History

Drivers: hv: vmbus: Introduce {lock,unlock}_requestor()

To abtract the lock and unlock operations on the requestor spin lock. The helpers will come in handy in hv_pci. No functional change.

Andrea Parri (Microsoft) committed 4 years ago

Commit b91eaf71 parent 0aadb6a2 files · +20 −6Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/hyperv.h+15−0
@@ -1042,6 +1042,21 @@ struct vmbus_channel { · 1041 unmodified lines
10421042 u32 max_pkt_size;
10431043 };
10441044
1045+#define lock_requestor(channel, flags) \
1046+do { \
1047+ struct vmbus_requestor *rqstor = &(channel)->requestor; \
1048+ \
1049+ spin_lock_irqsave(&rqstor->req_lock, flags); \
1050+} while (0)
1051+
1052+static __always_inline void unlock_requestor(struct vmbus_channel *channel,
1053+ unsigned long flags)
1054+{
1055+ struct vmbus_requestor *rqstor = &channel->requestor;
1056+
1057+ spin_unlock_irqrestore(&rqstor->req_lock, flags);
1058+}
1059+
10451060 u64 vmbus_next_request_id(struct vmbus_channel *channel, u64 rqst_addr);
10461061 u64 __vmbus_request_addr_match(struct vmbus_channel *channel, u64 trans_id,
10471062 u64 rqst_addr);