cifs: Remove unused functions
Subsystems (2)
PATCH 1/1 cifs: Remove unused functions
From: "Dr. David Alan Gilbert" <[email protected]>
cifs_ses_find_chan() has been unused since commitf486ef8e2003 ("cifs: use the chans_need_reconnect bitmap for reconnect status")
cifs_read_page_from_socket() has been unused since commitd08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list")
cifs_chan_in_reconnect() has been unused since commit bc962159e8e3 ("cifs: avoid race conditions with parallel reconnects")
Remove them.
--- fs/smb/client/cifsproto.h | 9 --------- fs/smb/client/connect.c | 12 ------------ fs/smb/client/sess.c | 32 -------------------------------- 3 files changed, 53 deletions(-)
fs/smb/client/cifsproto.h +0 -9
@@ -252,10 +252,6 @@ extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf, unsigned int to_read);extern ssize_t cifs_discard_from_socket (struct TCP_Server_Info *server,size_t to_read); -extern int cifs_read_page_from_socket (struct TCP_Server_Info *server, -struct page *page, -unsigned int page_offset, -unsigned int to_read);int cifs_read_iter_from_socket (struct TCP_Server_Info *server,struct iov_iter *iter,unsigned int to_read);
@@ -623,8 +619,6 @@ enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,int cifs_alloc_hash (const char *name,struct shash_desc **sdesc);void cifs_free_hash (struct shash_desc **sdesc); -struct cifs_chan * -cifs_ses_find_chan (struct cifs_ses *ses,struct TCP_Server_Info *server);int cifs_try_adding_channels (struct cifs_ses *ses);bool is_server_using_iface (struct TCP_Server_Info *server,struct cifs_server_iface *iface);
@@ -640,9 +634,6 @@ cifs_chan_set_in_reconnect(struct cifs_ses *ses,void cifs_chan_clear_in_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server); -bool -cifs_chan_in_reconnect (struct cifs_ses *ses, -struct TCP_Server_Info *server);void cifs_chan_set_need_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server);
fs/smb/client/connect.c +0 -12
@@ -794,18 +794,6 @@ cifs_discard_from_socket(struct TCP_Server_Info *server, size_t to_read)return cifs_readv_from_socket (server, &smb_msg); } -int -cifs_read_page_from_socket (struct TCP_Server_Info *server,struct page *page, -unsigned int page_offset,unsigned int to_read) -{ -struct msghdr smb_msg = {}; -struct bio_vec bv; - -bvec_set_page (&bv, page, to_read, page_offset); -iov_iter_bvec (&smb_msg.msg_iter,ITER_DEST , &bv,1 , to_read); -return cifs_readv_from_socket (server, &smb_msg); -} -int cifs_read_iter_from_socket (struct TCP_Server_Info *server,struct iov_iter *iter,unsigned int to_read)
fs/smb/client/sess.c +0 -32
@@ -115,18 +115,6 @@ cifs_chan_clear_in_reconnect(struct cifs_ses *ses, ses->chans[chan_index].in_reconnect = false; } -bool -cifs_chan_in_reconnect (struct cifs_ses *ses, -struct TCP_Server_Info *server) -{ -unsigned int chan_index =cifs_ses_get_chan_index (ses, server); - -if (chan_index ==CIFS_INVAL_CHAN_INDEX ) -return true;/* err on the safer side */ - -return CIFS_CHAN_IN_RECONNECT (ses, chan_index); -} -void cifs_chan_set_need_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server)
@@ -487,26 +475,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)spin_unlock (&ses->chan_lock); } -/* -* If server is a channel of ses, return the corresponding enclosing -* cifs_chan otherwise return NULL. -*/ -struct cifs_chan * -cifs_ses_find_chan (struct cifs_ses *ses,struct TCP_Server_Info *server) -{ -int i; - -spin_lock (&ses->chan_lock); -for (i =0 ; i < ses->chan_count; i++) { -if (ses->chans[i].server == server) { -spin_unlock (&ses->chan_lock); -return &ses->chans[i]; - } - } -spin_unlock (&ses->chan_lock); -return NULL ; -} -static int cifs_ses_add_channel (struct cifs_ses *ses,struct cifs_server_iface *iface)
Signature · 1 line
2.46.2
tentatively merged into cifs-2.6.git for-next pending testing and any additional reviews
Quoted 132 lines · On Sun, Oct 6, 2024 at 7:49 PM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cifs_ses_find_chan()has been unused since commitf486ef8e2003("cifs: use thechans_need_reconnectbitmap for reconnect status")
cifs_read_page_from_socket()has been unused since commitd08089f649a0("cifs: Change the I/O paths to use an iterator rather than a page list")
cifs_chan_in_reconnect()has been unused since commitbc962159e8e3("cifs: avoid race conditions with parallel reconnects")Remove them.
Signed-off-by Dr. David Alan Gilbert <[email protected]>--- fs/smb/client/cifsproto.h | 9 --------- fs/smb/client/connect.c | 12 ------------ fs/smb/client/sess.c | 32 -------------------------------- 3 files changed, 53 deletions(-)fs/smb/client/cifsproto.h +0
-9@@ -252,10 +252,6 @@ extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf, unsigned int to_read);extern ssize_t cifs_discard_from_socket (struct TCP_Server_Info *server,size_t to_read); -extern int cifs_read_page_from_socket (struct TCP_Server_Info *server, -struct page *page, -unsigned int page_offset, -unsigned int to_read);int cifs_read_iter_from_socket (struct TCP_Server_Info *server,struct iov_iter *iter,unsigned int to_read);@@ -623,8 +619,6 @@ enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,int cifs_alloc_hash (const char *name,struct shash_desc **sdesc);void cifs_free_hash (struct shash_desc **sdesc); -struct cifs_chan * -cifs_ses_find_chan (struct cifs_ses *ses,struct TCP_Server_Info *server);int cifs_try_adding_channels (struct cifs_ses *ses);bool is_server_using_iface (struct TCP_Server_Info *server,struct cifs_server_iface *iface);@@ -640,9 +634,6 @@ cifs_chan_set_in_reconnect(struct cifs_ses *ses,void cifs_chan_clear_in_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server); -bool -cifs_chan_in_reconnect (struct cifs_ses *ses, -struct TCP_Server_Info *server);void cifs_chan_set_need_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server);fs/smb/client/connect.c +0
-12@@ -794,18 +794,6 @@ cifs_discard_from_socket(struct TCP_Server_Info *server, size_t to_read)return cifs_readv_from_socket (server, &smb_msg); } -int -cifs_read_page_from_socket (struct TCP_Server_Info *server,struct page *page, -unsigned int page_offset,unsigned int to_read) -{ -struct msghdr smb_msg = {}; -struct bio_vec bv; - -bvec_set_page (&bv, page, to_read, page_offset); -iov_iter_bvec (&smb_msg.msg_iter,ITER_DEST , &bv,1 , to_read); -return cifs_readv_from_socket (server, &smb_msg); -} -int cifs_read_iter_from_socket (struct TCP_Server_Info *server,struct iov_iter *iter,unsigned int to_read)fs/smb/client/sess.c +0
-33@@ -115,18 +115,6 @@ cifs_chan_clear_in_reconnect(struct cifs_ses *ses, ses->chans[chan_index].in_reconnect = false; } -bool -cifs_chan_in_reconnect (struct cifs_ses *ses, -struct TCP_Server_Info *server) -{ -unsigned int chan_index =cifs_ses_get_chan_index (ses, server); - -if (chan_index ==CIFS_INVAL_CHAN_INDEX ) -return true;/* err on the safer side */ - -return CIFS_CHAN_IN_RECONNECT (ses, chan_index); -} -void cifs_chan_set_need_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server)@@ -487,26 +475,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)spin_unlock (&ses->chan_lock); } -/* -* If server is a channel of ses, return the corresponding enclosing -* cifs_chan otherwise return NULL. -*/ -struct cifs_chan * -cifs_ses_find_chan (struct cifs_ses *ses,struct TCP_Server_Info *server) -{ -int i; - -spin_lock (&ses->chan_lock); -for (i =0 ; i < ses->chan_count; i++) { -if (ses->chans[i].server == server) { -spin_unlock (&ses->chan_lock); -return &ses->chans[i]; - } - } -spin_unlock (&ses->chan_lock); -return NULL ; -} -static int cifs_ses_add_channel (struct cifs_ses *ses,struct cifs_server_iface *iface) --2.46.2
Signature · 3 lines
Thanks, Steve