linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: add fs_info generation to sysfs
@ 2020-10-07  7:20 Anand Jain
  2020-10-07  7:50 ` Nikolay Borisov
  2020-10-14 11:35 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2020-10-07  7:20 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, Anand Jain

Matching with the information that's available from the ioctl
BTRFS_IOC_FS_INFO, this patch adds generation to the sysfs.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/sysfs.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 279d9262b676..8424f5d0e5ed 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -854,6 +854,15 @@ static ssize_t btrfs_exclusive_operation_show(struct kobject *kobj,
 }
 BTRFS_ATTR(, exclusive_operation, btrfs_exclusive_operation_show);
 
+static ssize_t btrfs_generation_show(struct kobject *kobj,
+				     struct kobj_attribute *a, char *buf)
+{
+	struct btrfs_fs_info *fs_info = to_fs_info(kobj);
+
+	return scnprintf(buf, PAGE_SIZE, "%llu\n", fs_info->generation);
+}
+BTRFS_ATTR(, generation, btrfs_generation_show);
+
 static const struct attribute *btrfs_attrs[] = {
 	BTRFS_ATTR_PTR(, label),
 	BTRFS_ATTR_PTR(, nodesize),
@@ -863,6 +872,7 @@ static const struct attribute *btrfs_attrs[] = {
 	BTRFS_ATTR_PTR(, metadata_uuid),
 	BTRFS_ATTR_PTR(, checksum),
 	BTRFS_ATTR_PTR(, exclusive_operation),
+	BTRFS_ATTR_PTR(, generation),
 	NULL,
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: add fs_info generation to sysfs
  2020-10-07  7:20 [PATCH] btrfs: add fs_info generation to sysfs Anand Jain
@ 2020-10-07  7:50 ` Nikolay Borisov
  2020-10-12 15:51   ` David Sterba
  2020-10-14 11:35 ` David Sterba
  1 sibling, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2020-10-07  7:50 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs; +Cc: dsterba



On 7.10.20 г. 10:20 ч., Anand Jain wrote:
> Matching with the information that's available from the ioctl
> BTRFS_IOC_FS_INFO, this patch adds generation to the sysfs.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>


What problem are you trying to solve?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: add fs_info generation to sysfs
  2020-10-07  7:50 ` Nikolay Borisov
@ 2020-10-12 15:51   ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2020-10-12 15:51 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: Anand Jain, linux-btrfs, dsterba

On Wed, Oct 07, 2020 at 10:50:27AM +0300, Nikolay Borisov wrote:
> 
> 
> On 7.10.20 г. 10:20 ч., Anand Jain wrote:
> > Matching with the information that's available from the ioctl
> > BTRFS_IOC_FS_INFO, this patch adds generation to the sysfs.
> > 
> > Signed-off-by: Anand Jain <anand.jain@oracle.com>
> 
> What problem are you trying to solve?

Parity of FS_INFO ioctl and sysfs exports.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: add fs_info generation to sysfs
  2020-10-07  7:20 [PATCH] btrfs: add fs_info generation to sysfs Anand Jain
  2020-10-07  7:50 ` Nikolay Borisov
@ 2020-10-14 11:35 ` David Sterba
  1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2020-10-14 11:35 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs, dsterba

On Wed, Oct 07, 2020 at 03:20:03PM +0800, Anand Jain wrote:
> Matching with the information that's available from the ioctl
> BTRFS_IOC_FS_INFO, this patch adds generation to the sysfs.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-14 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07  7:20 [PATCH] btrfs: add fs_info generation to sysfs Anand Jain
2020-10-07  7:50 ` Nikolay Borisov
2020-10-12 15:51   ` David Sterba
2020-10-14 11:35 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).