aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel
diff options
context:
space:
mode:
authorSeunghun Lee <waydi1@gmail.com>2014-09-14 09:15:10 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-09 02:39:16 -0400
commit5e6123f3477e4260fb14392f0a88f1a842fa4d42 (patch)
tree66cf4572317d0e634f169cbdc702e773fe0e4b5c /arch/alpha/kernel
parent4d93bc3e81736ce55c79d9cae743bab4f89b4f9c (diff)
vfs: move getname() from callers to do_mount()
It would make more sense to pass char __user * instead of char * in callers of do_mount() and do getname() inside do_mount(). Suggested-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Seunghun Lee <waydi1@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r--arch/alpha/kernel/osf_sys.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 1402fcc11c2c..f9c732e18284 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -446,7 +446,8 @@ struct procfs_args {
446 * unhappy with OSF UFS. [CHECKME] 446 * unhappy with OSF UFS. [CHECKME]
447 */ 447 */
448static int 448static int
449osf_ufs_mount(const char *dirname, struct ufs_args __user *args, int flags) 449osf_ufs_mount(const char __user *dirname,
450 struct ufs_args __user *args, int flags)
450{ 451{
451 int retval; 452 int retval;
452 struct cdfs_args tmp; 453 struct cdfs_args tmp;
@@ -466,7 +467,8 @@ osf_ufs_mount(const char *dirname, struct ufs_args __user *args, int flags)
466} 467}
467 468
468static int 469static int
469osf_cdfs_mount(const char *dirname, struct cdfs_args __user *args, int flags) 470osf_cdfs_mount(const char __user *dirname,
471 struct cdfs_args __user *args, int flags)
470{ 472{
471 int retval; 473 int retval;
472 struct cdfs_args tmp; 474 struct cdfs_args tmp;
@@ -486,7 +488,8 @@ osf_cdfs_mount(const char *dirname, struct cdfs_args __user *args, int flags)
486} 488}
487 489
488static int 490static int
489osf_procfs_mount(const char *dirname, struct procfs_args __user *args, int flags) 491osf_procfs_mount(const char __user *dirname,
492 struct procfs_args __user *args, int flags)
490{ 493{
491 struct procfs_args tmp; 494 struct procfs_args tmp;
492 495
@@ -500,28 +503,22 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
500 int, flag, void __user *, data) 503 int, flag, void __user *, data)
501{ 504{
502 int retval; 505 int retval;
503 struct filename *name;
504 506
505 name = getname(path);
506 retval = PTR_ERR(name);
507 if (IS_ERR(name))
508 goto out;
509 switch (typenr) { 507 switch (typenr) {
510 case 1: 508 case 1:
511 retval = osf_ufs_mount(name->name, data, flag); 509 retval = osf_ufs_mount(path, data, flag);
512 break; 510 break;
513 case 6: 511 case 6:
514 retval = osf_cdfs_mount(name->name, data, flag); 512 retval = osf_cdfs_mount(path, data, flag);
515 break; 513 break;
516 case 9: 514 case 9:
517 retval = osf_procfs_mount(name->name, data, flag); 515 retval = osf_procfs_mount(path, data, flag);
518 break; 516 break;
519 default: 517 default:
520 retval = -EINVAL; 518 retval = -EINVAL;
521 printk("osf_mount(%ld, %x)\n", typenr, flag); 519 printk("osf_mount(%ld, %x)\n", typenr, flag);
522 } 520 }
523 putname(name); 521
524 out:
525 return retval; 522 return retval;
526} 523}
527 524