Commit 246998f1 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] Remove SWP_BLOCKDEV

	Below is a followup to bd_claim patch - it is the last one
from the current series.  Removes SWP_BLOCKDEV flag - it isn't needed
anymore.
parent 75e9c9e1
...@@ -64,7 +64,6 @@ typedef struct { ...@@ -64,7 +64,6 @@ typedef struct {
enum { enum {
SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */
SWP_BLOCKDEV = (1 << 2), /* is this swap a block device? */
SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), SWP_ACTIVE = (SWP_USED | SWP_WRITEOK),
}; };
......
...@@ -809,27 +809,30 @@ int get_swaparea_info(char *buf) ...@@ -809,27 +809,30 @@ int get_swaparea_info(char *buf)
len = sprintf(buf, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); len = sprintf(buf, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n");
for (i = 0 ; i < nr_swapfiles ; i++, ptr++) { for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
if ((ptr->flags & SWP_USED) && ptr->swap_map) { int j, usedswap;
char * path = d_path(ptr->swap_file->f_dentry, struct file *file;
ptr->swap_file->f_vfsmnt, char *path;
page, PAGE_SIZE);
int j, usedswap = 0; if (!(ptr->flags & SWP_USED) || !ptr->swap_map)
for (j = 0; j < ptr->max; ++j) continue;
switch (ptr->swap_map[j]) {
case SWAP_MAP_BAD: file = ptr->swap_file;
case 0: path = d_path(file->f_dentry, file->f_vfsmnt, page, PAGE_SIZE);
continue; for (j = 0,usedswap = 0; j < ptr->max; ++j)
default: switch (ptr->swap_map[j]) {
usedswap++; case SWAP_MAP_BAD:
} case 0:
len += sprintf(buf + len, "%-39s %s\t%d\t%d\t%d\n", continue;
path, default:
(ptr->flags & SWP_BLOCKDEV) ? usedswap++;
"partition" : "file\t", }
ptr->pages << (PAGE_SHIFT - 10), len += sprintf(buf + len, "%-39s %s\t%d\t%d\t%d\n",
usedswap << (PAGE_SHIFT - 10), path,
ptr->prio); S_ISBLK(file->f_dentry->d_inode->i_mode) ?
} "partition" : "file\t",
ptr->pages << (PAGE_SHIFT - 10),
usedswap << (PAGE_SHIFT - 10),
ptr->prio);
} }
free_page((unsigned long) page); free_page((unsigned long) page);
return len; return len;
...@@ -1037,8 +1040,6 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags) ...@@ -1037,8 +1040,6 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
swap_device_lock(p); swap_device_lock(p);
p->max = maxpages; p->max = maxpages;
p->flags = SWP_ACTIVE; p->flags = SWP_ACTIVE;
if (S_ISBLK(swap_file->f_dentry->d_inode->i_mode))
p->flags |= SWP_BLOCKDEV;
p->pages = nr_good_pages; p->pages = nr_good_pages;
nr_swap_pages += nr_good_pages; nr_swap_pages += nr_good_pages;
total_swap_pages += nr_good_pages; total_swap_pages += nr_good_pages;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment