diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/stat.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -261,6 +261,7 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) | |||
261 | return error; | 261 | return error; |
262 | } | 262 | } |
263 | 263 | ||
264 | #ifndef __ARCH_WANT_STAT64 | ||
264 | asmlinkage long sys_newfstatat(int dfd, char __user *filename, | 265 | asmlinkage long sys_newfstatat(int dfd, char __user *filename, |
265 | struct stat __user *statbuf, int flag) | 266 | struct stat __user *statbuf, int flag) |
266 | { | 267 | { |
@@ -281,6 +282,7 @@ asmlinkage long sys_newfstatat(int dfd, char __user *filename, | |||
281 | out: | 282 | out: |
282 | return error; | 283 | return error; |
283 | } | 284 | } |
285 | #endif | ||
284 | 286 | ||
285 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) | 287 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) |
286 | { | 288 | { |
@@ -395,6 +397,26 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) | |||
395 | return error; | 397 | return error; |
396 | } | 398 | } |
397 | 399 | ||
400 | asmlinkage long sys_fstatat64(int dfd, char __user *filename, | ||
401 | struct stat64 __user *statbuf, int flag) | ||
402 | { | ||
403 | struct kstat stat; | ||
404 | int error = -EINVAL; | ||
405 | |||
406 | if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) | ||
407 | goto out; | ||
408 | |||
409 | if (flag & AT_SYMLINK_NOFOLLOW) | ||
410 | error = vfs_lstat_fd(dfd, filename, &stat); | ||
411 | else | ||
412 | error = vfs_stat_fd(dfd, filename, &stat); | ||
413 | |||
414 | if (!error) | ||
415 | error = cp_new_stat64(&stat, statbuf); | ||
416 | |||
417 | out: | ||
418 | return error; | ||
419 | } | ||
398 | #endif /* __ARCH_WANT_STAT64 */ | 420 | #endif /* __ARCH_WANT_STAT64 */ |
399 | 421 | ||
400 | void inode_add_bytes(struct inode *inode, loff_t bytes) | 422 | void inode_add_bytes(struct inode *inode, loff_t bytes) |