aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_export.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-10-14 10:46:30 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:33:46 -0500
commitb44b84d765b02f813a67b96bf79e3b5d4d621631 (patch)
treecc5353f1c7f4cacf8560d52c47f108333f179792 /fs/gfs2/ops_export.c
parentb62f963e1fdf838fed91faec21228d421a834f2d (diff)
[GFS2] gfs2 misc endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_export.c')
-rw-r--r--fs/gfs2/ops_export.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c
index 33423a5c329b..b4e7b8775315 100644
--- a/fs/gfs2/ops_export.c
+++ b/fs/gfs2/ops_export.c
@@ -27,13 +27,14 @@
27#include "util.h" 27#include "util.h"
28 28
29static struct dentry *gfs2_decode_fh(struct super_block *sb, 29static struct dentry *gfs2_decode_fh(struct super_block *sb,
30 __u32 *fh, 30 __u32 *p,
31 int fh_len, 31 int fh_len,
32 int fh_type, 32 int fh_type,
33 int (*acceptable)(void *context, 33 int (*acceptable)(void *context,
34 struct dentry *dentry), 34 struct dentry *dentry),
35 void *context) 35 void *context)
36{ 36{
37 __be32 *fh = (__force __be32 *)p;
37 struct gfs2_fh_obj fh_obj; 38 struct gfs2_fh_obj fh_obj;
38 struct gfs2_inum_host *this, parent; 39 struct gfs2_inum_host *this, parent;
39 40
@@ -65,9 +66,10 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb,
65 acceptable, context); 66 acceptable, context);
66} 67}
67 68
68static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len, 69static int gfs2_encode_fh(struct dentry *dentry, __u32 *p, int *len,
69 int connectable) 70 int connectable)
70{ 71{
72 __be32 *fh = (__force __be32 *)p;
71 struct inode *inode = dentry->d_inode; 73 struct inode *inode = dentry->d_inode;
72 struct super_block *sb = inode->i_sb; 74 struct super_block *sb = inode->i_sb;
73 struct gfs2_inode *ip = GFS2_I(inode); 75 struct gfs2_inode *ip = GFS2_I(inode);
@@ -76,14 +78,10 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
76 (connectable && *len < GFS2_LARGE_FH_SIZE)) 78 (connectable && *len < GFS2_LARGE_FH_SIZE))
77 return 255; 79 return 255;
78 80
79 fh[0] = ip->i_num.no_formal_ino >> 32; 81 fh[0] = cpu_to_be32(ip->i_num.no_formal_ino >> 32);
80 fh[0] = cpu_to_be32(fh[0]); 82 fh[1] = cpu_to_be32(ip->i_num.no_formal_ino & 0xFFFFFFFF);
81 fh[1] = ip->i_num.no_formal_ino & 0xFFFFFFFF; 83 fh[2] = cpu_to_be32(ip->i_num.no_addr >> 32);
82 fh[1] = cpu_to_be32(fh[1]); 84 fh[3] = cpu_to_be32(ip->i_num.no_addr & 0xFFFFFFFF);
83 fh[2] = ip->i_num.no_addr >> 32;
84 fh[2] = cpu_to_be32(fh[2]);
85 fh[3] = ip->i_num.no_addr & 0xFFFFFFFF;
86 fh[3] = cpu_to_be32(fh[3]);
87 *len = GFS2_SMALL_FH_SIZE; 85 *len = GFS2_SMALL_FH_SIZE;
88 86
89 if (!connectable || inode == sb->s_root->d_inode) 87 if (!connectable || inode == sb->s_root->d_inode)
@@ -95,14 +93,10 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
95 igrab(inode); 93 igrab(inode);
96 spin_unlock(&dentry->d_lock); 94 spin_unlock(&dentry->d_lock);
97 95
98 fh[4] = ip->i_num.no_formal_ino >> 32; 96 fh[4] = cpu_to_be32(ip->i_num.no_formal_ino >> 32);
99 fh[4] = cpu_to_be32(fh[4]); 97 fh[5] = cpu_to_be32(ip->i_num.no_formal_ino & 0xFFFFFFFF);
100 fh[5] = ip->i_num.no_formal_ino & 0xFFFFFFFF; 98 fh[6] = cpu_to_be32(ip->i_num.no_addr >> 32);
101 fh[5] = cpu_to_be32(fh[5]); 99 fh[7] = cpu_to_be32(ip->i_num.no_addr & 0xFFFFFFFF);
102 fh[6] = ip->i_num.no_addr >> 32;
103 fh[6] = cpu_to_be32(fh[6]);
104 fh[7] = ip->i_num.no_addr & 0xFFFFFFFF;
105 fh[7] = cpu_to_be32(fh[7]);
106 100
107 fh[8] = cpu_to_be32(inode->i_mode); 101 fh[8] = cpu_to_be32(inode->i_mode);
108 fh[9] = 0; /* pad to double word */ 102 fh[9] = 0; /* pad to double word */