[PATCH 1/5] sysfs: add macro BIN_ATTR_ADMIN_WO()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The macros BIN_ATTR_RO/BIN_ATTR_WO/BIN_ATTR_WR and
BIN_ATTR_ADMIN_RO/BIN_ATTR_ADMIN_RW already exist.
To complete the collection also add BIN_ATTR_ADMIN_WO.

Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
 include/linux/sysfs.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 0f2fcd244523f050c5286f19d4fe1846506f9214..bcae49105e54a79b7d8a610f17212cb5920c205a 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -385,12 +385,18 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size)
 #define __BIN_ATTR_ADMIN_RO(_name, _size)				\
 	__BIN_ATTR(_name, 0400, _name##_read, NULL, _size)
 
+#define __BIN_ATTR_ADMIN_WO(_name, _size)				\
+	__BIN_ATTR(_name, 0200, NULL, _name##_write, _size)
+
 #define __BIN_ATTR_ADMIN_RW(_name, _size)					\
 	__BIN_ATTR(_name, 0600, _name##_read, _name##_write, _size)
 
 #define BIN_ATTR_ADMIN_RO(_name, _size)					\
 struct bin_attribute bin_attr_##_name = __BIN_ATTR_ADMIN_RO(_name, _size)
 
+#define BIN_ATTR_ADMIN_WO(_name, _size)					\
+struct bin_attribute bin_attr_##_name = __BIN_ATTR_ADMIN_WO(_name, _size)
+
 #define BIN_ATTR_ADMIN_RW(_name, _size)					\
 struct bin_attribute bin_attr_##_name = __BIN_ATTR_ADMIN_RW(_name, _size)
 

-- 
2.47.1





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux