diff options
author | Dave Chinner <dchinner@redhat.com> | 2020-12-09 10:02:17 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-12-12 10:48:24 -0800 |
commit | aececc9f8dec92a25c84a3378021636ce58d72dc (patch) | |
tree | 2a0033e5d90ceee461d45ab9bd3200b6f2e4c0b0 /fs/xfs/xfs_inode.c | |
parent | 15574ebbff260a70d344cfb924a8daf3c47dc303 (diff) |
xfs: introduce xfs_dialloc_roll()
Introduce a helper to make the on-disk inode allocation rolling
logic clearer in preparation of the following cleanup.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 034fe0adae05..6329b049570b 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -958,7 +958,6 @@ xfs_dir_ialloc( xfs_inode_t *ip; xfs_buf_t *ialloc_context = NULL; int code; - void *dqinfo; tp = *tpp; ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); @@ -1002,41 +1001,13 @@ xfs_dir_ialloc( * to succeed the second time. */ if (ialloc_context) { - /* - * Normally, xfs_trans_commit releases all the locks. - * We call bhold to hang on to the ialloc_context across - * the commit. Holding this buffer prevents any other - * processes from doing any allocations in this - * allocation group. - */ - xfs_trans_bhold(tp, ialloc_context); - - /* - * We want the quota changes to be associated with the next - * transaction, NOT this one. So, detach the dqinfo from this - * and attach it to the next transaction. - */ - dqinfo = NULL; - if (tp->t_dqinfo) { - dqinfo = (void *)tp->t_dqinfo; - tp->t_dqinfo = NULL; - } - - code = xfs_trans_roll(&tp); - - /* - * Re-attach the quota info that we detached from prev trx. - */ - if (dqinfo) - tp->t_dqinfo = dqinfo; - + code = xfs_dialloc_roll(&tp, ialloc_context); if (code) { xfs_buf_relse(ialloc_context); *tpp = tp; *ipp = NULL; return code; } - xfs_trans_bjoin(tp, ialloc_context); /* * Call ialloc again. Since we've locked out all |