gfs2-utils: master - libgfs2: Forgot to remove headers from apps

Steven Whitehouse swhiteho@fedoraproject.org
Mon Jan 26 14:49:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=f262c6004bef02c525bd672fdbf98af59f468cff
Commit:        f262c6004bef02c525bd672fdbf98af59f468cff
Parent:        136b0fae1f220d37e6d722703252a10248f11b8d
Author:        Steven Whitehouse <swhiteho@redhat.com>
AuthorDate:    Mon Jan 26 13:44:10 2009 +0000
Committer:     Steven Whitehouse <swhiteho@redhat.com>
CommitterDate: Mon Jan 26 13:44:10 2009 +0000

libgfs2: Forgot to remove headers from apps

The applications were including some of the headers directly,
and since they didn't (for some reason) rebuild when I removed
the headers, I missed that fact.

In fact one of the utils had included the content of ondisk.h
four times over into a single c file. I think we can just rely
of libgfs2.h for that now.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
 gfs2/convert/gfs2_convert.c     |    2 -
 gfs2/edit/gfs2hex.c             |    2 -
 gfs2/edit/hexedit.c             |    2 -
 gfs2/edit/hexedit.h             |    1 -
 gfs2/edit/savemeta.c            |    1 -
 gfs2/fsck/eattr.c               |    1 -
 gfs2/fsck/fs_recovery.c         |    1 -
 gfs2/fsck/initialize.c          |    2 -
 gfs2/fsck/metawalk.c            |    1 -
 gfs2/fsck/pass1.c               |    1 -
 gfs2/fsck/pass1b.c              |    1 -
 gfs2/fsck/pass1c.c              |    1 -
 gfs2/fsck/util.c                |    1 -
 gfs2/mkfs/gfs2_mkfs.h           |    2 -
 gfs2/mount/gfs_ondisk.h         |   43 +++++++++++++++++++++++++++++++++++++++
 gfs2/mount/ondisk1.c            |    2 -
 gfs2/mount/util.h               |    1 -
 gfs2/quota/gfs2_quota.h         |    1 -
 gfs2/tool/ondisk.c              |    2 -
 group/gfs_controld/gfs_daemon.h |    1 -
 20 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index e346635..634764a 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -20,12 +20,10 @@
 #include <time.h>
 #include <sys/time.h>
 
-#include "linux_endian.h"
 #include <linux/types.h>
 #include <linux/gfs2_ondisk.h>
 #include "osi_list.h"
 #include "copyright.cf"
-#include "ondisk.h"
 #include "libgfs2.h"
 
 /* The following declares are needed because gfs2 can't have  */
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index ff69a02..d6f22d0 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -11,7 +11,6 @@
 #include <curses.h>
 
 #include "hexedit.h"
-#include "linux_endian.h"
 
 #define WANT_GFS_CONVERSION_FUNCTIONS
 #include <linux/gfs2_ondisk.h>
@@ -19,7 +18,6 @@
 #include "gfs2hex.h"
 /* from libgfs2: */
 #include "libgfs2.h"
