public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* allow_dio/SG_FLAG_DIRECT_IO for sr devices
@ 2010-02-24 21:46 Adar Dembo
  2010-02-24 22:54 ` Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Adar Dembo @ 2010-02-24 21:46 UTC (permalink / raw)
  To: linux-scsi@vger.kernel.org

When sending SG_IO ioctls to a device:
- /dev/sgX devices (using sg.c) follow the behavior described at http://tldp.org/HOWTO/SCSI-Generic-HOWTO/dio.html in terms of defaulting to indirect I/O, and using direct I/O only if both /proc/scsi/sg/allow_dio and SG_FLAG_DIRECT_IO in the request are set.
- /dev/srX devices (using sr.c) default to direct I/O. At least, that appears to be the case from inspecting the code, as sr_block_ioctl->cdrom_ioctl->scsi_cmd_ioctl->sg_io->blk_rq_map_user->__blk_rq_map_user will attempt to map the pages, regardless of what the user specified in the request or in the proc node.

This difference caught me by surprise; my expectation would be that an sg_io_hdr_t passed via SG_IO would be serviced in the same way regardless of the underlying driver. Is this a bug, or a feature? If the latter, is it documented somewhere?


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

end of thread, other threads:[~2010-02-24 23:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24 21:46 allow_dio/SG_FLAG_DIRECT_IO for sr devices Adar Dembo
2010-02-24 22:54 ` Douglas Gilbert
2010-02-24 23:30   ` Adar Dembo

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