VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / include / linux / sysfs.h
index 4cb5437..23f7838 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SYSFS_H_
 #define _SYSFS_H_
 
+#define SYSFS_SUPER_MAGIC      0x62656572
+
 struct kobject;
 struct module;
 
@@ -24,6 +26,27 @@ struct attribute_group {
 };
 
 
+
+/**
+ * Use these macros to make defining attributes easier. See include/linux/device.h
+ * for examples..
+ */
+
+#define __ATTR(_name,_mode,_show,_store) { \
+       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },     \
+       .show   = _show,                                        \
+       .store  = _store,                                       \
+}
+
+#define __ATTR_RO(_name) { \
+       .attr   = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE },   \
+       .show   = _name##_show, \
+}
+
+#define __ATTR_NULL { .attr = { .name = NULL } }
+
+#define attr_name(_attr) (_attr).attr.name
+
 struct bin_attribute {
        struct attribute        attr;
        size_t                  size;