diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
commit | 529c593ece216e4aaffd36bd940cb94f1fa63129 (patch) | |
tree | 78f1c0b805f5656aa7b0417a043c5346f700a2cf /mm/swapfile.c | |
parent | 0bd079751d25808d1972baee5c4eaa1db2227257 (diff) |
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 53a561201..dc647f2b0 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -445,12 +445,12 @@ asmlinkage long sys_swapoff(const char * specialfile) struct swap_info_struct * p = NULL; struct dentry * dentry; int i, type, prev; - int err = -EPERM; + int err; - lock_kernel(); if (!capable(CAP_SYS_ADMIN)) - goto out; + return -EPERM; + lock_kernel(); dentry = namei(specialfile); err = PTR_ERR(dentry); if (IS_ERR(dentry)) @@ -587,7 +587,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags) struct dentry * swap_dentry; unsigned int type; int i, j, prev; - int error = -EPERM; + int error; static int least_priority = 0; union swap_header *swap_header = 0; int swap_header_version; @@ -596,13 +596,14 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags) int swapfilesize; struct block_device *bdev = NULL; - lock_kernel(); if (!capable(CAP_SYS_ADMIN)) - goto out; + return -EPERM; + lock_kernel(); p = swap_info; for (type = 0 ; type < nr_swapfiles ; type++,p++) if (!(p->flags & SWP_USED)) break; + error = -EPERM; if (type >= MAX_SWAPFILES) goto out; if (type >= nr_swapfiles) |