[Ocfs2-tools-devel] [PATCH 4/4] includes: Move public ocfs2 headers to the new location.

Joel Becker Joel.Becker at oracle.com
Tue Jan 8 12:43:35 PST 2008


[ Whoops, missed a dist header here too ]

includes: Move public ocfs2 headers to the new location.

The public headers for libocfs2 now live at $(TOPDIR)/include/ocfs2.
All programs have been modified to explicitly include <ocfs2/ocfs2.h>.
This removes the need for specifying a separate include path for ocfs2,
as well as the OCFS2_FLAT_INCLUDES define.

In addition, the private libocfs2 headers have been moved directly into
the libocfs2 directly, so that they are easier to manage with the
libocfs2 sources.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 debugfs.ocfs2/Makefile                             |    4 +-
 debugfs.ocfs2/commands.c                           |    4 ++-
 debugfs.ocfs2/dump.c                               |    4 ++-
 debugfs.ocfs2/dump_fs_locks.c                      |    2 +-
 debugfs.ocfs2/find_block_inode.c                   |    2 +-
 debugfs.ocfs2/find_inode_paths.c                   |    2 +-
 debugfs.ocfs2/include/journal.h                    |    2 -
 debugfs.ocfs2/include/main.h                       |    2 +-
 debugfs.ocfs2/journal.c                            |    2 +-
 debugfs.ocfs2/main.c                               |    2 +-
 debugfs.ocfs2/utils.c                              |    4 +-
 extras/Makefile                                    |    4 +--
 extras/compute_groups.c                            |    2 +-
 extras/find_allocation_fragments.c                 |    4 +-
 extras/find_dup_extents.c                          |    2 +-
 extras/find_hardlinks.c                            |    2 +-
 extras/find_inode_paths.c                          |    2 +-
 extras/mark_journal_dirty.c                        |    3 +-
 extras/set_random_bits.c                           |    2 +-
 fsck.ocfs2/Makefile                                |    3 +-
 fsck.ocfs2/dirblocks.c                             |    2 +-
 fsck.ocfs2/dirparents.c                            |    2 +-
 fsck.ocfs2/extent.c                                |    2 +-
 fsck.ocfs2/fsck.c                                  |    2 +-
 fsck.ocfs2/icount.c                                |    2 +-
 fsck.ocfs2/include/dirblocks.h                     |    3 +-
 fsck.ocfs2/include/dirparents.h                    |    2 +
 fsck.ocfs2/include/icount.h                        |    3 +-
 fsck.ocfs2/include/strings.h                       |    3 +-
 fsck.ocfs2/journal.c                               |    5 ++-
 fsck.ocfs2/pass0.c                                 |    4 +-
 fsck.ocfs2/pass1.c                                 |    4 +-
 fsck.ocfs2/pass2.c                                 |    2 +-
 fsck.ocfs2/pass3.c                                 |    2 +-
 fsck.ocfs2/pass4.c                                 |    2 +-
 fsck.ocfs2/problem.c                               |    2 +-
 fsck.ocfs2/strings.c                               |    2 +-
 fsck.ocfs2/util.c                                  |    2 +-
 fswreck/Makefile                                   |    4 +-
 fswreck/chain.c                                    |    2 +-
 fswreck/corrupt.c                                  |    2 +-
 fswreck/dir.c                                      |    2 +-
 fswreck/extent.c                                   |    2 +-
 fswreck/group.c                                    |    2 +-
 fswreck/include/main.h                             |    2 +-
 fswreck/inode.c                                    |    2 +-
 fswreck/local_alloc.c                              |    2 +-
 fswreck/main.c                                     |    2 +-
 fswreck/special.c                                  |    2 +-
 fswreck/symlink.c                                  |    2 +-
 fswreck/truncate_log.c                             |    2 +-
 include/Makefile                                   |    2 +-
 {libocfs2/include => include/ocfs2}/.gitignore     |    0 
 include/ocfs2/Makefile                             |   27 +++++++++++++++
 {libocfs2/include => include/ocfs2}/bitops.h       |    0 
 {libocfs2/include => include/ocfs2}/byteorder.h    |    0 
 .../include => include/ocfs2}/feature_string.h     |    2 +-
 {libocfs2/include => include/ocfs2}/jbd.h          |    0 
 .../include => include/ocfs2}/kernel-rbtree.h      |    0 
 {libocfs2/include => include/ocfs2}/ocfs2.h        |   11 ------
 libo2cb/Makefile                                   |    2 +-
 libocfs2/Makefile                                  |   36 +++++---------------
 libocfs2/alloc.c                                   |    2 +-
 libocfs2/backup_super.c                            |    2 +-
 libocfs2/bitmap.c                                  |    5 +--
 libocfs2/{include => }/bitmap.h                    |    2 +-
 libocfs2/bitops.c                                  |    2 +-
 libocfs2/cached_inode.c                            |    2 +-
 libocfs2/chain.c                                   |    4 ++-
 libocfs2/chainalloc.c                              |    5 +--
 libocfs2/checkhb.c                                 |    3 +-
 libocfs2/closefs.c                                 |    2 +-
 libocfs2/dir_iterate.c                             |    2 +-
 libocfs2/{include => }/dir_iterate.h               |    0 
 libocfs2/dir_scan.c                                |    2 +-
 libocfs2/{include => }/dir_util.h                  |    0 
 libocfs2/dirblock.c                                |    3 +-
 libocfs2/dlm.c                                     |    2 +-
 libocfs2/{include => }/dlm.h                       |    0 
 libocfs2/expanddir.c                               |    2 +-
 libocfs2/extend_file.c                             |    2 +-
 libocfs2/extent_map.c                              |    2 +-
 libocfs2/{include => }/extent_map.h                |    2 +-
 libocfs2/extents.c                                 |    3 +-
 libocfs2/feature_string.c                          |    2 +-
 libocfs2/fileio.c                                  |    2 +-
 libocfs2/freefs.c                                  |    2 +-
 libocfs2/getsectsize.c                             |    2 +-
 libocfs2/getsize.c                                 |    2 +-
 libocfs2/heartbeat.c                               |    3 +-
 libocfs2/inode.c                                   |    3 +-
 libocfs2/inode_scan.c                              |    2 +-
 libocfs2/ismounted.c                               |    2 +-
 libocfs2/kernel-rbtree.c                           |    2 +-
 libocfs2/link.c                                    |    2 +-
 libocfs2/lockid.c                                  |    2 +-
 libocfs2/lookup.c                                  |    2 +-
 libocfs2/memory.c                                  |    2 +-
 libocfs2/mkjournal.c                               |    4 +-
 libocfs2/namei.c                                   |    2 +-
 libocfs2/newdir.c                                  |    2 +-
 libocfs2/openfs.c                                  |    4 +-
 libocfs2/slot_map.c                                |    3 +-
 libocfs2/sysfile.c                                 |    2 +-
 libocfs2/truncate.c                                |    2 +-
 libocfs2/unix_io.c                                 |    4 ++-
 libocfs2/unlink.c                                  |    2 +-
 listuuid/Makefile                                  |    4 +--
 listuuid/listuuid.c                                |    4 +--
 mkfs.ocfs2/Makefile                                |    5 +--
 mkfs.ocfs2/mkfs.h                                  |   12 ++-----
 mount.ocfs2/Makefile                               |    4 +-
 mount.ocfs2/mount.ocfs2.h                          |    5 +--
 mounted.ocfs2/Makefile                             |    4 +-
 mounted.ocfs2/mounted.c                            |    3 +-
 o2cb_ctl/Makefile                                  |    2 +-
 ocfs2_hb_ctl/Makefile                              |    4 +-
 ocfs2_hb_ctl/ocfs2_hb_ctl.c                        |    2 +-
 ocfs2cdsl/Makefile                                 |    4 +--
 ocfs2cdsl/ocfs2cdsl.c                              |    2 +-
 ocfs2console/ocfs2interface/Makefile               |    5 +--
 ocfs2console/ocfs2interface/ocfs2module.c          |    2 +-
 ocfs2console/ocfs2interface/ocfsplist.c            |    2 +-
 sizetest/Makefile                                  |    4 +-
 sizetest/sizetest.c                                |    2 +-
 tunefs.ocfs2/Makefile                              |    4 +-
 tunefs.ocfs2/features.c                            |    2 +-
 tunefs.ocfs2/remove_slot.c                         |    2 -
 tunefs.ocfs2/sparse_file.c                         |    2 +-
 tunefs.ocfs2/tunefs.c                              |    2 +-
 tunefs.ocfs2/tunefs.h                              |    6 +--
 131 files changed, 195 insertions(+), 205 deletions(-)

