linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@linux.dev>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-ext4@vger.kernel.org
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Subject: [PATCH 3/6] fat: Hook up sb->s_uuid
Date: Mon,  5 Feb 2024 15:05:14 -0500	[thread overview]
Message-ID: <20240205200529.546646-4-kent.overstreet@linux.dev> (raw)
In-Reply-To: <20240205200529.546646-1-kent.overstreet@linux.dev>

Now that we have a standard ioctl for querying the filesystem UUID,
initialize sb->s_uuid so that it works.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
 fs/fat/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 1fac3dabf130..a3d3478442d1 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1762,6 +1762,10 @@ 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);
+	memcpy(&sb->s_uuid, &vol_id_le, sizeof(vol_id_le));
+	sb->s_uuid_len = 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;
 
-- 
2.43.0


  parent reply	other threads:[~2024-02-05 20:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 20:05 [PATCH 0/6] filesystem visibility ioctls Kent Overstreet
2024-02-05 20:05 ` [PATCH 1/6] fs: super_block->s_uuid_len Kent Overstreet
2024-02-05 21:58   ` Dave Chinner
2024-02-05 22:56     ` Kent Overstreet
2024-02-05 20:05 ` [PATCH 2/6] fs: FS_IOC_GETUUID Kent Overstreet
2024-02-05 22:17   ` Dave Chinner
2024-02-05 22:49     ` Kent Overstreet
2024-02-05 23:59       ` Darrick J. Wong
2024-02-06  8:24       ` Amir Goldstein
2024-02-06  9:00         ` Kent Overstreet
2024-02-05 20:05 ` Kent Overstreet [this message]
2024-02-05 20:05 ` [PATCH 4/6] fs: FS_IOC_GETSYSFSNAME Kent Overstreet
2024-02-05 22:27   ` Darrick J. Wong
2024-02-05 22:43     ` Kent Overstreet
2024-02-06  1:39       ` David Sterba
2024-02-06  4:20         ` Randy Dunlap
2024-02-06  4:33           ` Kent Overstreet
2024-02-06  5:08             ` Darrick J. Wong
2024-02-06  5:13               ` Kent Overstreet
2024-02-05 20:05 ` [PATCH 5/6] xfs: add support for FS_IOC_GETSYSFSNAME Kent Overstreet
2024-02-05 20:05 ` [PATCH 6/6] bcachefs: " Kent Overstreet
2024-02-06 16:22 ` [PATCH 0/6] filesystem visibility ioctls Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240205200529.546646-4-kent.overstreet@linux.dev \
    --to=kent.overstreet@linux.dev \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).