summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@math.psu.edu>2002-03-04 22:56:52 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-04 22:56:52 -0800
commit246998f16482da4b46407a8d0c768c4b76b4e343 (patch)
tree39bf8942262b33e1567574ffc6686ced55e77260
parent75e9c9e1bffbe4a1767172855296b94ccba28f71 (diff)
[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.
-rw-r--r--include/linux/swap.h1
-rw-r--r--mm/swapfile.c47
2 files changed, 24 insertions, 24 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 45a65b97460f..824a928d5c37 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -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),
};
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d6fab4e64cf6..bf28ff5d9bd3 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -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;