LLAPI\_LAYOUT\_EXTENSION\_SIZE\_GET(3) Lustre Library Functions LLAPI\_LAYOUT\_EXTENSION\_SIZE\_GET(3)

# [NAME](#NAME)

llapi\_layout\_extension\_size\_get, llapi\_layout\_extension\_size\_set - get or set the extension size of an extension component of a Lustre file

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_layout_extension_size_get(const struct llapi_layout *layout,
                                    uint64_t *ext_size);
```

```
int llapi_layout_extension_size_set(struct llapi_layout *layout,
                                    uint64_t ext_size);
```

# [DESCRIPTION](#DESCRIPTION)

The extension size is the unit of increase the previous component size when writing within the region of the current extension component. At the time of the change the OSTs of the previous component layout are checked if they have at least *ext\_size* free space. In case there is not enough free space, the space covered by the extension component spills over to the next component (see examples in [**lfs-setstripe**(1)](/man/enterprise-packages/lustre/lfs-setstripe.1)).

In case of a random write to a middle of the extension component, the extension happens from the beginning of the extension component up to the current writing position plus the *ext\_size*. However, the check for low space is still done for the *ext\_size*.

**llapi\_layout\_extension\_size\_get()** stores into *ext\_size* the extension size of *layout*.

**llapi\_layout\_extension\_size\_get()** sets the extension size of *layout* to *ext\_size*.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_layout\_extension\_size\_get()** and **llapi\_layout\_extension\_size\_set()** 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\_extension\_size\_get()** and **llapi\_layout\_extension\_size\_set()** are part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.13.0.

# [SEE ALSO](#SEE_ALSO)

[**lfs-setstripe**(1)](/man/enterprise-packages/lustre/lfs-setstripe.1), [**llapi\_layout\_alloc**(3)](/man/enterprise-packages/lustre/llapi_layout_alloc.3), [**llapi\_layout\_file\_open**(3)](/man/enterprise-packages/lustre/llapi_layout_file_open.3), [**llapi\_layout\_stripe\_size\_get**(3)](/man/enterprise-packages/lustre/llapi_layout_stripe_size_get.3), [**llapi\_layout\_stripe\_size\_set**(3)](/man/enterprise-packages/lustre/llapi_layout_stripe_size_set.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_extension_size_set(3) from lustre 2.17.59-r2 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
