diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_imeta.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_imeta.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/fs/xfs/libxfs/xfs_imeta.c b/fs/xfs/libxfs/xfs_imeta.c index 71b5cf4872cf..9d7cf5dfb337 100644 --- a/fs/xfs/libxfs/xfs_imeta.c +++ b/fs/xfs/libxfs/xfs_imeta.c @@ -47,26 +47,17 @@ */ /* Static metadata inode paths */ - -const struct xfs_imeta_path XFS_IMETA_RTBITMAP = { - .bogus = 0, -}; - -const struct xfs_imeta_path XFS_IMETA_RTSUMMARY = { - .bogus = 1, -}; - -const struct xfs_imeta_path XFS_IMETA_USRQUOTA = { - .bogus = 2, -}; - -const struct xfs_imeta_path XFS_IMETA_GRPQUOTA = { - .bogus = 3, -}; - -const struct xfs_imeta_path XFS_IMETA_PRJQUOTA = { - .bogus = 4, -}; +static const char *rtbitmap_path[] = {"realtime", "0.bitmap"}; +static const char *rtsummary_path[] = {"realtime", "0.summary"}; +static const char *usrquota_path[] = {"quota", "user"}; +static const char *grpquota_path[] = {"quota", "group"}; +static const char *prjquota_path[] = {"quota", "project"}; + +XFS_IMETA_DEFINE_PATH(XFS_IMETA_RTBITMAP, rtbitmap_path); +XFS_IMETA_DEFINE_PATH(XFS_IMETA_RTSUMMARY, rtsummary_path); +XFS_IMETA_DEFINE_PATH(XFS_IMETA_USRQUOTA, usrquota_path); +XFS_IMETA_DEFINE_PATH(XFS_IMETA_GRPQUOTA, grpquota_path); +XFS_IMETA_DEFINE_PATH(XFS_IMETA_PRJQUOTA, prjquota_path); /* Are these two paths equal? */ STATIC bool @@ -74,7 +65,20 @@ xfs_imeta_path_compare( const struct xfs_imeta_path *a, const struct xfs_imeta_path *b) { - return a == b; + unsigned int i; + + if (a == b) + return true; + + if (a->im_depth != b->im_depth) + return false; + + for (i = 0; i < a->im_depth; i++) + if (a->im_path[i] != b->im_path[i] && + strcmp(a->im_path[i], b->im_path[i])) + return false; + + return true; } /* Is this path ok? */ @@ -82,7 +86,7 @@ static inline bool xfs_imeta_path_check( const struct xfs_imeta_path *path) { - return true; + return path->im_depth <= XFS_IMETA_MAX_DEPTH; } /* Functions for storing and retrieving superblock inode values. */ |