xfs: split xfs_mod_freecounter
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Apr 2024 11:20:12 +0000 (13:20 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Mon, 22 Apr 2024 12:30:47 +0000 (18:00 +0530)
commitf30f656e25eb72c4309e76b16fa45062e183a2ee
treeb097332fb140ac64fbaa8f7a0d5a66358e8c83e2
parent5e1e4d4fc79c6e5f80864860208ceae27dead8a2
xfs: split xfs_mod_freecounter

xfs_mod_freecounter has two entirely separate code paths for adding or
subtracting from the free counters.  Only the subtract case looks at the
rsvd flag and can return an error.

Split xfs_mod_freecounter into separate helpers for subtracting or
adding the freecounter, and remove all the impossible to reach error
handling for the addition case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
14 files changed:
fs/xfs/libxfs/xfs_ag.c
fs/xfs/libxfs/xfs_ag_resv.c
fs/xfs/libxfs/xfs_ag_resv.h
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/scrub/fscounters.c
fs/xfs/scrub/repair.c
fs/xfs/xfs_fsops.c
fs/xfs/xfs_fsops.h
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_super.c
fs/xfs/xfs_trace.h
fs/xfs/xfs_trans.c