|
@@ -15,6 +15,7 @@
|
|
#include <linux/compiler.h>
|
|
#include <linux/compiler.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/list.h>
|
|
#include <linux/list.h>
|
|
|
|
+#include <linux/lockdep.h>
|
|
#include <asm/atomic.h>
|
|
#include <asm/atomic.h>
|
|
|
|
|
|
struct kobject;
|
|
struct kobject;
|
|
@@ -29,8 +30,23 @@ struct attribute {
|
|
const char *name;
|
|
const char *name;
|
|
struct module *owner;
|
|
struct module *owner;
|
|
mode_t mode;
|
|
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 {
|
|
struct attribute_group {
|
|
const char *name;
|
|
const char *name;
|
|
mode_t (*is_visible)(struct kobject *,
|
|
mode_t (*is_visible)(struct kobject *,
|
|
@@ -74,6 +90,8 @@ struct bin_attribute {
|
|
struct vm_area_struct *vma);
|
|
struct vm_area_struct *vma);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr)
|
|
|
|
+
|
|
struct sysfs_ops {
|
|
struct sysfs_ops {
|
|
ssize_t (*show)(struct kobject *, struct attribute *,char *);
|
|
ssize_t (*show)(struct kobject *, struct attribute *,char *);
|
|
ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
|
|
ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
|