[PATCH 07/16] SQUASHME pnfs_submit: don't get a reference on boundary calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

The i_lock needs to be held because in the write path, we don't know if any
of the pages served by the pgio have a layout segment.

FIXME: Review when we calculate the boundary in the write path, perhaps
delaying until we know if pNFS I/O is to occur (at least one page is
referencing a layout segment).

Signed-off-by: Andy Adamon <andros@xxxxxxxxxx>
---
 fs/nfs/pnfs.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 7219d2b..18ebde9 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1302,8 +1302,6 @@ pnfs_getboundary(struct inode *inode)
 	u32 stripe_size = 0;
 	struct nfs_server *nfss = NFS_SERVER(inode);
 	struct layoutdriver_policy_operations *policy_ops;
-	struct nfs_inode *nfsi;
-	struct pnfs_layout_type *lo;
 
 	if (!nfss->pnfs_curr_ld)
 		goto out;
@@ -1316,13 +1314,9 @@ pnfs_getboundary(struct inode *inode)
 	if (pnfs_ld_gather_across_stripes(nfss->pnfs_curr_ld))
 		goto out;
 
-	nfsi = NFS_I(inode);
 	spin_lock(&inode->i_lock);
-	lo = grab_current_layout(nfsi);;
-	if (lo) {
-		stripe_size = policy_ops->get_stripesize(lo);
-		put_layout(lo);
-	}
+	if (NFS_I(inode)->layout)
+		stripe_size = policy_ops->get_stripesize(NFS_I(inode)->layout);
 	spin_unlock(&inode->i_lock);
 out:
 	return stripe_size;
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux