#include <unistd.h>
#include <sys/types.h>
#include <linux/lustre/lustre_user.h>
+#include <fcntl.h>
#if defined(__cplusplus)
extern "C" {
int llapi_file_get_lov_uuid(const char *path, struct obd_uuid *lov_uuid);
int llapi_file_get_lmv_uuid(const char *path, struct obd_uuid *lmv_uuid);
int llapi_file_fget_lov_uuid(int fd, struct obd_uuid *lov_uuid);
+int llapi_file_fget_lmv_uuid(int fd, struct obd_uuid *lov_uuid);
int llapi_lov_get_uuids(int fd, struct obd_uuid *uuidp, int *ost_count);
int llapi_lmv_get_uuids(int fd, struct obd_uuid *uuidp, int *mdt_count);
int llapi_is_lustre_mnttype(const char *type);
struct lov_user_md *lum, size_t lumsize);
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,
struct lu_fid *parent_fid, char *name, size_t name_size);
int llapi_root_path_open(const char *device, int *outfd);
int llapi_chomp_string(char *buf);
-struct file_handle;
int llapi_handle_to_fid(struct file_handle **handle, const struct lu_fid *fid);
+int llapi_fid_to_handle(struct file_handle **handle, const struct lu_fid *fid);
int llapi_open_by_fid_at(int lustre_fd, const struct lu_fid *fid,
int open_flags);
int llapi_open_by_fid(const char *lustre_dir, const struct lu_fid *fid,
/* File lease */
int llapi_lease_acquire(int fd, enum ll_lease_mode mode);
+int llapi_lease_release_intent(int fd, struct ll_ioc_lease *data);
int llapi_lease_release(int fd);
int llapi_lease_set(int fd, const struct ll_ioc_lease *data);
int llapi_lease_check(int fd);
off_t pos, size_t count);
off_t llapi_mirror_data_seek(int fd, unsigned int id, off_t pos, size_t *size);
int llapi_mirror_punch(int fd, unsigned int id, off_t start, size_t length);
+bool llapi_mirror_is_sparse(int fd, unsigned int id);
int llapi_heat_get(int fd, struct lu_heat *heat);
int llapi_heat_set(int fd, __u64 flags);
return rc;
}
-int llapi_dir_stripe_limit_check(int stripe_offset, int stripe_count,
- int hash_type)
+static int dir_stripe_limit_check(int stripe_offset, int stripe_count,
+ int hash_type)
{
int rc;
}
/* Check if the stripe pattern is sane. */
- rc = llapi_dir_stripe_limit_check(param->lsp_stripe_offset,
- param->lsp_stripe_count,
- param->lsp_stripe_pattern);
+ rc = dir_stripe_limit_check(param->lsp_stripe_offset,
+ param->lsp_stripe_count,
+ param->lsp_stripe_pattern);
if (rc != 0)
return rc;
llapi_printf(LLAPI_MSG_NORMAL, "\n");
}
-void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
- struct lov_user_ost_data_v1 *objects,
- char *path, int obdindex, int depth,
- enum llapi_layout_verbose verbose,
- enum lov_dump_flags flags)
+static void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
+ struct lov_user_ost_data_v1 *objects,
+ char *path, int obdindex, int depth,
+ enum llapi_layout_verbose verbose,
+ enum lov_dump_flags flags)
{
bool is_dir = flags & LDF_IS_DIR;
bool indent = flags & LDF_INDENT;
llapi_printf(LLAPI_MSG_NORMAL, "\n");
}
-void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
- char *path, int obdindex, int depth,
- enum llapi_layout_verbose verbose,
- enum lov_dump_flags flags)
+static void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
+ char *path, int obdindex, int depth,
+ enum llapi_layout_verbose verbose,
+ enum lov_dump_flags flags)
{
struct lmv_user_mds_data *objects = lum->lum_objects;
char *prefix = lum->lum_magic == LMV_USER_MAGIC ? "(Default)" : "";
return verbose & VERBOSE_COMP_OPTS;
}
-struct lov_user_mds_data *lov_forge_comp_v1(struct lov_user_mds_data *orig,
- bool is_dir)
+static struct lov_user_mds_data *
+lov_forge_comp_v1(struct lov_user_mds_data *orig, bool is_dir)
{
struct lov_user_md *lum = &orig->lmd_lmm;
struct lov_user_mds_data *new;
* as part of the escape sequence (0 for an unrecognized
* escape sequence)
*/
-int printf_format_escape(char *seq, char *buffer, size_t size, int *wrote)
+static int printf_format_escape(char *seq, char *buffer, size_t size,
+ int *wrote)
{
*wrote = 0;
/* For now, only handle single char escape sequences: \n, \t, \\ */
* @return Number of characters from input string processed
* as part of the format (0 for an unknown format)
*/
-
-int printf_format_timestamp(char *seq, char *buffer, size_t size, int *wrote,
- struct find_param *param)
+static int printf_format_timestamp(char *seq, char *buffer, size_t size,
+ int *wrote, struct find_param *param)
{
struct statx_timestamp ts = { 0, 0 };
struct tm *tm;
* @return Number of characters from input string processed
* as part of the format (0 for an unknown format)
*/
-int printf_format_lustre(char *seq, char *buffer, size_t size, int *wrote,
- struct find_param *param, char *path, __u32 projid,
- int d)
+static int printf_format_lustre(char *seq, char *buffer, size_t size,
+ int *wrote, struct find_param *param,
+ char *path, __u32 projid, int d)
{
struct lmv_user_md *lum;
struct lmv_user_mds_data *objects;
* @return Number of characters from input string processed
* as part of the format (0 for an unknown format)
*/
-int printf_format_directive(char *seq, char *buffer, size_t size, int *wrote,
- struct find_param *param, char *path, __u32 projid,
- int d)
+static int printf_format_directive(char *seq, char *buffer, size_t size,
+ int *wrote, struct find_param *param,
+ char *path, __u32 projid, int d)
{
__u16 mode = param->fp_lmd->lmd_stx.stx_mode;
uint64_t blocks = param->fp_lmd->lmd_stx.stx_blocks;
* @param[in] d File descriptor for current directory (or -1 for a
* non-directory file)
*/
-void printf_format_string(struct find_param *param, char *path,
- __u32 projid, int d)
+static void printf_format_string(struct find_param *param, char *path,
+ __u32 projid, int d)
{
char output[FORMATTED_BUF_LEN];
char *fmt_char = param->fp_format_printf_str;
* @return Number of characters examined in the escape sequence
* (regardless of whether the sequence is valid or not).
*/
-int validate_printf_esc(char *c)
+static int validate_printf_esc(char *c)
{
char *valid_esc = "nt\\";
* @return Number of characters examined in the format directive
* (regardless of whether the directive is valid or not).
*/
-int validate_printf_fmt(char *c)
+static int validate_printf_fmt(char *c)
{
char *valid_fmt_single = "abcGkmnpstUwy%";
char *valid_fmt_double = "ACTW";
* @param[in] param Structure containing info about invocation of lfs find
* @return None
*/
-void validate_printf_str(struct find_param *param)
+static void validate_printf_str(struct find_param *param)
{
char *c = param->fp_format_printf_str;
int ret = 0;