From: Mike Waychison <Michael.Waychison@Sun.COM>
To: NeilBrown <neilb@cse.unsw.edu.au>
Cc: Andrew Morton <akpm@osdl.org>, nfs@lists.sourceforge.net
Subject: Re: [PATCH kNFSd 4 of 23] Preparation for delegation: client callback probe
Date: Fri, 17 Dec 2004 01:45:01 -0500 [thread overview]
Message-ID: <41C2806D.5050408@sun.com> (raw)
In-Reply-To: <E1CfAap-0002dc-GG@notabene.cse.unsw.edu.au>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NeilBrown wrote:
> client callback rpc to probe the callback
> channel on setclientid with a null request.
>
...
> +/*
> + * Set up the callback client and put a NFSPROC4_CB_NULL on the wire...
> + */
> +void
> +nfsd4_probe_callback(struct nfs4_client *clp)
> +{
> + struct sockaddr_in addr;
> + struct nfs4_callback *cb = &clp->cl_callback;
> + struct rpc_timeout timeparms;
> + struct rpc_xprt * xprt;
> + struct rpc_program * program = &cb->cb_program;
> + struct rpc_stat * stat = &cb->cb_stat;
> + struct rpc_clnt * clnt;
> + struct rpc_message msg = {
> + .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL],
> + .rpc_argp = clp,
> + };
> + char hostname[32];
> + int status;
> +
> + dprintk("NFSD: probe_callback. cb_parsed %d cb_set %d\n",
> + cb->cb_parsed, atomic_read(&cb->cb_set));
> + if (!cb->cb_parsed || atomic_read(&cb->cb_set))
> + return;
> +
> + /* Initialize address */
> + memset(&addr, 0, sizeof(addr));
> + addr.sin_family = AF_INET;
> + addr.sin_port = htons(cb->cb_port);
> + addr.sin_addr.s_addr = htonl(cb->cb_addr);
> +
> + /* Initialize timeout */
> + timeparms.to_initval = (NFSD_LEASE_TIME/4) * HZ;
> + timeparms.to_retries = 5;
> + timeparms.to_maxval = (NFSD_LEASE_TIME/2) * HZ;
> + timeparms.to_exponential = 1;
> +
> + /* Create RPC transport */
> + if (!(xprt = xprt_create_proto(IPPROTO_TCP, &addr, &timeparms))) {
> + dprintk("NFSD: couldn't create callback transport!\n");
> + goto out_err;
> + }
> +
> + /* Initialize rpc_program */
> + program->name = "nfs4_cb";
> + program->number = cb->cb_prog;
> + program->nrvers = sizeof(nfs_cb_version)/sizeof(nfs_cb_version[0]);
> + program->version = nfs_cb_version;
> + program->stats = stat;
> +
> + /* Initialize rpc_stat */
> + memset(stat, 0, sizeof(struct rpc_stat));
> + stat->program = program;
> +
> + /* Create RPC client
> + *
> + * XXX AUTH_UNIX only - need AUTH_GSS....
> + */
> + sprintf(hostname, "%u.%u.%u.%u", NIPQUAD(addr.sin_addr.s_addr));
> + if (!(clnt = rpc_create_client(xprt, hostname, program, 1, RPC_AUTH_UNIX))) {
> + dprintk("NFSD: couldn't create callback client\n");
> + goto out_xprt;
> + }
Out of curiosity, does this have to be a reserved port?
- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me,
and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBwoBsdQs4kOxk3/MRAgHCAJ4xgWFHL+6IlrslbifbQoCR1RDlQQCeLw8p
VsUf2XAdv0ihP2qfBOTlp40=
=1WbB
-----END PGP SIGNATURE-----
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2004-12-17 6:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-17 5:23 [PATCH kNFSd 0 of 23] Introduction NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 5 of 23] Probe the callback path upon a successful setclientid_confirm NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 7 of 23] Get rid of the special delegation_stateid_t, use the existing stateid_t NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 4 of 23] Preparation for delegation: client callback probe NeilBrown
2004-12-17 6:45 ` Mike Waychison [this message]
2004-12-17 19:01 ` William A.(Andy) Adamson
2004-12-21 15:56 ` Mike Waychison
2004-12-17 5:23 ` [PATCH kNFSd 2 of 23] Check the callback netid in gen_callback NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 1 of 23] Move nfserr_openmode checking from nfsd_read/write into nfs4_preprocess_stateid_op() in preperation for delegation state NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 6 of 23] Check for existence of file_lock parameter inside of the kernel lock NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 3 of 23] Count the nfs4_client structure usage NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 18 of 23] Remove unnecessary stateowner existence check NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 17 of 23] Attempt to hand out a delegation NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 8 of 23] Add structures for delegation support NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 15 of 23] Kernel thread for delegation callback NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 14 of 23] Delegation recall callback rpc NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 10 of 23] Find a delegation for a file given a stateid NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 9 of 23] Allocate and initialize the delegation structure NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 13 of 23] Delay nfsd_colse for delegations until reaping NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 11 of 23] Add the delegation release and free functions NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 16 of 23] Helper functions for deciding to grant a delegation NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 12 of 23] Changes to expire_client NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 19 of 23] Check for openmode violations given a delegation stateid NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 22 of 23] Add to the laundromat service for delegations NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 20 of 23] Add checking of delegation stateids to nfs4_preprocess_stateid_op NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 21 of 23] Add the DELEGRETURN operation NeilBrown
2004-12-17 5:23 ` [PATCH kNFSd 23 of 23] Clear the recall_lru of delegations at shutdown NeilBrown
-- strict thread matches above, loose matches on Subject: below --
2004-12-21 16:12 [PATCH kNFSd 4 of 23] Preparation for delegation: client callback probe Lever, Charles
2004-12-21 16:48 ` Mike Waychison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41C2806D.5050408@sun.com \
--to=michael.waychison@sun.com \
--cc=akpm@osdl.org \
--cc=neilb@cse.unsw.edu.au \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox