[4/6] btrfs: Pass 0 for bio_offset to btrfs_wq_submit_bio
diff mbox series

Message ID 20190410142443.6470-5-nborisov@suse.com
State New
Headers show
Series
  • Simplifications around submit_bio_hook
Related show

Commit Message

Nikolay Borisov April 10, 2019, 2:24 p.m. UTC
Buffered writeback always calls btrfs_csum_one_bio with the last 2
arguments being 0 irrespective of what the bio_offset has been passed
to btrfs_submit_bio_start. Make this apparent by explicitly passing 0
for bio_offset when calling btrfs_wq_submit_bio from
btrfs_submit_bio_hook. This will allow for further simplifications down
the line. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/inode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Johannes Thumshirn April 11, 2019, 1:09 p.m. UTC | #1
On 10/04/2019 16:24, Nikolay Borisov wrote:
> Buffered writeback always calls btrfs_csum_one_bio with the last 2
> arguments being 0 irrespective of what the bio_offset has been passed
> to btrfs_submit_bio_start. Make this apparent by explicitly passing 0
> for bio_offset when calling btrfs_wq_submit_bio from
> btrfs_submit_bio_hook. This will allow for further simplifications down
> the line. No functional changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/inode.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 07cf7050c99f..6e5f1afa7407 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -1991,8 +1991,7 @@ static blk_status_t btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
>  			goto mapit;
>  		/* we're doing a write, do the async checksumming */
>  		ret = btrfs_wq_submit_bio(fs_info, bio, mirror_num, bio_flags,
> -					  bio_offset, inode,
> -					  btrfs_submit_bio_start);
> +					  0, inode, btrfs_submit_bio_start);
>  		goto out;
>  	} else if (!skip_sum) {
>  		ret = btrfs_csum_one_bio(inode, bio, 0, 0);
> 

I think we can also kill 'async_submit_bio::bio_offset' as no other
value than 0 is ever used.
Johannes Thumshirn April 11, 2019, 1:10 p.m. UTC | #2
On 11/04/2019 15:09, Johannes Thumshirn wrote:
> I think we can also kill 'async_submit_bio::bio_offset' as no other
> value than 0 is ever used.

Right, this is what the following patches do. Ignore this.
Nikolay Borisov April 11, 2019, 1:17 p.m. UTC | #3
On 11.04.19 г. 16:10 ч., Johannes Thumshirn wrote:
> On 11/04/2019 15:09, Johannes Thumshirn wrote:
>> I think we can also kill 'async_submit_bio::bio_offset' as no other
>> value than 0 is ever used.
> 
> Right, this is what the following patches do. Ignore this.

Actually they don't particularly kill async_submit_bio::bio_offset. But
it could be done :)

> 
>
Johannes Thumshirn April 11, 2019, 1:26 p.m. UTC | #4
On 11/04/2019 15:17, Nikolay Borisov wrote:
> 
> 
> On 11.04.19 г. 16:10 ч., Johannes Thumshirn wrote:
>> On 11/04/2019 15:09, Johannes Thumshirn wrote:
>>> I think we can also kill 'async_submit_bio::bio_offset' as no other
>>> value than 0 is ever used.
>>
>> Right, this is what the following patches do. Ignore this.
> 
> Actually they don't particularly kill async_submit_bio::bio_offset. But
> it could be done :)


Yes but that's a follow up I guess.
Anyways,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

Patch
diff mbox series

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 07cf7050c99f..6e5f1afa7407 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1991,8 +1991,7 @@  static blk_status_t btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
 			goto mapit;
 		/* we're doing a write, do the async checksumming */
 		ret = btrfs_wq_submit_bio(fs_info, bio, mirror_num, bio_flags,
-					  bio_offset, inode,
-					  btrfs_submit_bio_start);
+					  0, inode, btrfs_submit_bio_start);
 		goto out;
 	} else if (!skip_sum) {
 		ret = btrfs_csum_one_bio(inode, bio, 0, 0);