LLAPI\_LAYOUT\_ALLOC(3) Lustre Library Functions LLAPI\_LAYOUT\_ALLOC(3)

# [NAME](#NAME)

llapi\_layout\_alloc, llapi\_layout\_free - allocate and destroy struct llapi\_layout objects.

# [SYNOPSIS](#SYNOPSIS)

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

```
struct llapi_layout *llapi_layout_alloc(void);
```

```
void llapi_layout_free(struct llapi_layout *layout);
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_layout\_alloc()** returns a pointer to a newly-allocated **struct llapi\_layout**. The **struct llapi\_layout** is an opaque entity containing the layout information for a file in a Lustre filesystem. Its internal structure should not be directly accessed by an application. It may be used in subsequent calls to the functions referenced in the [**llapi\_layout**(7)](/man/enterprise-packages/lustre/llapi_layout.7) manual page to modify layout attributes and create files with the given layout.

The returned **struct llapi\_layout** object is initialized with default attribute values that will affect the standard Lustre behavior for assigning layouts to newly-created files. These values may be modified using the group of functions in **struct llapi\_layout** API whose names end with **\_set**. The pointer should be freed with **llapi\_layout\_free()** when it is no longer needed.

**llapi\_layout\_free()** frees the memory associated with *layout*.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_layout\_alloc()** returns a valid pointer on success or **NULL** on failure with **errno** set to an approporiate error code.

**llapi\_layout\_free()** returns no value.

# [ERRORS](#ERRORS)

[**ENOMEM**](#ENOMEM)

Insufficient storage space is available.

# [AVAILABILITY](#AVAILABILITY)

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

# [SEE ALSO](#SEE_ALSO)

[**llapi\_layout\_file\_create**(3)](/man/enterprise-packages/lustre/llapi_layout_file_create.3), [**llapi\_layout**(7)](/man/enterprise-packages/lustre/llapi_layout.7), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-27 Lustre User API

---

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