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
|
|
|
*
|
2005-11-02 03:58:39 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
2005-04-16 22:20:36 +00:00
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
2005-11-02 03:58:39 +00:00
|
|
|
* This program is distributed in the hope that it would be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2005-11-02 03:58:39 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
#ifndef __XFS_SB_H__
|
|
|
|
#define __XFS_SB_H__
|
|
|
|
|
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);
|
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-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-01-08 18:51:27 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* __XFS_SB_H__ */
|