LLAPI\_FIND\_PARAM\_ALLOC(3) Lustre Library Functions LLAPI\_FIND\_PARAM\_ALLOC(3)

# [NAME](#NAME)

llapi\_find\_param\_alloc, llapi\_find\_param\_free - allocate and free struct find\_param objects.

# [SYNOPSIS](#SYNOPSIS)

```
#include <lustre/lustreapi.h>
```

```
struct find_param *llapi_find_param_alloc(void);
```

```
void llapi_find_param_free(struct find_param *param);
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_find\_param\_alloc()** returns a pointer to a newly-allocated **struct find\_param**. The **struct find\_param** contains the parameters that select which files match a search and how matching files are displayed. It may be used in subsequent calls to [**llapi\_find**(3)](/man/enterprise-packages/lustre/llapi_find.3), [**llapi\_getstripe**(3)](/man/enterprise-packages/lustre/llapi_getstripe.3), and the other functions declared in **&lt;lustre/lustreapi.h&gt;** that take a **struct find\_param** argument.

The returned **struct find\_param** object is zero-filled; the caller sets the fields that describe the desired search before passing it to one of the functions listed above. Applications should obtain a **struct find\_param** from **llapi\_find\_param\_alloc()** rather than declaring one directly, so that the allocation always matches the size of the **struct find\_param** used by the running library, even if the application was built against an older **&lt;lustre/lustreapi.h&gt;** header. The pointer should be freed with **llapi\_find\_param\_free()** when it is no longer needed.

**llapi\_find\_param\_free()** frees the memory associated with *param*, which must have been returned by an earlier call to **llapi\_find\_param\_alloc()**. If *param* is **NULL**, no action is taken. Memory referenced by fields of the structure is not freed and remains owned by the caller. It should be used in preference to [**free**(3)](/man/enterprise-packages/lustre/free.3) so that applications remain compatible with future versions of the library that may perform additional cleanup.

# [RETURN VALUES](#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.

# [ERRORS](#ERRORS)

[**ENOMEM**](#ENOMEM)

Insufficient storage space is available.

# [EXAMPLES](#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;
}
```

# [AVAILABILITY](#AVAILABILITY)

**llapi\_find\_param\_alloc()** and **llapi\_find\_param\_free()** are part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.18.0.

# [SEE ALSO](#SEE_ALSO)

[**lfs-find**(1)](/man/enterprise-packages/lustre/lfs-find.1), [**llapi\_find**(3)](/man/enterprise-packages/lustre/llapi_find.3), [**llapi\_getstripe**(3)](/man/enterprise-packages/lustre/llapi_getstripe.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2026-08-13 Lustre User API

---

Document: llapi_find_param_free(3) from lustre 2.17.59-r2 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
