Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'dev/fst-followup' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.5

+34 -18
+1
fs/btrfs/disk-io.c
··· 182 182 { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, 183 183 { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, 184 184 { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, 185 + { .id = BTRFS_FREE_SPACE_TREE_OBJECTID, .name_stem = "free-space" }, 185 186 { .id = 0, .name_stem = "tree" }, 186 187 }; 187 188
+16 -2
fs/btrfs/free-space-tree.c
··· 154 154 155 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 171 return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, 158 172 PAGE_KERNEL); 159 173 } ··· 304 290 305 291 ret = 0; 306 292 out: 307 - vfree(bitmap); 293 + kvfree(bitmap); 308 294 if (ret) 309 295 btrfs_abort_transaction(trans, root, ret); 310 296 return ret; ··· 453 439 454 440 ret = 0; 455 441 out: 456 - vfree(bitmap); 442 + kvfree(bitmap); 457 443 if (ret) 458 444 btrfs_abort_transaction(trans, root, ret); 459 445 return ret;
+2 -1
fs/btrfs/relocation.c
··· 575 575 root_objectid == BTRFS_TREE_LOG_OBJECTID || 576 576 root_objectid == BTRFS_CSUM_TREE_OBJECTID || 577 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 580 return 1; 580 581 return 0; 581 582 }
+5 -5
fs/btrfs/tests/btrfs-tests.c
··· 82 82 struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) 83 83 { 84 84 struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), 85 - GFP_NOFS); 85 + GFP_KERNEL); 86 86 87 87 if (!fs_info) 88 88 return fs_info; 89 89 fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), 90 - GFP_NOFS); 90 + GFP_KERNEL); 91 91 if (!fs_info->fs_devices) { 92 92 kfree(fs_info); 93 93 return NULL; 94 94 } 95 95 fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), 96 - GFP_NOFS); 96 + GFP_KERNEL); 97 97 if (!fs_info->super_copy) { 98 98 kfree(fs_info->fs_devices); 99 99 kfree(fs_info); ··· 180 180 { 181 181 struct btrfs_block_group_cache *cache; 182 182 183 - cache = kzalloc(sizeof(*cache), GFP_NOFS); 183 + cache = kzalloc(sizeof(*cache), GFP_KERNEL); 184 184 if (!cache) 185 185 return NULL; 186 186 cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), 187 - GFP_NOFS); 187 + GFP_KERNEL); 188 188 if (!cache->free_space_ctl) { 189 189 kfree(cache); 190 190 return NULL;
+6 -6
fs/btrfs/tests/extent-io-tests.c
··· 94 94 * test. 95 95 */ 96 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 98 if (!page) { 99 99 test_msg("Failed to allocate test page\n"); 100 100 ret = -ENOMEM; ··· 113 113 * |--- delalloc ---| 114 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 117 start = 0; 118 118 end = 0; 119 119 found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, ··· 144 144 test_msg("Couldn't find the locked page\n"); 145 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 148 start = test_start; 149 149 end = 0; 150 150 found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, ··· 199 199 * 200 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 203 start = test_start; 204 204 end = 0; 205 205 found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, ··· 262 262 } 263 263 ret = 0; 264 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 266 out: 267 267 if (locked_page) 268 268 page_cache_release(locked_page); ··· 360 360 361 361 test_msg("Running extent buffer bitmap tests\n"); 362 362 363 - bitmap = kmalloc(len, GFP_NOFS); 363 + bitmap = kmalloc(len, GFP_KERNEL); 364 364 if (!bitmap) { 365 365 test_msg("Couldn't allocate test bitmap\n"); 366 366 return -ENOMEM;
+4 -4
fs/btrfs/tests/inode-tests.c
··· 974 974 (BTRFS_MAX_EXTENT_SIZE >> 1) + 4095, 975 975 EXTENT_DELALLOC | EXTENT_DIRTY | 976 976 EXTENT_UPTODATE | EXTENT_DO_ACCOUNTING, 0, 0, 977 - NULL, GFP_NOFS); 977 + NULL, GFP_KERNEL); 978 978 if (ret) { 979 979 test_msg("clear_extent_bit returned %d\n", ret); 980 980 goto out; ··· 1045 1045 BTRFS_MAX_EXTENT_SIZE+8191, 1046 1046 EXTENT_DIRTY | EXTENT_DELALLOC | 1047 1047 EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, 1048 - NULL, GFP_NOFS); 1048 + NULL, GFP_KERNEL); 1049 1049 if (ret) { 1050 1050 test_msg("clear_extent_bit returned %d\n", ret); 1051 1051 goto out; ··· 1079 1079 ret = clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, (u64)-1, 1080 1080 EXTENT_DIRTY | EXTENT_DELALLOC | 1081 1081 EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, 1082 - NULL, GFP_NOFS); 1082 + NULL, GFP_KERNEL); 1083 1083 if (ret) { 1084 1084 test_msg("clear_extent_bit returned %d\n", ret); 1085 1085 goto out; ··· 1096 1096 clear_extent_bit(&BTRFS_I(inode)->io_tree, 0, (u64)-1, 1097 1097 EXTENT_DIRTY | EXTENT_DELALLOC | 1098 1098 EXTENT_DO_ACCOUNTING | EXTENT_UPTODATE, 0, 0, 1099 - NULL, GFP_NOFS); 1099 + NULL, GFP_KERNEL); 1100 1100 iput(inode); 1101 1101 btrfs_free_dummy_root(root); 1102 1102 return ret;