diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-05-11 21:36:38 -0400 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 15:53:03 -0400 |
commit | 184d2944cb3b92a2e8e1733c59d1e531ad6e924a (patch) | |
tree | e205b82e0ce14b846c1df01545dcce6f488b12a5 /drivers/block/nvme.c | |
parent | b77954cbddff28d55a36fad3c16f4daebb0f01df (diff) |
NVMe: Add a few calling convention notes
For the benefit of reviewers, add comments to a few functions describing
their calling context
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block/nvme.c')
-rw-r--r-- | drivers/block/nvme.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index ddc21ba24a70..12062c108bd9 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -155,6 +155,9 @@ static struct nvme_cmd_info *nvme_cmd_info(struct nvme_queue *nvmeq) | |||
155 | * the bottom two bits of the ctx pointer to store the handler ID. | 155 | * the bottom two bits of the ctx pointer to store the handler ID. |
156 | * Passing in a pointer that's not 4-byte aligned will cause a BUG. | 156 | * Passing in a pointer that's not 4-byte aligned will cause a BUG. |
157 | * We can change this if it becomes a problem. | 157 | * We can change this if it becomes a problem. |
158 | * | ||
159 | * May be called with local interrupts disabled and the q_lock held, | ||
160 | * or with interrupts enabled and no locks held. | ||
158 | */ | 161 | */ |
159 | static int alloc_cmdid(struct nvme_queue *nvmeq, void *ctx, int handler, | 162 | static int alloc_cmdid(struct nvme_queue *nvmeq, void *ctx, int handler, |
160 | unsigned timeout) | 163 | unsigned timeout) |
@@ -202,6 +205,9 @@ enum { | |||
202 | #define CMD_CTX_INVALID (0x314 + CMD_CTX_BASE) | 205 | #define CMD_CTX_INVALID (0x314 + CMD_CTX_BASE) |
203 | #define CMD_CTX_FLUSH (0x318 + CMD_CTX_BASE) | 206 | #define CMD_CTX_FLUSH (0x318 + CMD_CTX_BASE) |
204 | 207 | ||
208 | /* | ||
209 | * Called with local interrupts disabled and the q_lock held. May not sleep. | ||
210 | */ | ||
205 | static unsigned long free_cmdid(struct nvme_queue *nvmeq, int cmdid) | 211 | static unsigned long free_cmdid(struct nvme_queue *nvmeq, int cmdid) |
206 | { | 212 | { |
207 | unsigned long data; | 213 | unsigned long data; |
@@ -326,7 +332,7 @@ static void bio_completion(struct nvme_queue *nvmeq, void *ctx, | |||
326 | } | 332 | } |
327 | } | 333 | } |
328 | 334 | ||
329 | /* length is in bytes */ | 335 | /* length is in bytes. gfp flags indicates whether we may sleep. */ |
330 | static struct nvme_prps *nvme_setup_prps(struct nvme_dev *dev, | 336 | static struct nvme_prps *nvme_setup_prps(struct nvme_dev *dev, |
331 | struct nvme_common_command *cmd, | 337 | struct nvme_common_command *cmd, |
332 | struct scatterlist *sg, int *len, | 338 | struct scatterlist *sg, int *len, |
@@ -483,6 +489,9 @@ static int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns) | |||
483 | return nvme_submit_flush(nvmeq, ns, cmdid); | 489 | return nvme_submit_flush(nvmeq, ns, cmdid); |
484 | } | 490 | } |
485 | 491 | ||
492 | /* | ||
493 | * Called with local interrupts disabled and the q_lock held. May not sleep. | ||
494 | */ | ||
486 | static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns, | 495 | static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns, |
487 | struct bio *bio) | 496 | struct bio *bio) |
488 | { | 497 | { |