* [PATCH 1/2] remove WRITE_ODIRECT_PLUG
@ 2010-06-23 10:32 Christoph Hellwig
2010-07-02 14:16 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2010-06-23 10:32 UTC (permalink / raw)
To: axboe; +Cc: linux-fsdevel
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.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/direct-io.c
===================================================================
--- linux-2.6.orig/fs/direct-io.c 2010-06-23 11:48:32.000000000 +0200
+++ linux-2.6/fs/direct-io.c 2010-06-23 11:48:41.088253790 +0200
@@ -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
===================================================================
--- linux-2.6.orig/include/linux/fs.h 2010-06-23 11:48:33.000000000 +0200
+++ linux-2.6/include/linux/fs.h 2010-06-23 11:48:51.460005641 +0200
@@ -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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] remove WRITE_ODIRECT_PLUG
2010-06-23 10:32 [PATCH 1/2] remove WRITE_ODIRECT_PLUG Christoph Hellwig
@ 2010-07-02 14:16 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2010-07-02 14:16 UTC (permalink / raw)
To: axboe; +Cc: linux-fsdevel
ping?
On Wed, Jun 23, 2010 at 12:32:36PM +0200, Christoph Hellwig wrote:
>
> 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.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: linux-2.6/fs/direct-io.c
> ===================================================================
> --- linux-2.6.orig/fs/direct-io.c 2010-06-23 11:48:32.000000000 +0200
> +++ linux-2.6/fs/direct-io.c 2010-06-23 11:48:41.088253790 +0200
> @@ -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
> ===================================================================
> --- linux-2.6.orig/include/linux/fs.h 2010-06-23 11:48:33.000000000 +0200
> +++ linux-2.6/include/linux/fs.h 2010-06-23 11:48:51.460005641 +0200
> @@ -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)
---end quoted text---
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-02 14:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-23 10:32 [PATCH 1/2] remove WRITE_ODIRECT_PLUG Christoph Hellwig
2010-07-02 14:16 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).