]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libfrog: create header file for mocked-up kernel data structures
authorDarrick J. Wong <djwong@kernel.org>
Tue, 13 Jul 2021 16:09:39 +0000 (09:09 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 21:12:09 +0000 (14:12 -0700)
Create a mockups.h for mocked-up versions of kernel data structures to
ease porting of libxfs code.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
include/libxfs.h
libfrog/Makefile
libfrog/mockups.h [new file with mode: 0644]
libxfs/libxfs_priv.h

index 36ae86cc0df994341e50af9402378f04835a25c2..c297152f47e92b55fa1cb82866a3ef7af3f4aeb0 100644 (file)
@@ -17,6 +17,7 @@
 #include "bitops.h"
 #include "kmem.h"
 #include "libfrog/radix-tree.h"
+#include "libfrog/mockups.h"
 #include "atomic.h"
 
 #include "xfs_types.h"
index 0110708239a8c2818872d5f8c12b2965ac77da0c..5381d9b54a887b2b505cc904cbc58a2b6a9ec719 100644 (file)
@@ -41,6 +41,7 @@ crc32defs.h \
 crc32table.h \
 fsgeom.h \
 logging.h \
+mockups.h \
 paths.h \
 projects.h \
 ptvar.h \
diff --git a/libfrog/mockups.h b/libfrog/mockups.h
new file mode 100644 (file)
index 0000000..f00a9e4
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2000-2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ */
+#ifndef __LIBFROG_MOCKUPS_H__
+#define __LIBFROG_MOCKUPS_H__
+
+/* Mockups of kernel data structures. */
+
+typedef struct spinlock {
+} spinlock_t;
+
+#define spin_lock_init(lock)   ((void) 0)
+
+#define spin_lock(a)           ((void) 0)
+#define spin_unlock(a)         ((void) 0)
+
+#endif /* __LIBFROG_MOCKUPS_H__ */
index 7181a858931224f6af4374e4fd85c612450139aa..727f6be865d9ab5fb92c141c9f0115b69c11dc10 100644 (file)
@@ -47,6 +47,7 @@
 #include "bitops.h"
 #include "kmem.h"
 #include "libfrog/radix-tree.h"
+#include "libfrog/mockups.h"
 #include "atomic.h"
 
 #include "xfs_types.h"
@@ -205,9 +206,6 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
 #endif
 
 /* miscellaneous kernel routines not in user space */
-#define spin_lock_init(a)      ((void) 0)
-#define spin_lock(a)           ((void) 0)
-#define spin_unlock(a)         ((void) 0)
 #define likely(x)              (x)
 #define unlikely(x)            (x)
 #define rcu_read_lock()                ((void) 0)