Whamcloud - gitweb
LU-6142 uapi: Get rid of lustre_fid typedef 49/29849/8
authorJames Simmons <uja.ornl@yahoo.com>
Mon, 20 Nov 2017 21:16:52 +0000 (16:16 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 Dec 2017 05:14:47 +0000 (05:14 +0000)
Replace it with struct lu_fid. Update the userland code and man
pages to reflect this change.

Linux-commit: d8f6bc9a53f97d1ea4b2b955672904338643308b

Test-Parameters: trivial

Change-Id: I0b7e0770dd9da9bdac55c02c2ec98aea7cea7100
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: https://review.whamcloud.com/29849
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
18 files changed:
lustre/contrib/wireshark/packet-lustre.c
lustre/doc/llapi_hsm_copytool_register.3
lustre/doc/llapi_layout_get_by_fd.3
lustre/doc/llapi_path2fid.3
lustre/doc/llapi_path2parent.3
lustre/include/lustre/lustreapi.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/mdt/mdt_hsm.c
lustre/tests/llapi_fid_test.c
lustre/tests/llapi_layout_test.c
lustre/tests/multiop.c
lustre/tests/swap_lock_test.c
lustre/utils/lfs.c
lustre/utils/lhsmtool_posix.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_hsm.c
lustre/utils/liblustreapi_layout.c

index f95588a..87b1378 100644 (file)
@@ -8771,7 +8771,7 @@ lustre_dissect_struct_hsm_extent(tvbuff_t *tvb _U_, int offset _U_, packet_info
 }
 
 /* struct hsm_user_item { */
 }
 
 /* struct hsm_user_item { */
-/*        lustre_fid        hui_fid; */
+/*        struct lu_fid        hui_fid; */
 /*        struct hsm_extent hui_extent; */
 /* } __attribute__((packed)); */
 static int
 /*        struct hsm_extent hui_extent; */
 /* } __attribute__((packed)); */
 static int
@@ -8804,7 +8804,7 @@ lustre_dissect_struct_hsm_user_item(tvbuff_t *tvb _U_, int offset _U_, packet_in
 }
 
 /* struct hsm_progress_kernel { */
 }
 
 /* struct hsm_progress_kernel { */
-/*     lustre_fid              hpk_fid; */
+/*     struct lu_fid           hpk_fid; */
 /*     __u64                   hpk_cookie; */
 /*     struct hsm_extent       hpk_extent; */
 /*     __u16                   hpk_flags; */
 /*     __u64                   hpk_cookie; */
 /*     struct hsm_extent       hpk_extent; */
 /*     __u16                   hpk_flags; */
index e4eaa0d..04fe5d6 100644 (file)
@@ -100,8 +100,8 @@ struct hsm_action_list {
 struct hsm_action_item {
     __u32      hai_len;     /* valid size of this struct */
     __u32      hai_action;  /* hsm_copytool_action, but use known size */
 struct hsm_action_item {
     __u32      hai_len;     /* valid size of this struct */
     __u32      hai_action;  /* hsm_copytool_action, but use known size */
-    lustre_fid hai_fid;     /* Lustre FID to operated on */
-    lustre_fid hai_dfid;    /* fid used for data access */
+    struct lu_fid hai_fid;     /* Lustre FID to operated on */
+    struct lu_fid hai_dfid;    /* fid used for data access */
     struct hsm_extent hai_extent;  /* byte range to operate on */
     __u64      hai_cookie;  /* action cookie from coordinator */
     __u64      hai_gid;     /* grouplock id */
     struct hsm_extent hai_extent;  /* byte range to operate on */
     __u64      hai_cookie;  /* action cookie from coordinator */
     __u64      hai_gid;     /* grouplock id */
index a278fc5..ed08d20 100644 (file)
@@ -9,7 +9,7 @@ obtain the layout of a Lustre file
 .BI "struct llapi_layout *llapi_layout_get_by_fd(int "fd ", uint32_t " flags );
 .PP
 .BI "struct llapi_layout *llapi_layout_get_by_fid(const char *"lustre_path ,
 .BI "struct llapi_layout *llapi_layout_get_by_fd(int "fd ", uint32_t " flags );
 .PP
 .BI "struct llapi_layout *llapi_layout_get_by_fid(const char *"lustre_path ,
-.BI "                                             const lustre_fid *"fid ,
+.BI "                                             const struct lu_fid *"fid ,
 .BI "                                             uint32_t " flags );
 .PP
 .BI "struct llapi_layout *llapi_layout_get_by_path(const char *"path ,
 .BI "                                             uint32_t " flags );
 .PP
 .BI "struct llapi_layout *llapi_layout_get_by_path(const char *"path ,
