[PATCH 1/4] nilfs2: add support for FS_IOC_GETUUID
From: Ryusuke Konishi
Date: Thu Aug 15 2024 - 03:45:29 EST
Expose the UUID of a file system instance using the super_set_uuid
helper and support the FS_IOC_GETUUID ioctl.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxx>
---
fs/nilfs2/super.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index e835e1f5a712..167050b3ce7e 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1063,6 +1063,9 @@ nilfs_fill_super(struct super_block *sb, struct fs_context *fc)
if (err)
goto failed_nilfs;
+ super_set_uuid(sb, nilfs->ns_sbp[0]->s_uuid,
+ sizeof(nilfs->ns_sbp[0]->s_uuid));
+
cno = nilfs_last_cno(nilfs);
err = nilfs_attach_checkpoint(sb, cno, true, &fsroot);
if (err) {
--
2.34.1