All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 02/12] libfrog: move avl64.h to libfrog/
Date: Tue, 03 Sep 2019 21:35:56 -0700	[thread overview]
Message-ID: <156757175652.1838135.13049266190478520193.stgit@magnolia> (raw)
In-Reply-To: <156757174409.1838135.8885359673458816401.stgit@magnolia>

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/avl64.h     |  127 ---------------------------------------------------
 libfrog/Makefile    |    1 
 libfrog/avl64.h     |  127 +++++++++++++++++++++++++++++++++++++++++++++++++++
 repair/incore_ext.c |    2 -
 repair/xfs_repair.c |    2 -
 scrub/phase1.c      |    2 -
 6 files changed, 131 insertions(+), 130 deletions(-)
 delete mode 100644 include/avl64.h
 create mode 100644 libfrog/avl64.h


diff --git a/include/avl64.h b/include/avl64.h
deleted file mode 100644
index 4042f6c3..00000000
--- a/include/avl64.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
- * All Rights Reserved.
- */
-#ifndef __XR_AVL64_H__
-#define __XR_AVL64_H__
-
-#include <sys/types.h>
-
-typedef struct	avl64node {
-	struct	avl64node	*avl_forw;	/* pointer to right child  (> parent) */
-	struct	avl64node *avl_back;	/* pointer to left child  (< parent) */
-	struct	avl64node *avl_parent;	/* parent pointer */
-	struct	avl64node *avl_nextino;	/* next in-order; NULL terminated list*/
-	char		 avl_balance;	/* tree balance */
-} avl64node_t;
-
-/*
- * avl-tree operations
- */
-typedef struct avl64ops {
-	uint64_t	(*avl_start)(avl64node_t *);
-	uint64_t	(*avl_end)(avl64node_t *);
-} avl64ops_t;
-
-/*
- * avoid complaints about multiple def's since these are only used by
- * the avl code internally
- */
-#ifndef AVL_START
-#define	AVL_START(tree, n)	(*(tree)->avl_ops->avl_start)(n)
-#define	AVL_END(tree, n)	(*(tree)->avl_ops->avl_end)(n)
-#endif
-
-/*
- * tree descriptor:
- *	root points to the root of the tree.
- *	firstino points to the first in the ordered list.
- */
-typedef struct avl64tree_desc {
-	avl64node_t	*avl_root;
-	avl64node_t	*avl_firstino;
-	avl64ops_t	*avl_ops;
-} avl64tree_desc_t;
-
-/* possible values for avl_balance */
-
-#define AVL_BACK	1
-#define AVL_BALANCE	0
-#define AVL_FORW	2
-
-/*
- * 'Exported' avl tree routines
- */
-avl64node_t
-*avl64_insert(
-	avl64tree_desc_t *tree,
-	avl64node_t *newnode);
-
-void
-avl64_delete(
-	avl64tree_desc_t *tree,
-	avl64node_t *np);
-
-void
-avl64_insert_immediate(
-	avl64tree_desc_t *tree,
-	avl64node_t *afterp,
-	avl64node_t *newnode);
-
-avl64node_t *
-avl64_firstino(avl64node_t *root);
-
-avl64node_t *
-avl64_lastino(avl64node_t *root);
-
-void
-avl64_init_tree(
-	avl64tree_desc_t  *tree,
-	avl64ops_t *ops);
-
-avl64node_t *
-avl64_findrange(
-	avl64tree_desc_t *tree,
-	uint64_t value);
-
-avl64node_t *
-avl64_find(
-	avl64tree_desc_t *tree,
-	uint64_t value);
-
-avl64node_t *
-avl64_findanyrange(
-	avl64tree_desc_t *tree,
-	uint64_t	start,
-	uint64_t	end,
-	int     checklen);
-
-
-avl64node_t *
-avl64_findadjacent(
-	avl64tree_desc_t *tree,
-	uint64_t	value,
-	int		dir);
-
-void
-avl64_findranges(
-	avl64tree_desc_t *tree,
-	uint64_t	start,
-	uint64_t	end,
-	avl64node_t	        **startp,
-	avl64node_t		**endp);
-
-/*
- * avoid complaints about multiple def's since these are only used by
- * the avl code internally
- */
-#ifndef AVL_PRECEED
-#define AVL_PRECEED	0x1
-#define AVL_SUCCEED	0x2
-
-#define AVL_INCLUDE_ZEROLEN	0x0000
-#define AVL_EXCLUDE_ZEROLEN	0x0001
-#endif
-
-#endif /* __XR_AVL64_H__ */
diff --git a/libfrog/Makefile b/libfrog/Makefile
index 37976029..e766adba 100644
--- a/libfrog/Makefile
+++ b/libfrog/Makefile
@@ -28,6 +28,7 @@ util.c \
 workqueue.c
 
 HFILES = \
+avl64.h \
 bulkstat.h \
 crc32defs.h \
 crc32table.h \
