2018-06-06 10:42:14 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2005-11-02 11:58:39 +08:00
|
|
|
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
|
|
|
|
* All Rights Reserved.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
#ifndef __XFS_SB_H__
|
|
|
|
#define __XFS_SB_H__
|
|
|
|
|
2018-05-14 14:10:08 +08:00
|
|
|
struct xfs_mount;
|
|
|
|
struct xfs_sb;
|
|
|
|
struct xfs_dsb;
|
|
|
|
struct xfs_trans;
|
|
|
|
struct xfs_fsop_geom;
|
|
|
|
struct xfs_perag;
|
|
|
|
|
2015-01-22 06:10:31 +08:00
|
|
|
extern void xfs_log_sb(struct xfs_trans *tp);
|
|
|
|
extern int xfs_sync_sb(struct xfs_mount *mp, bool wait);
|
2018-05-16 04:21:48 +08:00
|
|
|
extern int xfs_sync_sb_buf(struct xfs_mount *mp);
|
xfs: remove bitfield based superblock updates
When we log changes to the superblock, we first have to write them
to the on-disk buffer, and then log that. Right now we have a
complex bitfield based arrangement to only write the modified field
to the buffer before we log it.
This used to be necessary as a performance optimisation because we
logged the superblock buffer in every extent or inode allocation or
freeing, and so performance was extremely important. We haven't done
this for years, however, ever since the lazy superblock counters
pulled the superblock logging out of the transaction commit
fast path.
Hence we have a bunch of complexity that is not necessary that makes
writing the in-core superblock to disk much more complex than it
needs to be. We only need to log the superblock now during
management operations (e.g. during mount, unmount or quota control
operations) so it is not a performance critical path anymore.
As such, remove the complex field based logging mechanism and
replace it with a simple conversion function similar to what we use
for all other on-disk structures.
This means we always log the entirity of the superblock, but again
because we rarely modify the superblock this is not an issue for log
bandwidth or CPU time. Indeed, if we do log the superblock
frequently, delayed logging will minimise the impact of this
overhead.
[Fixed gquota/pquota inode sharing regression noticed by bfoster.]
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2015-01-22 06:10:26 +08:00
|
|
|
extern void xfs_sb_mount_common(struct xfs_mount *mp, struct xfs_sb *sbp);
|
|
|
|
extern void xfs_sb_from_disk(struct xfs_sb *to, struct xfs_dsb *from);
|
|
|
|
extern void xfs_sb_to_disk(struct xfs_dsb *to, struct xfs_sb *from);
|
2013-08-12 18:49:41 +08:00
|
|
|
extern void xfs_sb_quota_from_disk(struct xfs_sb *sbp);
|
2021-08-19 09:46:54 +08:00
|
|
|
extern bool xfs_sb_good_version(struct xfs_sb *sbp);
|
2021-08-19 09:46:26 +08:00
|
|
|
extern uint64_t xfs_sb_version_to_features(struct xfs_sb *sbp);
|
2013-08-12 18:49:41 +08:00
|
|
|
|
2018-05-14 14:10:08 +08:00
|
|
|
extern int xfs_update_secondary_sbs(struct xfs_mount *mp);
|
|
|
|
|
2018-01-09 02:51:27 +08:00
|
|
|
#define XFS_FS_GEOM_MAX_STRUCT_VER (4)
|
2021-08-19 09:46:54 +08:00
|
|
|
extern void xfs_fs_geometry(struct xfs_mount *mp, struct xfs_fsop_geom *geo,
|
2018-01-09 02:51:27 +08:00
|
|
|
int struct_version);
|
2018-05-14 21:34:31 +08:00
|
|
|
extern int xfs_sb_read_secondary(struct xfs_mount *mp,
|
|
|
|
struct xfs_trans *tp, xfs_agnumber_t agno,
|
|
|
|
struct xfs_buf **bpp);
|
2018-05-30 13:18:12 +08:00
|
|
|
extern int xfs_sb_get_secondary(struct xfs_mount *mp,
|
|
|
|
struct xfs_trans *tp, xfs_agnumber_t agno,
|
|
|
|
struct xfs_buf **bpp);
|
2018-01-09 02:51:27 +08:00
|
|
|
|
2020-12-04 08:42:01 +08:00
|
|
|
extern bool xfs_validate_stripe_geometry(struct xfs_mount *mp,
|
|
|
|
__s64 sunit, __s64 swidth, int sectorsize, bool silent);
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif /* __XFS_SB_H__ */
|