diff options
| author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2026-09-20 22:28:09 -0400 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-09-29 23:13:05 -0700 |
| commit | 5b31ca56f0af4d67d659de62bd13f77cae9b6aba (patch) | |
| tree | 6fe6e7552a6942a10d8c1cab7631f060e892b396 /drivers/md | |
| parent | ae35d77d616b2a3db63ed1e113a41c3e8c2d0706 (diff) | |
| download | linux-next-5b31ca56f0af4d67d659de62bd13f77cae9b6aba.tar.gz linux-next-5b31ca56f0af4d67d659de62bd13f77cae9b6aba.zip | |
md: use folio_alloc_buffers()
Remove the last user of alloc_page_buffers(). Use folio_alloc_buffers()
instead, since alloc_page_buffers() is a wrap over it. Although the pages
used in md-bitmap are not folios, as they are not mapped into userspace
nor enter the page cache, but they still have buffer heads attached.
Cleaning up the code to not use buffer heads is future work.
[ziy@nvidia.com: reword commit message]
Link: https://lore.kernel.org/20260920-remove-pg_private-v5-13-bb68b6a21869@nvidia.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'drivers/md')
| -rw-r--r-- | drivers/md/md-bitmap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index b8325cb09a37..5f1637f974c1 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -560,6 +560,7 @@ static int read_file_page(struct file *file, unsigned long index, { int ret = 0; struct inode *inode = file_inode(file); + struct folio *folio = page_folio(page); struct buffer_head *bh; sector_t block, blk_cur; unsigned long blocksize = i_blocksize(inode); @@ -567,12 +568,12 @@ static int read_file_page(struct file *file, unsigned long index, pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE, (unsigned long long)index << PAGE_SHIFT); - bh = alloc_page_buffers(page, blocksize); + bh = folio_alloc_buffers(folio, blocksize, GFP_NOFS | __GFP_ACCOUNT); if (!bh) { ret = -ENOMEM; goto out; } - attach_page_private(page, bh); + folio_attach_private(folio, bh); blk_cur = index << (PAGE_SHIFT - inode->i_blkbits); while (bh) { block = blk_cur; |
