linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: [PATCH/RFC] Allowing REQ_FAILFAST to be set from SG_IO
Date: Wed, 10 May 2006 15:51:12 +0200	[thread overview]
Message-ID: <4461EFD0.50902@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

Hi all,

this patch allows to set the REQ_FAILFAST flag to be set from SG_IO
commands. With it one can send generic SCSI commands which behave
exactly like normal requests send via the block layer.

Comments etc welcome.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: sg-failfast-request --]
[-- Type: text/plain, Size: 1055 bytes --]

Allow FAILFAST flag to be set for SG_IO commands

This patch allows the FAILFAST flag to be set for SG_IO commands.

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index b33eda2..658b1b5 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -295,6 +295,8 @@ static int sg_io(struct file *file, requ
 	rq->sense_len = 0;
 
 	rq->flags |= REQ_BLOCK_PC;
+	if (hdr->flags & SG_FLAGS_FAILFAST)
+		rq->flags |= REQ_FAILFAST;
 	bio = rq->bio;
 
 	/*
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index 0a487fe..9cc466a 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -142,6 +142,7 @@ typedef struct sg_io_hdr
 #define SG_FLAG_UNUSED_LUN_INHIBIT 2   /* default is overwrite lun in SCSI */
 				/* command block (when <= SCSI_2) */
 #define SG_FLAG_MMAP_IO 4       /* request memory mapped IO */
+#define SG_FLAG_FAILFAST 8      /* request should set FAILFAST flag */
 #define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */
 				/* user space (debug indirect IO) */
 

             reply	other threads:[~2006-05-10 13:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 13:51 Hannes Reinecke [this message]
2006-05-10 16:41 ` [PATCH/RFC] Allowing REQ_FAILFAST to be set from SG_IO Douglas Gilbert
2006-05-10 16:50   ` James Bottomley
2006-05-10 17:42     ` Douglas Gilbert
2006-05-11 10:39       ` Hannes Reinecke
2006-05-11 10:36     ` Jens Axboe
2006-05-11 10:28   ` Hannes Reinecke

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=4461EFD0.50902@suse.de \
    --to=hare@suse.de \
    --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 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).