From: Gil <gil@fooplanet.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: How do I find endian-conversion function on Redhar/Fedora
Date: Sun, 05 Feb 2006 15:12:06 -0800 [thread overview]
Message-ID: <43E68646.4000209@fooplanet.com> (raw)
In-Reply-To: <17382.30814.778053.416244@cse.unsw.edu.au>
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
Neil Brown wrote:
> So my plea for help: Could someone with a Redhat installation
> please see if there is any way to get functions that convert
> between little endian and host endian, or if there is some name I
> can #define to disable the 'private kernel header' warning..
I have an FC4 machine that I tried this out on. I have no idea if
this is the right way to use these headers in /usr/include/linux,
but it made the compile problem go away at least.
--Gil
[-- Attachment #2: mdadm-2.3-byteorder.patch --]
[-- Type: text/plain, Size: 1966 bytes --]
diff -r -u mdadm-2.3/bitmap.c mdadm-2.3-patched/bitmap.c
--- mdadm-2.3/bitmap.c 2005-12-15 17:41:31.000000000 -0800
+++ mdadm-2.3-patched/bitmap.c 2006-02-05 15:09:32.000000000 -0800
@@ -21,7 +21,16 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "mdadm.h"
-#include <asm/byteorder.h>
+#include <endian.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# include <linux/byteorder/little_endian.h>
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# include <linux/byteorder/big_endian.h>
+#elif __BYTE_ORDER == __PDP_ENDIAN
+# include <linux/byteorder/pdp_endian.h>
+#else
+# error "unknown endianness."
+#endif
#define min(a,b) (((a) < (b)) ? (a) : (b))
diff -r -u mdadm-2.3/super0.c mdadm-2.3-patched/super0.c
--- mdadm-2.3/super0.c 2006-01-26 23:06:09.000000000 -0800
+++ mdadm-2.3-patched/super0.c 2006-02-05 14:59:37.000000000 -0800
@@ -28,7 +28,18 @@
*/
#include "mdadm.h"
-#include <asm/byteorder.h>
+
+#include <endian.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# include <linux/byteorder/little_endian.h>
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# include <linux/byteorder/big_endian.h>
+#elif __BYTE_ORDER == __PDP_ENDIAN
+# include <linux/byteorder/pdp_endian.h>
+#else
+# error "unknown endianness."
+#endif
+
/*
* All handling for the 0.90.0 version superblock is in
Only in mdadm-2.3-patched: .super0.c.swp
diff -r -u mdadm-2.3/super1.c mdadm-2.3-patched/super1.c
--- mdadm-2.3/super1.c 2006-01-30 17:45:32.000000000 -0800
+++ mdadm-2.3-patched/super1.c 2006-02-05 15:09:05.000000000 -0800
@@ -29,7 +29,15 @@
#include "mdadm.h"
#include <endian.h>
-#include "asm/byteorder.h"
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# include <linux/byteorder/little_endian.h>
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# include <linux/byteorder/big_endian.h>
+#elif __BYTE_ORDER == __PDP_ENDIAN
+# include <linux/byteorder/pdp_endian.h>
+#else
+# error "unknown endianness."
+#endif
/*
* The version-1 superblock :
* All numeric fields are little-endian.
next prev parent reply other threads:[~2006-02-05 23:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-05 0:47 Newbie questions: Max Active disks, RAID migration, Compiling mdadm 2.3 Martin Ritchie
2006-02-05 2:13 ` Mike Hardy
2006-02-05 22:12 ` How do I find endian-conversion function on Redhar/Fedora Neil Brown
2006-02-05 23:12 ` Gil [this message]
2006-02-06 0:18 ` Neil Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E68646.4000209@fooplanet.com \
--to=gil@fooplanet.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).