diff options
| author | Stephen Rothwell <sfr@canb.auug.org.au> | 2002-06-17 20:55:28 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-06-17 20:55:28 -0700 |
| commit | 640889850ea54ba4a8b3a8b23a07eba21f4c8a1d (patch) | |
| tree | 52c30c1ceb2521d12d837aecb62f87079e880f63 | |
| parent | 1f60ade2a44d22a67c75a165b70d66f9d4e0b76e (diff) | |
[PATCH] remove getname32
arch/ppc64/kernel/sys_ppc32.c has a getname32 function. The only
difference between it and getname() is that it calls do_getname32()
instead of do_getname() (see fs/namei.c). The difference between
do_getname and do_getname32 is that the former checks to make sure that
the pointer it is passed is less that TASK_SIZE and restricts the length
copied to the lesser of PATH_MAX and (TASK_SIZE - pointer).
do_getname32 uses PAGE_SIZE instead of PATH_MAX.
Anton Blanchard says it is OK to remove getname32.
arch/ia64/ia32/sys_ia32.c defined a getname32(), but nothing used it.
This patch removes both.
| -rw-r--r-- | arch/ia64/ia32/sys_ia32.c | 41 | ||||
| -rw-r--r-- | arch/ppc64/kernel/sys_ppc32.c | 45 |
2 files changed, 2 insertions, 84 deletions
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 7216ac0b60d0..00872c1c7101 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -3629,47 +3629,6 @@ sys32_sysinfo (struct sysinfo32 *info) return ret; } -/* In order to reduce some races, while at the same time doing additional - * checking and hopefully speeding things up, we copy filenames to the - * kernel data space before using them.. - * - * POSIX.1 2.4: an empty pathname is invalid (ENOENT). - */ -static inline int -do_getname32 (const char *filename, char *page) -{ - int retval; - - /* 32bit pointer will be always far below TASK_SIZE :)) */ - retval = strncpy_from_user((char *)page, (char *)filename, PAGE_SIZE); - if (retval > 0) { - if (retval < PAGE_SIZE) - return 0; - return -ENAMETOOLONG; - } else if (!retval) - retval = -ENOENT; - return retval; -} - -static char * -getname32 (const char *filename) -{ - char *tmp, *result; - - result = ERR_PTR(-ENOMEM); - tmp = (char *)__get_free_page(GFP_KERNEL); - if (tmp) { - int retval = do_getname32(filename, tmp); - - result = tmp; - if (retval < 0) { - putname(tmp); - result = ERR_PTR(retval); - } - } - return result; -} - asmlinkage long sys32_sched_rr_get_interval (pid_t pid, struct timespec32 *interval) { diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c index 56912d36cbe4..adec88decd79 100644 --- a/arch/ppc64/kernel/sys_ppc32.c +++ b/arch/ppc64/kernel/sys_ppc32.c @@ -82,47 +82,6 @@ extern unsigned long wall_jiffies; */ #define MSR_USERCHANGE (MSR_FE0 | MSR_FE1) -/* In order to reduce some races, while at the same time doing additional - * checking and hopefully speeding things up, we copy filenames to the - * kernel data space before using them.. - * - * POSIX.1 2.4: an empty pathname is invalid (ENOENT). - */ -static inline int do_getname32(const char *filename, char *page) -{ - int retval; - - /* 32bit pointer will be always far below TASK_SIZE :)) */ - retval = strncpy_from_user((char *)page, (char *)filename, PAGE_SIZE); - if (retval > 0) { - if (retval < PAGE_SIZE) - return 0; - return -ENAMETOOLONG; - } else if (!retval) - retval = -ENOENT; - return retval; -} - -char * getname32(const char *filename) -{ - char *tmp, *result; - - result = ERR_PTR(-ENOMEM); - tmp = __getname(); - if (tmp) { - int retval = do_getname32(filename, tmp); - - result = tmp; - if (retval < 0) { - putname(tmp); - result = ERR_PTR(retval); - } - } - return result; -} - - - extern asmlinkage long sys_utime(char * filename, struct utimbuf * times); struct utimbuf32 { @@ -142,7 +101,7 @@ asmlinkage long sys32_utime(char * filename, struct utimbuf32 *times) return sys_utime(filename, NULL); if (get_user(t.actime, ×->actime) || __get_user(t.modtime, ×->modtime)) return -EFAULT; - filenam = getname32(filename); + filenam = getname(filename); ret = PTR_ERR(filenam); if (!IS_ERR(filenam)) { @@ -937,7 +896,7 @@ asmlinkage long sys32_statfs(const char * path, struct statfs32 *buf) PPCDBG(PPCDBG_SYS32X, "sys32_statfs - entered - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm); - pth = getname32 (path); + pth = getname (path); ret = PTR_ERR(pth); if (!IS_ERR(pth)) { set_fs (KERNEL_DS); |
