patch-2.0.35 linux/include/linux/blk.h
Next file: linux/include/linux/blkdev.h
Previous file: linux/include/linux/baycom.h
Back to the patch index
Back to the overall index
- Lines: 37
- Date:
Mon Jul 13 13:47:38 1998
- Orig file:
v2.0.34/linux/include/linux/blk.h
- Orig date:
Wed Oct 15 15:22:13 1997
diff -u --recursive --new-file v2.0.34/linux/include/linux/blk.h linux/include/linux/blk.h
@@ -3,7 +3,9 @@
#include <linux/blkdev.h>
#include <linux/locks.h>
+#include <linux/malloc.h>
#include <linux/config.h>
+#include <linux/md.h>
/*
* NR_REQUEST is the number of entries in the request-queue.
@@ -400,8 +402,24 @@
if ((bh = req->bh) != NULL) {
req->bh = bh->b_reqnext;
bh->b_reqnext = NULL;
- mark_buffer_uptodate(bh, uptodate);
- unlock_buffer(bh);
+
+ /*
+ * This is our 'MD IO has finished' event handler.
+ * note that b_state should be cached in a register
+ * anyways, so the overhead if this checking is almost
+ * zero. But anyways .. we never get OO for free :)
+ */
+ if (test_bit(BH_MD, &bh->b_state)) {
+ struct md_personality * pers=(struct md_personality *)bh->personality;
+ pers->end_request(bh,uptodate);
+ }
+ /*
+ * the normal (nonmirrored and no RAID5) case:
+ */
+ else {
+ mark_buffer_uptodate(bh, uptodate);
+ unlock_buffer(bh);
+ }
if ((bh = req->bh) != NULL) {
req->current_nr_sectors = bh->b_size >> 9;
if (req->nr_sectors < req->current_nr_sectors) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov