OS Manuals

llapi_search_tgt(3)

llapi_search_tgt, llapi_search_mdt, llapi_search_ost - verify OST or MDT is in specified pool

LLAPI_SEARCH_TGT(3) Lustre Library Functions LLAPI_SEARCH_TGT(3)

llapi_search_tgt, llapi_search_mdt, llapi_search_ost - verify OST or MDT is in specified pool

#include <lustre/lustreapi.h>
int llapi_search_tgt(const char *fsname, const char *pool_name,
                     const char *tgt_name, bool is_mdt);
int llapi_search_mdt(const char *fsname, const char *pool_name,
                     const char *tgt_name);
int llapi_search_ost(const char *fsname, const char *pool_name,
                     const char *tgt_name);

llapi_search_tgt() verifies that the specified tgt_name is a valid MDT or OST (depending on whether is_mdt is true or false, respectively) in the filesystem named fsname and (if specified) in the pool named pool_name of that filesystem. At least fsname must be non-NULL, but pool_name may be NULL if just checking for the existence of the target, and tgt_name may be NULL, if only checking the existence of pool_name.

The llapi_search_mdt() and llapi_search_ost() functions are simple convenience/compatibility wrappers of llapi_search_tgt() that set is_mdt appropriately for the target type.

llapi_search_tgt() returns 1 if tgt_name (or pool_name if tgt_name is NULL) is found in the specified pool (or filesystem if pool_name is NULL). It returns 0 if tgt_name (pool_name) if it is not found in the specified pool (filesystem). A negative errno is returned if an error occurred, in which case errno is also set appropriately.

fsname is NULL or zero-length, or both pool_name and tgt_name are NULL.
pool_name is specified but is not part of fsname.

llapi_search_tgt(), llapi_search_mdt() and llapi_search_ost() is part of the lustre(7) user application interface library since release 2.4.0

llapi_pool_name_verify(3), lustre(7), lustreapi(7)

2024-08-28 Lustre User API

lustre 2.17.59-r2 · enterprise-packages · ingested 2026-10-11