Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a20c93e3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Trond Myklebust
Browse files

nfs: remove ->write_pageio_init from rpc ops



The write_pageio_init method is just a very convoluted way to grab the
right nfs_pageio_ops vector.  The vector to chose is not a choice of
protocol version, but just a pNFS vs MDS I/O choice that can simply be
done inside nfs_pageio_init_write based on the presence of a layout
driver, and a new force_mds flag to the special case of falling back
to MDS I/O on a pNFS-capable volume.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 1b33809e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
	dreq->count = 0;
	get_dreq(dreq);

	NFS_PROTO(dreq->inode)->write_pageio_init(&desc, dreq->inode, FLUSH_STABLE,
	nfs_pageio_init_write(&desc, dreq->inode, FLUSH_STABLE, false,
			      &nfs_direct_write_completion_ops);
	desc.pg_dreq = dreq;

@@ -874,7 +874,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
	size_t requested_bytes = 0;
	unsigned long seg;

	NFS_PROTO(inode)->write_pageio_init(&desc, inode, FLUSH_COND_STABLE,
	nfs_pageio_init_write(&desc, inode, FLUSH_COND_STABLE, false,
			      &nfs_direct_write_completion_ops);
	desc.pg_dreq = dreq;
	get_dreq(dreq);
+1 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ int nfs_remount(struct super_block *sb, int *flags, char *raw_data);

/* write.c */
extern void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio,
			struct inode *inode, int ioflags,
			struct inode *inode, int ioflags, bool force_mds,
			const struct nfs_pgio_completion_ops *compl_ops);
extern struct nfs_write_header *nfs_writehdr_alloc(void);
extern void nfs_writehdr_free(struct nfs_pgio_header *hdr);
+0 −1
Original line number Diff line number Diff line
@@ -951,7 +951,6 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
	.read_rpc_prepare = nfs3_proc_read_rpc_prepare,
	.read_done	= nfs3_read_done,
	.write_setup	= nfs3_proc_write_setup,
	.write_pageio_init = nfs_pageio_init_write,
	.write_rpc_prepare = nfs3_proc_write_rpc_prepare,
	.write_done	= nfs3_write_done,
	.commit_setup	= nfs3_proc_commit_setup,
+0 −1
Original line number Diff line number Diff line
@@ -8437,7 +8437,6 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
	.read_rpc_prepare = nfs4_proc_read_rpc_prepare,
	.read_done	= nfs4_read_done,
	.write_setup	= nfs4_proc_write_setup,
	.write_pageio_init = pnfs_pageio_init_write,
	.write_rpc_prepare = nfs4_proc_write_rpc_prepare,
	.write_done	= nfs4_write_done,
	.commit_setup	= nfs4_proc_commit_setup,
+1 −15
Original line number Diff line number Diff line
@@ -1447,20 +1447,6 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *inode,
		nfs_pageio_init(pgio, inode, ld->pg_read_ops, compl_ops, server->rsize, 0);
}

void
pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode,
		       int ioflags,
		       const struct nfs_pgio_completion_ops *compl_ops)
{
	struct nfs_server *server = NFS_SERVER(inode);
	struct pnfs_layoutdriver_type *ld = server->pnfs_curr_ld;

	if (ld == NULL)
		nfs_pageio_init_write(pgio, inode, ioflags, compl_ops);
	else
		nfs_pageio_init(pgio, inode, ld->pg_write_ops, compl_ops, server->wsize, ioflags);
}

bool
pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
		     struct nfs_page *req)
@@ -1496,7 +1482,7 @@ int pnfs_write_done_resend_to_mds(struct inode *inode,
	LIST_HEAD(failed);

	/* Resend all requests through the MDS */
	nfs_pageio_init_write(&pgio, inode, FLUSH_STABLE, compl_ops);
	nfs_pageio_init_write(&pgio, inode, FLUSH_STABLE, true, compl_ops);
	pgio.pg_dreq = dreq;
	while (!list_empty(head)) {
		struct nfs_page *req = nfs_list_entry(head->next);
Loading