fix mismerge in ll_rw_blk.c
authorJames Bottomley <jejb@titanic.(none)>
Sun, 28 Aug 2005 15:43:07 +0000 (10:43 -0500)
committerJames Bottomley <jejb@titanic.(none)>
Sun, 28 Aug 2005 15:43:07 +0000 (10:43 -0500)
1  2 
drivers/block/ll_rw_blk.c
drivers/ide/ide-disk.c
fs/bio.c
include/linux/bio.h
include/linux/blkdev.h

index 3c818544475ea857d249f1afc8f259028c163a2b,f6fda036b4aefb19677e08130d1a877ba8dd8a84..0c7599563b651448a800eb4d19ccd330bcb4edee
@@@ -2277,7 -2347,45 +2373,45 @@@ int blkdev_issue_flush(struct block_dev
  
  EXPORT_SYMBOL(blkdev_issue_flush);
  
 -void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
+ /**
+  * blkdev_scsi_issue_flush_fn - issue flush for SCSI devices
+  * @q:                device queue
+  * @disk:     gendisk
+  * @error_sector:     error offset
+  *
+  * Description:
+  *    Devices understanding the SCSI command set, can use this function as
+  *    a helper for issuing a cache flush. Note: driver is required to store
+  *    the error offset (in case of error flushing) in ->sector of struct
+  *    request.
+  */
+ int blkdev_scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk,
+                              sector_t *error_sector)
+ {
+       struct request *rq = blk_get_request(q, WRITE, __GFP_WAIT);
+       int ret;
+       rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER;
+       rq->sector = 0;
+       memset(rq->cmd, 0, sizeof(rq->cmd));
+       rq->cmd[0] = 0x35;
+       rq->cmd_len = 12;
+       rq->data = NULL;
+       rq->data_len = 0;
+       rq->timeout = 60 * HZ;
+       ret = blk_execute_rq(q, disk, rq, 0);
+       if (ret && error_sector)
+               *error_sector = rq->sector;
+       blk_put_request(rq);
+       return ret;
+ }
+ EXPORT_SYMBOL(blkdev_scsi_issue_flush_fn);
 +static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
  {
        int rw = rq_data_dir(rq);
  
Simple merge
diff --cc fs/bio.c
Simple merge
Simple merge
Simple merge