Re: [PATCH 11/11] nfs-acl

From: Trond Myklebust
Date: Tue Apr 27 2004 - 12:56:53 EST


On Tue, 2004-04-27 at 13:33, Andreas Gruenbacher wrote:

> We can share the same socket, but the code gets slightly messier. How
> about sharing the whole struct rpc_xprt (incremental patch)?

How about doing it as I suggested, using rpc_clone_client() instead?

You'll need to add

void rpc_change_program(struct rpc_client *clnt, struct rpc_program *program, int vers)
{
struct rpc_version *version;

BUG_ON(vers >= program->nrvers || !(version = program->version[vers]));
version = &program->version[vers];
clnt->cl_procinfo = version->procs;
clnt->cl_maxproc = version->nrprocs;
clnt->cl_protname = program->name;
clnt->cl_prog = program->number;
clnt->cl_vers = version->number;
clnt->cl_stats = program->stats
}

...but that will allow you to do the whole process of creating the ACL
RPC client in 2 lines:

struct rpc_client *aclclnt = rpc_clone_client(server->client);
rpc_change_program(aclclnt, &nfsacl_program, 1);


...and hey presto, you have something that shares both the
authentication cache and the socket with the NFS client.

Cheers,
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/