aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-10-10 15:25:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-12 20:14:55 -0400
commit91a27b2a756784714e924e5e854b919273082d26 (patch)
tree3913246b7d6e62703ec915f481e3a7159393f0f0 /arch/alpha
parent8e377d15078a501c4da98471f56396343c407d92 (diff)
vfs: define struct filename and have getname() return it
getname() is intended to copy pathname strings from userspace into a kernel buffer. The result is just a string in kernel space. It would however be quite helpful to be able to attach some ancillary info to the string. For instance, we could attach some audit-related info to reduce the amount of audit-related processing needed. When auditing is enabled, we could also call getname() on the string more than once and not need to recopy it from userspace. This patchset converts the getname()/putname() interfaces to return a struct instead of a string. For now, the struct just tracks the string in kernel space and the original userland pointer for it. Later, we'll add other information to the struct as it becomes convenient. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/kernel/osf_sys.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 63e77e3944ce..9eb090582cf1 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -449,7 +449,7 @@ osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags)
449{ 449{
450 int retval; 450 int retval;
451 struct cdfs_args tmp; 451 struct cdfs_args tmp;
452 char *devname; 452 struct filename *devname;
453 453
454 retval = -EFAULT; 454 retval = -EFAULT;
455 if (copy_from_user(&tmp, args, sizeof(tmp))) 455 if (copy_from_user(&tmp, args, sizeof(tmp)))
@@ -458,7 +458,7 @@ osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags)
458 retval = PTR_ERR(devname); 458 retval = PTR_ERR(devname);
459 if (IS_ERR(devname)) 459 if (IS_ERR(devname))
460 goto out; 460 goto out;
461 retval = do_mount(devname, dirname, "ext2", flags, NULL); 461 retval = do_mount(devname->name, dirname, "ext2", flags, NULL);
462 putname(devname); 462 putname(devname);
463 out: 463 out:
464 return retval; 464 return retval;
@@ -469,7 +469,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags)
469{ 469{
470 int retval; 470 int retval;
471 struct cdfs_args tmp; 471 struct cdfs_args tmp;
472 char *devname; 472 struct filename *devname;
473 473
474 retval = -EFAULT; 474 retval = -EFAULT;
475 if (copy_from_user(&tmp, args, sizeof(tmp))) 475 if (copy_from_user(&tmp, args, sizeof(tmp)))
@@ -478,7 +478,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags)
478 retval = PTR_ERR(devname); 478 retval = PTR_ERR(devname);
479 if (IS_ERR(devname)) 479 if (IS_ERR(devname))
480 goto out; 480 goto out;
481 retval = do_mount(devname, dirname, "iso9660", flags, NULL); 481 retval = do_mount(devname->name, dirname, "iso9660", flags, NULL);
482 putname(devname); 482 putname(devname);
483 out: 483 out:
484 return retval; 484 return retval;
@@ -499,7 +499,7 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
499 int, flag, void __user *, data) 499 int, flag, void __user *, data)
500{ 500{
501 int retval; 501 int retval;
502 char *name; 502 struct filename *name;
503 503
504 name = getname(path); 504 name = getname(path);
505 retval = PTR_ERR(name); 505 retval = PTR_ERR(name);
@@ -507,13 +507,13 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
507 goto out; 507 goto out;
508 switch (typenr) { 508 switch (typenr) {
509 case 1: 509 case 1:
510 retval = osf_ufs_mount(name, data, flag); 510 retval = osf_ufs_mount(name->name, data, flag);
511 break; 511 break;
512 case 6: 512 case 6:
513 retval = osf_cdfs_mount(name, data, flag); 513 retval = osf_cdfs_mount(name->name, data, flag);
514 break; 514 break;
515 case 9: 515 case 9:
516 retval = osf_procfs_mount(name, data, flag); 516 retval = osf_procfs_mount(name->name, data, flag);
517 break; 517 break;
518 default: 518 default:
519 retval = -EINVAL; 519 retval = -EINVAL;