llapi_search_tgt(3)

NAME
llapi_search_tgt - 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

EINVAL
    fsname is NULL or zero-length, or both pool_name and tgt_name are NULL.

ENOENT
    pool_name is specified but is not part of fsname.

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