Skip to content

Commit

Permalink
ext4: remove unnecessary check for APPEND and IMMUTABLE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lukas Czerner authored and Theodore Ts'o committed Apr 12, 2014
1 parent 622cad1 commit 9ef06ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
6 changes: 0 additions & 6 deletions fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -5398,12 +5398,6 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
/* Take mutex lock */
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)) {
ret = -ETXTBSY;
goto out_mutex;
Expand Down
6 changes: 1 addition & 5 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3541,11 +3541,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
}

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)) {
ret = -ETXTBSY;
goto out_mutex;
Expand Down

0 comments on commit 9ef06ce

Please sign in to comment.