diff options
| -rw-r--r-- | fs/dcache.c | 4 | ||||
| -rw-r--r-- | include/linux/dcache.h | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index bec4de176c81..1b4a3a34ec57 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
| @@ -1339,10 +1339,10 @@ void d_move(struct dentry * dentry, struct dentry * target) | |||
| 1339 | */ | 1339 | */ |
| 1340 | if (target < dentry) { | 1340 | if (target < dentry) { |
| 1341 | spin_lock(&target->d_lock); | 1341 | spin_lock(&target->d_lock); |
| 1342 | spin_lock(&dentry->d_lock); | 1342 | spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); |
| 1343 | } else { | 1343 | } else { |
| 1344 | spin_lock(&dentry->d_lock); | 1344 | spin_lock(&dentry->d_lock); |
| 1345 | spin_lock(&target->d_lock); | 1345 | spin_lock_nested(&target->d_lock, DENTRY_D_LOCK_NESTED); |
| 1346 | } | 1346 | } |
| 1347 | 1347 | ||
| 1348 | /* Move the dentry to the target hash queue, if on different bucket */ | 1348 | /* Move the dentry to the target hash queue, if on different bucket */ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 0dd1610a94a9..471781ffeab1 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -114,6 +114,18 @@ struct dentry { | |||
| 114 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ | 114 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | /* | ||
| 118 | * dentry->d_lock spinlock nesting subclasses: | ||
| 119 | * | ||
| 120 | * 0: normal | ||
| 121 | * 1: nested | ||
| 122 | */ | ||
| 123 | enum dentry_d_lock_class | ||
| 124 | { | ||
| 125 | DENTRY_D_LOCK_NORMAL, /* implicitly used by plain spin_lock() APIs. */ | ||
| 126 | DENTRY_D_LOCK_NESTED | ||
| 127 | }; | ||
| 128 | |||
| 117 | struct dentry_operations { | 129 | struct dentry_operations { |
| 118 | int (*d_revalidate)(struct dentry *, struct nameidata *); | 130 | int (*d_revalidate)(struct dentry *, struct nameidata *); |
| 119 | int (*d_hash) (struct dentry *, struct qstr *); | 131 | int (*d_hash) (struct dentry *, struct qstr *); |
