Make DISCARD_BARRIER and DISCARD_NOBARRIER writes instead of reads
authorDavid Woodhouse <dwmw2@infradead.org>
Sat, 12 Sep 2009 05:35:37 +0000 (07:35 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 14 Sep 2009 06:24:53 +0000 (08:24 +0200)
The commands are conceptually writes, and in the case of IDE and SCSI
commands actually are writes.  They were only reads because we thought
that would interact better with the elevators.  Now the elevators know
about discard requests, that advantage no longer exists.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
include/linux/fs.h

index c1f993515f51ee6c66faa51d15b76c110fdf0e93..7f5a8ad25008cc23317b642c1f75cca815b72185 100644 (file)
@@ -161,8 +161,8 @@ struct inodes_stat_t {
  * These aren't really reads or writes, they pass down information about
  * parts of device that are now unused by the file system.
  */
-#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
-#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
+#define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD))
+#define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER))
 
 #define SEL_IN         1
 #define SEL_OUT                2