Re: [PATCH v3 06/22] btrfs: extent_io: introduce a helper to grab an existing extent buffer from a page
From: David Sterba <hidden>
Date: 2021-01-12 15:11:05
From: David Sterba <hidden>
Date: 2021-01-12 15:11:05
On Wed, Jan 06, 2021 at 09:01:45AM +0800, Qu Wenruo wrote:
+static struct extent_buffer *grab_extent_buffer(struct page *page)
+{
+ struct extent_buffer *exists;
+
+ /* Page not yet attached to an extent buffer */
+ if (!PagePrivate(page))
+ return NULL;
+
+ /*
+ * We could have already allocated an eb for this page
+ * and attached one so lets see if we can get a ref on
+ * the existing eb, and if we can we know it's good and
+ * we can just return that one, else we know we can just
+ * overwrite page->private.
+ */Please reformat comments that get moved to full 80 columns line. Fixed.