Unverified Commit 01edea1b authored by Christian Brauner's avatar Christian Brauner
Browse files

Merge series "filesystem visibility ioctls" of...

Merge series "filesystem visibility ioctls" of https://lore.kernel.org/r/20240207025624.1019754-1-kent.overstreet@linux.dev

Pull filesystem visibility ioctls series from Kent Overstreet:

This patch series adds a few new ioctls to standardize a few interfaces
to get and set filesystem uuid and retrieving the sysfs path.

The get UUID ioctls are lifted versions of the ext4 ioctls with one
difference, killing the flexible array member - we'll never have UUIDs
more than 16 bytes, and getting rid of the flexible array member makes
them easier to use.

FS_IOC_GETFSSYSFSPATH is new, but it addresses something that we've been
doing in fs specific code for awhile - "given a path on a mounted
filesystem, tell me where it lives in sysfs".

* series "filesystem visibility ioctls" of https://lore.kernel.org/r/20240207025624.1019754-1-kent.overstreet@linux.dev

: (6 commits)
  xfs: add support for FS_IOC_GETFSSYSFSPATH
  fs: add FS_IOC_GETFSSYSFSPATH
  fat: Hook up sb->s_uuid
  fs: FS_IOC_GETUUID
  ovl: convert to super_set_uuid()
  fs: super_set_uuid()

Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parents 6613476e 231e8725
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -82,8 +82,9 @@ Code Seq# Include File Comments
0x10  00-0F  drivers/char/s390/vmcp.h
0x10  10-1F  arch/s390/include/uapi/sclp_ctl.h
0x10  20-2F  arch/s390/include/uapi/asm/hypfs.h
0x12  all    linux/fs.h
0x12  all    linux/fs.h                                              BLK* ioctls
             linux/blkpg.h
0x15  all    linux/fs.h                                              FS_IOC_* ioctls
0x1b  all                                                            InfiniBand Subsystem
                                                                     <http://infiniband.sourceforge.net/>
0x20  all    drivers/cdrom/cm206.h
+1 −1
Original line number Diff line number Diff line
@@ -5346,7 +5346,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
		sb->s_qcop = &ext4_qctl_operations;
	sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ;
#endif
	memcpy(&sb->s_uuid, es->s_uuid, sizeof(es->s_uuid));
	super_set_uuid(sb, es->s_uuid, sizeof(es->s_uuid));

	INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
	mutex_init(&sbi->s_orphan_lock);
+1 −1
Original line number Diff line number Diff line
@@ -4496,7 +4496,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
	sb->s_time_gran = 1;
	sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
		(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
	memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
	super_set_uuid(sb, (void *) raw_super->uuid, sizeof(raw_super->uuid));
	sb->s_iflags |= SB_I_CGROUPWB;

	/* init f2fs-specific super block info */
+3 −0
Original line number Diff line number Diff line
@@ -1762,6 +1762,9 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
	else /* fat 16 or 12 */
		sbi->vol_id = bpb.fat16_vol_id;

	__le32 vol_id_le = cpu_to_le32(sbi->vol_id);
	super_set_uuid(sb, (void *) &vol_id_le, sizeof(vol_id_le));

	sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry);
	sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1;

+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ static void gfs2_sb_in(struct gfs2_sbd *sdp, const void *buf)

	memcpy(sb->sb_lockproto, str->sb_lockproto, GFS2_LOCKNAME_LEN);
	memcpy(sb->sb_locktable, str->sb_locktable, GFS2_LOCKNAME_LEN);
	memcpy(&s->s_uuid, str->sb_uuid, 16);
	super_set_uuid(s, str->sb_uuid, 16);
}

/**
Loading