Lines Matching refs:wdata

2264 	struct cifs_writedata *wdata;  in wdata_alloc_and_fillpages()  local
2266 wdata = cifs_writedata_alloc((unsigned int)tofind, in wdata_alloc_and_fillpages()
2268 if (!wdata) in wdata_alloc_and_fillpages()
2272 PAGECACHE_TAG_DIRTY, tofind, wdata->pages); in wdata_alloc_and_fillpages()
2273 return wdata; in wdata_alloc_and_fillpages()
2277 wdata_prepare_pages(struct cifs_writedata *wdata, unsigned int found_pages, in wdata_prepare_pages() argument
2286 page = wdata->pages[i]; in wdata_prepare_pages()
2337 wdata->pages[i] = page; in wdata_prepare_pages()
2344 *index = wdata->pages[0]->index + 1; in wdata_prepare_pages()
2348 put_page(wdata->pages[i]); in wdata_prepare_pages()
2349 wdata->pages[i] = NULL; in wdata_prepare_pages()
2356 wdata_send_pages(struct cifs_writedata *wdata, unsigned int nr_pages, in wdata_send_pages() argument
2361 wdata->sync_mode = wbc->sync_mode; in wdata_send_pages()
2362 wdata->nr_pages = nr_pages; in wdata_send_pages()
2363 wdata->offset = page_offset(wdata->pages[0]); in wdata_send_pages()
2364 wdata->pagesz = PAGE_SIZE; in wdata_send_pages()
2365 wdata->tailsz = min(i_size_read(mapping->host) - in wdata_send_pages()
2366 page_offset(wdata->pages[nr_pages - 1]), in wdata_send_pages()
2368 wdata->bytes = ((nr_pages - 1) * PAGE_SIZE) + wdata->tailsz; in wdata_send_pages()
2369 wdata->pid = wdata->cfile->pid; in wdata_send_pages()
2371 rc = adjust_credits(wdata->server, &wdata->credits, wdata->bytes); in wdata_send_pages()
2375 if (wdata->cfile->invalidHandle) in wdata_send_pages()
2378 rc = wdata->server->ops->async_writev(wdata, in wdata_send_pages()
2392 struct cifs_writedata *wdata; in cifs_writepages() local
2444 wdata = wdata_alloc_and_fillpages(tofind, mapping, end, &index, in cifs_writepages()
2446 if (!wdata) { in cifs_writepages()
2454 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writepages()
2459 nr_pages = wdata_prepare_pages(wdata, found_pages, mapping, wbc, in cifs_writepages()
2464 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writepages()
2469 wdata->credits = credits_on_stack; in cifs_writepages()
2470 wdata->cfile = cfile; in cifs_writepages()
2471 wdata->server = server; in cifs_writepages()
2474 if (!wdata->cfile) { in cifs_writepages()
2482 rc = wdata_send_pages(wdata, nr_pages, mapping, wbc); in cifs_writepages()
2485 unlock_page(wdata->pages[i]); in cifs_writepages()
2489 add_credits_and_wake_if(server, &wdata->credits, 0); in cifs_writepages()
2493 wdata->pages[i]); in cifs_writepages()
2495 SetPageError(wdata->pages[i]); in cifs_writepages()
2496 end_page_writeback(wdata->pages[i]); in cifs_writepages()
2497 put_page(wdata->pages[i]); in cifs_writepages()
2502 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writepages()
2824 struct cifs_writedata *wdata = container_of(refcount, in cifs_uncached_writedata_release() local
2827 kref_put(&wdata->ctx->refcount, cifs_aio_ctx_release); in cifs_uncached_writedata_release()
2828 for (i = 0; i < wdata->nr_pages; i++) in cifs_uncached_writedata_release()
2829 put_page(wdata->pages[i]); in cifs_uncached_writedata_release()
2838 struct cifs_writedata *wdata = container_of(work, in cifs_uncached_writev_complete() local
2840 struct inode *inode = d_inode(wdata->cfile->dentry); in cifs_uncached_writev_complete()
2844 cifs_update_eof(cifsi, wdata->offset, wdata->bytes); in cifs_uncached_writev_complete()
2849 complete(&wdata->done); in cifs_uncached_writev_complete()
2850 collect_uncached_write_data(wdata->ctx); in cifs_uncached_writev_complete()
2852 kref_put(&wdata->refcount, cifs_uncached_writedata_release); in cifs_uncached_writev_complete()
2856 wdata_fill_from_iovec(struct cifs_writedata *wdata, struct iov_iter *from, in wdata_fill_from_iovec() argument
2865 copied = copy_page_from_iter(wdata->pages[i], 0, bytes, from); in wdata_fill_from_iovec()
2898 cifs_resend_wdata(struct cifs_writedata *wdata, struct list_head *wdata_list, in cifs_resend_wdata() argument
2904 struct TCP_Server_Info *server = wdata->server; in cifs_resend_wdata()
2907 if (wdata->cfile->invalidHandle) { in cifs_resend_wdata()
2908 rc = cifs_reopen_file(wdata->cfile, false); in cifs_resend_wdata()
2922 rc = server->ops->wait_mtu_credits(server, wdata->bytes, in cifs_resend_wdata()
2927 if (wsize < wdata->bytes) { in cifs_resend_wdata()
2931 } while (wsize < wdata->bytes); in cifs_resend_wdata()
2932 wdata->credits = credits; in cifs_resend_wdata()
2934 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in cifs_resend_wdata()
2937 if (wdata->cfile->invalidHandle) in cifs_resend_wdata()
2941 if (wdata->mr) { in cifs_resend_wdata()
2942 wdata->mr->need_invalidate = true; in cifs_resend_wdata()
2943 smbd_deregister_mr(wdata->mr); in cifs_resend_wdata()
2944 wdata->mr = NULL; in cifs_resend_wdata()
2947 rc = server->ops->async_writev(wdata, in cifs_resend_wdata()
2954 list_add_tail(&wdata->list, wdata_list); in cifs_resend_wdata()
2959 add_credits_and_wake_if(server, &wdata->credits, 0); in cifs_resend_wdata()
2963 kref_put(&wdata->refcount, cifs_uncached_writedata_release); in cifs_resend_wdata()
2976 struct cifs_writedata *wdata; in cifs_write_from_iter() local
3035 wdata = cifs_writedata_direct_alloc(pagevec, in cifs_write_from_iter()
3037 if (!wdata) { in cifs_write_from_iter()
3044 wdata->page_offset = start; in cifs_write_from_iter()
3045 wdata->tailsz = in cifs_write_from_iter()
3052 wdata = cifs_writedata_alloc(nr_pages, in cifs_write_from_iter()
3054 if (!wdata) { in cifs_write_from_iter()
3060 rc = cifs_write_allocate_pages(wdata->pages, nr_pages); in cifs_write_from_iter()
3062 kvfree(wdata->pages); in cifs_write_from_iter()
3063 kfree(wdata); in cifs_write_from_iter()
3070 wdata, from, &cur_len, &num_pages); in cifs_write_from_iter()
3073 put_page(wdata->pages[i]); in cifs_write_from_iter()
3074 kvfree(wdata->pages); in cifs_write_from_iter()
3075 kfree(wdata); in cifs_write_from_iter()
3085 put_page(wdata->pages[nr_pages - 1]); in cifs_write_from_iter()
3087 wdata->tailsz = cur_len - ((nr_pages - 1) * PAGE_SIZE); in cifs_write_from_iter()
3090 wdata->sync_mode = WB_SYNC_ALL; in cifs_write_from_iter()
3091 wdata->nr_pages = nr_pages; in cifs_write_from_iter()
3092 wdata->offset = (__u64)offset; in cifs_write_from_iter()
3093 wdata->cfile = cifsFileInfo_get(open_file); in cifs_write_from_iter()
3094 wdata->server = server; in cifs_write_from_iter()
3095 wdata->pid = pid; in cifs_write_from_iter()
3096 wdata->bytes = cur_len; in cifs_write_from_iter()
3097 wdata->pagesz = PAGE_SIZE; in cifs_write_from_iter()
3098 wdata->credits = credits_on_stack; in cifs_write_from_iter()
3099 wdata->ctx = ctx; in cifs_write_from_iter()
3102 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in cifs_write_from_iter()
3105 if (wdata->cfile->invalidHandle) in cifs_write_from_iter()
3108 rc = server->ops->async_writev(wdata, in cifs_write_from_iter()
3113 add_credits_and_wake_if(server, &wdata->credits, 0); in cifs_write_from_iter()
3114 kref_put(&wdata->refcount, in cifs_write_from_iter()
3124 list_add_tail(&wdata->list, wdata_list); in cifs_write_from_iter()
3135 struct cifs_writedata *wdata, *tmp; in collect_uncached_write_data() local
3158 list_for_each_entry_safe(wdata, tmp, &ctx->list, list) { in collect_uncached_write_data()
3160 if (!try_wait_for_completion(&wdata->done)) { in collect_uncached_write_data()
3165 if (wdata->result) in collect_uncached_write_data()
3166 rc = wdata->result; in collect_uncached_write_data()
3168 ctx->total_len += wdata->bytes; in collect_uncached_write_data()
3176 list_del_init(&wdata->list); in collect_uncached_write_data()
3180 wdata, &tmp_list, ctx); in collect_uncached_write_data()
3183 wdata->offset - ctx->pos); in collect_uncached_write_data()
3185 rc = cifs_write_from_iter(wdata->offset, in collect_uncached_write_data()
3186 wdata->bytes, &tmp_from, in collect_uncached_write_data()
3190 kref_put(&wdata->refcount, in collect_uncached_write_data()
3198 list_del_init(&wdata->list); in collect_uncached_write_data()
3199 kref_put(&wdata->refcount, cifs_uncached_writedata_release); in collect_uncached_write_data()