mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[PATCH] lockdep: annotate dcache
Teach special (recursive) locking code to the lock validator. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
13e83599d2
commit
a90b9c05df
2 changed files with 14 additions and 2 deletions
|
@ -1339,10 +1339,10 @@ void d_move(struct dentry * dentry, struct dentry * target)
|
||||||
*/
|
*/
|
||||||
if (target < dentry) {
|
if (target < dentry) {
|
||||||
spin_lock(&target->d_lock);
|
spin_lock(&target->d_lock);
|
||||||
spin_lock(&dentry->d_lock);
|
spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
|
||||||
} else {
|
} else {
|
||||||
spin_lock(&dentry->d_lock);
|
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 */
|
/* Move the dentry to the target hash queue, if on different bucket */
|
||||||
|
|
|
@ -114,6 +114,18 @@ struct dentry {
|
||||||
unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
|
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 {
|
struct dentry_operations {
|
||||||
int (*d_revalidate)(struct dentry *, struct nameidata *);
|
int (*d_revalidate)(struct dentry *, struct nameidata *);
|
||||||
int (*d_hash) (struct dentry *, struct qstr *);
|
int (*d_hash) (struct dentry *, struct qstr *);
|
||||||
|
|
Loading…
Reference in a new issue