浏览代码

ext4: remove unnecessary check for APPEND and IMMUTABLE

All the checks IS_APPEND and IS_IMMUTABLE for the fallocate operation on
the inode are done in vfs. No need to do this again in ext4. Remove it.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Lukas Czerner 11 年之前
父节点
当前提交
9ef06cec7c
共有 2 个文件被更改,包括 1 次插入11 次删除
  1. 0 6
      fs/ext4/extents.c
  2. 1 5
      fs/ext4/inode.c

+ 0 - 6
fs/ext4/extents.c

@@ -5398,12 +5398,6 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
 	/* Take mutex lock */
 	/* Take mutex lock */
 	mutex_lock(&inode->i_mutex);
 	mutex_lock(&inode->i_mutex);
 
 
-	/* It's not possible punch hole on append only file */
-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {
-		ret = -EPERM;
-		goto out_mutex;
-	}
-
 	if (IS_SWAPFILE(inode)) {
 	if (IS_SWAPFILE(inode)) {
 		ret = -ETXTBSY;
 		ret = -ETXTBSY;
 		goto out_mutex;
 		goto out_mutex;

+ 1 - 5
fs/ext4/inode.c

@@ -3541,11 +3541,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
 	}
 	}
 
 
 	mutex_lock(&inode->i_mutex);
 	mutex_lock(&inode->i_mutex);
-	/* It's not possible punch hole on append only file */
-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {
-		ret = -EPERM;
-		goto out_mutex;
-	}
+
 	if (IS_SWAPFILE(inode)) {
 	if (IS_SWAPFILE(inode)) {
 		ret = -ETXTBSY;
 		ret = -ETXTBSY;
 		goto out_mutex;
 		goto out_mutex;