[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pkl: Remove global state from IOS
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] pkl: Remove global state from IOS |
Date: |
Mon, 20 Dec 2021 22:54:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Hi, Jose.
>
> On Mon, Dec 20, 2021 at 10:12:16PM +0100, Jose E. Marchesi wrote:
>>
>> > This patch removes global state from IOS by introducing a new struct
>> > `ios_meta`.
>>
>> I would much prefer to use the name `ios_context' for this type, or
>> `ios_ctx' if you want it shorter.
>
>
> OK.
>
>
>> > I changed `open` function pointer of `struct pk_iod_if` to be compatible
>> > with the rest of world. But user doesn't need (and should not care about
>> > this new first parameter). I don't like this new unused parameter here.
>> > WDYT?
>>
>> Huh, why would you want to pass the ios context to the IOD implementations?
>>
>
> TBH I don't want :)
>
> I think I can solve this problem by adding new field to `struct ios_dev_if`:
> void *userdata;
> And changing the `open` signature to have a new `void *userdata` param.
> Based on that I can call the right `open` function (specified by the user).
> WDYT?
Oh, so this is because the sub IOD uses calls like ios_search_by_id? If
that is the only IOD that needs such operations, it seems to me that it
may be better to handle it in a special way rather than "polluting" the
interface...
[PATCH v2 1/2] pkl: Add user_data in IO device API, Mohammad-Reza Nabipoor, 2021/12/23
[PATCH v4] pkl: Remove global state from IOS, Mohammad-Reza Nabipoor, 2021/12/28