Thread (10 messages) 10 messages, 3 authors, 2021-02-09

Re: [PATCH 1/3] mm: provide filemap_range_needs_writeback() helper

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-02-08 23:22:35
Also in: linux-mm

On 2/8/21 4:02 PM, Matthew Wilcox wrote:
On Mon, Feb 08, 2021 at 03:18:27PM -0700, Jens Axboe wrote:
quoted
+	rcu_read_lock();
+	xas_for_each(&xas, head, max) {
+		if (xas_retry(&xas, head))
+			continue;
+		if (xa_is_value(head))
+			continue;
+		page = find_subpage(head, xas.xa_index);
+		if (PageDirty(page) || PageLocked(page) || PageWriteback(page))
+			break;
+		page = NULL;
+	}
+	rcu_read_unlock();
There's no need to find the sub-page for any of these three conditions --
the bit will be set on the head page.
Gotcha, that makes it simpler. I'll make the edit.

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