Skip to content

Commit 1cdd5a2

Browse files
committed
cifs: Move the SMB1 transport code out of transport.c
Shrink the size of cifs.ko when SMB1 is not enabled in the config by moving the SMB1 transport code to different file. Signed-off-by: David Howells <[email protected]> cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 3fd8ec2 commit 1cdd5a2

File tree

4 files changed

+588
-553
lines changed

4 files changed

+588
-553
lines changed

fs/smb/client/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ cifs-$(CONFIG_CIFS_SMB_DIRECT) += smbdirect.o
3232

3333
cifs-$(CONFIG_CIFS_ROOT) += cifsroot.o
3434

35-
cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += smb1ops.o cifssmb.o
35+
cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += smb1ops.o cifssmb.o cifstransport.o
3636

3737
cifs-$(CONFIG_CIFS_COMPRESSION) += compress.o compress/lz77.o

fs/smb/client/cifsproto.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,31 @@ extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
116116
int * /* bytes returned */ , const int);
117117
extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
118118
char *in_buf, int flags);
119+
int cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server);
119120
extern struct mid_q_entry *cifs_setup_request(struct cifs_ses *,
120121
struct TCP_Server_Info *,
121122
struct smb_rqst *);
122123
extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *,
123124
struct smb_rqst *);
125+
int __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
126+
struct smb_rqst *rqst);
124127
extern int cifs_check_receive(struct mid_q_entry *mid,
125128
struct TCP_Server_Info *server, bool log_error);
129+
int wait_for_free_request(struct TCP_Server_Info *server, const int flags,
130+
unsigned int *instance);
126131
extern int cifs_wait_mtu_credits(struct TCP_Server_Info *server,
127132
size_t size, size_t *num,
128133
struct cifs_credits *credits);
134+
135+
static inline int
136+
send_cancel(struct TCP_Server_Info *server, struct smb_rqst *rqst,
137+
struct mid_q_entry *mid)
138+
{
139+
return server->ops->send_cancel ?
140+
server->ops->send_cancel(server, rqst, mid) : 0;
141+
}
142+
143+
int wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ);
129144
extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
130145
struct kvec *, int /* nvec to send */,
131146
int * /* type of buf returned */, const int flags,

0 commit comments

Comments
 (0)