Whamcloud - gitweb
LU-12624 lod: alloc dir stripes by QoS
[fs/lustre-release.git] / lustre / include / lustre_update.h
index df1786f..78cd3d4 100644 (file)
@@ -20,7 +20,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2013, 2015, Intel Corporation.
+ * Copyright (c) 2013, 2017, Intel Corporation.
  */
 /*
  * lustre/include/lustre_update.h
@@ -34,7 +34,6 @@
 #include <lustre_net.h>
 #include <obj_update.h>
 
-#define OUT_UPDATE_INIT_BUFFER_SIZE    4096
 #define OUT_UPDATE_REPLY_SIZE          4096
 #define OUT_BULK_BUFFER_SIZE           4096
 
@@ -242,18 +241,15 @@ object_update_result_insert(struct object_update_reply *reply,
                            int rc)
 {
        struct object_update_result *update_result;
-       char *ptr;
 
        update_result = object_update_result_get(reply, index, NULL);
-       LASSERT(update_result != NULL);
+       LASSERT(update_result);
 
        update_result->our_rc = ptlrpc_status_hton(rc);
-       if (data != NULL && data_len > 0) {
-               LASSERT(data != NULL);
-               ptr = (char *)update_result +
-                       cfs_size_round(sizeof(struct object_update_reply));
+       if (rc >= 0) {
+               if (data_len > 0 && data)
+                       memcpy(update_result->our_data, data, data_len);
                update_result->our_datalen = data_len;
-               memcpy(ptr, data, data_len);
        }
 
        reply->ourp_lens[index] = cfs_size_round(data_len +
@@ -418,10 +414,8 @@ int out_create_pack(const struct lu_env *env, struct object_update *update,
                    size_t *max_update_size, const struct lu_fid *fid,
                    const struct lu_attr *attr, struct dt_allocation_hint *hint,
                    struct dt_object_format *dof);
-int out_object_destroy_pack(const struct lu_env *env,
-                           struct object_update *update,
-                           size_t *max_update_size,
-                           const struct lu_fid *fid);
+int out_destroy_pack(const struct lu_env *env, struct object_update *update,
+                    size_t *max_update_size, const struct lu_fid *fid);
 int out_index_delete_pack(const struct lu_env *env,
                          struct object_update *update, size_t *max_update_size,
                          const struct lu_fid *fid, const struct dt_key *key);
@@ -460,6 +454,9 @@ int out_xattr_get_pack(const struct lu_env *env,
                       struct object_update *update, size_t *max_update_size,
                       const struct lu_fid *fid, const char *name,
                       const int bufsize);
+int out_xattr_list_pack(const struct lu_env *env, struct object_update *update,
+                      size_t *max_update_size, const struct lu_fid *fid,
+                      const int bufsize);
 int out_read_pack(const struct lu_env *env, struct object_update *update,
                  size_t *max_update_length, const struct lu_fid *fid,
                  size_t size, loff_t pos);
@@ -516,8 +513,8 @@ size_t update_records_ref_add_size(const struct lu_env *env,
                                   const struct lu_fid *fid);
 size_t update_records_ref_del_size(const struct lu_env *env,
                                   const struct lu_fid *fid);
-size_t update_records_object_destroy_size(const struct lu_env *env,
-                                         const struct lu_fid *fid);
+size_t update_records_destroy_size(const struct lu_env *env,
+                                  const struct lu_fid *fid);
 size_t update_records_index_insert_size(const struct lu_env *env,
                                        const struct lu_fid *fid,
                                        const struct dt_rec *rec,
@@ -577,14 +574,13 @@ int update_records_ref_del_pack(const struct lu_env *env,
                                unsigned int *param_count,
                                size_t *max_param_size,
                                const struct lu_fid *fid);
-int update_records_object_destroy_pack(const struct lu_env *env,
-                                      struct update_ops *ops,
-                                      unsigned int *op_count,
-                                      size_t *max_ops_size,
-                                      struct update_params *params,
-                                      unsigned int *param_count,
-                                      size_t *max_param_size,
-                                      const struct lu_fid *fid);
+int update_records_destroy_pack(const struct lu_env *env,
+                               struct update_ops *ops, unsigned int *op_count,
+                               size_t *max_ops_size,
+                               struct update_params *params,
+                               unsigned int *param_count,
+                               size_t *max_param_size,
+                               const struct lu_fid *fid);
 int update_records_index_insert_pack(const struct lu_env *env,
                                     struct update_ops *ops,
                                     unsigned int *op_count,