[PATCH 1/4] nilfs2: add support for FS_IOC_GETUUID

Ryusuke Konishi posted 4 patches 1 year, 5 months ago
[PATCH 1/4] nilfs2: add support for FS_IOC_GETUUID
Posted by Ryusuke Konishi 1 year, 5 months ago
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@gmail.com>
---
 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