Lines Matching refs:hdr
114 static void nfs_writehdr_free(struct nfs_pgio_header *hdr) in nfs_writehdr_free() argument
116 mempool_free(hdr, nfs_wdata_mempool); in nfs_writehdr_free()
974 int nfs_write_need_commit(struct nfs_pgio_header *hdr) in nfs_write_need_commit() argument
976 if (hdr->verf.committed == NFS_DATA_SYNC) in nfs_write_need_commit()
977 return hdr->lseg == NULL; in nfs_write_need_commit()
978 return hdr->verf.committed != NFS_FILE_SYNC; in nfs_write_need_commit()
981 static void nfs_async_write_init(struct nfs_pgio_header *hdr) in nfs_async_write_init() argument
983 nfs_io_completion_get(hdr->io_completion); in nfs_async_write_init()
986 static void nfs_write_completion(struct nfs_pgio_header *hdr) in nfs_write_completion() argument
991 if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) in nfs_write_completion()
993 nfs_init_cinfo_from_inode(&cinfo, hdr->inode); in nfs_write_completion()
994 while (!list_empty(&hdr->pages)) { in nfs_write_completion()
995 struct nfs_page *req = nfs_list_entry(hdr->pages.next); in nfs_write_completion()
999 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && in nfs_write_completion()
1000 (hdr->good_bytes < bytes)) { in nfs_write_completion()
1002 nfs_mapping_set_error(req->wb_page, hdr->error); in nfs_write_completion()
1005 if (nfs_write_need_commit(hdr)) { in nfs_write_completion()
1008 memcpy(&req->wb_verf, &hdr->verf.verifier, sizeof(req->wb_verf)); in nfs_write_completion()
1009 nfs_mark_request_commit(req, hdr->lseg, &cinfo, in nfs_write_completion()
1010 hdr->pgio_mirror_idx); in nfs_write_completion()
1020 nfs_io_completion_put(hdr->io_completion); in nfs_write_completion()
1021 hdr->release(hdr); in nfs_write_completion()
1397 static void nfs_initiate_write(struct nfs_pgio_header *hdr, in nfs_initiate_write() argument
1405 rpc_ops->write_setup(hdr, msg, &task_setup_data->rpc_client); in nfs_initiate_write()
1406 trace_nfs_initiate_write(hdr->inode, hdr->io_start, hdr->good_bytes, in nfs_initiate_write()
1407 hdr->args.stable); in nfs_initiate_write()
1438 static void nfs_async_write_reschedule_io(struct nfs_pgio_header *hdr) in nfs_async_write_reschedule_io() argument
1440 nfs_async_write_error(&hdr->pages, 0); in nfs_async_write_reschedule_io()
1441 filemap_fdatawrite_range(hdr->inode->i_mapping, hdr->args.offset, in nfs_async_write_reschedule_io()
1442 hdr->args.offset + hdr->args.count - 1); in nfs_async_write_reschedule_io()
1517 static void nfs_writeback_check_extend(struct nfs_pgio_header *hdr, in nfs_writeback_check_extend() argument
1520 struct nfs_pgio_args *argp = &hdr->args; in nfs_writeback_check_extend()
1521 struct nfs_pgio_res *resp = &hdr->res; in nfs_writeback_check_extend()
1526 if (nfs_size_to_loff_t(fattr->size) < i_size_read(hdr->inode)) { in nfs_writeback_check_extend()
1538 void nfs_writeback_update_inode(struct nfs_pgio_header *hdr) in nfs_writeback_update_inode() argument
1540 struct nfs_fattr *fattr = &hdr->fattr; in nfs_writeback_update_inode()
1541 struct inode *inode = hdr->inode; in nfs_writeback_update_inode()
1544 nfs_writeback_check_extend(hdr, fattr); in nfs_writeback_update_inode()
1554 struct nfs_pgio_header *hdr, in nfs_writeback_done() argument
1566 status = NFS_PROTO(inode)->write_done(task, hdr); in nfs_writeback_done()
1570 nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, hdr->res.count); in nfs_writeback_done()
1572 hdr->args.offset, hdr->res.verf); in nfs_writeback_done()
1574 if (hdr->res.verf->committed < hdr->args.stable && in nfs_writeback_done()
1591 hdr->res.verf->committed, hdr->args.stable); in nfs_writeback_done()
1609 struct nfs_pgio_header *hdr) in nfs_writeback_result() argument
1611 struct nfs_pgio_args *argp = &hdr->args; in nfs_writeback_result()
1612 struct nfs_pgio_res *resp = &hdr->res; in nfs_writeback_result()
1618 nfs_inc_stats(hdr->inode, NFSIOS_SHORTWRITE); in nfs_writeback_result()
1628 nfs_set_pgio_error(hdr, -EIO, argp->offset); in nfs_writeback_result()
1635 hdr->pnfs_error = -EAGAIN; in nfs_writeback_result()
1642 hdr->mds_offset += resp->count; in nfs_writeback_result()