diff options
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 703ef5c6fdb1..c273c12de98e 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -690,3 +690,22 @@ backup_cred(struct cifs_sb_info *cifs_sb) | |||
690 | 690 | ||
691 | return false; | 691 | return false; |
692 | } | 692 | } |
693 | |||
694 | void | ||
695 | cifs_add_credits(struct TCP_Server_Info *server, const unsigned int add) | ||
696 | { | ||
697 | spin_lock(&server->req_lock); | ||
698 | server->credits += add; | ||
699 | server->in_flight--; | ||
700 | spin_unlock(&server->req_lock); | ||
701 | wake_up(&server->request_q); | ||
702 | } | ||
703 | |||
704 | void | ||
705 | cifs_set_credits(struct TCP_Server_Info *server, const int val) | ||
706 | { | ||
707 | spin_lock(&server->req_lock); | ||
708 | server->credits = val; | ||
709 | server->oplocks = val > 1 ? enable_oplocks : false; | ||
710 | spin_unlock(&server->req_lock); | ||
711 | } | ||