Skip to content

Commit df24c48

Browse files
Mike SnitzerAnna Schumaker
authored andcommitted
nfs: pass struct nfsd_file to nfs_init_pgio and nfs_init_commit
The nfsd_file will be passed, in future commits, by callers that enable LOCALIO support (for both regular NFS and pNFS IO). [Derived from patch authored by Weston Andros Adamson, but switched from passing struct file to struct nfsd_file] Signed-off-by: Mike Snitzer <snitzer@kernel.org> Reviewed-by: NeilBrown <neilb@suse.de> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent 946af9b commit df24c48

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

fs/nfs/filelayout/filelayout.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ filelayout_read_pagelist(struct nfs_pgio_header *hdr)
488488
/* Perform an asynchronous read to ds */
489489
nfs_initiate_pgio(ds_clnt, hdr, hdr->cred,
490490
NFS_PROTO(hdr->inode), &filelayout_read_call_ops,
491-
0, RPC_TASK_SOFTCONN);
491+
0, RPC_TASK_SOFTCONN, NULL);
492492
return PNFS_ATTEMPTED;
493493
}
494494

@@ -530,7 +530,7 @@ filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
530530
/* Perform an asynchronous write */
531531
nfs_initiate_pgio(ds_clnt, hdr, hdr->cred,
532532
NFS_PROTO(hdr->inode), &filelayout_write_call_ops,
533-
sync, RPC_TASK_SOFTCONN);
533+
sync, RPC_TASK_SOFTCONN, NULL);
534534
return PNFS_ATTEMPTED;
535535
}
536536

@@ -1011,7 +1011,7 @@ static int filelayout_initiate_commit(struct nfs_commit_data *data, int how)
10111011
data->args.fh = fh;
10121012
return nfs_initiate_commit(ds_clnt, data, NFS_PROTO(data->inode),
10131013
&filelayout_commit_call_ops, how,
1014-
RPC_TASK_SOFTCONN);
1014+
RPC_TASK_SOFTCONN, NULL);
10151015
out_err:
10161016
pnfs_generic_prepare_to_resend_writes(data);
10171017
pnfs_generic_commit_release(data);

fs/nfs/flexfilelayout/flexfilelayout.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
18061806
nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops,
18071807
vers == 3 ? &ff_layout_read_call_ops_v3 :
18081808
&ff_layout_read_call_ops_v4,
1809-
0, RPC_TASK_SOFTCONN);
1809+
0, RPC_TASK_SOFTCONN, NULL);
18101810
put_cred(ds_cred);
18111811
return PNFS_ATTEMPTED;
18121812

@@ -1874,7 +1874,7 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
18741874
nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops,
18751875
vers == 3 ? &ff_layout_write_call_ops_v3 :
18761876
&ff_layout_write_call_ops_v4,
1877-
sync, RPC_TASK_SOFTCONN);
1877+
sync, RPC_TASK_SOFTCONN, NULL);
18781878
put_cred(ds_cred);
18791879
return PNFS_ATTEMPTED;
18801880

@@ -1949,7 +1949,7 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how)
19491949
ret = nfs_initiate_commit(ds_clnt, data, ds->ds_clp->rpc_ops,
19501950
vers == 3 ? &ff_layout_commit_call_ops_v3 :
19511951
&ff_layout_commit_call_ops_v4,
1952-
how, RPC_TASK_SOFTCONN);
1952+
how, RPC_TASK_SOFTCONN, NULL);
19531953
put_cred(ds_cred);
19541954
return ret;
19551955
out_err:

fs/nfs/internal.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/crc32.h>
1010
#include <linux/sunrpc/addr.h>
1111
#include <linux/nfs_page.h>
12+
#include <linux/nfslocalio.h>
1213
#include <linux/wait_bit.h>
1314

