All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag
@ 2018-02-23 11:45 Nikolay Borisov
  2018-02-23 11:45 ` [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic Nikolay Borisov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nikolay Borisov @ 2018-02-23 11:45 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, axboe, hch, rgoldwyn, Nikolay Borisov

This flag was added by 6039257378e4 ("direct-io: add flag to allow aio
writes beyond i_size") to support XFS. However, with the rework of
XFS' DIO's path to use iomap in acdda3aae146 ("xfs: use iomap_dio_rw")
it became redundant. So let's remove it.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/direct-io.c     | 3 +--
 include/linux/fs.h | 3 ---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index a0ca9e48e993..99a81c49bce9 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1252,8 +1252,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 	 */
 	if (is_sync_kiocb(iocb))
 		dio->is_async = false;
-	else if (!(dio->flags & DIO_ASYNC_EXTEND) &&
-		 iov_iter_rw(iter) == WRITE && end > i_size_read(inode))
+	else if (iov_iter_rw(iter) == WRITE && end > i_size_read(inode))
 		dio->is_async = false;
 	else
 		dio->is_async = true;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2a815560fda0..260c233e7375 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2977,9 +2977,6 @@ enum {
 	/* filesystem does not support filling holes */
 	DIO_SKIP_HOLES	= 0x02,
 
-	/* filesystem can handle aio writes beyond i_size */
-	DIO_ASYNC_EXTEND = 0x04,
-
 	/* inode/fs/bdev does not need truncate protection */
 	DIO_SKIP_DIO_COUNT = 0x08,
 };
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic
  2018-02-23 11:45 [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Nikolay Borisov
@ 2018-02-23 11:45 ` Nikolay Borisov
  2018-02-23 15:08   ` Christoph Hellwig
  2018-02-23 15:07 ` [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Christoph Hellwig
  2018-03-12  9:54 ` Nikolay Borisov
  2 siblings, 1 reply; 6+ messages in thread
From: Nikolay Borisov @ 2018-02-23 11:45 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, axboe, hch, rgoldwyn, Nikolay Borisov

This flag was added by fe0f07d08ee3 ("direct-io: only inc/deci
inode->i_dio_count for file systems") as means to optimise the atomic
modificaiton of the variable for blockdevices. However with the advent
of 542ff7bf18c6 ("block: new direct I/O implementation") it became
unused. So let's remove it.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/direct-io.c     | 6 ++----
 include/linux/fs.h | 3 ---
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 99a81c49bce9..a8131087aa1c 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -315,8 +315,7 @@ static ssize_t dio_complete(struct dio *dio, ssize_t ret, unsigned int flags)
 			dio_warn_stale_pagecache(dio->iocb->ki_filp);
 	}
 
-	if (!(dio->flags & DIO_SKIP_DIO_COUNT))
-		inode_dio_end(dio->inode);
+	inode_dio_end(dio->inode);
 
 	if (flags & DIO_COMPLETE_ASYNC) {
 		/*
@@ -1297,8 +1296,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 	/*
 	 * Will be decremented at I/O completion time.
 	 */
-	if (!(dio->flags & DIO_SKIP_DIO_COUNT))
-		inode_dio_begin(inode);
+	inode_dio_begin(inode);
 
 	retval = 0;
 	sdio.blkbits = blkbits;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 260c233e7375..9bee267209e5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2976,9 +2976,6 @@ enum {
 
 	/* filesystem does not support filling holes */
 	DIO_SKIP_HOLES	= 0x02,
-
-	/* inode/fs/bdev does not need truncate protection */
-	DIO_SKIP_DIO_COUNT = 0x08,
 };
 
 void dio_end_io(struct bio *bio);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag
  2018-02-23 11:45 [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Nikolay Borisov
  2018-02-23 11:45 ` [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic Nikolay Borisov
@ 2018-02-23 15:07 ` Christoph Hellwig
  2018-03-12  9:54 ` Nikolay Borisov
  2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2018-02-23 15:07 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: viro, linux-fsdevel, linux-kernel, axboe, hch, rgoldwyn

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic
  2018-02-23 11:45 ` [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic Nikolay Borisov
@ 2018-02-23 15:08   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2018-02-23 15:08 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: viro, linux-fsdevel, linux-kernel, axboe, hch, rgoldwyn

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag
  2018-02-23 11:45 [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Nikolay Borisov
  2018-02-23 11:45 ` [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic Nikolay Borisov
  2018-02-23 15:07 ` [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Christoph Hellwig
@ 2018-03-12  9:54 ` Nikolay Borisov
  2018-03-12 16:20   ` Jens Axboe
  2 siblings, 1 reply; 6+ messages in thread
From: Nikolay Borisov @ 2018-03-12  9:54 UTC (permalink / raw)
  To: axboe; +Cc: linux-fsdevel, linux-kernel, hch, rgoldwyn, linux-block



On 23.02.2018 13:45, Nikolay Borisov wrote:
> This flag was added by 6039257378e4 ("direct-io: add flag to allow aio
> writes beyond i_size") to support XFS. However, with the rework of
> XFS' DIO's path to use iomap in acdda3aae146 ("xfs: use iomap_dio_rw")
> it became redundant. So let's remove it.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Jens,

On a second look I think you are the more appropriate person to take
these patches. SO do you have any objections to merging those via the
block tree. ( I did CC you but didn't cc linux-block).

> ---
>  fs/direct-io.c     | 3 +--
>  include/linux/fs.h | 3 ---
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index a0ca9e48e993..99a81c49bce9 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -1252,8 +1252,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
>  	 */
>  	if (is_sync_kiocb(iocb))
>  		dio->is_async = false;
> -	else if (!(dio->flags & DIO_ASYNC_EXTEND) &&
> -		 iov_iter_rw(iter) == WRITE && end > i_size_read(inode))
> +	else if (iov_iter_rw(iter) == WRITE && end > i_size_read(inode))
>  		dio->is_async = false;
>  	else
>  		dio->is_async = true;
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 2a815560fda0..260c233e7375 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2977,9 +2977,6 @@ enum {
>  	/* filesystem does not support filling holes */
>  	DIO_SKIP_HOLES	= 0x02,
>  
> -	/* filesystem can handle aio writes beyond i_size */
> -	DIO_ASYNC_EXTEND = 0x04,
> -
>  	/* inode/fs/bdev does not need truncate protection */
>  	DIO_SKIP_DIO_COUNT = 0x08,
>  };
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag
  2018-03-12  9:54 ` Nikolay Borisov
@ 2018-03-12 16:20   ` Jens Axboe
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2018-03-12 16:20 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-fsdevel, linux-kernel, hch, rgoldwyn, linux-block

On 3/12/18 2:54 AM, Nikolay Borisov wrote:
> 
> 
> On 23.02.2018 13:45, Nikolay Borisov wrote:
>> This flag was added by 6039257378e4 ("direct-io: add flag to allow aio
>> writes beyond i_size") to support XFS. However, with the rework of
>> XFS' DIO's path to use iomap in acdda3aae146 ("xfs: use iomap_dio_rw")
>> it became redundant. So let's remove it.
>>
>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> 
> Jens,
> 
> On a second look I think you are the more appropriate person to take
> these patches. SO do you have any objections to merging those via the
> block tree. ( I did CC you but didn't cc linux-block).

Both look fine to me, I can add them for 4.17. Thanks.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-12 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-23 11:45 [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Nikolay Borisov
2018-02-23 11:45 ` [PATCH 2/2] direct-io: Remove unused DIO_SKIP_DIO_COUNT logic Nikolay Borisov
2018-02-23 15:08   ` Christoph Hellwig
2018-02-23 15:07 ` [PATCH 1/2] direct-io: Remove unused DIO_ASYNC_EXTEND flag Christoph Hellwig
2018-03-12  9:54 ` Nikolay Borisov
2018-03-12 16:20   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.