LLAPI_LAYO..._INDEX_GET(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

✨ 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 call llapi_layout_ost_index_get() with a layout that was not initialized with one of llapi_layout_get_by_fd(), llapi_layout_get_by_fid(), or llapi_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 🌈


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