All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSd: use network-namespace-aware cache registering routines
@ 2011-12-06 14:04 Stanislav Kinsbursky
  2011-12-06 21:02 ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Kinsbursky @ 2011-12-06 14:04 UTC (permalink / raw)
  To: bfields; +Cc: neilb, linux-nfs, linux-kernel

This is a cleanup patch. Some day (hope, soon enough) 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 ++++++-----
 2 files changed, 11 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] NFSd: use network-namespace-aware cache registering routines
  2011-12-06 14:04 [PATCH] NFSd: use network-namespace-aware cache registering routines Stanislav Kinsbursky
@ 2011-12-06 21:02 ` J. Bruce Fields
  2011-12-06 21:14   ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2011-12-06 21:02 UTC (permalink / raw)
  To: Stanislav Kinsbursky; +Cc: neilb, linux-nfs, linux-kernel

On Tue, Dec 06, 2011 at 05:04:31PM +0300, Stanislav Kinsbursky wrote:
> This is a cleanup patch. Some day (hope, soon enough) generic cache_register()
> and cache_unregister() will be removed.

OK, applying for 3.3.--b.

> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> 
> ---
>  fs/nfsd/export.c    |   10 +++++-----
>  fs/nfsd/nfs4idmap.c |   11 ++++++-----
>  2 files changed, 11 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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NFSd: use network-namespace-aware cache registering routines
  2011-12-06 21:02 ` J. Bruce Fields
@ 2011-12-06 21:14   ` J. Bruce Fields
  2011-12-07  8:47     ` Stanislav Kinsbursky
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2011-12-06 21:14 UTC (permalink / raw)
  To: Stanislav Kinsbursky; +Cc: neilb, linux-nfs, linux-kernel

On Tue, Dec 06, 2011 at 04:02:34PM -0500, J. Bruce Fields wrote:
> On Tue, Dec 06, 2011 at 05:04:31PM +0300, Stanislav Kinsbursky wrote:
> > This is a cleanup patch. Some day (hope, soon enough) generic cache_register()
> > and cache_unregister() will be removed.
> 
> OK, applying for 3.3.--b.

Whoops, no I'm not, these make modular builds fail.  Looks like we need
a couple EXPORT_SYMBOL_GPL()'s.  Could you resend?

--b.

> 
> > 
> > Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> > 
> > ---
> >  fs/nfsd/export.c    |   10 +++++-----
> >  fs/nfsd/nfs4idmap.c |   11 ++++++-----
> >  2 files changed, 11 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
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NFSd: use network-namespace-aware cache registering routines
  2011-12-06 21:14   ` J. Bruce Fields
@ 2011-12-07  8:47     ` Stanislav Kinsbursky
  0 siblings, 0 replies; 4+ messages in thread
From: Stanislav Kinsbursky @ 2011-12-07  8:47 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: neilb, linux-nfs, linux-kernel

07.12.2011 01:14, J. Bruce Fields пишет:
> On Tue, Dec 06, 2011 at 04:02:34PM -0500, J. Bruce Fields wrote:
>> On Tue, Dec 06, 2011 at 05:04:31PM +0300, Stanislav Kinsbursky wrote:
>>> This is a cleanup patch. Some day (hope, soon enough) generic cache_register()
>>> and cache_unregister() will be removed.
>>
>> OK, applying for 3.3.--b.
>
> Whoops, no I'm not, these make modular builds fail.  Looks like we need
> a couple EXPORT_SYMBOL_GPL()'s.  Could you resend?
>

Sorry. My fault (I exported these symbols in other patch).
Will resend soon.

> --b.
>
>>
>>>
>>> Signed-off-by: Stanislav Kinsbursky<skinsbursky@parallels.com>
>>>
>>> ---
>>>   fs/nfsd/export.c    |   10 +++++-----
>>>   fs/nfsd/nfs4idmap.c |   11 ++++++-----
>>>   2 files changed, 11 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
>>>


-- 
Best regards,
Stanislav Kinsbursky

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-07  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06 14:04 [PATCH] NFSd: use network-namespace-aware cache registering routines Stanislav Kinsbursky
2011-12-06 21:02 ` J. Bruce Fields
2011-12-06 21:14   ` J. Bruce Fields
2011-12-07  8:47     ` Stanislav Kinsbursky

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.