aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ocfs2/file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index bdadbae09094..63e3fca266e0 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1995,6 +1995,7 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
1995 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1995 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1996 struct ocfs2_space_resv sr; 1996 struct ocfs2_space_resv sr;
1997 int change_size = 1; 1997 int change_size = 1;
1998 int cmd = OCFS2_IOC_RESVSP64;
1998 1999
1999 if (!ocfs2_writes_unwritten_extents(osb)) 2000 if (!ocfs2_writes_unwritten_extents(osb))
2000 return -EOPNOTSUPP; 2001 return -EOPNOTSUPP;
@@ -2005,12 +2006,15 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
2005 if (mode & FALLOC_FL_KEEP_SIZE) 2006 if (mode & FALLOC_FL_KEEP_SIZE)
2006 change_size = 0; 2007 change_size = 0;
2007 2008
2009 if (mode & FALLOC_FL_PUNCH_HOLE)
2010 cmd = OCFS2_IOC_UNRESVSP64;
2011
2008 sr.l_whence = 0; 2012 sr.l_whence = 0;
2009 sr.l_start = (s64)offset; 2013 sr.l_start = (s64)offset;
2010 sr.l_len = (s64)len; 2014 sr.l_len = (s64)len;
2011 2015
2012 return __ocfs2_change_file_space(NULL, inode, offset, 2016 return __ocfs2_change_file_space(NULL, inode, offset, cmd, &sr,
2013 OCFS2_IOC_RESVSP64, &sr, change_size); 2017 change_size);
2014} 2018}
2015 2019
2016int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos, 2020int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos,