Whamcloud - gitweb
LU-11776 utils: add support lfs find with mdt hash flag
[fs/lustre-release.git] / lustre / doc / llapi_layout_get_by_fd.3
index a29e9b0..dfd0500 100644 (file)
@@ -9,14 +9,19 @@ obtain the layout of a Lustre file
 .BI "struct llapi_layout *llapi_layout_get_by_fd(int "fd ", uint32_t " flags );
 .PP
 .BI "struct llapi_layout *llapi_layout_get_by_fid(const char *"lustre_path ,
-.BI "                                             const lustre_fid *"fid ,
+.BI "                                             const struct lu_fid *"fid ,
 .BI "                                             uint32_t " flags );
 .PP
 .BI "struct llapi_layout *llapi_layout_get_by_path(const char *"path ,
 .BI "                                              uint32_t " flags );
+.PP
+.BI "struct llapi_layout *llapi_layout_get_by_xattr(void *"lov_xattr ,
+.BI "                                               ssize_t " lov_xattr_size ,
+.BI "                                               uint32_t " xattr_flags );
 .fi
 .SH DESCRIPTION
 .PP
+.BR llapi_layout_get_by_xattr() ,
 .BR llapi_layout_get_by_fd() ,
 .BR llapi_layout_get_by_fid() ,
 and
@@ -24,6 +29,7 @@ and
 return a pointer to a newly-allocated
 .B struct llapi_layout
 containing the layout information for the file referenced by
+.IR lov_xattr ,
 .IR fd ,
 .IR fid ,
 or
@@ -39,6 +45,15 @@ The pointer should be freed with
 when it is no longer needed.
 .PP
 For
+.BR llapi_layout_get_by_xattr() ,
+.I lov_xattr
+is a Lustre layout extended attribute (LOV EA) from a file or directory in
+a Lustre filesystem. The
+.I lov_xattr
+should be the raw xattr without being byte-swapped, since this function will
+swap it properly.
+.PP
+For
 .BR llapi_layout_get_by_fd() ,
 .I fd
 is a valid open file descriptor for a file or directory in a Lustre
@@ -55,7 +70,7 @@ It is typically the filesystem root, but may also be any path beneath
 the root.  Use the function
 .BR llapi_path2fid (3)
 to obtain a
-.B lustre_fid
+.B struct lu_fid
 associated with a given path.
 .PP
 The function
@@ -66,13 +81,17 @@ argument that names a file or directory in a Lustre filesystem.
 .PP
 Zero or more flags may be bitwise-or'd together in
 .I flags
+or
+.I xattr_flags
 to control how a layout is retrieved.  Currently
 .B llapi_layout_get_by_path()
 accepts only one flag, and
 .B llapi_layout_get_by_fd()
 and
 .B llapi_layout_get_by_fid()
-do not accept any flags. The list of flags is as follows:
+do not accept any flags. The list of flags that can be used in
+.I flags
+is as follows:
 .TP 5
 .SM LAYOUT_GET_EXPECTED
 Unspecified attribute values are replaced by the literal default values
@@ -107,6 +126,29 @@ since stripe size is unspecified, while
 .B llapi_layout_get_by_path(D, LAYOUT_GET_EXPECTED)
 reports the literal value 1048576.  Both forms report a stripe count
 of 2, since that attribute is specified.
+.PP
+The list of flags that can be used in
+.I xattr_flags
+is as follows:
+.TP 5
+.SM LLAPI_LXF_CHECK
+If the
+.B LLAPI_LXF_CHECK
+flag is set, this function will check whether the objects count in lum
+is consistent with the stripe count in lum. This check only apply to
+regular file, so
+.B LLAPI_LXF_CHECK
+flag should be cleared if the xattr belongs to a directory.
+.TP
+.SM LLAPI_LXF_COPY
+If the
+.B LLAPI_LXF_COPY
+flag is set, this function will use a temporary buffer for byte swapping
+when necessary, leaving
+.I lov_xattr
+untouched. Otherwise, the byte swapping will be done to the
+.I lov_xattr
+buffer directly.
 .SH RETURN VALUES
 .LP
 .BR llapi_layout_get_by_fd() ,
@@ -139,4 +181,4 @@ The kernel returned less than the expected amount of data.
 .BR llapi_layout_file_open (3),
 .BR llapi_path2fid (3),
 .BR llapi_layout (7),
-.BR liblustreapi (7)
+.BR lustreapi (7)