diff options
author | Vyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com> | 2014-08-08 14:20:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 15:57:20 -0700 |
commit | ef43d5cd84b7d2ea09846de34e14be7d74be3e6f (patch) | |
tree | 67163715eb9012e931f9a7eefafe59a71ad20401 /fs/nilfs2/sysfs.h | |
parent | abc968dbf291955ac750ecf59e3baf2b529a8257 (diff) | |
download | lwn-ef43d5cd84b7d2ea09846de34e14be7d74be3e6f.tar.gz lwn-ef43d5cd84b7d2ea09846de34e14be7d74be3e6f.zip |
nilfs2: add /sys/fs/nilfs2/<device>/segments group
This patch adds creation of /sys/fs/nilfs2/<device>/segments
group.
The segments group contains attributes that describe
details about volume's segments:
(1) segments_number - show number of segments on volume.
(2) blocks_per_segment - show number of blocks in segment.
(3) clean_segments - show count of clean segments.
(4) dirty_segments - show count of dirty segments.
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.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/nilfs2/sysfs.h b/fs/nilfs2/sysfs.h index ad4d5bcc16f5..228bdd14f945 100644 --- a/fs/nilfs2/sysfs.h +++ b/fs/nilfs2/sysfs.h @@ -30,6 +30,8 @@ * @sg_superblock_kobj_unregister: completion state * @sg_segctor_kobj: /sys/fs/<nilfs>/<device>/segctor * @sg_segctor_kobj_unregister: completion state + * @sg_segments_kobj: /sys/fs/<nilfs>/<device>/segments + * @sg_segments_kobj_unregister: completion state */ struct nilfs_sysfs_dev_subgroups { /* /sys/fs/<nilfs>/<device>/superblock */ @@ -39,6 +41,10 @@ struct nilfs_sysfs_dev_subgroups { /* /sys/fs/<nilfs>/<device>/segctor */ struct kobject sg_segctor_kobj; struct completion sg_segctor_kobj_unregister; + + /* /sys/fs/<nilfs>/<device>/segments */ + struct kobject sg_segments_kobj; + struct completion sg_segments_kobj_unregister; }; #define NILFS_COMMON_ATTR_STRUCT(name) \ @@ -62,6 +68,7 @@ struct nilfs_##name##_attr { \ }; NILFS_DEV_ATTR_STRUCT(dev); +NILFS_DEV_ATTR_STRUCT(segments); NILFS_DEV_ATTR_STRUCT(superblock); NILFS_DEV_ATTR_STRUCT(segctor); @@ -92,6 +99,11 @@ NILFS_DEV_ATTR_STRUCT(segctor); #define NILFS_DEV_RW_ATTR(name) \ NILFS_RW_ATTR(dev, name) +#define NILFS_SEGMENTS_RO_ATTR(name) \ + NILFS_RO_ATTR(segments, name) +#define NILFS_SEGMENTS_RW_ATTR(name) \ + NILFS_RW_ATTR(segs_info, name) + #define NILFS_SUPERBLOCK_RO_ATTR(name) \ NILFS_RO_ATTR(superblock, name) #define NILFS_SUPERBLOCK_RW_ATTR(name) \ @@ -108,6 +120,8 @@ NILFS_DEV_ATTR_STRUCT(segctor); (&nilfs_feature_attr_##name.attr) #define NILFS_DEV_ATTR_LIST(name) \ (&nilfs_dev_attr_##name.attr) +#define NILFS_SEGMENTS_ATTR_LIST(name) \ + (&nilfs_segments_attr_##name.attr) #define NILFS_SUPERBLOCK_ATTR_LIST(name) \ (&nilfs_superblock_attr_##name.attr) #define NILFS_SEGCTOR_ATTR_LIST(name) \ |