提交 64394763 编写于 作者: M Matthew Wilcox (Oracle)

fs: Convert drop_buffers() to use a folio

All callers now have a folio.
Signed-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: NJeff Layton <jlayton@kernel.org>
上级 68189fef
...@@ -3180,10 +3180,10 @@ static inline int buffer_busy(struct buffer_head *bh) ...@@ -3180,10 +3180,10 @@ static inline int buffer_busy(struct buffer_head *bh)
(bh->b_state & ((1 << BH_Dirty) | (1 << BH_Lock))); (bh->b_state & ((1 << BH_Dirty) | (1 << BH_Lock)));
} }
static int static bool
drop_buffers(struct page *page, struct buffer_head **buffers_to_free) drop_buffers(struct folio *folio, struct buffer_head **buffers_to_free)
{ {
struct buffer_head *head = page_buffers(page); struct buffer_head *head = folio_buffers(folio);
struct buffer_head *bh; struct buffer_head *bh;
bh = head; bh = head;
...@@ -3201,10 +3201,10 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free) ...@@ -3201,10 +3201,10 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
bh = next; bh = next;
} while (bh != head); } while (bh != head);
*buffers_to_free = head; *buffers_to_free = head;
detach_page_private(page); folio_detach_private(folio);
return 1; return true;
failed: failed:
return 0; return false;
} }
bool try_to_free_buffers(struct folio *folio) bool try_to_free_buffers(struct folio *folio)
...@@ -3218,12 +3218,12 @@ bool try_to_free_buffers(struct folio *folio) ...@@ -3218,12 +3218,12 @@ bool try_to_free_buffers(struct folio *folio)
return false; return false;
if (mapping == NULL) { /* can this still happen? */ if (mapping == NULL) { /* can this still happen? */
ret = drop_buffers(&folio->page, &buffers_to_free); ret = drop_buffers(folio, &buffers_to_free);
goto out; goto out;
} }
spin_lock(&mapping->private_lock); spin_lock(&mapping->private_lock);
ret = drop_buffers(&folio->page, &buffers_to_free); ret = drop_buffers(folio, &buffers_to_free);
/* /*
* If the filesystem writes its buffers by hand (eg ext3) * If the filesystem writes its buffers by hand (eg ext3)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册