Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13948
b: refs/heads/master
c: c0ed79a
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Nov 9, 2005
1 parent 82d7133 commit 9d93d6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 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: 2ef8919830a262f10fb5e4a685e95f71a64bce6c
refs/heads/master: c0ed79a331caa68ac027dd6afc02bb5b58ef2798
22 changes: 9 additions & 13 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,20 +769,16 @@ static void sd_end_flush(request_queue_t *q, struct request *flush_rq)
static int sd_prepare_flush(request_queue_t *q, struct request *rq)
{
struct scsi_device *sdev = q->queuedata;
struct scsi_disk *sdkp = scsi_disk_get_from_dev(&sdev->sdev_gendev);
int ret = 0;
struct scsi_disk *sdkp = dev_get_drvdata(&sdev->sdev_gendev);

if (sdkp) {
if (sdkp->WCE) {
memset(rq->cmd, 0, sizeof(rq->cmd));
rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER;
rq->timeout = SD_TIMEOUT;
rq->cmd[0] = SYNCHRONIZE_CACHE;
ret = 1;
}
scsi_disk_put(sdkp);
}
return ret;
if (!sdkp || !sdkp->WCE)
return 0;

memset(rq->cmd, 0, sizeof(rq->cmd));
rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER;
rq->timeout = SD_TIMEOUT;
rq->cmd[0] = SYNCHRONIZE_CACHE;
return 1;
}

static void sd_rescan(struct device *dev)
Expand Down

0 comments on commit 9d93d6f

Please sign in to comment.