LLAPI_LAYO..._INDEX_GET(3)
β¨ NAME β¨
okay so this is a page from the Lustre Library Functions manual (section 3, bestie, we're in the C-library section π ), and it's about two little functions that are obsessed with OST indices:
llapi_layout_ost_index_getβ get the OST index of a stripe of a Lustre file πllapi_layout_ost_index_setβ set the OST index of a stripe of a Lustre file β¨
πΈ SYNOPSIS πΈ
#include <lustre/lustreapi.h>
int llapi_layout_ost_index_get(const struct llapi_layout *layout,
int stripe_number, uint64_t *ost_index);
int llapi_layout_ost_index_set(struct llapi_layout *layout,
int stripe_number, uint64_t ost_index);
like, look at them. matching. coordinated. iconique π
π¦ DESCRIPTION π¦
okay so llapi_layout_ost_index_get() is the nosy one β it goes and looks stuff up. It stores into ost_index the index number of the Lustre OST associated with stripe_number in layout. that's it, that's the whole job π
then there's llapi_layout_ost_index_set(), the bossy one β it sets the OST index of stripe_number in layout to ost_index. and like, this is how an application gets to control which OSTs are gonna be used to allocate storage for a file. main character energy, choosing her own destiny fr fr π
here's the tea on compatibility tho:
- Setting the starting OST index for a file (
stripe_number=0) is supported with all versions of Lustre, and the other stripes in the file will be assigned sequentially by the filesystem. easy. no notes. π - Setting the OST indices other than stripe 0 is only supported with Lustre 2.7 and later, and it will return an error at file creation time for 2.6 and earlier. π so if you're on 2.6 or older, do not come for stripe 1. she is not available.
β οΈ it is an error to callllapi_layout_ost_index_get()with a layout that was not initialized with one ofllapi_layout_get_by_fd(),llapi_layout_get_by_fid(), orllapi_layout_get_by_path(). uninitialized layout? not a vibe. instant L.
and one more thing, bestie, about defaults π β an ost_index value of LLAPI_LAYOUT_DEFAULT is only valid for stripe_number=0. What it means: an OST index will be automatically assigned by the filesystem, and it will reset any previously-set stripe_number assignments. so it's giving β¨factory resetβ¨ vibes β the filesystem picks, and your old plans are gone. periodt.
π«Ά RETURN VALUES π«Ά
both llapi_layout_ost_index_get() and llapi_layout_ost_index_set() return 0 on success, or -1 if an error occurred (and in that case, errno is set appropriately). classic. either we're slaying or we're setting errno, no in-between π
π ERRORS π
EINVALβ an invalid argument was specified. girl, what did you pass in. πEOPNOTSUPPβ attempted to set index of a stripe other than stripe 0. stripe 2.6 said no π
β AVAILABILITY β
llapi_layout_ost_index_get() and llapi_layout_ost_index_set() are part of the lustre(7) user application interface library since release 2.7.0. so they've been around. they're not new here, they're veterans π
π SEE ALSO π
llapi_layout_alloc(3)β like, the sibling, iykykllapi_layout_file_open(3)llapi_layout(7)πlustreapi(7)
and that's the whole page, bestie!! this was the Lustre User API page, dated 2024-08-27, and you can find it hanging out under LLAPI_LAYO..._INDEX_GET(3) in man section 3 π go forth and set your OST indices (stripe 0 only on old Lustre, i'm begging u) πβ¨
π¦ 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