All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH 0/2] sg_ring: Gentler scsi merge
Date: Thu, 3 Jan 2008 18:00:02 +1100	[thread overview]
Message-ID: <200801031800.02537.rusty@rustcorp.com.au> (raw)

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.

             reply	other threads:[~2008-01-03  7:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03  7:00 Rusty Russell [this message]
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 ` [PATCH 0/2] sg_ring: Gentler scsi merge Boaz Harrosh

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=200801031800.02537.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=jens.axboe@oracle.com \
    --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 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.