All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Dave Kleikamp <shaggy@kernel.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	jfs-discussion@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH v2 10/13] jfs: Convert inc_io to take a folio
Date: Wed, 17 Apr 2024 18:56:54 +0100	[thread overview]
Message-ID: <20240417175659.818299-11-willy@infradead.org> (raw)
In-Reply-To: <20240417175659.818299-1-willy@infradead.org>

All their callers now have a folio, so pass it in.  Remove mp_anchor()
as inc_io() was the last user.  No savings here, just cleaning up some
remnants.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/jfs/jfs_metapage.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 67d5d417fe01..f03e217ec1cb 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -78,7 +78,6 @@ struct meta_anchor {
 	atomic_t io_count;
 	struct metapage *mp[MPS_PER_PAGE];
 };
-#define mp_anchor(page) ((struct meta_anchor *)page_private(page))
 
 static inline struct metapage *folio_to_mp(struct folio *folio, int offset)
 {
@@ -132,9 +131,11 @@ static inline void remove_metapage(struct folio *folio, struct metapage *mp)
 	}
 }
 
-static inline void inc_io(struct page *page)
+static inline void inc_io(struct folio *folio)
 {
-	atomic_inc(&mp_anchor(page)->io_count);
+	struct meta_anchor *anchor = folio->private;
+
+	atomic_inc(&anchor->io_count);
 }
 
 static inline void dec_io(struct folio *folio, void (*handler) (struct folio *))
@@ -166,7 +167,7 @@ static inline void remove_metapage(struct folio *folio, struct metapage *mp)
 	kunmap(&folio->page);
 }
 
-#define inc_io(page) do {} while(0)
+#define inc_io(folio) do {} while(0)
 #define dec_io(folio, handler) handler(folio)
 
 #endif
@@ -395,14 +396,14 @@ static int metapage_write_folio(struct folio *folio,
 			 * Increment counter before submitting i/o to keep
 			 * count from hitting zero before we're through
 			 */
-			inc_io(&folio->page);
+			inc_io(folio);
 			if (!bio->bi_iter.bi_size)
 				goto dump_bio;
 			submit_bio(bio);
 			nr_underway++;
 			bio = NULL;
 		} else
-			inc_io(&folio->page);
+			inc_io(folio);
 		xlen = (folio_size(folio) - offset) >> inode->i_blkbits;
 		pblock = metapage_get_blocks(inode, lblock, &xlen);
 		if (!pblock) {
@@ -496,7 +497,7 @@ static int metapage_read_folio(struct file *fp, struct folio *folio)
 		if (pblock) {
 			if (!folio->private)
 				insert_metapage(folio, NULL);
-			inc_io(&folio->page);
+			inc_io(folio);
 			if (bio)
 				submit_bio(bio);
 
-- 
2.43.0


  parent reply	other threads:[~2024-04-17 17:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 17:56 [PATCH v2 00/13] JFS folio conversion Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 01/13] jfs: Convert metapage_read_folio to use folio APIs Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 02/13] jfs: Convert metapage_writepage to metapage_write_folio Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 03/13] jfs: Convert __get_metapage to use a folio Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 04/13] jfs: Convert insert_metapage() to take " Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 05/13] jfs; Convert release_metapage to use " Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 06/13] jfs: Convert drop_metapage and remove_metapage to take " Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 07/13] jfs: Convert dec_io " Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 08/13] jfs; Convert __invalidate_metapages to use " Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 09/13] jfs: Convert page_to_mp to folio_to_mp Matthew Wilcox (Oracle)
2024-04-17 17:56 ` Matthew Wilcox (Oracle) [this message]
2024-04-17 17:56 ` [PATCH v2 11/13] jfs: Convert force_metapage to use a folio Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 12/13] jfs: Change metapage->page to metapage->folio Matthew Wilcox (Oracle)
2024-04-17 17:56 ` [PATCH v2 13/13] fs: Remove i_blocks_per_page Matthew Wilcox (Oracle)
2024-04-18 14:37 ` [PATCH v2 14/13] jfs: Stop using PG_error Matthew Wilcox

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=20240417175659.818299-11-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shaggy@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.