patch-1.3.45 linux/drivers/block/ll_rw_blk.c
Next file: linux/drivers/block/triton.c
Previous file: linux/drivers/block/ide.h
Back to the patch index
Back to the overall index
- Lines: 52
- Date:
Sun Nov 26 23:45:33 1995
- Orig file:
v1.3.44/linux/drivers/block/ll_rw_blk.c
- Orig date:
Tue Nov 21 13:22:08 1995
diff -u --recursive --new-file v1.3.44/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
@@ -306,7 +306,7 @@
/* buffer is locked, we just forget about it, else it's a normal read */
rw_ahead = (rw == READA || rw == WRITEA);
if (rw_ahead) {
- if (bh->b_lock)
+ if (buffer_locked(bh))
return;
if (rw == READA)
rw = READ;
@@ -321,17 +321,16 @@
sector = bh->b_blocknr * count;
if (blk_size[major])
if (blk_size[major][MINOR(bh->b_dev)] < (sector + count)>>1) {
- bh->b_dirt = bh->b_uptodate = 0;
- bh->b_req = 0;
+ bh->b_state = 0;
printk("attempt to access beyond end of device\n");
return;
}
/* Uhhuh.. Nasty dead-lock possible here.. */
- if (bh->b_lock)
+ if (buffer_locked(bh))
return;
/* Maybe the above fixes it, and maybe it doesn't boot. Life is interesting */
lock_buffer(bh);
- if ((rw == WRITE && !bh->b_dirt) || (rw == READ && bh->b_uptodate)) {
+ if ((rw == WRITE && !buffer_dirty(bh)) || (rw == READ && buffer_uptodate(bh))) {
unlock_buffer(bh);
return;
}
@@ -523,7 +522,7 @@
plug_device(dev, &plug);
for (i = 0; i < nr; i++) {
if (bh[i]) {
- bh[i]->b_req = 1;
+ set_bit(BH_Req, &bh[i]->b_state);
make_request(major, rw, bh[i]);
if (rw == READ || rw == READA)
kstat.pgpgin++;
@@ -536,8 +535,10 @@
sorry:
for (i = 0; i < nr; i++) {
- if (bh[i])
- bh[i]->b_dirt = bh[i]->b_uptodate = 0;
+ if (bh[i]) {
+ clear_bit(BH_Dirty, &bh[i]->b_state);
+ clear_bit(BH_Uptodate, &bh[i]->b_state);
+ }
}
return;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this