diff options
author | Lukas Czerner <lczerner@redhat.com> | 2014-04-12 09:47:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-04-12 09:47:00 -0400 |
commit | 9ef06cec7c96f6bf59f1dd8b64b9645820099051 (patch) | |
tree | 300b9868f29dce82cf42ef9b39874fe07d76783b | |
parent | 622cad1325e404598fe3b148c3fa640dbaabc235 (diff) |
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>
-rw-r--r-- | fs/ext4/extents.c | 6 | ||||
-rw-r--r-- | fs/ext4/inode.c | 6 |
2 files changed, 1 insertions, 11 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index be1e56cbbf32..ed4ec48239b6 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -5398,12 +5398,6 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) | |||
5398 | /* Take mutex lock */ | 5398 | /* Take mutex lock */ |
5399 | mutex_lock(&inode->i_mutex); | 5399 | mutex_lock(&inode->i_mutex); |
5400 | 5400 | ||
5401 | /* It's not possible punch hole on append only file */ | ||
5402 | if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) { | ||
5403 | ret = -EPERM; | ||
5404 | goto out_mutex; | ||
5405 | } | ||
5406 | |||
5407 | if (IS_SWAPFILE(inode)) { | 5401 | if (IS_SWAPFILE(inode)) { |
5408 | ret = -ETXTBSY; | 5402 | ret = -ETXTBSY; |
5409 | goto out_mutex; | 5403 | goto out_mutex; |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f023f0cb46fc..e2bba76f0d7b 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3541,11 +3541,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) | |||
3541 | } | 3541 | } |
3542 | 3542 | ||
3543 | mutex_lock(&inode->i_mutex); | 3543 | mutex_lock(&inode->i_mutex); |
3544 | /* It's not possible punch hole on append only file */ | 3544 | |
3545 | if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) { | ||
3546 | ret = -EPERM; | ||
3547 | goto out_mutex; | ||
3548 | } | ||
3549 | if (IS_SWAPFILE(inode)) { | 3545 | if (IS_SWAPFILE(inode)) { |
3550 | ret = -ETXTBSY; | 3546 | ret = -ETXTBSY; |
3551 | goto out_mutex; | 3547 | goto out_mutex; |