summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2011-07-30 20:52:31 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-07-31 12:18:14 -0400
commitacff5880539fe33897d016c0f3dcf062e67c61b6 (patch)
treec5769a826e04e1c3b84c19d2b0f9932a2e69aa8f /fs/nfs/pnfs.c
parent374e4e3ec347d4f70e1417ce3e1c454f133dab72 (diff)
downloadlinux-acff5880539fe33897d016c0f3dcf062e67c61b6.tar.bz2
pnfs: save layoutcommit lwb at layout header
No need to save it for every lseg. [Needed in v3.0] CC: Stable Tree <stable@kernel.org> Signed-off-by: Peng Tao <peng_tao@emc.com> Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 38e5508555c6..7a948ab4e73d 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1379,9 +1379,11 @@ pnfs_set_layoutcommit(struct nfs_write_data *wdata)
dprintk("%s: Set layoutcommit for inode %lu ",
__func__, wdata->inode->i_ino);
}
- if (end_pos > wdata->lseg->pls_end_pos)
- wdata->lseg->pls_end_pos = end_pos;
+ if (end_pos > nfsi->layout->plh_lwb)
+ nfsi->layout->plh_lwb = end_pos;
spin_unlock(&nfsi->vfs_inode.i_lock);
+ dprintk("%s: lseg %p end_pos %llu\n",
+ __func__, wdata->lseg, nfsi->layout->plh_lwb);
/* if pnfs_layoutcommit_inode() runs between inode locks, the next one
* will be a noop because NFS_INO_LAYOUTCOMMIT will not be set */
@@ -1433,9 +1435,9 @@ pnfs_layoutcommit_inode(struct inode *inode, bool sync)
*/
lseg = pnfs_list_write_lseg(inode);
- end_pos = lseg->pls_end_pos;
+ end_pos = nfsi->layout->plh_lwb;
cred = lseg->pls_lc_cred;
- lseg->pls_end_pos = 0;
+ nfsi->layout->plh_lwb = 0;
lseg->pls_lc_cred = NULL;
memcpy(&data->args.stateid.data, nfsi->layout->plh_stateid.data,