[PATCH RFC 09/11] fs: move dir_pages() from <linux/pagemap.h> to <linux/fs.h>
From: Tal Zussman
Date: Wed May 20 2026 - 16:54:43 EST
This is an inode-based helper and should live with other inode helpers.
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
include/linux/fs.h | 6 ++++++
include/linux/pagemap.h | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index cd5088dfe9a1..776cc82932a7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1171,6 +1171,12 @@ static inline void i_size_write(struct inode *inode, loff_t i_size)
#endif
}
+static inline unsigned long dir_pages(const struct inode *inode)
+{
+ return (unsigned long)(inode->i_size + PAGE_SIZE - 1) >>
+ PAGE_SHIFT;
+}
+
static inline unsigned iminor(const struct inode *inode)
{
return MINOR(inode->i_rdev);
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 84ccb682cca8..f86a550ad516 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -1356,12 +1356,6 @@ static inline size_t readahead_batch_length(const struct readahead_control *rac)
return rac->_batch_count * PAGE_SIZE;
}
-static inline unsigned long dir_pages(const struct inode *inode)
-{
- return (unsigned long)(inode->i_size + PAGE_SIZE - 1) >>
- PAGE_SHIFT;
-}
-
/**
* folio_mkwrite_check_truncate - check if folio was truncated
* @folio: the folio to check
--
2.39.5