LLAPI_DIR_CREATE_FOREIGN(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’« LLAPI_DIR_CREATE_FOREIGN πŸ’«

okay bestie, sit down, we're doing a Lustre Library Functions moment β€” this one lives in section 3 of the manual, LLAPI_DIR_CREATE_FOREIGN(3), and it's literally the girl who makes foreign directory entries happen. no cap. πŸ¦‹


✨ NAME ✨

llapi_dir_create_foreign β€” create a foreign directory entry πŸ’…


🌸 SYNOPSIS 🌸

#include <lustre/lustreapi.h>

int llapi_dir_create_foreign(const char *name, mode_t mode,
                             __u32 type, __u32 flags,
                             const char *value)

πŸŽ€ DESCRIPTION πŸŽ€

so what does she do. llapi_dir_create_foreign() creates a foreign directory entry β€” and that entry stores a reference to external storage or metadata. which means Lustre can track and manage directories that live outside the Lustre filesystem. it's giving "we're keeping receipts on something that isn't even here." iconic honestly. πŸ‘‘

the arguments, bestie, one by one:

  • name β€” the pathname of the directory entry to create. the parent directory has to already exist, and it has to be on a Lustre filesystem. no parent, no party. 🚫
  • mode β€” the permission bits for the new directory, exactly like how open(2) describes them.
  • type β€” the type of foreign directory. this is what identifies what kind of external storage or system the foreign reference is pointing at.
  • flags β€” flags that control the behavior of the foreign directory entry.
  • value β€” a string value holding the foreign reference information, like a path or an identifier in the external system.

πŸ”₯ RETURN VALUE πŸ”₯

llapi_dir_create_foreign() returns 0 on success 🫢, or a negative errno value if it fails 😭.


πŸ’€ ERRORS πŸ’€

  • -EACCES β€” permission denied on parent directory.
  • -EALREADY β€” stripe already set on existing directory.
  • -EEXIST β€” directory already exists.
  • -EINVAL β€” an invalid argument was specified.
  • -ENOENT β€” parent directory does not exist.
  • -ENOMEM β€” not enough memory to allocate a resource.
ngl if you're seeing one of these, read it carefully before you start blaming yourself. the errno is literally telling you what's up. 🫑

🌈 AVAILABILITY 🌈

llapi_dir_create_foreign() is part of the lustre(7) user application interface library since release 2.13.0. so if your release is older than that… she's not there yet, bestie. πŸ’œ


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole vibe check, fr fr. this page came from the Lustre User API, dated 2026-01-26 β€” go forth and make your foreign directories, you absolute main character. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ˜­πŸ”₯πŸ‘‘πŸŒˆβ­πŸ’€πŸ™ˆπŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from