LLAPI\_LAYOUT\_OST\_INDEX\_RESET(3) Lustre Library Functions LLAPI\_LAYOUT\_OST\_INDEX\_RESET(3)

# [NAME](#NAME)

llapi\_layout\_ost\_index\_reset - reset OST index of all Lustre file components

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_layout_ost_index_reset(struct llapi_layout *layout);
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_layout\_ost\_index\_reset()** resets the starting ost\_index number of all components in the specified file *layout* to **LLAPI\_LAYOUT\_DEFAULT**. This allows the MDS to automatically allocate the objects for each file component to the best OSTs available at that time.

This should be called when copying an existing file *layout* retrieved using one of [**llapi\_layout\_get\_by\_fid**(3)](/man/enterprise-packages/lustre/llapi_layout_get_by_fid.3), [**llapi\_layout\_get\_by\_fd**(3)](/man/enterprise-packages/lustre/llapi_layout_get_by_fd.3), [**llapi\_layout\_get\_by\_path**(3)](/man/enterprise-packages/lustre/llapi_layout_get_by_path.3), or [**llapi\_layout\_get\_by\_xattr**(3)](/man/enterprise-packages/lustre/llapi_layout_get_by_xattr.3), so that the OST selection is not copied exactly from the source layout if it is used with [**llapi\_layout\_file\_open**(3)](/man/enterprise-packages/lustre/llapi_layout_file_open.3) to create a new file for migration, mirroring, or other replication task.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_layout\_ost\_index\_reset()** returns 0 on success, or a negative error if an error occurred (in which case, errno is set appropriately).

# [ERRORS](#ERRORS)

[**EINVAL**](#EINVAL)

An invalid argument was specified.

[**ENOENT**](#ENOENT)

The layout does not have any valid components.

[**ENOMEM**](#ENOMEM)

Insufficient memory to complete operation.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_layout\_ost\_index\_reset()** is 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\_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\_ost\_index\_set**(3)](/man/enterprise-packages/lustre/llapi_layout_ost_index_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_ost_index_reset(3) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
