X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flustreapi_internal.h;h=c0662b4056e7e452407db26f6a9ea4a28b7aa9be;hb=0f670d1ca9dd5af697bfbf3b95a301c61a8b4447;hp=8497ca9e73d7f0af8b0e511e0a0972d88a915152;hpb=ccabce23bd9e366c345c852f565766a799f61238;p=fs%2Flustre-release.git diff --git a/lustre/utils/lustreapi_internal.h b/lustre/utils/lustreapi_internal.h index 8497ca9..c0662b4 100644 --- a/lustre/utils/lustreapi_internal.h +++ b/lustre/utils/lustreapi_internal.h @@ -59,8 +59,8 @@ int get_root_path(int want, char *fsname, int *outfd, char *path, int index); int root_ioctl(const char *mdtname, int opc, void *data, int *mdtidxp, int want_error); -int obd_ioctl_pack(struct obd_ioctl_data *data, char **pbuf, int max_len); -int obd_ioctl_unpack(struct obd_ioctl_data *data, char *pbuf, int max_len); +int llapi_ioctl_pack(struct obd_ioctl_data *data, char **pbuf, int max_len); +int llapi_ioctl_unpack(struct obd_ioctl_data *data, char *pbuf, int max_len); int sattr_cache_get_defaults(const char *const fsname, const char *const pathname, unsigned int *scount, unsigned int *ssize, unsigned int *soffset); @@ -144,7 +144,9 @@ static inline bool llapi_dir_stripe_index_is_valid(int64_t index) static inline bool llapi_dir_hash_type_is_valid(int64_t hash) { - return hash > LMV_HASH_TYPE_UNKNOWN && hash < LMV_HASH_TYPE_MAX; + int64_t _hash = hash & LMV_HASH_TYPE_MASK; + + return _hash > LMV_HASH_TYPE_UNKNOWN && _hash < LMV_HASH_TYPE_MAX; } /* @@ -155,4 +157,12 @@ int libcfs_ukuc_stop(struct lustre_kernelcomm *l); int libcfs_ukuc_get_rfd(struct lustre_kernelcomm *link); int libcfs_ukuc_msg_get(struct lustre_kernelcomm *l, char *buf, int maxsize, int transport); + +enum get_lmd_info_type { + GET_LMD_INFO = 1, + GET_LMD_STRIPE = 2, +}; + +int get_lmd_info_fd(char *path, int parentfd, int dirfd, + void *lmd_buf, int lmd_len, enum get_lmd_info_type type); #endif /* _LUSTREAPI_INTERNAL_H_ */