Loading fs/btrfs/disk-io.c +1 −0 Original line number Original line Diff line number Diff line Loading @@ -182,6 +182,7 @@ static struct btrfs_lockdep_keyset { { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, { .id = BTRFS_FREE_SPACE_TREE_OBJECTID, .name_stem = "free-space" }, { .id = 0, .name_stem = "tree" }, { .id = 0, .name_stem = "tree" }, }; }; Loading fs/btrfs/free-space-tree.c +16 −2 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,20 @@ static inline u32 free_space_bitmap_size(u64 size, u32 sectorsize) static unsigned long *alloc_bitmap(u32 bitmap_size) static unsigned long *alloc_bitmap(u32 bitmap_size) { { void *mem; /* * The allocation size varies, observed numbers were < 4K up to 16K. * Using vmalloc unconditionally would be too heavy, we'll try * contiguous allocations first. */ if (bitmap_size <= PAGE_SIZE) return kzalloc(bitmap_size, GFP_NOFS); mem = kzalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_NOWARN); if (mem) return mem; return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); PAGE_KERNEL); } } Loading Loading @@ -290,7 +304,7 @@ int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, ret = 0; ret = 0; out: out: vfree(bitmap); kvfree(bitmap); if (ret) if (ret) btrfs_abort_transaction(trans, root, ret); btrfs_abort_transaction(trans, root, ret); return ret; return ret; Loading Loading @@ -439,7 +453,7 @@ int convert_free_space_to_extents(struct btrfs_trans_handle *trans, ret = 0; ret = 0; out: out: vfree(bitmap); kvfree(bitmap); if (ret) if (ret) btrfs_abort_transaction(trans, root, ret); btrfs_abort_transaction(trans, root, ret); return ret; return ret; Loading fs/btrfs/relocation.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -575,7 +575,8 @@ static int is_cowonly_root(u64 root_objectid) root_objectid == BTRFS_TREE_LOG_OBJECTID || root_objectid == BTRFS_TREE_LOG_OBJECTID || root_objectid == BTRFS_CSUM_TREE_OBJECTID || root_objectid == BTRFS_CSUM_TREE_OBJECTID || root_objectid == BTRFS_UUID_TREE_OBJECTID || root_objectid == BTRFS_UUID_TREE_OBJECTID || root_objectid == BTRFS_QUOTA_TREE_OBJECTID) root_objectid == BTRFS_QUOTA_TREE_OBJECTID || root_objectid == BTRFS_FREE_SPACE_TREE_OBJECTID) return 1; return 1; return 0; return 0; } } Loading fs/btrfs/tests/btrfs-tests.c +5 −5 Original line number Original line Diff line number Diff line Loading @@ -82,18 +82,18 @@ void btrfs_destroy_test_fs(void) struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) { { struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_NOFS); GFP_KERNEL); if (!fs_info) if (!fs_info) return fs_info; return fs_info; fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), GFP_NOFS); GFP_KERNEL); if (!fs_info->fs_devices) { if (!fs_info->fs_devices) { kfree(fs_info); kfree(fs_info); return NULL; return NULL; } } fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), GFP_NOFS); GFP_KERNEL); if (!fs_info->super_copy) { if (!fs_info->super_copy) { kfree(fs_info->fs_devices); kfree(fs_info->fs_devices); kfree(fs_info); kfree(fs_info); Loading Loading @@ -180,11 +180,11 @@ btrfs_alloc_dummy_block_group(unsigned long length) { { struct btrfs_block_group_cache *cache; struct btrfs_block_group_cache *cache; cache = kzalloc(sizeof(*cache), GFP_NOFS); cache = kzalloc(sizeof(*cache), GFP_KERNEL); if (!cache) if (!cache) return NULL; return NULL; cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), GFP_NOFS); GFP_KERNEL); if (!cache->free_space_ctl) { if (!cache->free_space_ctl) { kfree(cache); kfree(cache); return NULL; return NULL; Loading fs/btrfs/tests/extent-io-tests.c +6 −6 Original line number Original line Diff line number Diff line Loading @@ -94,7 +94,7 @@ static int test_find_delalloc(void) * test. * test. */ */ for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); page = find_or_create_page(inode->i_mapping, index, GFP_KERNEL); if (!page) { if (!page) { test_msg("Failed to allocate test page\n"); test_msg("Failed to allocate test page\n"); ret = -ENOMEM; ret = -ENOMEM; Loading @@ -113,7 +113,7 @@ static int test_find_delalloc(void) * |--- delalloc ---| * |--- delalloc ---| * |--- search ---| * |--- search ---| */ */ set_extent_delalloc(&tmp, 0, 4095, NULL, GFP_NOFS); set_extent_delalloc(&tmp, 0, 4095, NULL, GFP_KERNEL); start = 0; start = 0; end = 0; end = 0; found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, Loading Loading @@ -144,7 +144,7 @@ static int test_find_delalloc(void) test_msg("Couldn't find the locked page\n"); test_msg("Couldn't find the locked page\n"); goto out_bits; goto out_bits; } } set_extent_delalloc(&tmp, 4096, max_bytes - 1, NULL, GFP_NOFS); set_extent_delalloc(&tmp, 4096, max_bytes - 1, NULL, GFP_KERNEL); start = test_start; start = test_start; end = 0; end = 0; found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, Loading Loading @@ -199,7 +199,7 @@ static int test_find_delalloc(void) * * * We are re-using our test_start from above since it works out well. * We are re-using our test_start from above since it works out well. */ */ set_extent_delalloc(&tmp, max_bytes, total_dirty - 1, NULL, GFP_NOFS); set_extent_delalloc(&tmp, max_bytes, total_dirty - 1, NULL, GFP_KERNEL); start = test_start; start = test_start; end = 0; end = 0; found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, Loading Loading @@ -262,7 +262,7 @@ static int test_find_delalloc(void) } } ret = 0; ret = 0; out_bits: out_bits: clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_NOFS); clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_KERNEL); out: out: if (locked_page) if (locked_page) page_cache_release(locked_page); page_cache_release(locked_page); Loading Loading @@ -360,7 +360,7 @@ static int test_eb_bitmaps(void) test_msg("Running extent buffer bitmap tests\n"); test_msg("Running extent buffer bitmap tests\n"); bitmap = kmalloc(len, GFP_NOFS); bitmap = kmalloc(len, GFP_KERNEL); if (!bitmap) { if (!bitmap) { test_msg("Couldn't allocate test bitmap\n"); test_msg("Couldn't allocate test bitmap\n"); return -ENOMEM; return -ENOMEM; Loading Loading
fs/btrfs/disk-io.c +1 −0 Original line number Original line Diff line number Diff line Loading @@ -182,6 +182,7 @@ static struct btrfs_lockdep_keyset { { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, { .id = BTRFS_TREE_RELOC_OBJECTID, .name_stem = "treloc" }, { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, .name_stem = "dreloc" }, { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, { .id = BTRFS_UUID_TREE_OBJECTID, .name_stem = "uuid" }, { .id = BTRFS_FREE_SPACE_TREE_OBJECTID, .name_stem = "free-space" }, { .id = 0, .name_stem = "tree" }, { .id = 0, .name_stem = "tree" }, }; }; Loading
fs/btrfs/free-space-tree.c +16 −2 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,20 @@ static inline u32 free_space_bitmap_size(u64 size, u32 sectorsize) static unsigned long *alloc_bitmap(u32 bitmap_size) static unsigned long *alloc_bitmap(u32 bitmap_size) { { void *mem; /* * The allocation size varies, observed numbers were < 4K up to 16K. * Using vmalloc unconditionally would be too heavy, we'll try * contiguous allocations first. */ if (bitmap_size <= PAGE_SIZE) return kzalloc(bitmap_size, GFP_NOFS); mem = kzalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_NOWARN); if (mem) return mem; return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, return __vmalloc(bitmap_size, GFP_NOFS | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); PAGE_KERNEL); } } Loading Loading @@ -290,7 +304,7 @@ int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, ret = 0; ret = 0; out: out: vfree(bitmap); kvfree(bitmap); if (ret) if (ret) btrfs_abort_transaction(trans, root, ret); btrfs_abort_transaction(trans, root, ret); return ret; return ret; Loading Loading @@ -439,7 +453,7 @@ int convert_free_space_to_extents(struct btrfs_trans_handle *trans, ret = 0; ret = 0; out: out: vfree(bitmap); kvfree(bitmap); if (ret) if (ret) btrfs_abort_transaction(trans, root, ret); btrfs_abort_transaction(trans, root, ret); return ret; return ret; Loading
fs/btrfs/relocation.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -575,7 +575,8 @@ static int is_cowonly_root(u64 root_objectid) root_objectid == BTRFS_TREE_LOG_OBJECTID || root_objectid == BTRFS_TREE_LOG_OBJECTID || root_objectid == BTRFS_CSUM_TREE_OBJECTID || root_objectid == BTRFS_CSUM_TREE_OBJECTID || root_objectid == BTRFS_UUID_TREE_OBJECTID || root_objectid == BTRFS_UUID_TREE_OBJECTID || root_objectid == BTRFS_QUOTA_TREE_OBJECTID) root_objectid == BTRFS_QUOTA_TREE_OBJECTID || root_objectid == BTRFS_FREE_SPACE_TREE_OBJECTID) return 1; return 1; return 0; return 0; } } Loading
fs/btrfs/tests/btrfs-tests.c +5 −5 Original line number Original line Diff line number Diff line Loading @@ -82,18 +82,18 @@ void btrfs_destroy_test_fs(void) struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void) { { struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_NOFS); GFP_KERNEL); if (!fs_info) if (!fs_info) return fs_info; return fs_info; fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), GFP_NOFS); GFP_KERNEL); if (!fs_info->fs_devices) { if (!fs_info->fs_devices) { kfree(fs_info); kfree(fs_info); return NULL; return NULL; } } fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), GFP_NOFS); GFP_KERNEL); if (!fs_info->super_copy) { if (!fs_info->super_copy) { kfree(fs_info->fs_devices); kfree(fs_info->fs_devices); kfree(fs_info); kfree(fs_info); Loading Loading @@ -180,11 +180,11 @@ btrfs_alloc_dummy_block_group(unsigned long length) { { struct btrfs_block_group_cache *cache; struct btrfs_block_group_cache *cache; cache = kzalloc(sizeof(*cache), GFP_NOFS); cache = kzalloc(sizeof(*cache), GFP_KERNEL); if (!cache) if (!cache) return NULL; return NULL; cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), GFP_NOFS); GFP_KERNEL); if (!cache->free_space_ctl) { if (!cache->free_space_ctl) { kfree(cache); kfree(cache); return NULL; return NULL; Loading
fs/btrfs/tests/extent-io-tests.c +6 −6 Original line number Original line Diff line number Diff line Loading @@ -94,7 +94,7 @@ static int test_find_delalloc(void) * test. * test. */ */ for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); page = find_or_create_page(inode->i_mapping, index, GFP_KERNEL); if (!page) { if (!page) { test_msg("Failed to allocate test page\n"); test_msg("Failed to allocate test page\n"); ret = -ENOMEM; ret = -ENOMEM; Loading @@ -113,7 +113,7 @@ static int test_find_delalloc(void) * |--- delalloc ---| * |--- delalloc ---| * |--- search ---| * |--- search ---| */ */ set_extent_delalloc(&tmp, 0, 4095, NULL, GFP_NOFS); set_extent_delalloc(&tmp, 0, 4095, NULL, GFP_KERNEL); start = 0; start = 0; end = 0; end = 0; found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, Loading Loading @@ -144,7 +144,7 @@ static int test_find_delalloc(void) test_msg("Couldn't find the locked page\n"); test_msg("Couldn't find the locked page\n"); goto out_bits; goto out_bits; } } set_extent_delalloc(&tmp, 4096, max_bytes - 1, NULL, GFP_NOFS); set_extent_delalloc(&tmp, 4096, max_bytes - 1, NULL, GFP_KERNEL); start = test_start; start = test_start; end = 0; end = 0; found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, Loading Loading @@ -199,7 +199,7 @@ static int test_find_delalloc(void) * * * We are re-using our test_start from above since it works out well. * We are re-using our test_start from above since it works out well. */ */ set_extent_delalloc(&tmp, max_bytes, total_dirty - 1, NULL, GFP_NOFS); set_extent_delalloc(&tmp, max_bytes, total_dirty - 1, NULL, GFP_KERNEL); start = test_start; start = test_start; end = 0; end = 0; found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, found = find_lock_delalloc_range(inode, &tmp, locked_page, &start, Loading Loading @@ -262,7 +262,7 @@ static int test_find_delalloc(void) } } ret = 0; ret = 0; out_bits: out_bits: clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_NOFS); clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_KERNEL); out: out: if (locked_page) if (locked_page) page_cache_release(locked_page); page_cache_release(locked_page); Loading Loading @@ -360,7 +360,7 @@ static int test_eb_bitmaps(void) test_msg("Running extent buffer bitmap tests\n"); test_msg("Running extent buffer bitmap tests\n"); bitmap = kmalloc(len, GFP_NOFS); bitmap = kmalloc(len, GFP_KERNEL); if (!bitmap) { if (!bitmap) { test_msg("Couldn't allocate test bitmap\n"); test_msg("Couldn't allocate test bitmap\n"); return -ENOMEM; return -ENOMEM; Loading