LLAPI_LAYOUT_PATTERN_GET(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_LAYOUT_PATTERN_GET(3) πŸ’–

okay bestie, welcome to the llapi_layout_pattern_get page from the Lustre Library Functions manual β€” yes, that's a 3 in the parens, it's a library call, we're doing C today, hydrate first 🌸


✨ NAME ✨

llapi_layout_pattern_get, llapi_layout_pattern_set β€” get or set the RAID striping pattern of a Lustre file πŸ¦‹


✨ SYNOPSIS ✨

#include <lustre/lustreapi.h>

int llapi_layout_pattern_get(const struct llapi_layout *layout,
                             uint64_t *pattern);

int llapi_layout_pattern_set(struct llapi_layout *layout,
                             uint64_t pattern);

like, include the header first obviously, we don't just guess at structs πŸ’…


✨ DESCRIPTION ✨

so llapi_layout_pattern_get() does the cute lil read thing: it stores into pattern the RAID striping pattern used by layout layout. just hands it over. reading era πŸ“–βœ¨

then llapi_layout_pattern_set() sets the RAID striping pattern of layout to pattern. currently the only supported RAID pattern is RAID0, that's it, that's the whole menu, no cap. so if pattern is not a supported RAID pattern, the return value will be -1 and errno will be set to EOPNOTSUPP. it's giving rejection but politely πŸ’€

two special values, remember these:

  • A pattern value of LLAPI_LAYOUT_DEFAULT means that the filesystem default RAID pattern will be used.
  • A pattern value of LLAPI_LAYOUT_RAID0 means that the RAID0 pattern will be used.

lowkey the whole API in two constants, obsessed πŸŽ€


✨ RETURN VALUES ✨

llapi_layout_pattern_get() and llapi_layout_pattern_set() return 0 on success, or -1 if an error occurred (in which case, errno is set appropriately). zero is a slay, minus one is a vibe check failure 😭


✨ ERRORS ✨

  • EINVAL β€” An invalid argument was specified. you passed something goofy, bestie πŸ™ˆ
  • EOPNOTSUPP β€” An unsupported RAID pattern was specified. we said RAID0 and we meant RAID0 βœ‹

✨ AVAILABILITY ✨

llapi_layout_pattern_get() and llapi_layout_pattern_set() are part of the lustre(7) user application interface library since release 2.7.0 β€” so like, since forever ago, vintage icon behavior πŸ‘‘


✨ SEE ALSO ✨

go read those next, the lore is deep 🌈


anyway that's the page!! Lustre User API, dated 2024-08-27, from the LLAPI_LAYOUT_PATTERN_GET(3) era of your terminal. mwah, go write some layouts πŸ’œβœ¨

πŸ“¦ where this page comes from