diff options
author | Kaixu Xia <kaixuxia@tencent.com> | 2020-04-23 06:54:28 +0200 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-05-04 18:03:14 +0200 |
commit | fb353ff19d34e9b0ee8ba2b25d78aeab0436f479 (patch) | |
tree | 8e8d8d2d8c0c37fea1d368f5630db4631d4fd617 /fs/xfs/xfs_qm.c | |
parent | xfs: combine two if statements with same condition (diff) | |
download | linux-fb353ff19d34e9b0ee8ba2b25d78aeab0436f479.tar.xz linux-fb353ff19d34e9b0ee8ba2b25d78aeab0436f479.zip |
xfs: reserve quota inode transaction space only when needed
We share an inode between gquota and pquota with the older
superblock that doesn't have separate pquotino, and for the
need_alloc == false case we don't need to call xfs_dir_ialloc()
function, so add the check if reserved free disk blocks is
needed.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to '')
-rw-r--r-- | fs/xfs/xfs_qm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 6678baab37de..b684b0410a52 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -780,7 +780,8 @@ xfs_qm_qino_alloc( } error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create, - XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp); + need_alloc ? XFS_QM_QINOCREATE_SPACE_RES(mp) : 0, + 0, 0, &tp); if (error) return error; |