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 {
enum {
SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
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),
};
......
......@@ -809,27 +809,30 @@ int get_swaparea_info(char *buf)
len = sprintf(buf, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n");
for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
if ((ptr->flags & SWP_USED) && ptr->swap_map) {
char * path = d_path(ptr->swap_file->f_dentry,
ptr->swap_file->f_vfsmnt,
page, PAGE_SIZE);
int j, usedswap = 0;
for (j = 0; j < ptr->max; ++j)
switch (ptr->swap_map[j]) {
case SWAP_MAP_BAD:
case 0:
continue;
default:
usedswap++;
}
len += sprintf(buf + len, "%-39s %s\t%d\t%d\t%d\n",
path,
(ptr->flags & SWP_BLOCKDEV) ?
"partition" : "file\t",
ptr->pages << (PAGE_SHIFT - 10),
usedswap << (PAGE_SHIFT - 10),
ptr->prio);
}
int j, usedswap;
struct file *file;
char *path;
if (!(ptr->flags & SWP_USED) || !ptr->swap_map)
continue;
file = ptr->swap_file;
path = d_path(file->f_dentry, file->f_vfsmnt, page, PAGE_SIZE);
for (j = 0,usedswap = 0; j < ptr->max; ++j)
switch (ptr->swap_map[j]) {
case SWAP_MAP_BAD:
case 0:
continue;
default:
usedswap++;
}
len += sprintf(buf + len, "%-39s %s\t%d\t%d\t%d\n",
path,
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);
return len;
......@@ -1037,8 +1040,6 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
swap_device_lock(p);
p->max = maxpages;
p->flags = SWP_ACTIVE;
if (S_ISBLK(swap_file->f_dentry->d_inode->i_mode))
p->flags |= SWP_BLOCKDEV;
p->pages = nr_good_pages;
nr_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