Thread (86 messages) 86 messages, 7 authors, 2021-01-15

Re: [PATCH v11 19/40] btrfs: extract page adding function

From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-01-11 16:23:34
Also in: linux-fsdevel

On 12/21/20 10:49 PM, Naohiro Aota wrote:
quoted hunk ↗ jump to hunk
This commit extract page adding to bio part from submit_extent_page(). The
page is added only when bio_flags are the same, contiguous and the added
page fits in the same stripe as pages in the bio.

Condition checkings are reordered to allow early return to avoid possibly
heavy btrfs_bio_fits_in_stripe() calling.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
  fs/btrfs/extent_io.c | 56 ++++++++++++++++++++++++++++++++------------
  1 file changed, 41 insertions(+), 15 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 129d571a5c1a..2f070a9e5b22 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3061,6 +3061,44 @@ struct bio *btrfs_bio_clone_partial(struct bio *orig, int offset, int size)
  	return bio;
  }
  
+/**
+ * btrfs_bio_add_page	-	attempt to add a page to bio
+ * @bio:	destination bio
+ * @page:	page to add to the bio
+ * @logical:	offset of the new bio or to check whether we are adding
+ *              a contiguous page to the previous one
+ * @pg_offset:	starting offset in the page
+ * @size:	portion of page that we want to write
+ * @prev_bio_flags:  flags of previous bio to see if we can merge the current one
+ * @bio_flags:	flags of the current bio to see if we can merge them
Just a nit, you're missing @return here, the commit flags caught this, I'd 
recommend adding our commit flags to your local repo so you can preemptively 
catch these sort of things

https://github.com/btrfs/btrfs-workflow/blob/master/patch-submission.md

under the "Git config options" section.  If you have to respin you can add it 
then.  Thanks,

Josef
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help