X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Flustreapi_internal.h;fp=lustre%2Futils%2Flustreapi_internal.h;h=170f125c83a72e2877c2deea35baeb17f8a4c774;hp=3b94298fa7818566c9c9e469e78ee4c2cd8f6552;hb=087ec276de0bc79db66b614e1f17ff0bf631464f;hpb=76afb10a76830396b1457f51eb16992da8a894a4 diff --git a/lustre/utils/lustreapi_internal.h b/lustre/utils/lustreapi_internal.h index 3b94298..170f125 100644 --- a/lustre/utils/lustreapi_internal.h +++ b/lustre/utils/lustreapi_internal.h @@ -134,6 +134,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. */