Lines Matching refs:wdata
1860 struct cifs_writedata *wdata = container_of(refcount, in cifs_writedata_release() local
1863 if (wdata->mr) { in cifs_writedata_release()
1864 smbd_deregister_mr(wdata->mr); in cifs_writedata_release()
1865 wdata->mr = NULL; in cifs_writedata_release()
1869 if (wdata->cfile) in cifs_writedata_release()
1870 cifsFileInfo_put(wdata->cfile); in cifs_writedata_release()
1872 kvfree(wdata->pages); in cifs_writedata_release()
1873 kfree(wdata); in cifs_writedata_release()
1881 cifs_writev_requeue(struct cifs_writedata *wdata) in cifs_writev_requeue() argument
1884 struct inode *inode = d_inode(wdata->cfile->dentry); in cifs_writev_requeue()
1888 server = tlink_tcon(wdata->cfile->tlink)->ses->server; in cifs_writev_requeue()
1890 rest_len = wdata->bytes; in cifs_writev_requeue()
1917 wdata2->pages[j] = wdata->pages[i + j]; in cifs_writev_requeue()
1922 wdata2->sync_mode = wdata->sync_mode; in cifs_writev_requeue()
1961 } while (i < wdata->nr_pages); in cifs_writev_requeue()
1964 for (; i < wdata->nr_pages; i++) { in cifs_writev_requeue()
1965 SetPageError(wdata->pages[i]); in cifs_writev_requeue()
1966 end_page_writeback(wdata->pages[i]); in cifs_writev_requeue()
1967 put_page(wdata->pages[i]); in cifs_writev_requeue()
1972 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writev_requeue()
1978 struct cifs_writedata *wdata = container_of(work, in cifs_writev_complete() local
1980 struct inode *inode = d_inode(wdata->cfile->dentry); in cifs_writev_complete()
1983 if (wdata->result == 0) { in cifs_writev_complete()
1985 cifs_update_eof(CIFS_I(inode), wdata->offset, wdata->bytes); in cifs_writev_complete()
1987 cifs_stats_bytes_written(tlink_tcon(wdata->cfile->tlink), in cifs_writev_complete()
1988 wdata->bytes); in cifs_writev_complete()
1989 } else if (wdata->sync_mode == WB_SYNC_ALL && wdata->result == -EAGAIN) in cifs_writev_complete()
1990 return cifs_writev_requeue(wdata); in cifs_writev_complete()
1992 for (i = 0; i < wdata->nr_pages; i++) { in cifs_writev_complete()
1993 struct page *page = wdata->pages[i]; in cifs_writev_complete()
1994 if (wdata->result == -EAGAIN) in cifs_writev_complete()
1996 else if (wdata->result < 0) in cifs_writev_complete()
2002 if (wdata->result != -EAGAIN) in cifs_writev_complete()
2003 mapping_set_error(inode->i_mapping, wdata->result); in cifs_writev_complete()
2004 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writev_complete()
2021 struct cifs_writedata *wdata; in cifs_writedata_direct_alloc() local
2023 wdata = kzalloc(sizeof(*wdata), GFP_NOFS); in cifs_writedata_direct_alloc()
2024 if (wdata != NULL) { in cifs_writedata_direct_alloc()
2025 wdata->pages = pages; in cifs_writedata_direct_alloc()
2026 kref_init(&wdata->refcount); in cifs_writedata_direct_alloc()
2027 INIT_LIST_HEAD(&wdata->list); in cifs_writedata_direct_alloc()
2028 init_completion(&wdata->done); in cifs_writedata_direct_alloc()
2029 INIT_WORK(&wdata->work, complete); in cifs_writedata_direct_alloc()
2031 return wdata; in cifs_writedata_direct_alloc()
2041 struct cifs_writedata *wdata = mid->callback_data; in cifs_writev_callback() local
2042 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); in cifs_writev_callback()
2049 wdata->result = cifs_check_receive(mid, tcon->ses->server, 0); in cifs_writev_callback()
2050 if (wdata->result != 0) in cifs_writev_callback()
2062 if (written > wdata->bytes) in cifs_writev_callback()
2065 if (written < wdata->bytes) in cifs_writev_callback()
2066 wdata->result = -ENOSPC; in cifs_writev_callback()
2068 wdata->bytes = written; in cifs_writev_callback()
2072 wdata->result = -EAGAIN; in cifs_writev_callback()
2075 wdata->result = -EIO; in cifs_writev_callback()
2079 queue_work(cifsiod_wq, &wdata->work); in cifs_writev_callback()
2086 cifs_async_writev(struct cifs_writedata *wdata, in cifs_async_writev() argument
2092 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); in cifs_async_writev()
2100 if (wdata->offset >> 32 > 0) { in cifs_async_writev()
2110 smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid); in cifs_async_writev()
2111 smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16)); in cifs_async_writev()
2114 smb->Fid = wdata->cfile->fid.netfid; in cifs_async_writev()
2115 smb->OffsetLow = cpu_to_le32(wdata->offset & 0xFFFFFFFF); in cifs_async_writev()
2117 smb->OffsetHigh = cpu_to_le32(wdata->offset >> 32); in cifs_async_writev()
2133 rqst.rq_pages = wdata->pages; in cifs_async_writev()
2134 rqst.rq_offset = wdata->page_offset; in cifs_async_writev()
2135 rqst.rq_npages = wdata->nr_pages; in cifs_async_writev()
2136 rqst.rq_pagesz = wdata->pagesz; in cifs_async_writev()
2137 rqst.rq_tailsz = wdata->tailsz; in cifs_async_writev()
2140 wdata->offset, wdata->bytes); in cifs_async_writev()
2142 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF); in cifs_async_writev()
2143 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16); in cifs_async_writev()
2146 inc_rfc1001_len(&smb->hdr, wdata->bytes + 1); in cifs_async_writev()
2147 put_bcc(wdata->bytes + 1, &smb->hdr); in cifs_async_writev()
2152 inc_rfc1001_len(&smbw->hdr, wdata->bytes + 5); in cifs_async_writev()
2153 put_bcc(wdata->bytes + 5, &smbw->hdr); in cifs_async_writev()
2157 kref_get(&wdata->refcount); in cifs_async_writev()
2159 cifs_writev_callback, NULL, wdata, 0, NULL); in cifs_async_writev()
2164 kref_put(&wdata->refcount, release); in cifs_async_writev()