Skip to content

Commit 6439476

Browse files
author
Matthew Wilcox (Oracle)
committed
fs: Convert drop_buffers() to use a folio
All callers now have a folio. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Jeff Layton <[email protected]>
1 parent 68189fe commit 6439476

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fs/buffer.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,10 +3180,10 @@ static inline int buffer_busy(struct buffer_head *bh)
31803180
(bh->b_state & ((1 << BH_Dirty) | (1 << BH_Lock)));
31813181
}
31823182

3183-
static int
3184-
drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
3183+
static bool
3184+
drop_buffers(struct folio *folio, struct buffer_head **buffers_to_free)
31853185
{
3186-
struct buffer_head *head = page_buffers(page);
3186+
struct buffer_head *head = folio_buffers(folio);
31873187
struct buffer_head *bh;
31883188

31893189
bh = head;
@@ -3201,10 +3201,10 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
32013201
bh = next;
32023202
} while (bh != head);
32033203
*buffers_to_free = head;
3204-
detach_page_private(page);
3205-
return 1;
3204+
folio_detach_private(folio);
3205+
return true;
32063206
failed:
3207-
return 0;
3207+
return false;
32083208
}
32093209

32103210
bool try_to_free_buffers(struct folio *folio)
@@ -3218,12 +3218,12 @@ bool try_to_free_buffers(struct folio *folio)
32183218
return false;
32193219

32203220
if (mapping == NULL) { /* can this still happen? */
3221-
ret = drop_buffers(&folio->page, &buffers_to_free);
3221+
ret = drop_buffers(folio, &buffers_to_free);
32223222
goto out;
32233223
}
32243224

32253225
spin_lock(&mapping->private_lock);
3226-
ret = drop_buffers(&folio->page, &buffers_to_free);
3226+
ret = drop_buffers(folio, &buffers_to_free);
32273227

32283228
/*
32293229
* If the filesystem writes its buffers by hand (eg ext3)

0 commit comments

Comments
 (0)