Whamcloud - gitweb
LU-11367 som: integrate LSOM with lfs find
[fs/lustre-release.git] / lustre / include / lustre / lustreapi.h
index 7a29c13..9844822 100644 (file)
@@ -263,7 +263,8 @@ struct find_param {
                                 fp_exclude_hash_type:1,
                                 fp_yaml:1,     /* output layout in YAML */
                                 fp_check_blocks:1,
-                                fp_exclude_blocks:1;
+                                fp_exclude_blocks:1,
+                                fp_lazy:1;
 
        enum llapi_layout_verbose fp_verbose;
        int                      fp_quiet;
@@ -320,6 +321,7 @@ struct find_param {
                                 fp_obds_printed:1;
        unsigned int             fp_depth;
        unsigned int             fp_hash_type;
+       unsigned int             fp_time_margin; /* time margin in seconds */
 };
 
 int llapi_ostlist(char *path, struct find_param *param);
@@ -565,8 +567,8 @@ struct llapi_layout *llapi_layout_get_by_fd(int fd, uint32_t flags);
 
 /**
  * Return a pointer to a newly-allocated opaque data type containing the
- * layout for the file associated with Lustre file identifier string
- * \a fidstr.  The string \a path must name a path within the
+ * layout for the file associated with Lustre file identifier
+ * \a fid.  The string \a path must name a path within the
  * filesystem that contains the file being looked up, such as the
  * filesystem root.  The returned pointer should be freed with
  * llapi_layout_free() when it is no longer needed.  Failure is
@@ -577,6 +579,32 @@ struct llapi_layout *llapi_layout_get_by_fid(const char *path,
                                             const struct lu_fid *fid,
                                             uint32_t flags);
 
+enum llapi_layout_xattr_flags {
+       LLAPI_LXF_CHECK = 0x0001,
+       LLAPI_LXF_COPY  = 0x0002,
+};
+
+/**
+ * Return a pointer to a newly-allocated opaque data type containing the
+ * layout for the file associated with extended attribute \a lov_xattr.  The
+ * length of the extended attribute is \a lov_xattr_size. The \a lov_xattr
+ * should be raw xattr without being swapped, since this function will swap it
+ * properly. Thus, \a lov_xattr will be modified during the process. If the
+ * \a LLAPI_LXF_CHECK flag of \a flags 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 \a LLAPI_LXF_CHECK flag should be
+ * cleared if the xattr belongs to a directory. If the \a LLAPI_LXF_COPY flag
+ * of \a flags is set, this function will use a temporary buffer for byte
+ * swapping when necessary, leaving \a lov_xattr untouched. Otherwise, the byte
+ * swapping will be done to the \a lov_xattr buffer directly.  The returned
+ * pointer should be freed with llapi_layout_free() when it is no longer
+ * needed.  Failure is  * indicated with a NULL return value and an appropriate
+ * error code stored in errno.
+ */
+struct llapi_layout *llapi_layout_get_by_xattr(void *lov_xattr,
+                                              ssize_t lov_xattr_size,
+                                              uint32_t flags);
+
 /**
  * Allocate a new layout. Use this when creating a new file with
  * llapi_layout_file_create().
@@ -978,11 +1006,13 @@ int llapi_mirror_set(int fd, unsigned int id);
 int llapi_mirror_clear(int fd);
 ssize_t llapi_mirror_read(int fd, unsigned int id,
                           void *buf, size_t count, off_t pos);
-ssize_t llapi_mirror_copy_many(int fd, unsigned int src,
-                               unsigned int *dst, size_t count);
+ssize_t llapi_mirror_copy_many(int fd, __u16 src, __u16 *dst, size_t count);
 int llapi_mirror_copy(int fd, unsigned int src, unsigned int dst,
                       off_t pos, size_t count);
 
+int llapi_heat_get(int fd, struct lu_heat *heat);
+int llapi_heat_set(int fd, __u64 flags);
+
 /** @} llapi */
 
 #if defined(__cplusplus)