Commit cd936507 authored by David Howells's avatar David Howells Committed by Steve French
Browse files

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: default avatarDavid Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: linux-cifs@vger.kernel.org
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 4b96024e
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -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
+0 −2
Original line number Diff line number Diff line
@@ -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);
+0 −54
Original line number Diff line number Diff line
@@ -995,60 +995,6 @@ parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size,
	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