diff options
| author | Darrick J. Wong <[email protected]> | 2024-11-21 00:20:30 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2024-12-23 21:06:06 +0000 |
| commit | 71b8acb42be60e11810eb43a6f470589fcf7b7dd (patch) | |
| tree | 989ad8c19b2f788ac1ee19f7e1cf41793e88dbfa /fs/xfs/xfs_rtalloc.c | |
| parent | xfs: wire up rmap map and unmap to the realtime rmapbt (diff) | |
| download | kernel-71b8acb42be60e11810eb43a6f470589fcf7b7dd.tar.gz kernel-71b8acb42be60e11810eb43a6f470589fcf7b7dd.zip | |
xfs: create routine to allocate and initialize a realtime rmap btree inode
Create a library routine to allocate and initialize an empty realtime
rmapbt inode. We'll use this for mkfs and repair.
Signed-off-by: "Darrick J. Wong" <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
| -rw-r--r-- | fs/xfs/xfs_rtalloc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 2245f9ecaa33..c7efd9264139 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -846,6 +846,13 @@ xfs_growfs_rt_init_rtsb( mp->m_rtsb_bp = rtsb_bp; error = xfs_bwrite(rtsb_bp); xfs_buf_unlock(rtsb_bp); + if (error) + return error; + + /* Initialize the rtrmap to reflect the rtsb. */ + if (rtg_rmap(args->rtg) != NULL) + error = xfs_rtrmapbt_init_rtsb(nargs->mp, args->rtg, args->tp); + return error; } @@ -894,8 +901,9 @@ xfs_growfs_rt_bmblock( goto out_free; nargs.tp = args.tp; - xfs_rtgroup_lock(args.rtg, XFS_RTGLOCK_BITMAP); - xfs_rtgroup_trans_join(args.tp, args.rtg, XFS_RTGLOCK_BITMAP); + xfs_rtgroup_lock(args.rtg, XFS_RTGLOCK_BITMAP | XFS_RTGLOCK_RMAP); + xfs_rtgroup_trans_join(args.tp, args.rtg, + XFS_RTGLOCK_BITMAP | XFS_RTGLOCK_RMAP); /* * Update the bitmap inode's size ondisk and incore. We need to update |
