X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flustreapi_internal.h;h=4d636f454e77e1ca3225191b24d6b50d1c106d6d;hb=2f8d7b4679de3fa467040aa61733f262714e39c9;hp=c020db12da920b8ef496fb0cbb82178ab961da17;hpb=b36c377ff25c20417c481eab3798e67d042ec3a3;p=fs%2Flustre-release.git diff --git a/lustre/utils/lustreapi_internal.h b/lustre/utils/lustreapi_internal.h index c020db1..4d636f4 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 @@ -134,6 +132,21 @@ static inline bool llapi_stripe_index_is_valid(int64_t index) * terminology instead of the preferred "index". */ #define llapi_stripe_offset_is_valid(os) llapi_stripe_index_is_valid(os) +static inline bool llapi_dir_stripe_count_is_valid(int64_t count) +{ + return count >= -1 && count <= LMV_MAX_STRIPE_COUNT; +} + +static inline bool llapi_dir_stripe_index_is_valid(int64_t index) +{ + return index >= -1 && index < LMV_MAX_STRIPE_COUNT; +} + +static inline bool llapi_dir_hash_type_is_valid(int64_t hash) +{ + return hash > LMV_HASH_TYPE_UNKNOWN && hash < LMV_HASH_TYPE_MAX; +} + /* * Kernel communication for Changelogs and HSM requests. */ @@ -142,4 +155,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_ */