Whamcloud - gitweb
LU-1961 build: fix 'dereference before null check' errors
[fs/lustre-release.git] / lnet / selftest / conrpc.h
index 281bc73..27ac86b 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -37,7 +37,7 @@
  *
  * Console rpc
  *
- * Author: Liang Zhen <liangzhen@clusterfs.com>
+ * Author: Liang Zhen <liang@whamcloud.com>
  */
 
 #ifndef __LST_CONRPC_H__
@@ -73,7 +73,8 @@ typedef struct lstcon_rpc {
         int                      crp_posted:1;   /* rpc is posted */
         int                      crp_finished:1; /* rpc is finished */
         int                      crp_unpacked:1; /* reply is unpacked */
-        int                      crp_static:1;   /* not from RPC buffer */
+       /** RPC is embedded in other structure and can't free it */
+       int                      crp_embedded:1;
         int                      crp_status;     /* console rpc errors */
         cfs_time_t               crp_stamp;      /* replied time stamp */
 } lstcon_rpc_t;
@@ -82,6 +83,10 @@ typedef struct lstcon_rpc_trans {
         cfs_list_t            tas_olink;     /* link chain on owner list */
         cfs_list_t            tas_link;      /* link chain on global list */
         int                   tas_opc;       /* operation code of transaction */
+       /* features mask is uptodate */
+       unsigned              tas_feats_updated;
+       /* test features mask */
+       unsigned              tas_features;
         cfs_waitq_t           tas_waitq;     /* wait queue head */
         cfs_atomic_t          tas_remaining; /* # of un-scheduled rpcs */
         cfs_list_t            tas_rpcs_list; /* queued requests */
@@ -106,14 +111,16 @@ typedef struct lstcon_rpc_trans {
 typedef int (* lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *);
 typedef int (* lstcon_rpc_readent_func_t)(int, srpc_msg_t *, lstcon_rpc_ent_t *);
 
-int  lstcon_sesrpc_prep(struct lstcon_node *nd, 
-                        int transop, lstcon_rpc_t **crpc);
-int  lstcon_dbgrpc_prep(struct lstcon_node *nd, lstcon_rpc_t **crpc);
-int  lstcon_batrpc_prep(struct lstcon_node *nd, int transop,
+int  lstcon_sesrpc_prep(struct lstcon_node *nd, int transop,
+                       unsigned version, lstcon_rpc_t **crpc);
+int  lstcon_dbgrpc_prep(struct lstcon_node *nd,
+                       unsigned version, lstcon_rpc_t **crpc);
+int  lstcon_batrpc_prep(struct lstcon_node *nd, int transop, unsigned version,
                         struct lstcon_tsb_hdr *tsb, lstcon_rpc_t **crpc);
-int  lstcon_testrpc_prep(struct lstcon_node *nd, int transop,
+int  lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned version,
                          struct lstcon_test *test, lstcon_rpc_t **crpc);
-int  lstcon_statrpc_prep(struct lstcon_node *nd, lstcon_rpc_t **crpc);
+int  lstcon_statrpc_prep(struct lstcon_node *nd, unsigned version,
+                        lstcon_rpc_t **crpc);
 void lstcon_rpc_put(lstcon_rpc_t *crpc);
 int  lstcon_rpc_trans_prep(cfs_list_t *translist,
                            int transop, lstcon_rpc_trans_t **transpp);