diff mbox

[7/9] xfs: add support for passing in write hints for buffered writes

Message ID 1498004526-4543-8-git-send-email-axboe@kernel.dk (mailing list archive)
State New, archived
Headers show

Commit Message

Jens Axboe June 21, 2017, 12:22 a.m. UTC
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/xfs/xfs_aops.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Darrick J. Wong June 21, 2017, 1:35 a.m. UTC | #1
On Tue, Jun 20, 2017 at 06:22:04PM -0600, Jens Axboe wrote:
> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>

Looks ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_aops.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 76b6f988e2fa..e4d9d470402c 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -506,6 +506,7 @@ xfs_submit_ioend(
>  		return status;
>  	}
>  
> +	ioend->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(ioend->io_inode));
>  	submit_bio(ioend->io_bio);
>  	return 0;
>  }
> @@ -565,6 +566,7 @@ xfs_chain_bio(
>  	bio_chain(ioend->io_bio, new);
>  	bio_get(ioend->io_bio);		/* for xfs_destroy_ioend */
>  	ioend->io_bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);
> +	ioend->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(ioend->io_inode));
>  	submit_bio(ioend->io_bio);
>  	ioend->io_bio = new;
>  }
> -- 
> 2.7.4
>
Jens Axboe June 21, 2017, 1:46 a.m. UTC | #2
On 06/20/2017 07:35 PM, Darrick J. Wong wrote:
> On Tue, Jun 20, 2017 at 06:22:04PM -0600, Jens Axboe wrote:
>> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 
> Looks ok to me,
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks Darrick, added.
Christoph Hellwig June 26, 2017, 9:56 a.m. UTC | #3
> +	ioend->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(ioend->io_inode));

Too long line again.

I think simply adding an inode_hint_to_opf() flag would make the various
opencoded versions of the above call a little easier to read.
Jens Axboe June 26, 2017, 2:16 p.m. UTC | #4
On 06/26/2017 03:56 AM, Christoph Hellwig wrote:
>> +	ioend->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(ioend->io_inode));
> 
> Too long line again.
> 
> I think simply adding an inode_hint_to_opf() flag would make the various
> opencoded versions of the above call a little easier to read.

Sure, I'll do that.
diff mbox

Patch

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 76b6f988e2fa..e4d9d470402c 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -506,6 +506,7 @@  xfs_submit_ioend(
 		return status;
 	}
 
+	ioend->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(ioend->io_inode));
 	submit_bio(ioend->io_bio);
 	return 0;
 }
@@ -565,6 +566,7 @@  xfs_chain_bio(
 	bio_chain(ioend->io_bio, new);
 	bio_get(ioend->io_bio);		/* for xfs_destroy_ioend */
 	ioend->io_bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);
+	ioend->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(ioend->io_inode));
 	submit_bio(ioend->io_bio);
 	ioend->io_bio = new;
 }