Whamcloud - gitweb
LU-16500 utils: 'lfs migrate' should select new OSTs
[fs/lustre-release.git] / lustre / doc / llapi_layout_ost_index_reset.3
1 .TH llapi_layout_ost_index_reset 3 "2024 Mar 27" "Lustre User API"
2 .SH NAME
3 llapi_layout_ost_index_reset \- reset OST index of all Lustre file components
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .BI "int llapi_layout_ost_index_reset(struct llapi_layout *" layout );
9 .fi
10 .SH DESCRIPTION
11 .PP
12 .B llapi_layout_ost_index_reset()
13 resets the starting ost_index number of all components in the specified file
14 .I layout 
15 to
16 .BR LLAPI_LAYOUT_DEFAULT .
17 This allows the MDS to automatically allocate the objects for each file
18 component to the best OSTs available at that time.
19 .PP
20 This should be called when copying an existing file
21 .I layout
22 retrieved using one of
23 .BR llapi_layout_get_by_fid (3),
24 .BR llapi_layout_get_by_fd (3),
25 .BR llapi_layout_get_by_path (3),
26 or
27 .BR llapi_layout_get_by_xattr (3),
28 so that the OST selection is not copied exactly from the source layout if
29 it is used with
30 .BR llapi_layout_file_open (3)
31 to create a new file for migration, mirroring, or other replication task.
32 .SH RETURN VALUES
33 .LP
34 .B llapi_layout_ost_index_reset()
35 returns 0 on success, or a negative error if an error occurred (in which case,
36 errno is set appropriately).
37 .SH ERRORS
38 .TP 15
39 .SM EINVAL
40 An invalid argument was specified.
41 .TP 15
42 .SM ENOENT
43 The layout does not have any valid components.
44 .TP 15
45 .SM ENOMEM
46 The layout does not have any valid components.
47 .SH "SEE ALSO"
48 .BR llapi_layout (7),
49 .BR llapi_layout_alloc (3),
50 .BR llapi_layout_file_open (3),
51 .BR llapi_layout_ost_index_set (3),
52 .BR lustreapi (7)