• Home
  • Raw
  • Download

Lines Matching refs:wdata

2047 	struct cifs_writedata *wdata = container_of(refcount,  in cifs_writedata_release()  local
2050 if (wdata->mr) { in cifs_writedata_release()
2051 smbd_deregister_mr(wdata->mr); in cifs_writedata_release()
2052 wdata->mr = NULL; in cifs_writedata_release()
2056 if (wdata->cfile) in cifs_writedata_release()
2057 cifsFileInfo_put(wdata->cfile); in cifs_writedata_release()
2059 kvfree(wdata->pages); in cifs_writedata_release()
2060 kfree(wdata); in cifs_writedata_release()
2068 cifs_writev_requeue(struct cifs_writedata *wdata) in cifs_writev_requeue() argument
2071 struct inode *inode = d_inode(wdata->cfile->dentry); in cifs_writev_requeue()
2075 server = tlink_tcon(wdata->cfile->tlink)->ses->server; in cifs_writev_requeue()
2077 rest_len = wdata->bytes; in cifs_writev_requeue()
2104 wdata2->pages[j] = wdata->pages[i + j]; in cifs_writev_requeue()
2109 wdata2->sync_mode = wdata->sync_mode; in cifs_writev_requeue()
2148 } while (i < wdata->nr_pages); in cifs_writev_requeue()
2151 for (; i < wdata->nr_pages; i++) { in cifs_writev_requeue()
2152 SetPageError(wdata->pages[i]); in cifs_writev_requeue()
2153 end_page_writeback(wdata->pages[i]); in cifs_writev_requeue()
2154 put_page(wdata->pages[i]); in cifs_writev_requeue()
2159 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writev_requeue()
2165 struct cifs_writedata *wdata = container_of(work, in cifs_writev_complete() local
2167 struct inode *inode = d_inode(wdata->cfile->dentry); in cifs_writev_complete()
2170 if (wdata->result == 0) { in cifs_writev_complete()
2172 cifs_update_eof(CIFS_I(inode), wdata->offset, wdata->bytes); in cifs_writev_complete()
2174 cifs_stats_bytes_written(tlink_tcon(wdata->cfile->tlink), in cifs_writev_complete()
2175 wdata->bytes); in cifs_writev_complete()
2176 } else if (wdata->sync_mode == WB_SYNC_ALL && wdata->result == -EAGAIN) in cifs_writev_complete()
2177 return cifs_writev_requeue(wdata); in cifs_writev_complete()
2179 for (i = 0; i < wdata->nr_pages; i++) { in cifs_writev_complete()
2180 struct page *page = wdata->pages[i]; in cifs_writev_complete()
2181 if (wdata->result == -EAGAIN) in cifs_writev_complete()
2183 else if (wdata->result < 0) in cifs_writev_complete()
2188 if (wdata->result != -EAGAIN) in cifs_writev_complete()
2189 mapping_set_error(inode->i_mapping, wdata->result); in cifs_writev_complete()
2190 kref_put(&wdata->refcount, cifs_writedata_release); in cifs_writev_complete()
2207 struct cifs_writedata *wdata; in cifs_writedata_direct_alloc() local
2209 wdata = kzalloc(sizeof(*wdata), GFP_NOFS); in cifs_writedata_direct_alloc()
2210 if (wdata != NULL) { in cifs_writedata_direct_alloc()
2211 wdata->pages = pages; in cifs_writedata_direct_alloc()
2212 kref_init(&wdata->refcount); in cifs_writedata_direct_alloc()
2213 INIT_LIST_HEAD(&wdata->list); in cifs_writedata_direct_alloc()
2214 init_completion(&wdata->done); in cifs_writedata_direct_alloc()
2215 INIT_WORK(&wdata->work, complete); in cifs_writedata_direct_alloc()
2217 return wdata; in cifs_writedata_direct_alloc()
2227 struct cifs_writedata *wdata = mid->callback_data; in cifs_writev_callback() local
2228 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); in cifs_writev_callback()
2235 wdata->result = cifs_check_receive(mid, tcon->ses->server, 0); in cifs_writev_callback()
2236 if (wdata->result != 0) in cifs_writev_callback()
2248 if (written > wdata->bytes) in cifs_writev_callback()
2251 if (written < wdata->bytes) in cifs_writev_callback()
2252 wdata->result = -ENOSPC; in cifs_writev_callback()
2254 wdata->bytes = written; in cifs_writev_callback()
2258 wdata->result = -EAGAIN; in cifs_writev_callback()
2261 wdata->result = -EIO; in cifs_writev_callback()
2265 queue_work(cifsiod_wq, &wdata->work); in cifs_writev_callback()
2272 cifs_async_writev(struct cifs_writedata *wdata, in cifs_async_writev() argument
2278 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); in cifs_async_writev()
2286 if (wdata->offset >> 32 > 0) { in cifs_async_writev()
2296 smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid); in cifs_async_writev()
2297 smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16)); in cifs_async_writev()
2300 smb->Fid = wdata->cfile->fid.netfid; in cifs_async_writev()
2301 smb->OffsetLow = cpu_to_le32(wdata->offset & 0xFFFFFFFF); in cifs_async_writev()
2303 smb->OffsetHigh = cpu_to_le32(wdata->offset >> 32); in cifs_async_writev()
2319 rqst.rq_pages = wdata->pages; in cifs_async_writev()
2320 rqst.rq_offset = wdata->page_offset; in cifs_async_writev()
2321 rqst.rq_npages = wdata->nr_pages; in cifs_async_writev()
2322 rqst.rq_pagesz = wdata->pagesz; in cifs_async_writev()
2323 rqst.rq_tailsz = wdata->tailsz; in cifs_async_writev()
2326 wdata->offset, wdata->bytes); in cifs_async_writev()
2328 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF); in cifs_async_writev()
2329 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16); in cifs_async_writev()
2332 inc_rfc1001_len(&smb->hdr, wdata->bytes + 1); in cifs_async_writev()
2333 put_bcc(wdata->bytes + 1, &smb->hdr); in cifs_async_writev()
2338 inc_rfc1001_len(&smbw->hdr, wdata->bytes + 5); in cifs_async_writev()
2339 put_bcc(wdata->bytes + 5, &smbw->hdr); in cifs_async_writev()
2343 kref_get(&wdata->refcount); in cifs_async_writev()
2345 cifs_writev_callback, NULL, wdata, 0, NULL); in cifs_async_writev()
2350 kref_put(&wdata->refcount, release); in cifs_async_writev()