Re: [PATCH v1.1 39/45] libxfs: remove pointless *XFS_MOUNT* flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/28/22 4:43 PM, Darrick J. Wong wrote:
From: Darrick J. Wong <djwong@xxxxxxxxxx>

Get rid of these flags and the m_flags field, since none of them do
anything anymore.

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---
v1.1: add some clarifying comments, maintain same inode64 behavior
---

..


index e9235a35..18cbc59e 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -490,12 +490,7 @@ rtmount_init(
/*
   * Set parameters for inode allocation heuristics, taking into account
- * filesystem size and inode32/inode64 mount options; i.e. specifically
- * whether or not XFS_MOUNT_SMALL_INUMS is set.
- *
- * Inode allocation patterns are altered only if inode32 is requested
- * (XFS_MOUNT_SMALL_INUMS), and the filesystem is sufficiently large.
- * If altered, XFS_MOUNT_32BITINODES is set as well.
+ * filesystem size.
   *
   * An agcount independent of that in the mount structure is provided
   * because in the growfs case, mp->m_sb.sb_agcount is not yet updated
@@ -531,22 +526,8 @@ xfs_set_inode_alloc(
  		max_metadata = agcount;
  	}
- /* Get the last possible inode in the filesystem */
-	agino =	XFS_AGB_TO_AGINO(mp, sbp->sb_agblocks - 1);
-	ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino);

Whoops, removing "agino = " here leads to an uninitialized use later....

So if we're really going to rip this all out, we need to remove all the
logic under the  "xfs_is_inode32(mp)" cases and just set up every AG
as inode-capable, I think, i.e. this on top of yours:

diff --git a/libxfs/init.c b/libxfs/init.c
index 035d2807..cc031d50 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -506,7 +506,6 @@ xfs_set_inode_alloc(
        xfs_agnumber_t  maxagi = 0;
        xfs_sb_t        *sbp = &mp->m_sb;
        xfs_agnumber_t  max_metadata;
-       xfs_agino_t     agino;
        xfs_ino_t       ino;
/*
@@ -531,31 +530,13 @@ xfs_set_inode_alloc(
        for (index = 0; index < agcount; index++) {
                struct xfs_perag        *pag;
- ino = XFS_AGINO_TO_INO(mp, index, agino);
-
                pag = xfs_perag_get(mp, index);
-
-               if (xfs_is_inode32(mp)) {
-                       if (ino > XFS_MAXINUMBER_32) {
-                               pag->pagi_inodeok = 0;
-                               pag->pagf_metadata = 0;
-                       } else {
-                               pag->pagi_inodeok = 1;
-                               maxagi++;
-                               if (index < max_metadata)
-                                       pag->pagf_metadata = 1;
-                               else
-                                       pag->pagf_metadata = 0;
-                       }
-               } else {
-                       pag->pagi_inodeok = 1;
-                       pag->pagf_metadata = 0;
-               }
-
+               pag->pagi_inodeok = 1;
+               pag->pagf_metadata = 0;
                xfs_perag_put(pag);
        }
- return xfs_is_inode32(mp) ? maxagi : agcount;
+       return agcount;
 }




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux