Skip to contentSkip to conversation

remove WRITE_ODIRECT_PLUG

PATCH In review Christoph Hellwig 1 participant 2 messages Jun 23, 2010 – Jul 2, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 remove WRITE_ODIRECT_PLUG

Instead of keeping a global flag around for one special case user use the REQ_SYNC flag locally and explain what we're doing in a comment.

fs/direct-io.c +5 -1
Index: linux-2.6/fs/direct-io.c
===================================================================
@@ -1152,8 +1152,12 @@ __blockdev_direct_IO_newtrunc(int rw, st
 	loff_t end = offset;
 	struct dio *dio;
 
+	/*
+	 * We do not want to enable the noidle logic for O_DIRECT I/O, but
+	 * otherwise treat the I/O as synchronous.
+	 */
 	if (rw & WRITE)
-		rw = WRITE_ODIRECT_PLUG;
+		rw |= REQ_SYNC;
 
 	if (bdev)
 		bdev_blkbits = blksize_bits(bdev_logical_block_size(bdev));
include/linux/fs.h +0 -2
Index: linux-2.6/include/linux/fs.h
===================================================================
@@ -132,7 +132,6 @@ struct inodes_stat_t {
  * WRITE_SYNC		Like WRITE_SYNC_PLUG, but also unplugs the device
  *			immediately after submission. The write equivalent
  *			of READ_SYNC.
- * WRITE_ODIRECT_PLUG	Special case write for O_DIRECT only.
  * SWRITE_SYNC
  * SWRITE_SYNC_PLUG	Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer.
  *			See SWRITE.
@@ -156,7 +155,6 @@ struct inodes_stat_t {
 #define READ_META		(READ | REQ_META)
 #define WRITE_SYNC_PLUG		(WRITE | REQ_SYNC | REQ_NOIDLE)
 #define WRITE_SYNC		(WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG)
-#define WRITE_ODIRECT_PLUG	(WRITE | REQ_SYNC)
 #define WRITE_META		(WRITE | REQ_META)
 #define WRITE_BARRIER		(WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
 				 REQ_HARDBARRIER)
#1 lore raw

ping?

Quoted 37 lines · Christoph Hellwig

Instead of keeping a global flag around for one special case user use the REQ_SYNC flag locally and explain what we're doing in a comment.

Index: linux-2.6/fs/direct-io.c
===================================================================

fs/direct-io.c +5 -1
@@ -1152,8 +1152,12 @@ __blockdev_direct_IO_newtrunc(int rw, st
 	loff_t end = offset;
 	struct dio *dio;
 
+	/*
+	 * We do not want to enable the noidle logic for O_DIRECT I/O, but
+	 * otherwise treat the I/O as synchronous.
+	 */
 	if (rw & WRITE)
-		rw = WRITE_ODIRECT_PLUG;
+		rw |= REQ_SYNC;
 
 	if (bdev)
 		bdev_blkbits = blksize_bits(bdev_logical_block_size(bdev));

Index: linux-2.6/include/linux/fs.h
===================================================================

include/linux/fs.h +0 -1
@@ -132,7 +132,6 @@ struct inodes_stat_t {
  * WRITE_SYNC		Like WRITE_SYNC_PLUG, but also unplugs the device
  *			immediately after submission. The write equivalent
  *			of READ_SYNC.
- * WRITE_ODIRECT_PLUG	Special case write for O_DIRECT only.
  * SWRITE_SYNC
  * SWRITE_SYNC_PLUG	Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer.
  *			See SWRITE.

include/linux/fs.h struct inodes_stat_t { · line 160

Quoted 7 lines
include/linux/fs.h +0 -1
@@ -156,7 +155,6 @@ struct inodes_stat_t {
 #define READ_META		(READ | REQ_META)
 #define WRITE_SYNC_PLUG		(WRITE | REQ_SYNC | REQ_NOIDLE)
 #define WRITE_SYNC		(WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG)
-#define WRITE_ODIRECT_PLUG	(WRITE | REQ_SYNC)
 #define WRITE_META		(WRITE | REQ_META)
 #define WRITE_BARRIER		(WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \
 				 REQ_HARDBARRIER)

---end quoted text---