Lines Matching refs:hdr
1906 int pnfs_write_done_resend_to_mds(struct nfs_pgio_header *hdr) in pnfs_write_done_resend_to_mds() argument
1911 nfs_pageio_init_write(&pgio, hdr->inode, FLUSH_STABLE, true, in pnfs_write_done_resend_to_mds()
1912 hdr->completion_ops); in pnfs_write_done_resend_to_mds()
1913 set_bit(NFS_CONTEXT_RESEND_WRITES, &hdr->args.context->flags); in pnfs_write_done_resend_to_mds()
1914 return nfs_pageio_resend(&pgio, hdr); in pnfs_write_done_resend_to_mds()
1918 static void pnfs_ld_handle_write_error(struct nfs_pgio_header *hdr) in pnfs_ld_handle_write_error() argument
1921 dprintk("pnfs write error = %d\n", hdr->pnfs_error); in pnfs_ld_handle_write_error()
1922 if (NFS_SERVER(hdr->inode)->pnfs_curr_ld->flags & in pnfs_ld_handle_write_error()
1924 pnfs_return_layout(hdr->inode); in pnfs_ld_handle_write_error()
1926 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) in pnfs_ld_handle_write_error()
1927 hdr->task.tk_status = pnfs_write_done_resend_to_mds(hdr); in pnfs_ld_handle_write_error()
1933 void pnfs_ld_write_done(struct nfs_pgio_header *hdr) in pnfs_ld_write_done() argument
1935 if (likely(!hdr->pnfs_error)) { in pnfs_ld_write_done()
1936 pnfs_set_layoutcommit(hdr->inode, hdr->lseg, in pnfs_ld_write_done()
1937 hdr->mds_offset + hdr->res.count); in pnfs_ld_write_done()
1938 hdr->mds_ops->rpc_call_done(&hdr->task, hdr); in pnfs_ld_write_done()
1940 trace_nfs4_pnfs_write(hdr, hdr->pnfs_error); in pnfs_ld_write_done()
1941 if (unlikely(hdr->pnfs_error)) in pnfs_ld_write_done()
1942 pnfs_ld_handle_write_error(hdr); in pnfs_ld_write_done()
1943 hdr->mds_ops->rpc_release(hdr); in pnfs_ld_write_done()
1949 struct nfs_pgio_header *hdr) in pnfs_write_through_mds() argument
1953 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in pnfs_write_through_mds()
1954 list_splice_tail_init(&hdr->pages, &mirror->pg_list); in pnfs_write_through_mds()
1958 hdr->completion_ops->completion(hdr); in pnfs_write_through_mds()
1962 pnfs_try_to_write_data(struct nfs_pgio_header *hdr, in pnfs_try_to_write_data() argument
1967 struct inode *inode = hdr->inode; in pnfs_try_to_write_data()
1971 hdr->mds_ops = call_ops; in pnfs_try_to_write_data()
1974 inode->i_ino, hdr->args.count, hdr->args.offset, how); in pnfs_try_to_write_data()
1975 trypnfs = nfss->pnfs_curr_ld->write_pagelist(hdr, how); in pnfs_try_to_write_data()
1984 struct nfs_pgio_header *hdr, int how) in pnfs_do_write() argument
1990 trypnfs = pnfs_try_to_write_data(hdr, call_ops, lseg, how); in pnfs_do_write()
1992 pnfs_write_through_mds(desc, hdr); in pnfs_do_write()
1995 static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) in pnfs_writehdr_free() argument
1997 pnfs_put_lseg(hdr->lseg); in pnfs_writehdr_free()
1998 nfs_pgio_header_free(hdr); in pnfs_writehdr_free()
2006 struct nfs_pgio_header *hdr; in pnfs_generic_pg_writepages() local
2009 hdr = nfs_pgio_header_alloc(desc->pg_rw_ops); in pnfs_generic_pg_writepages()
2010 if (!hdr) { in pnfs_generic_pg_writepages()
2014 nfs_pgheader_init(desc, hdr, pnfs_writehdr_free); in pnfs_generic_pg_writepages()
2016 hdr->lseg = pnfs_get_lseg(desc->pg_lseg); in pnfs_generic_pg_writepages()
2017 ret = nfs_generic_pgio(desc, hdr); in pnfs_generic_pg_writepages()
2019 pnfs_do_write(desc, hdr, desc->pg_ioflags); in pnfs_generic_pg_writepages()
2025 int pnfs_read_done_resend_to_mds(struct nfs_pgio_header *hdr) in pnfs_read_done_resend_to_mds() argument
2030 nfs_pageio_init_read(&pgio, hdr->inode, true, hdr->completion_ops); in pnfs_read_done_resend_to_mds()
2031 return nfs_pageio_resend(&pgio, hdr); in pnfs_read_done_resend_to_mds()
2035 static void pnfs_ld_handle_read_error(struct nfs_pgio_header *hdr) in pnfs_ld_handle_read_error() argument
2037 dprintk("pnfs read error = %d\n", hdr->pnfs_error); in pnfs_ld_handle_read_error()
2038 if (NFS_SERVER(hdr->inode)->pnfs_curr_ld->flags & in pnfs_ld_handle_read_error()
2040 pnfs_return_layout(hdr->inode); in pnfs_ld_handle_read_error()
2042 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) in pnfs_ld_handle_read_error()
2043 hdr->task.tk_status = pnfs_read_done_resend_to_mds(hdr); in pnfs_ld_handle_read_error()
2049 void pnfs_ld_read_done(struct nfs_pgio_header *hdr) in pnfs_ld_read_done() argument
2051 if (likely(!hdr->pnfs_error)) { in pnfs_ld_read_done()
2052 __nfs4_read_done_cb(hdr); in pnfs_ld_read_done()
2053 hdr->mds_ops->rpc_call_done(&hdr->task, hdr); in pnfs_ld_read_done()
2055 trace_nfs4_pnfs_read(hdr, hdr->pnfs_error); in pnfs_ld_read_done()
2056 if (unlikely(hdr->pnfs_error)) in pnfs_ld_read_done()
2057 pnfs_ld_handle_read_error(hdr); in pnfs_ld_read_done()
2058 hdr->mds_ops->rpc_release(hdr); in pnfs_ld_read_done()
2064 struct nfs_pgio_header *hdr) in pnfs_read_through_mds() argument
2068 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { in pnfs_read_through_mds()
2069 list_splice_tail_init(&hdr->pages, &mirror->pg_list); in pnfs_read_through_mds()
2073 hdr->completion_ops->completion(hdr); in pnfs_read_through_mds()
2080 pnfs_try_to_read_data(struct nfs_pgio_header *hdr, in pnfs_try_to_read_data() argument
2084 struct inode *inode = hdr->inode; in pnfs_try_to_read_data()
2088 hdr->mds_ops = call_ops; in pnfs_try_to_read_data()
2091 __func__, inode->i_ino, hdr->args.count, hdr->args.offset); in pnfs_try_to_read_data()
2093 trypnfs = nfss->pnfs_curr_ld->read_pagelist(hdr); in pnfs_try_to_read_data()
2101 int pnfs_read_resend_pnfs(struct nfs_pgio_header *hdr) in pnfs_read_resend_pnfs() argument
2105 nfs_pageio_init_read(&pgio, hdr->inode, false, hdr->completion_ops); in pnfs_read_resend_pnfs()
2106 return nfs_pageio_resend(&pgio, hdr); in pnfs_read_resend_pnfs()
2111 pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr) in pnfs_do_read() argument
2118 trypnfs = pnfs_try_to_read_data(hdr, call_ops, lseg); in pnfs_do_read()
2120 err = pnfs_read_resend_pnfs(hdr); in pnfs_do_read()
2122 pnfs_read_through_mds(desc, hdr); in pnfs_do_read()
2125 static void pnfs_readhdr_free(struct nfs_pgio_header *hdr) in pnfs_readhdr_free() argument
2127 pnfs_put_lseg(hdr->lseg); in pnfs_readhdr_free()
2128 nfs_pgio_header_free(hdr); in pnfs_readhdr_free()
2136 struct nfs_pgio_header *hdr; in pnfs_generic_pg_readpages() local
2139 hdr = nfs_pgio_header_alloc(desc->pg_rw_ops); in pnfs_generic_pg_readpages()
2140 if (!hdr) { in pnfs_generic_pg_readpages()
2144 nfs_pgheader_init(desc, hdr, pnfs_readhdr_free); in pnfs_generic_pg_readpages()
2145 hdr->lseg = pnfs_get_lseg(desc->pg_lseg); in pnfs_generic_pg_readpages()
2146 ret = nfs_generic_pgio(desc, hdr); in pnfs_generic_pg_readpages()
2148 pnfs_do_read(desc, hdr); in pnfs_generic_pg_readpages()
2350 struct pnfs_layout_hdr *hdr; in pnfs_report_layoutstat() local
2367 hdr = NFS_I(inode)->layout; in pnfs_report_layoutstat()
2368 pnfs_get_layout_hdr(hdr); in pnfs_report_layoutstat()
2379 nfs4_stateid_copy(&data->args.stateid, &hdr->plh_stateid); in pnfs_report_layoutstat()
2393 pnfs_put_layout_hdr(hdr); in pnfs_report_layoutstat()