hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/net/tipc/subscr.h
....@@ -47,12 +47,15 @@
4747
4848 /**
4949 * struct tipc_subscription - TIPC network topology subscription object
50
- * @subscriber: pointer to its subscriber
51
- * @seq: name sequence associated with subscription
50
+ * @kref: reference count for this subscription
51
+ * @net: network namespace associated with subscription
5252 * @timer: timer governing subscription duration (optional)
53
- * @nameseq_list: adjacent subscriptions in name sequence's subscription list
53
+ * @service_list: adjacent subscriptions in name sequence's subscription list
5454 * @sub_list: adjacent subscriptions in subscriber's subscription list
5555 * @evt: template for events generated by subscription
56
+ * @conid: connection identifier of topology server
57
+ * @inactive: true if this subscription is inactive
58
+ * @lock: serialize up/down and timer events
5659 */
5760 struct tipc_subscription {
5861 struct kref kref;
....@@ -63,7 +66,7 @@
6366 struct tipc_event evt;
6467 int conid;
6568 bool inactive;
66
- spinlock_t lock; /* serialize up/down and timer events */
69
+ spinlock_t lock;
6770 };
6871
6972 struct tipc_subscription *tipc_sub_subscribe(struct net *net,
....@@ -96,6 +99,16 @@
9699 (swap_ ? swab32(val__) : val__); \
97100 })
98101
102
+/* tipc_sub_write - write val_ to field_ of struct sub_ in user endian format
103
+ */
104
+#define tipc_sub_write(sub_, field_, val_) \
105
+ ({ \
106
+ struct tipc_subscr *sub__ = sub_; \
107
+ u32 val__ = val_; \
108
+ int swap_ = !((sub__)->filter & TIPC_FILTER_MASK); \
109
+ (sub__)->field_ = swap_ ? swab32(val__) : val__; \
110
+ })
111
+
99112 /* tipc_evt_write - write val_ to field_ of struct evt_ in user endian format
100113 */
101114 #define tipc_evt_write(evt_, field_, val_) \