Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b1d9aa4e9c5cafe73b9df21d758b50b5d75264d
Commit:     9b1d9aa4e9c5cafe73b9df21d758b50b5d75264d
Parent:     4c62b53454a83178676e5ecae6665447d363c7b4
Author:     Satyam Sharma <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 4 16:37:06 2007 +0530
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 16:52:27 2007 -0700

    [PATCH] configfs+dlm: Separate out __CONFIGFS_ATTR into configfs.h
    
    fs/dlm/config.c contains a useful generic macro called __CONFIGFS_ATTR
    that is similar to sysfs' __ATTR macro that makes defining attributes
    easy for any user of configfs. Separate it out into configfs.h so that
    other users (forthcoming in dynamic netconsole patchset) can use it too.
    
    Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
    Cc: David Teigland <[EMAIL PROTECTED]>
    Signed-off-by: Joel Becker <[EMAIL PROTECTED]>
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/dlm/config.c          |    8 --------
 include/linux/configfs.h |   16 ++++++++++++++++
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 5069b2c..e47eb42 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -133,14 +133,6 @@ static ssize_t cluster_set(struct cluster *cl, unsigned 
int *cl_field,
        return len;
 }
 
-#define __CONFIGFS_ATTR(_name,_mode,_read,_write) {                           \
-       .attr   = { .ca_name = __stringify(_name),                            \
-                   .ca_mode = _mode,                                         \
-                   .ca_owner = THIS_MODULE },                                \
-       .show   = _read,                                                      \
-       .store  = _write,                                                     \
-}
-
 #define CLUSTER_ATTR(name, check_zero)                                        \
 static ssize_t name##_write(struct cluster *cl, const char *buf, size_t len)  \
 {                                                                             \
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 3d4a96e..def7c83 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -130,6 +130,22 @@ struct configfs_attribute {
        mode_t                  ca_mode;
 };
 
+/*
+ * Users often need to create attribute structures for their configurable
+ * attributes, containing a configfs_attribute member and function pointers
+ * for the show() and store() operations on that attribute. They can use
+ * this macro (similar to sysfs' __ATTR) to make defining attributes easier.
+ */
+#define __CONFIGFS_ATTR(_name, _mode, _show, _store)                   \
+{                                                                      \
+       .attr   = {                                                     \
+                       .ca_name = __stringify(_name),                  \
+                       .ca_mode = _mode,                               \
+                       .ca_owner = THIS_MODULE,                        \
+       },                                                              \
+       .show   = _show,                                                \
+       .store  = _store,                                               \
+}
 
 /*
  * If allow_link() exists, the item can symlink(2) out to other
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to