diff options
author | Brian Foster <bfoster@redhat.com> | 2018-05-07 17:38:48 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-09 10:04:02 -0700 |
commit | 8b922f0e6a7fb2eea65bd9f1462f648e240d4ba7 (patch) | |
tree | f3e073d9376303a0df38ceda925d55e7f0c25588 | |
parent | 658f8f95117349194af1631ef87970c212c68487 (diff) | |
download | linux-8b922f0e6a7fb2eea65bd9f1462f648e240d4ba7.tar.gz linux-8b922f0e6a7fb2eea65bd9f1462f648e240d4ba7.tar.bz2 linux-8b922f0e6a7fb2eea65bd9f1462f648e240d4ba7.zip |
xfs: defer frees from common inode allocation paths
Inode allocation can require block allocation for physical inode
chunk allocation, inode btree record insertion, and/or directory
block allocation for entry insertion. Any of these block allocation
requests can require AGFL fixups prior to the actual allocation.
Update the common file creation transacions to defer AGFL frees from
these contexts to avoid too much log reservation consumption
per-transaction.
Since these transactions are already passed down through the btree
cursors and da_args structure, this simply requires to attach dfops
to the transaction. Note that this covers tr_create, tr_mkdir and
tr_symlink. Other transactions such as tr_create_tmpfile do not
already make use of deferred operations and so are left alone for
the time being.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/xfs_inode.c | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_symlink.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 9959b6287bea..c903b6a0ef14 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1208,6 +1208,7 @@ xfs_create( unlock_dp_on_error = true; xfs_defer_init(&dfops, &first_block); + tp->t_agfl_dfops = &dfops; /* * Reserve disk quota and the inode. diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 5b66ac12913c..88643a8fd487 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -259,6 +259,7 @@ xfs_symlink( * bmapi or the directory create code. */ xfs_defer_init(&dfops, &first_block); + tp->t_agfl_dfops = &dfops; /* * Allocate an inode for the symlink. |