From: Waiman Long <Waiman.Long@hp.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Waiman Long <Waiman.Long@hp.com>
Subject: [PATCH] dcache: use read_seqlock_excl() in d_set_mounted()
Date: Wed, 13 Aug 2014 15:15:50 -0400 [thread overview]
Message-ID: <1407957350-37783-1-git-send-email-Waiman.Long@hp.com> (raw)
The d_set_mounted() doesn't change anything in the filesystem other
than setting the DCACHE_MOUNTED flag in the mount point's dentry
which is protected by d_lock anyway. So we can safely replace
write_seqlock/write_sequnlock by read_seqlock_excl/read_sequnlock_excl.
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
fs/dcache.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index 06f6585..bfdd8af 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1207,7 +1207,7 @@ int d_set_mounted(struct dentry *dentry)
{
struct dentry *p;
int ret = -ENOENT;
- write_seqlock(&rename_lock);
+ read_seqlock_excl(&rename_lock);
for (p = dentry->d_parent; !IS_ROOT(p); p = p->d_parent) {
/* Need exclusion wrt. check_submounts_and_drop() */
spin_lock(&p->d_lock);
@@ -1224,7 +1224,7 @@ int d_set_mounted(struct dentry *dentry)
}
spin_unlock(&dentry->d_lock);
out:
- write_sequnlock(&rename_lock);
+ read_sequnlock_excl(&rename_lock);
return ret;
}
--
1.7.1
reply other threads:[~2014-08-13 19:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1407957350-37783-1-git-send-email-Waiman.Long@hp.com \
--to=waiman.long@hp.com \
--cc=linux-fsdevel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).