smb: client: Remove an unused function and variable
Subsystems (2)
PATCH 1/1 smb: client: Remove an unused function and variable
From: "Dr. David Alan Gilbert" <[email protected]>
SMB2_QFS_info() has been unused since 2018's
commit 730928c8f4be ("cifs: update smb2_queryfs() to use compounding")
sign_CIFS_PDUs has been unused since 2009's
commit 2edd6c5b0517 ("[CIFS] NTLMSSP support moving into new file, old dead code removed")
Remove them.
--- fs/smb/client/cifsfs.c | 1 - fs/smb/client/smb2pdu.c | 65 --------------------------------------- fs/smb/client/smb2proto.h | 3 -- 3 files changed, 69 deletions(-)
fs/smb/client/cifsfs.c +0 -1
@@ -70,7 +70,6 @@ bool require_gcm_256; /* false by default */bool enable_negotiate_signing;/* false by default */ unsigned int global_secflags =CIFSSEC_DEF ;/* unsigned int ntlmv2_support = 0; */ -unsigned int sign_CIFS_PDUs =1 ;/* * Global transaction id (XID) information
fs/smb/client/smb2pdu.c +0 -65
71 lines not on this page · raw message
fs/smb/client/smb2proto.h +0 -3
@@ -259,9 +259,6 @@ extern int smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 volatile_fid);extern int smb2_handle_cancelled_mid (struct mid_q_entry *mid,struct TCP_Server_Info *server);void smb2_cancelled_close_fid (struct work_struct *work); -extern int SMB2_QFS_info (const unsigned int xid,struct cifs_tcon *tcon, -u64 persistent_file_id,u64 volatile_file_id, -struct kstatfs *FSData);extern int SMB311_posix_qfs_info (const unsigned int xid,struct cifs_tcon *tcon,u64 persistent_file_id,u64 volatile_file_id,struct kstatfs *FSData);
Signature · 1 line
2.49.0
This looks fine as something for 6.16-rc next month.
Quoted 125 lines · On Sat, May 3, 2025 at 6:40 PM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
SMB2_QFS_info()has been unused since 2018's
commit730928c8f4be("cifs: updatesmb2_queryfs()to use compounding")
sign_CIFS_PDUshas been unused since 2009's
commit2edd6c5b0517("[CIFS] NTLMSSP support moving into new file, old dead code removed")Remove them.
Signed-off-by Dr. David Alan Gilbert <[email protected]>--- fs/smb/client/cifsfs.c | 1 - fs/smb/client/smb2pdu.c | 65 --------------------------------------- fs/smb/client/smb2proto.h | 3 -- 3 files changed, 69 deletions(-)fs/smb/client/cifsfs.c +0
-1@@ -70,7 +70,6 @@ bool require_gcm_256; /* false by default */bool enable_negotiate_signing;/* false by default */ unsigned int global_secflags =CIFSSEC_DEF ;/* unsigned int ntlmv2_support = 0; */ -unsigned int sign_CIFS_PDUs =1 ;/* * Global transaction id (XID) information fs/smb/client/smb2pdu.c +0
-65@@ -5919,71 +5919,6 @@ SMB311_posix_qfs_info(const unsigned int xid, struct cifs_tcon *tcon,return rc; } -int -SMB2_QFS_info (const unsigned int xid,struct cifs_tcon *tcon, -u64 persistent_fid,u64 volatile_fid,struct kstatfs *fsdata) -{ -struct smb_rqst rqst; -struct smb2_query_info_rsp *rsp =NULL ; -struct kvec iov; -struct kvec rsp_iov; -int rc =0 ; -int resp_buftype; -struct cifs_ses *ses = tcon->ses; -struct TCP_Server_Info *server; -struct smb2_fs_full_size_info *info =NULL ; -int flags =0 ; -int retries =0 , cur_sleep =1 ; - -replay_again: -/* reinitialize for possible replay */ - flags =0 ; - server =cifs_pick_channel (ses); - - rc =build_qfs_info_req (&iov, tcon, server, -FS_FULL_SIZE_INFORMATION , -sizeof (struct smb2_fs_full_size_info ), - persistent_fid, volatile_fid); -if (rc) -return rc; - -if (smb3_encryption_required (tcon)) - flags |=CIFS_TRANSFORM_REQ ; - -memset (&rqst,0 ,sizeof (struct smb_rqst )); - rqst.rq_iov = &iov; - rqst.rq_nvec =1 ; - -if (retries) -smb2_set_replay (server, &rqst); - - rc =cifs_send_recv (xid, ses, server, - &rqst, &resp_buftype, flags, &rsp_iov); -free_qfs_info_req (&iov); -if (rc) { -cifs_stats_fail_inc (tcon,SMB2_QUERY_INFO_HE ); - goto qfsinf_exit; - } - rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base; - - info = (struct smb2_fs_full_size_info *)( -le16_to_cpu (rsp->OutputBufferOffset) + (char *)rsp); - rc =smb2_validate_iov (le16_to_cpu (rsp->OutputBufferOffset), -le32_to_cpu (rsp->OutputBufferLength), &rsp_iov, -sizeof (struct smb2_fs_full_size_info )); -if (!rc) -smb2_copy_fs_info_to_kstatfs (info, fsdata); - -qfsinf_exit: -free_rsp_buf (resp_buftype, rsp_iov.iov_base); - -if (is_replayable_error (rc) && -smb2_should_replay (tcon, &retries, &cur_sleep)) - goto replay_again; - -return rc; -} -int SMB2_QFS_attr (const unsigned int xid,struct cifs_tcon *tcon,u64 persistent_fid,u64 volatile_fid,int level)fs/smb/client/smb2proto.h +0
-4@@ -259,9 +259,6 @@ extern int smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 volatile_fid);extern int smb2_handle_cancelled_mid (struct mid_q_entry *mid,struct TCP_Server_Info *server);void smb2_cancelled_close_fid (struct work_struct *work); -extern int SMB2_QFS_info (const unsigned int xid,struct cifs_tcon *tcon, -u64 persistent_file_id,u64 volatile_file_id, -struct kstatfs *FSData);extern int SMB311_posix_qfs_info (const unsigned int xid,struct cifs_tcon *tcon,u64 persistent_file_id,u64 volatile_file_id,struct kstatfs *FSData); --2.49.0
Signature · 3 lines
Thanks, Steve
Steve French
Appliedmerged into cifs-2.6.git for-next
Quoted 125 lines · On Sat, May 3, 2025 at 6:40 PM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
SMB2_QFS_info()has been unused since 2018's
commit730928c8f4be("cifs: updatesmb2_queryfs()to use compounding")
sign_CIFS_PDUshas been unused since 2009's
commit2edd6c5b0517("[CIFS] NTLMSSP support moving into new file, old dead code removed")Remove them.
Signed-off-by Dr. David Alan Gilbert <[email protected]>--- fs/smb/client/cifsfs.c | 1 - fs/smb/client/smb2pdu.c | 65 --------------------------------------- fs/smb/client/smb2proto.h | 3 -- 3 files changed, 69 deletions(-)fs/smb/client/cifsfs.c +0
-1@@ -70,7 +70,6 @@ bool require_gcm_256; /* false by default */bool enable_negotiate_signing;/* false by default */ unsigned int global_secflags =CIFSSEC_DEF ;/* unsigned int ntlmv2_support = 0; */ -unsigned int sign_CIFS_PDUs =1 ;/* * Global transaction id (XID) information fs/smb/client/smb2pdu.c +0
-65@@ -5919,71 +5919,6 @@ SMB311_posix_qfs_info(const unsigned int xid, struct cifs_tcon *tcon,return rc; } -int -SMB2_QFS_info (const unsigned int xid,struct cifs_tcon *tcon, -u64 persistent_fid,u64 volatile_fid,struct kstatfs *fsdata) -{ -struct smb_rqst rqst; -struct smb2_query_info_rsp *rsp =NULL ; -struct kvec iov; -struct kvec rsp_iov; -int rc =0 ; -int resp_buftype; -struct cifs_ses *ses = tcon->ses; -struct TCP_Server_Info *server; -struct smb2_fs_full_size_info *info =NULL ; -int flags =0 ; -int retries =0 , cur_sleep =1 ; - -replay_again: -/* reinitialize for possible replay */ - flags =0 ; - server =cifs_pick_channel (ses); - - rc =build_qfs_info_req (&iov, tcon, server, -FS_FULL_SIZE_INFORMATION , -sizeof (struct smb2_fs_full_size_info ), - persistent_fid, volatile_fid); -if (rc) -return rc; - -if (smb3_encryption_required (tcon)) - flags |=CIFS_TRANSFORM_REQ ; - -memset (&rqst,0 ,sizeof (struct smb_rqst )); - rqst.rq_iov = &iov; - rqst.rq_nvec =1 ; - -if (retries) -smb2_set_replay (server, &rqst); - - rc =cifs_send_recv (xid, ses, server, - &rqst, &resp_buftype, flags, &rsp_iov); -free_qfs_info_req (&iov); -if (rc) { -cifs_stats_fail_inc (tcon,SMB2_QUERY_INFO_HE ); - goto qfsinf_exit; - } - rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base; - - info = (struct smb2_fs_full_size_info *)( -le16_to_cpu (rsp->OutputBufferOffset) + (char *)rsp); - rc =smb2_validate_iov (le16_to_cpu (rsp->OutputBufferOffset), -le32_to_cpu (rsp->OutputBufferLength), &rsp_iov, -sizeof (struct smb2_fs_full_size_info )); -if (!rc) -smb2_copy_fs_info_to_kstatfs (info, fsdata); - -qfsinf_exit: -free_rsp_buf (resp_buftype, rsp_iov.iov_base); - -if (is_replayable_error (rc) && -smb2_should_replay (tcon, &retries, &cur_sleep)) - goto replay_again; - -return rc; -} -int SMB2_QFS_attr (const unsigned int xid,struct cifs_tcon *tcon,u64 persistent_fid,u64 volatile_fid,int level)fs/smb/client/smb2proto.h +0
-4@@ -259,9 +259,6 @@ extern int smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 volatile_fid);extern int smb2_handle_cancelled_mid (struct mid_q_entry *mid,struct TCP_Server_Info *server);void smb2_cancelled_close_fid (struct work_struct *work); -extern int SMB2_QFS_info (const unsigned int xid,struct cifs_tcon *tcon, -u64 persistent_file_id,u64 volatile_file_id, -struct kstatfs *FSData);extern int SMB311_posix_qfs_info (const unsigned int xid,struct cifs_tcon *tcon,u64 persistent_file_id,u64 volatile_file_id,struct kstatfs *FSData); --2.49.0
Signature · 3 lines
Thanks, Steve