diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-03-15 06:22:27 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2012-03-21 12:35:36 -0400 |
commit | bc205ed19bdb56576b291830bc3f752aef5e3923 (patch) | |
tree | abdda57d027c601d40027572b2d070b9432670a2 /fs/cifs/cifsglob.h | |
parent | 5bc594982f49220d33e927e3c9e028bf87b4745c (diff) |
CIFS: Prepare credits code for a slot reservation
that is essential for CIFS/SMB/SMB2 oplock breaks and SMB2 echos.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 14 |
1 files changed, 12 insertions, 2 deletions
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) | |||
315 | return num; | 315 | return num; |
316 | } | 316 | } |
317 | 317 | ||
318 | static inline int* | ||
319 | get_credits_field(struct TCP_Server_Info *server) | ||
320 | { | ||
321 | /* | ||
322 | * This will change to switch statement when we reserve slots for echos | ||
323 | * and oplock breaks. | ||
324 | */ | ||
325 | return &server->credits; | ||
326 | } | ||
327 | |||
318 | static inline bool | 328 | static inline bool |
319 | has_credits(struct TCP_Server_Info *server) | 329 | has_credits(struct TCP_Server_Info *server, int *credits) |
320 | { | 330 | { |
321 | int num; | 331 | int num; |
322 | spin_lock(&server->req_lock); | 332 | spin_lock(&server->req_lock); |
323 | num = server->credits; | 333 | num = *credits; |
324 | spin_unlock(&server->req_lock); | 334 | spin_unlock(&server->req_lock); |
325 | return num > 0; | 335 | return num > 0; |
326 | } | 336 | } |