diff options
author | Vyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com> | 2014-08-08 17:20:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:20 -0400 |
commit | caa05d49dfd7fe04820ba8b7e424343d5426a7f3 (patch) | |
tree | db3d3a85b97d9cbedf982e323771c0f1ad634b5f /fs/nilfs2/the_nilfs.h | |
parent | da7141fb78db915680616e15677539fc8140cf53 (diff) |
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/the_nilfs.h')
-rw-r--r-- | fs/nilfs2/the_nilfs.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h index 34bc7bd57b0b..7fe822307f98 100644 --- a/fs/nilfs2/the_nilfs.h +++ b/fs/nilfs2/the_nilfs.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | 34 | ||
35 | struct nilfs_sc_info; | 35 | struct nilfs_sc_info; |
36 | struct nilfs_sysfs_dev_subgroups; | ||
36 | 37 | ||
37 | /* the_nilfs struct */ | 38 | /* the_nilfs struct */ |
38 | enum { | 39 | enum { |
@@ -54,6 +55,7 @@ enum { | |||
54 | * @ns_sbwcount: write count of super block | 55 | * @ns_sbwcount: write count of super block |
55 | * @ns_sbsize: size of valid data in super block | 56 | * @ns_sbsize: size of valid data in super block |
56 | * @ns_mount_state: file system state | 57 | * @ns_mount_state: file system state |
58 | * @ns_sb_update_freq: interval of periodical update of superblocks (in seconds) | ||
57 | * @ns_seg_seq: segment sequence counter | 59 | * @ns_seg_seq: segment sequence counter |
58 | * @ns_segnum: index number of the latest full segment. | 60 | * @ns_segnum: index number of the latest full segment. |
59 | * @ns_nextnum: index number of the full segment index to be used next | 61 | * @ns_nextnum: index number of the full segment index to be used next |
@@ -97,6 +99,7 @@ enum { | |||
97 | * @ns_crc_seed: seed value of CRC32 calculation | 99 | * @ns_crc_seed: seed value of CRC32 calculation |
98 | * @ns_dev_kobj: /sys/fs/<nilfs>/<device> | 100 | * @ns_dev_kobj: /sys/fs/<nilfs>/<device> |
99 | * @ns_dev_kobj_unregister: completion state | 101 | * @ns_dev_kobj_unregister: completion state |
102 | * @ns_dev_subgroups: <device> subgroups pointer | ||
100 | */ | 103 | */ |
101 | struct the_nilfs { | 104 | struct the_nilfs { |
102 | unsigned long ns_flags; | 105 | unsigned long ns_flags; |
@@ -116,6 +119,7 @@ struct the_nilfs { | |||
116 | unsigned ns_sbwcount; | 119 | unsigned ns_sbwcount; |
117 | unsigned ns_sbsize; | 120 | unsigned ns_sbsize; |
118 | unsigned ns_mount_state; | 121 | unsigned ns_mount_state; |
122 | unsigned ns_sb_update_freq; | ||
119 | 123 | ||
120 | /* | 124 | /* |
121 | * Following fields are dedicated to a writable FS-instance. | 125 | * Following fields are dedicated to a writable FS-instance. |
@@ -194,6 +198,7 @@ struct the_nilfs { | |||
194 | /* /sys/fs/<nilfs>/<device> */ | 198 | /* /sys/fs/<nilfs>/<device> */ |
195 | struct kobject ns_dev_kobj; | 199 | struct kobject ns_dev_kobj; |
196 | struct completion ns_dev_kobj_unregister; | 200 | struct completion ns_dev_kobj_unregister; |
201 | struct nilfs_sysfs_dev_subgroups *ns_dev_subgroups; | ||
197 | }; | 202 | }; |
198 | 203 | ||
199 | #define THE_NILFS_FNS(bit, name) \ | 204 | #define THE_NILFS_FNS(bit, name) \ |
@@ -260,7 +265,8 @@ struct nilfs_root { | |||
260 | static inline int nilfs_sb_need_update(struct the_nilfs *nilfs) | 265 | static inline int nilfs_sb_need_update(struct the_nilfs *nilfs) |
261 | { | 266 | { |
262 | u64 t = get_seconds(); | 267 | u64 t = get_seconds(); |
263 | return t < nilfs->ns_sbwtime || t > nilfs->ns_sbwtime + NILFS_SB_FREQ; | 268 | return t < nilfs->ns_sbwtime || |
269 | t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq; | ||
264 | } | 270 | } |
265 | 271 | ||
266 | static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs) | 272 | static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs) |