The patch titled

     v9fs: use standard kernel byteswapping routines

has been added to the -mm tree.  Its filename is

     v9fs-9p-protocol-implementation-use-standard-kernel-byteswapping.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

v9fs-documentation-makefiles-configuration.patch
v9fs-documentation-makefiles-configuration-add-fd-based-transport-to-makefile-docs.patch
v9fs-vfs-file-dentry-and-directory-operations.patch
v9fs-vfs-inode-operations.patch
v9fs-vfs-superblock-operations-and-glue.patch
v9fs-vfs-superblock-operations-and-glue-add-fd-based-transport-to-mount-options.patch
v9fs-9p-protocol-implementation.patch
v9fs-9p-protocol-implementation-use-standard-kernel-byteswapping.patch
v9fs-transport-modules.patch
v9fs-transport-modules-add-fd-based-transport-module.patch
v9fs-transport-modules-fix-a-problem-with-named-pipe-transport.patch
v9fs-debug-and-support-routines.patch
v9fs-change-error-magic-numbers-to-defined-constants.patch
v9fs-clean-up-vfs_inode-and-setattr-functions.patch
v9fs-fix-support-for-special-files-devices-named-pipes-etc.patch
v9fs-readlink-extended-mode-check.patch
v9fs-fix-handling-of-malformed-9p-messages.patch
v9fs-adjust-follow_link-and-put_link-to.patch
v9fs-fix-plan9port-example-in-v9fs.patch
v9fs-remove-sparse-bitwise-warnings.patch



From: Eric Van Hensbergen <[EMAIL PROTECTED]>

Originally suggested by hch, we have removed our byteswap code and replaced it
with calls to the standard kernel byteswapping code.

Signed-off-by: Eric Van Hensbergen <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/9p/conv.c |   28 ++++++----------------------
 1 files changed, 6 insertions(+), 22 deletions(-)

diff -puN 
fs/9p/conv.c~v9fs-9p-protocol-implementation-use-standard-kernel-byteswapping 
fs/9p/conv.c
--- 
devel/fs/9p/conv.c~v9fs-9p-protocol-implementation-use-standard-kernel-byteswapping
 2005-08-29 22:24:25.000000000 -0700
+++ devel-akpm/fs/9p/conv.c     2005-08-29 22:24:25.000000000 -0700
@@ -88,8 +88,7 @@ static inline void buf_put_int16(struct 
 {
        buf_check_size(buf, 2);
 
-       buf->p[0] = val;
-       buf->p[1] = val >> 8;
+       *(u16 *) buf->p = cpu_to_le16(val);
        buf->p += 2;
 }
 
@@ -97,10 +96,7 @@ static inline void buf_put_int32(struct 
 {
        buf_check_size(buf, 4);
 
-       buf->p[0] = val;
-       buf->p[1] = val >> 8;
-       buf->p[2] = val >> 16;
-       buf->p[3] = val >> 24;
+       *(u32 *)buf->p = cpu_to_le32(val);
        buf->p += 4;
 }
 
@@ -108,14 +104,7 @@ static inline void buf_put_int64(struct 
 {
        buf_check_size(buf, 8);
 
-       buf->p[0] = val;
-       buf->p[1] = val >> 8;
-       buf->p[2] = val >> 16;
-       buf->p[3] = val >> 24;
-       buf->p[4] = val >> 32;
-       buf->p[5] = val >> 40;
-       buf->p[6] = val >> 48;
-       buf->p[7] = val >> 56;
+       *(u64 *)buf->p = cpu_to_le64(val);
        buf->p += 8;
 }
 
@@ -158,7 +147,7 @@ static inline u16 buf_get_int16(struct c
        u16 ret = 0;
 
        buf_check_size(buf, 2);
-       ret = buf->p[0] | (buf->p[1] << 8);
+       ret = le16_to_cpu(*(u16 *)buf->p);
 
        buf->p += 2;
 
@@ -170,9 +159,7 @@ static inline u32 buf_get_int32(struct c
        u32 ret = 0;
 
        buf_check_size(buf, 4);
-       ret =
-           buf->p[0] | (buf->p[1] << 8) | (buf->p[2] << 16) | (buf->
-                                                               p[3] << 24);
+       ret = le32_to_cpu(*(u32 *)buf->p);
 
        buf->p += 4;
 
@@ -184,10 +171,7 @@ static inline u64 buf_get_int64(struct c
        u64 ret = 0;
 
        buf_check_size(buf, 8);
-       ret = (u64) buf->p[0] | ((u64) buf->p[1] << 8) |
-           ((u64) buf->p[2] << 16) | ((u64) buf->p[3] << 24) |
-           ((u64) buf->p[4] << 32) | ((u64) buf->p[5] << 40) |
-           ((u64) buf->p[6] << 48) | ((u64) buf->p[7] << 56);
+       ret = le64_to_cpu(*(u64 *)buf->p);
 
        buf->p += 8;
 
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to