Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / volser / voltrans_inline.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * Copyright 2009, Sine Nomine Associates
4 * All Rights Reserved.
5 *
6 * This software has been released under the terms of the IBM Public
7 * License. For details, see the LICENSE file in the top-level source
8 * directory or online at http://www.openafs.org/dl/license10.html
9 */
10
11 #ifndef _VOLTRANS_INLINE_H
12 #define _VOLTRANS_INLINE_H
13
14 #include "volser.h"
15
16 /**
17 * Save the most recent call and procedure name for
18 * transaction status reporting.
19 *
20 * \param tt transaction object
21 * \param call the rx call object, NULL if none
22 * \param name procedure name, NULL if none
23 *
24 * \pre VTRANS_OBJ_LOCK on tt must be held
25 */
26 static_inline void
27 TSetRxCall_r(struct volser_trans *tt, struct rx_call *call, const char *name)
28 {
29 if (name) {
30 strlcpy(tt->lastProcName, name, sizeof(tt->lastProcName));
31 }
32 if (call) {
33 tt->rxCallPtr = call;
34 }
35 }
36
37 /**
38 * Clears the most recent call object.
39 *
40 * \param tt transaction object
41 *
42 * \pre VTRANS_OBJ_LOCK on tt must be held
43 */
44 static_inline void
45 TClearRxCall_r(struct volser_trans *tt)
46 {
47 tt->rxCallPtr = NULL;
48 }
49
50 /**
51 * Save the most recent call and procedure name for
52 * transaction status reporting.
53 *
54 * \param tt transaction object
55 * \param call the rx call object, NULL if none
56 * \param name procedure name, NULL if none
57 *
58 * \pre VTRANS_OBJ_LOCK on tt must not be held
59 */
60 static_inline void
61 TSetRxCall(struct volser_trans *tt, struct rx_call *call, const char *name)
62 {
63 VTRANS_OBJ_LOCK(tt);
64 TSetRxCall_r(tt, call, name);
65 VTRANS_OBJ_UNLOCK(tt);
66 }
67
68 /**
69 * Clears the most recent call object.
70 *
71 * \param tt transaction object
72 *
73 * \pre VTRANS_OBJ_LOCK on tt must not be held
74 */
75 static_inline void
76 TClearRxCall(struct volser_trans *tt)
77 {
78 VTRANS_OBJ_LOCK(tt);
79 TClearRxCall_r(tt);
80 VTRANS_OBJ_UNLOCK(tt);
81 }
82
83 #endif /* _VOLTRANS_INLINE_H */