aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb1ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-23 08:14:34 -0400
committerSteve French <smfrench@gmail.com>2012-07-24 01:32:48 -0400
commita891f0f895f4a760fdb99636fab05e60597b8224 (patch)
tree0f911230af82d5b8cbbbbbb423b032ae8f5dc957 /fs/cifs/smb1ops.c
parent316cf94a910f6f93d43cc574359d163ccae098a3 (diff)
CIFS: Extend credit mechanism to process request type
Split all requests to echos, oplocks and others - each group uses its own credit slot. This is indicated by new flags CIFS_ECHO_OP and CIFS_OBREAK_OP that are not used now for CIFS. This change is required to support SMB2 protocol because of different processing of these commands. Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r--fs/cifs/smb1ops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 28359e789fff..f4f839459e90 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -101,7 +101,8 @@ cifs_find_mid(struct TCP_Server_Info *server, char *buffer)
101} 101}
102 102
103static void 103static void
104cifs_add_credits(struct TCP_Server_Info *server, const unsigned int add) 104cifs_add_credits(struct TCP_Server_Info *server, const unsigned int add,
105 const int optype)
105{ 106{
106 spin_lock(&server->req_lock); 107 spin_lock(&server->req_lock);
107 server->credits += add; 108 server->credits += add;
@@ -120,11 +121,17 @@ cifs_set_credits(struct TCP_Server_Info *server, const int val)
120} 121}
121 122
122static int * 123static int *
123cifs_get_credits_field(struct TCP_Server_Info *server) 124cifs_get_credits_field(struct TCP_Server_Info *server, const int optype)
124{ 125{
125 return &server->credits; 126 return &server->credits;
126} 127}
127 128
129static unsigned int
130cifs_get_credits(struct mid_q_entry *mid)
131{
132 return 1;
133}
134
128/* 135/*
129 * Find a free multiplex id (SMB mid). Otherwise there could be 136 * Find a free multiplex id (SMB mid). Otherwise there could be
130 * mid collisions which might cause problems, demultiplexing the 137 * mid collisions which might cause problems, demultiplexing the
@@ -390,6 +397,7 @@ struct smb_version_operations smb1_operations = {
390 .add_credits = cifs_add_credits, 397 .add_credits = cifs_add_credits,
391 .set_credits = cifs_set_credits, 398 .set_credits = cifs_set_credits,
392 .get_credits_field = cifs_get_credits_field, 399 .get_credits_field = cifs_get_credits_field,
400 .get_credits = cifs_get_credits,
393 .get_next_mid = cifs_get_next_mid, 401 .get_next_mid = cifs_get_next_mid,
394 .read_data_offset = cifs_read_data_offset, 402 .read_data_offset = cifs_read_data_offset,
395 .read_data_length = cifs_read_data_length, 403 .read_data_length = cifs_read_data_length,