summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_zone_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_zone_alloc.c')
-rw-r--r--fs/xfs/xfs_zone_alloc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index 5e297b75a85f..08d8b34f467e 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -944,6 +944,14 @@ xfs_zone_rgbno_is_valid(
rtg_rgno(rtg), XFS_RTG_FREE);
}
+void
+xfs_zone_mark_free(
+ struct xfs_rtgroup *rtg)
+{
+ xfs_group_set_mark(rtg_group(rtg), XFS_RTG_FREE);
+ atomic_inc(&rtg_mount(rtg)->m_zone_info->zi_nr_free_zones);
+}
+
static void
xfs_free_open_zones(
struct xfs_zone_info *zi)
@@ -1082,8 +1090,7 @@ xfs_init_zone(
if (write_pointer == 0) {
/* zone is empty */
- atomic_inc(&zi->zi_nr_free_zones);
- xfs_group_set_mark(rtg_group(rtg), XFS_RTG_FREE);
+ xfs_zone_mark_free(rtg);
iz->available += rtg_blocks(rtg);
} else if (write_pointer < rtg_blocks(rtg)) {
/* zone is open */