@@ -55,7 +55,7 @@ It is typically the filesystem root, but may also be any path beneath
 the root.  Use the function
 .BR llapi_path2fid (3)
 to obtain a
 the root.  Use the function
 .BR llapi_path2fid (3)
 to obtain a
-.B lustre_fid
+.B struct lu_fid
 associated with a given path.
 .PP
 The function
 associated with a given path.
 .PP
 The function
index 87f0ced..eb077b6 100644 (file)
@@ -5,7 +5,7 @@ llapi_path2fid \- translate a path name to a Lustre FID
 .nf
 .B #include <lustre/lustreapi.h>
 .PP
 .nf
 .B #include <lustre/lustreapi.h>
 .PP
-.BI "int llapi_path2fid(const char *"path ", lustre_fid *"fid );
+.BI "int llapi_path2fid(const char *"path ", struct lu_fid *"fid );
 .fi
 .SH DESCRIPTION
 .PP
 .fi
 .SH DESCRIPTION
 .PP
@@ -18,7 +18,7 @@ into
 The
 .I fid
 may be then be passed to other llapi functions that expect the
 The
 .I fid
 may be then be passed to other llapi functions that expect the
-.B lustre_fid
+.B struct lu_fid
 data type.
 .SH RETURN VALUES
 .LP
 data type.
 .SH RETURN VALUES
 .LP
index d5e8a40..5328206 100644 (file)
@@ -7,11 +7,11 @@ in Lustre.
 .B #include <lustre/lustreapi.h>
 .PP
 .BI "int llapi_path2parent(const char *" path ", unsigned int " linkno ","
 .B #include <lustre/lustreapi.h>
 .PP
 .BI "int llapi_path2parent(const char *" path ", unsigned int " linkno ","
-.BI "                      lustre_fid *" parent_fid ", char *" name ","
+.BI "                      struct lu_fid *" parent_fid ", char *" name ","
 .BI "                      size_t " name_size );
 
 .BI "int llapi_fd2parent(int " fd ", unsigned int " linkno ","
 .BI "                      size_t " name_size );
 
 .BI "int llapi_fd2parent(int " fd ", unsigned int " linkno ","
-.BI "                    lustre_fid *" parent_fid ", char *" name ","
+.BI "                    struct lu_fid *" parent_fid ", char *" name ","
 .BI "                    size_t " name_size );
 .sp
 .fi
 .BI "                    size_t " name_size );
 .sp
 .fi
index 79f2f17..3bae89c 100644 (file)
 #include <stdint.h>
 #include <linux/lustre/lustre_user.h>
 
 #include <stdint.h>
 #include <linux/lustre/lustre_user.h>
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #ifndef LL_MAXQUOTAS
 #define LL_MAXQUOTAS 3
 #endif
 #ifndef LL_MAXQUOTAS
 #define LL_MAXQUOTAS 3
 #endif
@@ -50,6 +54,8 @@
 #define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))
 #endif
 
 #define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))
 #endif
 
+#define lustre_fid struct lu_fid
+
 extern bool liblustreapi_initialized;
 
 
 extern bool liblustreapi_initialized;
 
 
@@ -317,6 +323,7 @@ int llapi_migrate_mdt(char *path, struct find_param *param);
 int llapi_mv(char *path, struct find_param *param);
 
 struct mntent;
 int llapi_mv(char *path, struct find_param *param);
 
 struct mntent;
+
 #define HAVE_LLAPI_IS_LUSTRE_MNT
 int llapi_is_lustre_mnt(struct mntent *mnt);
 int llapi_quotactl(char *mnt, struct if_quotactl *qctl);
 #define HAVE_LLAPI_IS_LUSTRE_MNT
 int llapi_is_lustre_mnt(struct mntent *mnt);
 int llapi_quotactl(char *mnt, struct if_quotactl *qctl);
@@ -327,17 +334,18 @@ int llapi_cp(int argc, char *argv[]);
 int llapi_ls(int argc, char *argv[]);
 int llapi_fid2path(const char *device, const char *fidstr, char *path,
                   int pathlen, long long *recno, int *linkno);
 int llapi_ls(int argc, char *argv[]);
 int llapi_fid2path(const char *device, const char *fidstr, char *path,
                   int pathlen, long long *recno, int *linkno);
