Commit 50493364 authored by Anna Schumaker's avatar Anna Schumaker
Browse files

NFS: Have _nfs4_proc_secinfo() call nfs4_call_sync_custom()



We do this to set the RPC_TASK_NO_ROUND_ROBIN flag in the task_setup
structure

Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent dae40965
Loading
Loading
Loading
Loading
+21 −8
Original line number Original line Diff line number Diff line
@@ -7644,6 +7644,8 @@ int nfs4_proc_fsid_present(struct inode *inode, const struct cred *cred)
static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors, bool use_integrity)
static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors, bool use_integrity)
{
{
	int status;
	int status;
	struct rpc_clnt *clnt = NFS_SERVER(dir)->client;
	struct nfs_client *clp = NFS_SERVER(dir)->nfs_client;
	struct nfs4_secinfo_arg args = {
	struct nfs4_secinfo_arg args = {
		.dir_fh = NFS_FH(dir),
		.dir_fh = NFS_FH(dir),
		.name   = name,
		.name   = name,
@@ -7656,26 +7658,37 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct
		.rpc_argp = &args,
		.rpc_argp = &args,
		.rpc_resp = &res,
		.rpc_resp = &res,
	};
	};
	struct rpc_clnt *clnt = NFS_SERVER(dir)->client;
	struct nfs4_call_sync_data data = {
		.seq_server = NFS_SERVER(dir),
		.seq_args = &args.seq_args,
		.seq_res = &res.seq_res,
	};
	struct rpc_task_setup task_setup = {
		.rpc_client = clnt,
		.rpc_message = &msg,
		.callback_ops = clp->cl_mvops->call_sync_ops,
		.callback_data = &data,
		.flags = RPC_TASK_NO_ROUND_ROBIN,
	};
	const struct cred *cred = NULL;
	const struct cred *cred = NULL;


	if (use_integrity) {
	if (use_integrity) {
		clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient;
		clnt = clp->cl_rpcclient;
		cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client);
		task_setup.rpc_client = clnt;

		cred = nfs4_get_clid_cred(clp);
		msg.rpc_cred = cred;
		msg.rpc_cred = cred;
	}
	}


	dprintk("NFS call  secinfo %s\n", name->name);
	dprintk("NFS call  secinfo %s\n", name->name);


	nfs4_state_protect(NFS_SERVER(dir)->nfs_client,
	nfs4_state_protect(clp, NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg);
		NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg);
	nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
	status = nfs4_call_sync_custom(&task_setup);


	status = nfs4_call_sync(clnt, NFS_SERVER(dir), &msg, &args.seq_args,
				&res.seq_res, RPC_TASK_NO_ROUND_ROBIN);
	dprintk("NFS reply  secinfo: %d\n", status);
	dprintk("NFS reply  secinfo: %d\n", status);


	put_cred(cred);
	put_cred(cred);

	return status;
	return status;
}
}