From 5d53cc023036178996a9cf2965103a6e20ca02ec Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 3 Jul 2006 00:25:04 -0700 Subject: [PATCH] --- yaml --- r: 31813 b: refs/heads/master c: a90b9c05df3c1e58eaedc28795d0f5abd896c098 h: refs/heads/master i: 31811: ac748fcfa555573aea1ad3a3ae8679e32b00667b v: v3 --- [refs] | 2 +- trunk/fs/dcache.c | 4 ++-- trunk/include/linux/dcache.h | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index b9f016f6c31e..89a35e36f356 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 13e83599d282ddfd544600df9db5ab343ac4662f +refs/heads/master: a90b9c05df3c1e58eaedc28795d0f5abd896c098 diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index bec4de176c81..1b4a3a34ec57 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -1339,10 +1339,10 @@ void d_move(struct dentry * dentry, struct dentry * target) */ if (target < dentry) { spin_lock(&target->d_lock); - spin_lock(&dentry->d_lock); + spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); } else { spin_lock(&dentry->d_lock); - spin_lock(&target->d_lock); + spin_lock_nested(&target->d_lock, DENTRY_D_LOCK_NESTED); } /* Move the dentry to the target hash queue, if on different bucket */ diff --git a/trunk/include/linux/dcache.h b/trunk/include/linux/dcache.h index 0dd1610a94a9..471781ffeab1 100644 --- a/trunk/include/linux/dcache.h +++ b/trunk/include/linux/dcache.h @@ -114,6 +114,18 @@ struct dentry { unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ }; +/* + * dentry->d_lock spinlock nesting subclasses: + * + * 0: normal + * 1: nested + */ +enum dentry_d_lock_class +{ + DENTRY_D_LOCK_NORMAL, /* implicitly used by plain spin_lock() APIs. */ + DENTRY_D_LOCK_NESTED +}; + struct dentry_operations { int (*d_revalidate)(struct dentry *, struct nameidata *); int (*d_hash) (struct dentry *, struct qstr *);