• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/fs/ext4/

Lines Matching refs:bh

64 #define BHDR(bh) ((struct ext4_xattr_header *)((bh)->b_data))
66 #define BFIRST(bh) ENTRY(BHDR(bh)+1)
83 # define ea_bdebug(bh, f...) do { \
86 bdevname(bh->b_bdev, b), \
87 (unsigned long) bh->b_blocknr); \
164 ext4_xattr_check_block(struct buffer_head *bh)
168 if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) ||
169 BHDR(bh)->h_blocks != cpu_to_le32(1))
171 error = ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size);
217 struct buffer_head *bh = NULL;
229 bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
230 if (!bh)
232 ea_bdebug(bh, "b_count=%d, refcount=%d",
233 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
234 if (ext4_xattr_check_block(bh)) {
241 ext4_xattr_cache_insert(bh);
242 entry = BFIRST(bh);
243 error = ext4_xattr_find_entry(&entry, name_index, name, bh->b_size, 1);
253 memcpy(buffer, bh->b_data + le16_to_cpu(entry->e_value_offs),
259 brelse(bh);
302 brelse(iloc.bh);
360 struct buffer_head *bh = NULL;
370 bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
372 if (!bh)
374 ea_bdebug(bh, "b_count=%d, refcount=%d",
375 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
376 if (ext4_xattr_check_block(bh)) {
383 ext4_xattr_cache_insert(bh);
384 error = ext4_xattr_list_entries(inode, BFIRST(bh), buffer, buffer_size);
387 brelse(bh);
416 brelse(iloc.bh);
475 struct buffer_head *bh)
480 ce = mb_cache_entry_get(ext4_xattr_cache, bh->b_bdev, bh->b_blocknr);
481 error = ext4_journal_get_write_access(handle, bh);
485 lock_buffer(bh);
486 if (BHDR(bh)->h_refcount == cpu_to_le32(1)) {
487 ea_bdebug(bh, "refcount now=0; freeing");
490 ext4_free_blocks(handle, inode, bh->b_blocknr, 1);
491 get_bh(bh);
492 ext4_forget(handle, 1, inode, bh, bh->b_blocknr);
494 BHDR(bh)->h_refcount = cpu_to_le32(
495 le32_to_cpu(BHDR(bh)->h_refcount) - 1);
496 error = ext4_journal_dirty_metadata(handle, bh);
500 ea_bdebug(bh, "refcount now=%d; releasing",
501 le32_to_cpu(BHDR(bh)->h_refcount));
505 unlock_buffer(bh);
629 struct buffer_head *bh;
644 bs->bh = sb_bread(sb, EXT4_I(inode)->i_file_acl);
646 if (!bs->bh)
648 ea_bdebug(bs->bh, "b_count=%d, refcount=%d",
649 atomic_read(&(bs->bh->b_count)),
650 le32_to_cpu(BHDR(bs->bh)->h_refcount));
651 if (ext4_xattr_check_block(bs->bh)) {
659 bs->s.base = BHDR(bs->bh);
660 bs->s.first = BFIRST(bs->bh);
661 bs->s.end = bs->bh->b_data + bs->bh->b_size;
664 i->name, bs->bh->b_size, 1);
691 ce = mb_cache_entry_get(ext4_xattr_cache, bs->bh->b_bdev,
692 bs->bh->b_blocknr);
693 error = ext4_journal_get_write_access(handle, bs->bh);
696 lock_buffer(bs->bh);
703 ea_bdebug(bs->bh, "modifying in-place");
709 ext4_xattr_cache_insert(bs->bh);
711 unlock_buffer(bs->bh);
716 bs->bh);
721 int offset = (char *)s->here - bs->bh->b_data;
723 unlock_buffer(bs->bh);
724 jbd2_journal_release_buffer(handle, bs->bh);
729 ea_bdebug(bs->bh, "cloning");
730 s->base = kmalloc(bs->bh->b_size, GFP_KERNEL);
734 memcpy(s->base, BHDR(bs->bh), bs->bh->b_size);
738 s->end = s->base + bs->bh->b_size;
769 if (new_bh == bs->bh)
794 } else if (bs->bh && s->base == bs->bh->b_data) {
796 ea_bdebug(bs->bh, "keeping this block");
797 new_bh = bs->bh;
838 if (bs->bh && bs->bh != new_bh)
839 ext4_xattr_release_block(handle, inode, bs->bh);
846 if (!(bs->bh && s->base == bs->bh->b_data))
990 error = ext4_journal_get_write_access(handle, is.iloc.bh);
1019 * The bh is consumed by ext4_mark_iloc_dirty, even with
1022 is.iloc.bh = NULL;
1028 brelse(is.iloc.bh);
1029 brelse(bs.bh);
1079 struct buffer_head *bh = NULL;
1083 bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
1084 if (!bh) {
1090 if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) ||
1091 BHDR(bh)->h_blocks != cpu_to_le32(1)) {
1097 ext4_xattr_release_block(handle, inode, bh);
1101 brelse(bh);
1124 ext4_xattr_cache_insert(struct buffer_head *bh)
1126 __u32 hash = le32_to_cpu(BHDR(bh)->h_hash);
1132 ea_bdebug(bh, "out of memory");
1135 error = mb_cache_entry_insert(ce, bh->b_bdev, bh->b_blocknr, &hash);
1139 ea_bdebug(bh, "already in cache");
1143 ea_bdebug(bh, "inserting [%x]", (int)hash);
1210 struct buffer_head *bh;
1217 bh = sb_bread(inode->i_sb, ce->e_block);
1218 if (!bh) {
1222 } else if (le32_to_cpu(BHDR(bh)->h_refcount) >=
1226 le32_to_cpu(BHDR(bh)->h_refcount),
1228 } else if (ext4_xattr_cmp(header, BHDR(bh)) == 0) {
1230 return bh;
1232 brelse(bh);