Whamcloud - gitweb
LU-4788 lfsck: replace cfs_list_t with list_head
[fs/lustre-release.git] / lustre / doc / llapi_layout_ost_index_get.3
1 .TH llapi_layout_ost_index_get 3 "2013 Oct 31" "Lustre User API"
2 .SH NAME
3 llapi_layout_ost_index_get, llapi_layout_ost_index_set \- get or set the
4 OST index of a stripe of a Lustre file
5 .SH SYNOPSIS
6 .nf
7 .B #include <lustre/lustreapi.h>
8 .PP
9 .BI "int llapi_layout_ost_index_get(const struct llapi_layout *" layout ,
10 .BI "                               int " stripe_number ", uint64_t *" ost_index );
11 .PP
12 .BI "int llapi_layout_ost_index_set(struct llapi_layout *" layout ,
13 .BI "                               int " stripe_number ", uint64_t " ost_index );
14 .fi
15 .SH DESCRIPTION
16 .PP
17 .B llapi_layout_ost_index_get()
18 stores into
19 .I ost_index
20 the index number of the Lustre OST associated with stripe number
21 .I stripe_number
22 in layout
23 .IR layout .
24 .PP
25 .B llapi_layout_ost_index_set()
26 sets the OST index of stripe number
27 .I stripe_number
28 in layout
29 .I layout
30 to
31 .IR ost_index .
32 This allows an application to control which OSTs will be used to
33 allocate storage for a file.  Setting the OST index is currently only
34 supported for stripe 0.
35 .PP
36 It is an error to call
37 .B llapi_layout_ost_index_get()
38 with a
39 .I layout
40 that was not initialized with with one of
41 .BR llapi_layout_get_by_fd() ,
42 .BR llapi_layout_get_by_fid() ,
43 or
44 .BR llapi_layout_get_by_path() .
45 .PP
46 An
47 .I ost_index
48 value of
49 .B LLAPI_LAYOUT_DEFAULT
50 means that an index will be automatically assigned by the filesystem.
51 .SH RETURN VALUES
52 .LP
53 .B llapi_layout_ost_index_get()
54 and
55 .B llapi_layout_ost_index_set()
56 return 0 on success, or -1 if an error occurred (in which case, errno is
57 set appropriately).
58 .SH ERRORS
59 .TP 15
60 .SM EINVAL
61 An invalid argument was specified.
62 .TP 15
63 .SM EOPNOTSUPP
64 Attempted to set index of a stripe other than stripe 0.
65 .SH "SEE ALSO"
66 .BR llapi_layout_alloc (3),
67 .BR llapi_layout_file_open (3),
68 .BR llapi_layout (7),
69 .BR liblustreapi (7)