]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/rxrpc/ar-internal.h
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux.git] / net / rxrpc / ar-internal.h
index 5e99df80e80a775b26e0de82eec5738454398abc..7d730c438404bacaf4b1c85c9af971d40de30c85 100644 (file)
@@ -490,6 +490,7 @@ enum rxrpc_call_flag {
        RXRPC_CALL_RX_HEARD,            /* The peer responded at least once to this call */
        RXRPC_CALL_RX_UNDERRUN,         /* Got data underrun */
        RXRPC_CALL_IS_INTR,             /* The call is interruptible */
+       RXRPC_CALL_DISCONNECTED,        /* The call has been disconnected */
 };
 
 /*
@@ -1021,6 +1022,16 @@ void rxrpc_unuse_local(struct rxrpc_local *);
 void rxrpc_queue_local(struct rxrpc_local *);
 void rxrpc_destroy_all_locals(struct rxrpc_net *);
 
+static inline bool __rxrpc_unuse_local(struct rxrpc_local *local)
+{
+       return atomic_dec_return(&local->active_users) == 0;
+}
+
+static inline bool __rxrpc_use_local(struct rxrpc_local *local)
+{
+       return atomic_fetch_add_unless(&local->active_users, 1, 0) != 0;
+}
+
 /*
  * misc.c
  */