linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: hch@infradead.org, david@fromorbit.com, willy@infradead.org,
	Guoqing Jiang <guoqing.jiang@cloud.ionos.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: [RFC PATCH V2 4/9] fs/buffer.c: use attach/clear_page_private
Date: Thu, 30 Apr 2020 23:44:45 +0200	[thread overview]
Message-ID: <20200430214450.10662-5-guoqing.jiang@cloud.ionos.com> (raw)
In-Reply-To: <20200430214450.10662-1-guoqing.jiang@cloud.ionos.com>

Since the new pair function is introduced, we can call them to clean the
code in buffer.c.

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
---
RFC -> RFC V2
1. change the name of new functions to attach/clear_page_private.

 fs/buffer.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index a60f60396cfa..60dd61384b13 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -123,14 +123,6 @@ void __wait_on_buffer(struct buffer_head * bh)
 }
 EXPORT_SYMBOL(__wait_on_buffer);
 
-static void
-__clear_page_buffers(struct page *page)
-{
-	ClearPagePrivate(page);
-	set_page_private(page, 0);
-	put_page(page);
-}
-
 static void buffer_io_error(struct buffer_head *bh, char *msg)
 {
 	if (!test_bit(BH_Quiet, &bh->b_state))
@@ -906,7 +898,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head)
 		bh = bh->b_this_page;
 	} while (bh);
 	tail->b_this_page = head;
-	attach_page_buffers(page, head);
+	attach_page_private(page, head);
 }
 
 static sector_t blkdev_max_block(struct block_device *bdev, unsigned int size)
@@ -1580,7 +1572,7 @@ void create_empty_buffers(struct page *page,
 			bh = bh->b_this_page;
 		} while (bh != head);
 	}
-	attach_page_buffers(page, head);
+	attach_page_private(page, head);
 	spin_unlock(&page->mapping->private_lock);
 }
 EXPORT_SYMBOL(create_empty_buffers);
@@ -2567,7 +2559,7 @@ static void attach_nobh_buffers(struct page *page, struct buffer_head *head)
 			bh->b_this_page = head;
 		bh = bh->b_this_page;
 	} while (bh != head);
-	attach_page_buffers(page, head);
+	attach_page_private(page, head);
 	spin_unlock(&page->mapping->private_lock);
 }
 
@@ -3227,7 +3219,7 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
 		bh = next;
 	} while (bh != head);
 	*buffers_to_free = head;
-	__clear_page_buffers(page);
+	clear_page_private(page);
 	return 1;
 failed:
 	return 0;
-- 
2.17.1


  parent reply	other threads:[~2020-04-30 21:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 21:44 [RFC PATCH V2 0/9] Introduce attach/clear_page_private to cleanup code Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 1/9] include/linux/pagemap.h: introduce attach/clear_page_private Guoqing Jiang
2020-04-30 22:10   ` Andreas Grünbacher
2020-05-01  6:38     ` Guoqing Jiang
2020-04-30 22:13   ` Matthew Wilcox
2020-05-01  1:42     ` Al Viro
2020-05-01  1:49       ` Al Viro
2020-05-01  6:41         ` Guoqing Jiang
2020-05-01  6:39     ` Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 2/9] md: remove __clear_page_buffers and use attach/clear_page_private Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 3/9] btrfs: " Guoqing Jiang
2020-04-30 21:44 ` Guoqing Jiang [this message]
2020-04-30 21:44 ` [RFC PATCH V2 5/9] f2fs: " Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 6/9] iomap: " Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 7/9] ntfs: replace attach_page_buffers with attach_page_private Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 8/9] orangefs: use attach/clear_page_private Guoqing Jiang
2020-04-30 21:44 ` [RFC PATCH V2 9/9] buffer_head.h: remove attach_page_buffers Guoqing Jiang
2020-05-01 22:16 ` [RFC PATCH V2 0/9] Introduce attach/clear_page_private to cleanup code Matthew Wilcox
2020-05-01 22:42   ` Guoqing Jiang
2020-05-02  0:41     ` Matthew Wilcox
2020-05-02  8:56       ` Guoqing Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200430214450.10662-5-guoqing.jiang@cloud.ionos.com \
    --to=guoqing.jiang@cloud.ionos.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).