Lines Matching refs:ctx
788 struct cifs_aio_ctx *ctx;
791 * Must use kzalloc to initialize ctx->bv to NULL and ctx->direct_io
795 ctx = kzalloc(sizeof(struct cifs_aio_ctx), GFP_KERNEL);
796 if (!ctx)
799 INIT_LIST_HEAD(&ctx->list);
800 mutex_init(&ctx->aio_mutex);
801 init_completion(&ctx->done);
802 kref_init(&ctx->refcount);
803 return ctx;
809 struct cifs_aio_ctx *ctx = container_of(refcount,
812 cifsFileInfo_put(ctx->cfile);
815 * ctx->bv is only set if setup_aio_ctx_iter() was call successfuly
819 if (ctx->bv) {
822 for (i = 0; i < ctx->npages; i++) {
823 if (ctx->should_dirty)
824 set_page_dirty(ctx->bv[i].bv_page);
825 put_page(ctx->bv[i].bv_page);
827 kvfree(ctx->bv);
830 kfree(ctx);
836 setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw)
851 memcpy(&ctx->iter, iter, sizeof(*iter));
852 ctx->len = count;
916 ctx->bv = bv;
917 ctx->len = saved_len - count;
918 ctx->npages = npages;
919 iov_iter_bvec(&ctx->iter, rw, ctx->bv, npages, ctx->len);