diff --git a/debugfs.ocfs2/Makefile b/debugfs.ocfs2/Makefile
index 78ef6e5..10782ef 100644
--- a/debugfs.ocfs2/Makefile
+++ b/debugfs.ocfs2/Makefile
@@ -6,9 +6,9 @@ sbindir = $(root_sbindir)
 SBIN_PROGRAMS = debugfs.ocfs2
 
 DEFINES = -DG_DISABLE_DEPRECATED -DLINUX -DDEBUGOCFS -DDEBUG
-DEFINES += -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+DEFINES += -DVERSION=\"$(VERSION)\"
 
-INCLUDES = -I$(TOPDIR)/include -Iinclude -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include -Iinclude
 INCLUDES += $(GLIB_CFLAGS)
 
 ifdef OCFS2_DEBUG
diff --git a/debugfs.ocfs2/commands.c b/debugfs.ocfs2/commands.c
index 5bad208..ed93759 100644
--- a/debugfs.ocfs2/commands.c
+++ b/debugfs.ocfs2/commands.c
@@ -23,7 +23,9 @@
  * Authors: Sunil Mushran, Manish Singh
  */
 
-#include <main.h>
+#include "main.h"
+#include "ocfs2/byteorder.h"
+
 #define SYSTEM_FILE_NAME_MAX	40
 #define MAX_BLOCKS		50
 
diff --git a/debugfs.ocfs2/dump.c b/debugfs.ocfs2/dump.c
index 49547f6..91c34d3 100644
--- a/debugfs.ocfs2/dump.c
+++ b/debugfs.ocfs2/dump.c
@@ -23,9 +23,11 @@
  * Authors: Sunil Mushran
  */
 
-#include <main.h>
 #include <stdint.h>
 
+#include "main.h"
+#include "ocfs2/byteorder.h"
+
 extern dbgfs_gbls gbls;
 
 /*
diff --git a/debugfs.ocfs2/dump_fs_locks.c b/debugfs.ocfs2/dump_fs_locks.c
index 047fb1f..74423eb 100644
--- a/debugfs.ocfs2/dump_fs_locks.c
+++ b/debugfs.ocfs2/dump_fs_locks.c
@@ -38,7 +38,7 @@
 #include <stdio.h>
 
 #include "main.h"
-#include "byteorder.h"
+#include "ocfs2/byteorder.h"
 #include "ocfs2_internals.h"
 
 static char *level_str(int level)
diff --git a/debugfs.ocfs2/find_block_inode.c b/debugfs.ocfs2/find_block_inode.c
index 121887c..1a708a8 100644
--- a/debugfs.ocfs2/find_block_inode.c
+++ b/debugfs.ocfs2/find_block_inode.c
@@ -23,7 +23,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern dbgfs_gbls gbls;
 
diff --git a/debugfs.ocfs2/find_inode_paths.c b/debugfs.ocfs2/find_inode_paths.c
index 9e85a35..e2d0e7d 100644
--- a/debugfs.ocfs2/find_inode_paths.c
+++ b/debugfs.ocfs2/find_inode_paths.c
@@ -25,7 +25,7 @@
  *  Copyright (C) 1993, 1994, 1994, 1995, 1996, 1997 Theodore Ts'o.
  */
 
