LLAPI_SEARCH_ROOTPATH(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_SEARCH_ROOTPATH(3) πŸ’–

okay bestie, so this is a section 3 manual page from the Lustre Library Functions collection, and it's literally all about finding where your Lustre filesystem is mounted. no cap. let's get into it 🫢


✨ NAME ✨

llapi_search_rootpath, llapi_search_rootpath_by_dev β€” retrieve the path of a lustre mount point πŸ¦‹


✨ SYNOPSIS ✨

#include <lustre/lustreapi.h>

int llapi_search_rootpath( char *pathname ,const char *fsname)

int llapi_search_rootpath_by_dev( char *pathname, dev_t dev)

✨ DESCRIPTION ✨

okay so picture this: llapi_search_rootpath() and llapi_search_rootpath_by_dev() are out here hunting down the first Lustre mount point for you. how do they do it? they match either the filesystem name fsname πŸ’… or the filesystem device dev πŸ’…. that's the whole vibe.

wherever that mount point is, its path gets stored into pathname, bestie. so make sure that buffer is, like, sufficient to store the path. don't come crying to me if you under-allocate, i warned you 😭

for example:

char pathname[PATH_MAX];

iconic. obsessed. now β€” where do you even get the filesystem device from? you can pull it out of a file with stat() (look at the field st_dev) or with statx() (look at the fields stx_dev_major and stx_dev_minor). yw πŸ’œ


✨ RETURN VALUES ✨

  • 0 β€” on success, slay ✨
  • -ve β€” error code on failure, and it sets errno appropriately. not the moment, ngl πŸ’€

✨ ERRORS ✨

  • EINVAL β€” the pathname pointer is NULL. stop it. πŸ™ˆ
  • ENODEV β€” the Lustre mount point was not found. it's giving lost in the sauce 🧚

✨ AVAILABILITY ✨

llapi_search_rootpath() and llapi_search_rootpath_by_dev() are part of the lustre(7) user application interface library πŸ‘‘

  • llapi_search_rootpath was added in release 2.4.0
  • llapi_search_rootpath_by_dev was added in release 2.16.0

main character energy from both of them fr fr πŸ’…


✨ SEE ALSO ✨

stat(2), statx(2), lustreapi(7) 🌈


and that's the whole page bestie. this one came to you from the Lustre User API, dated 2024-08-28 β€” thanks for reading, ily, go mount something πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from