aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.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/eattr.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/eattr.c')
-rw-r--r--fs/gfs2/eattr.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index a65a4ccfd4dd..518f0c0786c8 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -112,7 +112,7 @@ fail:
112static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data) 112static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data)
113{ 113{
114 struct buffer_head *bh, *eabh; 114 struct buffer_head *bh, *eabh;
115 u64 *eablk, *end; 115 __be64 *eablk, *end;
116 int error; 116 int error;
117 117
118 error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT, &bh); 118 error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT, &bh);
@@ -129,7 +129,7 @@ static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data)
129 goto out; 129 goto out;
130 } 130 }
131 131
132 eablk = (u64 *)(bh->b_data + sizeof(struct gfs2_meta_header)); 132 eablk = (__be64 *)(bh->b_data + sizeof(struct gfs2_meta_header));
133 end = eablk + GFS2_SB(&ip->i_inode)->sd_inptrs; 133 end = eablk + GFS2_SB(&ip->i_inode)->sd_inptrs;
134 134
135 for (; eablk < end; eablk++) { 135 for (; eablk < end; eablk++) {
@@ -224,7 +224,8 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
224 struct gfs2_rgrpd *rgd; 224 struct gfs2_rgrpd *rgd;
225 struct gfs2_holder rg_gh; 225 struct gfs2_holder rg_gh;
226 struct buffer_head *dibh; 226 struct buffer_head *dibh;
227 u64 *dataptrs, bn = 0; 227 __be64 *dataptrs;
228 u64 bn = 0;
228 u64 bstart = 0; 229 u64 bstart = 0;
229 unsigned int blen = 0; 230 unsigned int blen = 0;
230 unsigned int blks = 0; 231 unsigned int blks = 0;
@@ -444,7 +445,7 @@ static int ea_get_unstuffed(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
444 struct buffer_head **bh; 445 struct buffer_head **bh;
445 unsigned int amount = GFS2_EA_DATA_LEN(ea); 446 unsigned int amount = GFS2_EA_DATA_LEN(ea);
446 unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize); 447 unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize);
447 u64 *dataptrs = GFS2_EA2DATAPTRS(ea); 448 __be64 *dataptrs = GFS2_EA2DATAPTRS(ea);
448 unsigned int x; 449 unsigned int x;
449 int error = 0; 450 int error = 0;
450 451
@@ -629,7 +630,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
629 ea->ea_num_ptrs = 0; 630 ea->ea_num_ptrs = 0;
630 memcpy(GFS2_EA2DATA(ea), er->er_data, er->er_data_len); 631 memcpy(GFS2_EA2DATA(ea), er->er_data, er->er_data_len);
631 } else { 632 } else {
632 u64 *dataptr = GFS2_EA2DATAPTRS(ea); 633 __be64 *dataptr = GFS2_EA2DATAPTRS(ea);
633 const char *data = er->er_data; 634 const char *data = er->er_data;
634 unsigned int data_len = er->er_data_len; 635 unsigned int data_len = er->er_data_len;
635 unsigned int copy; 636 unsigned int copy;
@@ -931,12 +932,12 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
931{ 932{
932 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 933 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
933 struct buffer_head *indbh, *newbh; 934 struct buffer_head *indbh, *newbh;
934 u64 *eablk; 935 __be64 *eablk;
935 int error; 936 int error;
936 int mh_size = sizeof(struct gfs2_meta_header); 937 int mh_size = sizeof(struct gfs2_meta_header);
937 938
938 if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) { 939 if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) {
939 u64 *end; 940 __be64 *end;
940 941
941 error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT, 942 error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, DIO_WAIT,
942 &indbh); 943 &indbh);
@@ -948,7 +949,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
948 goto out; 949 goto out;
949 } 950 }
950 951
951 eablk = (u64 *)(indbh->b_data + mh_size); 952 eablk = (__be64 *)(indbh->b_data + mh_size);
952 end = eablk + sdp->sd_inptrs; 953 end = eablk + sdp->sd_inptrs;
953 954
954 for (; eablk < end; eablk++) 955 for (; eablk < end; eablk++)
@@ -971,7 +972,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
971 gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN); 972 gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
972 gfs2_buffer_clear_tail(indbh, mh_size); 973 gfs2_buffer_clear_tail(indbh, mh_size);
973 974
974 eablk = (u64 *)(indbh->b_data + mh_size); 975 eablk = (__be64 *)(indbh->b_data + mh_size);
975 *eablk = cpu_to_be64(ip->i_di.di_eattr); 976 *eablk = cpu_to_be64(ip->i_di.di_eattr);
976 ip->i_di.di_eattr = blk; 977 ip->i_di.di_eattr = blk;
977 ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; 978 ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT;
@@ -1202,7 +1203,7 @@ static int ea_acl_chmod_unstuffed(struct gfs2_inode *ip,
1202 struct buffer_head **bh; 1203 struct buffer_head **bh;
1203 unsigned int amount = GFS2_EA_DATA_LEN(ea); 1204 unsigned int amount = GFS2_EA_DATA_LEN(ea);
1204 unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize); 1205 unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize);
1205 u64 *dataptrs = GFS2_EA2DATAPTRS(ea); 1206 __be64 *dataptrs = GFS2_EA2DATAPTRS(ea);
1206 unsigned int x; 1207 unsigned int x;
1207 int error; 1208 int error;
1208 1209
@@ -1300,7 +1301,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
1300 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 1301 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
1301 struct gfs2_rgrp_list rlist; 1302 struct gfs2_rgrp_list rlist;
1302 struct buffer_head *indbh, *dibh; 1303 struct buffer_head *indbh, *dibh;
1303 u64 *eablk, *end; 1304 __be64 *eablk, *end;
1304 unsigned int rg_blocks = 0; 1305 unsigned int rg_blocks = 0;
1305 u64 bstart = 0; 1306 u64 bstart = 0;
1306 unsigned int blen = 0; 1307 unsigned int blen = 0;
@@ -1319,7 +1320,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
1319 goto out; 1320 goto out;
1320 } 1321 }
1321 1322
1322 eablk = (u64 *)(indbh->b_data + sizeof(struct gfs2_meta_header)); 1323 eablk = (__be64 *)(indbh->b_data + sizeof(struct gfs2_meta_header));
1323 end = eablk + sdp->sd_inptrs; 1324 end = eablk + sdp->sd_inptrs;
1324 1325
1325 for (; eablk < end; eablk++) { 1326 for (; eablk < end; eablk++) {
@@ -1363,7 +1364,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
1363 1364
1364 gfs2_trans_add_bh(ip->i_gl, indbh, 1); 1365 gfs2_trans_add_bh(ip->i_gl, indbh, 1);
1365 1366
1366 eablk = (u64 *)(indbh->b_data + sizeof(struct gfs2_meta_header)); 1367 eablk = (__be64 *)(indbh->b_data + sizeof(struct gfs2_meta_header));
1367 bstart = 0; 1368 bstart = 0;
1368 blen = 0; 1369 blen = 0;
1369 1370