Source kernel commit:
c1a55c7bacaa75f4b87dbf3678080448879b170e
Use a single helper to check for the up to give static metatada
inodes. Include the !metadir check in it as metadir file systems
never have them set.
Remove the duplicate check in xrep_orphanage_can_adopt as it already
checks for all metadata inodes directly below.
Remove the xfs_internal_inum wrapper as xfs_is_static_metadata_ino is
much more descriptive for what it does.
Check that an ino is valid before checking it is metadata in all places
that do both.
Signed-off-by: Christoph Hellwig <hch@lst.de>
return xfs_imeta_sb_link(upd);
}
-/* Does this inode number refer to a static metadata inode? */
-bool
-xfs_is_static_meta_ino(
- struct xfs_mount *mp,
- xfs_ino_t ino)
-{
- const struct xfs_imeta_sbmap *p;
-
- if (ino == NULLFSINO)
- return false;
-
- for (p = xfs_imeta_sbmaps; p->path; p++)
- if (ino == *xfs_imeta_sbmap_to_inop(mp, p))
- return true;
-
- return false;
-}
-
/*
* Ensure that the in-core superblock has all the values that it should.
* Caller should pass in an empty transaction to avoid livelocking on btree
int xfs_imeta_unlink(struct xfs_imeta_update *upd);
int xfs_imeta_link(struct xfs_imeta_update *upd);
-bool xfs_is_static_meta_ino(struct xfs_mount *mp, xfs_ino_t ino);
int xfs_imeta_mount(struct xfs_trans *tp);
unsigned int xfs_imeta_create_space_res(struct xfs_mount *mp);
#include "xfs_bit.h"
#include "xfs_mount.h"
#include "xfs_ag.h"
-#include "xfs_imeta.h"
+#include "xfs_inode.h"
#include "xfs_rtbitmap.h"
#include "xfs_rtgroup.h"
return xfs_verify_agno_agino(mp, agno, agino);
}
-/* Is this an internal inode number? */
-inline bool
-xfs_internal_inum(
- struct xfs_mount *mp,
- xfs_ino_t ino)
-{
- return xfs_is_static_meta_ino(mp, ino);
-}
-
/*
* Verify that a directory entry's inode number doesn't point at an internal
* inode, empty space, or static AG metadata.
struct xfs_mount *mp,
xfs_ino_t ino)
{
- if (!xfs_has_metadir(mp) && xfs_internal_inum(mp, ino))
+ if (!xfs_verify_ino(mp, ino))
return false;
- return xfs_verify_ino(mp, ino);
+ if (xfs_is_static_metadata_ino(mp, ino))
+ return false;
+ return true;
}
/*
xfs_fsblock_t len);
bool xfs_verify_ino(struct xfs_mount *mp, xfs_ino_t ino);
-bool xfs_internal_inum(struct xfs_mount *mp, xfs_ino_t ino);
bool xfs_verify_dir_ino(struct xfs_mount *mp, xfs_ino_t ino);
bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
bool xfs_verify_rtbext(struct xfs_mount *mp, xfs_rtblock_t rtbno,