Skip to content

Commit db2c1d8

Browse files
Guoqing Jiangtorvalds
authored andcommitted
md: remove __clear_page_buffers and use attach/detach_page_private
After introduction attach/detach_page_private in pagemap.h, we can remove the duplicated code and call the new functions. Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Song Liu <song@kernel.org> Link: http://lkml.kernel.org/r/20200517214718.468-3-guoqing.jiang@cloud.ionos.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b03143a commit db2c1d8

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

‎drivers/md/md-bitmap.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,6 @@ static void end_bitmap_write(struct buffer_head *bh, int uptodate)
324324
wake_up(&bitmap->write_wait);
325325
}
326326

327-
/* copied from buffer.c */
328-
static void
329-
__clear_page_buffers(struct page *page)
330-
{
331-
ClearPagePrivate(page);
332-
set_page_private(page, 0);
333-
put_page(page);
334-
}
335327
static void free_buffers(struct page *page)
336328
{
337329
struct buffer_head *bh;
@@ -345,7 +337,7 @@ static void free_buffers(struct page *page)
345337
free_buffer_head(bh);
346338
bh = next;
347339
}
348-
__clear_page_buffers(page);
340+
detach_page_private(page);
349341
put_page(page);
350342
}
351343

@@ -374,7 +366,7 @@ static int read_page(struct file *file, unsigned long index,
374366
ret = -ENOMEM;
375367
goto out;
376368
}
377-
attach_page_buffers(page, bh);
369+
attach_page_private(page, bh);
378370
blk_cur = index << (PAGE_SHIFT - inode->i_blkbits);
379371
while (bh) {
380372
block = blk_cur;

0 commit comments

Comments
 (0)