mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Imran Khan <imran.f.khan@oracle.com>
Cc: gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/4] kernfs: make ->attr.open RCU protected.
Date: Mon, 13 Jun 2022 17:19:03 -1000	[thread overview]
Message-ID: <Yqf+J/P1/24i6rN9@slm.duckdns.org> (raw)
In-Reply-To: <20220614020840.546013-2-imran.f.khan@oracle.com>

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

  reply	other threads:[~2022-06-14  3:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14  2:08 [PATCH v5 0/4] " Imran Khan
2022-06-14  2:08 ` [PATCH v5 1/4] " Imran Khan
2022-06-14  3:19   ` Tejun Heo [this message]
2022-06-14  7:20     ` Imran Khan
2022-06-14  2:08 ` [PATCH v5 2/4] kernfs: Change kernfs_notify_list to llist Imran Khan
2022-06-14  2:08 ` [PATCH v5 3/4] kernfs: Introduce interface to access global kernfs_open_file_mutex Imran Khan
2022-06-14  2:08 ` [PATCH v5 4/4] kernfs: Replace global kernfs_open_file_mutex with hashed mutexes Imran Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yqf+J/P1/24i6rN9@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=imran.f.khan@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®