linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erez Zilber <erezz@voltaire.com>
To: open-iscsi@googlegroups.com
Cc: linux-scsi@vger.kernel.org, James.Bottomley@steeleye.com,
	michaelc@cs.wisc.edu, rdreier@cisco.com
Subject: Re: [PATCH 2/2] iscsi_iser: convert to use the data buffer accessors
Date: Sun, 03 Jun 2007 16:56:47 +0300	[thread overview]
Message-ID: <4662C89F.1050002@voltaire.com> (raw)
In-Reply-To: <20070531033021L.fujita.tomonori@lab.ntt.co.jp>

FUJITA Tomonori wrote:

>
> iscsi_iser: convert to use the data buffer accessors
>
> - remove the unnecessary map_single path.
>
> - convert to use the new accessors for the sg lists and the
> parameters.
>
> TODO: use scsi_for_each_sg().
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  drivers/infiniband/ulp/iser/iscsi_iser.c     |    4 ++--
>  drivers/infiniband/ulp/iser/iser_initiator.c |   14 ++++----------
>  2 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c
> b/drivers/infiniband/ulp/iser/iscsi_iser.c
> index 1bf173d..effdee2 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.c
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
> @@ -210,10 +210,10 @@ iscsi_iser_ctask_xmit(struct iscsi_conn *conn,
>         int error = 0;
>
>         if (ctask->sc->sc_data_direction == DMA_TO_DEVICE) {
> -               BUG_ON(ctask->sc->request_bufflen == 0);
> +               BUG_ON(scsi_bufflen(ctask->sc) == 0);
>
>                 debug_scsi("cmd [itt %x total %d imm %d unsol_data %d\n",
> -                          ctask->itt, ctask->sc->request_bufflen,
> +                          ctask->itt, scsi_bufflen(ctask->sc),
>                            ctask->imm_count, ctask->unsol_count);
>         }
>
> diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c
> b/drivers/infiniband/ulp/iser/iser_initiator.c
> index 3651072..9ea5b9a 100644
> --- a/drivers/infiniband/ulp/iser/iser_initiator.c
> +++ b/drivers/infiniband/ulp/iser/iser_initiator.c
> @@ -351,18 +351,12 @@ int iser_send_command(struct iscsi_conn     *conn,
>         else
>                 data_buf = &iser_ctask->data[ISER_DIR_OUT];
>
> -       if (sc->use_sg) { /* using a scatter list */
> -               data_buf->buf  = sc->request_buffer;
> -               data_buf->size = sc->use_sg;
> -       } else if (sc->request_bufflen) {
> -               /* using a single buffer - convert it into one entry SG */
> -               sg_init_one(&data_buf->sg_single,
> -                           sc->request_buffer, sc->request_bufflen);
> -               data_buf->buf   = &data_buf->sg_single;
> -               data_buf->size  = 1;
> +       if (scsi_sg_count(sc)) { /* using a scatter list */
> +               data_buf->buf  = scsi_sglist(sc);
> +               data_buf->size = scsi_sg_count(sc);
>         }
>
> -       data_buf->data_len = sc->request_bufflen;
> +       data_buf->data_len = scsi_bufflen(sc);
>
>         if (hdr->flags & ISCSI_FLAG_CMD_READ) {
>                 err = iser_prepare_read_cmd(ctask, edtl);
> --
> 1.4.4.4
>
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "open-iscsi" group.
> To post to this group, send email to open-iscsi@googlegroups.com
> To unsubscribe from this group, send email to
> open-iscsi-unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/open-iscsi
> -~----------~----~----~----~------~----~------~--~---
>

Looks ok to me. I also ran some sanity tests and it works fine.

Erez


  reply	other threads:[~2007-06-03 14:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01  9:56 [PATCH 0/2] iscsi: convert to use the data buffer accessors FUJITA Tomonori
2007-06-01  9:56 ` [PATCH 1/2] iscsi_tcp: " FUJITA Tomonori
2007-06-01 18:25   ` Mike Christie
2007-06-01  9:56 ` [PATCH 2/2] iscsi_iser: " FUJITA Tomonori
2007-06-03 13:56   ` Erez Zilber [this message]
2007-06-18 10:56     ` FUJITA Tomonori
2007-06-18 18:07       ` Mike Christie
2007-06-19  0:23         ` 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=4662C89F.1050002@voltaire.com \
    --to=erezz@voltaire.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=open-iscsi@googlegroups.com \
    --cc=rdreier@cisco.com \
    /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;
as well as URLs for NNTP newsgroup(s).