diff options
| author | Jens Axboe <jens.axboe@oracle.com> | 2010-02-22 13:48:51 +0100 |
|---|---|---|
| committer | Jens Axboe <jens.axboe@oracle.com> | 2010-02-22 13:48:51 +0100 |
| commit | f11cbd74c5ff3614f6390b4de67a6ffdc614c378 (patch) | |
| tree | 6a30920ade9eeaac5bf6d6263b5d09712e882eb0 /fs/sysfs/sysfs.h | |
| parent | 429c42c9d246f5bda868495c09974312a0177328 (diff) | |
| parent | aea187c46f7d03ce985e55eb1398d0776a15b928 (diff) | |
Merge branch 'master' into for-2.6.34
Diffstat (limited to 'fs/sysfs/sysfs.h')
| -rw-r--r-- | fs/sysfs/sysfs.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index ca52e7b9d8f..cdd9377a6e0 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -8,6 +8,7 @@ * This file is released under the GPLv2. */ +#include <linux/lockdep.h> #include <linux/fs.h> struct sysfs_open_dirent; @@ -50,6 +51,9 @@ struct sysfs_inode_attrs { struct sysfs_dirent { atomic_t s_count; atomic_t s_active; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif struct sysfs_dirent *s_parent; struct sysfs_dirent *s_sibling; const char *s_name; @@ -84,6 +88,17 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd) return sd->s_flags & SYSFS_TYPE_MASK; } +#ifdef CONFIG_DEBUG_LOCK_ALLOC +#define sysfs_dirent_init_lockdep(sd) \ +do { \ + static struct lock_class_key __key; \ + \ + lockdep_init_map(&sd->dep_map, "s_active", &__key, 0); \ +} while(0) +#else +#define sysfs_dirent_init_lockdep(sd) do {} while(0) +#endif + /* * Context structure to be used while adding/removing nodes. */ |
