Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63688
b: refs/heads/master
c: 03a5743
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Aug 4, 2007
1 parent f807b79 commit eceda73
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66dbfbe6fde35c881deda5cebb6ecaa0dcc1c975
refs/heads/master: 03a5743a12b58e10eaa936a02498539db645ba4e
17 changes: 0 additions & 17 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,22 +1038,6 @@ static int scsi_init_io(struct scsi_cmnd *cmd)
return BLKPREP_KILL;
}

static int scsi_issue_flush_fn(struct request_queue *q, struct gendisk *disk,
sector_t *error_sector)
{
struct scsi_device *sdev = q->queuedata;
struct scsi_driver *drv;

if (sdev->sdev_state != SDEV_RUNNING)
return -ENXIO;

drv = *(struct scsi_driver **) disk->private_data;
if (drv->issue_flush)
return drv->issue_flush(&sdev->sdev_gendev, error_sector);

return -EOPNOTSUPP;
}

static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev,
struct request *req)
{
Expand Down Expand Up @@ -1596,7 +1580,6 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
return NULL;

blk_queue_prep_rq(q, scsi_prep_fn);
blk_queue_issue_flush_fn(q, scsi_issue_flush_fn);
blk_queue_softirq_done(q, scsi_softirq_done);
return q;
}
Expand Down
14 changes: 11 additions & 3 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ static struct scsi_driver sd_template = {
},
.rescan = sd_rescan,
.init_command = sd_init_command,
.issue_flush = sd_issue_flush,
};

/*
Expand Down Expand Up @@ -800,10 +799,17 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
return 0;
}

static int sd_issue_flush(struct device *dev, sector_t *error_sector)
static int sd_issue_flush(struct request_queue *q, struct gendisk *disk,
sector_t *error_sector)
{
int ret = 0;
struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
struct scsi_device *sdp = q->queuedata;
struct scsi_disk *sdkp;

if (sdp->sdev_state != SDEV_RUNNING)
return -ENXIO;

sdkp = scsi_disk_get_from_dev(&sdp->sdev_gendev);

if (!sdkp)
return -ENODEV;
Expand Down Expand Up @@ -1663,6 +1669,8 @@ static int sd_probe(struct device *dev)

sd_revalidate_disk(gd);

blk_queue_issue_flush_fn(sdp->request_queue, sd_issue_flush);

gd->driverfs_dev = &sdp->sdev_gendev;
gd->flags = GENHD_FL_DRIVERFS;
if (sdp->removable)
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/scsi/scsi_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ struct scsi_driver {

int (*init_command)(struct scsi_cmnd *);
void (*rescan)(struct device *);
int (*issue_flush)(struct device *, sector_t *);
int (*prepare_flush)(struct request_queue *, struct request *);
};
#define to_scsi_driver(drv) \
container_of((drv), struct scsi_driver, gendrv)
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/scsi/sd.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ static int sd_suspend(struct device *dev, pm_message_t state);
static int sd_resume(struct device *dev);
static void sd_rescan(struct device *);
static int sd_init_command(struct scsi_cmnd *);
static int sd_issue_flush(struct device *, sector_t *);
static void sd_prepare_flush(struct request_queue *, struct request *);
static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
static void scsi_disk_release(struct class_device *cdev);
static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
Expand Down

0 comments on commit eceda73

Please sign in to comment.