Message ID | 20190701165055.15483-2-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | None | expand |
On 2019/7/2 上午12:50, Nikolay Borisov wrote: > This label is only executed if compress_file_range fails to create an > inline extent. So move its code in the semantically related inline > extent handling branch. No functional changes. > > Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > fs/btrfs/inode.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index 3b0bf5ea9eb6..072a300f8487 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -600,7 +600,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) > PAGE_SET_WRITEBACK | > page_error_op | > PAGE_END_WRITEBACK); > - goto free_pages_out; > + > + for (i = 0; i < nr_pages; i++) { > + WARN_ON(pages[i]->mapping); > + put_page(pages[i]); > + } > + kfree(pages); > + > + return 0; > } > } > > @@ -678,15 +685,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) > compressed_extents += 1; > > return compressed_extents; > - > -free_pages_out: > - for (i = 0; i < nr_pages; i++) { > - WARN_ON(pages[i]->mapping); > - put_page(pages[i]); > - } > - kfree(pages); > - > - return 0; > } > > static void free_async_extent_pages(struct async_extent *async_extent) >
On 2/7/19 12:50 AM, Nikolay Borisov wrote: > This label is only executed if compress_file_range fails to create an > inline extent. So move its code in the semantically related inline > extent handling branch. No functional changes. > > Signed-off-by: Nikolay Borisov <nborisov@suse.com> Looks good. Reviewed-by: Anand Jain <anand.jain@oracle.com> > --- > fs/btrfs/inode.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index 3b0bf5ea9eb6..072a300f8487 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -600,7 +600,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) > PAGE_SET_WRITEBACK | > page_error_op | > PAGE_END_WRITEBACK); > - goto free_pages_out; > + > + for (i = 0; i < nr_pages; i++) { > + WARN_ON(pages[i]->mapping); > + put_page(pages[i]); > + } > + kfree(pages); > + > + return 0; > } > } > > @@ -678,15 +685,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) > compressed_extents += 1; > > return compressed_extents; > - > -free_pages_out: > - for (i = 0; i < nr_pages; i++) { > - WARN_ON(pages[i]->mapping); > - put_page(pages[i]); > - } > - kfree(pages); > - > - return 0; > } > > static void free_async_extent_pages(struct async_extent *async_extent) >
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 3b0bf5ea9eb6..072a300f8487 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -600,7 +600,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) PAGE_SET_WRITEBACK | page_error_op | PAGE_END_WRITEBACK); - goto free_pages_out; + + for (i = 0; i < nr_pages; i++) { + WARN_ON(pages[i]->mapping); + put_page(pages[i]); + } + kfree(pages); + + return 0; } } @@ -678,15 +685,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) compressed_extents += 1; return compressed_extents; - -free_pages_out: - for (i = 0; i < nr_pages; i++) { - WARN_ON(pages[i]->mapping); - put_page(pages[i]); - } - kfree(pages); - - return 0; } static void free_async_extent_pages(struct async_extent *async_extent)
This label is only executed if compress_file_range fails to create an inline extent. So move its code in the semantically related inline extent handling branch. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- fs/btrfs/inode.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)