summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-01 00:45:59 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-01 00:45:59 +0000
commitf4b377415b4b53722addedc10801db24ad4e6f23 (patch)
treebe8f09aeabfeaf2361d8d84e975c49ec68d96483
parent09b414e880b0c2e4ae08d82354bbae034dafdd9e (diff)
Reorganize /include/ to add a /sys/, this way we don't need to
muck with #includes in existing Solaris style source to get it to find the right stuff. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@18 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
-rw-r--r--cmd/Makefile.am4
-rw-r--r--cmd/splat.h2
-rw-r--r--configure.ac3
-rw-r--r--include/Makefile.am10
-rw-r--r--include/spl.h19
-rw-r--r--include/splat-ctl.h67
-rw-r--r--include/sys/Makefile.am5
-rw-r--r--include/sys/callb.h (renamed from include/spl-callb.h)2
-rw-r--r--include/sys/cmn_err.h4
-rw-r--r--include/sys/condvar.h (renamed from include/spl-condvar.h)0
-rw-r--r--include/sys/cred.h (renamed from include/spl-cred.h)0
-rw-r--r--include/sys/debug.h4
-rw-r--r--include/sys/generic.h (renamed from include/spl-generic.h)0
-rw-r--r--include/sys/kmem.h (renamed from include/spl-kmem.h)0
-rw-r--r--include/sys/kstat.h (renamed from include/spl-kstat.h)4
-rw-r--r--include/sys/mutex.h (renamed from include/spl-mutex.h)2
-rw-r--r--include/sys/param.h4
-rw-r--r--include/sys/random.h (renamed from include/spl-random.h)0
-rw-r--r--include/sys/rwlock.h (renamed from include/spl-rwlock.h)2
-rw-r--r--include/sys/spl.h19
-rw-r--r--include/sys/taskq.h (renamed from include/spl-taskq.h)2
-rw-r--r--include/sys/thread.h (renamed from include/spl-thread.h)4
-rw-r--r--include/sys/time.h (renamed from include/spl-time.h)2
-rw-r--r--include/sys/timer.h (renamed from include/spl-timer.h)0
-rw-r--r--include/sys/types.h (renamed from include/spl-types.h)0
-rw-r--r--lib/Makefile.am6
-rw-r--r--lib/list.c2
-rw-r--r--lib/list.h (renamed from include/list.h)0
-rw-r--r--modules/spl/spl-generic.c2
-rw-r--r--modules/spl/spl-kmem.c2
-rw-r--r--modules/spl/spl-rwlock.c2
-rw-r--r--modules/spl/spl-taskq.c2
-rw-r--r--modules/spl/spl-thread.c2
-rw-r--r--modules/splat/splat-internal.h2
34 files changed, 66 insertions, 113 deletions
diff --git a/cmd/Makefile.am b/cmd/Makefile.am
index 1a10fa808..d3d747797 100644
--- a/cmd/Makefile.am
+++ b/cmd/Makefile.am
@@ -1,6 +1,8 @@
+DEFAULT_INCLUDES = -I. -I.. -I../lib
AM_CFLAGS = -g -O2 -W -Wall -Wstrict-prototypes -Wshadow
-INCLUDES = -I$(top_srcdir)/include
+
sbin_PROGRAMS = splat
splat_SOURCES = splat.c
splat_LDFLAGS = $(top_builddir)/lib/libcommon.la
+
EXTRA_DIST = splat.h
diff --git a/cmd/splat.h b/cmd/splat.h
index 869805723..e4419def5 100644
--- a/cmd/splat.h
+++ b/cmd/splat.h
@@ -2,7 +2,7 @@
#define _SPLAT_H
#include "list.h"
-#include "splat-ctl.h"
+#include "../include/splat-ctl.h"
#define DEV_NAME "/dev/splatctl"
#define COLOR_BLACK "\033[0;30m"
diff --git a/configure.ac b/configure.ac
index 6b8dd7d36..9a7b103d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_INIT
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(spl, 0.0.1)
-AC_CONFIG_HEADERS([include/config.h])
+AC_CONFIG_HEADERS([config.h])
AC_PROG_INSTALL
AC_PROG_CC
@@ -115,6 +115,7 @@ AC_CONFIG_FILES([ Makefile
modules/spl/Makefile
modules/splat/Makefile
include/Makefile
+ include/sys/Makefile
scripts/Makefile
scripts/spl.spec
])
diff --git a/include/Makefile.am b/include/Makefile.am
index b84da9a8e..161a93a8d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,7 +1,3 @@
-EXTRA_DIST = spl.h
-EXTRA_DIST += spl-condvar.h spl-kmem.h spl-random.h spl-thread.h
-EXTRA_DIST += spl-types.h spl-cred.h spl-kstat.h spl-rwlock.h
-EXTRA_DIST += spl-time.h spl-callb.h spl-generic.h spl-mutex.h
-EXTRA_DIST += spl-taskq.h spl-timer.h
-EXTRA_DIST += splat-ctl.h
-EXTRA_DIST += list.h
+SUBDIRS = sys
+
+EXTRA_DIST = splat-ctl.h
diff --git a/include/spl.h b/include/spl.h
deleted file mode 100644
index d069fd94d..000000000
--- a/include/spl.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _SPL_H
-#define _SPL_H
-
-#include "spl-callb.h"
-#include "spl-condvar.h"
-#include "spl-cred.h"
-#include "spl-generic.h"
-#include "spl-kmem.h"
-#include "spl-kstat.h"
-#include "spl-mutex.h"
-#include "spl-random.h"
-#include "spl-rwlock.h"
-#include "spl-taskq.h"
-#include "spl-thread.h"
-#include "spl-time.h"
-#include "spl-timer.h"
-#include "spl-types.h"
-
-#endif /* _SPL_H */
diff --git a/include/splat-ctl.h b/include/splat-ctl.h
deleted file mode 100644
index d905340fb..000000000
--- a/include/splat-ctl.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _SPLAT_CTL_H
-#define _SPLAT_CTL_H
-
-/* Contains shared definitions which both the userspace
- * and kernelspace portions of splat must agree on.
- */
-
-#define SPLAT_MAJOR 229 /* XXX - Arbitrary */
-#define SPLAT_MINORS 1
-#define SPLAT_DEV "/dev/splatctl"
-
-#define SPLAT_NAME_SIZE 12
-#define SPLAT_DESC_SIZE 60
-
-typedef struct splat_user {
- char name[SPLAT_NAME_SIZE]; /* short name */
- char desc[SPLAT_DESC_SIZE]; /* short description */
- int id; /* unique numeric id */
-} splat_user_t;
-
-#define SPLAT_CFG_MAGIC 0x15263748U
-typedef struct splat_cfg {
- unsigned int cfg_magic; /* Unique magic */
- int cfg_cmd; /* Config command */
- int cfg_arg1; /* Config command arg 1 */
- int cfg_rc1; /* Config response 1 */
- union {
- struct {
- int size;
- splat_user_t descs[0];
- } splat_subsystems;
- struct {
- int size;
- splat_user_t descs[0];
- } splat_tests;
- } cfg_data;
-} splat_cfg_t;
-
-#define SPLAT_CMD_MAGIC 0x9daebfc0U
-typedef struct splat_cmd {
- unsigned int cmd_magic; /* Unique magic */
- int cmd_subsystem; /* Target subsystem */
- int cmd_test; /* Subsystem test */
- int cmd_data_size; /* Extra opaque data */
- char cmd_data_str[0]; /* Opaque data region */
-} splat_cmd_t;
-
-/* Valid ioctls */
-#define SPLAT_CFG _IOWR('f', 101, long)
-#define SPLAT_CMD _IOWR('f', 102, long)
-
-/* Valid configuration commands */
-#define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */
-#define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */
-#define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */
-#define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */
-#define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */
-#define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */
-
-/* Valid subsystem and test commands defined in each subsystem, we do
- * need to be careful to avoid colisions. That alone may argue to define
- * them all here, for now we just define the global error codes.
- */
-#define SPLAT_SUBSYSTEM_UNKNOWN 0xF00
-#define SPLAT_TEST_UNKNOWN 0xFFF
-
-#endif /* _SPLAT_CTL_H */
diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
new file mode 100644
index 000000000..c44748e02
--- /dev/null
+++ b/include/sys/Makefile.am
@@ -0,0 +1,5 @@
+EXTRA_DIST = callb.h cmn_err.h condvar.h cred.h
+EXTRA_DIST += debug.h generic.h kmem.h kstat.h
+EXTRA_DIST += mutex.h param.h random.h rwlock.h
+EXTRA_DIST += spl.h taskq.h thread.h time.h
+EXTRA_DIST += timer.h types.h
diff --git a/include/spl-callb.h b/include/sys/callb.h
index 98b966778..053ddf500 100644
--- a/include/spl-callb.h
+++ b/include/sys/callb.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
#include <linux/module.h>
-#include "spl-mutex.h"
+#include <sys/mutex.h>
#define DEBUG_CALLB
diff --git a/include/sys/cmn_err.h b/include/sys/cmn_err.h
new file mode 100644
index 000000000..44ccefc9f
--- /dev/null
+++ b/include/sys/cmn_err.h
@@ -0,0 +1,4 @@
+#ifndef _SPL_CMN_ERR_H
+#define _SPL_CMN_ERR_H
+
+#endif /* SPL_CMN_ERR_H */
diff --git a/include/spl-condvar.h b/include/sys/condvar.h
index 6a2060fd2..6a2060fd2 100644
--- a/include/spl-condvar.h
+++ b/include/sys/condvar.h
diff --git a/include/spl-cred.h b/include/sys/cred.h
index 0935a19fa..0935a19fa 100644
--- a/include/spl-cred.h
+++ b/include/sys/cred.h
diff --git a/include/sys/debug.h b/include/sys/debug.h
new file mode 100644
index 000000000..02f64c2cf
--- /dev/null
+++ b/include/sys/debug.h
@@ -0,0 +1,4 @@
+#ifndef _SPL_DEBUG_H
+#define _SPL_DEBUG_H
+
+#endif /* SPL_DEBUG_H */
diff --git a/include/spl-generic.h b/include/sys/generic.h
index 2d0989233..2d0989233 100644
--- a/include/spl-generic.h
+++ b/include/sys/generic.h
diff --git a/include/spl-kmem.h b/include/sys/kmem.h
index 89367c069..89367c069 100644
--- a/include/spl-kmem.h
+++ b/include/sys/kmem.h
diff --git a/include/spl-kstat.h b/include/sys/kstat.h
index cbef067d5..0b79a41c0 100644
--- a/include/spl-kstat.h
+++ b/include/sys/kstat.h
@@ -6,8 +6,8 @@ extern "C" {
#endif
#include <linux/module.h>
-#include "spl-types.h"
-#include "spl-time.h"
+#include <sys/types.h>
+#include <sys/time.h>
/* XXX - The minimum functionality here is stubbed out but nothing works. */
diff --git a/include/spl-mutex.h b/include/sys/mutex.h
index dec5dd7de..2db4a7f96 100644
--- a/include/spl-mutex.h
+++ b/include/sys/mutex.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
#include <linux/module.h>
-#include "spl-types.h"
+#include <sys/types.h>
/* See the "Big Theory Statement" in solaris mutex.c.
*
diff --git a/include/sys/param.h b/include/sys/param.h
new file mode 100644
index 000000000..f924006ef
--- /dev/null
+++ b/include/sys/param.h
@@ -0,0 +1,4 @@
+#ifndef _SPL_PARAM_H
+#define _SPL_PARAM_H
+
+#endif /* SPL_PARAM_H */
diff --git a/include/spl-random.h b/include/sys/random.h
index b7f83ce1a..b7f83ce1a 100644
--- a/include/spl-random.h
+++ b/include/sys/random.h
diff --git a/include/spl-rwlock.h b/include/sys/rwlock.h
index b04a4f0db..6c55ced98 100644
--- a/include/spl-rwlock.h
+++ b/include/sys/rwlock.h
@@ -5,7 +5,7 @@
#include <linux/slab.h>
#include <linux/rwsem.h>
#include <asm/current.h>
-#include "spl-types.h"
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
diff --git a/include/sys/spl.h b/include/sys/spl.h
new file mode 100644
index 000000000..7cc1cab58
--- /dev/null
+++ b/include/sys/spl.h
@@ -0,0 +1,19 @@
+#ifndef _SPL_H
+#define _SPL_H
+
+#include <sys/callb.h>
+#include <sys/condvar.h>
+#include <sys/cred.h>
+#include <sys/generic.h>
+#include <sys/kmem.h>
+#include <sys/kstat.h>
+#include <sys/mutex.h>
+#include <sys/random.h>
+#include <sys/rwlock.h>
+#include <sys/taskq.h>
+#include <sys/thread.h>
+#include <sys/time.h>
+#include <sys/timer.h>
+#include <sys/types.h>
+
+#endif /* _SPL_H */
diff --git a/include/spl-taskq.h b/include/sys/taskq.h
index 3723a6d47..2d7583daf 100644
--- a/include/spl-taskq.h
+++ b/include/sys/taskq.h
@@ -24,7 +24,7 @@ extern "C" {
#include <linux/gfp.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
-#include "spl-types.h"
+#include <sys/types.h>
#undef DEBUG_TASKQ_UNIMPLEMENTED
diff --git a/include/spl-thread.h b/include/sys/thread.h
index 8833846e9..e7f99c96d 100644
--- a/include/spl-thread.h
+++ b/include/sys/thread.h
@@ -8,8 +8,8 @@ extern "C" {
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
-#include "spl-types.h"
-#include "spl-generic.h"
+#include <sys/types.h>
+#include <sys/generic.h>
/*
* Thread interfaces
diff --git a/include/spl-time.h b/include/sys/time.h
index 576fd191c..726bd5f8a 100644
--- a/include/spl-time.h
+++ b/include/sys/time.h
@@ -12,7 +12,7 @@ extern "C" {
#include <linux/module.h>
#include <linux/time.h>
-#include "spl-types.h"
+#include <sys/types.h>
extern unsigned long long monotonic_clock(void);
typedef struct timespec timestruc_t; /* definition per SVr4 */
diff --git a/include/spl-timer.h b/include/sys/timer.h
index 237195d76..237195d76 100644
--- a/include/spl-timer.h
+++ b/include/sys/timer.h
diff --git a/include/spl-types.h b/include/sys/types.h
index b72b6c9e0..b72b6c9e0 100644
--- a/include/spl-types.h
+++ b/include/sys/types.h
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 91c228fb0..24ba72913 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,3 +1,7 @@
-INCLUDES = -I$(top_srcdir)/include
+DEFAULT_INCLUDES = -I. -I..
+AM_CFLAGS = -g -O2 -W -Wall -Wstrict-prototypes -Wshadow
+
noinst_LTLIBRARIES = libcommon.la
libcommon_la_SOURCES = list.c
+
+EXTRA_DIST = list.h
diff --git a/lib/list.c b/lib/list.c
index 6548cacbc..88af47c40 100644
--- a/lib/list.c
+++ b/lib/list.c
@@ -776,7 +776,7 @@ list_alloc_aux (int size, void *pfreelist)
void **plast;
assert(sizeof(char) == 1);
- assert(size >= sizeof(void *));
+ assert(size >= (int)sizeof(void *));
assert(pfreelist != NULL);
assert(LIST_ALLOC > 0);
list_mutex_lock(&list_free_lock);
diff --git a/include/list.h b/lib/list.h
index fe3fd006b..fe3fd006b 100644
--- a/include/list.h
+++ b/lib/list.h
diff --git a/modules/spl/spl-generic.c b/modules/spl/spl-generic.c
index 8a8435694..653b8cd1f 100644
--- a/modules/spl/spl-generic.c
+++ b/modules/spl/spl-generic.c
@@ -1,4 +1,4 @@
-#include "spl-generic.h"
+#include <sys/generic.h>
#include "config.h"
/*
diff --git a/modules/spl/spl-kmem.c b/modules/spl/spl-kmem.c
index 9b8ba26a7..6442d5824 100644
--- a/modules/spl/spl-kmem.c
+++ b/modules/spl/spl-kmem.c
@@ -1,4 +1,4 @@
-#include "spl-kmem.h"
+#include <sys/kmem.h>
/*
* Memory allocation interfaces
diff --git a/modules/spl/spl-rwlock.c b/modules/spl/spl-rwlock.c
index cafdd9b1c..d74d89e24 100644
--- a/modules/spl/spl-rwlock.c
+++ b/modules/spl/spl-rwlock.c
@@ -1,4 +1,4 @@
-#include <spl-rwlock.h>
+#include <sys/rwlock.h>
int
rw_lock_held(krwlock_t *rwlp)
diff --git a/modules/spl/spl-taskq.c b/modules/spl/spl-taskq.c
index d20ae59bd..0bfae5452 100644
--- a/modules/spl/spl-taskq.c
+++ b/modules/spl/spl-taskq.c
@@ -1,4 +1,4 @@
-#include <spl-taskq.h>
+#include <sys/taskq.h>
/*
* Task queue interface
diff --git a/modules/spl/spl-thread.c b/modules/spl/spl-thread.c
index b55f8c6af..40b1b316f 100644
--- a/modules/spl/spl-thread.c
+++ b/modules/spl/spl-thread.c
@@ -1,4 +1,4 @@
-#include <spl-thread.h>
+#include <sys/thread.h>
/*
* Thread interfaces
diff --git a/modules/splat/splat-internal.h b/modules/splat/splat-internal.h
index a64b711fe..d44c32463 100644
--- a/modules/splat/splat-internal.h
+++ b/modules/splat/splat-internal.h
@@ -18,7 +18,7 @@
#include <asm/uaccess.h>
#include <stdarg.h>
-#include "spl.h"
+#include <sys/spl.h>
#include "splat-ctl.h"
#define SPLAT_SUBSYSTEM_INIT(type) \