Loading fs/btrfs/acl.c +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode) return 0; acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); if (IS_ERR(acl) || !acl) if (IS_ERR_OR_NULL(acl)) return PTR_ERR(acl); clone = posix_acl_clone(acl, GFP_KERNEL); Loading fs/btrfs/compression.c +21 −21 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, struct compressed_bio *cb; unsigned long bytes_left; struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; int page_index = 0; int pg_index = 0; struct page *page; u64 first_byte = disk_start; struct block_device *bdev; Loading Loading @@ -367,8 +367,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, /* create and submit bios for the compressed pages */ bytes_left = compressed_len; for (page_index = 0; page_index < cb->nr_pages; page_index++) { page = compressed_pages[page_index]; for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) { page = compressed_pages[pg_index]; page->mapping = inode->i_mapping; if (bio->bi_size) ret = io_tree->ops->merge_bio_hook(page, 0, Loading Loading @@ -433,7 +433,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, struct compressed_bio *cb) { unsigned long end_index; unsigned long page_index; unsigned long pg_index; u64 last_offset; u64 isize = i_size_read(inode); int ret; Loading @@ -457,13 +457,13 @@ static noinline int add_ra_bio_pages(struct inode *inode, end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; while (last_offset < compressed_end) { page_index = last_offset >> PAGE_CACHE_SHIFT; pg_index = last_offset >> PAGE_CACHE_SHIFT; if (page_index > end_index) if (pg_index > end_index) break; rcu_read_lock(); page = radix_tree_lookup(&mapping->page_tree, page_index); page = radix_tree_lookup(&mapping->page_tree, pg_index); rcu_read_unlock(); if (page) { misses++; Loading @@ -477,7 +477,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, if (!page) break; if (add_to_page_cache_lru(page, mapping, page_index, if (add_to_page_cache_lru(page, mapping, pg_index, GFP_NOFS)) { page_cache_release(page); goto next; Loading Loading @@ -561,7 +561,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE; unsigned long compressed_len; unsigned long nr_pages; unsigned long page_index; unsigned long pg_index; struct page *page; struct block_device *bdev; struct bio *comp_bio; Loading Loading @@ -614,10 +614,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; for (page_index = 0; page_index < nr_pages; page_index++) { cb->compressed_pages[page_index] = alloc_page(GFP_NOFS | for (pg_index = 0; pg_index < nr_pages; pg_index++) { cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS | __GFP_HIGHMEM); if (!cb->compressed_pages[page_index]) if (!cb->compressed_pages[pg_index]) goto fail2; } cb->nr_pages = nr_pages; Loading @@ -635,8 +635,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, comp_bio->bi_end_io = end_compressed_bio_read; atomic_inc(&cb->pending_bios); for (page_index = 0; page_index < nr_pages; page_index++) { page = cb->compressed_pages[page_index]; for (pg_index = 0; pg_index < nr_pages; pg_index++) { page = cb->compressed_pages[pg_index]; page->mapping = inode->i_mapping; page->index = em_start >> PAGE_CACHE_SHIFT; Loading Loading @@ -703,8 +703,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, return 0; fail2: for (page_index = 0; page_index < nr_pages; page_index++) free_page((unsigned long)cb->compressed_pages[page_index]); for (pg_index = 0; pg_index < nr_pages; pg_index++) free_page((unsigned long)cb->compressed_pages[pg_index]); kfree(cb->compressed_pages); fail1: Loading Loading @@ -946,7 +946,7 @@ void btrfs_exit_compress(void) int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, unsigned long total_out, u64 disk_start, struct bio_vec *bvec, int vcnt, unsigned long *page_index, unsigned long *pg_index, unsigned long *pg_offset) { unsigned long buf_offset; Loading @@ -955,7 +955,7 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, unsigned long working_bytes = total_out - buf_start; unsigned long bytes; char *kaddr; struct page *page_out = bvec[*page_index].bv_page; struct page *page_out = bvec[*pg_index].bv_page; /* * start byte is the first byte of the page we're currently Loading Loading @@ -996,11 +996,11 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, /* check if we need to pick another page */ if (*pg_offset == PAGE_CACHE_SIZE) { (*page_index)++; if (*page_index >= vcnt) (*pg_index)++; if (*pg_index >= vcnt) return 0; page_out = bvec[*page_index].bv_page; page_out = bvec[*pg_index].bv_page; *pg_offset = 0; start_byte = page_offset(page_out) - disk_start; Loading fs/btrfs/compression.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page, int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, unsigned long total_out, u64 disk_start, struct bio_vec *bvec, int vcnt, unsigned long *page_index, unsigned long *pg_index, unsigned long *pg_offset); int btrfs_submit_compressed_write(struct inode *inode, u64 start, Loading fs/btrfs/ctree.c +14 −15 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ void btrfs_free_path(struct btrfs_path *p) { if (!p) return; btrfs_release_path(NULL, p); btrfs_release_path(p); kmem_cache_free(btrfs_path_cachep, p); } Loading @@ -112,7 +112,7 @@ void btrfs_free_path(struct btrfs_path *p) * * It is safe to call this on paths that no locks or extent buffers held. */ noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p) noinline void btrfs_release_path(struct btrfs_path *p) { int i; Loading Loading @@ -1323,7 +1323,7 @@ static noinline int reada_for_balance(struct btrfs_root *root, ret = -EAGAIN; /* release the whole path */ btrfs_release_path(root, path); btrfs_release_path(path); /* read the blocks */ if (block1) Loading Loading @@ -1470,7 +1470,7 @@ read_block_for_search(struct btrfs_trans_handle *trans, return 0; } free_extent_buffer(tmp); btrfs_release_path(NULL, p); btrfs_release_path(p); return -EIO; } } Loading @@ -1489,7 +1489,7 @@ read_block_for_search(struct btrfs_trans_handle *trans, if (p->reada) reada_for_search(root, p, level, slot, key->objectid); btrfs_release_path(NULL, p); btrfs_release_path(p); ret = -EAGAIN; tmp = read_tree_block(root, blocknr, blocksize, 0); Loading Loading @@ -1558,7 +1558,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans, } b = p->nodes[level]; if (!b) { btrfs_release_path(NULL, p); btrfs_release_path(p); goto again; } BUG_ON(btrfs_header_nritems(b) == 1); Loading Loading @@ -1748,7 +1748,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root if (!p->leave_spinning) btrfs_set_path_blocking(p); if (ret < 0) btrfs_release_path(root, p); btrfs_release_path(p); return ret; } Loading Loading @@ -3021,7 +3021,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans, struct btrfs_file_extent_item); extent_len = btrfs_file_extent_num_bytes(leaf, fi); } btrfs_release_path(root, path); btrfs_release_path(path); path->keep_locks = 1; path->search_for_split = 1; Loading Loading @@ -3641,7 +3641,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans, ret = 0; if (slot == 0) { struct btrfs_disk_key disk_key; btrfs_cpu_key_to_disk(&disk_key, cpu_key); ret = fixup_low_keys(trans, root, path, &disk_key, 1); } Loading Loading @@ -3943,7 +3942,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) else return 1; btrfs_release_path(root, path); btrfs_release_path(path); ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) return ret; Loading Loading @@ -4067,7 +4066,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key, sret = btrfs_find_next_key(root, path, min_key, level, cache_only, min_trans); if (sret == 0) { btrfs_release_path(root, path); btrfs_release_path(path); goto again; } else { goto out; Loading Loading @@ -4146,7 +4145,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path, btrfs_node_key_to_cpu(c, &cur_key, slot); orig_lowest = path->lowest_level; btrfs_release_path(root, path); btrfs_release_path(path); path->lowest_level = level; ret = btrfs_search_slot(NULL, root, &cur_key, path, 0, 0); Loading Loading @@ -4223,7 +4222,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) again: level = 1; next = NULL; btrfs_release_path(root, path); btrfs_release_path(path); path->keep_locks = 1; Loading Loading @@ -4279,7 +4278,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) goto again; if (ret < 0) { btrfs_release_path(root, path); btrfs_release_path(path); goto done; } Loading Loading @@ -4318,7 +4317,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) goto again; if (ret < 0) { btrfs_release_path(root, path); btrfs_release_path(path); goto done; } Loading fs/btrfs/ctree.h +6 −96 Original line number Diff line number Diff line Loading @@ -746,12 +746,12 @@ struct btrfs_space_info { */ unsigned long reservation_progress; int full:1; /* indicates that we cannot allocate any more unsigned int full:1; /* indicates that we cannot allocate any more chunks for this space */ int chunk_alloc:1; /* set if we are allocating a chunk */ unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ int force_alloc; /* set if we need to force a chunk alloc for this space */ unsigned int force_alloc; /* set if we need to force a chunk alloc for this space */ struct list_head list; Loading Loading @@ -1463,26 +1463,12 @@ static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb, return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr)); } static inline void btrfs_set_stripe_offset_nr(struct extent_buffer *eb, struct btrfs_chunk *c, int nr, u64 val) { btrfs_set_stripe_offset(eb, btrfs_stripe_nr(c, nr), val); } static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb, struct btrfs_chunk *c, int nr) { return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr)); } static inline void btrfs_set_stripe_devid_nr(struct extent_buffer *eb, struct btrfs_chunk *c, int nr, u64 val) { btrfs_set_stripe_devid(eb, btrfs_stripe_nr(c, nr), val); } /* struct btrfs_block_group_item */ BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item, used, 64); Loading Loading @@ -1540,14 +1526,6 @@ btrfs_inode_ctime(struct btrfs_inode_item *inode_item) return (struct btrfs_timespec *)ptr; } static inline struct btrfs_timespec * btrfs_inode_otime(struct btrfs_inode_item *inode_item) { unsigned long ptr = (unsigned long)inode_item; ptr += offsetof(struct btrfs_inode_item, otime); return (struct btrfs_timespec *)ptr; } BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64); BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32); Loading Loading @@ -1898,33 +1876,6 @@ static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) return (u8 *)ptr; } static inline u8 *btrfs_super_fsid(struct extent_buffer *eb) { unsigned long ptr = offsetof(struct btrfs_super_block, fsid); return (u8 *)ptr; } static inline u8 *btrfs_header_csum(struct extent_buffer *eb) { unsigned long ptr = offsetof(struct btrfs_header, csum); return (u8 *)ptr; } static inline struct btrfs_node *btrfs_buffer_node(struct extent_buffer *eb) { return NULL; } static inline struct btrfs_leaf *btrfs_buffer_leaf(struct extent_buffer *eb) { return NULL; } static inline struct btrfs_header *btrfs_buffer_header(struct extent_buffer *eb) { return NULL; } static inline int btrfs_is_leaf(struct extent_buffer *eb) { return btrfs_header_level(eb) == 0; Loading Loading @@ -2078,22 +2029,6 @@ static inline struct btrfs_root *btrfs_sb(struct super_block *sb) return sb->s_fs_info; } static inline int btrfs_set_root_name(struct btrfs_root *root, const char *name, int len) { /* if we already have a name just free it */ kfree(root->name); root->name = kmalloc(len+1, GFP_KERNEL); if (!root->name) return -ENOMEM; memcpy(root->name, name, len); root->name[len] = '\0'; return 0; } static inline u32 btrfs_level_size(struct btrfs_root *root, int level) { if (level == 0) Loading Loading @@ -2138,12 +2073,9 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, u64 num_bytes, u64 *refs, u64 *flags); int btrfs_pin_extent(struct btrfs_root *root, u64 bytenr, u64 num, int reserved); int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *leaf); int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, struct btrfs_root *root, u64 objectid, u64 offset, u64 bytenr); int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); struct btrfs_block_group_cache *btrfs_lookup_block_group( struct btrfs_fs_info *info, u64 bytenr); Loading Loading @@ -2320,7 +2252,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *parent, int start_slot, int cache_only, u64 *last_ret, struct btrfs_key *progress); void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); void btrfs_release_path(struct btrfs_path *p); struct btrfs_path *btrfs_alloc_path(void); void btrfs_free_path(struct btrfs_path *p); void btrfs_set_path_blocking(struct btrfs_path *p); Loading @@ -2343,11 +2275,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans, u32 total_data, u32 total_size, int nr); int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *key, void *data, u32 data_size); int btrfs_insert_some_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *cpu_key, u32 *data_size, int nr); int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, Loading Loading @@ -2393,8 +2320,6 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root *item); int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct btrfs_root_item *item, struct btrfs_key *key); int btrfs_search_root(struct btrfs_root *root, u64 search_start, u64 *found_objectid); int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); int btrfs_find_orphan_roots(struct btrfs_root *tree_root); int btrfs_set_root_node(struct btrfs_root_item *item, Loading Loading @@ -2493,15 +2418,10 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, struct btrfs_ordered_sum *sums); int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, struct bio *bio, u64 file_start, int contig); int btrfs_csum_file_bytes(struct btrfs_root *root, struct inode *inode, u64 start, unsigned long len); struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 bytenr, int cow); int btrfs_csum_truncate(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 isize); int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, struct list_head *list); /* inode.c */ Loading Loading @@ -2532,8 +2452,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, u32 min_type); int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); int btrfs_start_one_delalloc_inode(struct btrfs_root *root, int delay_iput, int sync); int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, struct extent_state **cached_state); int btrfs_writepages(struct address_space *mapping, Loading @@ -2550,7 +2468,6 @@ unsigned long btrfs_force_ra(struct address_space *mapping, int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); int btrfs_readpage(struct file *file, struct page *page); void btrfs_evict_inode(struct inode *inode); void btrfs_put_inode(struct inode *inode); int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); void btrfs_dirty_inode(struct inode *inode); struct inode *btrfs_alloc_inode(struct super_block *sb); Loading @@ -2561,10 +2478,8 @@ void btrfs_destroy_cachep(void); long btrfs_ioctl_trans_end(struct file *file); struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, struct btrfs_root *root, int *was_new); int btrfs_commit_write(struct file *file, struct page *page, unsigned from, unsigned to); struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, size_t page_offset, u64 start, u64 end, size_t pg_offset, u64 start, u64 end, int create); int btrfs_update_inode(struct btrfs_trans_handle *trans, struct btrfs_root *root, Loading Loading @@ -2601,7 +2516,6 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); int btrfs_sync_file(struct file *file, int datasync); int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, int skip_pinned); int btrfs_check_file(struct btrfs_root *root, struct inode *inode); extern const struct file_operations btrfs_file_operations; int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, u64 start, u64 end, u64 *hint_byte, int drop_cache); Loading @@ -2621,10 +2535,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, /* sysfs.c */ int btrfs_init_sysfs(void); void btrfs_exit_sysfs(void); int btrfs_sysfs_add_super(struct btrfs_fs_info *fs); int btrfs_sysfs_add_root(struct btrfs_root *root); void btrfs_sysfs_del_root(struct btrfs_root *root); void btrfs_sysfs_del_super(struct btrfs_fs_info *root); /* xattr.c */ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); Loading Loading
fs/btrfs/acl.c +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode) return 0; acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); if (IS_ERR(acl) || !acl) if (IS_ERR_OR_NULL(acl)) return PTR_ERR(acl); clone = posix_acl_clone(acl, GFP_KERNEL); Loading
fs/btrfs/compression.c +21 −21 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, struct compressed_bio *cb; unsigned long bytes_left; struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; int page_index = 0; int pg_index = 0; struct page *page; u64 first_byte = disk_start; struct block_device *bdev; Loading Loading @@ -367,8 +367,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, /* create and submit bios for the compressed pages */ bytes_left = compressed_len; for (page_index = 0; page_index < cb->nr_pages; page_index++) { page = compressed_pages[page_index]; for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) { page = compressed_pages[pg_index]; page->mapping = inode->i_mapping; if (bio->bi_size) ret = io_tree->ops->merge_bio_hook(page, 0, Loading Loading @@ -433,7 +433,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, struct compressed_bio *cb) { unsigned long end_index; unsigned long page_index; unsigned long pg_index; u64 last_offset; u64 isize = i_size_read(inode); int ret; Loading @@ -457,13 +457,13 @@ static noinline int add_ra_bio_pages(struct inode *inode, end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; while (last_offset < compressed_end) { page_index = last_offset >> PAGE_CACHE_SHIFT; pg_index = last_offset >> PAGE_CACHE_SHIFT; if (page_index > end_index) if (pg_index > end_index) break; rcu_read_lock(); page = radix_tree_lookup(&mapping->page_tree, page_index); page = radix_tree_lookup(&mapping->page_tree, pg_index); rcu_read_unlock(); if (page) { misses++; Loading @@ -477,7 +477,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, if (!page) break; if (add_to_page_cache_lru(page, mapping, page_index, if (add_to_page_cache_lru(page, mapping, pg_index, GFP_NOFS)) { page_cache_release(page); goto next; Loading Loading @@ -561,7 +561,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE; unsigned long compressed_len; unsigned long nr_pages; unsigned long page_index; unsigned long pg_index; struct page *page; struct block_device *bdev; struct bio *comp_bio; Loading Loading @@ -614,10 +614,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; for (page_index = 0; page_index < nr_pages; page_index++) { cb->compressed_pages[page_index] = alloc_page(GFP_NOFS | for (pg_index = 0; pg_index < nr_pages; pg_index++) { cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS | __GFP_HIGHMEM); if (!cb->compressed_pages[page_index]) if (!cb->compressed_pages[pg_index]) goto fail2; } cb->nr_pages = nr_pages; Loading @@ -635,8 +635,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, comp_bio->bi_end_io = end_compressed_bio_read; atomic_inc(&cb->pending_bios); for (page_index = 0; page_index < nr_pages; page_index++) { page = cb->compressed_pages[page_index]; for (pg_index = 0; pg_index < nr_pages; pg_index++) { page = cb->compressed_pages[pg_index]; page->mapping = inode->i_mapping; page->index = em_start >> PAGE_CACHE_SHIFT; Loading Loading @@ -703,8 +703,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, return 0; fail2: for (page_index = 0; page_index < nr_pages; page_index++) free_page((unsigned long)cb->compressed_pages[page_index]); for (pg_index = 0; pg_index < nr_pages; pg_index++) free_page((unsigned long)cb->compressed_pages[pg_index]); kfree(cb->compressed_pages); fail1: Loading Loading @@ -946,7 +946,7 @@ void btrfs_exit_compress(void) int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, unsigned long total_out, u64 disk_start, struct bio_vec *bvec, int vcnt, unsigned long *page_index, unsigned long *pg_index, unsigned long *pg_offset) { unsigned long buf_offset; Loading @@ -955,7 +955,7 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, unsigned long working_bytes = total_out - buf_start; unsigned long bytes; char *kaddr; struct page *page_out = bvec[*page_index].bv_page; struct page *page_out = bvec[*pg_index].bv_page; /* * start byte is the first byte of the page we're currently Loading Loading @@ -996,11 +996,11 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, /* check if we need to pick another page */ if (*pg_offset == PAGE_CACHE_SIZE) { (*page_index)++; if (*page_index >= vcnt) (*pg_index)++; if (*pg_index >= vcnt) return 0; page_out = bvec[*page_index].bv_page; page_out = bvec[*pg_index].bv_page; *pg_offset = 0; start_byte = page_offset(page_out) - disk_start; Loading
fs/btrfs/compression.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page, int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, unsigned long total_out, u64 disk_start, struct bio_vec *bvec, int vcnt, unsigned long *page_index, unsigned long *pg_index, unsigned long *pg_offset); int btrfs_submit_compressed_write(struct inode *inode, u64 start, Loading
fs/btrfs/ctree.c +14 −15 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ void btrfs_free_path(struct btrfs_path *p) { if (!p) return; btrfs_release_path(NULL, p); btrfs_release_path(p); kmem_cache_free(btrfs_path_cachep, p); } Loading @@ -112,7 +112,7 @@ void btrfs_free_path(struct btrfs_path *p) * * It is safe to call this on paths that no locks or extent buffers held. */ noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p) noinline void btrfs_release_path(struct btrfs_path *p) { int i; Loading Loading @@ -1323,7 +1323,7 @@ static noinline int reada_for_balance(struct btrfs_root *root, ret = -EAGAIN; /* release the whole path */ btrfs_release_path(root, path); btrfs_release_path(path); /* read the blocks */ if (block1) Loading Loading @@ -1470,7 +1470,7 @@ read_block_for_search(struct btrfs_trans_handle *trans, return 0; } free_extent_buffer(tmp); btrfs_release_path(NULL, p); btrfs_release_path(p); return -EIO; } } Loading @@ -1489,7 +1489,7 @@ read_block_for_search(struct btrfs_trans_handle *trans, if (p->reada) reada_for_search(root, p, level, slot, key->objectid); btrfs_release_path(NULL, p); btrfs_release_path(p); ret = -EAGAIN; tmp = read_tree_block(root, blocknr, blocksize, 0); Loading Loading @@ -1558,7 +1558,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans, } b = p->nodes[level]; if (!b) { btrfs_release_path(NULL, p); btrfs_release_path(p); goto again; } BUG_ON(btrfs_header_nritems(b) == 1); Loading Loading @@ -1748,7 +1748,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root if (!p->leave_spinning) btrfs_set_path_blocking(p); if (ret < 0) btrfs_release_path(root, p); btrfs_release_path(p); return ret; } Loading Loading @@ -3021,7 +3021,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans, struct btrfs_file_extent_item); extent_len = btrfs_file_extent_num_bytes(leaf, fi); } btrfs_release_path(root, path); btrfs_release_path(path); path->keep_locks = 1; path->search_for_split = 1; Loading Loading @@ -3641,7 +3641,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans, ret = 0; if (slot == 0) { struct btrfs_disk_key disk_key; btrfs_cpu_key_to_disk(&disk_key, cpu_key); ret = fixup_low_keys(trans, root, path, &disk_key, 1); } Loading Loading @@ -3943,7 +3942,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) else return 1; btrfs_release_path(root, path); btrfs_release_path(path); ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) return ret; Loading Loading @@ -4067,7 +4066,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key, sret = btrfs_find_next_key(root, path, min_key, level, cache_only, min_trans); if (sret == 0) { btrfs_release_path(root, path); btrfs_release_path(path); goto again; } else { goto out; Loading Loading @@ -4146,7 +4145,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path, btrfs_node_key_to_cpu(c, &cur_key, slot); orig_lowest = path->lowest_level; btrfs_release_path(root, path); btrfs_release_path(path); path->lowest_level = level; ret = btrfs_search_slot(NULL, root, &cur_key, path, 0, 0); Loading Loading @@ -4223,7 +4222,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) again: level = 1; next = NULL; btrfs_release_path(root, path); btrfs_release_path(path); path->keep_locks = 1; Loading Loading @@ -4279,7 +4278,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) goto again; if (ret < 0) { btrfs_release_path(root, path); btrfs_release_path(path); goto done; } Loading Loading @@ -4318,7 +4317,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) goto again; if (ret < 0) { btrfs_release_path(root, path); btrfs_release_path(path); goto done; } Loading
fs/btrfs/ctree.h +6 −96 Original line number Diff line number Diff line Loading @@ -746,12 +746,12 @@ struct btrfs_space_info { */ unsigned long reservation_progress; int full:1; /* indicates that we cannot allocate any more unsigned int full:1; /* indicates that we cannot allocate any more chunks for this space */ int chunk_alloc:1; /* set if we are allocating a chunk */ unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ int force_alloc; /* set if we need to force a chunk alloc for this space */ unsigned int force_alloc; /* set if we need to force a chunk alloc for this space */ struct list_head list; Loading Loading @@ -1463,26 +1463,12 @@ static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb, return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr)); } static inline void btrfs_set_stripe_offset_nr(struct extent_buffer *eb, struct btrfs_chunk *c, int nr, u64 val) { btrfs_set_stripe_offset(eb, btrfs_stripe_nr(c, nr), val); } static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb, struct btrfs_chunk *c, int nr) { return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr)); } static inline void btrfs_set_stripe_devid_nr(struct extent_buffer *eb, struct btrfs_chunk *c, int nr, u64 val) { btrfs_set_stripe_devid(eb, btrfs_stripe_nr(c, nr), val); } /* struct btrfs_block_group_item */ BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item, used, 64); Loading Loading @@ -1540,14 +1526,6 @@ btrfs_inode_ctime(struct btrfs_inode_item *inode_item) return (struct btrfs_timespec *)ptr; } static inline struct btrfs_timespec * btrfs_inode_otime(struct btrfs_inode_item *inode_item) { unsigned long ptr = (unsigned long)inode_item; ptr += offsetof(struct btrfs_inode_item, otime); return (struct btrfs_timespec *)ptr; } BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64); BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32); Loading Loading @@ -1898,33 +1876,6 @@ static inline u8 *btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) return (u8 *)ptr; } static inline u8 *btrfs_super_fsid(struct extent_buffer *eb) { unsigned long ptr = offsetof(struct btrfs_super_block, fsid); return (u8 *)ptr; } static inline u8 *btrfs_header_csum(struct extent_buffer *eb) { unsigned long ptr = offsetof(struct btrfs_header, csum); return (u8 *)ptr; } static inline struct btrfs_node *btrfs_buffer_node(struct extent_buffer *eb) { return NULL; } static inline struct btrfs_leaf *btrfs_buffer_leaf(struct extent_buffer *eb) { return NULL; } static inline struct btrfs_header *btrfs_buffer_header(struct extent_buffer *eb) { return NULL; } static inline int btrfs_is_leaf(struct extent_buffer *eb) { return btrfs_header_level(eb) == 0; Loading Loading @@ -2078,22 +2029,6 @@ static inline struct btrfs_root *btrfs_sb(struct super_block *sb) return sb->s_fs_info; } static inline int btrfs_set_root_name(struct btrfs_root *root, const char *name, int len) { /* if we already have a name just free it */ kfree(root->name); root->name = kmalloc(len+1, GFP_KERNEL); if (!root->name) return -ENOMEM; memcpy(root->name, name, len); root->name[len] = '\0'; return 0; } static inline u32 btrfs_level_size(struct btrfs_root *root, int level) { if (level == 0) Loading Loading @@ -2138,12 +2073,9 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, u64 num_bytes, u64 *refs, u64 *flags); int btrfs_pin_extent(struct btrfs_root *root, u64 bytenr, u64 num, int reserved); int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *leaf); int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, struct btrfs_root *root, u64 objectid, u64 offset, u64 bytenr); int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); struct btrfs_block_group_cache *btrfs_lookup_block_group( struct btrfs_fs_info *info, u64 bytenr); Loading Loading @@ -2320,7 +2252,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *parent, int start_slot, int cache_only, u64 *last_ret, struct btrfs_key *progress); void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p); void btrfs_release_path(struct btrfs_path *p); struct btrfs_path *btrfs_alloc_path(void); void btrfs_free_path(struct btrfs_path *p); void btrfs_set_path_blocking(struct btrfs_path *p); Loading @@ -2343,11 +2275,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans, u32 total_data, u32 total_size, int nr); int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *key, void *data, u32 data_size); int btrfs_insert_some_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *cpu_key, u32 *data_size, int nr); int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, Loading Loading @@ -2393,8 +2320,6 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root *item); int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct btrfs_root_item *item, struct btrfs_key *key); int btrfs_search_root(struct btrfs_root *root, u64 search_start, u64 *found_objectid); int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); int btrfs_find_orphan_roots(struct btrfs_root *tree_root); int btrfs_set_root_node(struct btrfs_root_item *item, Loading Loading @@ -2493,15 +2418,10 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, struct btrfs_ordered_sum *sums); int btrfs_csum_one_bio(struct btrfs_root *root, struct inode *inode, struct bio *bio, u64 file_start, int contig); int btrfs_csum_file_bytes(struct btrfs_root *root, struct inode *inode, u64 start, unsigned long len); struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 bytenr, int cow); int btrfs_csum_truncate(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 isize); int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, struct list_head *list); /* inode.c */ Loading Loading @@ -2532,8 +2452,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, u32 min_type); int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); int btrfs_start_one_delalloc_inode(struct btrfs_root *root, int delay_iput, int sync); int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, struct extent_state **cached_state); int btrfs_writepages(struct address_space *mapping, Loading @@ -2550,7 +2468,6 @@ unsigned long btrfs_force_ra(struct address_space *mapping, int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); int btrfs_readpage(struct file *file, struct page *page); void btrfs_evict_inode(struct inode *inode); void btrfs_put_inode(struct inode *inode); int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); void btrfs_dirty_inode(struct inode *inode); struct inode *btrfs_alloc_inode(struct super_block *sb); Loading @@ -2561,10 +2478,8 @@ void btrfs_destroy_cachep(void); long btrfs_ioctl_trans_end(struct file *file); struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, struct btrfs_root *root, int *was_new); int btrfs_commit_write(struct file *file, struct page *page, unsigned from, unsigned to); struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, size_t page_offset, u64 start, u64 end, size_t pg_offset, u64 start, u64 end, int create); int btrfs_update_inode(struct btrfs_trans_handle *trans, struct btrfs_root *root, Loading Loading @@ -2601,7 +2516,6 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); int btrfs_sync_file(struct file *file, int datasync); int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, int skip_pinned); int btrfs_check_file(struct btrfs_root *root, struct inode *inode); extern const struct file_operations btrfs_file_operations; int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, u64 start, u64 end, u64 *hint_byte, int drop_cache); Loading @@ -2621,10 +2535,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, /* sysfs.c */ int btrfs_init_sysfs(void); void btrfs_exit_sysfs(void); int btrfs_sysfs_add_super(struct btrfs_fs_info *fs); int btrfs_sysfs_add_root(struct btrfs_root *root); void btrfs_sysfs_del_root(struct btrfs_root *root); void btrfs_sysfs_del_super(struct btrfs_fs_info *root); /* xattr.c */ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); Loading