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/<device>/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/<device> - group contains attributes that describe file
system partition's details
(4) /sys/fs/nilfs2/<device>/superblock - group contains attributes that describe
superblock's details
(5) /sys/fs/nilfs2/<device>/segctor - group contains attributes that describe
segctor thread activity details
(6) /sys/fs/nilfs2/<device>/segments - group contains attributes that describe
details about volume's segments
(7) /sys/fs/nilfs2/<device>/checkpoints - group contains attributes that describe
details about volume's checkpoints
(8) /sys/fs/nilfs2/<device>/mounted_snapshots - group contains group for every
mounted snapshot
(9) /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> - 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-<xxx> and
time-<xxx>-secs). One sysfs file (time-<xxx>) shows time in
human-readable format. Another sysfs file (time-<xxx>-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 <mlsemon35@gmail.com>
Signed-off-by: Vyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-09 05:20:37 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/features/revision
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
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" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/features group.
|
2014-08-09 05:20:39 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/revision
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show NILFS file system revision on volume.
|
|
|
|
This value informs about metadata structures'
|
|
|
|
revision on mounted volume.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/blocksize
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show volume's block size in bytes.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/device_size
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show volume size in bytes.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/free_blocks
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show count of free blocks on volume.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/uuid
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show volume's UUID (Universally Unique Identifier).
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/volume_name
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show volume's label.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/<device> group.
|
2014-08-09 05:20:42 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/superblock/sb_write_time
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show last write time of super block in human-readable
|
|
|
|
format.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/superblock/sb_write_time_secs
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show last write time of super block in seconds.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/superblock/sb_write_count
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show current write count of super block.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/superblock/sb_update_frequency
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show/Set interval of periodical update of superblock
|
|
|
|
(in seconds).
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/superblock/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/<device>/superblock
|
|
|
|
group.
|
2014-08-09 05:20:44 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_pseg_block
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show start block number of the latest segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_seg_sequence
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show sequence value of the latest segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_seg_checkpoint
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show checkpoint number of the latest segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/current_seg_sequence
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show segment sequence counter.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/current_last_full_seg
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show index number of the latest full segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/next_full_seg
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show index number of the full segment index
|
|
|
|
to be used next.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/next_pseg_offset
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show offset of next partial segment in the current
|
|
|
|
full segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/next_checkpoint
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show next checkpoint number.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_seg_write_time
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show write time of the last segment in
|
|
|
|
human-readable format.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_seg_write_time_secs
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show write time of the last segment in seconds.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_nongc_write_time
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show write time of the last segment not for cleaner
|
|
|
|
operation in human-readable format.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/last_nongc_write_time_secs
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show write time of the last segment not for cleaner
|
|
|
|
operation in seconds.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/dirty_data_blocks_count
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of dirty data blocks.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segctor/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/<device>/segctor
|
|
|
|
group.
|
2014-08-09 05:20:46 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segments/segments_number
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of segments on a volume.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segments/blocks_per_segment
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of blocks in segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segments/clean_segments
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show count of clean segments.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segments/dirty_segments
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show count of dirty segments.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/segments/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/<device>/segments
|
|
|
|
group.
|
2014-08-09 05:20:48 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/checkpoints/checkpoints_number
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of checkpoints on volume.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/checkpoints/snapshots_number
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of snapshots on volume.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/checkpoints/last_seg_checkpoint
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show checkpoint number of the latest segment.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/checkpoints/next_checkpoint
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show next checkpoint number.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/checkpoints/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/<device>/checkpoints
|
|
|
|
group.
|
2014-08-09 05:20:50 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/mounted_snapshots/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe content of /sys/fs/nilfs2/<device>/mounted_snapshots
|
|
|
|
group.
|
2014-08-09 05:20:52 +08:00
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/mounted_snapshots/<id>/inodes_count
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of inodes for snapshot.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/mounted_snapshots/<id>/blocks_count
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Show number of blocks for snapshot.
|
|
|
|
|
|
|
|
What: /sys/fs/nilfs2/<device>/mounted_snapshots/<id>/README
|
|
|
|
Date: April 2014
|
|
|
|
Contact: "Vyacheslav Dubeyko" <slava@dubeyko.com>
|
|
|
|
Description:
|
|
|
|
Describe attributes of /sys/fs/nilfs2/<device>/mounted_snapshots/<id>
|
|
|
|
group.
|