Lines Matching refs:txb
22 struct rxrpc_txbuf *txb;
24 txb = kmalloc(sizeof(*txb), gfp);
25 if (txb) {
26 INIT_LIST_HEAD(&txb->call_link);
27 INIT_LIST_HEAD(&txb->tx_link);
28 refcount_set(&txb->ref, 1);
29 txb->call_debug_id = call->debug_id;
30 txb->debug_id = atomic_inc_return(&rxrpc_txbuf_debug_ids);
31 txb->space = sizeof(txb->data);
32 txb->len = 0;
33 txb->offset = 0;
34 txb->flags = 0;
35 txb->ack_why = 0;
36 txb->seq = call->tx_prepared + 1;
37 txb->wire.epoch = htonl(call->conn->proto.epoch);
38 txb->wire.cid = htonl(call->cid);
39 txb->wire.callNumber = htonl(call->call_id);
40 txb->wire.seq = htonl(txb->seq);
41 txb->wire.type = packet_type;
42 txb->wire.flags = call->conn->out_clientflag;
43 txb->wire.userStatus = 0;
44 txb->wire.securityIndex = call->security_ix;
45 txb->wire._rsvd = 0;
46 txb->wire.serviceId = htons(call->dest_srx.srx_service);
48 trace_rxrpc_txbuf(txb->debug_id,
49 txb->call_debug_id, txb->seq, 1,
56 return txb;
59 void rxrpc_get_txbuf(struct rxrpc_txbuf *txb, enum rxrpc_txbuf_trace what)
63 __refcount_inc(&txb->ref, &r);
64 trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, r + 1, what);
67 void rxrpc_see_txbuf(struct rxrpc_txbuf *txb, enum rxrpc_txbuf_trace what)
69 int r = refcount_read(&txb->ref);
71 trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, r, what);
76 struct rxrpc_txbuf *txb = container_of(rcu, struct rxrpc_txbuf, rcu);
78 trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, 0,
80 kfree(txb);
84 void rxrpc_put_txbuf(struct rxrpc_txbuf *txb, enum rxrpc_txbuf_trace what)
91 if (txb) {
92 debug_id = txb->debug_id;
93 call_debug_id = txb->call_debug_id;
94 seq = txb->seq;
95 dead = __refcount_dec_and_test(&txb->ref, &r);
98 call_rcu(&txb->rcu, rxrpc_free_txbuf);
107 struct rxrpc_txbuf *txb;
113 while ((txb = list_first_entry_or_null(&call->tx_buffer,
116 if (before(hard_ack, txb->seq))
119 if (txb->seq != call->tx_bottom + 1)
120 rxrpc_see_txbuf(txb, rxrpc_txbuf_see_out_of_step);
121 ASSERTCMP(txb->seq, ==, call->tx_bottom + 1);
123 list_del_rcu(&txb->call_link);
127 rxrpc_put_txbuf(txb, rxrpc_txbuf_put_rotated);