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