public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* writev to scsi disks
@ 2005-04-20 15:01 Dheeraj Pandey
  2005-04-20 21:15 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Dheeraj Pandey @ 2005-04-20 15:01 UTC (permalink / raw)
  To: linux-scsi, linux-kernel

I was wondering if I did a simple writev to a SCSI disk, does it take
the sg path to the device? I am guessing sg (REQ_SPECIAL) is only
true for character devices (and ioctl's) and not block devices.

These are my questions:
  - Is sg a common feature among SCSI disks these days? How do I know
what disks support this feature (any capabilities published by the driver)?
  - How does one make writev work for SCSI disk (as a block device)
in direct_io?
  - If I use SCSI disks as character device, can I simply use writev on the
character device file, and will sg codepath be taken?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: writev to scsi disks
  2005-04-20 15:01 writev to scsi disks Dheeraj Pandey
@ 2005-04-20 21:15 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2005-04-20 21:15 UTC (permalink / raw)
  To: Dheeraj Pandey; +Cc: SCSI Mailing List, Linux Kernel

On Wed, 2005-04-20 at 08:01 -0700, Dheeraj Pandey wrote:
> I was wondering if I did a simple writev to a SCSI disk, does it take
> the sg path to the device? I am guessing sg (REQ_SPECIAL) is only
> true for character devices (and ioctl's) and not block devices.

?  I think you misunderstand how writev works.  It's design is to take a
list of scattered buffers in a user program and consolidate them into a
single write.  This (in the current implementation) is a separate entity
from the block level Scatter Gather.

If by sg write path, if you mean scatter-gather write path, then yes,
that single write would be split up again into a sg list based on the
device parameters if you mean does the writev sg list control where on
the disk the data ends up, then no, if you use a disk device as a simple
file, writev consolidates all writes to the current file position.

James





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-20 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-20 15:01 writev to scsi disks Dheeraj Pandey
2005-04-20 21:15 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox