linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: cleanup free_stid
@ 2013-10-14  6:04 Benny Halevy
  2013-10-14 10:44 ` [PATCH v2] nfsd: nfs4_free_stid Benny Halevy
  0 siblings, 1 reply; 3+ messages in thread
From: Benny Halevy @ 2013-10-14  6:04 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Benny Halevy

Make it symmetric to alloc_stid

Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
---
 fs/nfsd/nfs4state.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 06984e3..c6625f2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -402,11 +402,16 @@ static void remove_stid(struct nfs4_stid *s)
 	idr_remove(stateids, s->sc_stateid.si_opaque.so_id);
 }
 
+static void free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
+{
+	kmem_cache_free(slab, s);
+}
+
 void
 nfs4_put_delegation(struct nfs4_delegation *dp)
 {
 	if (atomic_dec_and_test(&dp->dl_count)) {
-		kmem_cache_free(deleg_slab, dp);
+		free_stid(deleg_slab, &dp->dl_stid);
 		num_delegations--;
 	}
 }
@@ -610,7 +615,7 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp)
 static void free_generic_stateid(struct nfs4_ol_stateid *stp)
 {
 	remove_stid(&stp->st_stid);
-	kmem_cache_free(stateid_slab, stp);
+	free_stid(stateid_slab, &stp->st_stid);
 }
 
 static void release_lock_stateid(struct nfs4_ol_stateid *stp)
-- 
1.8.3.1


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

* [PATCH v2] nfsd: nfs4_free_stid
  2013-10-14  6:04 [PATCH] nfsd: cleanup free_stid Benny Halevy
@ 2013-10-14 10:44 ` Benny Halevy
  2013-10-28 19:43   ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Benny Halevy @ 2013-10-14 10:44 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Benny Halevy

Make it symmetric to nfs4_alloc_stid.

Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
---
 fs/nfsd/nfs4state.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 06984e3..64c167f 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -402,11 +402,16 @@ static void remove_stid(struct nfs4_stid *s)
 	idr_remove(stateids, s->sc_stateid.si_opaque.so_id);
 }
 
+static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
+{
+	kmem_cache_free(slab, s);
+}
+
 void
 nfs4_put_delegation(struct nfs4_delegation *dp)
 {
 	if (atomic_dec_and_test(&dp->dl_count)) {
-		kmem_cache_free(deleg_slab, dp);
+		nfs4_free_stid(deleg_slab, &dp->dl_stid);
 		num_delegations--;
 	}
 }
@@ -610,7 +615,7 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp)
 static void free_generic_stateid(struct nfs4_ol_stateid *stp)
 {
 	remove_stid(&stp->st_stid);
-	kmem_cache_free(stateid_slab, stp);
+	nfs4_free_stid(stateid_slab, &stp->st_stid);
 }
 
 static void release_lock_stateid(struct nfs4_ol_stateid *stp)
-- 
1.8.3.1


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

* Re: [PATCH v2] nfsd: nfs4_free_stid
  2013-10-14 10:44 ` [PATCH v2] nfsd: nfs4_free_stid Benny Halevy
@ 2013-10-28 19:43   ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2013-10-28 19:43 UTC (permalink / raw)
  To: Benny Halevy; +Cc: bfields, linux-nfs

On Mon, Oct 14, 2013 at 01:44:52PM +0300, Benny Halevy wrote:
> Make it symmetric to nfs4_alloc_stid.

OK, applying.--b.

> 
> Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
> ---
>  fs/nfsd/nfs4state.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 06984e3..64c167f 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -402,11 +402,16 @@ static void remove_stid(struct nfs4_stid *s)
>  	idr_remove(stateids, s->sc_stateid.si_opaque.so_id);
>  }
>  
> +static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
> +{
> +	kmem_cache_free(slab, s);
> +}
> +
>  void
>  nfs4_put_delegation(struct nfs4_delegation *dp)
>  {
>  	if (atomic_dec_and_test(&dp->dl_count)) {
> -		kmem_cache_free(deleg_slab, dp);
> +		nfs4_free_stid(deleg_slab, &dp->dl_stid);
>  		num_delegations--;
>  	}
>  }
> @@ -610,7 +615,7 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp)
>  static void free_generic_stateid(struct nfs4_ol_stateid *stp)
>  {
>  	remove_stid(&stp->st_stid);
> -	kmem_cache_free(stateid_slab, stp);
> +	nfs4_free_stid(stateid_slab, &stp->st_stid);
>  }
>  
>  static void release_lock_stateid(struct nfs4_ol_stateid *stp)
> -- 
> 1.8.3.1
> 

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

end of thread, other threads:[~2013-10-28 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-14  6:04 [PATCH] nfsd: cleanup free_stid Benny Halevy
2013-10-14 10:44 ` [PATCH v2] nfsd: nfs4_free_stid Benny Halevy
2013-10-28 19:43   ` J. Bruce Fields

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).