diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-05-17 09:53:29 -0400 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-05-23 04:33:12 -0400 |
commit | 452757897a311b939ae202744754ffd9ce6704d8 (patch) | |
tree | 29f14cb0476af25d2bcd10883e0d612711462f29 /fs/cifs/smb1ops.c | |
parent | 8aa26f3ed80ddbaf78804b6481fcfdbd447caa1c (diff) |
CIFS: Move add/set_credits and get_credits_field to ops structure
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
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/smb1ops.c')
-rw-r--r-- | fs/cifs/smb1ops.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index ddc8ca6c3090..d9d615fbed3f 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -100,11 +100,39 @@ cifs_find_mid(struct TCP_Server_Info *server, char *buffer) | |||
100 | return NULL; | 100 | return NULL; |
101 | } | 101 | } |
102 | 102 | ||
103 | static void | ||
104 | cifs_add_credits(struct TCP_Server_Info *server, const unsigned int add) | ||
105 | { | ||
106 | spin_lock(&server->req_lock); | ||
107 | server->credits += add; | ||
108 | server->in_flight--; | ||
109 | spin_unlock(&server->req_lock); | ||
110 | wake_up(&server->request_q); | ||
111 | } | ||
112 | |||
113 | static void | ||
114 | cifs_set_credits(struct TCP_Server_Info *server, const int val) | ||
115 | { | ||
116 | spin_lock(&server->req_lock); | ||
117 | server->credits = val; | ||
118 | server->oplocks = val > 1 ? enable_oplocks : false; | ||
119 | spin_unlock(&server->req_lock); | ||
120 | } | ||
121 | |||
122 | static int * | ||
123 | cifs_get_credits_field(struct TCP_Server_Info *server) | ||
124 | { | ||
125 | return &server->credits; | ||
126 | } | ||
127 | |||
103 | struct smb_version_operations smb1_operations = { | 128 | struct smb_version_operations smb1_operations = { |
104 | .send_cancel = send_nt_cancel, | 129 | .send_cancel = send_nt_cancel, |
105 | .compare_fids = cifs_compare_fids, | 130 | .compare_fids = cifs_compare_fids, |
106 | .setup_request = cifs_setup_request, | 131 | .setup_request = cifs_setup_request, |
107 | .check_receive = cifs_check_receive, | 132 | .check_receive = cifs_check_receive, |
133 | .add_credits = cifs_add_credits, | ||
134 | .set_credits = cifs_set_credits, | ||
135 | .get_credits_field = cifs_get_credits_field, | ||
108 | .read_data_offset = cifs_read_data_offset, | 136 | .read_data_offset = cifs_read_data_offset, |
109 | .read_data_length = cifs_read_data_length, | 137 | .read_data_length = cifs_read_data_length, |
110 | .map_error = map_smb_to_linux_error, | 138 | .map_error = map_smb_to_linux_error, |