Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / include / linux / sysfs.h
index f97d0db..ddad161 100644 (file)
@@ -70,6 +70,8 @@ struct attribute_group {
  * for examples..
  */
 
+#define SYSFS_PREALLOC 010000
+
 #define __ATTR(_name, _mode, _show, _store) {                          \
        .attr = {.name = __stringify(_name),                            \
                 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },             \
@@ -77,6 +79,13 @@ struct attribute_group {
        .store  = _store,                                               \
 }
 
+#define __ATTR_PREALLOC(_name, _mode, _show, _store) {                 \
+       .attr = {.name = __stringify(_name),                            \
+                .mode = SYSFS_PREALLOC | VERIFY_OCTAL_PERMISSIONS(_mode) },\
+       .show   = _show,                                                \
+       .store  = _store,                                               \
+}
+
 #define __ATTR_RO(_name) {                                             \
        .attr   = { .name = __stringify(_name), .mode = S_IRUGO },      \
        .show   = _name##_show,                                         \