diff options
author | Hugh Dickins <hugh@veritas.com> | 2009-01-06 17:39:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:05 -0500 |
commit | ebebbbe904634b0ca1c674457b399f68db5e05b1 (patch) | |
tree | 168c6c1193580e40ba1916ebaff822e15e8ee186 /include | |
parent | 81e33971271ec8603fe696731ff9967afb99e729 (diff) |
swapfile: rearrange scan and swap_info
Before making functional changes, rearrange scan_swap_map() to simplify
subsequent diffs. Actually, there is one functional change in there:
leave cluster_nr negative while scanning for a new cluster - resetting it
early increased the likelihood that when we have difficulty finding a free
cluster, another task may come in and try doing exactly the same - just a
waste of cpu.
Before making functional changes, rearrange struct swap_info_struct
slightly: flags will be needed as an unsigned long (for wait_on_bit), next
is a good int to pair with prio, old_block_size is uninteresting so shift
it to the end.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/swap.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 410c8e473727..9cabb8b21aba 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -133,14 +133,14 @@ enum { | |||
133 | * The in-memory structure used to track swap areas. | 133 | * The in-memory structure used to track swap areas. |
134 | */ | 134 | */ |
135 | struct swap_info_struct { | 135 | struct swap_info_struct { |
136 | unsigned int flags; | 136 | unsigned long flags; |
137 | int prio; /* swap priority */ | 137 | int prio; /* swap priority */ |
138 | int next; /* next entry on swap list */ | ||
138 | struct file *swap_file; | 139 | struct file *swap_file; |
139 | struct block_device *bdev; | 140 | struct block_device *bdev; |
140 | struct list_head extent_list; | 141 | struct list_head extent_list; |
141 | struct swap_extent *curr_swap_extent; | 142 | struct swap_extent *curr_swap_extent; |
142 | unsigned old_block_size; | 143 | unsigned short *swap_map; |
143 | unsigned short * swap_map; | ||
144 | unsigned int lowest_bit; | 144 | unsigned int lowest_bit; |
145 | unsigned int highest_bit; | 145 | unsigned int highest_bit; |
146 | unsigned int cluster_next; | 146 | unsigned int cluster_next; |
@@ -148,7 +148,7 @@ struct swap_info_struct { | |||
148 | unsigned int pages; | 148 | unsigned int pages; |
149 | unsigned int max; | 149 | unsigned int max; |
150 | unsigned int inuse_pages; | 150 | unsigned int inuse_pages; |
151 | int next; /* next entry on swap list */ | 151 | unsigned int old_block_size; |
152 | }; | 152 | }; |
153 | 153 | ||
154 | struct swap_list_t { | 154 | struct swap_list_t { |