Lines Matching refs:bh

54 int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,  in ocfs2_write_block()  argument
59 trace_ocfs2_write_block((unsigned long long)bh->b_blocknr, ci); in ocfs2_write_block()
61 BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO); in ocfs2_write_block()
62 BUG_ON(buffer_jbd(bh)); in ocfs2_write_block()
75 lock_buffer(bh); in ocfs2_write_block()
76 set_buffer_uptodate(bh); in ocfs2_write_block()
79 clear_buffer_dirty(bh); in ocfs2_write_block()
81 get_bh(bh); /* for end_buffer_write_sync() */ in ocfs2_write_block()
82 bh->b_end_io = end_buffer_write_sync; in ocfs2_write_block()
83 submit_bh(REQ_OP_WRITE, 0, bh); in ocfs2_write_block()
85 wait_on_buffer(bh); in ocfs2_write_block()
87 if (buffer_uptodate(bh)) { in ocfs2_write_block()
88 ocfs2_set_buffer_uptodate(ci, bh); in ocfs2_write_block()
107 struct buffer_head *bh; in ocfs2_read_blocks_sync() local
123 bh = bhs[i]; in ocfs2_read_blocks_sync()
125 if (buffer_jbd(bh)) { in ocfs2_read_blocks_sync()
127 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks_sync()
131 if (buffer_dirty(bh)) { in ocfs2_read_blocks_sync()
137 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks_sync()
141 lock_buffer(bh); in ocfs2_read_blocks_sync()
142 if (buffer_jbd(bh)) { in ocfs2_read_blocks_sync()
147 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks_sync()
150 unlock_buffer(bh); in ocfs2_read_blocks_sync()
155 clear_buffer_uptodate(bh); in ocfs2_read_blocks_sync()
156 get_bh(bh); /* for end_buffer_read_sync() */ in ocfs2_read_blocks_sync()
157 bh->b_end_io = end_buffer_read_sync; in ocfs2_read_blocks_sync()
158 submit_bh(REQ_OP_READ, 0, bh); in ocfs2_read_blocks_sync()
162 bh = bhs[i - 1]; in ocfs2_read_blocks_sync()
165 if (!buffer_jbd(bh)) in ocfs2_read_blocks_sync()
166 wait_on_buffer(bh); in ocfs2_read_blocks_sync()
168 if (!buffer_uptodate(bh)) { in ocfs2_read_blocks_sync()
173 put_bh(bh); in ocfs2_read_blocks_sync()
185 struct buffer_head *bh)) in ocfs2_read_blocks() argument
189 struct buffer_head *bh; in ocfs2_read_blocks() local
227 bh = bhs[i]; in ocfs2_read_blocks()
254 if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) { in ocfs2_read_blocks()
256 (unsigned long long)bh->b_blocknr, in ocfs2_read_blocks()
263 trace_ocfs2_read_blocks_bh((unsigned long long)bh->b_blocknr, in ocfs2_read_blocks()
264 ignore_cache, buffer_jbd(bh), buffer_dirty(bh)); in ocfs2_read_blocks()
266 if (buffer_jbd(bh)) { in ocfs2_read_blocks()
271 if (buffer_dirty(bh)) { in ocfs2_read_blocks()
282 && ocfs2_buffer_read_ahead(ci, bh)) in ocfs2_read_blocks()
285 lock_buffer(bh); in ocfs2_read_blocks()
286 if (buffer_jbd(bh)) { in ocfs2_read_blocks()
290 (unsigned long long)bh->b_blocknr); in ocfs2_read_blocks()
293 unlock_buffer(bh); in ocfs2_read_blocks()
304 && ocfs2_buffer_uptodate(ci, bh)) { in ocfs2_read_blocks()
305 unlock_buffer(bh); in ocfs2_read_blocks()
309 clear_buffer_uptodate(bh); in ocfs2_read_blocks()
310 get_bh(bh); /* for end_buffer_read_sync() */ in ocfs2_read_blocks()
312 set_buffer_needs_validate(bh); in ocfs2_read_blocks()
313 bh->b_end_io = end_buffer_read_sync; in ocfs2_read_blocks()
314 submit_bh(REQ_OP_READ, 0, bh); in ocfs2_read_blocks()
322 bh = bhs[i]; in ocfs2_read_blocks()
327 put_bh(bh); in ocfs2_read_blocks()
334 if (!buffer_jbd(bh)) in ocfs2_read_blocks()
335 wait_on_buffer(bh); in ocfs2_read_blocks()
337 if (!buffer_uptodate(bh)) { in ocfs2_read_blocks()
345 clear_buffer_needs_validate(bh); in ocfs2_read_blocks()
346 put_bh(bh); in ocfs2_read_blocks()
351 if (buffer_needs_validate(bh)) { in ocfs2_read_blocks()
355 BUG_ON(buffer_jbd(bh)); in ocfs2_read_blocks()
356 clear_buffer_needs_validate(bh); in ocfs2_read_blocks()
357 status = validate(sb, bh); in ocfs2_read_blocks()
359 put_bh(bh); in ocfs2_read_blocks()
369 ocfs2_set_buffer_uptodate(ci, bh); in ocfs2_read_blocks()
406 struct buffer_head *bh) in ocfs2_write_super_or_backup() argument
409 struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; in ocfs2_write_super_or_backup()
411 BUG_ON(buffer_jbd(bh)); in ocfs2_write_super_or_backup()
412 ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr); in ocfs2_write_super_or_backup()
420 lock_buffer(bh); in ocfs2_write_super_or_backup()
421 set_buffer_uptodate(bh); in ocfs2_write_super_or_backup()
424 clear_buffer_dirty(bh); in ocfs2_write_super_or_backup()
426 get_bh(bh); /* for end_buffer_write_sync() */ in ocfs2_write_super_or_backup()
427 bh->b_end_io = end_buffer_write_sync; in ocfs2_write_super_or_backup()
428 ocfs2_compute_meta_ecc(osb->sb, bh->b_data, &di->i_check); in ocfs2_write_super_or_backup()
429 submit_bh(REQ_OP_WRITE, 0, bh); in ocfs2_write_super_or_backup()
431 wait_on_buffer(bh); in ocfs2_write_super_or_backup()
433 if (!buffer_uptodate(bh)) { in ocfs2_write_super_or_backup()