LLAPI\_LAYOUT\_COMP\_ADD(3) Lustre Library Functions LLAPI\_LAYOUT\_COMP\_ADD(3)

# [NAME](#NAME)

llapi\_layout\_comp\_add, llapi\_layout\_comp\_del - add or delete a layout component into/from the layout.

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_layout_comp_add(struct llapi_layout *layout,
                          struct llapi_layout *comp);
```

```
int llapi_layout_comp_del(struct llapi_layout *layout,
                          struct llapi_layout *comp);
```

# [DESCRIPTION](#DESCRIPTION)

A composite layout is made of several layout components.

[**llapi\_layout\_comp\_add**(3)](/man/enterprise-packages/lustre/llapi_layout_comp_add.3) adds the layout component *comp* into the existing in-memory *layout* under construction, and *comp* is freed. The *layout* will be turned into composite if it was plain before adding. All layout attributes of *comp* will be inherited from the *layout*, unless otherwise specified for this component by llapi\_layout\_\*[\_set(3)](/man/enterprise-packages/lustre/_set.3) functions.

[**llapi\_layout\_comp\_del**(3)](/man/enterprise-packages/lustre/llapi_layout_comp_del.3) deletes the layout component *comp* from the in-memory *layout*, but does not delete the component from an existing file layout on the MDT.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_layout\_comp\_add()** and **llapi\_layout\_comp\_del()** return 0 on success, or -1 if an error occurred (in which case, **errno** is set appropriately).

# [ERRORS](#ERRORS)

[**EINVAL**](#EINVAL)

An invalid argument was specified.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_layout\_comp\_add()** and **llapi\_layout\_comp\_del()** are part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.10.0.

# [SEE ALSO](#SEE_ALSO)

[**llapi\_layout\_alloc**(3)](/man/enterprise-packages/lustre/llapi_layout_alloc.3), [**llapi\_layout\_file\_comp\_add**(3)](/man/enterprise-packages/lustre/llapi_layout_file_comp_add.3), [**llapi\_layout\_file\_comp\_del**(3)](/man/enterprise-packages/lustre/llapi_layout_file_comp_del.3), [**llapi\_layout\_file\_open**(3)](/man/enterprise-packages/lustre/llapi_layout_file_open.3), [**llapi\_layout\_free**(3)](/man/enterprise-packages/lustre/llapi_layout_free.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_comp_del(3) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
