diff options
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 14e254c768fc..71cd288b2001 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1483,7 +1483,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) | |||
1483 | struct file *swap_file, *victim; | 1483 | struct file *swap_file, *victim; |
1484 | struct address_space *mapping; | 1484 | struct address_space *mapping; |
1485 | struct inode *inode; | 1485 | struct inode *inode; |
1486 | char *pathname; | 1486 | struct filename *pathname; |
1487 | int oom_score_adj; | 1487 | int oom_score_adj; |
1488 | int i, type, prev; | 1488 | int i, type, prev; |
1489 | int err; | 1489 | int err; |
@@ -1498,8 +1498,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) | |||
1498 | if (IS_ERR(pathname)) | 1498 | if (IS_ERR(pathname)) |
1499 | goto out; | 1499 | goto out; |
1500 | 1500 | ||
1501 | victim = filp_open(pathname, O_RDWR|O_LARGEFILE, 0); | 1501 | victim = file_open_name(pathname, O_RDWR|O_LARGEFILE, 0); |
1502 | putname(pathname); | ||
1503 | err = PTR_ERR(victim); | 1502 | err = PTR_ERR(victim); |
1504 | if (IS_ERR(victim)) | 1503 | if (IS_ERR(victim)) |
1505 | goto out; | 1504 | goto out; |
@@ -1936,7 +1935,7 @@ static int setup_swap_map_and_extents(struct swap_info_struct *p, | |||
1936 | SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) | 1935 | SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) |
1937 | { | 1936 | { |
1938 | struct swap_info_struct *p; | 1937 | struct swap_info_struct *p; |
1939 | char *name; | 1938 | struct filename *name; |
1940 | struct file *swap_file = NULL; | 1939 | struct file *swap_file = NULL; |
1941 | struct address_space *mapping; | 1940 | struct address_space *mapping; |
1942 | int i; | 1941 | int i; |
@@ -1967,7 +1966,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) | |||
1967 | name = NULL; | 1966 | name = NULL; |
1968 | goto bad_swap; | 1967 | goto bad_swap; |
1969 | } | 1968 | } |
1970 | swap_file = filp_open(name, O_RDWR|O_LARGEFILE, 0); | 1969 | swap_file = file_open_name(name, O_RDWR|O_LARGEFILE, 0); |
1971 | if (IS_ERR(swap_file)) { | 1970 | if (IS_ERR(swap_file)) { |
1972 | error = PTR_ERR(swap_file); | 1971 | error = PTR_ERR(swap_file); |
1973 | swap_file = NULL; | 1972 | swap_file = NULL; |
@@ -2053,7 +2052,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) | |||
2053 | 2052 | ||
2054 | printk(KERN_INFO "Adding %uk swap on %s. " | 2053 | printk(KERN_INFO "Adding %uk swap on %s. " |
2055 | "Priority:%d extents:%d across:%lluk %s%s%s\n", | 2054 | "Priority:%d extents:%d across:%lluk %s%s%s\n", |
2056 | p->pages<<(PAGE_SHIFT-10), name, p->prio, | 2055 | p->pages<<(PAGE_SHIFT-10), name->name, p->prio, |
2057 | nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10), | 2056 | nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10), |
2058 | (p->flags & SWP_SOLIDSTATE) ? "SS" : "", | 2057 | (p->flags & SWP_SOLIDSTATE) ? "SS" : "", |
2059 | (p->flags & SWP_DISCARDABLE) ? "D" : "", | 2058 | (p->flags & SWP_DISCARDABLE) ? "D" : "", |