Skip to content

Commit 68ed144

Browse files
ematsumiyasmfrench
authored andcommitted
cifs: remove unused server parameter from calc_smb_size()
This parameter is unused by the called function Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Enzo Matsumiya <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 5dd8ce2 commit 68ed144

File tree

9 files changed

+11
-13
lines changed

9 files changed

+11
-13
lines changed

fs/cifs/cifs_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void cifs_dump_detail(void *buf, struct TCP_Server_Info *server)
4242
smb->Command, smb->Status.CifsError,
4343
smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
4444
cifs_dbg(VFS, "smb buf %p len %u\n", smb,
45-
server->ops->calc_smb_size(smb, server));
45+
server->ops->calc_smb_size(smb));
4646
#endif /* CONFIG_CIFS_DEBUG2 */
4747
}
4848

fs/cifs/cifsglob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ struct smb_version_operations {
417417
int (*close_dir)(const unsigned int, struct cifs_tcon *,
418418
struct cifs_fid *);
419419
/* calculate a size of SMB message */
420-
unsigned int (*calc_smb_size)(void *buf, struct TCP_Server_Info *ptcpi);
420+
unsigned int (*calc_smb_size)(void *buf);
421421
/* check for STATUS_PENDING and process the response if yes */
422422
bool (*is_status_pending)(char *buf, struct TCP_Server_Info *server);
423423
/* check for STATUS_NETWORK_SESSION_EXPIRED */

fs/cifs/cifsproto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ extern int cifs_get_writable_path(struct cifs_tcon *tcon, const char *name,
151151
extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool);
152152
extern int cifs_get_readable_path(struct cifs_tcon *tcon, const char *name,
153153
struct cifsFileInfo **ret_file);
154-
extern unsigned int smbCalcSize(void *buf, struct TCP_Server_Info *server);
154+
extern unsigned int smbCalcSize(void *buf);
155155
extern int decode_negTokenInit(unsigned char *security_blob, int length,
156156
struct TCP_Server_Info *server);
157157
extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len);

fs/cifs/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ checkSMB(char *buf, unsigned int total_read, struct TCP_Server_Info *server)
354354
/* otherwise, there is enough to get to the BCC */
355355
if (check_smb_hdr(smb))
356356
return -EIO;
357-
clc_len = smbCalcSize(smb, server);
357+
clc_len = smbCalcSize(smb);
358358

359359
if (4 + rfclen != total_read) {
360360
cifs_dbg(VFS, "Length read does not match RFC1001 length %d\n",

fs/cifs/netmisc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ map_and_check_smb_error(struct mid_q_entry *mid, bool logErr)
909909
* portion, the number of word parameters and the data portion of the message
910910
*/
911911
unsigned int
912-
smbCalcSize(void *buf, struct TCP_Server_Info *server)
912+
smbCalcSize(void *buf)
913913
{
914914
struct smb_hdr *ptr = buf;
915915
return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +

fs/cifs/readdir.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos,
806806

807807
end_of_smb = cfile->srch_inf.ntwrk_buf_start +
808808
server->ops->calc_smb_size(
809-
cfile->srch_inf.ntwrk_buf_start,
810-
server);
809+
cfile->srch_inf.ntwrk_buf_start);
811810

812811
cur_ent = cfile->srch_inf.srch_entries_start;
813812
first_entry_in_buffer = cfile->srch_inf.index_of_last_entry
@@ -1161,8 +1160,7 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
11611160
cifs_dbg(FYI, "loop through %d times filling dir for net buf %p\n",
11621161
num_to_fill, cifsFile->srch_inf.ntwrk_buf_start);
11631162
max_len = tcon->ses->server->ops->calc_smb_size(
1164-
cifsFile->srch_inf.ntwrk_buf_start,
1165-
tcon->ses->server);
1163+
cifsFile->srch_inf.ntwrk_buf_start);
11661164
end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len;
11671165

11681166
tmp_buf = kmalloc(UNICODE_NAME_MAX, GFP_KERNEL);

fs/cifs/smb2misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)
222222
}
223223
}
224224

225-
calc_len = smb2_calc_size(buf, server);
225+
calc_len = smb2_calc_size(buf);
226226

227227
/* For SMB2_IOCTL, OutputOffset and OutputLength are optional, so might
228228
* be 0, and not a real miscalculation */
@@ -410,7 +410,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *shdr)
410410
* portion, the number of word parameters and the data portion of the message.
411411
*/
412412
unsigned int
413-
smb2_calc_size(void *buf, struct TCP_Server_Info *srvr)
413+
smb2_calc_size(void *buf)
414414
{
415415
struct smb2_pdu *pdu = buf;
416416
struct smb2_hdr *shdr = &pdu->hdr;

fs/cifs/smb2ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ smb2_dump_detail(void *buf, struct TCP_Server_Info *server)
387387
shdr->Command, shdr->Status, shdr->Flags, shdr->MessageId,
388388
shdr->Id.SyncId.ProcessId);
389389
cifs_server_dbg(VFS, "smb buf %p len %u\n", buf,
390-
server->ops->calc_smb_size(buf, server));
390+
server->ops->calc_smb_size(buf));
391391
#endif
392392
}
393393

fs/cifs/smb2proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct smb_rqst;
2323
extern int map_smb2_to_linux_error(char *buf, bool log_err);
2424
extern int smb2_check_message(char *buf, unsigned int length,
2525
struct TCP_Server_Info *server);
26-
extern unsigned int smb2_calc_size(void *buf, struct TCP_Server_Info *server);
26+
extern unsigned int smb2_calc_size(void *buf);
2727
extern char *smb2_get_data_area_len(int *off, int *len,
2828
struct smb2_hdr *shdr);
2929
extern __le16 *cifs_convert_path_to_utf16(const char *from,

0 commit comments

Comments
 (0)