diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-14 13:52:13 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-01-21 21:02:04 -0500 |
commit | 9ee49a047dc53fd21808cbb7f3b6a3345463e834 (patch) | |
tree | 98710aa584c84501c00ecf2227138ff4f44d5396 /fs | |
parent | 5efa0490cc94aee06cd8d282683e22a8ce0a0026 (diff) |
btrfs: switch extent_state state to unsigned
Currently there's a 4B hole in the structure between refs and state and there
are only 16 bits used so we can make it unsigned. This will get a better
packing and may save some stack space for local variables.
The size of extent_state gets reduced by 8B and there are usually a lot
of slab objects.
struct extent_state {
u64 start; /* 0 8 */
u64 end; /* 8 8 */
struct rb_node rb_node; /* 16 24 */
wait_queue_head_t wq; /* 40 24 */
/* --- cacheline 1 boundary (64 bytes) --- */
atomic_t refs; /* 64 4 */
/* XXX 4 bytes hole, try to pack */
long unsigned int state; /* 72 8 */
u64 private; /* 80 8 */
/* size: 88, cachelines: 2, members: 7 */
/* sum members: 84, holes: 1, sum holes: 4 */
/* last cacheline: 24 bytes */
};
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent_io.c | 45 | ||||
-rw-r--r-- | fs/btrfs/extent_io.h | 58 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 4 | ||||
-rw-r--r-- | fs/btrfs/tests/extent-io-tests.c | 3 |
4 files changed, 55 insertions, 55 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c4ca90ab687e..65bd285ef361 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -64,7 +64,7 @@ void btrfs_leak_debug_check(void) | |||
64 | 64 | ||
65 | while (!list_empty(&states)) { | 65 | while (!list_empty(&states)) { |
66 | state = list_entry(states.next, struct extent_state, leak_list); | 66 | state = list_entry(states.next, struct extent_state, leak_list); |
67 | pr_err("BTRFS: state leak: start %llu end %llu state %lu in tree %d refs %d\n", | 67 | pr_err("BTRFS: state leak: start %llu end %llu state %u in tree %d refs %d\n", |
68 | state->start, state->end, state->state, | 68 | state->start, state->end, state->state, |
69 | extent_state_in_tree(state), | 69 | extent_state_in_tree(state), |
70 | atomic_read(&state->refs)); | 70 | atomic_read(&state->refs)); |
@@ -396,21 +396,21 @@ static void merge_state(struct extent_io_tree *tree, | |||
396 | } | 396 | } |
397 | 397 | ||
398 | static void set_state_cb(struct extent_io_tree *tree, | 398 | static void set_state_cb(struct extent_io_tree *tree, |
399 | struct extent_state *state, unsigned long *bits) | 399 | struct extent_state *state, unsigned *bits) |
400 | { | 400 | { |
401 | if (tree->ops && tree->ops->set_bit_hook) | 401 | if (tree->ops && tree->ops->set_bit_hook) |
402 | tree->ops->set_bit_hook(tree->mapping->host, state, bits); | 402 | tree->ops->set_bit_hook(tree->mapping->host, state, bits); |
403 | } | 403 | } |
404 | 404 | ||
405 | static void clear_state_cb(struct extent_io_tree *tree, | 405 | static void clear_state_cb(struct extent_io_tree *tree, |
406 | struct extent_state *state, unsigned long *bits) | 406 | struct extent_state *state, unsigned *bits) |
407 | { | 407 | { |
408 | if (tree->ops && tree->ops->clear_bit_hook) | 408 | if (tree->ops && tree->ops->clear_bit_hook) |
409 | tree->ops->clear_bit_hook(tree->mapping->host, state, bits); | 409 | tree->ops->clear_bit_hook(tree->mapping->host, state, bits); |
410 | } | 410 | } |
411 | 411 | ||
412 | static void set_state_bits(struct extent_io_tree *tree, | 412 | static void set_state_bits(struct extent_io_tree *tree, |
413 | struct extent_state *state, unsigned long *bits); | 413 | struct extent_state *state, unsigned *bits); |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * insert an extent_state struct into the tree. 'bits' are set on the | 416 | * insert an extent_state struct into the tree. 'bits' are set on the |
@@ -426,7 +426,7 @@ static int insert_state(struct extent_io_tree *tree, | |||
426 | struct extent_state *state, u64 start, u64 end, | 426 | struct extent_state *state, u64 start, u64 end, |
427 | struct rb_node ***p, | 427 | struct rb_node ***p, |
428 | struct rb_node **parent, | 428 | struct rb_node **parent, |
429 | unsigned long *bits) | 429 | unsigned *bits) |
430 | { | 430 | { |
431 | struct rb_node *node; | 431 | struct rb_node *node; |
432 | 432 | ||
@@ -511,10 +511,10 @@ static struct extent_state *next_state(struct extent_state *state) | |||
511 | */ | 511 | */ |
512 | static struct extent_state *clear_state_bit(struct extent_io_tree *tree, | 512 | static struct extent_state *clear_state_bit(struct extent_io_tree *tree, |
513 | struct extent_state *state, | 513 | struct extent_state *state, |
514 | unsigned long *bits, int wake) | 514 | unsigned *bits, int wake) |
515 | { | 515 | { |
516 | struct extent_state *next; | 516 | struct extent_state *next; |
517 | unsigned long bits_to_clear = *bits & ~EXTENT_CTLBITS; | 517 | unsigned bits_to_clear = *bits & ~EXTENT_CTLBITS; |
518 | 518 | ||
519 | if ((bits_to_clear & EXTENT_DIRTY) && (state->state & EXTENT_DIRTY)) { | 519 | if ((bits_to_clear & EXTENT_DIRTY) && (state->state & EXTENT_DIRTY)) { |
520 | u64 range = state->end - state->start + 1; | 520 | u64 range = state->end - state->start + 1; |
@@ -570,7 +570,7 @@ static void extent_io_tree_panic(struct extent_io_tree *tree, int err) | |||
570 | * This takes the tree lock, and returns 0 on success and < 0 on error. | 570 | * This takes the tree lock, and returns 0 on success and < 0 on error. |
571 | */ | 571 | */ |
572 | int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 572 | int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
573 | unsigned long bits, int wake, int delete, | 573 | unsigned bits, int wake, int delete, |
574 | struct extent_state **cached_state, | 574 | struct extent_state **cached_state, |
575 | gfp_t mask) | 575 | gfp_t mask) |
576 | { | 576 | { |
@@ -789,9 +789,9 @@ out: | |||
789 | 789 | ||
790 | static void set_state_bits(struct extent_io_tree *tree, | 790 | static void set_state_bits(struct extent_io_tree *tree, |
791 | struct extent_state *state, | 791 | struct extent_state *state, |
792 | unsigned long *bits) | 792 | unsigned *bits) |
793 | { | 793 | { |
794 | unsigned long bits_to_set = *bits & ~EXTENT_CTLBITS; | 794 | unsigned bits_to_set = *bits & ~EXTENT_CTLBITS; |
795 | 795 | ||
796 | set_state_cb(tree, state, bits); | 796 | set_state_cb(tree, state, bits); |
797 | if ((bits_to_set & EXTENT_DIRTY) && !(state->state & EXTENT_DIRTY)) { | 797 | if ((bits_to_set & EXTENT_DIRTY) && !(state->state & EXTENT_DIRTY)) { |
@@ -803,7 +803,7 @@ static void set_state_bits(struct extent_io_tree *tree, | |||
803 | 803 | ||
804 | static void cache_state_if_flags(struct extent_state *state, | 804 | static void cache_state_if_flags(struct extent_state *state, |
805 | struct extent_state **cached_ptr, | 805 | struct extent_state **cached_ptr, |
806 | const u64 flags) | 806 | unsigned flags) |
807 | { | 807 | { |
808 | if (cached_ptr && !(*cached_ptr)) { | 808 | if (cached_ptr && !(*cached_ptr)) { |
809 | if (!flags || (state->state & flags)) { | 809 | if (!flags || (state->state & flags)) { |
@@ -833,7 +833,7 @@ static void cache_state(struct extent_state *state, | |||
833 | 833 | ||
834 | static int __must_check | 834 | static int __must_check |
835 | __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 835 | __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
836 | unsigned long bits, unsigned long exclusive_bits, | 836 | unsigned bits, unsigned exclusive_bits, |
837 | u64 *failed_start, struct extent_state **cached_state, | 837 | u64 *failed_start, struct extent_state **cached_state, |
838 | gfp_t mask) | 838 | gfp_t mask) |
839 | { | 839 | { |
@@ -1034,7 +1034,7 @@ search_again: | |||
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 1036 | int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
1037 | unsigned long bits, u64 * failed_start, | 1037 | unsigned bits, u64 * failed_start, |
1038 | struct extent_state **cached_state, gfp_t mask) | 1038 | struct extent_state **cached_state, gfp_t mask) |
1039 | { | 1039 | { |
1040 | return __set_extent_bit(tree, start, end, bits, 0, failed_start, | 1040 | return __set_extent_bit(tree, start, end, bits, 0, failed_start, |
@@ -1060,7 +1060,7 @@ int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | |||
1060 | * boundary bits like LOCK. | 1060 | * boundary bits like LOCK. |
1061 | */ | 1061 | */ |
1062 | int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 1062 | int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
1063 | unsigned long bits, unsigned long clear_bits, | 1063 | unsigned bits, unsigned clear_bits, |
1064 | struct extent_state **cached_state, gfp_t mask) | 1064 | struct extent_state **cached_state, gfp_t mask) |
1065 | { | 1065 | { |
1066 | struct extent_state *state; | 1066 | struct extent_state *state; |
@@ -1268,14 +1268,14 @@ int set_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, | |||
1268 | } | 1268 | } |
1269 | 1269 | ||
1270 | int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, | 1270 | int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, |
1271 | unsigned long bits, gfp_t mask) | 1271 | unsigned bits, gfp_t mask) |
1272 | { | 1272 | { |
1273 | return set_extent_bit(tree, start, end, bits, NULL, | 1273 | return set_extent_bit(tree, start, end, bits, NULL, |
1274 | NULL, mask); | 1274 | NULL, mask); |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, | 1277 | int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, |
1278 | unsigned long bits, gfp_t mask) | 1278 | unsigned bits, gfp_t mask) |
1279 | { | 1279 | { |
1280 | return clear_extent_bit(tree, start, end, bits, 0, 0, NULL, mask); | 1280 | return clear_extent_bit(tree, start, end, bits, 0, 0, NULL, mask); |
1281 | } | 1281 | } |
@@ -1330,10 +1330,11 @@ int clear_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, | |||
1330 | * us if waiting is desired. | 1330 | * us if waiting is desired. |
1331 | */ | 1331 | */ |
1332 | int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, | 1332 | int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, |
1333 | unsigned long bits, struct extent_state **cached_state) | 1333 | unsigned bits, struct extent_state **cached_state) |
1334 | { | 1334 | { |
1335 | int err; | 1335 | int err; |
1336 | u64 failed_start; | 1336 | u64 failed_start; |
1337 | |||
1337 | while (1) { | 1338 | while (1) { |
1338 | err = __set_extent_bit(tree, start, end, EXTENT_LOCKED | bits, | 1339 | err = __set_extent_bit(tree, start, end, EXTENT_LOCKED | bits, |
1339 | EXTENT_LOCKED, &failed_start, | 1340 | EXTENT_LOCKED, &failed_start, |
@@ -1440,7 +1441,7 @@ static int set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end) | |||
1440 | */ | 1441 | */ |
1441 | static struct extent_state * | 1442 | static struct extent_state * |
1442 | find_first_extent_bit_state(struct extent_io_tree *tree, | 1443 | find_first_extent_bit_state(struct extent_io_tree *tree, |
1443 | u64 start, unsigned long bits) | 1444 | u64 start, unsigned bits) |
1444 | { | 1445 | { |
1445 | struct rb_node *node; | 1446 | struct rb_node *node; |
1446 | struct extent_state *state; | 1447 | struct extent_state *state; |
@@ -1474,7 +1475,7 @@ out: | |||
1474 | * If nothing was found, 1 is returned. If found something, return 0. | 1475 | * If nothing was found, 1 is returned. If found something, return 0. |
1475 | */ | 1476 | */ |
1476 | int find_first_extent_bit(struct extent_io_tree *tree, u64 start, | 1477 | int find_first_extent_bit(struct extent_io_tree *tree, u64 start, |
1477 | u64 *start_ret, u64 *end_ret, unsigned long bits, | 1478 | u64 *start_ret, u64 *end_ret, unsigned bits, |
1478 | struct extent_state **cached_state) | 1479 | struct extent_state **cached_state) |
1479 | { | 1480 | { |
1480 | struct extent_state *state; | 1481 | struct extent_state *state; |
@@ -1753,7 +1754,7 @@ out_failed: | |||
1753 | 1754 | ||
1754 | int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end, | 1755 | int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end, |
1755 | struct page *locked_page, | 1756 | struct page *locked_page, |
1756 | unsigned long clear_bits, | 1757 | unsigned clear_bits, |
1757 | unsigned long page_ops) | 1758 | unsigned long page_ops) |
1758 | { | 1759 | { |
1759 | struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree; | 1760 | struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree; |
@@ -1810,7 +1811,7 @@ int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end, | |||
1810 | */ | 1811 | */ |
1811 | u64 count_range_bits(struct extent_io_tree *tree, | 1812 | u64 count_range_bits(struct extent_io_tree *tree, |
1812 | u64 *start, u64 search_end, u64 max_bytes, | 1813 | u64 *start, u64 search_end, u64 max_bytes, |
1813 | unsigned long bits, int contig) | 1814 | unsigned bits, int contig) |
1814 | { | 1815 | { |
1815 | struct rb_node *node; | 1816 | struct rb_node *node; |
1816 | struct extent_state *state; | 1817 | struct extent_state *state; |
@@ -1928,7 +1929,7 @@ out: | |||
1928 | * range is found set. | 1929 | * range is found set. |
1929 | */ | 1930 | */ |
1930 | int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, | 1931 | int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, |
1931 | unsigned long bits, int filled, struct extent_state *cached) | 1932 | unsigned bits, int filled, struct extent_state *cached) |
1932 | { | 1933 | { |
1933 | struct extent_state *state = NULL; | 1934 | struct extent_state *state = NULL; |
1934 | struct rb_node *node; | 1935 | struct rb_node *node; |
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 71268e508b7a..695b0ccfb755 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -4,22 +4,22 @@ | |||
4 | #include <linux/rbtree.h> | 4 | #include <linux/rbtree.h> |
5 | 5 | ||
6 | /* bits for the extent state */ | 6 | /* bits for the extent state */ |
7 | #define EXTENT_DIRTY 1 | 7 | #define EXTENT_DIRTY (1U << 0) |
8 | #define EXTENT_WRITEBACK (1 << 1) | 8 | #define EXTENT_WRITEBACK (1U << 1) |
9 | #define EXTENT_UPTODATE (1 << 2) | 9 | #define EXTENT_UPTODATE (1U << 2) |
10 | #define EXTENT_LOCKED (1 << 3) | 10 | #define EXTENT_LOCKED (1U << 3) |
11 | #define EXTENT_NEW (1 << 4) | 11 | #define EXTENT_NEW (1U << 4) |
12 | #define EXTENT_DELALLOC (1 << 5) | 12 | #define EXTENT_DELALLOC (1U << 5) |
13 | #define EXTENT_DEFRAG (1 << 6) | 13 | #define EXTENT_DEFRAG (1U << 6) |
14 | #define EXTENT_BOUNDARY (1 << 9) | 14 | #define EXTENT_BOUNDARY (1U << 9) |
15 | #define EXTENT_NODATASUM (1 << 10) | 15 | #define EXTENT_NODATASUM (1U << 10) |
16 | #define EXTENT_DO_ACCOUNTING (1 << 11) | 16 | #define EXTENT_DO_ACCOUNTING (1U << 11) |
17 | #define EXTENT_FIRST_DELALLOC (1 << 12) | 17 | #define EXTENT_FIRST_DELALLOC (1U << 12) |
18 | #define EXTENT_NEED_WAIT (1 << 13) | 18 | #define EXTENT_NEED_WAIT (1U << 13) |
19 | #define EXTENT_DAMAGED (1 << 14) | 19 | #define EXTENT_DAMAGED (1U << 14) |
20 | #define EXTENT_NORESERVE (1 << 15) | 20 | #define EXTENT_NORESERVE (1U << 15) |
21 | #define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK) | 21 | #define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK) |
22 | #define EXTENT_CTLBITS (EXTENT_DO_ACCOUNTING | EXTENT_FIRST_DELALLOC) | 22 | #define EXTENT_CTLBITS (EXTENT_DO_ACCOUNTING | EXTENT_FIRST_DELALLOC) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * flags for bio submission. The high bits indicate the compression | 25 | * flags for bio submission. The high bits indicate the compression |
@@ -81,9 +81,9 @@ struct extent_io_ops { | |||
81 | int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end, | 81 | int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end, |
82 | struct extent_state *state, int uptodate); | 82 | struct extent_state *state, int uptodate); |
83 | void (*set_bit_hook)(struct inode *inode, struct extent_state *state, | 83 | void (*set_bit_hook)(struct inode *inode, struct extent_state *state, |
84 | unsigned long *bits); | 84 | unsigned *bits); |
85 | void (*clear_bit_hook)(struct inode *inode, struct extent_state *state, | 85 | void (*clear_bit_hook)(struct inode *inode, struct extent_state *state, |
86 | unsigned long *bits); | 86 | unsigned *bits); |
87 | void (*merge_extent_hook)(struct inode *inode, | 87 | void (*merge_extent_hook)(struct inode *inode, |
88 | struct extent_state *new, | 88 | struct extent_state *new, |
89 | struct extent_state *other); | 89 | struct extent_state *other); |
@@ -108,7 +108,7 @@ struct extent_state { | |||
108 | /* ADD NEW ELEMENTS AFTER THIS */ | 108 | /* ADD NEW ELEMENTS AFTER THIS */ |
109 | wait_queue_head_t wq; | 109 | wait_queue_head_t wq; |
110 | atomic_t refs; | 110 | atomic_t refs; |
111 | unsigned long state; | 111 | unsigned state; |
112 | 112 | ||
113 | /* for use by the FS */ | 113 | /* for use by the FS */ |
114 | u64 private; | 114 | u64 private; |
@@ -188,7 +188,7 @@ int try_release_extent_mapping(struct extent_map_tree *map, | |||
188 | int try_release_extent_buffer(struct page *page); | 188 | int try_release_extent_buffer(struct page *page); |
189 | int lock_extent(struct extent_io_tree *tree, u64 start, u64 end); | 189 | int lock_extent(struct extent_io_tree *tree, u64 start, u64 end); |
190 | int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, | 190 | int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, |
191 | unsigned long bits, struct extent_state **cached); | 191 | unsigned bits, struct extent_state **cached); |
192 | int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end); | 192 | int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end); |
193 | int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end, | 193 | int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end, |
194 | struct extent_state **cached, gfp_t mask); | 194 | struct extent_state **cached, gfp_t mask); |
@@ -202,21 +202,21 @@ void extent_io_exit(void); | |||
202 | 202 | ||
203 | u64 count_range_bits(struct extent_io_tree *tree, | 203 | u64 count_range_bits(struct extent_io_tree *tree, |
204 | u64 *start, u64 search_end, | 204 | u64 *start, u64 search_end, |
205 | u64 max_bytes, unsigned long bits, int contig); | 205 | u64 max_bytes, unsigned bits, int contig); |
206 | 206 | ||
207 | void free_extent_state(struct extent_state *state); | 207 | void free_extent_state(struct extent_state *state); |
208 | int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, | 208 | int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, |
209 | unsigned long bits, int filled, | 209 | unsigned bits, int filled, |
210 | struct extent_state *cached_state); | 210 | struct extent_state *cached_state); |
211 | int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, | 211 | int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, |
212 | unsigned long bits, gfp_t mask); | 212 | unsigned bits, gfp_t mask); |
213 | int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 213 | int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
214 | unsigned long bits, int wake, int delete, | 214 | unsigned bits, int wake, int delete, |
215 | struct extent_state **cached, gfp_t mask); | 215 | struct extent_state **cached, gfp_t mask); |
216 | int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, | 216 | int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, |
217 | unsigned long bits, gfp_t mask); | 217 | unsigned bits, gfp_t mask); |
218 | int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 218 | int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
219 | unsigned long bits, u64 *failed_start, | 219 | unsigned bits, u64 *failed_start, |
220 | struct extent_state **cached_state, gfp_t mask); | 220 | struct extent_state **cached_state, gfp_t mask); |
221 | int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, | 221 | int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, |
222 | struct extent_state **cached_state, gfp_t mask); | 222 | struct extent_state **cached_state, gfp_t mask); |
@@ -229,14 +229,14 @@ int set_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, | |||
229 | int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, | 229 | int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, |
230 | gfp_t mask); | 230 | gfp_t mask); |
231 | int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 231 | int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
232 | unsigned long bits, unsigned long clear_bits, | 232 | unsigned bits, unsigned clear_bits, |
233 | struct extent_state **cached_state, gfp_t mask); | 233 | struct extent_state **cached_state, gfp_t mask); |
234 | int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end, | 234 | int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end, |
235 | struct extent_state **cached_state, gfp_t mask); | 235 | struct extent_state **cached_state, gfp_t mask); |
236 | int set_extent_defrag(struct extent_io_tree *tree, u64 start, u64 end, | 236 | int set_extent_defrag(struct extent_io_tree *tree, u64 start, u64 end, |
237 | struct extent_state **cached_state, gfp_t mask); | 237 | struct extent_state **cached_state, gfp_t mask); |
238 | int find_first_extent_bit(struct extent_io_tree *tree, u64 start, | 238 | int find_first_extent_bit(struct extent_io_tree *tree, u64 start, |
239 | u64 *start_ret, u64 *end_ret, unsigned long bits, | 239 | u64 *start_ret, u64 *end_ret, unsigned bits, |
240 | struct extent_state **cached_state); | 240 | struct extent_state **cached_state); |
241 | int extent_invalidatepage(struct extent_io_tree *tree, | 241 | int extent_invalidatepage(struct extent_io_tree *tree, |
242 | struct page *page, unsigned long offset); | 242 | struct page *page, unsigned long offset); |
@@ -323,7 +323,7 @@ int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end); | |||
323 | int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end); | 323 | int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end); |
324 | int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end, | 324 | int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end, |
325 | struct page *locked_page, | 325 | struct page *locked_page, |
326 | unsigned long bits_to_clear, | 326 | unsigned bits_to_clear, |
327 | unsigned long page_ops); | 327 | unsigned long page_ops); |
328 | struct bio * | 328 | struct bio * |
329 | btrfs_bio_alloc(struct block_device *bdev, u64 first_sector, int nr_vecs, | 329 | btrfs_bio_alloc(struct block_device *bdev, u64 first_sector, int nr_vecs, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5e529208ffea..220f0c3f2df6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1604,7 +1604,7 @@ static void btrfs_del_delalloc_inode(struct btrfs_root *root, | |||
1604 | * have pending delalloc work to be done. | 1604 | * have pending delalloc work to be done. |
1605 | */ | 1605 | */ |
1606 | static void btrfs_set_bit_hook(struct inode *inode, | 1606 | static void btrfs_set_bit_hook(struct inode *inode, |
1607 | struct extent_state *state, unsigned long *bits) | 1607 | struct extent_state *state, unsigned *bits) |
1608 | { | 1608 | { |
1609 | 1609 | ||
1610 | if ((*bits & EXTENT_DEFRAG) && !(*bits & EXTENT_DELALLOC)) | 1610 | if ((*bits & EXTENT_DEFRAG) && !(*bits & EXTENT_DELALLOC)) |
@@ -1645,7 +1645,7 @@ static void btrfs_set_bit_hook(struct inode *inode, | |||
1645 | */ | 1645 | */ |
1646 | static void btrfs_clear_bit_hook(struct inode *inode, | 1646 | static void btrfs_clear_bit_hook(struct inode *inode, |
1647 | struct extent_state *state, | 1647 | struct extent_state *state, |
1648 | unsigned long *bits) | 1648 | unsigned *bits) |
1649 | { | 1649 | { |
1650 | u64 len = state->end + 1 - state->start; | 1650 | u64 len = state->end + 1 - state->start; |
1651 | 1651 | ||
diff --git a/fs/btrfs/tests/extent-io-tests.c b/fs/btrfs/tests/extent-io-tests.c index 7e99c2f98dd0..9e9f2368177d 100644 --- a/fs/btrfs/tests/extent-io-tests.c +++ b/fs/btrfs/tests/extent-io-tests.c | |||
@@ -258,8 +258,7 @@ static int test_find_delalloc(void) | |||
258 | } | 258 | } |
259 | ret = 0; | 259 | ret = 0; |
260 | out_bits: | 260 | out_bits: |
261 | clear_extent_bits(&tmp, 0, total_dirty - 1, | 261 | clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_NOFS); |
262 | (unsigned long)-1, GFP_NOFS); | ||
263 | out: | 262 | out: |
264 | if (locked_page) | 263 | if (locked_page) |
265 | page_cache_release(locked_page); | 264 | page_cache_release(locked_page); |