2018-06-06 09:42:14 +07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
2005-11-02 10:58:39 +07:00
|
|
|
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
|
|
|
|
* All Rights Reserved.
|
2005-04-17 05:20:36 +07:00
|
|
|
*/
|
|
|
|
#ifndef __XFS_SB_H__
|
|
|
|
#define __XFS_SB_H__
|
|
|
|
|
2018-05-14 13:10:08 +07:00
|
|
|
struct xfs_mount;
|
|
|
|
struct xfs_sb;
|
|
|
|
struct xfs_dsb;
|
|
|
|
struct xfs_trans;
|
|
|
|
struct xfs_fsop_geom;
|
|
|
|
struct xfs_perag;
|
|
|
|
|
2013-08-12 17:49:41 +07:00
|
|
|
/*
|
|
|
|
* perag get/put wrappers for ref counting
|
|
|
|
*/
|
|
|
|
extern struct xfs_perag *xfs_perag_get(struct xfs_mount *, xfs_agnumber_t);
|
|
|
|
extern struct xfs_perag *xfs_perag_get_tag(struct xfs_mount *, xfs_agnumber_t,
|
|
|
|
int tag);
|
|
|
|
extern void xfs_perag_put(struct xfs_perag *pag);
|
|
|
|
extern int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
|
|
|
|
|
2015-01-22 05:10:31 +07:00
|
|
|
extern void xfs_log_sb(struct xfs_trans *tp);
|
|
|
|
extern int xfs_sync_sb(struct xfs_mount *mp, bool wait);
|
2018-05-16 03:21:48 +07: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 05:10:26 +07: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 17:49:41 +07:00
|
|
|
extern void xfs_sb_quota_from_disk(struct xfs_sb *sbp);
|
|
|
|
|
2018-05-14 13:10:08 +07:00
|
|
|
extern int xfs_update_secondary_sbs(struct xfs_mount *mp);
|
|
|
|
|
2018-01-09 01:51:27 +07:00
|
|
|
#define XFS_FS_GEOM_MAX_STRUCT_VER (4)
|
2019-05-02 10:26:30 +07:00
|
|
|
extern void xfs_fs_geometry(struct xfs_sb *sbp, struct xfs_fsop_geom *geo,
|
2018-01-09 01:51:27 +07:00
|
|
|
int struct_version);
|
2018-05-14 20:34:31 +07: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 12:18:12 +07: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 01:51:27 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#endif /* __XFS_SB_H__ */
|