To abtract the lock and unlock operations on the requestor spin lock. The helpers will come in handy in hv_pci. No functional change.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -1042,6 +1042,21 @@ struct vmbus_channel { · 1041 unmodified lines | ||
| 1042 | 1042 | u32 max_pkt_size; |
| 1043 | 1043 | }; |
| 1044 | 1044 | |
| 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 | + | |
| 1045 | 1060 | u64 vmbus_next_request_id(struct vmbus_channel *channel, u64 rqst_addr); |
| 1046 | 1061 | u64 __vmbus_request_addr_match(struct vmbus_channel *channel, u64 trans_id, |
| 1047 | 1062 | u64 rqst_addr); |