LLAPI_DIR_CREATE(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

✨ NAME ✨

llapi_dir_create β€” bestie, this is the one that makes a directory with the striping YOU picked πŸ’…


🌸 SYNOPSIS 🌸

#include <lustre/lustreapi.h>

int llapi_dir_create(const char *name, mode_t mode,
                     const struct llapi_stripe_param *param)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so llapi_dir_create() spins up a brand-new directory with whatever name and stripe parameters you hand it, on a Lustre filesystem. the whole point? you get explicit control over which MDTs (Metadata Targets) that directory gets striped across. which means β€” parallel metadata operations, babes. when a directory has a truly unhinged number of entries in it, that's the moment this eats πŸ”₯

here's the breakdown of the args, no gatekeeping:

  • name β€” the pathname of the directory you wanna 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 open(2) describes them.
  • param β€” a pointer to a struct llapi_stripe_param holding your striping config. the fields that actually matter for directories are:
    • lsp_stripe_count β€” how many MDTs to stripe this directory across. normally you just set it to 1, unless you're about to create hundreds of thousands of files directly in this directory, in which case, go off, bump it up.
    • lsp_stripe_offset β€” the MDT index where the directory should start. or -1 if you want the system to pick for you based on available space. letting the algorithm choose is lowkey iconic tbh.
    • lsp_stripe_pattern β€” the hash algorithm that spreads directory entries across MDTs. valid values include:
      • LMV_HASH_TYPE_FNV_1A_64 β€” the default, and it gives good distribution. the standard slay.
      • LMV_HASH_TYPE_CRUSH β€” optimized for migration.
      • LMV_HASH_TYPE_ALL_CHARS β€” weak, and it's for testing only. do not bring this to production, i'm begging.
    • lsp_pool β€” currently ignored, so set it as NULL. she's just sitting there, vibing, doing nothing.
    • lsp_is_specific β€” if true, use the lsp_tgts array for specific MDT indices.
    • lsp_max_inherit β€” maximum depth for subdirectories to inherit this default layout.
    • lsp_max_inherit_rr β€” maximum depth for subdirectories to use round-robin MDT selection.

πŸ’– RETURN VALUE πŸ’–

llapi_dir_create() returns 0 on success πŸŽ€ or a negative errno value on failure 😭


πŸ’€ ERRORS πŸ’€

  • -EACCES β€” permission denied on the parent directory. not your house, not your rules.
  • -EALREADY β€” stripe already set on an existing directory.
  • -EEXIST β€” directory already exists. girl, she's already here.
  • -EINVAL β€” an invalid argument was specified.
  • -ENOENT β€” parent directory does not exist. you can't build in a void, bestie.
  • -ENOMEM β€” not enough memory to allocate a resource.

🌈 AVAILABILITY 🌈

llapi_dir_create() has been part of the lustre(7) user application interface library since release 2.10.0. she's been around, and she's been serving ✨


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie 🫢 straight outta the Lustre User API, dated 2026-01-26 β€” now go stripe something responsibly πŸ’œ

πŸ“¦ where this page comes from