From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v5 1/5] nfsd: add nfsd4_client_tracking_ops struct and a way to set it
Date: Thu, 2 Feb 2012 17:45:41 -0500 [thread overview]
Message-ID: <20120202224541.GA28291@fieldses.org> (raw)
In-Reply-To: <1328111052-28389-2-git-send-email-jlayton@redhat.com>
Just nits:
On Wed, Feb 01, 2012 at 10:44:08AM -0500, Jeff Layton wrote:
> +static struct nfsd4_client_tracking_ops nfsd4_legacy_tracking_ops = {
> + .init = nfsd4_load_reboot_recovery_data,
> + .exit = nfsd4_shutdown_recdir,
> + .create = nfsd4_create_clid_dir,
> + .remove = nfsd4_remove_clid_dir,
> + .check = nfsd4_check_legacy_client,
> + .grace_done = nfsd4_recdir_purge_old,
> +};
> +
> +int
> +nfsd4_client_tracking_init(void)
> +{
> + int status;
> +
> + client_tracking_ops = &nfsd4_legacy_tracking_ops;
> +
> + if (!client_tracking_ops->init)
> + return 0;
Is that check necessary?
> +
> + status = client_tracking_ops->init();
> + if (status) {
> + printk(KERN_WARNING "NFSD: Unable to initialize client "
> + "recovery tracking! (%d)\n", status);
> + client_tracking_ops = NULL;
> + }
> + return status;
> +}
> +
> +void
> +nfsd4_client_tracking_exit(void)
> +{
> + if (client_tracking_ops && client_tracking_ops->exit)
In general I don't see the point of handling the case where one of the
ops is NULL. If there was some implementation that really wanted that
we could get the same effect by defining a default no-op implementation
they could use, but I don't think there actually is?
> +int
> +nfsd4_client_record_check(struct nfs4_client *clp)
> +{
> + if (client_tracking_ops && client_tracking_ops->check)
> + return client_tracking_ops->check(clp);
> +
> + return -EOPNOTSUPP;
> +}
> +
> +void
> +nfsd4_grace_done(time_t boot_time)
That name's a bit generic--but I don't have a better suggestion.
(nfsd4_record_grace_done()?)
Looks basically fine, though.
--b.
next prev parent reply other threads:[~2012-02-02 22:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 15:44 [PATCH v5 0/5] nfsd: overhaul the client name tracking code Jeff Layton
2012-02-01 15:44 ` [PATCH v5 1/5] nfsd: add nfsd4_client_tracking_ops struct and a way to set it Jeff Layton
2012-02-02 22:45 ` J. Bruce Fields [this message]
2012-02-03 19:22 ` Jeff Layton
2012-02-01 15:44 ` [PATCH v5 2/5] sunrpc: create nfsd dir in rpc_pipefs Jeff Layton
2012-02-01 15:44 ` [PATCH v5 3/5] nfsd: convert nfs4_client->cl_cb_flags to a generic flags field Jeff Layton
2012-02-03 19:35 ` J. Bruce Fields
2012-02-04 12:21 ` Jeff Layton
2012-02-08 21:00 ` Jeff Layton
2012-02-10 16:06 ` Jeff Layton
2012-02-01 15:44 ` [PATCH v5 4/5] nfsd: add a header describing upcall to nfsdcld Jeff Layton
2012-02-01 15:44 ` [PATCH v5 5/5] nfsd: add the infrastructure to handle the cld upcall Jeff Layton
2012-02-03 22:57 ` J. Bruce Fields
2012-02-04 11:49 ` Jeff Layton
2012-02-07 15:00 ` Jeff Layton
2012-02-07 15:19 ` J. Bruce Fields
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=20120202224541.GA28291@fieldses.org \
--to=bfields@fieldses.org \
--cc=jlayton@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).