Discussion:
[PATCH v2 0/9] nilfs2: introduce functionality of creation of sysfs groups and attributes
Vyacheslav Dubeyko
2014-04-18 16:07:20 UTC
Permalink
Hi,

This second version of patchset implements creation of
sysfs groups and attributes with the purpose to show
NILFS2 volume details and internal state of the driver.

v1->v2
* Improve human-readable format of timestamp output (Michael L. Semon)
* Fix issue with nilfs_sysfs_{create/delete}_snapshot_group (Michael L. Semon)

Implemented functionality creates such groups:

(1) /sys/fs/nilfs - root group
(2) /sys/fs/nilfs/features - group contains attributes that describe NILFS
file system driver features
(3) /sys/fs/nilfs/<device> - group contains attributes that describe file
system partition's details
(4) /sys/fs/nilfs/<device>/superblock - group contains attributes that describe
superblock's details
(5) /sys/fs/nilfs/<device>/segctor - group contains attributes that describe
segctor thread activity details
(6) /sys/fs/nilfs/<device>/segments - group contains attributes that describe
details about volume's segments
(7) /sys/fs/nilfs/<device>/checkpoints - group contains attributes that describe
details about volume's checkpoints
(8) /sys/fs/nilfs/<device>/mounted_snapshots - group contains group for every
mounted snapshot
(9) /sys/fs/nilfs/<device>/mounted_snapshots/<snapshot> - group contains
details about mounted snapshot

With the best regards,
Vyacheslav Dubeyko.
---
fs/nilfs2/Makefile | 2 +-
fs/nilfs2/nilfs.h | 8 +
fs/nilfs2/super.c | 9 +-
fs/nilfs2/sysfs.c | 1134 +++++++++++++++++++++++++++++++++++++++++++++++++
fs/nilfs2/sysfs.h | 174 ++++++++
fs/nilfs2/the_nilfs.c | 17 +-
fs/nilfs2/the_nilfs.h | 20 +-
7 files changed, 1360 insertions(+), 4 deletions(-)
--
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ryusuke Konishi
2014-04-20 16:18:25 UTC
Permalink
Hi Vyacheslav,
Post by Vyacheslav Dubeyko
Hi,
This second version of patchset implements creation of
sysfs groups and attributes with the purpose to show
NILFS2 volume details and internal state of the driver.
v1->v2
* Improve human-readable format of timestamp output (Michael L. Semon)
* Fix issue with nilfs_sysfs_{create/delete}_snapshot_group (Michael L. Semon)
(1) /sys/fs/nilfs - root group
(2) /sys/fs/nilfs/features - group contains attributes that describe NILFS
file system driver features
(3) /sys/fs/nilfs/<device> - group contains attributes that describe file
system partition's details
(4) /sys/fs/nilfs/<device>/superblock - group contains attributes that describe
superblock's details
(5) /sys/fs/nilfs/<device>/segctor - group contains attributes that describe
segctor thread activity details
(6) /sys/fs/nilfs/<device>/segments - group contains attributes that describe
details about volume's segments
(7) /sys/fs/nilfs/<device>/checkpoints - group contains attributes that describe
details about volume's checkpoints
(8) /sys/fs/nilfs/<device>/mounted_snapshots - group contains group for every
mounted snapshot
(9) /sys/fs/nilfs/<device>/mounted_snapshots/<snapshot> - group contains
details about mounted snapshot
Thank you for posting this series.

I am thinking of sending this series to upstream.

For that end, please clarify the motivation, the background, or the
issue what this series tries to solve within the cover letter ([PATCH
0/n]). I will refer to it when I will send the series to upstream.

Also, it's preferable to include a brief overview of this sysfs
interface in a Documentation file.

Some filesystems describe their sysfs interface in
Documentation/ABI/testing/sysfs-fs-xxx. Even though this sysfs
interface has description of ABI in README files, I think
documentation should be added in a similar manner to other
filesystems.

You chose "nilfs" instead of "nilfs2" as the filesystem name. This
may lead to discussion, but I also prefer "nilfs" because we
intentionally use the name "nilfs" in userland as the name separated
from implementation and this is the name of interface for users and
userland tools.

One my question is about the "device" name. Is it guaranteed that
every device has canonical single node name? What will happen for
devices such as /dev/mapper/xxx?

Thanks,
Ryusuke Konishi
Post by Vyacheslav Dubeyko
With the best regards,
Vyacheslav Dubeyko.
---
fs/nilfs2/Makefile | 2 +-
fs/nilfs2/nilfs.h | 8 +
fs/nilfs2/super.c | 9 +-
fs/nilfs2/sysfs.c | 1134 +++++++++++++++++++++++++++++++++++++++++++++++++
fs/nilfs2/sysfs.h | 174 ++++++++
fs/nilfs2/the_nilfs.c | 17 +-
fs/nilfs2/the_nilfs.h | 20 +-
7 files changed, 1360 insertions(+), 4 deletions(-)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vyacheslav Dubeyko
2014-04-21 12:14:23 UTC
Permalink
Hi Ryusuke,

On Mon, 2014-04-21 at 01:18 +0900, Ryusuke Konishi wrote:

[snip]
Post by Ryusuke Konishi
Thank you for posting this series.
I am thinking of sending this series to upstream.
For that end, please clarify the motivation, the background, or the
issue what this series tries to solve within the cover letter ([PATCH
0/n]). I will refer to it when I will send the series to upstream.
OK. I'll do it.
Post by Ryusuke Konishi
Also, it's preferable to include a brief overview of this sysfs
interface in a Documentation file.
Some filesystems describe their sysfs interface in
Documentation/ABI/testing/sysfs-fs-xxx. Even though this sysfs
interface has description of ABI in README files, I think
documentation should be added in a similar manner to other
filesystems.
Yes, I agree. It makes sense. I'll add the description.
Post by Ryusuke Konishi
You chose "nilfs" instead of "nilfs2" as the filesystem name. This
may lead to discussion, but I also prefer "nilfs" because we
intentionally use the name "nilfs" in userland as the name separated
from implementation and this is the name of interface for users and
userland tools.
One my question is about the "device" name. Is it guaranteed that
every device has canonical single node name? What will happen for
devices such as /dev/mapper/xxx?
I need to check it. I am not ready to answer right now.

Thanks,
Vyacheslav Dubeyko.


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vyacheslav Dubeyko
2014-04-29 14:50:50 UTC
Permalink
Hi Ryusuke,
Post by Ryusuke Konishi
One my question is about the "device" name. Is it guaranteed that
every device has canonical single node name? What will happen for
devices such as /dev/mapper/xxx?
I've checked this by means of using kpartx utility. At first I've
prepared the image with several partitions on it. Then I've created
device maps from partition table:

kpartx -va ./<image-file>

As a result, I can see such situation:

ls -lah /dev/mapper/
total 0
drwxr-xr-x 2 root root 120 Apr 29 18:38 .
drwxr-xr-x 16 root root 4.2K Apr 29 18:38 ..
crw------- 1 root root 10, 236 Apr 29 09:58 control
lrwxrwxrwx 1 root root 7 Apr 29 18:38 loop0p1 -> ../dm-0
lrwxrwxrwx 1 root root 7 Apr 29 18:38 loop0p2 -> ../dm-1
lrwxrwxrwx 1 root root 7 Apr 29 18:38 loop0p3 -> ../dm-2

Finally, namely, dm-0 (and so on) is used as name of device during
creation of /sys/fs/nilfs2/<device> group. Moreover, other file systems
are used sb->s_id for device naming too. I think that it is safe way of
device naming.

With the best regards,
Vyacheslav Dubeyko.


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...