From: "J. Bruce Fields" <bfields@fieldses.org>
To: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: neilb@suse.de, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] NFSd: use network-namespace-aware cache registering routines
Date: Wed, 7 Dec 2011 17:47:01 -0500 [thread overview]
Message-ID: <20111207224701.GA23621@fieldses.org> (raw)
In-Reply-To: <20111207085741.7867.57700.stgit@localhost6.localdomain6>
Thanks, applied.
On Wed, Dec 07, 2011 at 12:57:56PM +0300, Stanislav Kinsbursky wrote:
> v2: cache_register_net() and cache_unregister_net() GPL exports added
>
> This is a cleanup patch. Hope, some day generic cache_register() and
> cache_unregister() will be removed.
>
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
>
> ---
> fs/nfsd/export.c | 10 +++++-----
> fs/nfsd/nfs4idmap.c | 11 ++++++-----
> net/sunrpc/cache.c | 2 ++
> 3 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 62f3b90..d1feeef 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -1226,12 +1226,12 @@ nfsd_export_init(void)
> int rv;
> dprintk("nfsd: initializing export module.\n");
>
> - rv = cache_register(&svc_export_cache);
> + rv = cache_register_net(&svc_export_cache, &init_net);
> if (rv)
> return rv;
> - rv = cache_register(&svc_expkey_cache);
> + rv = cache_register_net(&svc_expkey_cache, &init_net);
> if (rv)
> - cache_unregister(&svc_export_cache);
> + cache_unregister_net(&svc_export_cache, &init_net);
> return rv;
>
> }
> @@ -1255,8 +1255,8 @@ nfsd_export_shutdown(void)
>
> dprintk("nfsd: shutting down export module.\n");
>
> - cache_unregister(&svc_expkey_cache);
> - cache_unregister(&svc_export_cache);
> + cache_unregister_net(&svc_expkey_cache, &init_net);
> + cache_unregister_net(&svc_export_cache, &init_net);
> svcauth_unix_purge();
>
> dprintk("nfsd: export shutdown complete.\n");
> diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
> index 55780a2..9409627 100644
> --- a/fs/nfsd/nfs4idmap.c
> +++ b/fs/nfsd/nfs4idmap.c
> @@ -36,6 +36,7 @@
> #include <linux/seq_file.h>
> #include <linux/sched.h>
> #include <linux/slab.h>
> +#include <net/net_namespace.h>
> #include "idmap.h"
> #include "nfsd.h"
>
> @@ -466,20 +467,20 @@ nfsd_idmap_init(void)
> {
> int rv;
>
> - rv = cache_register(&idtoname_cache);
> + rv = cache_register_net(&idtoname_cache, &init_net);
> if (rv)
> return rv;
> - rv = cache_register(&nametoid_cache);
> + rv = cache_register_net(&nametoid_cache, &init_net);
> if (rv)
> - cache_unregister(&idtoname_cache);
> + cache_unregister_net(&idtoname_cache, &init_net);
> return rv;
> }
>
> void
> nfsd_idmap_shutdown(void)
> {
> - cache_unregister(&idtoname_cache);
> - cache_unregister(&nametoid_cache);
> + cache_unregister_net(&idtoname_cache, &init_net);
> + cache_unregister_net(&nametoid_cache, &init_net);
> }
>
> static int
> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> index 72ad836..b8daa57 100644
> --- a/net/sunrpc/cache.c
> +++ b/net/sunrpc/cache.c
> @@ -1641,6 +1641,7 @@ int cache_register_net(struct cache_detail *cd, struct net *net)
> sunrpc_destroy_cache_detail(cd);
> return ret;
> }
> +EXPORT_SYMBOL_GPL(cache_register_net);
>
> int cache_register(struct cache_detail *cd)
> {
> @@ -1653,6 +1654,7 @@ void cache_unregister_net(struct cache_detail *cd, struct net *net)
> remove_cache_proc_entries(cd, net);
> sunrpc_destroy_cache_detail(cd);
> }
> +EXPORT_SYMBOL_GPL(cache_unregister_net);
>
> void cache_unregister(struct cache_detail *cd)
> {
>
prev parent reply other threads:[~2011-12-07 22:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-07 9:57 [PATCH v2] NFSd: use network-namespace-aware cache registering routines Stanislav Kinsbursky
2011-12-07 22:47 ` J. Bruce Fields [this message]
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=20111207224701.GA23621@fieldses.org \
--to=bfields@fieldses.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=skinsbursky@parallels.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.