All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jens Axboe <jens.axboe@oracle.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 0/2] sg_ring: Gentler scsi merge
Date: Thu, 03 Jan 2008 11:42:43 +0200	[thread overview]
Message-ID: <477CAE13.1030608@panasas.com> (raw)
In-Reply-To: <200801031800.02537.rusty@rustcorp.com.au>

On Thu, Jan 03 2008 at 9:00 +0200, Rusty Russell <rusty@rustcorp.com.au> wrote:
> OK, after wading through many scsi drivers, I decided to change tack and try 
> to provide a transition path.  This is in two stages:
> 
> 1) These two patches.  sg_ring used underneath, but if any driver asks for 
> scsi_sglist() they get a 2.6.24-style chained sg.  No other patches are 
> necessary.
> 
> 2) Once all chained-sg-needing scsi drivers change to use cmd->sg (ie. 
> sg_ring) directly, and the chained sg patches can be reverted.  scsi_sglist() 
> and scsi_sg_count() then become:
> 
> 	/* You should only use these if you never need chained sgs */
> 	static inline struct scatterlist *scsi_sglist(struct scsi_cmd *cmd)
> 	{
> 		BUG_ON(!list_empty(&cmd->sg->list));
> 		return &cmd->sg->sg[0];
> 	}
> 
> 	static unsigned int scsi_sg_count(struct scsi_cmd *cmd)
> 	{
> 		if (!cmd->sg)
> 			return 0;
> 		BUG_ON(!list_empty(&cmd->sg->list));
> 		return cmd->sg->num;
> 	}
> 
> Thanks,
> Rusty.

Look in the mailing list archives for the scsi_sgtable patches.
These did exactly what you do here. (OK 95% ;))
(only as a scsi subsystem not as a generic sg)

Boaz


      parent reply	other threads:[~2008-01-03  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03  7:00 [PATCH 0/2] sg_ring: Gentler scsi merge Rusty Russell
2008-01-03  8:50 ` [PATCH 1/3] scsi: Convert everyone to scsi_sglist and scsi_sg_count Rusty Russell
2008-01-03  8:54   ` [PATCH 2/3] usb_storage: usb_stor_bulk_transfer_sg cleanup Rusty Russell
2008-01-03  8:55     ` [PATCH 3/3] scsi: convert core to sg_ring Rusty Russell
2008-01-03  9:26   ` [PATCH 1/3] scsi: Convert everyone to scsi_sglist and scsi_sg_count Boaz Harrosh
2008-01-04  3:28     ` Rusty Russell
2008-01-03  9:42 ` Boaz Harrosh [this message]

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=477CAE13.1030608@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.