Lines Matching refs:bs
1805 struct ext4_xattr_block_find *bs) in ext4_xattr_block_find() argument
1815 bs->bh = ext4_sb_bread(sb, EXT4_I(inode)->i_file_acl, REQ_PRIO); in ext4_xattr_block_find()
1816 if (IS_ERR(bs->bh)) { in ext4_xattr_block_find()
1817 error = PTR_ERR(bs->bh); in ext4_xattr_block_find()
1818 bs->bh = NULL; in ext4_xattr_block_find()
1821 ea_bdebug(bs->bh, "b_count=%d, refcount=%d", in ext4_xattr_block_find()
1822 atomic_read(&(bs->bh->b_count)), in ext4_xattr_block_find()
1823 le32_to_cpu(BHDR(bs->bh)->h_refcount)); in ext4_xattr_block_find()
1824 error = ext4_xattr_check_block(inode, bs->bh); in ext4_xattr_block_find()
1828 bs->s.base = BHDR(bs->bh); in ext4_xattr_block_find()
1829 bs->s.first = BFIRST(bs->bh); in ext4_xattr_block_find()
1830 bs->s.end = bs->bh->b_data + bs->bh->b_size; in ext4_xattr_block_find()
1831 bs->s.here = bs->s.first; in ext4_xattr_block_find()
1832 error = xattr_find_entry(inode, &bs->s.here, bs->s.end, in ext4_xattr_block_find()
1836 bs->s.not_found = error; in ext4_xattr_block_find()
1844 struct ext4_xattr_block_find *bs) in ext4_xattr_block_set() argument
1848 struct ext4_xattr_search s_copy = bs->s; in ext4_xattr_block_set()
1861 BUFFER_TRACE(bs->bh, "get_write_access"); in ext4_xattr_block_set()
1862 error = ext4_journal_get_write_access(handle, sb, bs->bh, in ext4_xattr_block_set()
1866 lock_buffer(bs->bh); in ext4_xattr_block_set()
1869 __u32 hash = le32_to_cpu(BHDR(bs->bh)->h_hash); in ext4_xattr_block_set()
1878 bs->bh->b_blocknr); in ext4_xattr_block_set()
1879 ea_bdebug(bs->bh, "modifying in-place"); in ext4_xattr_block_set()
1882 ext4_xattr_block_csum_set(inode, bs->bh); in ext4_xattr_block_set()
1883 unlock_buffer(bs->bh); in ext4_xattr_block_set()
1889 bs->bh); in ext4_xattr_block_set()
1894 int offset = (char *)s->here - bs->bh->b_data; in ext4_xattr_block_set()
1896 unlock_buffer(bs->bh); in ext4_xattr_block_set()
1897 ea_bdebug(bs->bh, "cloning"); in ext4_xattr_block_set()
1898 s->base = kmalloc(bs->bh->b_size, GFP_NOFS); in ext4_xattr_block_set()
1902 memcpy(s->base, BHDR(bs->bh), bs->bh->b_size); in ext4_xattr_block_set()
1906 s->end = s->base + bs->bh->b_size; in ext4_xattr_block_set()
1981 if (new_bh == bs->bh) in ext4_xattr_block_set()
2046 } else if (bs->bh && s->base == bs->bh->b_data) { in ext4_xattr_block_set()
2048 ea_bdebug(bs->bh, "keeping this block"); in ext4_xattr_block_set()
2049 ext4_xattr_block_cache_insert(ea_block_cache, bs->bh); in ext4_xattr_block_set()
2050 new_bh = bs->bh; in ext4_xattr_block_set()
2127 if (bs->bh && bs->bh != new_bh) { in ext4_xattr_block_set()
2130 ext4_xattr_release_block(handle, inode, bs->bh, in ext4_xattr_block_set()
2155 if (!(bs->bh && s->base == bs->bh->b_data)) in ext4_xattr_block_set()
2283 struct ext4_xattr_block_find bs = { in ext4_xattr_set_handle() local
2333 error = ext4_xattr_block_find(inode, &i, &bs); in ext4_xattr_set_handle()
2336 if (is.s.not_found && bs.s.not_found) { in ext4_xattr_set_handle()
2352 else if (!bs.s.not_found) in ext4_xattr_set_handle()
2353 error = ext4_xattr_block_set(handle, inode, &i, &bs); in ext4_xattr_set_handle()
2359 if (!bs.s.not_found && ext4_xattr_value_same(&bs.s, &i)) in ext4_xattr_set_handle()
2368 if (!error && !bs.s.not_found) { in ext4_xattr_set_handle()
2370 error = ext4_xattr_block_set(handle, inode, &i, &bs); in ext4_xattr_set_handle()
2372 if (EXT4_I(inode)->i_file_acl && !bs.s.base) { in ext4_xattr_set_handle()
2373 brelse(bs.bh); in ext4_xattr_set_handle()
2374 bs.bh = NULL; in ext4_xattr_set_handle()
2375 error = ext4_xattr_block_find(inode, &i, &bs); in ext4_xattr_set_handle()
2379 error = ext4_xattr_block_set(handle, inode, &i, &bs); in ext4_xattr_set_handle()
2415 brelse(bs.bh); in ext4_xattr_set_handle()
2528 struct ext4_xattr_block_find *bs = NULL; in ext4_xattr_move_to_block() local
2541 bs = kzalloc(sizeof(struct ext4_xattr_block_find), GFP_NOFS); in ext4_xattr_move_to_block()
2544 if (!is || !bs || !buffer || !b_entry_name) { in ext4_xattr_move_to_block()
2550 bs->s.not_found = -ENODATA; in ext4_xattr_move_to_block()
2552 bs->bh = NULL; in ext4_xattr_move_to_block()
2583 error = ext4_xattr_block_find(inode, &i, bs); in ext4_xattr_move_to_block()
2588 error = ext4_xattr_block_set(handle, inode, &i, bs); in ext4_xattr_move_to_block()
2597 if (bs) in ext4_xattr_move_to_block()
2598 brelse(bs->bh); in ext4_xattr_move_to_block()
2600 kfree(bs); in ext4_xattr_move_to_block()