X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flustreapi_internal.h;h=94bc8ed5b6cc4b86c0eac5527bb381705394e079;hb=2e2b16c28bcf4048ba4f34129b7fb91c36b55a71;hp=170f125c83a72e2877c2deea35baeb17f8a4c774;hpb=087ec276de0bc79db66b614e1f17ff0bf631464f;p=fs%2Flustre-release.git diff --git a/lustre/utils/lustreapi_internal.h b/lustre/utils/lustreapi_internal.h index 170f125..94bc8ed 100644 --- a/lustre/utils/lustreapi_internal.h +++ b/lustre/utils/lustreapi_internal.h @@ -4,10 +4,10 @@ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * (C) Copyright 2012 Commissariat a l'energie atomique et aux energies - * - * Copyright (c) 2016, Intel Corporation. * alternatives * + * Copyright (c) 2016, 2017, Intel Corporation. + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 or (at your discretion) any later version. @@ -26,8 +26,6 @@ * * lustre/utils/lustreapi_internal.h * - * Copyright (c) 2016 Intel Corporation. - * * Author: Aurelien Degremont * Author: JC Lafoucriere * Author: Thomas Leibovici @@ -61,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); @@ -146,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; } /* @@ -157,4 +157,14 @@ 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(const char *path, int parentfd, int dirfd, + void *lmd_buf, int lmd_len, enum get_lmd_info_type type); + +int lov_comp_md_size(struct lov_comp_md_v1 *lcm); #endif /* _LUSTREAPI_INTERNAL_H_ */