-int llapi_path2fid(const char *path, lustre_fid *fid);
-int llapi_get_mdt_index_by_fid(int fd, const lustre_fid *fid, int *mdt_index);
-int llapi_fd2fid(int fd, lustre_fid *fid);
+int llapi_path2fid(const char *path, struct lu_fid *fid);
+int llapi_get_mdt_index_by_fid(int fd, const struct lu_fid *fid,
+                              int *mdt_index);
+int llapi_fd2fid(int fd, struct lu_fid *fid);
 /* get FID of parent dir + the related name of entry in this parent dir */
 int llapi_path2parent(const char *path, unsigned int linkno,
 /* get FID of parent dir + the related name of entry in this parent dir */
 int llapi_path2parent(const char *path, unsigned int linkno,
-                     lustre_fid *parent_fid, char *name, size_t name_size);
-int llapi_fd2parent(int fd, unsigned int linkno, lustre_fid *parent_fid,
+                     struct lu_fid *parent_fid, char *name, size_t name_size);
+int llapi_fd2parent(int fd, unsigned int linkno, struct lu_fid *parent_fid,
                    char *name, size_t name_size);
 int llapi_chomp_string(char *buf);
                    char *name, size_t name_size);
 int llapi_chomp_string(char *buf);
-int llapi_open_by_fid(const char *dir, const lustre_fid *fid, int open_flags);
-
+int llapi_open_by_fid(const char *dir, const struct lu_fid *fid,
+                     int open_flags);
 int llapi_get_version_string(char *version, unsigned int version_size);
 /* llapi_get_version() is deprecated, use llapi_get_version_string() instead */
 int llapi_get_version(char *buffer, int buffer_size, char **version)
 int llapi_get_version_string(char *version, unsigned int version_size);
 /* llapi_get_version() is deprecated, use llapi_get_version_string() instead */
 int llapi_get_version(char *buffer, int buffer_size, char **version)
