Lines Matching refs:bh
53 int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, in ocfs2_write_block() argument
58 trace_ocfs2_write_block((unsigned long long)bh->b_blocknr, ci); in ocfs2_write_block()
60 BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO); in ocfs2_write_block()
61 BUG_ON(buffer_jbd(bh)); in ocfs2_write_block()
74 lock_buffer(bh); in ocfs2_write_block()
75 set_buffer_uptodate(bh); in ocfs2_write_block()
78 clear_buffer_dirty(bh); in ocfs2_write_block()
80 get_bh(bh); /* for end_buffer_write_sync() */ in ocfs2_write_block()
81 bh->b_end_io = end_buffer_write_sync; in ocfs2_write_block()
82 submit_bh(REQ_OP_WRITE, 0, bh); in ocfs2_write_block()
84 wait_on_buffer(bh); in ocfs2_write_block()
86 if (buffer_uptodate(bh)) { in ocfs2_write_block()
87 ocfs2_set_buffer_uptodate(ci, bh); in ocfs2_write_block()
106 struct buffer_head *bh; in ocfs2_read_blocks_sync() local
122 bh = bhs[i]; in ocfs2_read_blocks_sync()
124 if (buffer_jbd(bh)) { in ocfs2_read_blocks_sync()
126 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks_sync()
130 if (buffer_dirty(bh)) { in ocfs2_read_blocks_sync()
136 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks_sync()
140 lock_buffer(bh); in ocfs2_read_blocks_sync()
141 if (buffer_jbd(bh)) { in ocfs2_read_blocks_sync()
146 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks_sync()
149 unlock_buffer(bh); in ocfs2_read_blocks_sync()
154 clear_buffer_uptodate(bh); in ocfs2_read_blocks_sync()
155 get_bh(bh); /* for end_buffer_read_sync() */ in ocfs2_read_blocks_sync()
156 bh->b_end_io = end_buffer_read_sync; in ocfs2_read_blocks_sync()
157 submit_bh(REQ_OP_READ, 0, bh); in ocfs2_read_blocks_sync()
161 bh = bhs[i - 1]; in ocfs2_read_blocks_sync()
164 if (!buffer_jbd(bh)) in ocfs2_read_blocks_sync()
165 wait_on_buffer(bh); in ocfs2_read_blocks_sync()
167 if (!buffer_uptodate(bh)) { in ocfs2_read_blocks_sync()
172 put_bh(bh); in ocfs2_read_blocks_sync()
184 struct buffer_head *bh)) in ocfs2_read_blocks() argument
188 struct buffer_head *bh; in ocfs2_read_blocks() local
226 bh = bhs[i]; in ocfs2_read_blocks()
253 if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) { in ocfs2_read_blocks()
255 (unsigned long long)bh->b_blocknr, in ocfs2_read_blocks()
262 trace_ocfs2_read_blocks_bh((unsigned long long)bh->b_blocknr, in ocfs2_read_blocks()
263 ignore_cache, buffer_jbd(bh), buffer_dirty(bh)); in ocfs2_read_blocks()
265 if (buffer_jbd(bh)) { in ocfs2_read_blocks()
270 if (buffer_dirty(bh)) { in ocfs2_read_blocks()
281 && ocfs2_buffer_read_ahead(ci, bh)) in ocfs2_read_blocks()
284 lock_buffer(bh); in ocfs2_read_blocks()
285 if (buffer_jbd(bh)) { in ocfs2_read_blocks()
289 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks()
292 unlock_buffer(bh); in ocfs2_read_blocks()
303 && ocfs2_buffer_uptodate(ci, bh)) { in ocfs2_read_blocks()
304 unlock_buffer(bh); in ocfs2_read_blocks()
308 clear_buffer_uptodate(bh); in ocfs2_read_blocks()
309 get_bh(bh); /* for end_buffer_read_sync() */ in ocfs2_read_blocks()
311 set_buffer_needs_validate(bh); in ocfs2_read_blocks()
312 bh->b_end_io = end_buffer_read_sync; in ocfs2_read_blocks()
313 submit_bh(REQ_OP_READ, 0, bh); in ocfs2_read_blocks()
321 bh = bhs[i]; in ocfs2_read_blocks()
326 put_bh(bh); in ocfs2_read_blocks()
333 if (!buffer_jbd(bh)) in ocfs2_read_blocks()
334 wait_on_buffer(bh); in ocfs2_read_blocks()
336 if (!buffer_uptodate(bh)) { in ocfs2_read_blocks()
344 put_bh(bh); in ocfs2_read_blocks()
349 if (buffer_needs_validate(bh)) { in ocfs2_read_blocks()
353 BUG_ON(buffer_jbd(bh)); in ocfs2_read_blocks()
354 clear_buffer_needs_validate(bh); in ocfs2_read_blocks()
355 status = validate(sb, bh); in ocfs2_read_blocks()
357 put_bh(bh); in ocfs2_read_blocks()
367 ocfs2_set_buffer_uptodate(ci, bh); in ocfs2_read_blocks()
404 struct buffer_head *bh) in ocfs2_write_super_or_backup() argument
407 struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; in ocfs2_write_super_or_backup()
409 BUG_ON(buffer_jbd(bh)); in ocfs2_write_super_or_backup()
410 ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr); in ocfs2_write_super_or_backup()
418 lock_buffer(bh); in ocfs2_write_super_or_backup()
419 set_buffer_uptodate(bh); in ocfs2_write_super_or_backup()
422 clear_buffer_dirty(bh); in ocfs2_write_super_or_backup()
424 get_bh(bh); /* for end_buffer_write_sync() */ in ocfs2_write_super_or_backup()
425 bh->b_end_io = end_buffer_write_sync; in ocfs2_write_super_or_backup()
426 ocfs2_compute_meta_ecc(osb->sb, bh->b_data, &di->i_check); in ocfs2_write_super_or_backup()
427 submit_bh(REQ_OP_WRITE, 0, bh); in ocfs2_write_super_or_backup()
429 wait_on_buffer(bh); in ocfs2_write_super_or_backup()
431 if (!buffer_uptodate(bh)) { in ocfs2_write_super_or_backup()