Skip to content

Commit

Permalink
xfs: remove unnecessary ternary from xfs_create
Browse files Browse the repository at this point in the history
Since the "no-allocation" reservations for file creations has
been removed, the resblks value should be larger than zero, so
remove unnecessary ternary conditional.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: s/judgment/ternary/]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  • Loading branch information
Kaixu Xia authored and Darrick J. Wong committed Mar 28, 2020
1 parent 5cc3c00 commit 63337b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,7 @@ xfs_create(
unlock_dp_on_error = false;

error = xfs_dir_createname(tp, dp, name, ip->i_ino,
resblks ?
resblks - XFS_IALLOC_SPACE_RES(mp) : 0);
resblks - XFS_IALLOC_SPACE_RES(mp));
if (error) {
ASSERT(error != -ENOSPC);
goto out_trans_cancel;
Expand Down

0 comments on commit 63337b6

Please sign in to comment.