OS Manuals

llapi_dir_create_foreign(3)

llapi_dir_create_foreign - create a foreign directory entry

LLAPI_DIR_CREATE_FOREIGN(3) Lustre Library Functions LLAPI_DIR_CREATE_FOREIGN(3)

llapi_dir_create_foreign - create a foreign directory entry

#include <lustre/lustreapi.h>
int llapi_dir_create_foreign(const char *name, mode_t mode,
                             __u32 type, __u32 flags,
                             const char *value)

llapi_dir_create_foreign() creates a foreign directory entry that stores a reference to external storage or metadata. This allows Lustre to track and manage directories that reside outside the Lustre filesystem.

The arguments are as follows:

The pathname of the directory entry to create. The parent directory must already exist and be on a Lustre filesystem.
The permission bits for the new directory, as described in open(2).
The type of foreign directory. This identifies what kind of external storage or system the foreign reference points to.
Flags controlling the behavior of the foreign directory entry.
A string value containing the foreign reference information, such as a path or identifier in the external system.

llapi_dir_create_foreign() returns 0 on success, or a negative errno value on failure.

Permission denied on parent directory.
Stripe already set on existing directory.
Directory already exists.
An invalid argument was specified.
Parent directory does not exist.
Not enough memory to allocate a resource.

llapi_dir_create_foreign () is part of the lustre(7) user application interface library since release 2.13.0.

llapi_dir_create(3), llapi_dir_create_pool(3), lustreapi(7)

2026-01-26 Lustre User API

lustre 2.17.60-r0 · enterprise-packages · ingested 2026-10-22