summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/sysfs.h
diff options
context:
space:
mode:
authorVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>2014-08-08 14:20:42 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 15:57:20 -0700
commitcaa05d49dfd7fe04820ba8b7e424343d5426a7f3 (patch)
treedb3d3a85b97d9cbedf982e323771c0f1ad634b5f /fs/nilfs2/sysfs.h
parentda7141fb78db915680616e15677539fc8140cf53 (diff)
downloadlinux-stable-caa05d49dfd7fe04820ba8b7e424343d5426a7f3.tar.gz
linux-stable-caa05d49dfd7fe04820ba8b7e424343d5426a7f3.tar.bz2
linux-stable-caa05d49dfd7fe04820ba8b7e424343d5426a7f3.zip
nilfs2: add /sys/fs/nilfs2/<device>/superblock group
This patch adds creation of /sys/fs/nilfs2/<device>/superblock group. The superblock group contains attributes that describe superblock's details: (1) sb_write_time - show previous write time of super block in human-readable format. (2) sb_write_time_secs - show previous write time of super block in seconds. (3) sb_write_count - show write count of super block. (4) sb_update_frequency - show/set interval of periodical update of superblock (in seconds). You can set preferable frequency of superblock update by command: echo <value> > /sys/fs/nilfs2/<device>/superblock/sb_update_frequency Signed-off-by: Vyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com> Cc: Vyacheslav Dubeyko <slava@dubeyko.com> Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: Michael L. Semon <mlsemon35@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/sysfs.h')
-rw-r--r--fs/nilfs2/sysfs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/nilfs2/sysfs.h b/fs/nilfs2/sysfs.h
index 2353b28c2796..1d76af59238c 100644
--- a/fs/nilfs2/sysfs.h
+++ b/fs/nilfs2/sysfs.h
@@ -24,6 +24,17 @@
#define NILFS_ROOT_GROUP_NAME "nilfs2"
+/*
+ * struct nilfs_sysfs_dev_subgroups - device subgroup kernel objects
+ * @sg_superblock_kobj: /sys/fs/<nilfs>/<device>/superblock
+ * @sg_superblock_kobj_unregister: completion state
+ */
+struct nilfs_sysfs_dev_subgroups {
+ /* /sys/fs/<nilfs>/<device>/superblock */
+ struct kobject sg_superblock_kobj;
+ struct completion sg_superblock_kobj_unregister;
+};
+
#define NILFS_COMMON_ATTR_STRUCT(name) \
struct nilfs_##name##_attr { \
struct attribute attr; \
@@ -45,6 +56,7 @@ struct nilfs_##name##_attr { \
};
NILFS_DEV_ATTR_STRUCT(dev);
+NILFS_DEV_ATTR_STRUCT(superblock);
#define NILFS_ATTR(type, name, mode, show, store) \
static struct nilfs_##type##_attr nilfs_##type##_attr_##name = \
@@ -73,9 +85,16 @@ NILFS_DEV_ATTR_STRUCT(dev);
#define NILFS_DEV_RW_ATTR(name) \
NILFS_RW_ATTR(dev, name)
+#define NILFS_SUPERBLOCK_RO_ATTR(name) \
+ NILFS_RO_ATTR(superblock, name)
+#define NILFS_SUPERBLOCK_RW_ATTR(name) \
+ NILFS_RW_ATTR(superblock, name)
+
#define NILFS_FEATURE_ATTR_LIST(name) \
(&nilfs_feature_attr_##name.attr)
#define NILFS_DEV_ATTR_LIST(name) \
(&nilfs_dev_attr_##name.attr)
+#define NILFS_SUPERBLOCK_ATTR_LIST(name) \
+ (&nilfs_superblock_attr_##name.attr)
#endif /* _NILFS_SYSFS_H */