summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-04-18 18:25:42 +1000
committerNeilBrown <neilb@suse.de>2011-04-18 18:25:42 +1000
commit97658cdd3af7d01461874c93b89afa4a2465e7c6 (patch)
treed4e2f930850eb3981307a3eec8c86399dcebf68a /drivers/md/md.h
parent482c083492ddaa32ef5864bae3d143dc8bcdf7d1 (diff)
downloadop-kernel-dev-97658cdd3af7d01461874c93b89afa4a2465e7c6.zip
op-kernel-dev-97658cdd3af7d01461874c93b89afa4a2465e7c6.tar.gz
md: provide generic support for handling unplug callbacks.
When an md device adds a request to a queue, it can call mddev_check_plugged. If this succeeds then we know that the md thread will be woken up shortly, and ->plug_cnt will be non-zero until then, so some processing can be delayed. If it fails, then no unplug callback is expected and the make_request function needs to do whatever is required to make the request happen. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index fad9022..0b1fd3f 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -179,6 +179,9 @@ struct mddev_s
int delta_disks, new_level, new_layout;
int new_chunk_sectors;
+ atomic_t plug_cnt; /* If device is expecting
+ * more bios soon.
+ */
struct mdk_thread_s *thread; /* management thread */
struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */
sector_t curr_resync; /* last block scheduled */
@@ -508,4 +511,5 @@ extern struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
mddev_t *mddev);
extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
mddev_t *mddev);
+extern int mddev_check_plugged(mddev_t *mddev);
#endif /* _MD_MD_H */
OpenPOWER on IntegriCloud