Skip to content

Commit

Permalink
exfat: Convert to new uid/gid option parsing helpers
Browse files Browse the repository at this point in the history
Convert to new uid/gid option parsing helpers

Signed-off-by: Eric Sandeen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Christian Brauner <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
Eric Sandeen authored and namjaejeon committed Aug 7, 2024
1 parent 228f689 commit 05b27be
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions super.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,13 @@ static const struct constant_table exfat_param_enums[] = {
};

static const struct fs_parameter_spec exfat_parameters[] = {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
fsparam_uid("uid", Opt_uid),
fsparam_gid("gid", Opt_gid),
#else
fsparam_u32("uid", Opt_uid),
fsparam_u32("gid", Opt_gid),
#endif
fsparam_u32oct("umask", Opt_umask),
fsparam_u32oct("dmask", Opt_dmask),
fsparam_u32oct("fmask", Opt_fmask),
Expand Down Expand Up @@ -271,10 +276,18 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param)

switch (opt) {
case Opt_uid:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
opts->fs_uid = result.uid;
#else
opts->fs_uid = make_kuid(current_user_ns(), result.uint_32);
#endif
break;
case Opt_gid:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
opts->fs_gid = result.gid;
#else
opts->fs_gid = make_kgid(current_user_ns(), result.uint_32);
#endif
break;
case Opt_umask:
opts->fs_fmask = result.uint_32;
Expand Down

0 comments on commit 05b27be

Please sign in to comment.