diff --git a/libfrog/avl64.h b/libfrog/avl64.h
new file mode 100644
index 00000000..283fc91c
--- /dev/null
+++ b/libfrog/avl64.h
@@ -0,0 +1,127 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ */
+#ifndef __LIBFROG_AVL64_H__
+#define __LIBFROG_AVL64_H__
+
+#include <sys/types.h>
+
+typedef struct	avl64node {
+	struct	avl64node	*avl_forw;	/* pointer to right child  (> parent) */
+	struct	avl64node *avl_back;	/* pointer to left child  (< parent) */
+	struct	avl64node *avl_parent;	/* parent pointer */
+	struct	avl64node *avl_nextino;	/* next in-order; NULL terminated list*/
+	char		 avl_balance;	/* tree balance */
+} avl64node_t;
+
+/*
+ * avl-tree operations
+ */
+typedef struct avl64ops {
+	uint64_t	(*avl_start)(avl64node_t *);
+	uint64_t	(*avl_end)(avl64node_t *);
+} avl64ops_t;
+
+/*
+ * avoid complaints about multiple def's since these are only used by
+ * the avl code internally
+ */
+#ifndef AVL_START
+#define	AVL_START(tree, n)	(*(tree)->avl_ops->avl_start)(n)
+#define	AVL_END(tree, n)	(*(tree)->avl_ops->avl_end)(n)
+#endif
+
+/*
+ * tree descriptor:
+ *	root points to the root of the tree.
+ *	firstino points to the first in the ordered list.
+ */
+typedef struct avl64tree_desc {
+	avl64node_t	*avl_root;
+	avl64node_t	*avl_firstino;
+	avl64ops_t	*avl_ops;
+} avl64tree_desc_t;
+
+/* possible values for avl_balance */
+
+#define AVL_BACK	1
+#define AVL_BALANCE	0
+#define AVL_FORW	2
+
+/*
+ * 'Exported' avl tree routines
+ */
+avl64node_t
+*avl64_insert(
+	avl64tree_desc_t *tree,
+	avl64node_t *newnode);
+
+void
+avl64_delete(
+	avl64tree_desc_t *tree,
+	avl64node_t *np);
+
+void
+avl64_insert_immediate(
+	avl64tree_desc_t *tree,
+	avl64node_t *afterp,
+	avl64node_t *newnode);
+
+avl64node_t *
+avl64_firstino(avl64node_t *root);
+
+avl64node_t *
+avl64_lastino(avl64node_t *root);
+
+void
+avl64_init_tree(
+	avl64tree_desc_t  *tree,
+	avl64ops_t *ops);
+
+avl64node_t *
+avl64_findrange(
+	avl64tree_desc_t *tree,
+	uint64_t value);
+
+avl64node_t *
+avl64_find(
+	avl64tree_desc_t *tree,
+	uint64_t value);
+
+avl64node_t *
+avl64_findanyrange(
+	avl64tree_desc_t *tree,
+	uint64_t	start,
+	uint64_t	end,
+	int     checklen);
+
+
+avl64node_t *
+avl64_findadjacent(
+	avl64tree_desc_t *tree,
+	uint64_t	value,
+	int		dir);
+
+void
+avl64_findranges(
+	avl64tree_desc_t *tree,
+	uint64_t	start,
+	uint64_t	end,
+	avl64node_t	        **startp,
+	avl64node_t		**endp);
+
+/*
+ * avoid complaints about multiple def's since these are only used by
+ * the avl code internally
+ */
+#ifndef AVL_PRECEED
+#define AVL_PRECEED	0x1
+#define AVL_SUCCEED	0x2
+
+#define AVL_INCLUDE_ZEROLEN	0x0000
+#define AVL_EXCLUDE_ZEROLEN	0x0001
+#endif
+
+#endif /* __LIBFROG_AVL64_H__ */
diff --git a/repair/incore_ext.c b/repair/incore_ext.c
index e7ef9eb2..7292f5dc 100644
--- a/repair/incore_ext.c
+++ b/repair/incore_ext.c
@@ -12,7 +12,7 @@
 #include "agheader.h"
 #include "protos.h"
 #include "err_protos.h"
-#include "avl64.h"
+#include "libfrog/avl64.h"
 #include "threads.h"
 
 /*
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index e414c4fb..d7e70dd0 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -9,7 +9,7 @@
 #include <sys/resource.h>
 #include "xfs_multidisk.h"
 #include "avl.h"
-#include "avl64.h"
+#include "libfrog/avl64.h"
 #include "globals.h"
 #include "versions.h"
 #include "agheader.h"
diff --git a/scrub/phase1.c b/scrub/phase1.c
index 81b0990d..6d1cbe25 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -19,7 +19,7 @@
 #include "path.h"
 #include "handle.h"
 #include "bitops.h"
-#include "avl64.h"
+#include "libfrog/avl64.h"
 #include "list.h"
 #include "xfs_scrub.h"
 #include "common.h"


  parent reply	other threads:[~2019-09-04  5:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  4:35 [PATCH 00/12] libfrog: move header files Darrick J. Wong
2019-09-04  4:35 ` [PATCH 01/12] libxfs: move topology declarations into separate header Darrick J. Wong
2019-09-04 23:24   ` Dave Chinner
2019-09-04  4:35 ` Darrick J. Wong [this message]
2019-09-04 23:25   ` [PATCH 02/12] libfrog: move avl64.h to libfrog/ Dave Chinner
2019-09-04  4:36 ` [PATCH 03/12] libfrog: move bitmap.h " Darrick J. Wong
2019-09-04 23:28   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 04/12] libfrog: move convert.h " Darrick J. Wong
2019-09-04 23:28   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 05/12] libfrog: move fsgeom.h " Darrick J. Wong
2019-09-04 23:32   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 06/12] libfrog: move ptvar.h " Darrick J. Wong
2019-09-04 23:32   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 07/12] libfrog: move radix-tree.h " Darrick J. Wong
2019-09-04 23:33   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 08/12] libfrog: move workqueue.h " Darrick J. Wong
2019-09-04 23:34   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 09/12] libfrog: move crc32c.h " Darrick J. Wong
2019-09-04 23:37   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 10/12] libfrog: move path.h " Darrick J. Wong
2019-09-04 23:39   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 11/12] libfrog: move workqueue.h " Darrick J. Wong
2019-09-04 23:40   ` Dave Chinner
2019-09-04  4:36 ` [PATCH 12/12] libfrog: move libfrog.h to libfrog/util.h Darrick J. Wong
2019-09-04 23:43   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=156757175652.1838135.13049266190478520193.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.