Lines Matching refs:bh
31 struct buffer_head *bh, in nilfs_mdt_insert_new_block() argument
42 bh->b_blocknr = 0; in nilfs_mdt_insert_new_block()
44 ret = nilfs_bmap_insert(ii->i_bmap, block, (unsigned long)bh); in nilfs_mdt_insert_new_block()
48 set_buffer_mapped(bh); in nilfs_mdt_insert_new_block()
50 kaddr = kmap_atomic(bh->b_page); in nilfs_mdt_insert_new_block()
51 memset(kaddr + bh_offset(bh), 0, i_blocksize(inode)); in nilfs_mdt_insert_new_block()
53 init_block(inode, bh, kaddr); in nilfs_mdt_insert_new_block()
54 flush_dcache_page(bh->b_page); in nilfs_mdt_insert_new_block()
57 set_buffer_uptodate(bh); in nilfs_mdt_insert_new_block()
58 mark_buffer_dirty(bh); in nilfs_mdt_insert_new_block()
74 struct buffer_head *bh; in nilfs_mdt_create_block() local
80 bh = nilfs_grab_buffer(inode, inode->i_mapping, block, 0); in nilfs_mdt_create_block()
81 if (unlikely(!bh)) in nilfs_mdt_create_block()
85 if (buffer_uptodate(bh)) in nilfs_mdt_create_block()
88 wait_on_buffer(bh); in nilfs_mdt_create_block()
89 if (buffer_uptodate(bh)) in nilfs_mdt_create_block()
92 err = nilfs_mdt_insert_new_block(inode, block, bh, init_block); in nilfs_mdt_create_block()
94 get_bh(bh); in nilfs_mdt_create_block()
95 *out_bh = bh; in nilfs_mdt_create_block()
99 unlock_page(bh->b_page); in nilfs_mdt_create_block()
100 put_page(bh->b_page); in nilfs_mdt_create_block()
101 brelse(bh); in nilfs_mdt_create_block()
116 struct buffer_head *bh; in nilfs_mdt_submit_block() local
120 bh = nilfs_grab_buffer(inode, inode->i_mapping, blkoff, 0); in nilfs_mdt_submit_block()
121 if (unlikely(!bh)) in nilfs_mdt_submit_block()
125 if (buffer_uptodate(bh)) in nilfs_mdt_submit_block()
129 if (!trylock_buffer(bh)) { in nilfs_mdt_submit_block()
134 lock_buffer(bh); in nilfs_mdt_submit_block()
136 if (buffer_uptodate(bh)) { in nilfs_mdt_submit_block()
137 unlock_buffer(bh); in nilfs_mdt_submit_block()
143 unlock_buffer(bh); in nilfs_mdt_submit_block()
146 map_bh(bh, inode->i_sb, (sector_t)blknum); in nilfs_mdt_submit_block()
148 bh->b_end_io = end_buffer_read_sync; in nilfs_mdt_submit_block()
149 get_bh(bh); in nilfs_mdt_submit_block()
150 submit_bh(opf, bh); in nilfs_mdt_submit_block()
156 get_bh(bh); in nilfs_mdt_submit_block()
157 *out_bh = bh; in nilfs_mdt_submit_block()
160 unlock_page(bh->b_page); in nilfs_mdt_submit_block()
161 put_page(bh->b_page); in nilfs_mdt_submit_block()
162 brelse(bh); in nilfs_mdt_submit_block()
170 struct buffer_head *first_bh, *bh; in nilfs_mdt_read_block() local
186 REQ_OP_READ | REQ_RAHEAD, &bh); in nilfs_mdt_read_block()
188 brelse(bh); in nilfs_mdt_read_block()
374 struct buffer_head *bh; in nilfs_mdt_forget_block() local
376 bh = nilfs_page_get_nth_block(page, block - first_block); in nilfs_mdt_forget_block()
377 nilfs_forget_buffer(bh); in nilfs_mdt_forget_block()
558 int nilfs_mdt_freeze_buffer(struct inode *inode, struct buffer_head *bh) in nilfs_mdt_freeze_buffer() argument
565 page = grab_cache_page(shadow->inode->i_mapping, bh->b_folio->index); in nilfs_mdt_freeze_buffer()
572 bh_frozen = nilfs_page_get_nth_block(page, bh_offset(bh) >> blkbits); in nilfs_mdt_freeze_buffer()
575 nilfs_copy_buffer(bh_frozen, bh); in nilfs_mdt_freeze_buffer()
579 set_buffer_nilfs_redirected(bh); in nilfs_mdt_freeze_buffer()
590 nilfs_mdt_get_frozen_buffer(struct inode *inode, struct buffer_head *bh) in nilfs_mdt_get_frozen_buffer() argument
597 page = find_lock_page(shadow->inode->i_mapping, bh->b_folio->index); in nilfs_mdt_get_frozen_buffer()
600 n = bh_offset(bh) >> inode->i_blkbits; in nilfs_mdt_get_frozen_buffer()
612 struct buffer_head *bh; in nilfs_release_frozen_buffers() local
615 bh = list_first_entry(head, struct buffer_head, in nilfs_release_frozen_buffers()
617 list_del_init(&bh->b_assoc_buffers); in nilfs_release_frozen_buffers()
618 brelse(bh); /* drop ref-count to make it releasable */ in nilfs_release_frozen_buffers()