-#include "ondisk.h"
 
 #define pv(struct, member, fmt, fmt2) do {				\
 		print_it("  "#member, fmt, fmt2, struct->member);	\
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 4cf6795..9b1fcc4 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -17,13 +17,11 @@
 #include <sys/mount.h>
 #include <dirent.h>
 
-#include "linux_endian.h"
 #include <linux/gfs2_ondisk.h>
 #include "copyright.cf"
 
 #define EXTERN
 #include "hexedit.h"
-#include "linux_endian.h"
 #include "libgfs2.h"
 #include "gfs2hex.h"
 
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index 768a6d6..7d6a8b8 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -1,7 +1,6 @@
 #ifndef __HEXVIEW_DOT_H__
 #define __HEXVIEW_DOT_H__
 
-#include "linux_endian.h"
 #include <sys/types.h>
 #include <inttypes.h>
 #include <limits.h>
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 8b7637b..3587c4b 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -14,7 +14,6 @@
 #include <term.h>
 #include <sys/ioctl.h>
 #include <limits.h>
-#include <linux_endian.h>
 #include <sys/time.h>
 #include <linux/gfs2_ondisk.h>
 
diff --git a/gfs2/fsck/eattr.c b/gfs2/fsck/eattr.c
index e32a366..0fe2421 100644
--- a/gfs2/fsck/eattr.c
+++ b/gfs2/fsck/eattr.c
@@ -1,6 +1,5 @@
 #include <stdint.h>
 #include <string.h>
-#include <linux_endian.h>
 
 #include "libgfs2.h"
 #include "fsck.h"
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 06e71bf..fb830fe 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -1,6 +1,5 @@
 #include <errno.h>
 #include <inttypes.h>
-#include <linux_endian.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 9378419..e3d3f6c 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1,4 +1,3 @@
-#include <linux_endian.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <inttypes.h>
@@ -13,7 +12,6 @@
 #include "fsck.h"
 #include "util.h"
 #include "fs_recovery.h"
-#include "linux_endian.h"
 
 #define CLEAR_POINTER(x) \
 	if(x) { \
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 8006291..278c8dd 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1,5 +1,4 @@
 #include <inttypes.h>
-#include <linux_endian.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index a33ad16..9d6d90d 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -21,7 +21,6 @@
 #include "fsck.h"
 #include "util.h"
 #include "link.h"
-#include "linux_endian.h"
 #include "metawalk.h"
 
 struct block_count {
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 88306ad..1b0dde0 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -1,5 +1,4 @@
 #include <inttypes.h>
-#include <linux_endian.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/gfs2/fsck/pass1c.c b/gfs2/fsck/pass1c.c
index fa0e0db..aaeac15 100644
--- a/gfs2/fsck/pass1c.c
+++ b/gfs2/fsck/pass1c.c
@@ -1,5 +1,4 @@
 #include <inttypes.h>
-#include <linux_endian.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index 54bc54d..46b1de3 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -1,5 +1,4 @@
 #include <inttypes.h>
-#include <linux_endian.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/gfs2/mkfs/gfs2_mkfs.h b/gfs2/mkfs/gfs2_mkfs.h
index 0242c5f..493fa54 100644
--- a/gfs2/mkfs/gfs2_mkfs.h
+++ b/gfs2/mkfs/gfs2_mkfs.h
@@ -1,11 +1,9 @@
 #ifndef __GFS2_MKFS_DOT_H__
 #define __GFS2_MKFS_DOT_H__
 
-#include "linux_endian.h"
 #include <linux/gfs2_ondisk.h>
 #include "osi_list.h"
 #include "copyright.cf"
-#include "ondisk.h"
 
 /* main_grow */
 void main_grow(int argc, char *argv[]);
diff --git a/gfs2/mount/gfs_ondisk.h b/gfs2/mount/gfs_ondisk.h
index 0648d28..b3002d9 100644
--- a/gfs2/mount/gfs_ondisk.h
+++ b/gfs2/mount/gfs_ondisk.h
@@ -80,6 +80,49 @@
 #ifndef __GFS_ONDISK_DOT_H__
 #define __GFS_ONDISK_DOT_H__
 
+#include <endian.h>
+#include <byteorder.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+
+#define be16_to_cpu(x) (x)
+#define be32_to_cpu(x) (x)
+#define be64_to_cpu(x) (x)
+
+#define cpu_to_be16(x) (x)
+#define cpu_to_be32(x) (x)
+#define cpu_to_be64(x) (x)
+
+#define le16_to_cpu(x) (bswap_16((x)))
+#define le32_to_cpu(x) (bswap_32((x)))
+#define le64_to_cpu(x) (bswap_64((x)))
+
+#define cpu_to_le16(x) (bswap_16((x)))
+#define cpu_to_le32(x) (bswap_32((x)))
+#define cpu_to_le64(x) (bswap_64((x)))
+
+#endif  /*  __BYTE_ORDER == __BIG_ENDIAN  */
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+
+#define be16_to_cpu(x) (bswap_16((x)))
+#define be32_to_cpu(x) (bswap_32((x)))
+#define be64_to_cpu(x) (bswap_64((x)))
+
+#define cpu_to_be16(x) (bswap_16((x)))
+#define cpu_to_be32(x) (bswap_32((x)))
+#define cpu_to_be64(x) (bswap_64((x))) 
+
+#define le16_to_cpu(x) (x)
+#define le32_to_cpu(x) (x)
+#define le64_to_cpu(x) (x)
+
+#define cpu_to_le16(x) (x)
+#define cpu_to_le32(x) (x)
+#define cpu_to_le64(x) (x)
+
+#endif  /*  __BYTE_ORDER == __LITTLE_ENDIAN  */
+
 #define GFS_MAGIC               (0x01161970) /* for all on-disk headers */
 #define GFS_BASIC_BLOCK         (512)  /* "basic block" = "sector" = 512B */
 #define GFS_BASIC_BLOCK_SHIFT   (9)
diff --git a/gfs2/mount/ondisk1.c b/gfs2/mount/ondisk1.c
index 0a64021..846a702 100644
--- a/gfs2/mount/ondisk1.c
+++ b/gfs2/mount/ondisk1.c
@@ -4,8 +4,6 @@
 #include <stdint.h>
 #include <inttypes.h>
 
-#include "linux_endian.h"
-
 #define printk printf
 #define pv(struct, member, fmt) printf("  "#member" = "fmt"\n", struct->member);
 
diff --git a/gfs2/mount/util.h b/gfs2/mount/util.h
index 14c5182..2d40d82 100644
--- a/gfs2/mount/util.h
+++ b/gfs2/mount/util.h
@@ -20,7 +20,6 @@
 #include <linux/types.h>
 #include <linux/gfs2_ondisk.h>
 #include "gfs_ondisk.h"
-#include "linux_endian.h"
 
 #define die(fmt, args...) \
 do { \
diff --git a/gfs2/quota/gfs2_quota.h b/gfs2/quota/gfs2_quota.h
index 7e31e4f..bcd945d 100644
--- a/gfs2/quota/gfs2_quota.h
+++ b/gfs2/quota/gfs2_quota.h
@@ -2,7 +2,6 @@
 #define __GFS2_QUOTA_DOT_H__
 
 #include "libgfs2.h"
-#include "linux_endian.h"
 #include <linux/gfs2_ondisk.h>
 
 #define type_zalloc(ptr, type, count) \
diff --git a/gfs2/tool/ondisk.c b/gfs2/tool/ondisk.c
index 6a31832..d10cfd8 100644
--- a/gfs2/tool/ondisk.c
+++ b/gfs2/tool/ondisk.c
@@ -5,8 +5,6 @@
 #include <inttypes.h>
 #include <linux/types.h>
 
-#include "linux_endian.h"
-
 #define printk printf
 
 #define WANT_GFS2_CONVERSION_FUNCTIONS
diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h
index ec9c0c6..37b57aa 100644
--- a/group/gfs_controld/gfs_daemon.h
+++ b/group/gfs_controld/gfs_daemon.h
@@ -40,7 +40,6 @@
 #include "libgfscontrol.h"
 #include "gfs_controld.h"
 #include "list.h"
-#include "linux_endian.h"
 
 /* TODO: warn if
    DLM_LOCKSPACE_LEN (from dlmconstants.h) !=



More information about the Cluster-cvs mailing list