On Tue, Jun 14, 2022 at 12:08:37PM +1000, Imran Khan wrote:
> +static struct kernfs_open_node *
> +kernfs_deref_open_node(struct kernfs_open_file *of, struct kernfs_node *kn)
> +{
> + struct kernfs_open_node *on;
> + bool deref_ok;
> +
> + deref_ok = (of ? !list_empty(&of->list) : false) ||
> + lockdep_is_held(&kernfs_open_file_mutex);
> +
> + on = rcu_dereference_check(kn->attr.open, deref_ok);
> +
> + return on;
> +}
Hahahaha didn't know they'd be taking two different arguments. Sorry about
the many iterations but it'd probably be better to have two different
versions for the two argument types. Other than that, looks fine to me.
Thanks.
--
tejun
Hello Tejun,
On 14/6/22 1:19 pm, Tejun Heo wrote:
> On Tue, Jun 14, 2022 at 12:08:37PM +1000, Imran Khan wrote:
>> +static struct kernfs_open_node *
[...]
>
> Hahahaha didn't know they'd be taking two different arguments. Sorry about
> the many iterations but it'd probably be better to have two different
> versions for the two argument types. Other than that, looks fine to me.
>
No problem. I have made the changes in v6 (at [1]) to make use of 2 helpers
based on the arguments.
Thanks
-- Imran
[1]: https://lore.kernel.org/lkml/[email protected]/