Commit acff5880539fe33897d016c0f3dcf062e67c61b6
Committed by
Trond Myklebust
1 parent
374e4e3ec3
Exists in
master
and in
4 other branches
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>
Showing 3 changed files with 8 additions and 6 deletions Side-by-side Diff
fs/nfs/nfs4filelayout.c
fs/nfs/pnfs.c
... | ... | @@ -1379,9 +1379,11 @@ |
1379 | 1379 | dprintk("%s: Set layoutcommit for inode %lu ", |
1380 | 1380 | __func__, wdata->inode->i_ino); |
1381 | 1381 | } |
1382 | - if (end_pos > wdata->lseg->pls_end_pos) | |
1383 | - wdata->lseg->pls_end_pos = end_pos; | |
1382 | + if (end_pos > nfsi->layout->plh_lwb) | |
1383 | + nfsi->layout->plh_lwb = end_pos; | |
1384 | 1384 | spin_unlock(&nfsi->vfs_inode.i_lock); |
1385 | + dprintk("%s: lseg %p end_pos %llu\n", | |
1386 | + __func__, wdata->lseg, nfsi->layout->plh_lwb); | |
1385 | 1387 | |
1386 | 1388 | /* if pnfs_layoutcommit_inode() runs between inode locks, the next one |
1387 | 1389 | * will be a noop because NFS_INO_LAYOUTCOMMIT will not be set */ |
1388 | 1390 | |
... | ... | @@ -1433,9 +1435,9 @@ |
1433 | 1435 | */ |
1434 | 1436 | lseg = pnfs_list_write_lseg(inode); |
1435 | 1437 | |
1436 | - end_pos = lseg->pls_end_pos; | |
1438 | + end_pos = nfsi->layout->plh_lwb; | |
1437 | 1439 | cred = lseg->pls_lc_cred; |
1438 | - lseg->pls_end_pos = 0; | |
1440 | + nfsi->layout->plh_lwb = 0; | |
1439 | 1441 | lseg->pls_lc_cred = NULL; |
1440 | 1442 | |
1441 | 1443 | memcpy(&data->args.stateid.data, nfsi->layout->plh_stateid.data, |
fs/nfs/pnfs.h
... | ... | @@ -45,7 +45,6 @@ |
45 | 45 | unsigned long pls_flags; |
46 | 46 | struct pnfs_layout_hdr *pls_layout; |
47 | 47 | struct rpc_cred *pls_lc_cred; /* LAYOUTCOMMIT credential */ |
48 | - loff_t pls_end_pos; /* LAYOUTCOMMIT write end */ | |
49 | 48 | }; |
50 | 49 | |
51 | 50 | enum pnfs_try_status { |
... | ... | @@ -125,6 +124,7 @@ |
125 | 124 | unsigned long plh_block_lgets; /* block LAYOUTGET if >0 */ |
126 | 125 | u32 plh_barrier; /* ignore lower seqids */ |
127 | 126 | unsigned long plh_flags; |
127 | + loff_t plh_lwb; /* last write byte for layoutcommit */ | |
128 | 128 | struct inode *plh_inode; |
129 | 129 | }; |
130 | 130 |