linux/fs/xfs/scrub/bitmap.h
Darrick J. Wong bc270b53e6 xfs: move the repair extent list into its own file
Move the xrep_extent_list code into a separate file.  Logically, this
data structure is really just a clumsy bitmap, and in the next patch
we'll make this more obvious.  No functional changes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
2018-07-29 22:37:09 -07:00

38 lines
960 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2018 Oracle. All Rights Reserved.
* Author: Darrick J. Wong <darrick.wong@oracle.com>
*/
#ifndef __XFS_SCRUB_BITMAP_H__
#define __XFS_SCRUB_BITMAP_H__
struct xrep_extent {
struct list_head list;
xfs_fsblock_t fsbno;
xfs_extlen_t len;
};
struct xrep_extent_list {
struct list_head list;
};
static inline void
xrep_init_extent_list(
struct xrep_extent_list *exlist)
{
INIT_LIST_HEAD(&exlist->list);
}
#define for_each_xrep_extent_safe(rbe, n, exlist) \
list_for_each_entry_safe((rbe), (n), &(exlist)->list, list)
int xrep_collect_btree_extent(struct xfs_scrub *sc,
struct xrep_extent_list *btlist, xfs_fsblock_t fsbno,
xfs_extlen_t len);
void xrep_cancel_btree_extents(struct xfs_scrub *sc,
struct xrep_extent_list *btlist);
int xrep_subtract_extents(struct xfs_scrub *sc,
struct xrep_extent_list *exlist,
struct xrep_extent_list *sublist);
#endif /* __XFS_SCRUB_BITMAP_H__ */