diff mbox series

[03/12] libfrog: move bitmap.h to libfrog/

Message ID 156757176284.1838135.8194717294650007232.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series libfrog: move header files | expand

Commit Message

Darrick J. Wong Sept. 4, 2019, 4:36 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Move this header to libfrog since the code is there already.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 include/bitmap.h |   24 ------------------------
 libfrog/Makefile |    1 +
 libfrog/bitmap.h |   24 ++++++++++++++++++++++++
 repair/rmap.c    |    2 +-
 scrub/phase6.c   |    2 +-
 5 files changed, 27 insertions(+), 26 deletions(-)
 delete mode 100644 include/bitmap.h
 create mode 100644 libfrog/bitmap.h

Comments

Dave Chinner Sept. 4, 2019, 11:28 p.m. UTC | #1
On Tue, Sep 03, 2019 at 09:36:02PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Move this header to libfrog since the code is there already.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  include/bitmap.h |   24 ------------------------
>  libfrog/Makefile |    1 +
>  libfrog/bitmap.h |   24 ++++++++++++++++++++++++
>  repair/rmap.c    |    2 +-
>  scrub/phase6.c   |    2 +-
>  5 files changed, 27 insertions(+), 26 deletions(-)
>  delete mode 100644 include/bitmap.h
>  create mode 100644 libfrog/bitmap.h

looks good.

FWIW, given these are file moves, you could tell git to generate
move diffs rather than long form entire-file-changed diffs. The
shortform git diffs are a lot easier to review :P

Reviewed-by: Dave Chinner <dchinner@redhat.com>
diff mbox series

Patch

diff --git a/include/bitmap.h b/include/bitmap.h
deleted file mode 100644
index 99a2fb23..00000000
--- a/include/bitmap.h
+++ /dev/null
@@ -1,24 +0,0 @@ 
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2018 Oracle.  All Rights Reserved.
- * Author: Darrick J. Wong <darrick.wong@oracle.com>
- */
-#ifndef LIBFROG_BITMAP_H_
-#define LIBFROG_BITMAP_H_
-
-struct bitmap {
-	pthread_mutex_t		bt_lock;
-	struct avl64tree_desc	*bt_tree;
-};
-
-int bitmap_init(struct bitmap **bmap);
-void bitmap_free(struct bitmap **bmap);
-int bitmap_set(struct bitmap *bmap, uint64_t start, uint64_t length);
-int bitmap_iterate(struct bitmap *bmap, int (*fn)(uint64_t, uint64_t, void *),
-		void *arg);
-bool bitmap_test(struct bitmap *bmap, uint64_t start,
-		uint64_t len);
-bool bitmap_empty(struct bitmap *bmap);
-void bitmap_dump(struct bitmap *bmap);
-
-#endif /* LIBFROG_BITMAP_H_ */
diff --git a/libfrog/Makefile b/libfrog/Makefile
index e766adba..2b199b45 100644
--- a/libfrog/Makefile
+++ b/libfrog/Makefile
@@ -30,6 +30,7 @@  workqueue.c
 HFILES = \
 avl64.h \
 bulkstat.h \
+bitmap.h \
 crc32defs.h \
 crc32table.h \
 topology.h
diff --git a/libfrog/bitmap.h b/libfrog/bitmap.h
new file mode 100644
index 00000000..40119b9c
--- /dev/null
+++ b/libfrog/bitmap.h
@@ -0,0 +1,24 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Oracle.  All Rights Reserved.
+ * Author: Darrick J. Wong <darrick.wong@oracle.com>
+ */
+#ifndef __LIBFROG_BITMAP_H__
+#define __LIBFROG_BITMAP_H__
+
+struct bitmap {
+	pthread_mutex_t		bt_lock;
+	struct avl64tree_desc	*bt_tree;
+};
+
+int bitmap_init(struct bitmap **bmap);
+void bitmap_free(struct bitmap **bmap);
+int bitmap_set(struct bitmap *bmap, uint64_t start, uint64_t length);
+int bitmap_iterate(struct bitmap *bmap, int (*fn)(uint64_t, uint64_t, void *),
+		void *arg);
+bool bitmap_test(struct bitmap *bmap, uint64_t start,
+		uint64_t len);
+bool bitmap_empty(struct bitmap *bmap);
+void bitmap_dump(struct bitmap *bmap);
+
+#endif /* __LIBFROG_BITMAP_H__ */
diff --git a/repair/rmap.c b/repair/rmap.c
index 47828a06..5dd6557a 100644
--- a/repair/rmap.c
+++ b/repair/rmap.c
@@ -12,7 +12,7 @@ 
 #include "dinode.h"
 #include "slab.h"
 #include "rmap.h"
-#include "bitmap.h"
+#include "libfrog/bitmap.h"
 
 #undef RMAP_DEBUG
 
diff --git a/scrub/phase6.c b/scrub/phase6.c
index 5628b926..9b0d228a 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -12,7 +12,7 @@ 
 #include "workqueue.h"
 #include "xfs_scrub.h"
 #include "common.h"
-#include "bitmap.h"
+#include "libfrog/bitmap.h"
 #include "disk.h"
 #include "filemap.h"
 #include "fscounters.h"