From aebe17f6844488ff0b824fbac28d9f342f7b078e Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:37 -0700 Subject: nilfs2: add /sys/fs/nilfs2/features group This patchset implements creation of sysfs groups and attributes with the purpose to show NILFS2 volume details, internal state of the driver and to manage internal state of NILFS2 driver. Sysfs is a virtual file system that exports information about devices and drivers from the kernel device model to user space, and is also used for configuration. NILFS2 is a complex file system that has segctor thread, GC thread, checkpoint/snapshot model and so on. Sysfs namespace provides native and easy way for: (1) getting info and statistics about volume state; (2) getting info and configuration of internal subsystems (segctor thread); (3) snapshots management. Suggested patchset provides basis for managing segctor thread behaviour and manipulation by snapshots. Currently, it informs only about segctor thread's internal parameters and about mounted snapshots. But sysfs interface can provide easy and simple way for deep management of segctor thread and snapshots. This patchset provides opportunity to manage interval of periodical update of superblock (in seconds). Default value is 10 seconds. Now a user can increase this value by means of nilfs2//superblock/sb_update_frequency attribute in the case of necessity. Also the patchset provides opportunity to get information easily about key volumes's parameters (free blocks, superblock write count, superblock update frequency, latest segment info, dirty data blocks count, count of clean segments, count of dirty segments and so on) in real time manner. Such information can be used in scripts for subtle management of filesystem. Implemented functionality creates such groups: (1) /sys/fs/nilfs2 - root group (2) /sys/fs/nilfs2/features - group contains attributes that describe NILFS file system driver features (3) /sys/fs/nilfs2/ - group contains attributes that describe file system partition's details (4) /sys/fs/nilfs2//superblock - group contains attributes that describe superblock's details (5) /sys/fs/nilfs2//segctor - group contains attributes that describe segctor thread activity details (6) /sys/fs/nilfs2//segments - group contains attributes that describe details about volume's segments (7) /sys/fs/nilfs2//checkpoints - group contains attributes that describe details about volume's checkpoints (8) /sys/fs/nilfs2//mounted_snapshots - group contains group for every mounted snapshot (9) /sys/fs/nilfs2//mounted_snapshots/ - group contains details about mounted snapshot This patch (of 9): This patch adds code of creation /sys/fs/nilfs2 group and /sys/fs/nilfs2/features group. The features group contains attributes that describe NILFS file system driver features: (1) revision - show current revision of NILFS file system driver. There are two formats of timestamp output - seconds and human-readable format. Every showed timestamp has two sysfs files (time- and time--secs). One sysfs file (time-) shows time in human-readable format. Another sysfs file (time--secs) shows time in seconds. It was reported by Michael Semon that timestamp output in human-readable format should be changed from "2014-4-12 14:5:38" to "2014-04-12 14:05:38". Second version of the patch fixes this issue. Reported-by: Michael L. Semon Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-fs-nilfs2 (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 new file mode 100644 index 000000000000..71b4fd39f74d --- /dev/null +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -0,0 +1,14 @@ + +What: /sys/fs/nilfs2/features/revision +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show current revision of NILFS file system driver. + This value informs about file system revision that + driver is ready to support. + +What: /sys/fs/nilfs2/features/README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2/features group. -- cgit v1.2.3 From da7141fb78db915680616e15677539fc8140cf53 Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:39 -0700 Subject: nilfs2: add /sys/fs/nilfs2/ group This patch adds creation of /sys/fs/nilfs2/ group. The group contains attributes that describe file system partition's details: (1) revision - show NILFS file system revision. (2) blocksize - show volume block size in bytes. (3) device_size - show volume size in bytes. (4) free_blocks - show count of free blocks on volume. (5) uuid - show volume's UUID. (6) volume_name - show volume's name. Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index 71b4fd39f74d..0a521d03539a 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -12,3 +12,47 @@ Date: April 2014 Contact: "Vyacheslav Dubeyko" Description: Describe attributes of /sys/fs/nilfs2/features group. + +What: /sys/fs/nilfs2//revision +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show NILFS file system revision on volume. + This value informs about metadata structures' + revision on mounted volume. + +What: /sys/fs/nilfs2//blocksize +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show volume's block size in bytes. + +What: /sys/fs/nilfs2//device_size +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show volume size in bytes. + +What: /sys/fs/nilfs2//free_blocks +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show count of free blocks on volume. + +What: /sys/fs/nilfs2//uuid +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show volume's UUID (Universally Unique Identifier). + +What: /sys/fs/nilfs2//volume_name +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show volume's label. + +What: /sys/fs/nilfs2//README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2/ group. -- cgit v1.2.3 From caa05d49dfd7fe04820ba8b7e424343d5426a7f3 Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:42 -0700 Subject: nilfs2: add /sys/fs/nilfs2//superblock group This patch adds creation of /sys/fs/nilfs2//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 > /sys/fs/nilfs2//superblock/sb_update_frequency Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index 0a521d03539a..e9b4c61aa88a 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -56,3 +56,36 @@ Date: April 2014 Contact: "Vyacheslav Dubeyko" Description: Describe attributes of /sys/fs/nilfs2/ group. + +What: /sys/fs/nilfs2//superblock/sb_write_time +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show last write time of super block in human-readable + format. + +What: /sys/fs/nilfs2//superblock/sb_write_time_secs +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show last write time of super block in seconds. + +What: /sys/fs/nilfs2//superblock/sb_write_count +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show current write count of super block. + +What: /sys/fs/nilfs2//superblock/sb_update_frequency +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show/Set interval of periodical update of superblock + (in seconds). + +What: /sys/fs/nilfs2//superblock/README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2//superblock + group. -- cgit v1.2.3 From abc968dbf291955ac750ecf59e3baf2b529a8257 Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:44 -0700 Subject: nilfs2: add /sys/fs/nilfs2//segctor group This patch adds creation of /sys/fs/nilfs2//segctor group. The segctor group contains attributes that describe segctor thread activity details: (1) last_pseg_block - show start block number of the latest segment. (2) last_seg_sequence - show sequence value of the latest segment. (3) last_seg_checkpoint - show checkpoint number of the latest segment. (4) current_seg_sequence - show segment sequence counter. (5) current_last_full_seg - show index number of the latest full segment. (6) next_full_seg - show index number of the full segment index to be used next. (7) next_pseg_offset - show offset of next partial segment in the current full segment. (8) next_checkpoint - show next checkpoint number. (9) last_seg_write_time - show write time of the last segment in human-readable format. (10) last_seg_write_time_secs - show write time of the last segment in seconds. (11) last_nongc_write_time - show write time of the last segment not for cleaner operation in human-readable format. (12) last_nongc_write_time_secs - show write time of the last segment not for cleaner operation in seconds. (13) dirty_data_blocks_count - show number of dirty data blocks. Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index e9b4c61aa88a..c9952f4071e7 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -89,3 +89,93 @@ Contact: "Vyacheslav Dubeyko" Description: Describe attributes of /sys/fs/nilfs2//superblock group. + +What: /sys/fs/nilfs2//segctor/last_pseg_block +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show start block number of the latest segment. + +What: /sys/fs/nilfs2//segctor/last_seg_sequence +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show sequence value of the latest segment. + +What: /sys/fs/nilfs2//segctor/last_seg_checkpoint +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show checkpoint number of the latest segment. + +What: /sys/fs/nilfs2//segctor/current_seg_sequence +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show segment sequence counter. + +What: /sys/fs/nilfs2//segctor/current_last_full_seg +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show index number of the latest full segment. + +What: /sys/fs/nilfs2//segctor/next_full_seg +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show index number of the full segment index + to be used next. + +What: /sys/fs/nilfs2//segctor/next_pseg_offset +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show offset of next partial segment in the current + full segment. + +What: /sys/fs/nilfs2//segctor/next_checkpoint +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show next checkpoint number. + +What: /sys/fs/nilfs2//segctor/last_seg_write_time +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show write time of the last segment in + human-readable format. + +What: /sys/fs/nilfs2//segctor/last_seg_write_time_secs +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show write time of the last segment in seconds. + +What: /sys/fs/nilfs2//segctor/last_nongc_write_time +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show write time of the last segment not for cleaner + operation in human-readable format. + +What: /sys/fs/nilfs2//segctor/last_nongc_write_time_secs +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show write time of the last segment not for cleaner + operation in seconds. + +What: /sys/fs/nilfs2//segctor/dirty_data_blocks_count +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of dirty data blocks. + +What: /sys/fs/nilfs2//segctor/README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2//segctor + group. -- cgit v1.2.3 From ef43d5cd84b7d2ea09846de34e14be7d74be3e6f Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:46 -0700 Subject: nilfs2: add /sys/fs/nilfs2//segments group This patch adds creation of /sys/fs/nilfs2//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 Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index c9952f4071e7..d39e0768171e 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -179,3 +179,34 @@ Contact: "Vyacheslav Dubeyko" Description: Describe attributes of /sys/fs/nilfs2//segctor group. + +What: /sys/fs/nilfs2//segments/segments_number +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of segments on a volume. + +What: /sys/fs/nilfs2//segments/blocks_per_segment +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of blocks in segment. + +What: /sys/fs/nilfs2//segments/clean_segments +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show count of clean segments. + +What: /sys/fs/nilfs2//segments/dirty_segments +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show count of dirty segments. + +What: /sys/fs/nilfs2//segments/README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2//segments + group. -- cgit v1.2.3 From 02a0ba1c60c2ad532322089a60256c8b0f46678c Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:48 -0700 Subject: nilfs2: add /sys/fs/nilfs2//checkpoints group This patch adds creation of /sys/fs/nilfs2//checkpoints group. The checkpoints group contains attributes that describe details about volume's checkpoints: (1) checkpoints_number - show number of checkpoints on volume. (2) snapshots_number - show number of snapshots on volume. (3) last_seg_checkpoint - show checkpoint number of the latest segment. (4) next_checkpoint - show next checkpoint number. Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index d39e0768171e..7b820d65d3f0 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -210,3 +210,34 @@ Contact: "Vyacheslav Dubeyko" Description: Describe attributes of /sys/fs/nilfs2//segments group. + +What: /sys/fs/nilfs2//checkpoints/checkpoints_number +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of checkpoints on volume. + +What: /sys/fs/nilfs2//checkpoints/snapshots_number +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of snapshots on volume. + +What: /sys/fs/nilfs2//checkpoints/last_seg_checkpoint +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show checkpoint number of the latest segment. + +What: /sys/fs/nilfs2//checkpoints/next_checkpoint +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show next checkpoint number. + +What: /sys/fs/nilfs2//checkpoints/README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2//checkpoints + group. -- cgit v1.2.3 From a2ecb791a9d6e71a2d37d66034475a92ebc7e02c Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:50 -0700 Subject: nilfs2: add /sys/fs/nilfs2//mounted_snapshots group This patch adds creation of /sys/fs/nilfs2//mounted_snapshots group. The mounted_snapshots group contains group for every mounted snapshot. Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index 7b820d65d3f0..29dbc8f8bcbd 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -241,3 +241,10 @@ Contact: "Vyacheslav Dubeyko" Description: Describe attributes of /sys/fs/nilfs2//checkpoints group. + +What: /sys/fs/nilfs2//mounted_snapshots/README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe content of /sys/fs/nilfs2//mounted_snapshots + group. -- cgit v1.2.3 From a5a7332a291b55beb0863b119816d12ffc04dfb0 Mon Sep 17 00:00:00 2001 From: Vyacheslav Dubeyko Date: Fri, 8 Aug 2014 14:20:52 -0700 Subject: nilfs2: add /sys/fs/nilfs2//mounted_snapshots/ group This patch adds creation of group for every mounted snapshot in /sys/fs/nilfs2//mounted_snapshots group. The group contains details about mounted snapshot: (1) inodes_count - show number of inodes for snapshot. (2) blocks_count - show number of blocks for snapshot. Signed-off-by: Vyacheslav Dubeyko Cc: Vyacheslav Dubeyko Cc: Ryusuke Konishi Cc: Michael L. Semon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/ABI/testing/sysfs-fs-nilfs2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Documentation/ABI') diff --git a/Documentation/ABI/testing/sysfs-fs-nilfs2 b/Documentation/ABI/testing/sysfs-fs-nilfs2 index 29dbc8f8bcbd..304ba84a973a 100644 --- a/Documentation/ABI/testing/sysfs-fs-nilfs2 +++ b/Documentation/ABI/testing/sysfs-fs-nilfs2 @@ -248,3 +248,22 @@ Contact: "Vyacheslav Dubeyko" Description: Describe content of /sys/fs/nilfs2//mounted_snapshots group. + +What: /sys/fs/nilfs2//mounted_snapshots//inodes_count +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of inodes for snapshot. + +What: /sys/fs/nilfs2//mounted_snapshots//blocks_count +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Show number of blocks for snapshot. + +What: /sys/fs/nilfs2//mounted_snapshots//README +Date: April 2014 +Contact: "Vyacheslav Dubeyko" +Description: + Describe attributes of /sys/fs/nilfs2//mounted_snapshots/ + group. -- cgit v1.2.3