Lines Matching refs:wdata

4254 	struct cifs_writedata *wdata = mid->callback_data;  in smb2_writev_callback()  local
4255 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); in smb2_writev_callback()
4256 struct TCP_Server_Info *server = wdata->server; in smb2_writev_callback()
4261 WARN_ONCE(wdata->server != mid->server, in smb2_writev_callback()
4263 wdata->server, mid->server); in smb2_writev_callback()
4269 wdata->result = smb2_check_receive(mid, server, 0); in smb2_writev_callback()
4270 if (wdata->result != 0) in smb2_writev_callback()
4280 if (written > wdata->bytes) in smb2_writev_callback()
4283 if (written < wdata->bytes) in smb2_writev_callback()
4284 wdata->result = -ENOSPC; in smb2_writev_callback()
4286 wdata->bytes = written; in smb2_writev_callback()
4290 wdata->result = -EAGAIN; in smb2_writev_callback()
4297 wdata->result = -EIO; in smb2_writev_callback()
4308 if (wdata->mr) { in smb2_writev_callback()
4309 smbd_deregister_mr(wdata->mr); in smb2_writev_callback()
4310 wdata->mr = NULL; in smb2_writev_callback()
4313 if (wdata->result) { in smb2_writev_callback()
4316 wdata->cfile->fid.persistent_fid, in smb2_writev_callback()
4317 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_writev_callback()
4318 wdata->bytes, wdata->result); in smb2_writev_callback()
4319 if (wdata->result == -ENOSPC) in smb2_writev_callback()
4324 wdata->cfile->fid.persistent_fid, in smb2_writev_callback()
4326 wdata->offset, wdata->bytes); in smb2_writev_callback()
4328 queue_work(cifsiod_wq, &wdata->work); in smb2_writev_callback()
4335 smb2_async_writev(struct cifs_writedata *wdata, in smb2_async_writev() argument
4341 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); in smb2_async_writev()
4342 struct TCP_Server_Info *server = wdata->server; in smb2_async_writev()
4347 if (!wdata->server) in smb2_async_writev()
4348 server = wdata->server = cifs_pick_channel(tcon->ses); in smb2_async_writev()
4359 shdr->Id.SyncId.ProcessId = cpu_to_le32(wdata->cfile->pid); in smb2_async_writev()
4361 req->PersistentFileId = cpu_to_le64(wdata->cfile->fid.persistent_fid); in smb2_async_writev()
4362 req->VolatileFileId = cpu_to_le64(wdata->cfile->fid.volatile_fid); in smb2_async_writev()
4366 req->Offset = cpu_to_le64(wdata->offset); in smb2_async_writev()
4371 trace_smb3_write_enter(0 /* xid */, wdata->cfile->fid.persistent_fid, in smb2_async_writev()
4372 tcon->tid, tcon->ses->Suid, wdata->offset, wdata->bytes); in smb2_async_writev()
4378 if (server->rdma && !server->sign && wdata->bytes >= in smb2_async_writev()
4384 wdata->mr = smbd_register_mr( in smb2_async_writev()
4385 server->smbd_conn, wdata->pages, in smb2_async_writev()
4386 wdata->nr_pages, wdata->page_offset, in smb2_async_writev()
4387 wdata->tailsz, false, need_invalidate); in smb2_async_writev()
4388 if (!wdata->mr) { in smb2_async_writev()
4394 if (wdata->nr_pages > 1) in smb2_async_writev()
4397 (wdata->nr_pages - 1) * wdata->pagesz - in smb2_async_writev()
4398 wdata->page_offset + wdata->tailsz in smb2_async_writev()
4401 req->RemainingBytes = cpu_to_le32(wdata->tailsz); in smb2_async_writev()
4410 v1->offset = cpu_to_le64(wdata->mr->mr->iova); in smb2_async_writev()
4411 v1->token = cpu_to_le32(wdata->mr->mr->rkey); in smb2_async_writev()
4412 v1->length = cpu_to_le32(wdata->mr->mr->length); in smb2_async_writev()
4420 rqst.rq_pages = wdata->pages; in smb2_async_writev()
4421 rqst.rq_offset = wdata->page_offset; in smb2_async_writev()
4422 rqst.rq_npages = wdata->nr_pages; in smb2_async_writev()
4423 rqst.rq_pagesz = wdata->pagesz; in smb2_async_writev()
4424 rqst.rq_tailsz = wdata->tailsz; in smb2_async_writev()
4426 if (wdata->mr) { in smb2_async_writev()
4432 wdata->offset, wdata->bytes); in smb2_async_writev()
4436 if (!wdata->mr) in smb2_async_writev()
4437 req->Length = cpu_to_le32(wdata->bytes); in smb2_async_writev()
4439 req->Length = cpu_to_le32(wdata->bytes); in smb2_async_writev()
4442 if (wdata->credits.value > 0) { in smb2_async_writev()
4443 shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(wdata->bytes, in smb2_async_writev()
4447 rc = adjust_credits(server, &wdata->credits, wdata->bytes); in smb2_async_writev()
4454 kref_get(&wdata->refcount); in smb2_async_writev()
4456 wdata, flags, &wdata->credits); in smb2_async_writev()
4461 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_async_writev()
4462 wdata->bytes, rc); in smb2_async_writev()
4463 kref_put(&wdata->refcount, release); in smb2_async_writev()