* RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
@ 2006-09-19 23:56 David C Somayajulu
2006-09-22 17:09 ` [RFC] " David C Somayajulu
0 siblings, 1 reply; 10+ messages in thread
From: David C Somayajulu @ 2006-09-19 23:56 UTC (permalink / raw)
To: Jens Axboe, James Bottomley, linux-scsi
Cc: open-iscsi, Mike Christie, Doug Maxey, David Wagner,
David Somayajulu, Ravi Anand, Duane Grigsby
This was necessitated by the need for a function to get back
to a scsi_cmnd, when an hba the posts its (corresponding) completion
interrupt with a block layer tag as its reference.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
---
block/ll_rw_blk.c | 7 +------
include/linux/blkdev.h | 8 ++++++++
include/scsi/scsi_tcq.h | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+), 6 deletions(-)
39a4a2005c490d22a3e5c4430e5e71375615de73
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 556a3d3..4aea565 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -837,12 +837,7 @@ EXPORT_SYMBOL(blk_queue_dma_alignment);
**/
struct request *blk_queue_find_tag(request_queue_t *q, int tag)
{
- struct blk_queue_tag *bqt = q->queue_tags;
-
- if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
- return NULL;
-
- return bqt->tag_index[tag];
+ return blk_map_queue_find_tag(q->queue_tags, tag);
}
EXPORT_SYMBOL(blk_queue_find_tag);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 427b0d6..dd16ce9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -749,6 +749,14 @@ extern long blk_congestion_wait(int rw,
extern struct blk_queue_tag *blk_init_tags(int);
extern void blk_free_tags(struct blk_queue_tag *);
+static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
+ int tag)
+{
+ if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
+ return NULL;
+ return bqt->tag_index[tag];
+}
+
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
extern int blkdev_issue_flush(struct block_device *, sector_t *);
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index d04d05a..1215ffe 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -144,4 +144,24 @@ static inline int scsi_init_shared_tag_m
return shost->bqt ? 0 : -ENOMEM;
}
+/**
+ * scsi_host_find_tag - find the tagged command by host
+ * @shost: pointer to scsi host
+ * @tag: tag of the scsi_cmnd
+ *
+ * Notes:
+ * Only works with tags allocated by the generic blk layer.
+ */
+static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost,
+ int tag)
+{
+ struct request *req;
+
+ if (tag != SCSI_NO_TAG) {
+ req = blk_map_queue_find_tag(shost->bqt, tag);
+ return req ? (struct scsi_cmnd *)req->special : NULL;
+ }
+ return NULL;
+}
+
#endif /* _SCSI_SCSI_TCQ_H */
--
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-09-19 23:56 RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag David C Somayajulu
@ 2006-09-22 17:09 ` David C Somayajulu
2006-09-22 19:11 ` Jens Axboe
0 siblings, 1 reply; 10+ messages in thread
From: David C Somayajulu @ 2006-09-22 17:09 UTC (permalink / raw)
To: Jens Axboe
Cc: James Bottomley, linux-scsi, Mike Christie, Doug Maxey,
David Wagner
On Tue, 2006-09-19 at 16:56 -0700, David C Somayajulu wrote:
> This was necessitated by the need for a function to get back
> to a scsi_cmnd, when an hba the posts its (corresponding) completion
> interrupt with a block layer tag as its reference.
Regenerated the patch with reference to
git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
Also fixed tabs.
Here is the link to the same patch with reference scsi-misc just in case
( ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/blk_tag_helper_patch.txt )
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
---
block/ll_rw_blk.c | 7 +------
include/linux/blkdev.h | 8 ++++++++
include/scsi/scsi_tcq.h | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+), 6 deletions(-)
f07bce89f5707f53a502543b47a95fea1b041084
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index ddd9253..6c55467 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -837,12 +837,7 @@ EXPORT_SYMBOL(blk_queue_dma_alignment);
**/
struct request *blk_queue_find_tag(request_queue_t *q, int tag)
{
- struct blk_queue_tag *bqt = q->queue_tags;
-
- if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
- return NULL;
-
- return bqt->tag_index[tag];
+ return blk_map_queue_find_tag(q->queue_tags, tag);
}
EXPORT_SYMBOL(blk_queue_find_tag);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index aafe827..924d05e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -747,6 +747,14 @@ extern int blk_queue_resize_tags(request
extern void blk_queue_invalidate_tags(request_queue_t *);
extern long blk_congestion_wait(int rw, long timeout);
+static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
+ int tag)
+{
+ if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
+ return NULL;
+ return bqt->tag_index[tag];
+}
+
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
extern int blkdev_issue_flush(struct block_device *, sector_t *);
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index e47e36a..1733b4d 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -131,4 +131,24 @@ static inline struct scsi_cmnd *scsi_fin
return sdev->current_cmnd;
}
+/**
+ * scsi_host_find_tag - find the tagged command by host
+ * @shost: pointer to scsi_host
+ * @tag: tag of the scsi_cmnd
+ *
+ * Notes:
+ * Only works with tags allocated by the generic blk layer.
+ **/
+static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost,
+ int tag)
+{
+ struct request *req;
+
+ if (tag != SCSI_NO_TAG) {
+ req = blk_map_queue_find_tag(shost->bqt, tag);
+ return req ? (struct scsi_cmnd *)req->special : NULL;
+ }
+ return NULL;
+}
+
#endif /* _SCSI_SCSI_TCQ_H */
--
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-09-22 17:09 ` [RFC] " David C Somayajulu
@ 2006-09-22 19:11 ` Jens Axboe
2006-09-22 22:00 ` David C Somayajulu
0 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2006-09-22 19:11 UTC (permalink / raw)
To: David C Somayajulu
Cc: James Bottomley, linux-scsi, Mike Christie, Doug Maxey,
David Wagner
On Fri, Sep 22 2006, David C Somayajulu wrote:
> On Tue, 2006-09-19 at 16:56 -0700, David C Somayajulu wrote:
> > This was necessitated by the need for a function to get back
> > to a scsi_cmnd, when an hba the posts its (corresponding) completion
> > interrupt with a block layer tag as its reference.
> Regenerated the patch with reference to
> git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
> Also fixed tabs.
>
> Here is the link to the same patch with reference scsi-misc just in case
> ( ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/blk_tag_helper_patch.txt )
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
It still fails for me:
axboe@nelson:/src/linux-2.6-block.git $ patch -p1 --dry-run < ~/1
patching file block/ll_rw_blk.c
Hunk #1 succeeded at 840 (offset 3 lines).
patching file include/linux/blkdev.h
Hunk #1 succeeded at 766 (offset 19 lines).
patching file include/scsi/scsi_tcq.h
Hunk #1 FAILED at 131.
1 out of 1 hunk FAILED -- saving rejects to file
include/scsi/scsi_tcq.h.rej
I wonder if you are using the 'block' branch, not just the master
branch? It seems to apply perfectly there, but that is just the same as
Linus' tree. So when you have cloned the block git repo, there are a
number of branches you can work against. The main branch with current
changes is the 'block' branch, that is what you want to be making
patches against.
I'll be away for the entire next week, so no rush on my end.
--
Jens Axboe
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-09-22 19:11 ` Jens Axboe
@ 2006-09-22 22:00 ` David C Somayajulu
2006-10-03 18:06 ` David Somayajulu
0 siblings, 1 reply; 10+ messages in thread
From: David C Somayajulu @ 2006-09-22 22:00 UTC (permalink / raw)
To: Jens Axboe
Cc: James Bottomley, linux-scsi, Mike Christie, Doug Maxey,
David Wagner
On Fri, 2006-09-22 at 21:11 +0200, Jens Axboe wrote:
> On Fri, Sep 22 2006, David C Somayajulu wrote:
> > On Tue, 2006-09-19 at 16:56 -0700, David C Somayajulu wrote:
> > > This was necessitated by the need for a function to get back
> > > to a scsi_cmnd, when an hba the posts its (corresponding) completion
> > > interrupt with a block layer tag as its reference.
> > Regenerated the patch with reference to
> > git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
> > Also fixed tabs.
> >
> > Here is the link to the same patch with reference scsi-misc just in case
> > ( ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/blk_tag_helper_patch.txt )
> >
> > Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
> > Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
>
> It still fails for me:
>
> axboe@nelson:/src/linux-2.6-block.git $ patch -p1 --dry-run < ~/1
> patching file block/ll_rw_blk.c
> Hunk #1 succeeded at 840 (offset 3 lines).
> patching file include/linux/blkdev.h
> Hunk #1 succeeded at 766 (offset 19 lines).
> patching file include/scsi/scsi_tcq.h
> Hunk #1 FAILED at 131.
> 1 out of 1 hunk FAILED -- saving rejects to file
> include/scsi/scsi_tcq.h.rej
>
> I wonder if you are using the 'block' branch, not just the master
> branch? It seems to apply perfectly there, but that is just the same as
> Linus' tree. So when you have cloned the block git repo, there are a
> number of branches you can work against. The main branch with current
> changes is the 'block' branch, that is what you want to be making
> patches against.
>
> I'll be away for the entire next week, so no rush on my end.
>
I think I got it right this time. Here it is.
Thanks
David Somayajulu
---
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 4475fa4..a4a72bd 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -840,12 +840,7 @@ EXPORT_SYMBOL(blk_queue_dma_alignment);
**/
struct request *blk_queue_find_tag(request_queue_t *q, int tag)
{
- struct blk_queue_tag *bqt = q->queue_tags;
-
- if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
- return NULL;
-
- return bqt->tag_index[tag];
+ return blk_map_queue_find_tag(q->queue_tags, tag);
}
EXPORT_SYMBOL(blk_queue_find_tag);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c55d470..10fd39d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -766,6 +766,14 @@ extern int blk_queue_resize_tags(request
extern void blk_queue_invalidate_tags(request_queue_t *);
extern long blk_congestion_wait(int rw, long timeout);
+static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
+ int tag)
+{
+ if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
+ return NULL;
+ return bqt->tag_index[tag];
+}
+
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
extern int blkdev_issue_flush(struct block_device *, sector_t *);
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index d1d9b10..01b7481 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -131,5 +131,25 @@ static inline struct scsi_cmnd *scsi_fin
return sdev->current_cmnd;
}
+/**
+ * scsi_host_find_tag - find the tagged command by host
+ * @shost: pointer to scsi_host
+ * @tag: tag of the scsi_cmnd
+ *
+ * Notes:
+ * Only works with tags allocated by the generic blk layer.
+ **/
+static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost,
+ int tag)
+{
+ struct request *req;
+
+ if (tag != SCSI_NO_TAG) {
+ req = blk_map_queue_find_tag(shost->bqt, tag);
+ return req ? (struct scsi_cmnd *)req->special : NULL;
+ }
+ return NULL;
+}
+
#endif /* CONFIG_BLOCK */
#endif /* _SCSI_SCSI_TCQ_H */
---
^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-09-22 22:00 ` David C Somayajulu
@ 2006-10-03 18:06 ` David Somayajulu
2006-10-03 19:10 ` Jens Axboe
0 siblings, 1 reply; 10+ messages in thread
From: David Somayajulu @ 2006-10-03 18:06 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-scsi, Mike Christie, David Wagner
> From: linux-scsi-owner@vger.kernel.org
[mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of David C
> Somayajulu
> Sent: Friday, September 22, 2006 3:01 PM
> To: Jens Axboe
> Cc: James Bottomley; linux-scsi@vger.kernel.org; Mike Christie; Doug
Maxey; David Wagner
> > I wonder if you are using the 'block' branch, not just the master
> > branch? It seems to apply perfectly there, but that is just the same
as
> > Linus' tree. So when you have cloned the block git repo, there are a
> > number of branches you can work against. The main branch with
current
> > changes is the 'block' branch, that is what you want to be making
> > patches against.
> >
> > I'll be away for the entire next week, so no rush on my end.
> >
> I think I got it right this time. Here it is.
> Thanks
> David Somayajulu
Jens,
I would appreciate if you can let me know if the last post of the above
patch was acceptable.
Thanks
David Somayajulu
> ---
>
> diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
> index 4475fa4..a4a72bd 100644
> --- a/block/ll_rw_blk.c
> +++ b/block/ll_rw_blk.c
> @@ -840,12 +840,7 @@ EXPORT_SYMBOL(blk_queue_dma_alignment);
> **/
> struct request *blk_queue_find_tag(request_queue_t *q, int tag)
> {
> - struct blk_queue_tag *bqt = q->queue_tags;
> -
> - if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
> - return NULL;
> -
> - return bqt->tag_index[tag];
> + return blk_map_queue_find_tag(q->queue_tags, tag);
> }
>
> EXPORT_SYMBOL(blk_queue_find_tag);
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index c55d470..10fd39d 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -766,6 +766,14 @@ extern int blk_queue_resize_tags(request
> extern void blk_queue_invalidate_tags(request_queue_t *);
> extern long blk_congestion_wait(int rw, long timeout);
>
> +static inline struct request *blk_map_queue_find_tag(struct
blk_queue_tag *bqt,
> + int tag)
> +{
> + if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
> + return NULL;
> + return bqt->tag_index[tag];
> +}
> +
> extern void blk_rq_bio_prep(request_queue_t *, struct request *,
struct bio *);
> extern int blkdev_issue_flush(struct block_device *, sector_t *);
>
> diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
> index d1d9b10..01b7481 100644
> --- a/include/scsi/scsi_tcq.h
> +++ b/include/scsi/scsi_tcq.h
> @@ -131,5 +131,25 @@ static inline struct scsi_cmnd *scsi_fin
> return sdev->current_cmnd;
> }
>
> +/**
> + * scsi_host_find_tag - find the tagged command by host
> + * @shost: pointer to scsi_host
> + * @tag: tag of the scsi_cmnd
> + *
> + * Notes:
> + * Only works with tags allocated by the generic blk layer.
> + **/
> +static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host
*shost,
> + int tag)
> +{
> + struct request *req;
> +
> + if (tag != SCSI_NO_TAG) {
> + req = blk_map_queue_find_tag(shost->bqt, tag);
> + return req ? (struct scsi_cmnd *)req->special : NULL;
> + }
> + return NULL;
> +}
> +
> #endif /* CONFIG_BLOCK */
> #endif /* _SCSI_SCSI_TCQ_H */
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-10-03 18:06 ` David Somayajulu
@ 2006-10-03 19:10 ` Jens Axboe
2006-10-03 20:43 ` David Somayajulu
2006-10-03 22:27 ` David C Somayajulu
0 siblings, 2 replies; 10+ messages in thread
From: Jens Axboe @ 2006-10-03 19:10 UTC (permalink / raw)
To: David Somayajulu; +Cc: linux-scsi, Mike Christie, David Wagner
On Tue, Oct 03 2006, David Somayajulu wrote:
> > From: linux-scsi-owner@vger.kernel.org
> [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of David C
> > Somayajulu
> > Sent: Friday, September 22, 2006 3:01 PM
> > To: Jens Axboe
> > Cc: James Bottomley; linux-scsi@vger.kernel.org; Mike Christie; Doug
> Maxey; David Wagner
> > > I wonder if you are using the 'block' branch, not just the master
> > > branch? It seems to apply perfectly there, but that is just the same
> as
> > > Linus' tree. So when you have cloned the block git repo, there are a
> > > number of branches you can work against. The main branch with
> current
> > > changes is the 'block' branch, that is what you want to be making
> > > patches against.
> > >
> > > I'll be away for the entire next week, so no rush on my end.
> > >
> > I think I got it right this time. Here it is.
> > Thanks
> > David Somayajulu
> Jens,
> I would appreciate if you can let me know if the last post of the above
> patch was acceptable.
The content and indentation looks good, but it doesn't apply to the
current tree. Care to rediff it?
--
Jens Axboe
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-10-03 19:10 ` Jens Axboe
@ 2006-10-03 20:43 ` David Somayajulu
2006-10-03 22:27 ` David C Somayajulu
1 sibling, 0 replies; 10+ messages in thread
From: David Somayajulu @ 2006-10-03 20:43 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-scsi, Mike Christie, David Wagner
> -----Original Message-----
> From: Jens Axboe [mailto:jens.axboe@oracle.com]
> Sent: Tuesday, October 03, 2006 12:10 PM
> To: David Somayajulu
> Cc: linux-scsi@vger.kernel.org; Mike Christie; David Wagner
> Subject: Re: [RFC] [PATCH] helper function for retrieving scsi_cmd
given host based block layer tag
>
> On Tue, Oct 03 2006, David Somayajulu wrote:
> > > From: linux-scsi-owner@vger.kernel.org
> > [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of David C
> > > Somayajulu
> > > Sent: Friday, September 22, 2006 3:01 PM
> > > To: Jens Axboe
> > > Cc: James Bottomley; linux-scsi@vger.kernel.org; Mike Christie;
Doug
> > Maxey; David Wagner
> > > > I wonder if you are using the 'block' branch, not just the
master
> > > > branch? It seems to apply perfectly there, but that is just the
same
> > as
> > > > Linus' tree. So when you have cloned the block git repo, there
are a
> > > > number of branches you can work against. The main branch with
> > current
> > > > changes is the 'block' branch, that is what you want to be
making
> > > > patches against.
> > > >
> > > > I'll be away for the entire next week, so no rush on my end.
> > > >
> > > I think I got it right this time. Here it is.
> > > Thanks
> > > David Somayajulu
> > Jens,
> > I would appreciate if you can let me know if the last post of the
above
> > patch was acceptable.
>
> The content and indentation looks good, but it doesn't apply to the
> current tree. Care to rediff it?
Thanks Jens. I will send this ASAP.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-10-03 19:10 ` Jens Axboe
2006-10-03 20:43 ` David Somayajulu
@ 2006-10-03 22:27 ` David C Somayajulu
2006-10-04 6:27 ` Jens Axboe
1 sibling, 1 reply; 10+ messages in thread
From: David C Somayajulu @ 2006-10-03 22:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-scsi, Mike Christie, David Wagner
On Tue, 2006-10-03 at 21:10 +0200, Jens Axboe wrote:
> The content and indentation looks good, but it doesn't apply to the
> current tree. Care to rediff it?
Here it is. Thanks.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Date: Tue Oct 3 14:52:51 2006 -0700
---
block/ll_rw_blk.c | 7 +------
include/linux/blkdev.h | 8 ++++++++
include/scsi/scsi_tcq.h | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+), 6 deletions(-)
fd6b37cdcd6db09207461f56eeebd377bab49d01
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 83425fb..c847e17 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -840,12 +840,7 @@ EXPORT_SYMBOL(blk_queue_dma_alignment);
**/
struct request *blk_queue_find_tag(request_queue_t *q, int tag)
{
- struct blk_queue_tag *bqt = q->queue_tags;
-
- if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
- return NULL;
-
- return bqt->tag_index[tag];
+ return blk_map_queue_find_tag(q->queue_tags, tag);
}
EXPORT_SYMBOL(blk_queue_find_tag);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1d79b8d..26f7856 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -769,6 +769,14 @@ extern struct blk_queue_tag *blk_init_ta
extern void blk_free_tags(struct blk_queue_tag *);
extern void blk_congestion_end(int rw);
+static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
+ int tag)
+{
+ if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
+ return NULL;
+ return bqt->tag_index[tag];
+}
+
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
extern int blkdev_issue_flush(struct block_device *, sector_t *);
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index c247a28..cf4c219 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -144,5 +144,25 @@ static inline int scsi_init_shared_tag_m
return shost->bqt ? 0 : -ENOMEM;
}
+/**
+ * scsi_host_find_tag - find the tagged command by host
+ * @shost: pointer to scsi_host
+ * @tag: tag of the scsi_cmnd
+ *
+ * Notes:
+ * Only works with tags allocated by the generic blk layer.
+ **/
+static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost,
+ int tag)
+{
+ struct request *req;
+
+ if (tag != SCSI_NO_TAG) {
+ req = blk_map_queue_find_tag(shost->bqt, tag);
+ return req ? (struct scsi_cmnd *)req->special : NULL;
+ }
+ return NULL;
+}
+
#endif /* CONFIG_BLOCK */
#endif /* _SCSI_SCSI_TCQ_H */
--
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-10-03 22:27 ` David C Somayajulu
@ 2006-10-04 6:27 ` Jens Axboe
2006-10-04 16:27 ` David Somayajulu
0 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2006-10-04 6:27 UTC (permalink / raw)
To: David C Somayajulu; +Cc: linux-scsi, Mike Christie, David Wagner
On Tue, Oct 03 2006, David C Somayajulu wrote:
> On Tue, 2006-10-03 at 21:10 +0200, Jens Axboe wrote:
> > The content and indentation looks good, but it doesn't apply to the
> > current tree. Care to rediff it?
> Here it is. Thanks.
Thanks, applied! It'll go upstream in a day or two.
--
Jens Axboe
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
2006-10-04 6:27 ` Jens Axboe
@ 2006-10-04 16:27 ` David Somayajulu
0 siblings, 0 replies; 10+ messages in thread
From: David Somayajulu @ 2006-10-04 16:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-scsi, Mike Christie, David Wagner
> From: Jens Axboe [mailto:jens.axboe@oracle.com]
> Sent: Tuesday, October 03, 2006 11:28 PM
> On Tue, Oct 03 2006, David C Somayajulu wrote:
> > On Tue, 2006-10-03 at 21:10 +0200, Jens Axboe wrote:
> > > The content and indentation looks good, but it doesn't apply to
the
> > > current tree. Care to rediff it?
> > Here it is. Thanks.
>
> Thanks, applied! It'll go upstream in a day or two.
Jens, Thank you very much.
-david S.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-10-04 16:27 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-19 23:56 RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag David C Somayajulu
2006-09-22 17:09 ` [RFC] " David C Somayajulu
2006-09-22 19:11 ` Jens Axboe
2006-09-22 22:00 ` David C Somayajulu
2006-10-03 18:06 ` David Somayajulu
2006-10-03 19:10 ` Jens Axboe
2006-10-03 20:43 ` David Somayajulu
2006-10-03 22:27 ` David C Somayajulu
2006-10-04 6:27 ` Jens Axboe
2006-10-04 16:27 ` David Somayajulu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox