summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_imeta.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-01-16 10:12:25 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-02-04 09:31:18 -0800
commit57a2aa5649a1fe4b308c551ec80420e16815701a (patch)
tree8f828ccd06bfb8a710179dc3985cafaf98caa882 /fs/xfs/libxfs/xfs_imeta.c
parent2668e02d97838e323dbc0f97656aee7ba1b6305b (diff)
xfs: create transaction reservations for metadata inode operations
Create transaction reservation types and block reservation helpers to help us calculate transaction requirements. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_imeta.c')
-rw-r--r--fs/xfs/libxfs/xfs_imeta.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_imeta.c b/fs/xfs/libxfs/xfs_imeta.c
index 9994b867aeab..aadba5786d1c 100644
--- a/fs/xfs/libxfs/xfs_imeta.c
+++ b/fs/xfs/libxfs/xfs_imeta.c
@@ -17,6 +17,10 @@
#include "xfs_imeta.h"
#include "xfs_trace.h"
#include "xfs_inode.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_da_format.h"
+#include "xfs_da_btree.h"
+#include "xfs_trans_space.h"
/*
* Metadata Inode Number Management
@@ -378,3 +382,19 @@ xfs_imeta_mount(
{
return 0;
}
+
+/* Calculate the log block reservation to create a metadata inode. */
+unsigned int
+xfs_imeta_create_space_res(
+ struct xfs_mount *mp)
+{
+ return XFS_IALLOC_SPACE_RES(mp);
+}
+
+/* Calculate the log block reservation to unlink a metadata inode. */
+unsigned int
+xfs_imeta_unlink_space_res(
+ struct xfs_mount *mp)
+{
+ return XFS_REMOVE_SPACE_RES(mp);
+}