@@ -411,12 +419,12 @@ int llapi_hsm_action_progress(struct hsm_copyaction_private *hcp,
                              const struct hsm_extent *he, __u64 total,
                              int hp_flags);
 int llapi_hsm_action_get_dfid(const struct hsm_copyaction_private *hcp,
                              const struct hsm_extent *he, __u64 total,
                              int hp_flags);
 int llapi_hsm_action_get_dfid(const struct hsm_copyaction_private *hcp,
-                             lustre_fid *fid);
+                             struct lu_fid *fid);
 int llapi_hsm_action_get_fd(const struct hsm_copyaction_private *hcp);
 int llapi_hsm_import(const char *dst, int archive, const struct stat *st,
                     unsigned long long stripe_size, int stripe_offset,
                     int stripe_count, int stripe_pattern, char *pool_name,
 int llapi_hsm_action_get_fd(const struct hsm_copyaction_private *hcp);
 int llapi_hsm_import(const char *dst, int archive, const struct stat *st,
                     unsigned long long stripe_size, int stripe_offset,
                     int stripe_count, int stripe_pattern, char *pool_name,
-                    lustre_fid *newfid);
+                    struct lu_fid *newfid);
 
 /* HSM user interface */
 struct hsm_user_request *llapi_hsm_user_request_alloc(int itemcount,
 
 /* HSM user interface */
 struct hsm_user_request *llapi_hsm_user_request_alloc(int itemcount,
@@ -485,7 +493,7 @@ struct llapi_layout *llapi_layout_get_by_fd(int fd, uint32_t flags);
  * stored in errno.
  */
 struct llapi_layout *llapi_layout_get_by_fid(const char *path,
  * stored in errno.
  */
 struct llapi_layout *llapi_layout_get_by_fid(const char *path,
-                                            const lustre_fid *fid,
+                                            const struct lu_fid *fid,
                                             uint32_t flags);
 
 /**
                                             uint32_t flags);
 
 /**
@@ -813,4 +821,8 @@ bool llapi_layout_is_composite(struct llapi_layout *layout);
 
 /** @} llapi */
 
 
 /** @} llapi */
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif
 #endif
index 9635941..aec644d 100644 (file)
 # include <linux/lustre/lustre_ver.h>
 #endif
 
 # include <linux/lustre/lustre_ver.h>
 #endif
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  *  GENERAL STUFF
  */
 /*
  *  GENERAL STUFF
  */
@@ -3221,7 +3225,7 @@ struct layout_intent {
  */
 struct hsm_progress_kernel {
        /* Field taken from struct hsm_progress */
  */
 struct hsm_progress_kernel {
        /* Field taken from struct hsm_progress */
-       lustre_fid              hpk_fid;
+       struct lu_fid           hpk_fid;
        __u64                   hpk_cookie;
        struct hsm_extent       hpk_extent;
        __u16                   hpk_flags;
        __u64                   hpk_cookie;
        struct hsm_extent       hpk_extent;
        __u16                   hpk_flags;
@@ -3510,5 +3514,9 @@ struct ladvise_hdr {
        struct lu_ladvise       lah_advise[0];  /* advices in this header */
 };
 
        struct lu_ladvise       lah_advise[0];  /* advices in this header */
 };
 
+#if defined(__cplusplus)
+}
+#endif
+
 #endif
 /** @} lustreidl */
 #endif
 /** @} lustreidl */
index a0c38c1..a406dd4 100644 (file)
 # include <linux/lustre/lustre_fiemap.h>
 #endif /* __KERNEL__ */
 
 # include <linux/lustre/lustre_fiemap.h>
 #endif /* __KERNEL__ */
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /*
  * This is a temporary solution of adding quota type.
  * Should be removed as soon as system header is updated.
 /*
  * This is a temporary solution of adding quota type.
  * Should be removed as soon as system header is updated.
@@ -198,7 +202,7 @@ struct filter_fid {
 /* Userspace should treat lu_fid as opaque, and only use the following methods
  * to print or parse them.  Other functions (e.g. compare, swab) could be moved
  * here from lustre_idl.h if needed. */
 /* Userspace should treat lu_fid as opaque, and only use the following methods
  * to print or parse them.  Other functions (e.g. compare, swab) could be moved
  * here from lustre_idl.h if needed. */
-typedef struct lu_fid lustre_fid;
+struct lu_fid;
 
 enum lma_compat {
        LMAC_HSM         = 0x00000001,
 
 enum lma_compat {
        LMAC_HSM         = 0x00000001,
@@ -1033,16 +1037,16 @@ struct changelog_rec {
        __u64                   cr_prev;  /**< last index for this target fid */
        __u64                   cr_time;
        union {
        __u64                   cr_prev;  /**< last index for this target fid */
        __u64                   cr_time;
        union {
-               lustre_fid      cr_tfid;        /**< target fid */
+               struct lu_fid   cr_tfid;        /**< target fid */
                __u32           cr_markerflags; /**< CL_MARK flags */
        };
                __u32           cr_markerflags; /**< CL_MARK flags */
        };
-       lustre_fid              cr_pfid;        /**< parent fid */
+       struct lu_fid           cr_pfid;        /**< parent fid */
 };
 
 /* Changelog extension for RENAME. */
 struct changelog_ext_rename {
 };
 
 /* Changelog extension for RENAME. */
 struct changelog_ext_rename {
-       lustre_fid              cr_sfid;     /**< source fid, or zero */
-       lustre_fid              cr_spfid;    /**< source parent fid, or zero */
+       struct lu_fid           cr_sfid;     /**< source fid, or zero */
+       struct lu_fid           cr_spfid;    /**< source parent fid, or zero */
 };
 
 /* Changelog extension to include JOBID. */
 };
 
 /* Changelog extension to include JOBID. */
@@ -1327,7 +1331,7 @@ struct hsm_request {
 };
 
 struct hsm_user_item {
 };
 
 struct hsm_user_item {
-       lustre_fid        hui_fid;
+       struct lu_fid        hui_fid;
        struct hsm_extent hui_extent;
 } __attribute__((packed));
 
        struct hsm_extent hui_extent;
 } __attribute__((packed));
 
@@ -1397,8 +1401,8 @@ static inline const char *hsm_copytool_action2name(enum hsm_copytool_action  a)
 struct hsm_action_item {
        __u32      hai_len;     /* valid size of this struct */
        __u32      hai_action;  /* hsm_copytool_action, but use known size */
 struct hsm_action_item {
        __u32      hai_len;     /* valid size of this struct */
        __u32      hai_action;  /* hsm_copytool_action, but use known size */
-       lustre_fid hai_fid;     /* Lustre FID to operate on */
-       lustre_fid hai_dfid;    /* fid used for data access */
+       struct lu_fid hai_fid;     /* Lustre FID to operate on */
+       struct lu_fid hai_dfid;    /* fid used for data access */
        struct hsm_extent hai_extent;  /* byte range to operate on */
        __u64      hai_cookie;  /* action cookie from coordinator */
        __u64      hai_gid;     /* grouplock id */
        struct hsm_extent hai_extent;  /* byte range to operate on */
        __u64      hai_cookie;  /* action cookie from coordinator */
        __u64      hai_gid;     /* grouplock id */
@@ -1508,7 +1512,7 @@ struct hsm_user_import {
 #define HP_FLAG_RETRY     0x02
 
 struct hsm_progress {
 #define HP_FLAG_RETRY     0x02
 
 struct hsm_progress {
-       lustre_fid              hp_fid;
+       struct lu_fid           hp_fid;
        __u64                   hp_cookie;
        struct hsm_extent       hp_extent;
        __u16                   hp_flags;
        __u64                   hp_cookie;
        struct hsm_extent       hp_extent;
        __u16                   hp_flags;
@@ -1653,6 +1657,10 @@ enum lockahead_results {
        LLA_RESULT_SAME,
 };
 
        LLA_RESULT_SAME,
 };
 
+#if defined(__cplusplus)
+}
+#endif
+
 /** @} lustreuser */
 
 #endif /* _LUSTRE_USER_H */
 /** @} lustreuser */
 
 #endif /* _LUSTRE_USER_H */
index b4ab8ac..9041d5f 100644 (file)
@@ -462,7 +462,7 @@ out:
 }
 
 /* Return true if a FID is present in an action list. */
 }
 
 /* Return true if a FID is present in an action list. */
-static bool is_fid_in_hal(struct hsm_action_list *hal, const lustre_fid *fid)
+static bool is_fid_in_hal(struct hsm_action_list *hal, const struct lu_fid *fid)
 {
        struct hsm_action_item *hai;
        int i;
 {
        struct hsm_action_item *hai;
        int i;
index ba8cd1e..be3866c 100644 (file)
@@ -99,9 +99,9 @@ static void cleanup(void)
  * file/directory */
 static void helper_fid2path(const char *filename, int fd)
 {
  * file/directory */
 static void helper_fid2path(const char *filename, int fd)
 {
-       lustre_fid fid;
-       lustre_fid fid2;
-       lustre_fid fid3;
+       struct lu_fid fid;
+       struct lu_fid fid2;
+       struct lu_fid fid3;
        char fidstr[FID_LEN + 1];
        char path1[PATH_MAX];
        char path2[PATH_MAX];
        char fidstr[FID_LEN + 1];
        char path1[PATH_MAX];
        char path2[PATH_MAX];
@@ -237,7 +237,7 @@ static void test11(void)
 {
        int rc;
        int fd;
 {
        int rc;
        int fd;
-       lustre_fid fid;
+       struct lu_fid fid;
        char fidstr[FID_LEN + 1];
        char path[PATH_MAX];
        long long recno;
        char fidstr[FID_LEN + 1];
        char path[PATH_MAX];
        long long recno;
@@ -273,7 +273,7 @@ static void test12(void)
        int fd;
        int fd2;
        int fd3;
        int fd;
        int fd2;
        int fd3;
-       lustre_fid fid;
+       struct lu_fid fid;
 
        /* Against a volatile file */
        rc = mkdir(mainpath, 0);
 
        /* Against a volatile file */
        rc = mkdir(mainpath, 0);
@@ -367,7 +367,7 @@ static void test30(void)
        } links[num_links];
        char buf[PATH_MAX];
        char buf2[PATH_MAX];
        } links[num_links];
        char buf[PATH_MAX];
        char buf2[PATH_MAX];
-       lustre_fid fid;
+       struct lu_fid fid;
        char fidstr[FID_LEN + 1];
        int rc;
        int i;
        char fidstr[FID_LEN + 1];
        int rc;
        int i;
@@ -473,8 +473,8 @@ static void test30(void)
  * type). mainpath must exist. */
 static void help_test40(void)
 {
  * type). mainpath must exist. */
 static void help_test40(void)
 {
-       lustre_fid parent_fid;
-       lustre_fid fid2;
+       struct lu_fid parent_fid;
+       struct lu_fid fid2;
        char buf[PATH_MAX];
        int rc;
 
        char buf[PATH_MAX];
        int rc;
 
@@ -571,7 +571,7 @@ static void test42(void)
        const int num_links = 100;
        struct {
                char subdir[PATH_MAX];
        const int num_links = 100;
        struct {
                char subdir[PATH_MAX];
-               lustre_fid subdir_fid;
+               struct lu_fid subdir_fid;
                char filename[PATH_MAX];
                bool seen;
        } links[num_links];
                char filename[PATH_MAX];
                bool seen;
        } links[num_links];
@@ -581,7 +581,7 @@ static void test42(void)
        int i;
        int fd;
        int linkno;
        int i;
        int fd;
        int linkno;
-       lustre_fid parent_fid;
+       struct lu_fid parent_fid;
 
        /* Create the containing directory. */
        rc = mkdir(mainpath, 0);
 
        /* Create the containing directory. */
        rc = mkdir(mainpath, 0);
index d5258a9..603cdb2 100644 (file)
@@ -200,7 +200,7 @@ void test3(void)
 {
        int rc;
        struct llapi_layout *layout;
 {
        int rc;
        struct llapi_layout *layout;
-       lustre_fid fid;
+       struct lu_fid fid;
        char fidstr[4096];
        char path[PATH_MAX];
 
        char fidstr[4096];
        char path[PATH_MAX];
 
index 7d284f9..90dd413 100644 (file)
@@ -216,7 +216,7 @@ int main(int argc, char **argv)
        int                      save_errno;
        int                      verbose = 0;
        int                      gid = 0;
        int                      save_errno;
        int                      verbose = 0;
        int                      gid = 0;
-       lustre_fid               fid;
+       struct lu_fid            fid;
        struct timespec          ts;
        struct lov_user_md_v3    lum;
        __u64                    dv;
        struct timespec          ts;
        struct lov_user_md_v3    lum;
        __u64                    dv;
index 2bd3e2f..91dee2e 100644 (file)
@@ -548,7 +548,7 @@ static void test16(void)
        int rc;
        char *filename;
        int fd;
        int rc;
        char *filename;
        int fd;
-       lustre_fid fid;
+       struct lu_fid fid;
 
        rc = mkdir(mainpath, 0);
        ASSERTF(rc == 0, "mkdir failed for '%s': %s",
 
        rc = mkdir(mainpath, 0);
        ASSERTF(rc == 0, "mkdir failed for '%s': %s",
index 167bc53..8068cb0 100644 (file)
@@ -4670,7 +4670,7 @@ static int lfs_path2fid(int argc, char **argv)
        char            **path;
        const char        short_opts[] = "p";
        const char       *sep = "";
        char            **path;
        const char        short_opts[] = "p";
        const char       *sep = "";
-       lustre_fid        fid;
+       struct lu_fid     fid;
        int               rc = 0;
        bool              show_parents = false;
 
        int               rc = 0;
        bool              show_parents = false;
 
index 804dbe7..28e3c49 100644 (file)
@@ -794,14 +794,14 @@ static int ct_copy_xattr(const char *src, const char *dst, int src_fd,
 }
 
 static int ct_path_lustre(char *buf, int sz, const char *mnt,
 }
 
 static int ct_path_lustre(char *buf, int sz, const char *mnt,
-                         const lustre_fid *fid)
+                         const struct lu_fid *fid)
 {
        return snprintf(buf, sz, "%s/%s/fid/"DFID_NOBRACE, mnt,
                        dot_lustre_name, PFID(fid));
 }
 
 static int ct_path_archive(char *buf, int sz, const char *archive_dir,
 {
        return snprintf(buf, sz, "%s/%s/fid/"DFID_NOBRACE, mnt,
                        dot_lustre_name, PFID(fid));
 }
 
 static int ct_path_archive(char *buf, int sz, const char *archive_dir,
-                          const lustre_fid *fid)
+                          const struct lu_fid *fid)
 {
        return snprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/"
                        DFID_NOBRACE, archive_dir,
 {
        return snprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/"
                        DFID_NOBRACE, archive_dir,
@@ -1396,7 +1396,7 @@ static int ct_process_item_async(const struct hsm_action_item *hai,
 static int ct_import_one(const char *src, const char *dst)
 {
        char            newarc[PATH_MAX];
 static int ct_import_one(const char *src, const char *dst)
 {
        char            newarc[PATH_MAX];
-       lustre_fid      fid;
+       struct lu_fid   fid;
        struct stat     st;
        int             rc;
 
        struct stat     st;
        int             rc;
 
@@ -1454,7 +1454,7 @@ static char *path_concat(const char *dirname, const char *basename)
        return result;
 }
 
        return result;
 }
 
-static int ct_import_fid(const lustre_fid *import_fid)
+static int ct_import_fid(const struct lu_fid *import_fid)
 {
        char    fid_path[PATH_MAX];
        int     rc;
 {
        char    fid_path[PATH_MAX];
        int     rc;
@@ -1480,7 +1480,7 @@ static int ct_import_recurse(const char *relpath)
        DIR             *dir;
        struct dirent   *ent;
        char            *srcpath, *newpath;
        DIR             *dir;
        struct dirent   *ent;
        char            *srcpath, *newpath;
-       lustre_fid       import_fid;
+       struct lu_fid    import_fid;
        int              rc;
 
        if (relpath == NULL)
        int              rc;
 
        if (relpath == NULL)
@@ -1563,7 +1563,8 @@ out:
        return rc;
 }
 
        return rc;
 }
 
-static int ct_rebind_one(const lustre_fid *old_fid, const lustre_fid *new_fid)
+static int ct_rebind_one(const struct lu_fid *old_fid,
+                        const struct lu_fid *new_fid)
 {
        char    src[PATH_MAX];
        char    dst[PATH_MAX];
 {
        char    src[PATH_MAX];
        char    dst[PATH_MAX];
@@ -1591,7 +1592,7 @@ static int ct_rebind_one(const lustre_fid *old_fid, const lustre_fid *new_fid)
        return 0;
 }
 
        return 0;
 }
 
-static bool fid_is_file(lustre_fid *fid)
+static bool fid_is_file(struct lu_fid *fid)
 {
        return fid_is_norm(fid) || fid_is_igif(fid);
 }
 {
        return fid_is_norm(fid) || fid_is_igif(fid);
 }
@@ -1631,8 +1632,8 @@ static int ct_rebind_list(const char *list)
 
        /* each line consists of 2 FID */
        while ((r = getline(&line, &line_size, filp)) != -1) {
 
        /* each line consists of 2 FID */
        while ((r = getline(&line, &line_size, filp)) != -1) {
-               lustre_fid      old_fid;
-               lustre_fid      new_fid;
+               struct lu_fid   old_fid;
+               struct lu_fid   new_fid;
 
                /* Ignore empty and commented out ('#...') lines. */
                if (should_ignore_line(line))
 
                /* Ignore empty and commented out ('#...') lines. */
                if (should_ignore_line(line))
@@ -1672,8 +1673,8 @@ static int ct_rebind(void)
        int     rc;
 
        if (opt.o_dst) {
        int     rc;
 
        if (opt.o_dst) {
-               lustre_fid      old_fid;
-               lustre_fid      new_fid;
+               struct lu_fid old_fid;
+               struct lu_fid new_fid;
 
                if (sscanf(opt.o_src, SFID, RFID(&old_fid)) != 3 ||
                    !fid_is_file(&old_fid)) {
 
                if (sscanf(opt.o_src, SFID, RFID(&old_fid)) != 3 ||
                    !fid_is_file(&old_fid)) {
index d3c5e7f..57e2519 100644 (file)
@@ -4604,7 +4604,7 @@ out_free:
        return rc;
 }
 
        return rc;
 }
 
-static int fid_from_lma(const char *path, int fd, lustre_fid *fid)
+static int fid_from_lma(const char *path, int fd, struct lu_fid *fid)
 {
        char                     buf[512];
        struct lustre_mdt_attrs *lma;
 {
        char                     buf[512];
        struct lustre_mdt_attrs *lma;
@@ -4621,7 +4621,7 @@ static int fid_from_lma(const char *path, int fd, lustre_fid *fid)
        return 0;
 }
 
        return 0;
 }
 
-int llapi_get_mdt_index_by_fid(int fd, const lustre_fid *fid,
+int llapi_get_mdt_index_by_fid(int fd, const struct lu_fid *fid,
                               int *mdt_index)
 {
        int     rc;
                               int *mdt_index)
 {
        int     rc;
@@ -4635,7 +4635,7 @@ int llapi_get_mdt_index_by_fid(int fd, const lustre_fid *fid,
        return rc;
 }
 
        return rc;
 }
 
-int llapi_fd2fid(int fd, lustre_fid *fid)
+int llapi_fd2fid(int fd, struct lu_fid *fid)
 {
        int rc;
 
 {
        int rc;
 
@@ -4648,7 +4648,7 @@ int llapi_fd2fid(int fd, lustre_fid *fid)
        return rc;
 }
 
        return rc;
 }
 
-int llapi_path2fid(const char *path, lustre_fid *fid)
+int llapi_path2fid(const char *path, struct lu_fid *fid)
 {
        int fd, rc;
 
 {
        int fd, rc;
 
@@ -4668,7 +4668,7 @@ int llapi_path2fid(const char *path, lustre_fid *fid)
        return rc;
 }
 
        return rc;
 }
 
-int llapi_fd2parent(int fd, unsigned int linkno, lustre_fid *parent_fid,
+int llapi_fd2parent(int fd, unsigned int linkno, struct lu_fid *parent_fid,
                    char *name, size_t name_size)
 {
        struct getparent        *gp;
                    char *name, size_t name_size)
 {
        struct getparent        *gp;
@@ -4698,7 +4698,7 @@ err_free:
 }
 
 int llapi_path2parent(const char *path, unsigned int linkno,
 }
 
 int llapi_path2parent(const char *path, unsigned int linkno,
-                     lustre_fid *parent_fid, char *name, size_t name_size)
+                     struct lu_fid *parent_fid, char *name, size_t name_size)
 {
        int     fd;
        int     rc;
 {
        int     fd;
        int     rc;
@@ -4969,7 +4969,8 @@ out:
  * \retval                     non-negative file descriptor on successful open
  * \retval                     -1 if an error occurred
  */
  * \retval                     non-negative file descriptor on successful open
  * \retval                     -1 if an error occurred
  */
-int llapi_open_by_fid(const char *lustre_dir, const lustre_fid *fid, int flags)
+int llapi_open_by_fid(const char *lustre_dir, const struct lu_fid *fid,
+                     int flags)
 {
        char mntdir[PATH_MAX];
        char path[PATH_MAX];
 {
        char mntdir[PATH_MAX];
        char path[PATH_MAX];
index ed3511f..486be87 100644 (file)
@@ -933,7 +933,7 @@ out_err:
  * \param parent_len Destination buffer size.
  * \return 0 on success.
  */
  * \param parent_len Destination buffer size.
  * \return 0 on success.
  */
-static int fid_parent(const char *mnt, const lustre_fid *fid, char *parent,
+static int fid_parent(const char *mnt, const struct lu_fid *fid, char *parent,
                      size_t parent_len)
 {
        int              rc;
                      size_t parent_len)
 {
        int              rc;
@@ -1280,7 +1280,7 @@ int llapi_hsm_action_progress(struct hsm_copyaction_private *hcp,
  * @return error code if the action is not a copy operation.
  */
 int llapi_hsm_action_get_dfid(const struct hsm_copyaction_private *hcp,
  * @return error code if the action is not a copy operation.
  */
 int llapi_hsm_action_get_dfid(const struct hsm_copyaction_private *hcp,
-                             lustre_fid *fid)
+                             struct lu_fid *fid)
 {
        const struct hsm_action_item    *hai = &hcp->copy.hc_hai;
 
 {
        const struct hsm_action_item    *hai = &hcp->copy.hc_hai;
 
@@ -1337,7 +1337,7 @@ int llapi_hsm_action_get_fd(const struct hsm_copyaction_private *hcp)
 int llapi_hsm_import(const char *dst, int archive, const struct stat *st,
                     unsigned long long stripe_size, int stripe_offset,
                     int stripe_count, int stripe_pattern, char *pool_name,
 int llapi_hsm_import(const char *dst, int archive, const struct stat *st,
                     unsigned long long stripe_size, int stripe_offset,
                     int stripe_count, int stripe_pattern, char *pool_name,
-                    lustre_fid *newfid)
+                    struct lu_fid *newfid)
 {
        struct hsm_user_import   hui;
        int                      fd;
 {
        struct hsm_user_import   hui;
        int                      fd;
index f6e477c..b0cbcd7 100644 (file)
@@ -1012,7 +1012,7 @@ struct llapi_layout *llapi_layout_get_by_path(const char *path, uint32_t flags)
  * \retval     NULL if an error occurs
  */
 struct llapi_layout *llapi_layout_get_by_fid(const char *lustre_dir,
  * \retval     NULL if an error occurs
  */
 struct llapi_layout *llapi_layout_get_by_fid(const char *lustre_dir,
-                                            const lustre_fid *fid,
+                                            const struct lu_fid *fid,
                                             uint32_t flags)
 {
        int fd;
                                             uint32_t flags)
 {
        int fd;