All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: linux-ide@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
	James Bottomely <jbottomley@parallels.com>,
	Hannes Reinecke <hare@suse.de>
Subject: [PATCH 4/4] sd: Handle ZBC drives correctly
Date: Mon, 21 Jul 2014 10:27:21 +0200	[thread overview]
Message-ID: <1405931241-92015-5-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1405931241-92015-1-git-send-email-hare@suse.de>

ZBC drives are close to disk devices, so update sd.c to handle
ZBC drives correctly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 377a520..29c981b 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -161,7 +161,7 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
 	static const char temp[] = "temporary ";
 	int len;
 
-	if (sdp->type != TYPE_DISK)
+	if (sdp->type != TYPE_DISK && sdp->type != TYPE_ZBC)
 		/* no cache control on RBC devices; theoretically they
 		 * can do it, but there's probably so many exceptions
 		 * it's not worth the risk */
@@ -259,7 +259,7 @@ allow_restart_store(struct device *dev, struct device_attribute *attr,
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	if (sdp->type != TYPE_DISK)
+	if (sdp->type != TYPE_DISK && sdp->type != TYPE_ZBC)
 		return -EINVAL;
 
 	sdp->allow_restart = simple_strtoul(buf, NULL, 10);
@@ -389,7 +389,7 @@ provisioning_mode_store(struct device *dev, struct device_attribute *attr,
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	if (sdp->type != TYPE_DISK)
+	if (sdp->type != TYPE_DISK && sdp->type != TYPE_ZBC)
 		return -EINVAL;
 
 	if (!strncmp(buf, lbp_mode[SD_LBP_UNMAP], 20))
@@ -456,7 +456,7 @@ max_write_same_blocks_store(struct device *dev, struct device_attribute *attr,
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	if (sdp->type != TYPE_DISK)
+	if (sdp->type != TYPE_DISK && sdp->type != TYPE_ZBC)
 		return -EINVAL;
 
 	err = kstrtoul(buf, 10, &max);
@@ -2537,7 +2537,7 @@ static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer)
 	struct scsi_mode_data data;
 	struct scsi_sense_hdr sshdr;
 
-	if (sdp->type != TYPE_DISK)
+	if (sdp->type != TYPE_DISK && sdp->type != TYPE_ZBC)
 		return;
 
 	if (sdkp->protection_type == 0)
-- 
1.7.12.4


  parent reply	other threads:[~2014-07-21  8:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21  8:27 [PATCHv2 0/4] Initial SMR drive support Hannes Reinecke
2014-07-21  8:27 ` [PATCH 1/4] libata: consolidate ata_dev_classify() Hannes Reinecke
2014-07-21  8:27 ` [PATCH 2/4] libata: Implement ATA_DEV_ZAC Hannes Reinecke
2014-07-21  8:27 ` [PATCH 3/4] libata-scsi: Update SATL for ZAC drives Hannes Reinecke
2014-07-21  8:27 ` Hannes Reinecke [this message]
2014-07-21 11:29   ` [PATCH 4/4] sd: Handle ZBC drives correctly Christoph Hellwig
2014-07-21 11:51     ` Hannes Reinecke
2014-07-21 15:01       ` Christoph Hellwig
2014-07-21 16:18       ` John Utz
2014-07-21 16:30         ` John Utz
2014-07-21 17:49         ` Hannes Reinecke
2014-07-22 16:19         ` Christoph Hellwig
2014-07-22 18:25           ` John Utz

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=1405931241-92015-5-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-ide@vger.kernel.org \
    --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.