linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] SQUASHME pnfs-submit: pnfs_try_to_commit can release nfs_write_data
@ 2010-07-14 19:43 andros
  2010-07-14 19:43 ` [PATCH 2/5] SQUASHME pnfs-submit remove gather_across_stripes policy andros
  0 siblings, 1 reply; 5+ messages in thread
From: andros @ 2010-07-14 19:43 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

So don't reference nfs_write_data.

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

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 3018ed6..56c3af4 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1373,7 +1373,7 @@ enum pnfs_try_status
 pnfs_try_to_commit(struct nfs_write_data *data,
 		    const struct rpc_call_ops *call_ops, int sync)
 {
-	struct nfs_inode *nfsi = NFS_I(data->inode);
+	struct inode *inode = data->inode;
 	struct nfs_server *nfss = NFS_SERVER(data->inode);
 	enum pnfs_try_status trypnfs;
 
@@ -1389,12 +1389,12 @@ pnfs_try_to_commit(struct nfs_write_data *data,
 	data->pdata.call_ops = call_ops;
 	data->pdata.how = sync;
 	data->pdata.lseg = NULL;
-	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->commit(nfsi->layout,
+	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->commit(NFS_I(inode)->layout,
 							sync, data);
 	if (trypnfs == PNFS_NOT_ATTEMPTED)
 		_pnfs_clear_lseg_from_pages(&data->pages);
 	else
-		nfs_inc_stats(data->inode, NFSIOS_PNFS_COMMIT);
+		nfs_inc_stats(inode, NFSIOS_PNFS_COMMIT);
 	dprintk("%s End (trypnfs:%d)\n", __func__, trypnfs);
 	return trypnfs;
 }
-- 
1.6.6


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

* [PATCH 2/5] SQUASHME pnfs-submit remove gather_across_stripes policy
  2010-07-14 19:43 [PATCH 1/5] SQUASHME pnfs-submit: pnfs_try_to_commit can release nfs_write_data andros
@ 2010-07-14 19:43 ` andros
  2010-07-14 19:43   ` [PATCH 3/5] SQUASHME pnfs-submit remove layoutret_on_setattr policy andros
  0 siblings, 1 reply; 5+ messages in thread
From: andros @ 2010-07-14 19:43 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

Unused by the file layout. Will restore.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/pnfs.c             |    4 ----
 include/linux/nfs4_pnfs.h |   10 ----------
 2 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 56c3af4..d3df8df 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1191,10 +1191,6 @@ pnfs_getboundary(struct inode *inode)
 	if (!policy_ops || !policy_ops->get_stripesize)
 		goto out;
 
-	/* The default is to not gather across stripes */
-	if (pnfs_ld_gather_across_stripes(nfss->pnfs_curr_ld))
-		goto out;
-
 	spin_lock(&inode->i_lock);
 	if (NFS_I(inode)->layout)
 		stripe_size = policy_ops->get_stripesize(NFS_I(inode)->layout);
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 9eebbdd..eb9dfe4 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -156,9 +156,6 @@ struct layoutdriver_io_operations {
 };
 
 enum layoutdriver_policy_flags {
-	/* Should the NFS req. gather algorithm cross stripe boundaries? */
-	PNFS_GATHER_ACROSS_STRIPES	= 1 << 1,
-
 	/* Should the pNFS client commit and return the layout upon a setattr */
 	PNFS_LAYOUTRET_ON_SETATTR	= 1 << 3,
 };
@@ -173,13 +170,6 @@ struct layoutdriver_policy_operations {
 	int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
 };
 
-/* Should the NFS req. gather algorithm cross stripe boundaries? */
-static inline int
-pnfs_ld_gather_across_stripes(struct pnfs_layoutdriver_type *ld)
-{
-	return ld->ld_policy_ops->flags & PNFS_GATHER_ACROSS_STRIPES;
-}
-
 struct pnfs_device {
 	struct pnfs_deviceid dev_id;
 	unsigned int  layout_type;
-- 
1.6.6


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

* [PATCH 3/5] SQUASHME pnfs-submit remove layoutret_on_setattr policy
  2010-07-14 19:43 ` [PATCH 2/5] SQUASHME pnfs-submit remove gather_across_stripes policy andros
