llapi_layout_ost_index_get(3) 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 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 stripe_number in layout layout. llapi_layout_ost_index_set() sets the OST index of stripe number stripe_number in layout layout to ost_index. This allows an applica- tion to control which OSTs will be used to allocate storage for a file. Setting the OST index is currently only supported for stripe 0. It is an error to call llapi_layout_ost_index_get() with a layout that was not initialized with 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 means that an index will be automatically assigned by the filesystem. 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. SEE ALSO llapi_layout_alloc(3), llapi_layout_file_open(3), llapi_layout(7), liblustreapi(7) Lustre User API 2013 Oct 31 llapi_layout_ost_index_get(3)