aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index cf254ce8c941..a6651956482e 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1989,9 +1989,10 @@ int ocfs2_change_file_space(struct file *file, unsigned int cmd,
1989 return __ocfs2_change_file_space(file, inode, file->f_pos, cmd, sr, 0); 1989 return __ocfs2_change_file_space(file, inode, file->f_pos, cmd, sr, 0);
1990} 1990}
1991 1991
1992static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset, 1992static long ocfs2_fallocate(struct file *file, int mode, loff_t offset,
1993 loff_t len) 1993 loff_t len)
1994{ 1994{
1995 struct inode *inode = file->f_path.dentry->d_inode;
1995 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1996 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
1996 struct ocfs2_space_resv sr; 1997 struct ocfs2_space_resv sr;
1997 int change_size = 1; 1998 int change_size = 1;
@@ -2002,9 +2003,6 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
2002 if (!ocfs2_writes_unwritten_extents(osb)) 2003 if (!ocfs2_writes_unwritten_extents(osb))
2003 return -EOPNOTSUPP; 2004 return -EOPNOTSUPP;
2004 2005
2005 if (S_ISDIR(inode->i_mode))
2006 return -ENODEV;
2007
2008 if (mode & FALLOC_FL_KEEP_SIZE) 2006 if (mode & FALLOC_FL_KEEP_SIZE)
2009 change_size = 0; 2007 change_size = 0;
2010 2008
@@ -2612,7 +2610,6 @@ const struct inode_operations ocfs2_file_iops = {
2612 .getxattr = generic_getxattr, 2610 .getxattr = generic_getxattr,
2613 .listxattr = ocfs2_listxattr, 2611 .listxattr = ocfs2_listxattr,
2614 .removexattr = generic_removexattr, 2612 .removexattr = generic_removexattr,
2615 .fallocate = ocfs2_fallocate,
2616 .fiemap = ocfs2_fiemap, 2613 .fiemap = ocfs2_fiemap,
2617}; 2614};
2618 2615
@@ -2644,6 +2641,7 @@ const struct file_operations ocfs2_fops = {
2644 .flock = ocfs2_flock, 2641 .flock = ocfs2_flock,
2645 .splice_read = ocfs2_file_splice_read, 2642 .splice_read = ocfs2_file_splice_read,
2646 .splice_write = ocfs2_file_splice_write, 2643 .splice_write = ocfs2_file_splice_write,
2644 .fallocate = ocfs2_fallocate,
2647}; 2645};
2648 2646
2649const struct file_operations ocfs2_dops = { 2647const struct file_operations ocfs2_dops = {