diff mbox

Btrfs: cleanup submit_one_bio

Message ID 1491252347-3827-1-git-send-email-bo.li.liu@oracle.com (mailing list archive)
State Superseded
Headers show

Commit Message

Liu Bo April 3, 2017, 8:45 p.m. UTC
@bio_offset is passed into submit_bio_hook and is used at
btrfs_wq_submit_bio(), but only dio code makes use of @bio_offset, so
remove other dead code.

Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/extent_io.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

kernel test robot April 4, 2017, 12:27 p.m. UTC | #1
Hi Liu,

[auto build test ERROR on next-20170330]
[also build test ERROR on v4.11-rc5]
[cannot apply to btrfs/next v4.9-rc8 v4.9-rc7 v4.9-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Liu-Bo/Btrfs-cleanup-submit_one_bio/20170404-194545
config: x86_64-randconfig-x012-201714 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   fs/btrfs/extent_io.c: In function 'submit_one_bio':
>> fs/btrfs/extent_io.c:2739:36: error: 'page' undeclared (first use in this function)
      ret = tree->ops->submit_bio_hook(page->mapping->host, bio,
                                       ^~~~
   fs/btrfs/extent_io.c:2739:36: note: each undeclared identifier is reported only once for each function it appears in

vim +/page +2739 fs/btrfs/extent_io.c

70dec807 Chris Mason     2008-01-29  2733  	struct extent_io_tree *tree = bio->bi_private;
70dec807 Chris Mason     2008-01-29  2734  
902b22f3 David Woodhouse 2008-08-20  2735  	bio->bi_private = NULL;
d1310b2e Chris Mason     2008-01-24  2736  	bio_get(bio);
d1310b2e Chris Mason     2008-01-24  2737  
20c9801d David Sterba    2017-02-17  2738  	if (tree->ops)
81a75f67 Mike Christie   2016-06-05 @2739  		ret = tree->ops->submit_bio_hook(page->mapping->host, bio,
178218fd Liu Bo          2017-04-03  2740  					   mirror_num, bio_flags, 0);
0b86a832 Chris Mason     2008-03-24  2741  	else
4e49ea4a Mike Christie   2016-06-05  2742  		btrfsic_submit_bio(bio);

:::::: The code at line 2739 was first introduced by commit
:::::: 81a75f6781deb7a3b5274b4c683e327e5cb5b883 btrfs: use bio fields for op and flags

:::::: TO: Mike Christie <mchristi@redhat.com>
:::::: CC: Jens Axboe <axboe@fb.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Liu Bo April 4, 2017, 5:43 p.m. UTC | #2
On Mon, Apr 03, 2017 at 01:45:47PM -0700, Liu Bo wrote:
> @bio_offset is passed into submit_bio_hook and is used at
> btrfs_wq_submit_bio(), but only dio code makes use of @bio_offset, so
> remove other dead code.
>

Please ignore this one.

Thanks,

-liubo
> Cc: David Sterba <dsterba@suse.cz>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  fs/btrfs/extent_io.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 7b5139d..79f38e6a 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2746,19 +2746,14 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
>  				       unsigned long bio_flags)
>  {
>  	int ret = 0;
> -	struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
> -	struct page *page = bvec->bv_page;
>  	struct extent_io_tree *tree = bio->bi_private;
> -	u64 start;
> -
> -	start = page_offset(page) + bvec->bv_offset;
>  
>  	bio->bi_private = NULL;
>  	bio_get(bio);
>  
>  	if (tree->ops)
>  		ret = tree->ops->submit_bio_hook(page->mapping->host, bio,
> -					   mirror_num, bio_flags, start);
> +					   mirror_num, bio_flags, 0);
>  	else
>  		btrfsic_submit_bio(bio);
>  
> -- 
> 2.5.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7b5139d..79f38e6a 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2746,19 +2746,14 @@  static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
 				       unsigned long bio_flags)
 {
 	int ret = 0;
-	struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
-	struct page *page = bvec->bv_page;
 	struct extent_io_tree *tree = bio->bi_private;
-	u64 start;
-
-	start = page_offset(page) + bvec->bv_offset;
 
 	bio->bi_private = NULL;
 	bio_get(bio);
 
 	if (tree->ops)
 		ret = tree->ops->submit_bio_hook(page->mapping->host, bio,
-					   mirror_num, bio_flags, start);
+					   mirror_num, bio_flags, 0);
 	else
 		btrfsic_submit_bio(bio);