X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flustreapi_internal.h;h=7284ea909299fa2631a94922352902a4a0947504;hb=121a79651fc77e5c596716972fb58da7e93f7075;hp=95c57ffed4f3e3f27e01d33091ff84b5ac889816;hpb=5e65d6a8e57a5a17c4c7e043cb46e86bf82b7782;p=fs%2Flustre-release.git diff --git a/lustre/utils/lustreapi_internal.h b/lustre/utils/lustreapi_internal.h index 95c57ff..7284ea9 100644 --- a/lustre/utils/lustreapi_internal.h +++ b/lustre/utils/lustreapi_internal.h @@ -131,29 +131,17 @@ static inline bool llapi_stripe_index_is_valid(int64_t index) return index >= -1 && index <= LOV_V1_INSANE_STRIPE_COUNT; } -static inline bool llapi_pool_name_is_valid(const char **pool_name, - const char *fsname) +static inline bool llapi_pool_name_is_valid(const char **pool_name) { const char *ptr; if (*pool_name == NULL) return false; - /** - * in case user gives the full pool name ., - * strip the fsname - */ + /* Strip off any 'fsname.' portion. */ ptr = strchr(*pool_name, '.'); - if (ptr != NULL) { - if (fsname != NULL) { - int fslen = strlen(fsname); - - if (fslen != ptr - *pool_name || - strncmp(*pool_name, fsname, fslen) != 0) - return false; - } + if (ptr != NULL) *pool_name = ptr + 1; - } if (strlen(*pool_name) > LOV_MAXPOOLNAME) return false; @@ -161,9 +149,6 @@ static inline bool llapi_pool_name_is_valid(const char **pool_name, return true; } - -int llapi_layout_search_ost(__u32 ost, const char *pname, char *fsname); - /* Compatibility macro for legacy llapi functions that use "offset" * terminology instead of the preferred "index". */ #define llapi_stripe_offset_is_valid(os) llapi_stripe_index_is_valid(os)