Lines Matching refs:bs
1858 struct ext4_xattr_block_find *bs) in ext4_xattr_block_find() argument
1868 bs->bh = ext4_sb_bread(sb, EXT4_I(inode)->i_file_acl, REQ_PRIO); in ext4_xattr_block_find()
1869 if (IS_ERR(bs->bh)) { in ext4_xattr_block_find()
1870 error = PTR_ERR(bs->bh); in ext4_xattr_block_find()
1871 bs->bh = NULL; in ext4_xattr_block_find()
1874 ea_bdebug(bs->bh, "b_count=%d, refcount=%d", in ext4_xattr_block_find()
1875 atomic_read(&(bs->bh->b_count)), in ext4_xattr_block_find()
1876 le32_to_cpu(BHDR(bs->bh)->h_refcount)); in ext4_xattr_block_find()
1877 error = ext4_xattr_check_block(inode, bs->bh); in ext4_xattr_block_find()
1881 bs->s.base = BHDR(bs->bh); in ext4_xattr_block_find()
1882 bs->s.first = BFIRST(bs->bh); in ext4_xattr_block_find()
1883 bs->s.end = bs->bh->b_data + bs->bh->b_size; in ext4_xattr_block_find()
1884 bs->s.here = bs->s.first; in ext4_xattr_block_find()
1885 error = xattr_find_entry(inode, &bs->s.here, bs->s.end, in ext4_xattr_block_find()
1889 bs->s.not_found = error; in ext4_xattr_block_find()
1897 struct ext4_xattr_block_find *bs) in ext4_xattr_block_set() argument
1901 struct ext4_xattr_search s_copy = bs->s; in ext4_xattr_block_set()
1926 int offset = (char *)s->here - bs->bh->b_data; in ext4_xattr_block_set()
1928 BUFFER_TRACE(bs->bh, "get_write_access"); in ext4_xattr_block_set()
1929 error = ext4_journal_get_write_access(handle, sb, bs->bh, in ext4_xattr_block_set()
1934 lock_buffer(bs->bh); in ext4_xattr_block_set()
1937 __u32 hash = le32_to_cpu(BHDR(bs->bh)->h_hash); in ext4_xattr_block_set()
1948 hash, bs->bh->b_blocknr); in ext4_xattr_block_set()
1958 ea_bdebug(bs->bh, "modifying in-place"); in ext4_xattr_block_set()
1961 ext4_xattr_block_csum_set(inode, bs->bh); in ext4_xattr_block_set()
1962 unlock_buffer(bs->bh); in ext4_xattr_block_set()
1968 bs->bh); in ext4_xattr_block_set()
1974 unlock_buffer(bs->bh); in ext4_xattr_block_set()
1975 ea_bdebug(bs->bh, "cloning"); in ext4_xattr_block_set()
1976 s->base = kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS); in ext4_xattr_block_set()
1983 s->end = s->base + bs->bh->b_size; in ext4_xattr_block_set()
2041 if (new_bh == bs->bh) in ext4_xattr_block_set()
2101 } else if (bs->bh && s->base == bs->bh->b_data) { in ext4_xattr_block_set()
2103 ea_bdebug(bs->bh, "keeping this block"); in ext4_xattr_block_set()
2104 ext4_xattr_block_cache_insert(ea_block_cache, bs->bh); in ext4_xattr_block_set()
2105 new_bh = bs->bh; in ext4_xattr_block_set()
2175 if (bs->bh && bs->bh != new_bh) { in ext4_xattr_block_set()
2178 ext4_xattr_release_block(handle, inode, bs->bh, in ext4_xattr_block_set()
2202 if (!(bs->bh && s->base == bs->bh->b_data)) in ext4_xattr_block_set()
2357 struct ext4_xattr_block_find bs = { in ext4_xattr_set_handle() local
2407 error = ext4_xattr_block_find(inode, &i, &bs); in ext4_xattr_set_handle()
2410 if (is.s.not_found && bs.s.not_found) { in ext4_xattr_set_handle()
2426 else if (!bs.s.not_found) in ext4_xattr_set_handle()
2427 error = ext4_xattr_block_set(handle, inode, &i, &bs); in ext4_xattr_set_handle()
2433 if (!bs.s.not_found && ext4_xattr_value_same(&bs.s, &i)) in ext4_xattr_set_handle()
2442 if (!error && !bs.s.not_found) { in ext4_xattr_set_handle()
2444 error = ext4_xattr_block_set(handle, inode, &i, &bs); in ext4_xattr_set_handle()
2446 if (EXT4_I(inode)->i_file_acl && !bs.s.base) { in ext4_xattr_set_handle()
2447 brelse(bs.bh); in ext4_xattr_set_handle()
2448 bs.bh = NULL; in ext4_xattr_set_handle()
2449 error = ext4_xattr_block_find(inode, &i, &bs); in ext4_xattr_set_handle()
2453 error = ext4_xattr_block_set(handle, inode, &i, &bs); in ext4_xattr_set_handle()
2490 brelse(bs.bh); in ext4_xattr_set_handle()
2603 struct ext4_xattr_block_find *bs = NULL; in ext4_xattr_move_to_block() local
2617 bs = kzalloc(sizeof(struct ext4_xattr_block_find), GFP_NOFS); in ext4_xattr_move_to_block()
2619 if (!is || !bs || !b_entry_name) { in ext4_xattr_move_to_block()
2625 bs->s.not_found = -ENODATA; in ext4_xattr_move_to_block()
2627 bs->bh = NULL; in ext4_xattr_move_to_block()
2659 error = ext4_xattr_block_find(inode, &i, bs); in ext4_xattr_move_to_block()
2664 error = ext4_xattr_block_set(handle, inode, &i, bs); in ext4_xattr_move_to_block()
2679 if (bs) in ext4_xattr_move_to_block()
2680 brelse(bs->bh); in ext4_xattr_move_to_block()
2682 kfree(bs); in ext4_xattr_move_to_block()