diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-01-16 21:21:04 +0000 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-01-16 21:21:04 +0000 |
commit | f652f6c5b7cfdf139f4155d78f397e99ae1c4acc (patch) | |
tree | 71c6344688bf56ea6aaf18c586ab69ff4f077ade /fs/ocfs2/dcache.c | |
parent | 140e3008e7fe1526cbb12f8f07dbc273ac713b75 (diff) | |
parent | c66ac9db8d4ad9994a02b3e933ea2ccc643e1fe5 (diff) | |
download | kernel_goldelico_gta04-f652f6c5b7cfdf139f4155d78f397e99ae1c4acc.zip kernel_goldelico_gta04-f652f6c5b7cfdf139f4155d78f397e99ae1c4acc.tar.gz kernel_goldelico_gta04-f652f6c5b7cfdf139f4155d78f397e99ae1c4acc.tar.bz2 |
Merge branch 'master' of /pub/scm/linux/kernel/git/jejb/scsi-post-merge-2.6 into for-linus
Diffstat (limited to 'fs/ocfs2/dcache.c')
-rw-r--r-- | fs/ocfs2/dcache.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index 895532ac..6d80ecc 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -52,9 +52,15 @@ void ocfs2_dentry_attach_gen(struct dentry *dentry) static int ocfs2_dentry_revalidate(struct dentry *dentry, struct nameidata *nd) { - struct inode *inode = dentry->d_inode; + struct inode *inode; int ret = 0; /* if all else fails, just return false */ - struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb); + struct ocfs2_super *osb; + + if (nd->flags & LOOKUP_RCU) + return -ECHILD; + + inode = dentry->d_inode; + osb = OCFS2_SB(dentry->d_sb); mlog_entry("(0x%p, '%.*s')\n", dentry, dentry->d_name.len, dentry->d_name.name); @@ -169,23 +175,25 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode, struct list_head *p; struct dentry *dentry = NULL; - spin_lock(&dcache_lock); - + spin_lock(&inode->i_lock); list_for_each(p, &inode->i_dentry) { dentry = list_entry(p, struct dentry, d_alias); + spin_lock(&dentry->d_lock); if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { mlog(0, "dentry found: %.*s\n", dentry->d_name.len, dentry->d_name.name); - dget_locked(dentry); + dget_dlock(dentry); + spin_unlock(&dentry->d_lock); break; } + spin_unlock(&dentry->d_lock); dentry = NULL; } - spin_unlock(&dcache_lock); + spin_unlock(&inode->i_lock); return dentry; } |