[pnfs] [PATCH 16/17] [SQUASHME] nfs41: obliterate nfs41_call_validate_seq_args
Ricardo Labiaga
ricardo.labiaga at netapp.com
Tue Jun 3 20:04:40 EDT 2008
Good, thanks!
- ricardo
On Tue, 2008-06-03 at 20:41 +0300, Benny Halevy wrote:
> there's no need to through so many levels of indirection: callers
> calling nfs41_call_validate_seq_args indirectly calling
> server->nfs_client->rpc_ops->validate_sequence_args that's always
> set up to nfs41_validate_seq_args (for nfs41 and pnfs).
> nfs41_validate_seq_args just turns around and calls nfs41_setup_sequence.
>
> Instead, the public nfs4_setup_sequence function should be called by
> whoever called nfs41_call_validate_seq_args in the nfs module.
>
> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
> ---
> fs/nfs/nfs4_fs.h | 3 ---
> fs/nfs/nfs4proc.c | 29 -----------------------------
> fs/nfs/read.c | 8 +++-----
> fs/nfs/unlink.c | 7 +++----
> fs/nfs/write.c | 8 +++-----
> include/linux/nfs_xdr.h | 7 -------
> 6 files changed, 9 insertions(+), 53 deletions(-)
>
> diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
> index 7c36eb1..e54fe5d 100644
> --- a/fs/nfs/nfs4_fs.h
> +++ b/fs/nfs/nfs4_fs.h
> @@ -205,9 +205,6 @@ extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
> extern struct nfs4_state_recovery_ops *nfs4_reboot_recovery_ops[];
> extern struct nfs4_state_recovery_ops *nfs4_network_partition_recovery_ops[];
> #if defined(CONFIG_NFS_V4_1)
> -extern int nfs41_call_validate_seq_args(struct nfs_server *server,
> - struct nfs4_session *session, void *args, void *res, int cache_this,
> - struct rpc_task *task);
> extern int nfs4_setup_sequence(struct nfs_client *clp,
> struct nfs4_session *session, struct nfs41_sequence_args *args,
> struct nfs41_sequence_res *res, int cache_reply, struct rpc_task *task);
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 76ef329..d4cf831 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -424,17 +424,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
> return 0;
> }
>
> -static int nfs41_validate_seq_args(struct nfs4_session *session,
> - void *args,
> - void *res,
> - int cache_this,
> - struct rpc_task *task)
> -{
> - return nfs41_setup_sequence(session,
> - args, res,
> - cache_this, task);
> -}
> -
> int nfs4_setup_sequence(struct nfs_client *clp,
> struct nfs4_session *session,
> struct nfs41_sequence_args *args,
> @@ -470,23 +459,6 @@ int nfs4_setup_sequence(struct nfs_client *clp,
> return ret;
> }
>
> -int nfs41_call_validate_seq_args(struct nfs_server *server,
> - struct nfs4_session *session,
> - void *args,
> - void *res,
> - int cache_this,
> - struct rpc_task *task)
> -{
> - int (*setup_sequence)(struct nfs4_session *,
> - void *, void *, int, struct rpc_task *);
> -
> - setup_sequence = server->nfs_client->rpc_ops->validate_sequence_args;
> - if (!setup_sequence)
> - return 0;
> -
> - return setup_sequence(session, args, res, cache_this, task);
> -}
> -
> struct nfs41_call_sync_data {
> struct nfs_server *server;
> struct rpc_message *msg;
> @@ -5085,7 +5057,6 @@ const struct nfs_rpc_ops nfs_v41_clientops = {
> .file_release = nfs_release,
> .lock = nfs4_proc_lock,
> .clear_acl_cache = nfs4_zap_acl_attr,
> - .validate_sequence_args = nfs41_validate_seq_args,
> .increment_open_seqid = nfs41_increment_open_seqid,
> .increment_lock_seqid = nfs41_increment_lock_seqid,
> .nfs4_clientid = nfs41_clientid,
> diff --git a/fs/nfs/read.c b/fs/nfs/read.c
> index 7dfc145..8d5a1ed 100644
> --- a/fs/nfs/read.c
> +++ b/fs/nfs/read.c
> @@ -399,12 +399,10 @@ int nfs_read_validate(struct rpc_task *task, void *calldata)
> {
> struct nfs_read_data *data = calldata;
> struct nfs_server *server = data->args.server;
> - struct nfs4_session *session = server->session;
>
> - return nfs41_call_validate_seq_args(server, session,
> - &data->args.seq_args,
> - &data->res.seq_res,
> - 0, task);
> + return nfs4_setup_sequence(server->nfs_client, server->session,
> + &data->args.seq_args, &data->res.seq_res,
> + 0, task);
> }
> #endif /* CONFIG_NFS_V4_1 */
>
> diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
> index df54cb0..8f9134c 100644
> --- a/fs/nfs/unlink.c
> +++ b/fs/nfs/unlink.c
> @@ -108,10 +108,9 @@ int nfs_unlink_validate(struct rpc_task *task, void *calldata)
> struct nfs_unlinkdata *data = calldata;
> struct nfs_server *server = NFS_SERVER(data->dir);
>
> - return nfs41_call_validate_seq_args(server, server->session,
> - &data->args.seq_args,
> - &data->res.seq_res,
> - 1, task);
> + return nfs4_setup_sequence(server->nfs_client, server->session,
> + &data->args.seq_args, &data->res.seq_res,
> + 1, task);
> }
> #endif /* CONFIG_NFS_V4_1 */
> static const struct rpc_call_ops nfs_unlink_ops = {
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 739870f..d5de529 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1019,12 +1019,10 @@ int nfs_write_validate(struct rpc_task *task, void *calldata)
> {
> struct nfs_write_data *data = calldata;
> struct nfs_server *server = NFS_SERVER(data->inode);
> - struct nfs4_session *session = server->session;
>
> - return nfs41_call_validate_seq_args(server, session,
> - &data->args.seq_args,
> - &data->res.seq_res,
> - 1, task);
> + return nfs4_setup_sequence(server->nfs_client, server->session,
> + &data->args.seq_args, &data->res.seq_res,
> + 1, task);
> }
> #endif /* CONFIG_NFS_V4_1 */
>
> diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
> index 0c461aa..4c6c4fc 100644
> --- a/include/linux/nfs_xdr.h
> +++ b/include/linux/nfs_xdr.h
> @@ -1118,13 +1118,6 @@ struct nfs_rpc_ops {
> int (*file_release) (struct inode *, struct file *);
> int (*lock)(struct file *, int, struct file_lock *);
> void (*clear_acl_cache)(struct inode *);
> -#if defined(CONFIG_NFS_V4_1)
> - int (*validate_sequence_args)(struct nfs4_session *,
> - void *args,
> - void *res,
> - int,
> - struct rpc_task *);
> -#endif /* CONFIG_NFS_V4_1 */
> void (*increment_open_seqid)(int status, struct nfs_seqid *seqid);
> void (*increment_lock_seqid)(int status, struct nfs_seqid *seqid);
> u64 (*nfs4_clientid)(struct nfs_client *);
More information about the pNFS
mailing list