aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-01-20 13:36:50 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-20 16:46:22 -0500
commitc3dccf48174e50668b7c63544ac8c60c07a45978 (patch)
tree9197f69ef539330373d609b334bfdd67fd4aa207 /fs/cifs
parenta70307eeeb25b89f6b2baf3cf3f0cef83c96ba12 (diff)
cifs: TCP_Server_Info diet
Remove fields that are completely unused, and rearrange struct according to recommendations by "pahole". Before: /* size: 1112, cachelines: 18, members: 49 */ /* sum members: 1086, holes: 8, sum holes: 26 */ /* bit holes: 1, sum bit holes: 7 bits */ /* last cacheline: 24 bytes */ After: /* size: 1072, cachelines: 17, members: 42 */ /* sum members: 1065, holes: 3, sum holes: 7 */ /* last cacheline: 48 bytes */ ...savings of 40 bytes per struct on x86_64. 21 bytes by field removal, and 19 by reorganizing to eliminate holes. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsglob.h26
-rw-r--r--fs/cifs/cifssmb.c2
2 files changed, 9 insertions, 19 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 571132c95231..36f097e1ee74 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -161,6 +161,7 @@ struct TCP_Server_Info {
161 int srv_count; /* reference counter */ 161 int srv_count; /* reference counter */
162 /* 15 character server name + 0x20 16th byte indicating type = srv */ 162 /* 15 character server name + 0x20 16th byte indicating type = srv */
163 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 163 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
164 enum statusEnum tcpStatus; /* what we think the status is */
164 char *hostname; /* hostname portion of UNC string */ 165 char *hostname; /* hostname portion of UNC string */
165 struct socket *ssocket; 166 struct socket *ssocket;
166 struct sockaddr_storage dstaddr; 167 struct sockaddr_storage dstaddr;
@@ -168,25 +169,16 @@ struct TCP_Server_Info {
168 wait_queue_head_t response_q; 169 wait_queue_head_t response_q;
169 wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/ 170 wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
170 struct list_head pending_mid_q; 171 struct list_head pending_mid_q;
171 void *Server_NlsInfo; /* BB - placeholder for future NLS info */
172 unsigned short server_codepage; /* codepage for the server */
173 enum protocolEnum protocolType;
174 char versionMajor;
175 char versionMinor;
176 bool svlocal:1; /* local server or remote */
177 bool noblocksnd; /* use blocking sendmsg */ 172 bool noblocksnd; /* use blocking sendmsg */
178 bool noautotune; /* do not autotune send buf sizes */ 173 bool noautotune; /* do not autotune send buf sizes */
179 bool tcp_nodelay; 174 bool tcp_nodelay;
180 atomic_t inFlight; /* number of requests on the wire to server */ 175 atomic_t inFlight; /* number of requests on the wire to server */
181#ifdef CONFIG_CIFS_STATS2
182 atomic_t inSend; /* requests trying to send */
183 atomic_t num_waiters; /* blocked waiting to get in sendrecv */
184#endif
185 enum statusEnum tcpStatus; /* what we think the status is */
186 struct mutex srv_mutex; 176 struct mutex srv_mutex;
187 struct task_struct *tsk; 177 struct task_struct *tsk;
188 char server_GUID[16]; 178 char server_GUID[16];
189 char secMode; 179 char secMode;
180 bool session_estab; /* mark when very first sess is established */
181 u16 dialect; /* dialect index that server chose */
190 enum securityEnum secType; 182 enum securityEnum secType;
191 unsigned int maxReq; /* Clients should submit no more */ 183 unsigned int maxReq; /* Clients should submit no more */
192 /* than maxReq distinct unanswered SMBs to the server when using */ 184 /* than maxReq distinct unanswered SMBs to the server when using */
@@ -199,8 +191,6 @@ struct TCP_Server_Info {
199 unsigned int max_vcs; /* maximum number of smb sessions, at least 191 unsigned int max_vcs; /* maximum number of smb sessions, at least
200 those that can be specified uniquely with 192 those that can be specified uniquely with
201 vcnumbers */ 193 vcnumbers */
202 char sessid[4]; /* unique token id for this session */
203 /* (returned on Negotiate */
204 int capabilities; /* allow selective disabling of caps by smb sess */ 194 int capabilities; /* allow selective disabling of caps by smb sess */
205 int timeAdj; /* Adjust for difference in server time zone in sec */ 195 int timeAdj; /* Adjust for difference in server time zone in sec */
206 __u16 CurrentMid; /* multiplex id - rotating counter */ 196 __u16 CurrentMid; /* multiplex id - rotating counter */
@@ -210,18 +200,20 @@ struct TCP_Server_Info {
210 __u32 sequence_number; /* for signing, protected by srv_mutex */ 200 __u32 sequence_number; /* for signing, protected by srv_mutex */
211 struct session_key session_key; 201 struct session_key session_key;
212 unsigned long lstrp; /* when we got last response from this server */ 202 unsigned long lstrp; /* when we got last response from this server */
213 u16 dialect; /* dialect index that server chose */
214 struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */ 203 struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */
215 /* extended security flavors that server supports */ 204 /* extended security flavors that server supports */
205 bool sec_ntlmssp; /* supports NTLMSSP */
206 bool sec_kerberosu2u; /* supports U2U Kerberos */
216 bool sec_kerberos; /* supports plain Kerberos */ 207 bool sec_kerberos; /* supports plain Kerberos */
217 bool sec_mskerberos; /* supports legacy MS Kerberos */ 208 bool sec_mskerberos; /* supports legacy MS Kerberos */
218 bool sec_kerberosu2u; /* supports U2U Kerberos */
219 bool sec_ntlmssp; /* supports NTLMSSP */
220 bool session_estab; /* mark when very first sess is established */
221 struct delayed_work echo; /* echo ping workqueue job */ 209 struct delayed_work echo; /* echo ping workqueue job */
222#ifdef CONFIG_CIFS_FSCACHE 210#ifdef CONFIG_CIFS_FSCACHE
223 struct fscache_cookie *fscache; /* client index cache cookie */ 211 struct fscache_cookie *fscache; /* client index cache cookie */
224#endif 212#endif
213#ifdef CONFIG_CIFS_STATS2
214 atomic_t inSend; /* requests trying to send */
215 atomic_t num_waiters; /* blocked waiting to get in sendrecv */
216#endif
225}; 217};
226 218
227/* 219/*
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 37113450757b..5b1f6637f161 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -452,7 +452,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
452 server->maxBuf = min((__u32)le16_to_cpu(rsp->MaxBufSize), 452 server->maxBuf = min((__u32)le16_to_cpu(rsp->MaxBufSize),
453 (__u32)CIFSMaxBufSize + MAX_CIFS_HDR_SIZE); 453 (__u32)CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
454 server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs); 454 server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs);
455 GETU32(server->sessid) = le32_to_cpu(rsp->SessionKey);
456 /* even though we do not use raw we might as well set this 455 /* even though we do not use raw we might as well set this
457 accurately, in case we ever find a need for it */ 456 accurately, in case we ever find a need for it */
458 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) { 457 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {
@@ -566,7 +565,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
566 (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE); 565 (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
567 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); 566 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
568 cFYI(DBG2, "Max buf = %d", ses->server->maxBuf); 567 cFYI(DBG2, "Max buf = %d", ses->server->maxBuf);
569 GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);
570 server->capabilities = le32_to_cpu(pSMBr->Capabilities); 568 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
571 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone); 569 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);
572 server->timeAdj *= 60; 570 server->timeAdj *= 60;