[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251117220522.4064487-3-jkoolstra@xs4all.nl>
Date: Mon, 17 Nov 2025 23:05:22 +0100
From: Jori Koolstra <jkoolstra@...all.nl>
To: Christian Brauner <brauner@...nel.org>
Cc: Jori Koolstra <jkoolstra@...all.nl>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Jan Kara <jack@...e.cz>,
Taotao Chen <chentaotao@...iglobal.com>,
Shuah Khan <skhan@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] minix: calculate s_firstdatazone to support more inodes
We can potentially ignore the on-disk s_firstdatazone and calculate the
value on the fly instead. Since this field is only a u16, this allows
more inodes to be handled. The mfs implementation in the minix OS does
roughly the same. Currently there is no support for s_firstdatazone=0 in
utils-linux.
Signed-off-by: Jori Koolstra <jkoolstra@...all.nl>
---
fs/minix/inode.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 8eb26ff91adf..d4a43bc86890 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -272,6 +272,15 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc)
} else
goto out_no_fs;
+ /* We can potentially ignore the on-disk s_firstdatazone and instead
+ * calculate the value on the fly. Since this field is only a u16,
+ * this allows more inodes to be handled.
+ */
+ if (sbi->s_firstdatazone == 0) {
+ sbi->s_firstdatazone = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
+ minix_blocks_needed(sbi->s_ninodes, s->s_blocksize);
+ }
+
if (!minix_check_superblock(s))
goto out_illegal_sb;
--
2.51.2
Powered by blists - more mailing lists