File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ struct rxrpc_peer *rxrpc_kernel_get_peer(struct rxrpc_peer *peer);
69
69
struct rxrpc_peer * rxrpc_kernel_get_call_peer (struct socket * sock , struct rxrpc_call * call );
70
70
const struct sockaddr_rxrpc * rxrpc_kernel_remote_srx (const struct rxrpc_peer * peer );
71
71
const struct sockaddr * rxrpc_kernel_remote_addr (const struct rxrpc_peer * peer );
72
+ unsigned long rxrpc_kernel_set_peer_data (struct rxrpc_peer * peer , unsigned long app_data );
73
+ unsigned long rxrpc_kernel_get_peer_data (const struct rxrpc_peer * peer );
72
74
unsigned int rxrpc_kernel_get_srtt (const struct rxrpc_peer * );
73
75
int rxrpc_kernel_charge_accept (struct socket * , rxrpc_notify_rx_t ,
74
76
rxrpc_user_attach_call_t , unsigned long , gfp_t ,
Original file line number Diff line number Diff line change @@ -344,6 +344,7 @@ struct rxrpc_peer {
344
344
struct hlist_head error_targets ; /* targets for net error distribution */
345
345
struct rb_root service_conns ; /* Service connections */
346
346
struct list_head keepalive_link ; /* Link in net->peer_keepalive[] */
347
+ unsigned long app_data ; /* Application data (e.g. afs_server) */
347
348
time64_t last_tx_at ; /* Last time packet sent here */
348
349
seqlock_t service_conn_lock ;
349
350
spinlock_t lock ; /* access lock */
Original file line number Diff line number Diff line change @@ -520,3 +520,29 @@ const struct sockaddr *rxrpc_kernel_remote_addr(const struct rxrpc_peer *peer)
520
520
(peer ? & peer -> srx .transport : & rxrpc_null_addr .transport );
521
521
}
522
522
EXPORT_SYMBOL (rxrpc_kernel_remote_addr );
523
+
524
+ /**
525
+ * rxrpc_kernel_set_peer_data - Set app-specific data on a peer.
526
+ * @peer: The peer to alter
527
+ * @app_data: The data to set
528
+ *
529
+ * Set the app-specific data on a peer. AF_RXRPC makes no effort to retain
530
+ * anything the data might refer to. The previous app_data is returned.
531
+ */
532
+ unsigned long rxrpc_kernel_set_peer_data (struct rxrpc_peer * peer , unsigned long app_data )
533
+ {
534
+ return xchg (& peer -> app_data , app_data );
535
+ }
536
+ EXPORT_SYMBOL (rxrpc_kernel_set_peer_data );
537
+
538
+ /**
539
+ * rxrpc_kernel_get_peer_data - Get app-specific data from a peer.
540
+ * @peer: The peer to query
541
+ *
542
+ * Retrieve the app-specific data from a peer.
543
+ */
544
+ unsigned long rxrpc_kernel_get_peer_data (const struct rxrpc_peer * peer )
545
+ {
546
+ return peer -> app_data ;
547
+ }
548
+ EXPORT_SYMBOL (rxrpc_kernel_get_peer_data );
You can’t perform that action at this time.
0 commit comments