Whamcloud - gitweb
LU-7318 out: dynamic reply size
[fs/lustre-release.git] / lustre / include / lustre_update.h
index f9fd97e..1ec8b4d 100644 (file)
@@ -20,7 +20,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2013, 2014, Intel Corporation.
+ * Copyright (c) 2013, 2015, Intel Corporation.
  */
 /*
  * lustre/include/lustre_update.h
@@ -34,8 +34,8 @@
 #include <dt_object.h>
 
 #define OUT_UPDATE_INIT_BUFFER_SIZE    4096
-/* 16KB, the current biggest size is llog header(8KB) */
-#define OUT_UPDATE_REPLY_SIZE          16384
+#define OUT_UPDATE_REPLY_SIZE          4096
+#define OUT_BULK_BUFFER_SIZE           4096
 
 struct dt_key;
 struct dt_rec;
@@ -227,7 +227,7 @@ object_update_result_insert(struct object_update_reply *reply,
        LASSERT(update_result != NULL);
 
        update_result->our_rc = ptlrpc_status_hton(rc);
-       if (data_len > 0) {
+       if (data != NULL && data_len > 0) {
                LASSERT(data != NULL);
                ptr = (char *)update_result +
                        cfs_size_round(sizeof(struct object_update_reply));
@@ -261,7 +261,7 @@ object_update_result_data_get(const struct object_update_reply *reply,
        lbuf->lb_buf = update_result->our_data;
        lbuf->lb_len = update_result->our_datalen;
 
-       return 0;
+       return result;
 }
 
 /**
@@ -285,6 +285,7 @@ struct top_multiple_thandle {
        atomic_t                tmt_refcount;
        /* Other sub transactions will be listed here. */
        struct list_head        tmt_sub_thandle_list;
+       spinlock_t              tmt_sub_lock;
 
        struct list_head        tmt_commit_list;
        /* All of update records will packed here */
@@ -389,7 +390,8 @@ struct thandle_exec_args {
 int out_update_pack(const struct lu_env *env, struct object_update *update,
                    size_t *max_update_size, enum update_type op,
                    const struct lu_fid *fid, unsigned int params_count,
-                   __u16 *param_sizes, const void **param_bufs);
+                   __u16 *param_sizes, const void **param_bufs,
+                   __u32 reply_size);
 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,
@@ -434,7 +436,8 @@ int out_index_lookup_pack(const struct lu_env *env,
                          const struct dt_key *key);
 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 struct lu_fid *fid, const char *name,
+                      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);