lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 1/4] kernfs: make ->attr.open RCU protected.
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

\
 
 \ /
  Last update: 2022-06-14 05:20    [W:0.118 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site