From bc205ed19bdb56576b291830bc3f752aef5e3923 Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Thu, 15 Mar 2012 13:22:27 +0300 Subject: CIFS: Prepare credits code for a slot reservation that is essential for CIFS/SMB/SMB2 oplock breaks and SMB2 echos. Reviewed-by: Jeff Layton Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/cifsglob.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'fs/cifs/cifsglob.h') diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index d55de9684df9..2309a67738bf 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -315,12 +315,22 @@ in_flight(struct TCP_Server_Info *server) return num; } +static inline int* +get_credits_field(struct TCP_Server_Info *server) +{ + /* + * This will change to switch statement when we reserve slots for echos + * and oplock breaks. + */ + return &server->credits; +} + static inline bool -has_credits(struct TCP_Server_Info *server) +has_credits(struct TCP_Server_Info *server, int *credits) { int num; spin_lock(&server->req_lock); - num = server->credits; + num = *credits; spin_unlock(&server->req_lock); return num > 0; } -- cgit v1.2.3