[Top][All Lists]

[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).

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]