Lines Matching refs:bh
70 struct buffer_head *bh;
71 int bufsize = sizeof(*bh) + kdev->k_ctx->fs->blocksize -
72 sizeof(bh->b_data);
74 bh = e2fsck_allocate_memory(kdev->k_ctx, bufsize, "block buffer");
75 if (!bh)
85 bh->b_ctx = kdev->k_ctx;
87 bh->b_io = kdev->k_ctx->fs->io;
89 bh->b_io = kdev->k_ctx->journal_io;
90 bh->b_size = blocksize;
91 bh->b_blocknr = blocknr;
93 return bh;
111 struct buffer_head *bh;
114 bh = *bhp++;
115 if (rw == READ && !bh->b_uptodate) {
117 bh->b_blocknr, (void *) bh);
118 retval = io_channel_read_blk64(bh->b_io,
119 bh->b_blocknr,
120 1, bh->b_data);
122 com_err(bh->b_ctx->device_name, retval,
124 bh->b_blocknr);
125 bh->b_err = (int) retval;
128 bh->b_uptodate = 1;
129 } else if (rw == WRITE && bh->b_dirty) {
131 bh->b_blocknr,
132 (void *) bh);
133 retval = io_channel_write_blk64(bh->b_io,
134 bh->b_blocknr,
135 1, bh->b_data);
137 com_err(bh->b_ctx->device_name, retval,
139 bh->b_blocknr);
140 bh->b_err = (int) retval;
143 bh->b_dirty = 0;
144 bh->b_uptodate = 1;
148 bh->b_blocknr);
153 void mark_buffer_dirty(struct buffer_head *bh)
155 bh->b_dirty = 1;
158 static void mark_buffer_clean(struct buffer_head * bh)
160 bh->b_dirty = 0;
163 void brelse(struct buffer_head *bh)
165 if (bh->b_dirty)
166 ll_rw_block(WRITE, 1, &bh);
168 bh->b_blocknr, (void *) bh, --bh_count);
169 ext2fs_free_mem(&bh);
172 int buffer_uptodate(struct buffer_head *bh)
174 return bh->b_uptodate;
177 void mark_buffer_uptodate(struct buffer_head *bh, int val)
179 bh->b_uptodate = val;
182 void wait_on_buffer(struct buffer_head *bh)
184 if (!bh->b_uptodate)
185 ll_rw_block(READ, 1, &bh);
233 struct buffer_head *bh;
397 bh = getblk(dev_journal, start, ctx->fs->blocksize);
398 if (!bh) {
402 ll_rw_block(READ, 1, &bh);
403 if ((retval = bh->b_err) != 0) {
404 brelse(bh);
407 memcpy(&jsuper, start ? bh->b_data : bh->b_data + 1024,
409 brelse(bh);
433 if (!(bh = getblk(dev_journal, start, journal->j_blocksize))) {
438 journal->j_sb_buffer = bh;
439 journal->j_superblock = (journal_superblock_t *)bh->b_data;