@ 2010-07-14 19:43   ` andros
  2010-07-14 19:43     ` [PATCH 4/5] post-submit: restore and fix layoutret_on_setattr andros
  0 siblings, 1 reply; 5+ messages in thread
From: andros @ 2010-07-14 19:43 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

Not used by the file layout driver. Will be restored.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/nfs4proc.c         |    3 ---
 fs/nfs/pnfs.h             |    9 ---------
 include/linux/nfs4_pnfs.h |    7 -------
 3 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 288025e..756f6e9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2358,9 +2358,6 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
 	struct nfs4_state *state = NULL;
 	int status;
 
-	if (pnfs_ld_layoutret_on_setattr(inode))
-		pnfs_return_layout(inode, NULL, NULL, RETURN_FILE, true);
-
 	nfs_fattr_init(fattr);
 	
 	/* Search for an existing open(O_WRITE) file */
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 71086aa..6bc27af 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -92,15 +92,6 @@ static inline int pnfs_enabled_sb(struct nfs_server *nfss)
 	return nfss->pnfs_curr_ld != NULL;
 }
 
-/* Should the pNFS client commit and return the layout upon a setattr
- */
-static inline bool
-pnfs_ld_layoutret_on_setattr(struct inode *inode)
-{
-	return NFS_SERVER(inode)->pnfs_curr_ld->ld_policy_ops->flags &
-		PNFS_LAYOUTRET_ON_SETATTR;
-}
-
 /* Should the pNFS client commit and return the layout on close
  */
 static inline int
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index eb9dfe4..52fe384 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -155,14 +155,7 @@ struct layoutdriver_io_operations {
 	int (*uninitialize_mountpoint) (struct nfs_server *server);
 };
 
