]> www.infradead.org Git - users/hch/misc.git/commitdiff
cifs: Remove unused functions
authorDr. David Alan Gilbert <linux@treblig.org>
Mon, 7 Oct 2024 00:48:55 +0000 (01:48 +0100)
committerSteve French <stfrench@microsoft.com>
Wed, 16 Oct 2024 05:30:52 +0000 (00:30 -0500)
cifs_ses_find_chan() has been unused since commit
f486ef8e2003 ("cifs: use the chans_need_reconnect bitmap for reconnect status")

cifs_read_page_from_socket() has been unused since commit
d08089f649a0 ("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.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsproto.h
fs/smb/client/connect.c
fs/smb/client/sess.c

index 68c716e6261b3abd40173dc08a30ca08183df0aa..1d3470bca45edda942514c9bcf5ef098bb80b416 100644 (file)
@@ -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);
index adf8758847f63f92ae69ddb84d35f5e631634ff6..15d94ac4095ea8ba572d475ecdbd6609da2207cf 100644 (file)
@@ -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)
index 3216f786908fbb2ac8345cf5929fadf8ec6920d4..c88e9657f47a8d80b10396ffe4826b948ef05c08 100644 (file)
@@ -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)