1 .TH llapi_layout_file_open 3 "2013 Oct 31" "Lustre User API"
3 llapi_layout_file_open, llapi_layout_file_create \- open and apply a layout to a Lustre file
6 .B #include <lustre/lustreapi.h>
8 .BI "int llapi_layout_file_open(char *" path ", int " open_flags ", int " mode ,
9 .BI " const struct llapi_layout *" layout );
11 .BI "int llapi_layout_file_create(char *" path ", int " open_flags ", int " mode ,
12 .BI " const struct llapi_layout *" layout );
17 .B llapi_layout_file_open()
19 .B llapi_layout_file_create()
20 open and possibly create a file at
22 with the permissions specified in
24 using the Lustre layout attributes in
26 The returned file descriptor may be used in subsequent system calls
30 etc.), and closed with
32 One access mode and zero or more file creation flags and file status
33 flags may be bitwise-or'd in
41 is not on a Lustre filesystem this function will fail and set
48 .B " llapi_layout_file_create(path, open_flags, mode, layout)"
50 shall be equivalent to:
52 .B " llapi_layout_file_open(path, open_flags|O_CREAT|O_EXCL, mode, layout)"
58 will not be applied to a file which already exists. Callers requiring a
59 guarantee that the opened file is created with the specified
64 .BR llapi_layout_file_create() .
69 may be specified, in which case the standard Lustre behavior for
70 assigning layouts to newly-created files will apply.
72 If the pool name attribute of
74 has been set, it must refer to an OST pool that exists and contains one
75 or more OSTs, otherwise these functions will fail and set
80 .BR llapi_layout_pool_name_set (3).
83 .B llapi_layout_file_open()
85 .B llapi_layout_file_create()
86 return a new file descriptor, or -1 if an error occurred (in which
87 case, errno is set appropriately).
92 does not reside on a Lustre filesystem.
95 An invalid argument was specified.
99 .BR llapi_layout_alloc (3),
100 .BR llapi_layout_pool_name_set (3),