linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim
@ 2010-07-21 14:43 andros
  2010-07-21 14:43 ` [PATCH 2/2] SQUASHME pnfs-submit destroy all layouts upon lease expiration andros
  2010-07-21 17:40 ` [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim Benny Halevy
  0 siblings, 2 replies; 3+ messages in thread
From: andros @ 2010-07-21 14:43 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

Not used. Destroy all layouts on lease expiration instead.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/nfs4proc.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index fd6438d..05f072c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1094,17 +1094,6 @@ static struct nfs_open_context *nfs4_state_find_open_context(struct nfs4_state *
 	return ERR_PTR(-ENOENT);
 }
 
-static void pnfs4_layout_reclaim(struct nfs4_state *state)
-{
-#if defined(CONFIG_NFS_V4_1)
-	/* FIXME: send gratuitous layout commits and return with the reclaim
-	 * flag during grace period
-	 */
-	pnfs_destroy_layout(NFS_I(state->inode));
-	pnfs_set_layout_stateid(NFS_I(state->inode)->layout, &zero_stateid);
-#endif /* CONFIG_NFS_V4_1 */
-}
-
 static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context *ctx, struct nfs4_state *state)
 {
 	struct nfs4_opendata *opendata;
@@ -1181,7 +1170,6 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *
 			       sizeof(state->stateid.u.data));
 		write_sequnlock(&state->seqlock);
 	}
-	pnfs4_layout_reclaim(state);
 	return 0;
 }
 
@@ -1236,7 +1224,6 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta
 		return PTR_ERR(ctx);
 	ret = nfs4_do_open_reclaim(ctx, state);
 	put_nfs_open_context(ctx);
-	pnfs4_layout_reclaim(state);
 	return ret;
 }
 
-- 
1.6.6


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

* [PATCH 2/2] SQUASHME pnfs-submit destroy all layouts upon lease expiration
  2010-07-21 14:43 [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim andros
@ 2010-07-21 14:43 ` andros
  2010-07-21 17:40 ` [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim Benny Halevy
  1 sibling, 0 replies; 3+ messages in thread
From: andros @ 2010-07-21 14:43 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/nfs4state.c |    1 +
 fs/nfs/pnfs.c      |   18 ++++++++++++++++++
 fs/nfs/pnfs.h      |    5 +++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 2696909..18284bd 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1471,6 +1471,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
 			}
 			clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state);
 			set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
+			pnfs_destroy_all_layouts(clp);
 		}
 
 		if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 0f255f5..a0415d5 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -399,6 +399,24 @@ pnfs_destroy_layout(struct nfs_inode *nfsi)
 	spin_unlock(&nfsi->vfs_inode.i_lock);
 }
 
+/*
+ * Called by the state manger to remove all layouts established under an
+ * expired lease.
+ */
+void
+pnfs_destroy_all_layouts(struct nfs_client *clp)
+{
+	struct pnfs_layout_type *lo;
+
+	while (!list_empty(&clp->cl_layouts)) {
+		lo = list_entry(clp->cl_layouts.next, struct pnfs_layout_type,
+				lo_layouts);
+		dprintk("%s freeing layout for inode %lu\n", __func__,
+			lo->lo_inode->i_ino);
+		pnfs_destroy_layout(NFS_I(lo->lo_inode));
+	}
+}
+
 static inline void
 init_lseg(struct pnfs_layout_type *lo, struct pnfs_layout_segment *lseg)
 {
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 1d16049..30c91d0 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -64,6 +64,7 @@ void pnfs_layout_release(struct pnfs_layout_type *, struct nfs4_pnfs_layout_segm
 void pnfs_set_layout_stateid(struct pnfs_layout_type *lo,
 			     const nfs4_stateid *stateid);
 void pnfs_destroy_layout(struct nfs_inode *);
+void pnfs_destroy_all_layouts(struct nfs_client *);
 void put_layout(struct inode *inode);
 void pnfs_get_layout_stateid(nfs4_stateid *dst, struct pnfs_layout_type *lo);
 
@@ -134,6 +135,10 @@ static inline void pnfs_update_layout(struct inode *ino,
 
 #else  /* CONFIG_NFS_V4_1 */
 
+static inline void pnfs_destroy_all_layouts(struct nfs_client *clp)
+{
+}
+
 static inline void pnfs_destroy_layout(struct nfs_inode *nfsi)
 {
 }
-- 
1.6.6


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

* Re: [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim
  2010-07-21 14:43 [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim andros
  2010-07-21 14:43 ` [PATCH 2/2] SQUASHME pnfs-submit destroy all layouts upon lease expiration andros
@ 2010-07-21 17:40 ` Benny Halevy
  1 sibling, 0 replies; 3+ messages in thread
From: Benny Halevy @ 2010-07-21 17:40 UTC (permalink / raw)
  To: andros; +Cc: linux-nfs

On Jul. 21, 2010, 17:43 +0300, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
> 
> Not used. Destroy all layouts on lease expiration instead.

What do you mean by not used?
You've just deleted two uses in this patch...

Benny

> 
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
>  fs/nfs/nfs4proc.c |   13 -------------
>  1 files changed, 0 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index fd6438d..05f072c 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -1094,17 +1094,6 @@ static struct nfs_open_context *nfs4_state_find_open_context(struct nfs4_state *
>  	return ERR_PTR(-ENOENT);
>  }
>  
> -static void pnfs4_layout_reclaim(struct nfs4_state *state)
> -{
> -#if defined(CONFIG_NFS_V4_1)
> -	/* FIXME: send gratuitous layout commits and return with the reclaim
> -	 * flag during grace period
> -	 */
> -	pnfs_destroy_layout(NFS_I(state->inode));
> -	pnfs_set_layout_stateid(NFS_I(state->inode)->layout, &zero_stateid);
> -#endif /* CONFIG_NFS_V4_1 */
> -}
> -
>  static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context *ctx, struct nfs4_state *state)
>  {
>  	struct nfs4_opendata *opendata;
> @@ -1181,7 +1170,6 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *
>  			       sizeof(state->stateid.u.data));
>  		write_sequnlock(&state->seqlock);
>  	}
> -	pnfs4_layout_reclaim(state);
>  	return 0;
>  }
>  
> @@ -1236,7 +1224,6 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta
>  		return PTR_ERR(ctx);
>  	ret = nfs4_do_open_reclaim(ctx, state);
>  	put_nfs_open_context(ctx);
> -	pnfs4_layout_reclaim(state);
>  	return ret;
>  }
>  

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

end of thread, other threads:[~2010-07-21 17:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-21 14:43 [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim andros
2010-07-21 14:43 ` [PATCH 2/2] SQUASHME pnfs-submit destroy all layouts upon lease expiration andros
2010-07-21 17:40 ` [PATCH 1/2] SQUASHME pnfs-submit remove pnfs4_layout_reclaim Benny Halevy

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