OS Manuals

llapi_path2parent(3)

llapi_path2parent, llapi_fd2parent - Retrieve <parent FID>/name(s) for an entry in Lustre.

LLAPI_PATH2PARENT(3) Lustre Library Functions LLAPI_PATH2PARENT(3)

llapi_path2parent, llapi_fd2parent - Retrieve <parent FID>/name(s) for an entry in Lustre.

#include <lustre/lustreapi.h>
int llapi_path2parent(const char *path, unsigned int linkno,
                      struct lu_fid *parent_fid, char *name,
                      size_t name_size);
int llapi_fd2parent(int fd, unsigned int linkno,
                    struct lu_fid *parent_fid, char *name,
                    size_t name_size);

llapi_path2parent() for link number linkno stores the FID of the parent directory into parent_fid and the NUL-terminated name of the entry into the buffer name which is expected to be of size name_size. If linkno should be initialized to -1 when starting to iterate over all links of a file. The function llapi_fd2parent() behaves similarly except that it operates on an open file descriptor instead of a path.

0 is returned on success or a negative errno value on failure.

linkno has reached the total link count of the file.
path or fd does not reside on a Lustre filesystem.
path does not exist.
An invalid argument was specified.
The given buffer was too small to hold the pathname.
The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.

llapi_path2parent() and llapi_fd2parent() are part of the lustre(7) user application interface library since release 2.4.0

lfs-path2fid(1), llapi_fid2path(3), llapi_path2fid(3), lustreapi(7)

2024-08-28 Lustre User API

lustre 2.17.59-r1 · enterprise-packages · ingested 2026-10-02