LLAPI_LAYOUT_OST_INDEX_RESET(3)

NAME
llapi_layout_ost_index_reset - reset OST index of all Lustre file components

SYNOPSIS
#include <lustre/lustreapi.h>

int llapi_layout_ost_index_reset(struct llapi_layout *layout);

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), llapi_layout_get_by_fd(3), llapi_layout_get_by_path(3), or 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) to create a new file for migration, mirroring, or other replication task.

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

EINVAL
    An invalid argument was specified.

ENOENT
    The layout does not have any valid components.

ENOMEM
    Insufficient memory to complete operation.

AVAILABILITY
llapi_layout_ost_index_reset() is part of the lustre(7) user application interface library since release 2.7.0

SEE ALSO
llapi_layout_alloc(3), llapi_layout_file_open(3), llapi_layout_ost_index_set(3), llapi_layout(7), lustreapi(7)