public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* gfs2-utils: master - mount.gfs2: Move the endian functions out of gfs_ondisk.h
@ 2009-02-19 9:45 Steven Whitehouse
0 siblings, 0 replies; only message in thread
From: Steven Whitehouse @ 2009-02-19 9:45 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=aa9d5f4680f56ef527d85c1561be82db7a4b5f48
Commit: aa9d5f4680f56ef527d85c1561be82db7a4b5f48
Parent: 06da4a72b8262be8380dde551f4ecfb59511fd37
Author: Steven Whitehouse <swhiteho@redhat.com>
AuthorDate: Thu Feb 19 08:33:09 2009 +0000
Committer: Steven Whitehouse <swhiteho@redhat.com>
CommitterDate: Thu Feb 19 08:33:09 2009 +0000
mount.gfs2: Move the endian functions out of gfs_ondisk.h
Its only required in two files, so I've moved it into those
directly.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
gfs2/mount/gfs_ondisk.h | 43 -------------------------------------------
gfs2/mount/ondisk1.c | 42 ++++++++++++++++++++++++++++++++++++++++++
gfs2/mount/util.c | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+), 43 deletions(-)
diff --git a/gfs2/mount/gfs_ondisk.h b/gfs2/mount/gfs_ondisk.h
index 61cf30d..0648d28 100644
--- a/gfs2/mount/gfs_ondisk.h
+++ b/gfs2/mount/gfs_ondisk.h
@@ -80,49 +80,6 @@
#ifndef __GFS_ONDISK_DOT_H__
#define __GFS_ONDISK_DOT_H__
-#include <endian.h>
-#include <byteswap.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 846a702..8b3d2c4 100644
--- a/gfs2/mount/ondisk1.c
+++ b/gfs2/mount/ondisk1.c
@@ -3,6 +3,8 @@
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
+#include <endian.h>
+#include <byteswap.h>
#define printk printf
#define pv(struct, member, fmt) printf(" "#member" = "fmt"\n", struct->member);
@@ -12,6 +14,46 @@
#define RET(x) return
#define RETURN(x, y) return y
+#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 WANT_GFS_CONVERSION_FUNCTIONS
#include "gfs_ondisk.h"
diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c
index cbe2a3a..ca48fe9 100644
--- a/gfs2/mount/util.c
+++ b/gfs2/mount/util.c
@@ -1,6 +1,48 @@
+#include <endian.h>
+#include <byteswap.h>
#include "util.h"
#include "libgfscontrol.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 */
+
extern char *prog_name;
extern char *fsname;
extern int verbose;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-19 9:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-19 9:45 gfs2-utils: master - mount.gfs2: Move the endian functions out of gfs_ondisk.h Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).