Whamcloud - gitweb
LU-17848 osd: move fid_is_fs_root() to lustre_fid.h 43/57743/3
authorTimothy Day <timday@amazon.com>
Tue, 14 Jan 2025 04:45:18 +0000 (23:45 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Feb 2025 01:27:48 +0000 (01:27 +0000)
Move the duplicate fid_is_fs_root() functions to the
lustre_fid.h header.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I43d914dc28cf653deb0fa48228877c9dae503383
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57743
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/include/lustre_fid.h
lustre/osd-ldiskfs/osd_oi.c
lustre/osd-zfs/osd_oi.c

index 8a9b9db..d24fab9 100644 (file)
@@ -278,6 +278,12 @@ static inline int fid_seq_in_fldb(u64 seq)
               fid_seq_is_root(seq) || fid_seq_is_dot(seq);
 }
 
+static inline int fid_is_fs_root(const struct lu_fid *fid)
+{
+       return (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE &&
+                        fid_oid(fid) == OSD_FS_ROOT_OID));
+}
+
 #ifdef HAVE_SERVER_SUPPORT
 static inline int fid_is_namespace_visible(const struct lu_fid *fid)
 {
index fa05cac..d880828 100644 (file)
@@ -506,13 +506,6 @@ void osd_oi_fini(struct osd_thread_info *info, struct osd_device *osd)
        osd->od_oi_table = NULL;
 }
 
-static inline int fid_is_fs_root(const struct lu_fid *fid)
-{
-       /* Map root inode to special local object FID */
-       return (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE &&
-                        fid_oid(fid) == OSD_FS_ROOT_OID));
-}
-
 static int osd_oi_iam_lookup(struct osd_thread_info *oti,
                             struct osd_oi *oi, struct dt_rec *rec,
                             const struct dt_key *key)
index 9e4fa8b..bfd8e3d 100644 (file)
@@ -632,13 +632,6 @@ uint64_t osd_get_name_n_idx(const struct lu_env *env, struct osd_device *osd,
        return zapid;
 }
 
-static inline int fid_is_fs_root(const struct lu_fid *fid)
-{
-       /* Map root inode to special local object FID */
-       return fid_seq(fid) == FID_SEQ_LOCAL_FILE &&
-               fid_oid(fid) == OSD_FS_ROOT_OID;
-}
-
 int osd_fid_lookup(const struct lu_env *env, struct osd_device *dev,
                   const struct lu_fid *fid, uint64_t *oid)
 {