diff options
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index d67a3760ca30..59dc823c2833 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -713,12 +713,12 @@ static int get_leaf(struct gfs2_inode *dip, u64 leaf_no, | |||
713 | static int get_leaf_nr(struct gfs2_inode *dip, u32 index, | 713 | static int get_leaf_nr(struct gfs2_inode *dip, u32 index, |
714 | u64 *leaf_out) | 714 | u64 *leaf_out) |
715 | { | 715 | { |
716 | u64 leaf_no; | 716 | __be64 leaf_no; |
717 | int error; | 717 | int error; |
718 | 718 | ||
719 | error = gfs2_dir_read_data(dip, (char *)&leaf_no, | 719 | error = gfs2_dir_read_data(dip, (char *)&leaf_no, |
720 | index * sizeof(u64), | 720 | index * sizeof(__be64), |
721 | sizeof(u64), 0); | 721 | sizeof(__be64), 0); |
722 | if (error != sizeof(u64)) | 722 | if (error != sizeof(u64)) |
723 | return (error < 0) ? error : -EIO; | 723 | return (error < 0) ? error : -EIO; |
724 | 724 | ||
@@ -837,7 +837,8 @@ static int dir_make_exhash(struct inode *inode) | |||
837 | struct gfs2_leaf *leaf; | 837 | struct gfs2_leaf *leaf; |
838 | int y; | 838 | int y; |
839 | u32 x; | 839 | u32 x; |
840 | u64 *lp, bn; | 840 | __be64 *lp; |
841 | u64 bn; | ||
841 | int error; | 842 | int error; |
842 | 843 | ||
843 | error = gfs2_meta_inode_buffer(dip, &dibh); | 844 | error = gfs2_meta_inode_buffer(dip, &dibh); |
@@ -893,7 +894,7 @@ static int dir_make_exhash(struct inode *inode) | |||
893 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); | 894 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
894 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); | 895 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); |
895 | 896 | ||
896 | lp = (u64 *)(dibh->b_data + sizeof(struct gfs2_dinode)); | 897 | lp = (__be64 *)(dibh->b_data + sizeof(struct gfs2_dinode)); |
897 | 898 | ||
898 | for (x = sdp->sd_hash_ptrs; x--; lp++) | 899 | for (x = sdp->sd_hash_ptrs; x--; lp++) |
899 | *lp = cpu_to_be64(bn); | 900 | *lp = cpu_to_be64(bn); |
@@ -929,7 +930,8 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) | |||
929 | struct gfs2_leaf *nleaf, *oleaf; | 930 | struct gfs2_leaf *nleaf, *oleaf; |
930 | struct gfs2_dirent *dent = NULL, *prev = NULL, *next = NULL, *new; | 931 | struct gfs2_dirent *dent = NULL, *prev = NULL, *next = NULL, *new; |
931 | u32 start, len, half_len, divider; | 932 | u32 start, len, half_len, divider; |
932 | u64 bn, *lp, leaf_no; | 933 | u64 bn, leaf_no; |
934 | __be64 *lp; | ||
933 | u32 index; | 935 | u32 index; |
934 | int x, moved = 0; | 936 | int x, moved = 0; |
935 | int error; | 937 | int error; |
@@ -974,7 +976,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) | |||
974 | /* Change the pointers. | 976 | /* Change the pointers. |
975 | Don't bother distinguishing stuffed from non-stuffed. | 977 | Don't bother distinguishing stuffed from non-stuffed. |
976 | This code is complicated enough already. */ | 978 | This code is complicated enough already. */ |
977 | lp = kmalloc(half_len * sizeof(u64), GFP_NOFS | __GFP_NOFAIL); | 979 | lp = kmalloc(half_len * sizeof(__be64), GFP_NOFS | __GFP_NOFAIL); |
978 | /* Change the pointers */ | 980 | /* Change the pointers */ |
979 | for (x = 0; x < half_len; x++) | 981 | for (x = 0; x < half_len; x++) |
980 | lp[x] = cpu_to_be64(bn); | 982 | lp[x] = cpu_to_be64(bn); |
@@ -1341,7 +1343,7 @@ static int dir_e_read(struct inode *inode, u64 *offset, void *opaque, | |||
1341 | u32 hsize, len = 0; | 1343 | u32 hsize, len = 0; |
1342 | u32 ht_offset, lp_offset, ht_offset_cur = -1; | 1344 | u32 ht_offset, lp_offset, ht_offset_cur = -1; |
1343 | u32 hash, index; | 1345 | u32 hash, index; |
1344 | u64 *lp; | 1346 | __be64 *lp; |
1345 | int copied = 0; | 1347 | int copied = 0; |
1346 | int error = 0; | 1348 | int error = 0; |
1347 | unsigned depth = 0; | 1349 | unsigned depth = 0; |
@@ -1365,7 +1367,7 @@ static int dir_e_read(struct inode *inode, u64 *offset, void *opaque, | |||
1365 | 1367 | ||
1366 | if (ht_offset_cur != ht_offset) { | 1368 | if (ht_offset_cur != ht_offset) { |
1367 | error = gfs2_dir_read_data(dip, (char *)lp, | 1369 | error = gfs2_dir_read_data(dip, (char *)lp, |
1368 | ht_offset * sizeof(u64), | 1370 | ht_offset * sizeof(__be64), |
1369 | sdp->sd_hash_bsize, 1); | 1371 | sdp->sd_hash_bsize, 1); |
1370 | if (error != sdp->sd_hash_bsize) { | 1372 | if (error != sdp->sd_hash_bsize) { |
1371 | if (error >= 0) | 1373 | if (error >= 0) |
@@ -1715,7 +1717,7 @@ static int foreach_leaf(struct gfs2_inode *dip, leaf_call_t lc, void *data) | |||
1715 | u32 hsize, len; | 1717 | u32 hsize, len; |
1716 | u32 ht_offset, lp_offset, ht_offset_cur = -1; | 1718 | u32 ht_offset, lp_offset, ht_offset_cur = -1; |
1717 | u32 index = 0; | 1719 | u32 index = 0; |
1718 | u64 *lp; | 1720 | __be64 *lp; |
1719 | u64 leaf_no; | 1721 | u64 leaf_no; |
1720 | int error = 0; | 1722 | int error = 0; |
1721 | 1723 | ||
@@ -1735,7 +1737,7 @@ static int foreach_leaf(struct gfs2_inode *dip, leaf_call_t lc, void *data) | |||
1735 | 1737 | ||
1736 | if (ht_offset_cur != ht_offset) { | 1738 | if (ht_offset_cur != ht_offset) { |
1737 | error = gfs2_dir_read_data(dip, (char *)lp, | 1739 | error = gfs2_dir_read_data(dip, (char *)lp, |
1738 | ht_offset * sizeof(u64), | 1740 | ht_offset * sizeof(__be64), |
1739 | sdp->sd_hash_bsize, 1); | 1741 | sdp->sd_hash_bsize, 1); |
1740 | if (error != sdp->sd_hash_bsize) { | 1742 | if (error != sdp->sd_hash_bsize) { |
1741 | if (error >= 0) | 1743 | if (error >= 0) |