[PATCH 2/2] Remove redundant inode mode checks for ceph & ext4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These checks are not needed here, since they are already performed
by do_fallocate()

Signed-off-by: Rohan Puri <rohan.puri15@xxxxxxxxx>
---
 fs/ceph/file.c  | 3 ---
 fs/ext4/inode.c | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 88a6df4..687a72e 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1218,9 +1218,6 @@ static long ceph_fallocate(struct file *file, int mode,
 	loff_t endoff = 0;
 	loff_t size;
 
-	if (!S_ISREG(inode->i_mode))
-		return -EOPNOTSUPP;
-
 	mutex_lock(&inode->i_mutex);
 
 	if (ceph_snap(inode) != CEPH_NOSNAP) {
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7fcd68e..22c9868 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3532,9 +3532,6 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
 	unsigned int credits;
 	int ret = 0;
 
-	if (!S_ISREG(inode->i_mode))
-		return -EOPNOTSUPP;
-
 	trace_ext4_punch_hole(inode, offset, length, 0);
 
 	/*
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux