| LLAPI_LAYOUT_OST_INDEX_GET(3) | Lustre Library Functions | LLAPI_LAYOUT_OST_INDEX_GET(3) |
NAME
llapi_layout_ost_index_get, llapi_layout_ost_index_set - get or set the OST index of a stripe of a Lustre file
SYNOPSIS
#include <lustre/lustreapi.h>
int llapi_layout_ost_index_get(const struct llapi_layout *layout,
int stripe_number, uint64_t *ost_index);
int llapi_layout_ost_index_set(struct llapi_layout *layout,
int stripe_number, uint64_t ost_index);
DESCRIPTION
llapi_layout_ost_index_get() stores into ost_index the index number of the Lustre OST associated with stripe_number in layout.
llapi_layout_ost_index_set() sets the OST index of stripe_number in layout to ost_index. This allows an application to control which OSTs will be used to allocate storage for a file. Setting the starting OST index for a file (stripe_number=0) is supported with all versions of Lustre, and other stripes in the file will be assigned sequentially by the filesystem. Setting the OST indices other than stripe 0 is only supported with Lustre 2.7 and later, and will return an error at file creation time for 2.6 and earlier.
It is an error to call llapi_layout_ost_index_get() with a layout that was not initialized with one of llapi_layout_get_by_fd(), llapi_layout_get_by_fid(), or llapi_layout_get_by_path().
An ost_index value of LLAPI_LAYOUT_DEFAULT is only valid for stripe_number=0 and means that an OST index will be automatically assigned by the filesystem and will reset previously-set stripe_number assignments.
RETURN VALUES
llapi_layout_ost_index_get() and llapi_layout_ost_index_set() return 0 on success, or -1 if an error occurred (in which case, errno is set appropriately).
ERRORS
- EINVAL
- An invalid argument was specified.
- EOPNOTSUPP
- Attempted to set index of a stripe other than stripe 0.
AVAILABILITY
llapi_layout_ost_index_get() and llapi_layout_ost_index_set() are 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(7), lustreapi(7)
| 2024-08-27 | Lustre User API |