diff options
author | Dave Chinner <david@fromorbit.com> | 2022-04-21 11:40:17 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-04-21 11:40:17 +1000 |
commit | 1499b8a3a37baf5a78ee8044e9a8fa0471268d74 (patch) | |
tree | 12d56bded6454f11cf12922e71b3ce9dfb7e4093 /fs/xfs/xfs_mount.h | |
parent | 9a5280b312e2e7898b6397b2ca3cfd03f67d7be1 (diff) | |
parent | 2d9ac4319b9959bf3195fedf88bdfd224c67593b (diff) | |
download | linux-1499b8a3a37baf5a78ee8044e9a8fa0471268d74.tar.gz |
Merge branch 'guilt/5.19-miscellaneous' into xfs-5.19-for-next
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index f6dc19de8322..a6b8efb2df52 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -183,6 +183,8 @@ typedef struct xfs_mount { struct percpu_counter m_icount; /* allocated inodes counter */ struct percpu_counter m_ifree; /* free inodes counter */ struct percpu_counter m_fdblocks; /* free block counter */ + struct percpu_counter m_frextents; /* free rt extent counter */ + /* * Count of data device blocks reserved for delayed allocations, * including indlen blocks. Does not include allocated CoW staging @@ -494,9 +496,20 @@ xfs_fdblocks_unavailable( return mp->m_alloc_set_aside + atomic64_read(&mp->m_allocbt_blks); } -extern int xfs_mod_fdblocks(struct xfs_mount *mp, int64_t delta, - bool reserved); -extern int xfs_mod_frextents(struct xfs_mount *mp, int64_t delta); +int xfs_mod_freecounter(struct xfs_mount *mp, struct percpu_counter *counter, + int64_t delta, bool rsvd); + +static inline int +xfs_mod_fdblocks(struct xfs_mount *mp, int64_t delta, bool reserved) +{ + return xfs_mod_freecounter(mp, &mp->m_fdblocks, delta, reserved); +} + +static inline int +xfs_mod_frextents(struct xfs_mount *mp, int64_t delta) +{ + return xfs_mod_freecounter(mp, &mp->m_frextents, delta, false); +} extern int xfs_readsb(xfs_mount_t *, int); extern void xfs_freesb(xfs_mount_t *); |