}
/* struct hsm_user_item { */
-/* lustre_fid hui_fid; */
+/* struct lu_fid hui_fid; */
/* struct hsm_extent hui_extent; */
/* } __attribute__((packed)); */
static int
}
/* struct hsm_progress_kernel { */
-/* lustre_fid hpk_fid; */
+/* struct lu_fid hpk_fid; */
/* __u64 hpk_cookie; */
/* struct hsm_extent hpk_extent; */
/* __u16 hpk_flags; */
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 */
.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 ,
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
.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
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
.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 " lustre_fid *" parent_fid ", char *" name ","
+.BI " struct lu_fid *" parent_fid ", char *" name ","
.BI " size_t " name_size );
.sp
.fi
#include <stdint.h>
#include <linux/lustre/lustre_user.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#ifndef LL_MAXQUOTAS
#define LL_MAXQUOTAS 3
#endif
#define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))
#endif
+#define lustre_fid struct lu_fid
+
extern bool liblustreapi_initialized;
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);
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,
- 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);
-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)
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,
- lustre_fid *newfid);
+ struct lu_fid *newfid);
/* HSM user interface */
struct hsm_user_request *llapi_hsm_user_request_alloc(int itemcount,
* 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);
/**
/** @} llapi */
+#if defined(__cplusplus)
+}
+#endif
+
#endif
# include <linux/lustre/lustre_ver.h>
#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* GENERAL STUFF
*/
*/
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;
struct lu_ladvise lah_advise[0]; /* advices in this header */
};
+#if defined(__cplusplus)
+}
+#endif
+
#endif
/** @} lustreidl */
# 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.
/* 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,
__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 */
};
- lustre_fid cr_pfid; /**< parent fid */
+ struct lu_fid cr_pfid; /**< parent fid */
};
/* 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. */
};
struct hsm_user_item {
- lustre_fid hui_fid;
+ struct lu_fid hui_fid;
struct hsm_extent hui_extent;
} __attribute__((packed));
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 */
#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;
LLA_RESULT_SAME,
};
+#if defined(__cplusplus)
+}
+#endif
+
/** @} lustreuser */
#endif /* _LUSTRE_USER_H */
}
/* 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;
* 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];
{
int rc;
int fd;
- lustre_fid fid;
+ struct lu_fid fid;
char fidstr[FID_LEN + 1];
char path[PATH_MAX];
long long recno;
int fd;
int fd2;
int fd3;
- lustre_fid fid;
+ struct lu_fid fid;
/* Against a volatile file */
rc = mkdir(mainpath, 0);
} 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;
* 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;
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];
int i;
int fd;
int linkno;
- lustre_fid parent_fid;
+ struct lu_fid parent_fid;
/* Create the containing directory. */
rc = mkdir(mainpath, 0);
{
int rc;
struct llapi_layout *layout;
- lustre_fid fid;
+ struct lu_fid fid;
char fidstr[4096];
char path[PATH_MAX];
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;
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",
char **path;
const char short_opts[] = "p";
const char *sep = "";
- lustre_fid fid;
+ struct lu_fid fid;
int rc = 0;
bool show_parents = false;
}
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,
- const lustre_fid *fid)
+ const struct lu_fid *fid)
{
return snprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/"
DFID_NOBRACE, archive_dir,
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;
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;
DIR *dir;
struct dirent *ent;
char *srcpath, *newpath;
- lustre_fid import_fid;
+ struct lu_fid import_fid;
int rc;
if (relpath == NULL)
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];
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);
}
/* 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))
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)) {
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;
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;
return rc;
}
-int llapi_fd2fid(int fd, lustre_fid *fid)
+int llapi_fd2fid(int fd, struct lu_fid *fid)
{
int 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;
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;
}
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;
* \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];
* \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;
* @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;
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;
* \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;