aboutsummaryrefslogtreecommitdiffstats
path: root/fs/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/stat.c')
-rw-r--r--fs/stat.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/fs/stat.c b/fs/stat.c
index 7e12a6f82795..2db740a0cfb5 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -152,7 +152,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
152 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 152 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
153} 153}
154 154
155asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf) 155SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf)
156{ 156{
157 struct kstat stat; 157 struct kstat stat;
158 int error = vfs_stat_fd(AT_FDCWD, filename, &stat); 158 int error = vfs_stat_fd(AT_FDCWD, filename, &stat);
@@ -162,7 +162,8 @@ asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user
162 162
163 return error; 163 return error;
164} 164}
165asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf) 165
166SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf)
166{ 167{
167 struct kstat stat; 168 struct kstat stat;
168 int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); 169 int error = vfs_lstat_fd(AT_FDCWD, filename, &stat);
@@ -172,7 +173,8 @@ asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __use
172 173
173 return error; 174 return error;
174} 175}
175asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf) 176
177SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf)
176{ 178{
177 struct kstat stat; 179 struct kstat stat;
178 int error = vfs_fstat(fd, &stat); 180 int error = vfs_fstat(fd, &stat);
@@ -235,7 +237,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
235 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 237 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
236} 238}
237 239
238asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) 240SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf)
239{ 241{
240 struct kstat stat; 242 struct kstat stat;
241 int error = vfs_stat_fd(AT_FDCWD, filename, &stat); 243 int error = vfs_stat_fd(AT_FDCWD, filename, &stat);
@@ -246,7 +248,7 @@ asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf)
246 return error; 248 return error;
247} 249}
248 250
249asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) 251SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf)
250{ 252{
251 struct kstat stat; 253 struct kstat stat;
252 int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); 254 int error = vfs_lstat_fd(AT_FDCWD, filename, &stat);
@@ -258,8 +260,8 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
258} 260}
259 261
260#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) 262#if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
261asmlinkage long sys_newfstatat(int dfd, char __user *filename, 263SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename,
262 struct stat __user *statbuf, int flag) 264 struct stat __user *, statbuf, int, flag)
263{ 265{
264 struct kstat stat; 266 struct kstat stat;
265 int error = -EINVAL; 267 int error = -EINVAL;
@@ -280,7 +282,7 @@ out:
280} 282}
281#endif 283#endif
282 284
283asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) 285SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
284{ 286{
285 struct kstat stat; 287 struct kstat stat;
286 int error = vfs_fstat(fd, &stat); 288 int error = vfs_fstat(fd, &stat);
@@ -291,8 +293,8 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
291 return error; 293 return error;
292} 294}
293 295
294asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, 296SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
295 char __user *buf, int bufsiz) 297 char __user *, buf, int, bufsiz)
296{ 298{
297 struct path path; 299 struct path path;
298 int error; 300 int error;
@@ -318,8 +320,8 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *pathname,
318 return error; 320 return error;
319} 321}
320 322
321asmlinkage long sys_readlink(const char __user *path, char __user *buf, 323SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
322 int bufsiz) 324 int, bufsiz)
323{ 325{
324 return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); 326 return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
325} 327}
@@ -365,7 +367,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
365 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 367 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
366} 368}
367 369
368asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf) 370SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf)
369{ 371{
370 struct kstat stat; 372 struct kstat stat;
371 int error = vfs_stat(filename, &stat); 373 int error = vfs_stat(filename, &stat);
@@ -375,7 +377,8 @@ asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbu
375 377
376 return error; 378 return error;
377} 379}
378asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf) 380
381SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf)
379{ 382{
380 struct kstat stat; 383 struct kstat stat;
381 int error = vfs_lstat(filename, &stat); 384 int error = vfs_lstat(filename, &stat);
@@ -385,7 +388,8 @@ asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statb
385 388
386 return error; 389 return error;
387} 390}
388asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) 391
392SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf)
389{ 393{
390 struct kstat stat; 394 struct kstat stat;
391 int error = vfs_fstat(fd, &stat); 395 int error = vfs_fstat(fd, &stat);
@@ -396,8 +400,8 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
396 return error; 400 return error;
397} 401}
398 402
399asmlinkage long sys_fstatat64(int dfd, char __user *filename, 403SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename,
400 struct stat64 __user *statbuf, int flag) 404 struct stat64 __user *, statbuf, int, flag)
401{ 405{
402 struct kstat stat; 406 struct kstat stat;
403 int error = -EINVAL; 407 int error = -EINVAL;