-#include <main.h>
+#include "main.h"
 
 struct walk_path {
 	char *argv0;
diff --git a/debugfs.ocfs2/include/journal.h b/debugfs.ocfs2/include/journal.h
index b69e7ea..3825bbe 100644
--- a/debugfs.ocfs2/include/journal.h
+++ b/debugfs.ocfs2/include/journal.h
@@ -26,8 +26,6 @@
 #ifndef _JOURNAL_H_
 #define _JOURNAL_H_
 
-#include <jbd.h>
-
 errcode_t read_journal(ocfs2_filesys *fs, uint64_t blkno, FILE *out);
 int detect_block (char *buf);
 
diff --git a/debugfs.ocfs2/include/main.h b/debugfs.ocfs2/include/main.h
index b4ed99d..f0e0c2b 100644
--- a/debugfs.ocfs2/include/main.h
+++ b/debugfs.ocfs2/include/main.h
@@ -56,7 +56,7 @@
 
 #include <linux/types.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 #include "ocfs2-kernel/ocfs1_fs_compat.h"
 
 enum {
diff --git a/debugfs.ocfs2/journal.c b/debugfs.ocfs2/journal.c
index d692554..5f02e2a 100644
--- a/debugfs.ocfs2/journal.c
+++ b/debugfs.ocfs2/journal.c
@@ -23,7 +23,7 @@
  * Authors: Sunil Mushran, Mark Fasheh
  */
 
-#include <main.h>
+#include "main.h"
 
 extern dbgfs_gbls gbls;
 
diff --git a/debugfs.ocfs2/main.c b/debugfs.ocfs2/main.c
index 1f646c3..30846fe 100644
--- a/debugfs.ocfs2/main.c
+++ b/debugfs.ocfs2/main.c
@@ -23,7 +23,7 @@
  * Authors: Sunil Mushran, Manish Singh
  */
 
-#include <main.h>
+#include "main.h"
 #include <sys/types.h>
 #include <dirent.h>
 
diff --git a/debugfs.ocfs2/utils.c b/debugfs.ocfs2/utils.c
index 7d91bb4..a980362 100644
--- a/debugfs.ocfs2/utils.c
+++ b/debugfs.ocfs2/utils.c
@@ -23,8 +23,8 @@
  * Authors: Sunil Mushran
  */
 
-#include <main.h>
-#include <bitops.h>
+#include "main.h"
+#include "ocfs2/bitops.h"
 
 extern dbgfs_gbls gbls;
 
diff --git a/extras/Makefile b/extras/Makefile
index dab57b4..bbdd813 100644
--- a/extras/Makefile
+++ b/extras/Makefile
@@ -13,12 +13,10 @@ CFLAGS = $(OPTS) $(WARNINGS)
 
 UNINST_PROGRAMS = find_hardlinks find_dup_extents find_inode_paths set_random_bits decode_lockres encode_lockres mark_journal_dirty find_allocation_fragments compute_groups
 
-INCLUDES = -I$(TOPDIR)/include -I../libocfs2/include
+INCLUDES = -I$(TOPDIR)/include
 
 OPTIMIZE = -O2
 
-DEFINES += -DOCFS2_FLAT_INCLUDES
-
 CFLAGS += $(OPTIMIZE)
 
 FIND_HARDLINKS_CFILES = find_hardlinks.c
diff --git a/extras/compute_groups.c b/extras/compute_groups.c
index 5c9a66a..e56fc33 100644
--- a/extras/compute_groups.c
+++ b/extras/compute_groups.c
@@ -32,7 +32,7 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #define TWO_TERA	2199023255552LL
 
diff --git a/extras/find_allocation_fragments.c b/extras/find_allocation_fragments.c
index d5ae360..439a8e7 100644
--- a/extras/find_allocation_fragments.c
+++ b/extras/find_allocation_fragments.c
@@ -33,8 +33,8 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
-#include "bitops.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 
 struct fragment {
 	uint64_t f_group_blkno;
diff --git a/extras/find_dup_extents.c b/extras/find_dup_extents.c
index dc887ad..1ce0f11 100644
--- a/extras/find_dup_extents.c
+++ b/extras/find_dup_extents.c
@@ -34,7 +34,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 static void print_usage(void)
 {
diff --git a/extras/find_hardlinks.c b/extras/find_hardlinks.c
index 492763e..cef0c90 100644
--- a/extras/find_hardlinks.c
+++ b/extras/find_hardlinks.c
@@ -35,7 +35,7 @@
 #include <getopt.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 static void print_usage(void)
 {
diff --git a/extras/find_inode_paths.c b/extras/find_inode_paths.c
index 5d0b66f..ea8942a 100644
--- a/extras/find_inode_paths.c
+++ b/extras/find_inode_paths.c
@@ -36,7 +36,7 @@
 #include <getopt.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 static void print_usage(void)
 {
diff --git a/extras/mark_journal_dirty.c b/extras/mark_journal_dirty.c
index c287abb..18ab63a 100644
--- a/extras/mark_journal_dirty.c
+++ b/extras/mark_journal_dirty.c
@@ -32,7 +32,8 @@
 #include <getopt.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 static int debug = 0;
 
diff --git a/extras/set_random_bits.c b/extras/set_random_bits.c
index 23c1813..96de5e8 100644
--- a/extras/set_random_bits.c
+++ b/extras/set_random_bits.c
@@ -34,7 +34,7 @@
 #include <inttypes.h>
 #include <string.h>
 #include <stdint.h>
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 static uint64_t read_number(const char *num)
 {
diff --git a/fsck.ocfs2/Makefile b/fsck.ocfs2/Makefile
index 9feac20..fe34e37 100644
--- a/fsck.ocfs2/Makefile
+++ b/fsck.ocfs2/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/Preamble.make
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = fsck.ocfs2
 
-INCLUDES = -I$(TOPDIR)/include -Iinclude -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include -Iinclude
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
 LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm
@@ -26,7 +26,6 @@ endif
 CFLAGS := $(OPTS) -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
-DEFINES = -DOCFS2_FLAT_INCLUDES
 
 CFILES =	fsck.c		\
 		dirblocks.c 	\
diff --git a/fsck.ocfs2/dirblocks.c b/fsck.ocfs2/dirblocks.c
index 4173682..afabc11 100644
--- a/fsck.ocfs2/dirblocks.c
+++ b/fsck.ocfs2/dirblocks.c
@@ -28,7 +28,7 @@
 #include <stdarg.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "fsck.h"
 #include "dirblocks.h"
diff --git a/fsck.ocfs2/dirparents.c b/fsck.ocfs2/dirparents.c
index e319f3c..694e30c 100644
--- a/fsck.ocfs2/dirparents.c
+++ b/fsck.ocfs2/dirparents.c
@@ -30,7 +30,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "fsck.h"
 #include "dirparents.h"
diff --git a/fsck.ocfs2/extent.c b/fsck.ocfs2/extent.c
index ee79a1c..718719a 100644
--- a/fsck.ocfs2/extent.c
+++ b/fsck.ocfs2/extent.c
@@ -37,7 +37,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "extent.h"
 #include "fsck.h"
diff --git a/fsck.ocfs2/fsck.c b/fsck.ocfs2/fsck.c
index e4c9105..c738c16 100644
--- a/fsck.ocfs2/fsck.c
+++ b/fsck.ocfs2/fsck.c
@@ -53,7 +53,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "fsck.h"
 #include "icount.h"
diff --git a/fsck.ocfs2/icount.c b/fsck.ocfs2/icount.c
index 1d770b5..858063a 100644
--- a/fsck.ocfs2/icount.c
+++ b/fsck.ocfs2/icount.c
@@ -29,7 +29,7 @@
 #include <stdarg.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "fsck.h"
 #include "icount.h"
diff --git a/fsck.ocfs2/include/dirblocks.h b/fsck.ocfs2/include/dirblocks.h
index a3904ac..cdd9741 100644
--- a/fsck.ocfs2/include/dirblocks.h
+++ b/fsck.ocfs2/include/dirblocks.h
@@ -24,7 +24,8 @@
 #ifndef __O2FSCK_DIRBLOCKS_H__
 #define __O2FSCK_DIRBLOCKS_H__
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/kernel-rbtree.h"
 
 typedef struct _o2fsck_dirblocks {
 	struct rb_root	db_root;
diff --git a/fsck.ocfs2/include/dirparents.h b/fsck.ocfs2/include/dirparents.h
index fd796e9..8f85ca9 100644
--- a/fsck.ocfs2/include/dirparents.h
+++ b/fsck.ocfs2/include/dirparents.h
@@ -24,6 +24,8 @@
 #ifndef __O2FSCK_DIRPARENTS_H__
 #define __O2FSCK_DIRPARENTS_H__
 
+#include "ocfs2/kernel-rbtree.h"
+
 typedef struct _o2fsck_dir_parent {
 	struct rb_node	dp_node;
 	uint64_t 	dp_ino; /* The dir inode in question. */
diff --git a/fsck.ocfs2/include/icount.h b/fsck.ocfs2/include/icount.h
index 5a52ece..ae73e6e 100644
--- a/fsck.ocfs2/include/icount.h
+++ b/fsck.ocfs2/include/icount.h
@@ -24,7 +24,8 @@
 #ifndef __O2FSCK_ICOUNT_H__
 #define __O2FSCK_ICOUNT_H__
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/kernel-rbtree.h"
 
 typedef struct _o2fsck_icount {
 	ocfs2_bitmap	*ic_single_bm;
diff --git a/fsck.ocfs2/include/strings.h b/fsck.ocfs2/include/strings.h
index 2196dc5..22be678 100644
--- a/fsck.ocfs2/include/strings.h
+++ b/fsck.ocfs2/include/strings.h
@@ -24,7 +24,8 @@
 #ifndef __O2FSCK_STRINGS_H__
 #define __O2FSCK_STRINGS_H__
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/kernel-rbtree.h"
 
 typedef struct _o2fsck_strings {
 	struct rb_root	s_root;
diff --git a/fsck.ocfs2/journal.c b/fsck.ocfs2/journal.c
index 8ce8f9d..d9846ba 100644
--- a/fsck.ocfs2/journal.c
+++ b/fsck.ocfs2/journal.c
@@ -41,10 +41,11 @@
 #include <string.h>
 #include <inttypes.h>
 
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
+
 #include "fsck.h"
 #include "journal.h"
-#include "jbd.h"
-#include "ocfs2.h"
 #include "pass1.h"
 #include "problem.h"
 #include "util.h"
diff --git a/fsck.ocfs2/pass0.c b/fsck.ocfs2/pass0.c
index d53c76d..add7721 100644
--- a/fsck.ocfs2/pass0.c
+++ b/fsck.ocfs2/pass0.c
@@ -49,8 +49,8 @@
 #include <inttypes.h>
 #include <time.h>
 
-#include "ocfs2.h"
-#include "bitops.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 
 #include "dirblocks.h"
 #include "dirparents.h"
diff --git a/fsck.ocfs2/pass1.c b/fsck.ocfs2/pass1.c
index c5bbf5b..6e739ad 100644
--- a/fsck.ocfs2/pass1.c
+++ b/fsck.ocfs2/pass1.c
@@ -54,8 +54,8 @@
 #include <inttypes.h>
 #include <time.h>
 
-#include "ocfs2.h"
-#include "bitops.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 
 #include "dirblocks.h"
 #include "dirparents.h"
diff --git a/fsck.ocfs2/pass2.c b/fsck.ocfs2/pass2.c
index 2243807..ba357b4 100644
--- a/fsck.ocfs2/pass2.c
+++ b/fsck.ocfs2/pass2.c
@@ -35,7 +35,7 @@
 #include <inttypes.h>
 #include <time.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "dirparents.h"
 #include "icount.h"
diff --git a/fsck.ocfs2/pass3.c b/fsck.ocfs2/pass3.c
index 488491f..f546a72 100644
--- a/fsck.ocfs2/pass3.c
+++ b/fsck.ocfs2/pass3.c
@@ -33,7 +33,7 @@
 #include <string.h>
 #include <limits.h>
 
-#include <ocfs2.h>
+#include "ocfs2/ocfs2.h"
 
 #include "dirparents.h"
 #include "fsck.h"
diff --git a/fsck.ocfs2/pass4.c b/fsck.ocfs2/pass4.c
index 64373e0..505ff70 100644
--- a/fsck.ocfs2/pass4.c
+++ b/fsck.ocfs2/pass4.c
@@ -29,7 +29,7 @@
 #include <inttypes.h>
 #include <limits.h>
 
-#include <ocfs2.h>
+#include "ocfs2/ocfs2.h"
 
 #include "fsck.h"
 #include "icount.h"
diff --git a/fsck.ocfs2/problem.c b/fsck.ocfs2/problem.c
index fd6b608..0052939 100644
--- a/fsck.ocfs2/problem.c
+++ b/fsck.ocfs2/problem.c
@@ -36,7 +36,7 @@
 #include <ctype.h>
 #include <signal.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "problem.h"
 #include "util.h"
diff --git a/fsck.ocfs2/strings.c b/fsck.ocfs2/strings.c
index 508d5ad..77cef6b 100644
--- a/fsck.ocfs2/strings.c
+++ b/fsck.ocfs2/strings.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "fsck.h"
 #include "strings.h"
diff --git a/fsck.ocfs2/util.c b/fsck.ocfs2/util.c
index 11d002c..ca22a85 100644
--- a/fsck.ocfs2/util.c
+++ b/fsck.ocfs2/util.c
@@ -27,7 +27,7 @@
  */
 #include <inttypes.h>
 #include <string.h>
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "util.h"
 
diff --git a/fswreck/Makefile b/fswreck/Makefile
index c8da5a2..b7109b0 100644
--- a/fswreck/Makefile
+++ b/fswreck/Makefile
@@ -5,9 +5,9 @@ include $(TOPDIR)/Preamble.make
 SBIN_PROGRAMS = fswreck
 
 DEFINES = -DG_DISABLE_DEPRECATED -DLINUX
-DEFINES += -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+DEFINES += -DVERSION=\"$(VERSION)\"
 
-INCLUDES = -I$(TOPDIR)/include -Iinclude -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include -Iinclude
 INCLUDES += $(GLIB_CFLAGS)
 
 ifdef OCFS2_DEBUG
diff --git a/fswreck/chain.c b/fswreck/chain.c
index 6cb5d18..87993fa 100644
--- a/fswreck/chain.c
+++ b/fswreck/chain.c
@@ -22,7 +22,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/corrupt.c b/fswreck/corrupt.c
index 3b2830f..59a3f81 100644
--- a/fswreck/corrupt.c
+++ b/fswreck/corrupt.c
@@ -22,7 +22,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/dir.c b/fswreck/dir.c
index 4371601..0be4c70 100644
--- a/fswreck/dir.c
+++ b/fswreck/dir.c
@@ -39,7 +39,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/extent.c b/fswreck/extent.c
index f75ef8a..3470b37 100644
--- a/fswreck/extent.c
+++ b/fswreck/extent.c
@@ -34,7 +34,7 @@
  */
 
 #include <errno.h>
-#include <main.h>
+#include "main.h"
 
 
 extern char *progname;
diff --git a/fswreck/group.c b/fswreck/group.c
index f22f013..0f758b6 100644
--- a/fswreck/group.c
+++ b/fswreck/group.c
@@ -33,7 +33,7 @@
  * Group list error:		GROUP_UNEXPECTED_DESC, GROUP_EXPECTED_DESC
  *
  */
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/include/main.h b/fswreck/include/main.h
index 98bc2fb..0649014 100644
--- a/fswreck/include/main.h
+++ b/fswreck/include/main.h
@@ -51,7 +51,7 @@
 
 #include <linux/types.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #define FSWRK_FATAL(fmt, arg...)	({ fprintf(stderr, "ERROR at %s, %d: " fmt ".  EXITING!!!\n", \
 						   __FILE__, __LINE__, ##arg);  \
diff --git a/fswreck/inode.c b/fswreck/inode.c
index 5a7505a..f823117 100644
--- a/fswreck/inode.c
+++ b/fswreck/inode.c
@@ -35,7 +35,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/local_alloc.c b/fswreck/local_alloc.c
index e0a5977..2c70a0f 100644
--- a/fswreck/local_alloc.c
+++ b/fswreck/local_alloc.c
@@ -36,7 +36,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/main.c b/fswreck/main.c
index 7fbe0d8..b8afe08 100644
--- a/fswreck/main.c
+++ b/fswreck/main.c
@@ -22,7 +22,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 
 char *progname = NULL;
diff --git a/fswreck/special.c b/fswreck/special.c
index 653a88e..58e059b 100644
--- a/fswreck/special.c
+++ b/fswreck/special.c
@@ -22,7 +22,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/fswreck/symlink.c b/fswreck/symlink.c
index e746374..ed8d975 100644
--- a/fswreck/symlink.c
+++ b/fswreck/symlink.c
@@ -28,7 +28,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 static char *dummy = "/dummy00/dummy00";
 extern char *progname;
diff --git a/fswreck/truncate_log.c b/fswreck/truncate_log.c
index cd4012b..b757013 100644
--- a/fswreck/truncate_log.c
+++ b/fswreck/truncate_log.c
@@ -31,7 +31,7 @@
  *
  */
 
-#include <main.h>
+#include "main.h"
 
 extern char *progname;
 
diff --git a/include/Makefile b/include/Makefile
index 432cd0e..512d8cf 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -2,6 +2,6 @@ TOPDIR = ..
 
 include $(TOPDIR)/Preamble.make
 
-SUBDIRS = ocfs2-kernel o2dlm o2cb
+SUBDIRS = ocfs2-kernel o2dlm o2cb ocfs2
 
 include $(TOPDIR)/Postamble.make
diff --git a/libocfs2/include/.gitignore b/include/ocfs2/.gitignore
similarity index 100%
rename from libocfs2/include/.gitignore
rename to include/ocfs2/.gitignore
diff --git a/include/ocfs2/Makefile b/include/ocfs2/Makefile
new file mode 100644
index 0000000..125ff7a
--- /dev/null
+++ b/include/ocfs2/Makefile
@@ -0,0 +1,27 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+HFILES_GEN = ocfs2_err.h
+
+all: $(HFILES_GEN)
+
+HFILES = ocfs2.h jbd.h bitops.h byteorder.h kernel-rbtree.h feature_string.h
+
+HEADERS_SUBDIR = ocfs2
+HEADERS = $(HFILES) $(HFILES_GEN)
+
+ocfs2_err.h: $(TOPDIR)/libocfs2/ocfs2_err.h
+	cp $< $@
+
+$(TOPDIR)/libocfs2/ocfs2_err.h:
+	make -C $(TOPDIR)/libocfs2 ocfs2_err.h
+
+DIST_FILES = $(HFILES)
+
+CLEAN_RULES = clean-err
+
+clean-err:
+	rm -f ocfs2_err.h
+
+include $(TOPDIR)/Postamble.make
diff --git a/libocfs2/include/bitops.h b/include/ocfs2/bitops.h
similarity index 100%
rename from libocfs2/include/bitops.h
rename to include/ocfs2/bitops.h
diff --git a/libocfs2/include/byteorder.h b/include/ocfs2/byteorder.h
similarity index 100%
rename from libocfs2/include/byteorder.h
rename to include/ocfs2/byteorder.h
diff --git a/libocfs2/include/feature_string.h b/include/ocfs2/feature_string.h
similarity index 99%
rename from libocfs2/include/feature_string.h
rename to include/ocfs2/feature_string.h
index 49156a7..650dda8 100644
--- a/libocfs2/include/feature_string.h
+++ b/include/ocfs2/feature_string.h
@@ -26,7 +26,7 @@
 #ifndef __FEATURE_STRING_H
 #define __FEATURE_STRING_H
 
-#include <ocfs2.h>
+#include <ocfs2/ocfs2.h>
 
 struct fs_feature_flags {
 	const char *ff_str;
diff --git a/libocfs2/include/jbd.h b/include/ocfs2/jbd.h
similarity index 100%
rename from libocfs2/include/jbd.h
rename to include/ocfs2/jbd.h
diff --git a/libocfs2/include/kernel-rbtree.h b/include/ocfs2/kernel-rbtree.h
similarity index 100%
rename from libocfs2/include/kernel-rbtree.h
rename to include/ocfs2/kernel-rbtree.h
diff --git a/libocfs2/include/ocfs2.h b/include/ocfs2/ocfs2.h
similarity index 99%
rename from libocfs2/include/ocfs2.h
rename to include/ocfs2/ocfs2.h
index f35f3ed..390666d 100644
--- a/libocfs2/include/ocfs2.h
+++ b/include/ocfs2/ocfs2.h
@@ -47,23 +47,12 @@
 
 #include <et/com_err.h>
 
-#include "byteorder.h"
-
 #include <ocfs2-kernel/kernel-list.h>
 #include <ocfs2-kernel/ocfs2_fs.h>
 #include <o2dlm/o2dlm.h>
 #include <o2cb/o2cb.h>
-
-#if OCFS2_FLAT_INCLUDES
-#include "kernel-rbtree.h"
-#include "ocfs2_err.h"
-#include "jbd.h"
-#else
-#include <ocfs2/kernel-rbtree.h>
 #include <ocfs2/ocfs2_err.h>
 #include <ocfs2/jbd.h>
-#endif
-
 #include <ocfs2-kernel/ocfs2_lockid.h>
 
 #define OCFS2_LIB_FEATURE_INCOMPAT_SUPP		(OCFS2_FEATURE_INCOMPAT_SUPP | \
diff --git a/libo2cb/Makefile b/libo2cb/Makefile
index d666bb5..09edbdd 100644
--- a/libo2cb/Makefile
+++ b/libo2cb/Makefile
@@ -63,6 +63,6 @@ DIST_FILES = $(CFILES) $(HFILES) o2cb_err.et
 CLEAN_RULES = clean-err
 
 clean-err:
-	rm -f o2cb_err.c o2cb_err.h include/o2cb_err.h
+	rm -f o2cb_err.c o2cb_err.h
 
 include $(TOPDIR)/Postamble.make
diff --git a/libocfs2/Makefile b/libocfs2/Makefile
index eff1565..52461fb 100644
--- a/libocfs2/Makefile
+++ b/libocfs2/Makefile
@@ -11,7 +11,7 @@ else
 OPTS += -O2
 endif
 
-INCLUDES = -I$(TOPDIR)/include -Iinclude
+INCLUDES = -I$(TOPDIR)/include
 
 LIBRARIES = libocfs2.a
 
@@ -22,7 +22,6 @@ LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
 LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
 
 CFLAGS = $(OPTS) $(WARNINGS) -fPIC
-CPPFLAGS += -DOCFS2_FLAT_INCLUDES
 
 ifneq ($(OCFS2_DEBUG_EXE),)
 DEBUG_EXE_FILES = $(shell awk '/DEBUG_EXE/{if (k[FILENAME] == 0) {print FILENAME; k[FILENAME] = 1;}}' $(CFILES))
@@ -84,32 +83,20 @@ CFILES = 		\
 	backup_super.c	\
 	feature_string.c
 
-HFILES =				\
-	include/bitmap.h		\
-	include/bitops.h		\
-	include/byteorder.h		\
-	include/dir_iterate.h		\
-	include/dir_util.h		\
-	include/extent_map.h		\
-	include/kernel-rbtree.h		\
-	include/jbd.h			\
-	include/ocfs2.h			\
-	include/feature_string.h
+HFILES =		\
+	bitmap.h	\
+	dir_iterate.h	\
+	dir_util.h	\
+	dlm.h		\
+	extent_map.h
 
-HFILES_GEN =		\
-	include/ocfs2_err.h
-
-HEADERS_SUBDIR = ocfs2
-HEADERS = $(HFILES) $(HFILES_GEN)
+HFILES_GEN = ocfs2_err.h
 
 OBJS = $(subst .c,.o,$(CFILES)) \
 	ocfs2_err.o
 
 $(OBJS): $(HFILES_GEN)
 
-include/ocfs2_err.h: ocfs2_err.h
-	cp $< $@
-
 ocfs2_err.c ocfs2_err.h: ocfs2_err.et
 	compile_et ocfs2_err.et
 
@@ -120,14 +107,9 @@ libocfs2.a: $(OBJS)
 
 DIST_FILES = $(CFILES) $(HFILES) ocfs2_err.et
 
-DIST_RULES = dist-subdircreate
-
-dist-subdircreate:
-	$(TOPDIR)/mkinstalldirs $(DIST_DIR)/include
-
 CLEAN_RULES = clean-err
 
 clean-err:
-	rm -f ocfs2_err.c ocfs2_err.h include/ocfs2_err.h
+	rm -f ocfs2_err.c ocfs2_err.h
 
 include $(TOPDIR)/Postamble.make
diff --git a/libocfs2/alloc.c b/libocfs2/alloc.c
index 5207239..3e54629 100644
--- a/libocfs2/alloc.c
+++ b/libocfs2/alloc.c
@@ -29,7 +29,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 static errcode_t ocfs2_chain_alloc_with_io(ocfs2_filesys *fs,
 					   ocfs2_cached_inode *cinode,
diff --git a/libocfs2/backup_super.c b/libocfs2/backup_super.c
index 6332d1f..c5bbdb2 100644
--- a/libocfs2/backup_super.c
+++ b/libocfs2/backup_super.c
@@ -24,7 +24,7 @@
  */
 
 #include <errno.h>
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 /* In case we don't have fs_blocksize, we will return
  * byte offsets and let the caller calculate them by itself.
diff --git a/libocfs2/bitmap.c b/libocfs2/bitmap.c
index b60f20d..a5fe511 100644
--- a/libocfs2/bitmap.c
+++ b/libocfs2/bitmap.c
@@ -29,11 +29,10 @@
 #include <limits.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 
-#include "bitops.h"
 #include "bitmap.h"
-#include "kernel-rbtree.h"
 
 
 /* The public API */
diff --git a/libocfs2/include/bitmap.h b/libocfs2/bitmap.h
similarity index 99%
rename from libocfs2/include/bitmap.h
rename to libocfs2/bitmap.h
index e144e74..cd1379a 100644
--- a/libocfs2/include/bitmap.h
+++ b/libocfs2/bitmap.h
@@ -27,7 +27,7 @@
 #ifndef _BITMAP_H
 #define _BITMAP_H
 
-#include "kernel-rbtree.h"
+#include "ocfs2/kernel-rbtree.h"
 
 
 struct ocfs2_bitmap_region {
diff --git a/libocfs2/bitops.c b/libocfs2/bitops.c
index f0c3d65..df9cb9a 100644
--- a/libocfs2/bitops.c
+++ b/libocfs2/bitops.c
@@ -30,7 +30,7 @@
 #include <strings.h>
 #include <sys/types.h>
 
-#include "bitops.h"
+#include "ocfs2/bitops.h"
 
 /*
  * For the benefit of those who are trying to port Linux to another
diff --git a/libocfs2/cached_inode.c b/libocfs2/cached_inode.c
index 11eb5f9..eedfd96 100644
--- a/libocfs2/cached_inode.c
+++ b/libocfs2/cached_inode.c
@@ -27,7 +27,7 @@
 
 #include <string.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 errcode_t ocfs2_read_cached_inode(ocfs2_filesys *fs, uint64_t blkno,
 				  ocfs2_cached_inode **ret_ci)
diff --git a/libocfs2/chain.c b/libocfs2/chain.c
index cf578f0..c860015 100644
--- a/libocfs2/chain.c
+++ b/libocfs2/chain.c
@@ -27,7 +27,9 @@
 
 #include <string.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
+
+#include "ocfs2/byteorder.h"
 
 void ocfs2_swap_group_desc(struct ocfs2_group_desc *gd)
 {
diff --git a/libocfs2/chainalloc.c b/libocfs2/chainalloc.c
index 3b967b4..39170dd 100644
--- a/libocfs2/chainalloc.c
+++ b/libocfs2/chainalloc.c
@@ -29,11 +29,10 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "bitmap.h"
-#include "bitops.h"
-#include "kernel-rbtree.h"
+#include "ocfs2/bitops.h"
 
 
 struct chainalloc_bitmap_private {
diff --git a/libocfs2/checkhb.c b/libocfs2/checkhb.c
index 688d905..f4ff19e 100644
--- a/libocfs2/checkhb.c
+++ b/libocfs2/checkhb.c
@@ -37,7 +37,8 @@
 #include <signal.h>
 
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 #include "ocfs2-kernel/ocfs1_fs_compat.h"
 
 static errcode_t ocfs2_read_slotmap (ocfs2_filesys *fs, uint8_t *node_nums)
diff --git a/libocfs2/closefs.c b/libocfs2/closefs.c
index e5a713a..54411da 100644
--- a/libocfs2/closefs.c
+++ b/libocfs2/closefs.c
@@ -28,7 +28,7 @@
 #define _XOPEN_SOURCE 600  /* Triggers XOPEN2K in features.h */
 #define _LARGEFILE64_SOURCE
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 errcode_t ocfs2_flush(ocfs2_filesys *fs)
diff --git a/libocfs2/dir_iterate.c b/libocfs2/dir_iterate.c
index a156ed0..eda85fa 100644
--- a/libocfs2/dir_iterate.c
+++ b/libocfs2/dir_iterate.c
@@ -30,7 +30,7 @@
 
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "dir_iterate.h"
 #include "dir_util.h"
diff --git a/libocfs2/include/dir_iterate.h b/libocfs2/dir_iterate.h
similarity index 100%
rename from libocfs2/include/dir_iterate.h
rename to libocfs2/dir_iterate.h
diff --git a/libocfs2/dir_scan.c b/libocfs2/dir_scan.c
index bb31101..ea70671 100644
--- a/libocfs2/dir_scan.c
+++ b/libocfs2/dir_scan.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "dir_util.h"
 
diff --git a/libocfs2/include/dir_util.h b/libocfs2/dir_util.h
similarity index 100%
rename from libocfs2/include/dir_util.h
rename to libocfs2/dir_util.h
diff --git a/libocfs2/dirblock.c b/libocfs2/dirblock.c
index f7736d3..d8135fc 100644
--- a/libocfs2/dirblock.c
+++ b/libocfs2/dirblock.c
@@ -30,7 +30,8 @@
 
 #include <string.h>
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 static void ocfs2_swap_dir_entry(struct ocfs2_dir_entry *dirent)
 {
diff --git a/libocfs2/dlm.c b/libocfs2/dlm.c
index 710d406..7bb215c 100644
--- a/libocfs2/dlm.c
+++ b/libocfs2/dlm.c
@@ -26,7 +26,7 @@
 #define _XOPEN_SOURCE 600 /* Triggers magic in features.h */
 #define _LARGEFILE64_SOURCE
                                                                                                                                                          
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #define DEFAULT_DLMFS_PATH	"/dlm/"
 
diff --git a/libocfs2/include/dlm.h b/libocfs2/dlm.h
similarity index 100%
rename from libocfs2/include/dlm.h
rename to libocfs2/dlm.h
diff --git a/libocfs2/expanddir.c b/libocfs2/expanddir.c
index 7ddab61..f6a5385 100644
--- a/libocfs2/expanddir.c
+++ b/libocfs2/expanddir.c
@@ -35,7 +35,7 @@
 #include <unistd.h>
 #endif
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 /*
  * ocfs2_expand_dir()
diff --git a/libocfs2/extend_file.c b/libocfs2/extend_file.c
index 422fb42..0b7310f 100644
--- a/libocfs2/extend_file.c
+++ b/libocfs2/extend_file.c
@@ -33,7 +33,7 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <assert.h>
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 /*
  * Structures which describe a path through a btree, and functions to
diff --git a/libocfs2/extent_map.c b/libocfs2/extent_map.c
index a97902b..eb8595a 100644
--- a/libocfs2/extent_map.c
+++ b/libocfs2/extent_map.c
@@ -29,7 +29,7 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "extent_map.h"
 
diff --git a/libocfs2/include/extent_map.h b/libocfs2/extent_map.h
similarity index 97%
rename from libocfs2/include/extent_map.h
rename to libocfs2/extent_map.h
index 4c61c0d..99f74de 100644
--- a/libocfs2/include/extent_map.h
+++ b/libocfs2/extent_map.h
@@ -27,7 +27,7 @@
 #ifndef _EXTENT_MAP_H
 #define _EXTENT_MAP_H
 
-#include "kernel-rbtree.h"
+#include "ocfs2/kernel-rbtree.h"
 
 typedef struct _ocfs2_extent_map_entry ocfs2_extent_map_entry;
 
diff --git a/libocfs2/extents.c b/libocfs2/extents.c
index 50f3b6e..d3f998a 100644
--- a/libocfs2/extents.c
+++ b/libocfs2/extents.c
@@ -32,7 +32,8 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 static void ocfs2_swap_extent_list_primary(struct ocfs2_extent_list *el)
 {
diff --git a/libocfs2/feature_string.c b/libocfs2/feature_string.c
index 40720b8..831edc1 100644
--- a/libocfs2/feature_string.c
+++ b/libocfs2/feature_string.c
@@ -22,7 +22,7 @@
  * Boston, MA 021110-1307, USA.
  *
  */
-#include <feature_string.h>
+#include "ocfs2/feature_string.h"
 
 struct feature_level_translation {
 	const char *fl_str;
diff --git a/libocfs2/fileio.c b/libocfs2/fileio.c
index f35c8b6..3b8aa76 100644
--- a/libocfs2/fileio.c
+++ b/libocfs2/fileio.c
@@ -32,7 +32,7 @@
 #include <limits.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 struct read_whole_context {
 	char		*buf;
diff --git a/libocfs2/freefs.c b/libocfs2/freefs.c
index 6067b52..ab8a8ea 100644
--- a/libocfs2/freefs.c
+++ b/libocfs2/freefs.c
@@ -30,7 +30,7 @@
 
 #include <stdlib.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 void ocfs2_freefs(ocfs2_filesys *fs)
diff --git a/libocfs2/getsectsize.c b/libocfs2/getsectsize.c
index 7bd1e2f..937baa6 100644
--- a/libocfs2/getsectsize.c
+++ b/libocfs2/getsectsize.c
@@ -37,7 +37,7 @@
 #define BLKSSZGET  _IO(0x12,104)/* get block device sector size */
 #endif
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 /*
  * Returns the number of blocks in a partition
diff --git a/libocfs2/getsize.c b/libocfs2/getsize.c
index 8ae8626..4176e4b 100644
--- a/libocfs2/getsize.c
+++ b/libocfs2/getsize.c
@@ -67,7 +67,7 @@
 #define BLKGETSIZE DKIOCGETBLOCKCOUNT32
 #endif /* APPLE_DARWIN */
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #if defined(__CYGWIN__) || defined (WIN32)
 #include "windows.h"
diff --git a/libocfs2/heartbeat.c b/libocfs2/heartbeat.c
index 885712f..6adb6c6 100644
--- a/libocfs2/heartbeat.c
+++ b/libocfs2/heartbeat.c
@@ -28,7 +28,8 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 void ocfs2_swap_disk_heartbeat_block(struct o2hb_disk_heartbeat_block *hb)
 {
diff --git a/libocfs2/inode.c b/libocfs2/inode.c
index dfb1e7e..3cc5815 100644
--- a/libocfs2/inode.c
+++ b/libocfs2/inode.c
@@ -31,7 +31,8 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 
 errcode_t ocfs2_check_directory(ocfs2_filesys *fs, uint64_t dir)
diff --git a/libocfs2/inode_scan.c b/libocfs2/inode_scan.c
index 01eabcf..11ba848 100644
--- a/libocfs2/inode_scan.c
+++ b/libocfs2/inode_scan.c
@@ -33,7 +33,7 @@
 #include <stdlib.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include "extent_map.h"
 
diff --git a/libocfs2/ismounted.c b/libocfs2/ismounted.c
index f4d79d2..c6ddf31 100644
--- a/libocfs2/ismounted.c
+++ b/libocfs2/ismounted.c
@@ -38,7 +38,7 @@
 #include <string.h>
 #include <sys/stat.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #ifdef HAVE_MNTENT_H
 /*
diff --git a/libocfs2/kernel-rbtree.c b/libocfs2/kernel-rbtree.c
index 2226ecc..1c8f911 100644
--- a/libocfs2/kernel-rbtree.c
+++ b/libocfs2/kernel-rbtree.c
@@ -28,7 +28,7 @@
   linux/lib/rbtree.c
 */
 
-#include "kernel-rbtree.h"
+#include "ocfs2/kernel-rbtree.h"
 
 static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
 {
diff --git a/libocfs2/link.c b/libocfs2/link.c
index 37211bd..fcfe56f 100644
--- a/libocfs2/link.c
+++ b/libocfs2/link.c
@@ -30,7 +30,7 @@
 
 #include <string.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 struct link_struct  {
diff --git a/libocfs2/lockid.c b/libocfs2/lockid.c
index b68f2ce..7046e51 100644
--- a/libocfs2/lockid.c
+++ b/libocfs2/lockid.c
@@ -22,7 +22,7 @@
  * Boston, MA 021110-1307, USA.
  */
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include <string.h>
 #include <inttypes.h>
diff --git a/libocfs2/lookup.c b/libocfs2/lookup.c
index f9d0d8e..374113c 100644
--- a/libocfs2/lookup.c
+++ b/libocfs2/lookup.c
@@ -31,7 +31,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 struct lookup_struct  {
diff --git a/libocfs2/memory.c b/libocfs2/memory.c
index bad8300..589e114 100644
--- a/libocfs2/memory.c
+++ b/libocfs2/memory.c
@@ -33,7 +33,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 errcode_t ocfs2_malloc(unsigned long size, void *ptr)
 {
diff --git a/libocfs2/mkjournal.c b/libocfs2/mkjournal.c
index ccc939d..afb617c 100644
--- a/libocfs2/mkjournal.c
+++ b/libocfs2/mkjournal.c
@@ -31,8 +31,8 @@
 #include <string.h>
 #include <netinet/in.h>
 
-#include "ocfs2.h"
-#include "jbd.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 void ocfs2_swap_journal_superblock(journal_superblock_t *jsb)
 {
diff --git a/libocfs2/namei.c b/libocfs2/namei.c
index 121ae7f..aa78937 100644
--- a/libocfs2/namei.c
+++ b/libocfs2/namei.c
@@ -34,7 +34,7 @@
 #include <unistd.h>
 #endif
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 static errcode_t open_namei(ocfs2_filesys *fs, uint64_t root, uint64_t base,
 			    const char *pathname, size_t pathlen, int follow,
diff --git a/libocfs2/newdir.c b/libocfs2/newdir.c
index dcf7572..480ac80 100644
--- a/libocfs2/newdir.c
+++ b/libocfs2/newdir.c
@@ -34,7 +34,7 @@
 #include <unistd.h>
 #endif
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 /*
  * Create new directory block
diff --git a/libocfs2/openfs.c b/libocfs2/openfs.c
index 2e6b625..f352add 100644
--- a/libocfs2/openfs.c
+++ b/libocfs2/openfs.c
@@ -36,8 +36,8 @@
 # define ULLONG_MAX 18446744073709551615ULL
 #endif
 
-#include "ocfs2.h"
-
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 #include "ocfs2-kernel/ocfs1_fs_compat.h"
 
 
diff --git a/libocfs2/slot_map.c b/libocfs2/slot_map.c
index 349371b..616df50 100644
--- a/libocfs2/slot_map.c
+++ b/libocfs2/slot_map.c
@@ -21,7 +21,8 @@
 #define _XOPEN_SOURCE 600  /* Triggers XOPEN2K in features.h */
 #define _LARGEFILE64_SOURCE
 
-#include "ocfs2.h"
+#include "ocfs2/byteorder.h"
+#include "ocfs2/ocfs2.h"
 
 void ocfs2_swap_slot_map(int16_t *map, loff_t num_slots)
 {
diff --git a/libocfs2/sysfile.c b/libocfs2/sysfile.c
index 9be9d40..81ce020 100644
--- a/libocfs2/sysfile.c
+++ b/libocfs2/sysfile.c
@@ -27,7 +27,7 @@
 
 #include <string.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 errcode_t ocfs2_lookup_system_inode(ocfs2_filesys *fs, int type,
 				    int slot_num, uint64_t *blkno)
diff --git a/libocfs2/truncate.c b/libocfs2/truncate.c
index ae25dcd..bc70682 100644
--- a/libocfs2/truncate.c
+++ b/libocfs2/truncate.c
@@ -30,7 +30,7 @@
 #include <unistd.h>
 #endif
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 struct truncate_ctxt {
 	uint64_t new_size_in_clusters;
diff --git a/libocfs2/unix_io.c b/libocfs2/unix_io.c
index d453471..2ba51d4 100644
--- a/libocfs2/unix_io.c
+++ b/libocfs2/unix_io.c
@@ -43,7 +43,9 @@
 #endif
 #include <inttypes.h>
 
-#include "ocfs2.h"
+#include "ocfs2/kernel-rbtree.h"
+
+#include "ocfs2/ocfs2.h"
 
 
 /*
diff --git a/libocfs2/unlink.c b/libocfs2/unlink.c
index e56cf2d..286ef59 100644
--- a/libocfs2/unlink.c
+++ b/libocfs2/unlink.c
@@ -31,7 +31,7 @@
 
 #include <string.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 struct link_struct  {
diff --git a/listuuid/Makefile b/listuuid/Makefile
index bcef721..78c9444 100644
--- a/listuuid/Makefile
+++ b/listuuid/Makefile
@@ -2,7 +2,7 @@ TOPDIR = ..
 
 include $(TOPDIR)/Preamble.make
 
-INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include
 
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
@@ -22,8 +22,6 @@ endif
 CFLAGS := $(OPTS) -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
-DEFINES = -DOCFS2_FLAT_INCLUDES
-
 UNINST_PROGRAMS = listuuid
 
 CFILES =	listuuid.c
diff --git a/listuuid/listuuid.c b/listuuid/listuuid.c
index 965a136..e1fb621 100644
--- a/listuuid/listuuid.c
+++ b/listuuid/listuuid.c
@@ -38,9 +38,7 @@
 #include <uuid/uuid.h>
 
 
-#define  OCFS2_FLAT_INCLUDES	1
-#include <ocfs2.h>
-
+#include "ocfs2/ocfs2.h"
 #include "ocfs2-kernel/ocfs1_fs_compat.h"
 
 char *device = NULL;
diff --git a/mkfs.ocfs2/Makefile b/mkfs.ocfs2/Makefile
index 4748818..00d9d22 100644
--- a/mkfs.ocfs2/Makefile
+++ b/mkfs.ocfs2/Makefile
@@ -16,7 +16,6 @@ CFLAGS = $(OPTS) $(WARNINGS)
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = mkfs.ocfs2
 
-LIBOCFS2_CFLAGS = -I$(TOPDIR)/libocfs2/include
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
 
@@ -26,8 +25,8 @@ LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
 LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm
 LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
 
-INCLUDES = -I$(TOPDIR)/include $(LIBOCFS2_CFLAGS) -I.
-DEFINES = -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+INCLUDES = -I$(TOPDIR)/include -I.
+DEFINES = -DVERSION=\"$(VERSION)\"
 
 CFILES = mkfs.c check.c
 HFILES = mkfs.h
diff --git a/mkfs.ocfs2/mkfs.h b/mkfs.ocfs2/mkfs.h
index 9712575..2e7db4b 100644
--- a/mkfs.ocfs2/mkfs.h
+++ b/mkfs.ocfs2/mkfs.h
@@ -43,20 +43,14 @@
 
 #include <uuid/uuid.h>
 
-#include "ocfs2.h"
-#include "bitops.h"
-
-/* jfs_compat.h defines these */
-#undef cpu_to_be32
-#undef be32_to_cpu
-
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 #include "ocfs2-kernel/ocfs1_fs_compat.h"
 
 #include <signal.h>
 #include <libgen.h>
 
-#include "jbd.h"
-#include <feature_string.h>
+#include "ocfs2/feature_string.h"
 
 #ifndef MAX
 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
diff --git a/mount.ocfs2/Makefile b/mount.ocfs2/Makefile
index b1f8859..5f796c9 100644
--- a/mount.ocfs2/Makefile
+++ b/mount.ocfs2/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/Preamble.make
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = mount.ocfs2
 
-INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
 LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm
@@ -22,7 +22,7 @@ endif
 CFLAGS := $(OPTS) -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
-DEFINES = -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+DEFINES = -DVERSION=\"$(VERSION)\"
 
 CFILES = opts.c mount.ocfs2.c
 CFILES += fstab.c mntent.c realpath.c sundries.c xmalloc.c
diff --git a/mount.ocfs2/mount.ocfs2.h b/mount.ocfs2/mount.ocfs2.h
index 9f586ac..91d97d0 100644
--- a/mount.ocfs2/mount.ocfs2.h
+++ b/mount.ocfs2/mount.ocfs2.h
@@ -48,7 +48,6 @@
 #include "mount_constants.h"
 #include "opts.h"
 
-#include <ocfs2.h>
-
-#include "bitops.h"
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 
diff --git a/mounted.ocfs2/Makefile b/mounted.ocfs2/Makefile
index 890fbce..be10987 100644
--- a/mounted.ocfs2/Makefile
+++ b/mounted.ocfs2/Makefile
@@ -11,7 +11,7 @@ else
 OPTS = -O2
 endif
 
-CFLAGS = $(OPTS) $(WARNINGS) -DOCFS2_FLAT_INCLUDES
+CFLAGS = $(OPTS) $(WARNINGS)
 
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
@@ -25,7 +25,7 @@ LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = mounted.ocfs2
 
-INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include
 
 CFILES = mounted.c
 OBJS = $(subst .c,.o,$(CFILES))
diff --git a/mounted.ocfs2/mounted.c b/mounted.ocfs2/mounted.c
index 3d00071..87a4f98 100644
--- a/mounted.ocfs2/mounted.c
+++ b/mounted.ocfs2/mounted.c
@@ -37,8 +37,7 @@
 #include <uuid/uuid.h>
 
 #include "ocfs2-kernel/kernel-list.h"
-
-#include <ocfs2.h>
+#include "ocfs2/ocfs2.h"
 
 static int quick_detect = 0;
 static char *device = NULL;
diff --git a/o2cb_ctl/Makefile b/o2cb_ctl/Makefile
index 82be918..b6cd01b 100644
--- a/o2cb_ctl/Makefile
+++ b/o2cb_ctl/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/Preamble.make
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = o2cb_ctl
 
-INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include
 
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
diff --git a/ocfs2_hb_ctl/Makefile b/ocfs2_hb_ctl/Makefile
index 5489c58..0b40a0f 100644
--- a/ocfs2_hb_ctl/Makefile
+++ b/ocfs2_hb_ctl/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/Preamble.make
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = ocfs2_hb_ctl
 
-INCLUDES = -I$(TOPDIR)/include -Iinclude -I$(TOPDIR)/libocfs2/include
+INCLUDES = -I$(TOPDIR)/include
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
 LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm
@@ -26,7 +26,7 @@ endif
 CFLAGS := $(OPTS) -Wall -Wstrict-prototypes -Wmissing-prototypes \
            -Wmissing-declarations
 
-DEFINES = -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+DEFINES = -DVERSION=\"$(VERSION)\"
 
 CFILES = ocfs2_hb_ctl.c
 
diff --git a/ocfs2_hb_ctl/ocfs2_hb_ctl.c b/ocfs2_hb_ctl/ocfs2_hb_ctl.c
index 58a240c..6888aa1 100644
--- a/ocfs2_hb_ctl/ocfs2_hb_ctl.c
+++ b/ocfs2_hb_ctl/ocfs2_hb_ctl.c
@@ -40,7 +40,7 @@
 #include <sys/stat.h>
 #include <signal.h>
 
-#include <ocfs2.h>
+#include "ocfs2/ocfs2.h"
 
 #define DEV_PREFIX      "/dev/"
 #define PROC_IDE_FORMAT "/proc/ide/%s/media"
diff --git a/ocfs2cdsl/Makefile b/ocfs2cdsl/Makefile
index ddb2874..e8125c7 100644
--- a/ocfs2cdsl/Makefile
+++ b/ocfs2cdsl/Makefile
@@ -8,7 +8,6 @@ ifdef OCFS2_DEBUG
 OPTS = -g
 endif
 
-LIBOCFS2_CFLAGS = -I$(TOPDIR)/libocfs2/include
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a 
 
@@ -24,10 +23,9 @@ sbindir = $(root_sbindir)
 SBIN_PROGRAMS = ocfs2cdsl
 
 DEFINES = -DVERSION=\"$(VERSION)\"
-DEFINES += -DOCFS2_FLAT_INCLUDES
 DEFINES += -DG_DISABLE_DEPRECATED
 
-INCLUDES = -I$(TOPDIR)/include $(LIBOCFS2_CFLAGS) $(GLIB_CFLAGS)
+INCLUDES = -I$(TOPDIR)/include $(GLIB_CFLAGS)
 
 OPTIMIZE = -O2
 
diff --git a/ocfs2cdsl/ocfs2cdsl.c b/ocfs2cdsl/ocfs2cdsl.c
index 6a78c77..33bc8e1 100644
--- a/ocfs2cdsl/ocfs2cdsl.c
+++ b/ocfs2cdsl/ocfs2cdsl.c
@@ -43,7 +43,7 @@
 
 #include <glib.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 #define CDSL_BASE       ".cluster"
diff --git a/ocfs2console/ocfs2interface/Makefile b/ocfs2console/ocfs2interface/Makefile
index b418e3f..be16577 100644
--- a/ocfs2console/ocfs2interface/Makefile
+++ b/ocfs2console/ocfs2interface/Makefile
@@ -15,7 +15,6 @@ CFLAGS = $(OPTS) $(WARNINGS) -fPIC
 
 PYMOD_CFLAGS = $(CFLAGS) -fno-strict-aliasing $(PYTHON_INCLUDES)
 
-LIBOCFS2_CFLAGS = -I$(TOPDIR)/libocfs2/include
 LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
 LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
 
@@ -34,8 +33,6 @@ BLKID_CFLAGS = -I$(TOPDIR)/ocfs2console
 BLKID_LIBS = -L$(TOPDIR)/ocfs2console/blkid -lblkid-internal $(UUID_LIBS)
 endif
 
-OCFS2_CPPFLAGS = -DOCFS2_FLAT_INCLUDES $(LIBOCFS2_CFLAGS)
-
 GLIB_CPPFLAGS = $(GLIB_CFLAGS) -DG_DISABLE_DEPRECATED
 
 OPTIMIZE = -O2
@@ -46,7 +43,7 @@ PLIST_CBITS = ocfsplist.c
 PLIST_CFILES = $(PLIST_CBITS) plistmodule.c
 PLIST_HFILES = $(subst .c,.h,$(PLIST_CBITS))
 
-ocfsplist_CPPFLAGS = $(OCFS2_CPPFLAGS) $(GLIB_CPPFLAGS) $(BLKID_CFLAGS)
+ocfsplist_CPPFLAGS = $(GLIB_CPPFLAGS) $(BLKID_CFLAGS)
 plistmodule_CPPFLAGS = $(GLIB_CPPFLAGS)
 plistmodule_CFLAGS = $(PYMOD_CFLAGS)
 
diff --git a/ocfs2console/ocfs2interface/ocfs2module.c b/ocfs2console/ocfs2interface/ocfs2module.c
index d860cf0..9a4815c 100644
--- a/ocfs2console/ocfs2interface/ocfs2module.c
+++ b/ocfs2console/ocfs2interface/ocfs2module.c
@@ -30,7 +30,7 @@
 
 #include <uuid/uuid.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 
 #define Filesystem_Check(op)  PyObject_TypeCheck(op, &Filesystem_Type)
diff --git a/ocfs2console/ocfs2interface/ocfsplist.c b/ocfs2console/ocfs2interface/ocfsplist.c
index f93f2b3..aab8d75 100644
--- a/ocfs2console/ocfs2interface/ocfsplist.c
+++ b/ocfs2console/ocfs2interface/ocfsplist.c
@@ -33,7 +33,7 @@
 
 #include <glib.h>
 
-#include "ocfs2.h"
+#include "ocfs2/ocfs2.h"
 
 #include <blkid/blkid.h>
 
diff --git a/sizetest/Makefile b/sizetest/Makefile
index ceacea3..23df530 100644
--- a/sizetest/Makefile
+++ b/sizetest/Makefile
@@ -15,8 +15,8 @@ CFLAGS = $(OPTS) $(WARNINGS)
 
 UNINST_PROGRAMS = sizetest.ocfs2
 
-INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libocfs2/include
-DEFINES = -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+INCLUDES = -I$(TOPDIR)/include
+DEFINES = -DVERSION=\"$(VERSION)\"
 
 CFILES = sizetest.c
 OBJS = $(subst .c,.o,$(CFILES))
diff --git a/sizetest/sizetest.c b/sizetest/sizetest.c
index 4e43a9a..0b24031 100644
--- a/sizetest/sizetest.c
+++ b/sizetest/sizetest.c
@@ -24,7 +24,7 @@
  */
 
 
-#include <ocfs2.h>
+#include "ocfs2/ocfs2.h"
 
 
 #undef offsetof
diff --git a/tunefs.ocfs2/Makefile b/tunefs.ocfs2/Makefile
index 55e653d..e062dfb 100644
--- a/tunefs.ocfs2/Makefile
+++ b/tunefs.ocfs2/Makefile
@@ -25,9 +25,9 @@ LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
 sbindir = $(root_sbindir)
 SBIN_PROGRAMS = tunefs.ocfs2
 
-INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libocfs2/include -I.
+INCLUDES = -I$(TOPDIR)/include -I.
 INCLUDES += $(GLIB_CFLAGS)
-DEFINES = -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+DEFINES = -DVERSION=\"$(VERSION)\"
 
 MANS = tunefs.ocfs2.8
 
diff --git a/tunefs.ocfs2/features.c b/tunefs.ocfs2/features.c
index 856e833..2208269 100644
--- a/tunefs.ocfs2/features.c
+++ b/tunefs.ocfs2/features.c
@@ -21,7 +21,7 @@
  * Boston, MA 021110-1307, USA.
  *
  */
-#include <ocfs2.h>
+#include <ocfs2/ocfs2.h>
 
 #include <assert.h>
 
diff --git a/tunefs.ocfs2/remove_slot.c b/tunefs.ocfs2/remove_slot.c
index 1e4238a..ed4d460 100644
--- a/tunefs.ocfs2/remove_slot.c
+++ b/tunefs.ocfs2/remove_slot.c
@@ -23,8 +23,6 @@
  */
 
 #include <inttypes.h>
-#include <bitops.h>
-#include <ocfs2.h>
 
 #include <assert.h>
 
diff --git a/tunefs.ocfs2/sparse_file.c b/tunefs.ocfs2/sparse_file.c
index 07e593f..9b9e0d9 100644
--- a/tunefs.ocfs2/sparse_file.c
+++ b/tunefs.ocfs2/sparse_file.c
@@ -22,7 +22,7 @@
  *
  */
 
-#include <kernel-rbtree.h>
+#include <ocfs2/kernel-rbtree.h>
 #include <tunefs.h>
 #include <assert.h>
 
diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
index fbcee4a..03976fe 100644
--- a/tunefs.ocfs2/tunefs.c
+++ b/tunefs.ocfs2/tunefs.c
@@ -24,7 +24,7 @@
  */
 
 #include <tunefs.h>
-#include <feature_string.h>
+#include <ocfs2/feature_string.h>
 
 ocfs2_tune_opts opts;
 ocfs2_filesys *fs_gbl = NULL;
diff --git a/tunefs.ocfs2/tunefs.h b/tunefs.ocfs2/tunefs.h
index 3c110c6..4f523b7 100644
--- a/tunefs.ocfs2/tunefs.h
+++ b/tunefs.ocfs2/tunefs.h
@@ -48,10 +48,8 @@
 #include <signal.h>
 #include <uuid/uuid.h>
 
-#include <ocfs2.h>
-#include <bitops.h>
-
-#include <jbd.h>
+#include "ocfs2/ocfs2.h"
+#include "ocfs2/bitops.h"
 
 #define SYSTEM_FILE_NAME_MAX   40
 
-- 

Life's Little Instruction Book #173

	"Be kinder than necessary."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list