Thread (17 messages) 17 messages, 3 authors, 2021-07-01

Re: [PATCH v4 02/10] btrfs: defrag: extract the page preparation code into one helper

From: Qu Wenruo <hidden>
Date: 2021-07-01 22:32:52


On 2021/7/2 上午12:58, David Sterba wrote:
On Thu, Jun 10, 2021 at 01:09:09PM +0800, Qu Wenruo wrote:
quoted
In cluster_pages_for_defrag(), we have complex code block inside one
for() loop.

The code block is to prepare one page for defrag, this will ensure:
- The page is locked and set up properly
- No ordered extent exists in the page range
- The page is uptodate
- The writeback has finished

This behavior is pretty common and will be reused by later defrag
rework.

So extract the code into its own helper, defrag_prepare_one_page(), for
later usage, and cleanup the code by a little.

Since we're here, also make the page check to be subpage compatible,
which means we will also check page::private, not only page->mapping.
Please split this change, it's unnoticeable in the refactoring.
Sure, but the defrag patchset is now in very low priority mode, thus it 
will be a long time before you see the next update...

(And I hope I didn't forgot those comments before next update)

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