diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2009-04-08 12:05:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-04-20 23:02:51 -0400 |
commit | 0112fc2229847feb6c4eb011e6833d8f1742a375 (patch) | |
tree | c5bda0b4f5a5f942478faf2fb5961df7fbd15546 /fs/compat.c | |
parent | fd56d242b3b80b6f2ca174272b20029aae61df75 (diff) |
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 <green@linuxhacker.ru>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/compat.c b/fs/compat.c index 3f84d5f15889..dda72e267092 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -204,21 +204,12 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename, | |||
204 | struct compat_stat __user *statbuf, int flag) | 204 | struct compat_stat __user *statbuf, int flag) |
205 | { | 205 | { |
206 | struct kstat stat; | 206 | struct kstat stat; |
207 | int error = -EINVAL; | 207 | int error; |
208 | |||
209 | if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) | ||
210 | goto out; | ||
211 | |||
212 | if (flag & AT_SYMLINK_NOFOLLOW) | ||
213 | error = vfs_lstat_fd(dfd, filename, &stat); | ||
214 | else | ||
215 | error = vfs_stat_fd(dfd, filename, &stat); | ||
216 | |||
217 | if (!error) | ||
218 | error = cp_compat_stat(&stat, statbuf); | ||
219 | 208 | ||
220 | out: | 209 | error = vfs_fstatat(dfd, filename, &stat, flag); |
221 | return error; | 210 | if (error) |
211 | return error; | ||
212 | return cp_compat_stat(&stat, statbuf); | ||
222 | } | 213 | } |
223 | #endif | 214 | #endif |
224 | 215 | ||