Skip to content

Commit cd93650

Browse files
dhowellssmfrench
authored andcommitted
cifs: Remove cifs_aio_ctx
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 <[email protected]> cc: Steve French <[email protected]> cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 4b96024 commit cd93650

File tree

3 files changed

+0
-80
lines changed

3 files changed

+0
-80
lines changed

fs/smb/client/cifsglob.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,29 +1471,6 @@ struct cifs_io_parms {
14711471
struct TCP_Server_Info *server;
14721472
};
14731473

1474-
struct cifs_aio_ctx {
1475-
struct kref refcount;
1476-
struct list_head list;
1477-
struct mutex aio_mutex;
1478-
struct completion done;
1479-
struct iov_iter iter;
1480-
struct kiocb *iocb;
1481-
struct cifsFileInfo *cfile;
1482-
struct bio_vec *bv;
1483-
loff_t pos;
1484-
unsigned int nr_pinned_pages;
1485-
ssize_t rc;
1486-
unsigned int len;
1487-
unsigned int total_len;
1488-
unsigned int bv_need_unpin; /* If ->bv[] needs unpinning */
1489-
bool should_dirty;
1490-
/*
1491-
* Indicates if this aio_ctx is for direct_io,
1492-
* If yes, iter is a copy of the user passed iov_iter
1493-
*/
1494-
bool direct_io;
1495-
};
1496-
14971474
struct cifs_io_request {
14981475
struct netfs_io_request rreq;
14991476
struct cifsFileInfo *cfile;
@@ -2010,7 +1987,6 @@ require use of the stronger protocol */
20101987
* cifsFileInfo->file_info_lock cifsFileInfo->count cifs_new_fileinfo
20111988
* ->invalidHandle initiate_cifs_search
20121989
* ->oplock_break_cancelled
2013-
* cifs_aio_ctx->aio_mutex cifs_aio_ctx cifs_aio_ctx_alloc
20141990
****************************************************************************/
20151991

20161992
#ifdef DECLARE_GLOBALS_HERE

fs/smb/client/cifsproto.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,6 @@ int __cifs_calc_signature(struct smb_rqst *rqst,
619619
struct shash_desc *shash);
620620
enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,
621621
enum securityEnum);
622-
struct cifs_aio_ctx *cifs_aio_ctx_alloc(void);
623-
void cifs_aio_ctx_release(struct kref *refcount);
624622

625623
int cifs_alloc_hash(const char *name, struct shash_desc **sdesc);
626624
void cifs_free_hash(struct shash_desc **sdesc);

fs/smb/client/misc.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -995,60 +995,6 @@ parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size,
995995
return rc;
996996
}
997997

998-
struct cifs_aio_ctx *
999-
cifs_aio_ctx_alloc(void)
1000-
{
1001-
struct cifs_aio_ctx *ctx;
1002-
1003-
/*
1004-
* Must use kzalloc to initialize ctx->bv to NULL and ctx->direct_io
1005-
* to false so that we know when we have to unreference pages within
1006-
* cifs_aio_ctx_release()
1007-
*/
1008-
ctx = kzalloc(sizeof(struct cifs_aio_ctx), GFP_KERNEL);
1009-
if (!ctx)
1010-
return NULL;
1011-
1012-
INIT_LIST_HEAD(&ctx->list);
1013-
mutex_init(&ctx->aio_mutex);
1014-
init_completion(&ctx->done);
1015-
kref_init(&ctx->refcount);
1016-
return ctx;
1017-
}
1018-
1019-
void
1020-
cifs_aio_ctx_release(struct kref *refcount)
1021-
{
1022-
struct cifs_aio_ctx *ctx = container_of(refcount,
1023-
struct cifs_aio_ctx, refcount);
1024-
1025-
cifsFileInfo_put(ctx->cfile);
1026-
1027-
/*
1028-
* ctx->bv is only set if setup_aio_ctx_iter() was call successfuly
1029-
* which means that iov_iter_extract_pages() was a success and thus
1030-
* that we may have references or pins on pages that we need to
1031-
* release.
1032-
*/
1033-
if (ctx->bv) {
1034-
if (ctx->should_dirty || ctx->bv_need_unpin) {
1035-
unsigned int i;
1036-
1037-
for (i = 0; i < ctx->nr_pinned_pages; i++) {
1038-
struct page *page = ctx->bv[i].bv_page;
1039-
1040-
if (ctx->should_dirty)
1041-
set_page_dirty(page);
1042-
if (ctx->bv_need_unpin)
1043-
unpin_user_page(page);
1044-
}
1045-
}
1046-
kvfree(ctx->bv);
1047-
}
1048-
1049-
kfree(ctx);
1050-
}
1051-
1052998
/**
1053999
* cifs_alloc_hash - allocate hash and hash context together
10541000
* @name: The name of the crypto hash algo

0 commit comments

Comments
 (0)