| LLAPI_SEARCH_TGT(3) | Lustre Library Functions | LLAPI_SEARCH_TGT(3) |
NAME
llapi_search_tgt, llapi_search_mdt, llapi_search_ost - verify OST or MDT is in specified pool
SYNOPSIS
#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);
DESCRIPTION
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.
RETURN VALUES
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.
ERRORS
AVAILABILITY
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
SEE ALSO
| 2024-08-28 | Lustre User API |