diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-10-10 05:36:29 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:26:14 -0400 |
commit | be9eee2e8b87e335531a3ae13abb8d26e834c438 (patch) | |
tree | c9590e1b5b246cdbd1e8cd5bc2d314a86b11f814 /fs/smbfs/dir.c | |
parent | 0461ee2616252f1f6cec628990fa913a4282dcf7 (diff) |
smbfs: use dget_parent
Use dget_parent instead of opencoding it. This simplifies the code, but
more importanly prepares for the more complicated locking for a parent
dget in the dcache scale patch series.
Note that the d_time assignment in smb_renew_times moves out of d_lock,
but it's a single atomic 32-bit value, and that's what other sites
setting it do already.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/smbfs/dir.c')
-rw-r--r-- | fs/smbfs/dir.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c index 00a70cab1f3..f678d421e54 100644 --- a/fs/smbfs/dir.c +++ b/fs/smbfs/dir.c @@ -406,21 +406,15 @@ void smb_renew_times(struct dentry * dentry) { dget(dentry); - spin_lock(&dentry->d_lock); - for (;;) { - struct dentry *parent; + dentry->d_time = jiffies; - dentry->d_time = jiffies; - if (IS_ROOT(dentry)) - break; - parent = dentry->d_parent; - dget(parent); - spin_unlock(&dentry->d_lock); + while (!IS_ROOT(dentry)) { + struct dentry *parent = dget_parent(dentry); dput(dentry); dentry = parent; - spin_lock(&dentry->d_lock); + + dentry->d_time = jiffies; } - spin_unlock(&dentry->d_lock); dput(dentry); } |