-enum layoutdriver_policy_flags {
-	/* Should the pNFS client commit and return the layout upon a setattr */
-	PNFS_LAYOUTRET_ON_SETATTR	= 1 << 3,
-};
-
 struct layoutdriver_policy_operations {
-	unsigned flags;
-
 	/* The stripe size of the file system */
 	ssize_t (*get_stripesize) (struct pnfs_layout_type *layoutid);
 
-- 
1.6.6


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

* [PATCH 4/5] post-submit: restore and fix layoutret_on_setattr
  2010-07-14 19:43   ` [PATCH 3/5] SQUASHME pnfs-submit remove layoutret_on_setattr policy andros
@ 2010-07-14 19:43     ` andros
  2010-07-14 19:43       ` [PATCH 5/5] pnfs post-submit: restore gather_across_stripes policy andros
  0 siblings, 1 reply; 5+ messages in thread
From: andros @ 2010-07-14 19:43 UTC (permalink / raw)
  To: bhalevy; +Cc: linux-nfs, Andy Adamson

From: Andy Adamson <andros@netapp.com>

Add pnfs_enabled_sb check

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/nfs4proc.c         |    3 +++
 fs/nfs/pnfs.h             |   10 ++++++++++
 include/linux/nfs4_pnfs.h |    7 +++++++
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 756f6e9..288025e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2358,6 +2358,9 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
 	struct nfs4_state *state = NULL;
 	int status;
 
+	if (pnfs_ld_layoutret_on_setattr(inode))
+		pnfs_return_layout(inode, NULL, NULL, RETURN_FILE, true);
+
 	nfs_fattr_init(fattr);
 	
 	/* Search for an existing open(O_WRITE) file */
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 6bc27af..d5dc2e2 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -92,6 +92,16 @@ static inline int pnfs_enabled_sb(struct nfs_server *nfss)
 	return nfss->pnfs_curr_ld != NULL;
 }
 
+/* Should the pNFS client commit and return the layout upon a setattr */
+static inline bool
+pnfs_ld_layoutret_on_setattr(struct inode *inode)
+{
+	if (!pnfs_enabled_sb(NFS_SERVER(inode)))
+		return false;
+	return NFS_SERVER(inode)->pnfs_curr_ld->ld_policy_ops->flags &
+		PNFS_LAYOUTRET_ON_SETATTR;
+}
+
 /* Should the pNFS client commit and return the layout on close
  */
 static inline int
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 52fe384..eb9dfe4 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -155,7 +155,14 @@ struct layoutdriver_io_operations {
 	int (*uninitialize_mountpoint) (struct nfs_server *server);
 };
 
+enum layoutdriver_policy_flags {
+	/* Should the pNFS client commit and return the layout upon a setattr */
+	PNFS_LAYOUTRET_ON_SETATTR	= 1 << 3,
+};
+
 struct layoutdriver_policy_operations {
+	unsigned flags;
+
 	/* The stripe size of the file system */
 	ssize_t (*get_stripesize) (struct pnfs_layout_type *layoutid);
 
-- 
1.6.6


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

* [PATCH 5/5] pnfs post-submit: restore gather_across_stripes policy
  2010-07-14 19:43     ` [PATCH 4/5] post-submit: restore and fix layoutret_on_setattr andros
@ 2010-07-14 19:43       ` andros
  0 siblings, 0 replies; 5+ messages in thread
From: andros @ 2010-07-14 19: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/pnfs.c             |    4 ++++
 include/linux/nfs4_pnfs.h |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index d3df8df..56c3af4 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1191,6 +1191,10 @@ pnfs_getboundary(struct inode *inode)
 	if (!policy_ops || !policy_ops->get_stripesize)
 		goto out;
 
+	/* The default is to not gather across stripes */
+	if (pnfs_ld_gather_across_stripes(nfss->pnfs_curr_ld))
+		goto out;
+
 	spin_lock(&inode->i_lock);
 	if (NFS_I(inode)->layout)
 		stripe_size = policy_ops->get_stripesize(NFS_I(inode)->layout);
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index eb9dfe4..9eebbdd 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -156,6 +156,9 @@ struct layoutdriver_io_operations {
 };
 
 enum layoutdriver_policy_flags {
+	/* Should the NFS req. gather algorithm cross stripe boundaries? */
+	PNFS_GATHER_ACROSS_STRIPES	= 1 << 1,
+
 	/* Should the pNFS client commit and return the layout upon a setattr */
 	PNFS_LAYOUTRET_ON_SETATTR	= 1 << 3,
 };
@@ -170,6 +173,13 @@ struct layoutdriver_policy_operations {
 	int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
 };
 
+/* Should the NFS req. gather algorithm cross stripe boundaries? */
+static inline int
+pnfs_ld_gather_across_stripes(struct pnfs_layoutdriver_type *ld)
+{
+	return ld->ld_policy_ops->flags & PNFS_GATHER_ACROSS_STRIPES;
+}
+
 struct pnfs_device {
 	struct pnfs_deviceid dev_id;
 	unsigned int  layout_type;
-- 
1.6.6


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

end of thread, other threads:[~2010-07-14 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 19:43 [PATCH 1/5] SQUASHME pnfs-submit: pnfs_try_to_commit can release nfs_write_data andros
2010-07-14 19:43 ` [PATCH 2/5] SQUASHME pnfs-submit remove gather_across_stripes policy andros
2010-07-14 19:43   ` [PATCH 3/5] SQUASHME pnfs-submit remove layoutret_on_setattr policy andros
2010-07-14 19:43     ` [PATCH 4/5] post-submit: restore and fix layoutret_on_setattr andros
2010-07-14 19:43       ` [PATCH 5/5] pnfs post-submit: restore gather_across_stripes policy andros

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