]> www.infradead.org Git - users/willy/xarray.git/commitdiff
cifs: Remove cifs_aio_ctx
authorDavid Howells <dhowells@redhat.com>
Wed, 31 Jul 2024 10:30:00 +0000 (11:30 +0100)
committerSteve French <stfrench@microsoft.com>
Fri, 2 Aug 2024 15:55:45 +0000 (10:55 -0500)
Remove struct cifs_aio_ctx and its associated alloc/release functions as it
is no longer used, the functions being taken over by netfslib.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/cifsproto.h
fs/smb/client/misc.c

index 8e86fec7dcd2ba6f54167600f651439540942045..f6d1f075987f16418e83be7bd5b4a44a8e5b028b 100644 (file)
@@ -1471,29 +1471,6 @@ struct cifs_io_parms {
        struct TCP_Server_Info *server;
 };
 
-struct cifs_aio_ctx {
-       struct kref             refcount;
-       struct list_head        list;
-       struct mutex            aio_mutex;
-       struct completion       done;
-       struct iov_iter         iter;
-       struct kiocb            *iocb;
-       struct cifsFileInfo     *cfile;
-       struct bio_vec          *bv;
-       loff_t                  pos;
-       unsigned int            nr_pinned_pages;
-       ssize_t                 rc;
-       unsigned int            len;
-       unsigned int            total_len;
-       unsigned int            bv_need_unpin;  /* If ->bv[] needs unpinning */
-       bool                    should_dirty;
-       /*
-        * Indicates if this aio_ctx is for direct_io,
-        * If yes, iter is a copy of the user passed iov_iter
-        */
-       bool                    direct_io;
-};
-
 struct cifs_io_request {
        struct netfs_io_request         rreq;
        struct cifsFileInfo             *cfile;
@@ -2010,7 +1987,6 @@ require use of the stronger protocol */
  * cifsFileInfo->file_info_lock        cifsFileInfo->count             cifs_new_fileinfo
  *                             ->invalidHandle                 initiate_cifs_search
  *                             ->oplock_break_cancelled
- * cifs_aio_ctx->aio_mutex             cifs_aio_ctx                    cifs_aio_ctx_alloc
  ****************************************************************************/
 
 #ifdef DECLARE_GLOBALS_HERE
index c15bb5ee7eb7d6787f5138499591071169008bda..497bf3c447bcb59486feed877560bd920d91a70e 100644 (file)
@@ -619,8 +619,6 @@ int __cifs_calc_signature(struct smb_rqst *rqst,
                        struct shash_desc *shash);
 enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,
                                        enum securityEnum);
-struct cifs_aio_ctx *cifs_aio_ctx_alloc(void);
-void cifs_aio_ctx_release(struct kref *refcount);
 
 int cifs_alloc_hash(const char *name, struct shash_desc **sdesc);
 void cifs_free_hash(struct shash_desc **sdesc);
index 07c468ddb88a89d65f8a48433a055759deb3da26..b28ff62f1f1516d8e80859846a463e5a06f3ec62 100644 (file)
@@ -995,60 +995,6 @@ parse_DFS_referrals_exit:
        return rc;
 }
 
-struct cifs_aio_ctx *
-cifs_aio_ctx_alloc(void)
-{
-       struct cifs_aio_ctx *ctx;
-
-       /*
-        * Must use kzalloc to initialize ctx->bv to NULL and ctx->direct_io
-        * to false so that we know when we have to unreference pages within
-        * cifs_aio_ctx_release()
-        */
-       ctx = kzalloc(sizeof(struct cifs_aio_ctx), GFP_KERNEL);
-       if (!ctx)
-               return NULL;
-
-       INIT_LIST_HEAD(&ctx->list);
-       mutex_init(&ctx->aio_mutex);
-       init_completion(&ctx->done);
-       kref_init(&ctx->refcount);
-       return ctx;
-}
-
-void
-cifs_aio_ctx_release(struct kref *refcount)
-{
-       struct cifs_aio_ctx *ctx = container_of(refcount,
-                                       struct cifs_aio_ctx, refcount);
-
-       cifsFileInfo_put(ctx->cfile);
-
-       /*
-        * ctx->bv is only set if setup_aio_ctx_iter() was call successfuly
-        * which means that iov_iter_extract_pages() was a success and thus
-        * that we may have references or pins on pages that we need to
-        * release.
-        */
-       if (ctx->bv) {
-               if (ctx->should_dirty || ctx->bv_need_unpin) {
-                       unsigned int i;
-
-                       for (i = 0; i < ctx->nr_pinned_pages; i++) {
-                               struct page *page = ctx->bv[i].bv_page;
-
-                               if (ctx->should_dirty)
-                                       set_page_dirty(page);
-                               if (ctx->bv_need_unpin)
-                                       unpin_user_page(page);
-                       }
-               }
-               kvfree(ctx->bv);
-       }
-
-       kfree(ctx);
-}
-
 /**
  * cifs_alloc_hash - allocate hash and hash context together
  * @name: The name of the crypto hash algo