[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200901155748.2884-8-hch@lst.de>
Date: Tue, 1 Sep 2020 17:57:46 +0200
From: Christoph Hellwig <hch@....de>
To: Jens Axboe <axboe@...nel.dk>
Cc: Josef Bacik <josef@...icpanda.com>,
Dan Williams <dan.j.williams@...el.com>, dm-devel@...hat.com,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
nbd@...er.debian.org, ceph-devel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
linux-raid@...r.kernel.org, linux-nvdimm@...ts.01.org,
linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH 7/9] sd: open code revalidate_disk
Instead of calling revalidate_disk just do the work directly by
calling sd_revalidate_disk, and revalidate_disk_size where needed.
Signed-off-by: Christoph Hellwig <hch@....de>
---
drivers/scsi/sd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 95018e650f2d0c..2bec8cd526164d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -217,7 +217,7 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
sd_print_sense_hdr(sdkp, &sshdr);
return -EINVAL;
}
- revalidate_disk(sdkp->disk);
+ sd_revalidate_disk(sdkp->disk);
return count;
}
@@ -1706,8 +1706,10 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)
static void sd_rescan(struct device *dev)
{
struct scsi_disk *sdkp = dev_get_drvdata(dev);
+ int ret;
- revalidate_disk(sdkp->disk);
+ ret = sd_revalidate_disk(sdkp->disk);
+ revalidate_disk_size(sdkp->disk, ret == 0);
}
static int sd_ioctl(struct block_device *bdev, fmode_t mode,
--
2.28.0
Powered by blists - more mailing lists