Skip to content

Commit b548291

Browse files
Eric Sandeenbrauner
authored andcommitted
tracefs: Convert to new uid/gid option parsing helpers
Convert to new uid/gid option parsing helpers Signed-off-by: Eric Sandeen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Steven Rostedt (Google) <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 3229e3a commit b548291

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

fs/tracefs/inode.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -296,18 +296,16 @@ enum {
296296
};
297297

298298
static const struct fs_parameter_spec tracefs_param_specs[] = {
299-
fsparam_u32 ("gid", Opt_gid),
299+
fsparam_gid ("gid", Opt_gid),
300300
fsparam_u32oct ("mode", Opt_mode),
301-
fsparam_u32 ("uid", Opt_uid),
301+
fsparam_uid ("uid", Opt_uid),
302302
{}
303303
};
304304

305305
static int tracefs_parse_param(struct fs_context *fc, struct fs_parameter *param)
306306
{
307307
struct tracefs_fs_info *opts = fc->s_fs_info;
308308
struct fs_parse_result result;
309-
kuid_t uid;
310-
kgid_t gid;
311309
int opt;
312310

313311
opt = fs_parse(fc, tracefs_param_specs, param, &result);
@@ -316,16 +314,10 @@ static int tracefs_parse_param(struct fs_context *fc, struct fs_parameter *param
316314

317315
switch (opt) {
318316
case Opt_uid:
319-
uid = make_kuid(current_user_ns(), result.uint_32);
320-
if (!uid_valid(uid))
321-
return invalf(fc, "Unknown uid");
322-
opts->uid = uid;
317+
opts->uid = result.uid;
323318
break;
324319
case Opt_gid:
325-
gid = make_kgid(current_user_ns(), result.uint_32);
326-
if (!gid_valid(gid))
327-
return invalf(fc, "Unknown gid");
328-
opts->gid = gid;
320+
opts->gid = result.gid;
329321
break;
330322
case Opt_mode:
331323
opts->mode = result.uint_32 & S_IALLUGO;

0 commit comments

Comments
 (0)