Skip to content

Commit

Permalink
sd: open code revalidate_disk
Browse files Browse the repository at this point in the history
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@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Sep 2, 2020
1 parent b55d3d2 commit 033a1b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 033a1b9

Please sign in to comment.