LLAPI_DIR_CREATE(3)
β¨ 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 likeopen(2)describes them.paramβ a pointer to astruct llapi_stripe_paramholding 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 to1, 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-1if 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 asNULL. she's just sitting there, vibing, doing nothing.lsp_is_specificβ if true, use thelsp_tgtsarray 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
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms