From: Boaz Harrosh <bharrosh@panasas.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Kai.Makisara@kolumbus.fi, James.Bottomley@HansenPartnership.com,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH 09/11] st: convert read_mode_page to use st_scsi_kern_execute
Date: Sun, 30 Nov 2008 14:12:41 +0200 [thread overview]
Message-ID: <49328339.5050602@panasas.com> (raw)
In-Reply-To: <1228032485-10328-10-git-send-email-fujita.tomonori@lab.ntt.co.jp>
FUJITA Tomonori wrote:
> This replaces st_do_scsi in read_mode_page (MODE_SENSE) with
> st_scsi_kern_execute.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> drivers/scsi/st.c | 16 +++++++++++-----
> 1 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
> index cc085bc..91d1249 100644
> --- a/drivers/scsi/st.c
> +++ b/drivers/scsi/st.c
> @@ -2393,7 +2393,8 @@ static int st_set_options(struct scsi_tape *STp, long options)
> static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs)
> {
> unsigned char cmd[MAX_COMMAND_SIZE];
> - struct st_request *SRpnt = NULL;
> + struct st_request *SRpnt;
> + int ret;
>
> memset(cmd, 0, MAX_COMMAND_SIZE);
> cmd[0] = MODE_SENSE;
> @@ -2402,10 +2403,15 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs)
> cmd[2] = page;
> cmd[4] = 255;
>
> - SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE,
> - STp->device->timeout, 0, 1);
> - if (SRpnt == NULL)
> - return (STp->buffer)->syscall_result;
> + SRpnt = st_allocate_request(STp);
> + if (!SRpnt)
> + return STp->buffer->syscall_result;
> +
> + ret = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE,
> + STp->buffer->b_data, cmd[4],
> + STp->device->timeout, MAX_RETRIES);
> + if (ret)
> + return ret;
Are you sure you want to return here without st_release_request() ?
All other patches return ret but release first.
>
> st_release_request(SRpnt);
>
Boaz
next prev parent reply other threads:[~2008-11-30 12:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-30 8:07 [PATCH 00/11] st: remove scsi_execute_async usage (the first half) FUJITA Tomonori
2008-11-30 8:07 ` [PATCH 01/11] st: move st_request initialization to st_allocate_request form st_do_scsi FUJITA Tomonori
2008-11-30 8:07 ` [PATCH 02/11] st: add st_scsi_kern_execute helper function FUJITA Tomonori
2008-11-30 8:07 ` [PATCH 03/11] st: convert test_ready to use st_scsi_kern_execute FUJITA Tomonori
2008-11-30 8:07 ` [PATCH 04/11] st: convert set_location " FUJITA Tomonori
2008-11-30 8:07 ` [PATCH 05/11] st: convert do_load_unload " FUJITA Tomonori
2008-11-30 8:08 ` [PATCH 06/11] st: convert cross_eof " FUJITA Tomonori
2008-11-30 8:08 ` [PATCH 07/11] st: convert st_flush " FUJITA Tomonori
2008-11-30 8:08 ` [PATCH 08/11] st: convert check_tape " FUJITA Tomonori
2008-11-30 8:08 ` [PATCH 09/11] st: convert read_mode_page " FUJITA Tomonori
2008-11-30 8:08 ` [PATCH 10/11] st: convert write_mode_page " FUJITA Tomonori
2008-11-30 8:08 ` [PATCH 11/11] st: convert get_location " FUJITA Tomonori
2008-11-30 12:12 ` Boaz Harrosh [this message]
2008-12-01 8:21 ` [PATCH 09/11] st: convert read_mode_page " FUJITA Tomonori
2008-11-30 12:10 ` [PATCH 02/11] st: add st_scsi_kern_execute helper function Boaz Harrosh
2008-12-01 8:15 ` FUJITA Tomonori
2008-12-01 15:19 ` [PATCH 00/11] st: remove scsi_execute_async usage (the first half) Vladislav Bolkhovitin
2008-12-01 15:36 ` Boaz Harrosh
2008-12-01 18:17 ` Vladislav Bolkhovitin
2008-12-02 7:52 ` Boaz Harrosh
2008-12-02 19:08 ` Kai Makisara
2008-12-03 0:27 ` FUJITA Tomonori
2008-12-03 19:40 ` Kai Makisara
2008-12-04 5:53 ` FUJITA Tomonori
2008-12-04 20:23 ` Kai Makisara
2008-12-05 6:25 ` FUJITA Tomonori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49328339.5050602@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Kai.Makisara@kolumbus.fi \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox