Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187085
b: refs/heads/master
c: 6992f53
h: refs/heads/master
i:
  187083: d02f516
v: v3
  • Loading branch information
Eric W. Biederman authored and Greg Kroah-Hartman committed Mar 8, 2010
1 parent 9ed3ea2 commit 33c8324
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2db6842873c8e5a70652f278d469128cb52db70
refs/heads/master: 6992f5334995af474c2b58d010d08bc597f0f2fe
7 changes: 5 additions & 2 deletions trunk/fs/sysfs/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
#ifdef CONFIG_DEBUG_LOCK_ALLOC
#define sysfs_dirent_init_lockdep(sd) \
do { \
static struct lock_class_key __key; \
struct attribute *attr = sd->s_attr.attr; \
struct lock_class_key *key = attr->key; \
if (!key) \
key = &attr->skey; \
\
lockdep_init_map(&sd->dep_map, "s_active", &__key, 0); \
lockdep_init_map(&sd->dep_map, "s_active", key, 0); \
} while(0)
#else
#define sysfs_dirent_init_lockdep(sd) do {} while(0)
Expand Down
18 changes: 18 additions & 0 deletions trunk/include/linux/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/lockdep.h>
#include <asm/atomic.h>

struct kobject;
Expand All @@ -29,8 +30,23 @@ struct attribute {
const char *name;
struct module *owner;
mode_t mode;
#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lock_class_key *key;
struct lock_class_key skey;
#endif
};

#ifdef CONFIG_DEBUG_LOCK_ALLOC
#define sysfs_attr_init(attr) \
do { \
static struct lock_class_key __key; \
\
(attr)->key = &__key; \
} while(0)
#else
#define sysfs_attr_init(attr) do {} while(0)
#endif

struct attribute_group {
const char *name;
mode_t (*is_visible)(struct kobject *,
Expand Down Expand Up @@ -74,6 +90,8 @@ struct bin_attribute {
struct vm_area_struct *vma);
};

#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr)

struct sysfs_ops {
ssize_t (*show)(struct kobject *, struct attribute *,char *);
ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
Expand Down

0 comments on commit 33c8324

Please sign in to comment.