mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Separate out common fstatat code into vfs_fstatat
This is a version incorporating Christoph's suggestion. Separate out common *fstatat functionality into a single function instead of duplicating it all over the code. Signed-off-by: Oleg Drokin <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
fd56d242b3
commit
0112fc2229
7 changed files with 54 additions and 97 deletions
19
fs/compat.c
19
fs/compat.c
|
|
@ -204,21 +204,12 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename,
|
|||
struct compat_stat __user *statbuf, int flag)
|
||||
{
|
||||
struct kstat stat;
|
||||
int error = -EINVAL;
|
||||
int error;
|
||||
|
||||
if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
|
||||
goto out;
|
||||
|
||||
if (flag & AT_SYMLINK_NOFOLLOW)
|
||||
error = vfs_lstat_fd(dfd, filename, &stat);
|
||||
else
|
||||
error = vfs_stat_fd(dfd, filename, &stat);
|
||||
|
||||
if (!error)
|
||||
error = cp_compat_stat(&stat, statbuf);
|
||||
|
||||
out:
|
||||
return error;
|
||||
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||
if (error)
|
||||
return error;
|
||||
return cp_compat_stat(&stat, statbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue