summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2011-07-08 10:19:21 +0400
committerJens Axboe <jaxboe@fusionio.com>2011-07-08 10:19:21 +0400
commit316cc67d5e03801a5ee4ac660a4dfe9e02aed475 (patch)
treeddcac370cf4402127a9609cfe6bb86eb1ebb6c8d
parent55c022bbddb2c056b5dff1bd1b1758d31b6d64c9 (diff)
downloadlinux-316cc67d5e03801a5ee4ac660a4dfe9e02aed475.tar.xz
block: document blk_plug list access
I'm often confused why not disable preempt when changing blk_plug list. It would be better to add comments here in case others have the similar concerns. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--include/linux/blkdev.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 92edb9601242..6dcea6885a5d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -857,6 +857,12 @@ struct request_queue *blk_alloc_queue(gfp_t);
struct request_queue *blk_alloc_queue_node(gfp_t, int);
extern void blk_put_queue(struct request_queue *);
+/*
+ * Note: Code in between changing the blk_plug list/cb_list or element of such
+ * lists is preemptable, but such code can't do sleep (or be very careful),
+ * otherwise data is corrupted. For details, please check schedule() where
+ * blk_schedule_flush_plug() is called.
+ */
struct blk_plug {
unsigned long magic;
struct list_head list;