Skip to content

Commit 1af60fb

Browse files
JeffMoyerJens Axboe
authored andcommitted
block: get rid of the WRITE_ODIRECT flag
Hi, The WRITE_ODIRECT flag is only used in one place, and that code path happens to also call blk_run_address_space. The introduction of this flag, then, could result in the device being unplugged twice for every I/O. Further, with the batching changes in the next patch, we don't want an O_DIRECT write to imply a queue unplug. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent 1a1238a commit 1af60fb

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

‎fs/direct-io.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
11241124
int acquire_i_mutex = 0;
11251125

11261126
if (rw & WRITE)
1127-
rw = WRITE_ODIRECT;
1127+
rw = WRITE_SYNC_PLUG;
11281128

11291129
if (bdev)
11301130
bdev_blkbits = blksize_bits(bdev_logical_block_size(bdev));

‎include/linux/fs.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ struct inodes_stat_t {
129129
* WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device
130130
* immediately after submission. The write equivalent
131131
* of READ_SYNC.
132-
* WRITE_ODIRECT Special case write for O_DIRECT only.
133132
* SWRITE_SYNC
134133
* SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer.
135134
* See SWRITE.
@@ -151,7 +150,6 @@ struct inodes_stat_t {
151150
#define READ_META (READ | (1 << BIO_RW_META))
152151
#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
153152
#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
154-
#define WRITE_ODIRECT (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
155153
#define SWRITE_SYNC_PLUG \
156154
(SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
157155
#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))

0 commit comments

Comments
 (0)