1415
#define NFS_SB_MASK (SB_RDONLY|SB_NOSUID|SB_NODEV|SB_NOEXEC|SB_SYNCHRONOUS)
@@ -308,7 +309,8 @@ void nfs_pgio_header_free(struct nfs_pgio_header *);
308309
int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *);
309310
int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr,
310311
const struct cred *cred, const struct nfs_rpc_ops *rpc_ops,
311-
const struct rpc_call_ops *call_ops, int how, int flags);
312+
const struct rpc_call_ops *call_ops, int how, int flags,
313+
struct nfsd_file *localio);
312314
void nfs_free_request(struct nfs_page *req);
313315
struct nfs_pgio_mirror *
314316
nfs_pgio_current_mirror(struct nfs_pageio_descriptor *desc);
@@ -527,7 +529,8 @@ extern int nfs_initiate_commit(struct rpc_clnt *clnt,
527529
struct nfs_commit_data *data,
528530
const struct nfs_rpc_ops *nfs_ops,
529531
const struct rpc_call_ops *call_ops,
530-
int how, int flags);
532+
int how, int flags,
533+
struct nfsd_file *localio);
531534
extern void nfs_init_commit(struct nfs_commit_data *data,
532535
struct list_head *head,
533536
struct pnfs_layout_segment *lseg,

fs/nfs/pagelist.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ static void nfs_pgio_prepare(struct rpc_task *task, void *calldata)
731731

732732
int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr,
733733
const struct cred *cred, const struct nfs_rpc_ops *rpc_ops,
734-
const struct rpc_call_ops *call_ops, int how, int flags)
734+
const struct rpc_call_ops *call_ops, int how, int flags,
735+
struct nfsd_file *localio)
735736
{
736737
struct rpc_task *task;
737738
struct rpc_message msg = {
@@ -961,7 +962,8 @@ static int nfs_generic_pg_pgios(struct nfs_pageio_descriptor *desc)
961962
NFS_PROTO(hdr->inode),
962963
desc->pg_rpc_callops,
963964
desc->pg_ioflags,
964-
RPC_TASK_CRED_NOREF | task_flags);
965+
RPC_TASK_CRED_NOREF | task_flags,
966+
NULL);
965967
}
966968
return ret;
967969
}

fs/nfs/pnfs_nfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ pnfs_generic_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
490490
nfs_initiate_commit(NFS_CLIENT(inode), data,
491491
NFS_PROTO(data->inode),
492492
data->mds_ops, how,
493-
RPC_TASK_CRED_NOREF);
493+
RPC_TASK_CRED_NOREF, NULL);
494494
} else {
495495
nfs_init_commit(data, NULL, data->lseg, cinfo);
496496
initiate_commit(data, how);

fs/nfs/write.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,8 @@ EXPORT_SYMBOL_GPL(nfs_commitdata_release);
16641664
int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data,
16651665
const struct nfs_rpc_ops *nfs_ops,
16661666
const struct rpc_call_ops *call_ops,
1667-
int how, int flags)
1667+
int how, int flags,
1668+
struct nfsd_file *localio)
16681669
{
16691670
struct rpc_task *task;
16701671
int priority = flush_task_priority(how);
@@ -1810,7 +1811,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how,
18101811
task_flags = RPC_TASK_MOVEABLE;
18111812
return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode),
18121813
data->mds_ops, how,
1813-
RPC_TASK_CRED_NOREF | task_flags);
1814+
RPC_TASK_CRED_NOREF | task_flags, NULL);
18141815
}
18151816

18161817
/*

include/linux/nfslocalio.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#ifndef __LINUX_NFSLOCALIO_H
77
#define __LINUX_NFSLOCALIO_H
88

9+
/* nfsd_file structure is purposely kept opaque to NFS client */
10+
struct nfsd_file;
11+
912
#if IS_ENABLED(CONFIG_NFS_LOCALIO)
1013

1114
#include <linux/module.h>
@@ -36,8 +39,6 @@ void nfs_uuid_is_local(const uuid_t *, struct list_head *,
3639
void nfs_uuid_invalidate_clients(struct list_head *list);
3740
void nfs_uuid_invalidate_one_client(nfs_uuid_t *nfs_uuid);
3841

39-
struct nfsd_file;
40-
4142
/* localio needs to map filehandle -> struct nfsd_file */
4243
extern struct nfsd_file *
4344
nfsd_open_local_fh(struct net *, struct auth_domain *, struct rpc_clnt *,

0 commit comments

Comments
 (0)