LLAPI_FIND_PARAM_ALLOC(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_FIND_PARAM_ALLOC πŸ’–

okay bestie, welcome to the Lustre Library Functions section of the manual β€” yes this is a section 3 page, yes it's iconic, let's get into it πŸ’…

  • llapi_find_param_alloc, llapi_find_param_free β€” allocate and free struct find_param objects πŸŽ€

✨ SYNOPSIS ✨

#include <lustre/lustreapi.h>

struct find_param *llapi_find_param_alloc(void);

void llapi_find_param_free(struct find_param *param);

🌸 DESCRIPTION 🌸

okay so first up: llapi_find_param_alloc() hands you back a pointer to a freshly-allocated struct find_param. and what is a struct find_param, you ask? it's the whole vibe-setter β€” it holds the parameters that decide which files match a search and how the matching files get displayed. you're gonna pass it into later calls to llapi_find(3), llapi_getstripe(3), and all the other functions declared in <lustre/lustreapi.h> that take a struct find_param argument πŸ¦‹

the returned struct find_param object comes back zero-filled, and then you β€” the caller β€” set the fields describing the search you want before handing it off to one of those functions up there. and bestie, listen: applications should get their struct find_param from llapi_find_param_alloc() rather than just declaring one directly, so the allocation always matches the size of the struct find_param used by the running library β€” even if your app was built against an older <lustre/lustreapi.h> header. no mismatched sizes, no chaos, periodt. and when you're done with that pointer, free it with llapi_find_param_free() πŸ’–

now, llapi_find_param_free() frees the memory associated with param, which must have come from an earlier call to llapi_find_param_alloc(). if param is NULL, nothing happens, no action taken, we move on gracefully πŸ™ˆ. heads up though: memory referenced by fields of the structure is not freed, and it stays owned by the caller. and pls use this instead of free(3) β€” like, actually β€” because that keeps your application compatible with future versions of the library that might do extra cleanup 🧚


πŸ”₯ RETURN VALUES πŸ”₯

  • llapi_find_param_alloc() β€” returns a valid pointer on success, or NULL on failure with errno set to an appropriate error code 😭
  • llapi_find_param_free() β€” returns no value. it's giving void.

πŸ’€ ERRORS πŸ’€

  • ENOMEM β€” insufficient storage space is available.

🌈 EXAMPLES 🌈

list all regular files below path:

#include <lustre/lustreapi.h>

int find_regular_files(char *path)
{
     struct find_param *param;
     int rc;

     param = llapi_find_param_alloc();
     if (!param)
          return -errno;

     param->fp_max_depth = -1;
     param->fp_type = S_IFREG;

     rc = llapi_find(path, param);

     llapi_find_param_free(param);

     return rc;
}

look at her go, main character energy fr fr πŸ‘‘


πŸ‘‘ AVAILABILITY πŸ‘‘

llapi_find_param_alloc() and llapi_find_param_free() are part of the lustre(7) user application interface library since release 2.18.0 ⭐


🫢 SEE ALSO 🫢

lfs-find(1), llapi_find(3), llapi_getstripe(3), lustreapi(7)


ok that's the whole page bestie, you ate that πŸ’…βœ¨

bye!! this was Lustre User API, dated 2026-08-13, filed under LLAPI_FIND_PARAM_ALLOC(3) β€” go forth and allocate responsibly πŸŽ€πŸ’–πŸŒΈ

πŸ“¦ where this page comes from