summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/bitmap.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-07-30 08:37:09 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-30 08:37:09 +0300
commitbc270b53e6aa3b9723e26a548fa1a1688ea61361 (patch)
tree5229acc648d38c095cdf6b6c9e5b2efc8acb6658 /fs/xfs/scrub/bitmap.h
parentebcbef3a61a6081ffe20b0b684f18ebbf23f1dfb (diff)
downloadlinux-bc270b53e6aa3b9723e26a548fa1a1688ea61361.tar.xz
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>
Diffstat (limited to 'fs/xfs/scrub/bitmap.h')
-rw-r--r--fs/xfs/scrub/bitmap.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/fs/xfs/scrub/bitmap.h b/fs/xfs/scrub/bitmap.h
new file mode 100644
index 000000000000..1038157695a8
--- /dev/null
+++ b/fs/xfs/scrub/bitmap.h
@@ -0,0 +1,37 @@
+// 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__ */