public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: move stubbed-out kernel functions out of xfs_shared.h
@ 2021-11-04  2:21 Eric Sandeen
  2021-11-04  2:28 ` Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eric Sandeen @ 2021-11-04  2:21 UTC (permalink / raw)
  To: xfs; +Cc: Darrick J. Wong

Move kernel stubs out of libxfs/xfs_shared.h, which is kernel
libxfs code and should not have userspace shims in it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/include/libxfs.h b/include/libxfs.h
index 24424d0e..64b44af8 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -11,6 +11,7 @@
  #include "platform_defs.h"
  #include "xfs.h"
  
+#include "stubs.h"
  #include "list.h"
  #include "hlist.h"
  #include "cache.h"
diff --git a/include/stubs.h b/include/stubs.h
new file mode 100644
index 00000000..41eaa0c4
--- /dev/null
+++ b/include/stubs.h
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/*
+ * Stub out unimplemented and unneeded kernel structures etc
+ */
+#ifndef STUBS_H
+#define STUBS_H
+
+struct rb_root {
+};
+
+#define RB_ROOT 		(struct rb_root) { }
+
+typedef struct wait_queue_head {
+} wait_queue_head_t;
+
+#define init_waitqueue_head(wqh)	do { } while(0)
+
+struct rhashtable {
+};
+
+struct delayed_work {
+};
+
+#define INIT_DELAYED_WORK(work, func)	do { } while(0)
+#define cancel_delayed_work_sync(work)	do { } while(0)
+
+#endif
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 15bae1ff..32271c66 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -41,6 +41,7 @@
  #include "platform_defs.h"
  #include "xfs.h"
  
+#include "stubs.h"
  #include "list.h"
  #include "hlist.h"
  #include "cache.h"
diff --git a/libxfs/xfs_shared.h b/libxfs/xfs_shared.h
index bafee48c..25c4cab5 100644
--- a/libxfs/xfs_shared.h
+++ b/libxfs/xfs_shared.h
@@ -180,24 +180,4 @@ struct xfs_ino_geometry {
  
  };
  
-/* Faked up kernel bits */
-struct rb_root {
-};
-
-#define RB_ROOT 		(struct rb_root) { }
-
-typedef struct wait_queue_head {
-} wait_queue_head_t;
-
-#define init_waitqueue_head(wqh)	do { } while(0)
-
-struct rhashtable {
-};
-
-struct delayed_work {
-};
-
-#define INIT_DELAYED_WORK(work, func)	do { } while(0)
-#define cancel_delayed_work_sync(work)	do { } while(0)
-
  #endif /* __XFS_SHARED_H__ */


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-11-07 22:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04  2:21 [PATCH] xfsprogs: move stubbed-out kernel functions out of xfs_shared.h Eric Sandeen
2021-11-04  2:28 ` Darrick J. Wong
2021-11-04  2:55   ` Eric Sandeen
2021-11-04  2:59 ` [PATCH V2] " Eric Sandeen
2021-11-04  3:14   ` Darrick J. Wong
2021-11-04  3:33     ` Eric Sandeen
2021-11-04 17:15 ` [PATCH V3 RFC] xfsprogs: remove stubbed-out kernel functions out from xfs_shared.h Eric Sandeen
2021-11-04 19:08   ` Darrick J. Wong
2021-11-04 22:38   ` Dave Chinner
2021-11-05 16:40     ` Eric Sandeen
2021-11-07 22:58       ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox