diff options
author | Chris Mason <clm@fb.com> | 2016-01-27 08:48:23 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-01-27 08:48:23 -0500 |
commit | d32a4e34348869a273a01139112a13fc6870f003 (patch) | |
tree | 507adf3bf14d2cafb38502c27ea8cc82b28cf11a /fs | |
parent | bf6092066f80840410e3401cd962b23d54a95713 (diff) | |
parent | 3e4c5efbb3ac7c9c4fb5f33b659fa98afe568ab1 (diff) |
Merge branch 'dev/fst-followup' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.5
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 1 | ||||
-rw-r--r-- | fs/btrfs/free-space-tree.c | 18 | ||||
-rw-r--r-- | fs/btrfs/relocation.c | 3 | ||||
-rw-r--r-- | fs/btrfs/tests/btrfs-tests.c | 10 | ||||
-rw-r--r-- | fs/btrfs/tests/extent-io-tests.c | 12 | ||||
-rw-r--r-- | fs/btrfs/tests/inode-tests.c | 8 |
6 files changed, 34 insertions, 18 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 404e894c33d9..50bed6c8b66f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -182,6 +182,7 @@ static struct btrfs_lockdep_keyset { | |||
182 | { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, | 182 | { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, |
183 | { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, | 183 | { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, |
184 | { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, | 184 | { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, |
185 | { .id = BTRFS_FREE_SPACE_TREE_OBJECTID, .name_stem = "free-space" }, | ||
185 | { .id = 0, .name_stem = "tree" }, | 186 | { .id = 0, .name_stem = "tree" }, |
186 | }; | 187 | }; |
187 | 188 | ||
diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c index 94e887f5ec4e..dfa8124effb8 100644 --- a/fs/btrfs/free-space-tree.c +++ b/fs/btrfs/free-space-tree.c | |||
@@ -154,6 +154,20 @@ static inline u32 free_space_bitmap_size(u64 size, u32 sectorsize) | |||
154 | 154 | ||
155 | static unsigned long *alloc_bitmap(u32 bitmap_size) | 155 | static unsigned long *alloc_bitmap(u32 bitmap_size) |
156 | { | 156 | { |
157 | void *mem; | ||
158 | |||
159 | /* | ||
160 | * The allocation size varies, observed numbers were < 4K up to 16K. | ||
161 | * Using vmalloc unconditionally would be too heavy, we'll try | ||
162 | * contiguous allocations first. | ||
163 | */ | ||
164 | if (bitmap_size <= PAGE_SIZE) | ||
165 | return kzalloc(bitmap_size, GFP_NOFS); | ||
166 | |||
167 | mem = kzalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_NOWARN); | ||
168 | if (mem) | ||
169 | return mem; | ||
170 | |||
157 | return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, | 171 | return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, |
158 | PAGE_KERNEL); | 172 | PAGE_KERNEL); |
159 | } | 173 | } |
@@ -290,7 +304,7 @@ int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, | |||
290 | 304 | ||
291 | ret = 0; | 305 | ret = 0; |
292 | out: | 306 | out: |
293 | vfree(bitmap); | 307 | kvfree(bitmap); |
294 | if (ret) | 308 | if (ret) |
295 | btrfs_abort_transaction(trans, root, ret); | 309 | btrfs_abort_transaction(trans, root, ret); |
296 | return ret; | 310 | return ret; |
@@ -439,7 +453,7 @@ int convert_free_space_to_extents(struct btrfs_trans_handle *trans, | |||
439 | 453 | ||
440 | ret = 0; | 454 | ret = 0; |
441 | out: | 455 | out: |
442 | vfree(bitmap); | 456 | kvfree(bitmap); |
443 | if (ret) | 457 | if (ret) |
444 | btrfs_abort_transaction(trans, root, ret); | 458 | btrfs_abort_transaction(trans, root, ret); |
445 | return ret; | 459 | return ret; |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index ef6d8fc85853..c5540302402d 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -575,7 +575,8 @@ static int is_cowonly_root(u64 root_objectid) | |||
575 | root_objectid == BTRFS_TREE_LOG_OBJECTID || | 575 | root_objectid == BTRFS_TREE_LOG_OBJECTID || |
576 | root_objectid == BTRFS_CSUM_TREE_OBJECTID || | 576 | root_objectid == BTRFS_CSUM_TREE_OBJECTID || |
577 | root_objectid == BTRFS_UUID_TREE_OBJECTID || | 577 | root_objectid == BTRFS_UUID_TREE_OBJECTID || |
578 | root_objectid == BTRFS_QUOTA_TREE_OBJECTID) | 578 | root_objectid == BTRFS_QUOTA_TREE_OBJECTID || |
579 | root_objectid == BTRFS_FREE_SPACE_TREE_OBJECTID) | ||
579 | return 1; | 580 | return 1; |
580 | return 0; | 581 | return 0; |
581 | } | 582 | } |
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c index b1d920b30070..0e1e61a7ec23 100644 --- a/fs/btrfs/tests/btrfs-tests.c +++ b/fs/btrfs/tests/btrfs-tests.c | |||
@@ -82,18 +82,18 @@ void btrfs_destroy_test_fs(void) | |||
82 | struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) | 82 | struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) |
83 | { | 83 | { |
84 | struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), | 84 | struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), |
85 | GFP_NOFS); | 85 | GFP_KERNEL); |
86 | 86 | ||
87 | if (!fs_info) | 87 | if (!fs_info) |
88 | return fs_info; | 88 | return fs_info; |
89 | fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), | 89 | fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), |
90 | GFP_NOFS); | 90 | GFP_KERNEL); |
91 | if (!fs_info->fs_devices) { | 91 | if (!fs_info->fs_devices) { |
92 | kfree(fs_info); | 92 | kfree(fs_info); |
93 | return NULL; | 93 | return NULL; |
94 | } | 94 | } |
95 | fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), | 95 | fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), |
96 | GFP_NOFS); | 96 | GFP_KERNEL); |
97 | if (!fs_info->super_copy) { | 97 | if (!fs_info->super_copy) { |
98 | kfree(fs_info->fs_devices); | 98 | kfree(fs_info->fs_devices); |
99 | kfree(fs_info); | 99 | kfree(fs_info); |
@@ -180,11 +180,11 @@ btrfs_alloc_dummy_block_group(unsigned long length) | |||
180 | { | 180 | { |
181 | struct btrfs_block_group_cache *cache; | 181 | struct btrfs_block_group_cache *cache; |
182 | 182 | ||
183 | cache = kzalloc(sizeof(*cache), GFP_NOFS); | 183 | cache = kzalloc(sizeof(*cache), GFP_KERNEL); |
184 | if (!cache) | 184 | if (!cache) |
185 | return NULL; | 185 | return NULL; |
186 | cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), | 186 | cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), |
187 | GFP_NOFS); | 187 | GFP_KERNEL); |
188 | if (!cache->free_space_ctl) { | 188 | if (!cache->free_space_ctl) { |
189 | kfree(cache); | 189 | kfree(cache); |
190 | return NULL; | 190 | return NULL; |
diff --git a/fs/btrfs/tests/extent-io-tests.c b/fs/btrfs/tests/extent-io-tests.c index e29fa297e053..669b58201e36 100644 --- a/fs/btrfs/tests/extent-io-tests.c +++ b/fs/btrfs/tests/extent-io-tests.c | |||
@@ -94,7 +94,7 @@ static int test_find_delalloc(void) | |||
94 | * test. | 94 | * test. |
95 | */ | 95 | */ |
96 | for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { | 96 | for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { |
97 | page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); | 97 | page = find_or_create_page(inode->i_mapping, index, GFP_KERNEL); |
98 | if (!page) { | 98 | if (!page) { |
99 | test_msg("Failed to allocate test page\n"); | 99 | test_msg("Failed to allocate test page\n"); |
100 | ret = -ENOMEM; | 100 | ret = -ENOMEM; |
@@ -113,7 +113,7 @@ static int test_find_delalloc(void) | |||
113 | * |--- delalloc ---| | 113 | * |--- delalloc ---| |
114 | * |--- search ---| | 114 | * |--- search ---| |
115 | */ | 115 | */ |
116 | set_extent_delalloc(&tmp, 0, 4095, NULL, GFP_NOFS); | 116 | set_extent_delalloc(&tmp, 0, 4095, NULL, GFP_KERNEL); |
117 | start = 0; | 117 | start = 0; |
118 | end = 0; | 118 | end = 0; |
119 | found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, | 119 | found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, |
@@ -144,7 +144,7 @@ static int test_find_delalloc(void) | |||
144 | test_msg("Couldn't find the locked page\n"); | 144 | test_msg("Couldn't find the locked page\n"); |
145 | goto out_bits; | 145 | goto out_bits; |
146 | } | 146 | } |
147 | set_extent_delalloc(&tmp, 4096, max_bytes - 1, NULL, GFP_NOFS); | 147 | set_extent_delalloc(&tmp, 4096, max_bytes - 1, NULL, GFP_KERNEL); |
148 | start = test_start; | 148 | start = test_start; |
149 | end = 0; | 149 | end = 0; |
150 | found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, | 150 | found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, |
@@ -199,7 +199,7 @@ static int test_find_delalloc(void) | |||
199 | * | 199 | * |
200 | * We are re-using our test_start from above since it works out well. | 200 | * We are re-using our test_start from above since it works out well. |
201 | */ | 201 | */ |
202 | set_extent_delalloc(&tmp, max_bytes, total_dirty - 1, NULL, GFP_NOFS); | 202 | set_extent_delalloc(&tmp, max_bytes, total_dirty - 1, NULL, GFP_KERNEL); |
203 | start = test_start; | 203 | start = test_start; |
204 | end = 0; | 204 | end = 0; |
205 | found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, | 205 | found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, |
@@ -262,7 +262,7 @@ static int test_find_delalloc(void) | |||
262 | } | 262 | } |
263 | ret = 0; | 263 | ret = 0; |
264 | out_bits: | 264 | out_bits: |
265 | clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_NOFS); | 265 | clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_KERNEL); |
266 | out: | 266 | out: |
267 | if (locked_page) | 267 | if (locked_page) |
268 | page_cache_release(locked_page); | 268 | page_cache_release(locked_page); |
@@ -360,7 +360,7 @@ static int test_eb_bitmaps(void) | |||
360 | 360 | ||
361 | test_msg("Running extent buffer bitmap tests\n"); | 361 | test_msg("Running extent buffer bitmap tests\n"); |
362 | 362 | ||
363 | bitmap = kmalloc(len, GFP_NOFS); | 363 | bitmap = kmalloc(len, GFP_KERNEL); |
364 | if (!bitmap) { | 364 | if (!bitmap) { |
365 | test_msg("Couldn't allocate test bitmap\n"); | 365 | test_msg("Couldn't allocate test bitmap\n"); |
366 | return -ENOMEM; | 366 | return -ENOMEM; |
diff --git a/fs/btrfs/tests/inode-tests.c b/fs/btrfs/tests/inode-tests.c index 5de55fdd28bc..e2d3da02deee 100644 --- a/fs/btrfs/tests/inode-tests.c +++ b/fs/btrfs/tests/inode-tests.c | |||
@@ -974,7 +974,7 @@ static int test_extent_accounting(void) | |||
974 | (BTRFS_MAX_EXTENT_SIZE >> 1) + 4095, | 974 | (BTRFS_MAX_EXTENT_SIZE >> 1) + 4095, |
975 | EXTENT_DELALLOC | EXTENT_DIRTY | | 975 | EXTENT_DELALLOC | EXTENT_DIRTY | |
976 | EXTENT_UPTODATE | EXTENT_DO_ACCOUNTING, 0, 0, | 976 | EXTENT_UPTODATE | EXTENT_DO_ACCOUNTING, 0, 0, |
977 | NULL, GFP_NOFS); | 977 | NULL, GFP_KERNEL); |
978 | if (ret) { | 978 | if (ret) { |
979 | test_msg("clear_extent_bit returned %d\n", ret); | 979 | test_msg("clear_extent_bit returned %d\n", ret); |
980 | goto out; | 980 | goto out; |
@@ -1045,7 +1045,7 @@ static int test_extent_accounting(void) | |||
1045 | BTRFS_MAX_EXTENT_SIZE+8191, | 1045 | BTRFS_MAX_EXTENT_SIZE+8191, |
1046 | EXTENT_DIRTY | EXTENT_DELALLOC | | 1046 | EXTENT_DIRTY | EXTENT_DELALLOC | |
1047 | EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, | 1047 | EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, |
1048 | NULL, GFP_NOFS); | 1048 | NULL, GFP_KERNEL); |
1049 | if (ret) { | 1049 | if (ret) { |
1050 | test_msg("clear_extent_bit returned %d\n", ret); | 1050 | test_msg("clear_extent_bit returned %d\n", ret); |
1051 | goto out; | 1051 | goto out; |
@@ -1079,7 +1079,7 @@ static int test_extent_accounting(void) | |||
1079 | ret = clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, (u64)-1, | 1079 | ret = clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, (u64)-1, |
1080 | EXTENT_DIRTY | EXTENT_DELALLOC | | 1080 | EXTENT_DIRTY | EXTENT_DELALLOC | |
1081 | EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, | 1081 | EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, |
1082 | NULL, GFP_NOFS); | 1082 | NULL, GFP_KERNEL); |
1083 | if (ret) { | 1083 | if (ret) { |
1084 | test_msg("clear_extent_bit returned %d\n", ret); | 1084 | test_msg("clear_extent_bit returned %d\n", ret); |
1085 | goto out; | 1085 | goto out; |
@@ -1096,7 +1096,7 @@ out: | |||
1096 | clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, (u64)-1, | 1096 | clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, (u64)-1, |
1097 | EXTENT_DIRTY | EXTENT_DELALLOC | | 1097 | EXTENT_DIRTY | EXTENT_DELALLOC | |
1098 | EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, | 1098 | EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, |
1099 | NULL, GFP_NOFS); | 1099 | NULL, GFP_KERNEL); |
1100 | iput(inode); | 1100 | iput(inode); |
1101 | btrfs_free_dummy_root(root); | 1101 | btrfs_free_dummy_root(root); |
1102 | return ret; | 1102 | return ret; |