Skip to content

Commit 33b54bc

Browse files
author
Al Viro
committed
do_f{chmod,chown,access}at(): use CLASS(filename_uflags)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent d4ffeab commit 33b54bc

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

fs/open.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ static int do_faccessat(int dfd, const char __user *filename, int mode, int flag
469469
int res;
470470
unsigned int lookup_flags = LOOKUP_FOLLOW;
471471
const struct cred *old_cred = NULL;
472-
struct filename *name;
473472

474473
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
475474
return -EINVAL;
@@ -486,7 +485,7 @@ static int do_faccessat(int dfd, const char __user *filename, int mode, int flag
486485
return -ENOMEM;
487486
}
488487

489-
name = getname_uflags(filename, flags);
488+
CLASS(filename_uflags, name)(filename, flags);
490489
retry:
491490
res = filename_lookup(dfd, name, lookup_flags, &path, NULL);
492491
if (res)
@@ -528,7 +527,6 @@ static int do_faccessat(int dfd, const char __user *filename, int mode, int flag
528527
goto retry;
529528
}
530529
out:
531-
putname(name);
532530
if (old_cred)
533531
put_cred(revert_creds(old_cred));
534532

@@ -677,15 +675,14 @@ static int do_fchmodat(int dfd, const char __user *filename, umode_t mode,
677675
unsigned int flags)
678676
{
679677
struct path path;
680-
struct filename *name;
681678
int error;
682679
unsigned int lookup_flags;
683680

684681
if (unlikely(flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)))
685682
return -EINVAL;
686683

687684
lookup_flags = (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW;
688-
name = getname_uflags(filename, flags);
685+
CLASS(filename_uflags, name)(filename, flags);
689686
retry:
690687
error = filename_lookup(dfd, name, lookup_flags, &path, NULL);
691688
if (!error) {
@@ -696,7 +693,6 @@ static int do_fchmodat(int dfd, const char __user *filename, umode_t mode,
696693
goto retry;
697694
}
698695
}
699-
putname(name);
700696
return error;
701697
}
702698

0 commit comments

Comments
 (0)