summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-09-10 11:23:31 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-09-10 15:47:03 -0400
commitc88953d87f5c8cd95bebcbd6d15f2f0cdd348136 (patch)
tree6805b3c8feb934404205d5e79a2cf37dde87647f /fs/nfs/pnfs.c
parent612aa983a041056c3368aacfdc9febd406d245a8 (diff)
pnfs: add return_range method
If a layout driver keeps per-inode state outside of the layout segments it needs to be notified of any layout returns or recalls on an inode, and not just about the freeing of layout segments. Add a method to acomplish this, which will allow the block layout driver to handle the case of truncated and re-expanded files properly. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index ce5d1ea695d1..76de7f568119 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -857,6 +857,16 @@ _pnfs_return_layout(struct inode *ino)
857 empty = list_empty(&lo->plh_segs); 857 empty = list_empty(&lo->plh_segs);
858 pnfs_clear_layoutcommit(ino, &tmp_list); 858 pnfs_clear_layoutcommit(ino, &tmp_list);
859 pnfs_mark_matching_lsegs_invalid(lo, &tmp_list, NULL); 859 pnfs_mark_matching_lsegs_invalid(lo, &tmp_list, NULL);
860
861 if (NFS_SERVER(ino)->pnfs_curr_ld->return_range) {
862 struct pnfs_layout_range range = {
863 .iomode = IOMODE_ANY,
864 .offset = 0,
865 .length = NFS4_MAX_UINT64,
866 };
867 NFS_SERVER(ino)->pnfs_curr_ld->return_range(lo, &range);
868 }
869
860 /* Don't send a LAYOUTRETURN if list was initially empty */ 870 /* Don't send a LAYOUTRETURN if list was initially empty */
861 if (empty) { 871 if (empty) {
862 spin_unlock(&ino->i_lock); 872 spin_unlock(&ino->i_lock);