]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: enable block size larger than page size support
authorPankaj Raghav <p.raghav@samsung.com>
Mon, 21 Oct 2024 00:10:46 +0000 (17:10 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 31 Oct 2024 22:45:03 +0000 (15:45 -0700)
Source kernel commit: 7df7c204c678e24cd32d33360538670b7b90e330

Page cache now has the ability to have a minimum order when allocating
a folio which is a prerequisite to add support for block size > page
size.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20240827-xfs-fix-wformat-bs-gt-ps-v1-1-aec6717609e0@kernel.org
Link: https://lore.kernel.org/r/20240822135018.1931258-11-kernel@pankajraghav.com
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
libxfs/init.c
libxfs/libxfs_priv.h
libxfs/xfs_ialloc.c
libxfs/xfs_shared.h

index 1e45f091dbb5bfb23b8a1812d8178af49aa2d11d..733ab3f1abc557e7485b76d12fc05277c0f7bd51 100644 (file)
@@ -22,6 +22,7 @@
 #include "xfs_rmap_btree.h"
 #include "xfs_refcount_btree.h"
 #include "libfrog/platform.h"
+#include "libfrog/util.h"
 #include "libxfs/xfile.h"
 #include "libxfs/buf_mem.h"
 
@@ -44,6 +45,8 @@ int   use_xfs_buf_lock;       /* global flag: use xfs_buf locks for MT */
 
 static int nextfakedev = -1;   /* device number to give to next fake device */
 
+unsigned int PAGE_SHIFT;
+
 /*
  * Checks whether a given device has a mounted, writable
  * filesystem, returns 1 if it does & fatal (just warns
@@ -257,6 +260,8 @@ libxfs_close_devices(
 int
 libxfs_init(struct libxfs_init *a)
 {
+       if (!PAGE_SHIFT)
+               PAGE_SHIFT = log2_roundup(PAGE_SIZE);
        xfs_check_ondisk_structs();
        xmbuf_libinit();
        rcu_init();
index fa025aeb09712b0c66a8e7f34a52966367965a89..97f5003ea5386272bad8e888919b83fad2a0d144 100644 (file)
@@ -224,6 +224,7 @@ uint32_t get_random_u32(void);
 #endif
 
 #define PAGE_SIZE              getpagesize()
+extern unsigned int PAGE_SHIFT;
 
 #define inode_peek_iversion(inode)     (inode)->i_version
 #define inode_set_iversion_queried(inode, version) do { \
index 141b2d397b1fe718375d88a4f46dbc6a508fabef..43af698fa9090374b49b7039a3e8115729b4a4e7 100644 (file)
@@ -3029,6 +3029,11 @@ xfs_ialloc_setup_geometry(
                igeo->ialloc_align = mp->m_dalign;
        else
                igeo->ialloc_align = 0;
+
+       if (mp->m_sb.sb_blocksize > PAGE_SIZE)
+               igeo->min_folio_order = mp->m_sb.sb_blocklog - PAGE_SHIFT;
+       else
+               igeo->min_folio_order = 0;
 }
 
 /* Compute the location of the root directory inode that is laid out by mkfs. */
index 2f7413afbf46cdfafb93ea15daa7d3b9013a5275..33b84a3a83ff6340cfd146050a057ff27209d6f3 100644 (file)
@@ -224,6 +224,9 @@ struct xfs_ino_geometry {
        /* precomputed value for di_flags2 */
        uint64_t        new_diflags2;
 
+       /* minimum folio order of a page cache allocation */
+       unsigned int    min_folio_order;
+
 };
 
 #endif /* __XFS_SHARED_H__ */