aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/ref.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/ref.h')
-rw-r--r--net/tipc/ref.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/net/tipc/ref.h b/net/tipc/ref.h
index 429cde57228a..4f8f9f40dcac 100644
--- a/net/tipc/ref.h
+++ b/net/tipc/ref.h
@@ -54,7 +54,7 @@ struct reference {
54}; 54};
55 55
56/** 56/**
57 * struct ref_table - table of TIPC object reference entries 57 * struct tipc_ref_table - table of TIPC object reference entries
58 * @entries: pointer to array of reference entries 58 * @entries: pointer to array of reference entries
59 * @index_mask: bitmask for array index portion of reference values 59 * @index_mask: bitmask for array index portion of reference values
60 * @first_free: array index of first unused object reference entry 60 * @first_free: array index of first unused object reference entry
@@ -68,24 +68,24 @@ struct ref_table {
68 u32 last_free; 68 u32 last_free;
69}; 69};
70 70
71extern struct ref_table ref_table; 71extern struct ref_table tipc_ref_table;
72 72
73int ref_table_init(u32 requested_size, u32 start); 73int tipc_ref_table_init(u32 requested_size, u32 start);
74void ref_table_stop(void); 74void tipc_ref_table_stop(void);
75 75
76u32 ref_acquire(void *object, spinlock_t **lock); 76u32 tipc_ref_acquire(void *object, spinlock_t **lock);
77void ref_discard(u32 ref); 77void tipc_ref_discard(u32 ref);
78 78
79 79
80/** 80/**
81 * ref_lock - lock referenced object and return pointer to it 81 * tipc_ref_lock - lock referenced object and return pointer to it
82 */ 82 */
83 83
84static inline void *ref_lock(u32 ref) 84static inline void *tipc_ref_lock(u32 ref)
85{ 85{
86 if (likely(ref_table.entries)) { 86 if (likely(tipc_ref_table.entries)) {
87 struct reference *r = 87 struct reference *r =
88 &ref_table.entries[ref & ref_table.index_mask]; 88 &tipc_ref_table.entries[ref & tipc_ref_table.index_mask];
89 89
90 spin_lock_bh(&r->lock); 90 spin_lock_bh(&r->lock);
91 if (likely(r->data.reference == ref)) 91 if (likely(r->data.reference == ref))
@@ -96,31 +96,31 @@ static inline void *ref_lock(u32 ref)
96} 96}
97 97
98/** 98/**
99 * ref_unlock - unlock referenced object 99 * tipc_ref_unlock - unlock referenced object
100 */ 100 */
101 101
102static inline void ref_unlock(u32 ref) 102static inline void tipc_ref_unlock(u32 ref)
103{ 103{
104 if (likely(ref_table.entries)) { 104 if (likely(tipc_ref_table.entries)) {
105 struct reference *r = 105 struct reference *r =
106 &ref_table.entries[ref & ref_table.index_mask]; 106 &tipc_ref_table.entries[ref & tipc_ref_table.index_mask];
107 107
108 if (likely(r->data.reference == ref)) 108 if (likely(r->data.reference == ref))
109 spin_unlock_bh(&r->lock); 109 spin_unlock_bh(&r->lock);
110 else 110 else
111 err("ref_unlock() invoked using obsolete reference\n"); 111 err("tipc_ref_unlock() invoked using obsolete reference\n");
112 } 112 }
113} 113}
114 114
115/** 115/**
116 * ref_deref - return pointer referenced object (without locking it) 116 * tipc_ref_deref - return pointer referenced object (without locking it)
117 */ 117 */
118 118
119static inline void *ref_deref(u32 ref) 119static inline void *tipc_ref_deref(u32 ref)
120{ 120{
121 if (likely(ref_table.entries)) { 121 if (likely(tipc_ref_table.entries)) {
122 struct reference *r = 122 struct reference *r =
123 &ref_table.entries[ref & ref_table.index_mask]; 123 &tipc_ref_table.entries[ref & tipc_ref_table.index_mask];
124 124
125 if (likely(r->data.reference == ref)) 125 if (likely(r->data.reference == ref))
126 return r->object; 126 return r->object;