diff options
Diffstat (limited to 'fs/gfs2/eattr.c')
-rw-r--r-- | fs/gfs2/eattr.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c index 5a56e6568622..f6b5e306a6c8 100644 --- a/fs/gfs2/eattr.c +++ b/fs/gfs2/eattr.c | |||
@@ -115,7 +115,7 @@ fail: | |||
115 | static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data) | 115 | static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data) |
116 | { | 116 | { |
117 | struct buffer_head *bh, *eabh; | 117 | struct buffer_head *bh, *eabh; |
118 | uint64_t *eablk, *end; | 118 | u64 *eablk, *end; |
119 | int error; | 119 | int error; |
120 | 120 | ||
121 | error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, | 121 | error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, |
@@ -133,11 +133,11 @@ static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data) | |||
133 | goto out; | 133 | goto out; |
134 | } | 134 | } |
135 | 135 | ||
136 | eablk = (uint64_t *)(bh->b_data + sizeof(struct gfs2_meta_header)); | 136 | eablk = (u64 *)(bh->b_data + sizeof(struct gfs2_meta_header)); |
137 | end = eablk + GFS2_SB(&ip->i_inode)->sd_inptrs; | 137 | end = eablk + GFS2_SB(&ip->i_inode)->sd_inptrs; |
138 | 138 | ||
139 | for (; eablk < end; eablk++) { | 139 | for (; eablk < end; eablk++) { |
140 | uint64_t bn; | 140 | u64 bn; |
141 | 141 | ||
142 | if (!*eablk) | 142 | if (!*eablk) |
143 | break; | 143 | break; |
@@ -235,8 +235,8 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
235 | struct gfs2_rgrpd *rgd; | 235 | struct gfs2_rgrpd *rgd; |
236 | struct gfs2_holder rg_gh; | 236 | struct gfs2_holder rg_gh; |
237 | struct buffer_head *dibh; | 237 | struct buffer_head *dibh; |
238 | uint64_t *dataptrs, bn = 0; | 238 | u64 *dataptrs, bn = 0; |
239 | uint64_t bstart = 0; | 239 | u64 bstart = 0; |
240 | unsigned int blen = 0; | 240 | unsigned int blen = 0; |
241 | unsigned int blks = 0; | 241 | unsigned int blks = 0; |
242 | unsigned int x; | 242 | unsigned int x; |
@@ -296,7 +296,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
296 | gfs2_free_meta(ip, bstart, blen); | 296 | gfs2_free_meta(ip, bstart, blen); |
297 | 297 | ||
298 | if (prev && !leave) { | 298 | if (prev && !leave) { |
299 | uint32_t len; | 299 | u32 len; |
300 | 300 | ||
301 | len = GFS2_EA_REC_LEN(prev) + GFS2_EA_REC_LEN(ea); | 301 | len = GFS2_EA_REC_LEN(prev) + GFS2_EA_REC_LEN(ea); |
302 | prev->ea_rec_len = cpu_to_be32(len); | 302 | prev->ea_rec_len = cpu_to_be32(len); |
@@ -459,7 +459,7 @@ static int ea_get_unstuffed(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
459 | struct buffer_head **bh; | 459 | struct buffer_head **bh; |
460 | unsigned int amount = GFS2_EA_DATA_LEN(ea); | 460 | unsigned int amount = GFS2_EA_DATA_LEN(ea); |
461 | unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize); | 461 | unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize); |
462 | uint64_t *dataptrs = GFS2_EA2DATAPTRS(ea); | 462 | u64 *dataptrs = GFS2_EA2DATAPTRS(ea); |
463 | unsigned int x; | 463 | unsigned int x; |
464 | int error = 0; | 464 | int error = 0; |
465 | 465 | ||
@@ -601,7 +601,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp) | |||
601 | { | 601 | { |
602 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 602 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
603 | struct gfs2_ea_header *ea; | 603 | struct gfs2_ea_header *ea; |
604 | uint64_t block; | 604 | u64 block; |
605 | 605 | ||
606 | block = gfs2_alloc_meta(ip); | 606 | block = gfs2_alloc_meta(ip); |
607 | 607 | ||
@@ -649,7 +649,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
649 | ea->ea_num_ptrs = 0; | 649 | ea->ea_num_ptrs = 0; |
650 | memcpy(GFS2_EA2DATA(ea), er->er_data, er->er_data_len); | 650 | memcpy(GFS2_EA2DATA(ea), er->er_data, er->er_data_len); |
651 | } else { | 651 | } else { |
652 | uint64_t *dataptr = GFS2_EA2DATAPTRS(ea); | 652 | u64 *dataptr = GFS2_EA2DATAPTRS(ea); |
653 | const char *data = er->er_data; | 653 | const char *data = er->er_data; |
654 | unsigned int data_len = er->er_data_len; | 654 | unsigned int data_len = er->er_data_len; |
655 | unsigned int copy; | 655 | unsigned int copy; |
@@ -658,7 +658,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
658 | ea->ea_num_ptrs = DIV_ROUND_UP(er->er_data_len, sdp->sd_jbsize); | 658 | ea->ea_num_ptrs = DIV_ROUND_UP(er->er_data_len, sdp->sd_jbsize); |
659 | for (x = 0; x < ea->ea_num_ptrs; x++) { | 659 | for (x = 0; x < ea->ea_num_ptrs; x++) { |
660 | struct buffer_head *bh; | 660 | struct buffer_head *bh; |
661 | uint64_t block; | 661 | u64 block; |
662 | int mh_size = sizeof(struct gfs2_meta_header); | 662 | int mh_size = sizeof(struct gfs2_meta_header); |
663 | 663 | ||
664 | block = gfs2_alloc_meta(ip); | 664 | block = gfs2_alloc_meta(ip); |
@@ -676,7 +676,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
676 | memset(bh->b_data + mh_size + copy, 0, | 676 | memset(bh->b_data + mh_size + copy, 0, |
677 | sdp->sd_jbsize - copy); | 677 | sdp->sd_jbsize - copy); |
678 | 678 | ||
679 | *dataptr++ = cpu_to_be64((uint64_t)bh->b_blocknr); | 679 | *dataptr++ = cpu_to_be64((u64)bh->b_blocknr); |
680 | data += copy; | 680 | data += copy; |
681 | data_len -= copy; | 681 | data_len -= copy; |
682 | 682 | ||
@@ -792,10 +792,10 @@ static int ea_init(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
792 | 792 | ||
793 | static struct gfs2_ea_header *ea_split_ea(struct gfs2_ea_header *ea) | 793 | static struct gfs2_ea_header *ea_split_ea(struct gfs2_ea_header *ea) |
794 | { | 794 | { |
795 | uint32_t ea_size = GFS2_EA_SIZE(ea); | 795 | u32 ea_size = GFS2_EA_SIZE(ea); |
796 | struct gfs2_ea_header *new = (struct gfs2_ea_header *)((char *)ea + | 796 | struct gfs2_ea_header *new = (struct gfs2_ea_header *)((char *)ea + |
797 | ea_size); | 797 | ea_size); |
798 | uint32_t new_size = GFS2_EA_REC_LEN(ea) - ea_size; | 798 | u32 new_size = GFS2_EA_REC_LEN(ea) - ea_size; |
799 | int last = ea->ea_flags & GFS2_EAFLAG_LAST; | 799 | int last = ea->ea_flags & GFS2_EAFLAG_LAST; |
800 | 800 | ||
801 | ea->ea_rec_len = cpu_to_be32(ea_size); | 801 | ea->ea_rec_len = cpu_to_be32(ea_size); |
@@ -812,7 +812,7 @@ static void ea_set_remove_stuffed(struct gfs2_inode *ip, | |||
812 | { | 812 | { |
813 | struct gfs2_ea_header *ea = el->el_ea; | 813 | struct gfs2_ea_header *ea = el->el_ea; |
814 | struct gfs2_ea_header *prev = el->el_prev; | 814 | struct gfs2_ea_header *prev = el->el_prev; |
815 | uint32_t len; | 815 | u32 len; |
816 | 816 | ||
817 | gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); | 817 | gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); |
818 | 818 | ||
@@ -953,12 +953,12 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
953 | { | 953 | { |
954 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 954 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
955 | struct buffer_head *indbh, *newbh; | 955 | struct buffer_head *indbh, *newbh; |
956 | uint64_t *eablk; | 956 | u64 *eablk; |
957 | int error; | 957 | int error; |
958 | int mh_size = sizeof(struct gfs2_meta_header); | 958 | int mh_size = sizeof(struct gfs2_meta_header); |
959 | 959 | ||
960 | if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) { | 960 | if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) { |
961 | uint64_t *end; | 961 | u64 *end; |
962 | 962 | ||
963 | error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, | 963 | error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr, |
964 | DIO_START | DIO_WAIT, &indbh); | 964 | DIO_START | DIO_WAIT, &indbh); |
@@ -970,7 +970,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
970 | goto out; | 970 | goto out; |
971 | } | 971 | } |
972 | 972 | ||
973 | eablk = (uint64_t *)(indbh->b_data + mh_size); | 973 | eablk = (u64 *)(indbh->b_data + mh_size); |
974 | end = eablk + sdp->sd_inptrs; | 974 | end = eablk + sdp->sd_inptrs; |
975 | 975 | ||
976 | for (; eablk < end; eablk++) | 976 | for (; eablk < end; eablk++) |
@@ -984,7 +984,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
984 | 984 | ||
985 | gfs2_trans_add_bh(ip->i_gl, indbh, 1); | 985 | gfs2_trans_add_bh(ip->i_gl, indbh, 1); |
986 | } else { | 986 | } else { |
987 | uint64_t blk; | 987 | u64 blk; |
988 | 988 | ||
989 | blk = gfs2_alloc_meta(ip); | 989 | blk = gfs2_alloc_meta(ip); |
990 | 990 | ||
@@ -993,7 +993,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
993 | gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN); | 993 | gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN); |
994 | gfs2_buffer_clear_tail(indbh, mh_size); | 994 | gfs2_buffer_clear_tail(indbh, mh_size); |
995 | 995 | ||
996 | eablk = (uint64_t *)(indbh->b_data + mh_size); | 996 | eablk = (u64 *)(indbh->b_data + mh_size); |
997 | *eablk = cpu_to_be64(ip->i_di.di_eattr); | 997 | *eablk = cpu_to_be64(ip->i_di.di_eattr); |
998 | ip->i_di.di_eattr = blk; | 998 | ip->i_di.di_eattr = blk; |
999 | ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; | 999 | ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; |
@@ -1006,7 +1006,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
1006 | if (error) | 1006 | if (error) |
1007 | goto out; | 1007 | goto out; |
1008 | 1008 | ||
1009 | *eablk = cpu_to_be64((uint64_t)newbh->b_blocknr); | 1009 | *eablk = cpu_to_be64((u64)newbh->b_blocknr); |
1010 | error = ea_write(ip, GFS2_EA_BH2FIRST(newbh), er); | 1010 | error = ea_write(ip, GFS2_EA_BH2FIRST(newbh), er); |
1011 | brelse(newbh); | 1011 | brelse(newbh); |
1012 | if (error) | 1012 | if (error) |
@@ -1140,7 +1140,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) | |||
1140 | gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); | 1140 | gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); |
1141 | 1141 | ||
1142 | if (prev) { | 1142 | if (prev) { |
1143 | uint32_t len; | 1143 | u32 len; |
1144 | 1144 | ||
1145 | len = GFS2_EA_REC_LEN(prev) + GFS2_EA_REC_LEN(ea); | 1145 | len = GFS2_EA_REC_LEN(prev) + GFS2_EA_REC_LEN(ea); |
1146 | prev->ea_rec_len = cpu_to_be32(len); | 1146 | prev->ea_rec_len = cpu_to_be32(len); |
@@ -1225,7 +1225,7 @@ static int ea_acl_chmod_unstuffed(struct gfs2_inode *ip, | |||
1225 | struct buffer_head **bh; | 1225 | struct buffer_head **bh; |
1226 | unsigned int amount = GFS2_EA_DATA_LEN(ea); | 1226 | unsigned int amount = GFS2_EA_DATA_LEN(ea); |
1227 | unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize); | 1227 | unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize); |
1228 | uint64_t *dataptrs = GFS2_EA2DATAPTRS(ea); | 1228 | u64 *dataptrs = GFS2_EA2DATAPTRS(ea); |
1229 | unsigned int x; | 1229 | unsigned int x; |
1230 | int error; | 1230 | int error; |
1231 | 1231 | ||
@@ -1325,9 +1325,9 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) | |||
1325 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1325 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
1326 | struct gfs2_rgrp_list rlist; | 1326 | struct gfs2_rgrp_list rlist; |
1327 | struct buffer_head *indbh, *dibh; | 1327 | struct buffer_head *indbh, *dibh; |
1328 | uint64_t *eablk, *end; | 1328 | u64 *eablk, *end; |
1329 | unsigned int rg_blocks = 0; | 1329 | unsigned int rg_blocks = 0; |
1330 | uint64_t bstart = 0; | 1330 | u64 bstart = 0; |
1331 | unsigned int blen = 0; | 1331 | unsigned int blen = 0; |
1332 | unsigned int blks = 0; | 1332 | unsigned int blks = 0; |
1333 | unsigned int x; | 1333 | unsigned int x; |
@@ -1345,11 +1345,11 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) | |||
1345 | goto out; | 1345 | goto out; |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header)); | 1348 | eablk = (u64 *)(indbh->b_data + sizeof(struct gfs2_meta_header)); |
1349 | end = eablk + sdp->sd_inptrs; | 1349 | end = eablk + sdp->sd_inptrs; |
1350 | 1350 | ||
1351 | for (; eablk < end; eablk++) { | 1351 | for (; eablk < end; eablk++) { |
1352 | uint64_t bn; | 1352 | u64 bn; |
1353 | 1353 | ||
1354 | if (!*eablk) | 1354 | if (!*eablk) |
1355 | break; | 1355 | break; |
@@ -1390,12 +1390,12 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) | |||
1390 | 1390 | ||
1391 | gfs2_trans_add_bh(ip->i_gl, indbh, 1); | 1391 | gfs2_trans_add_bh(ip->i_gl, indbh, 1); |
1392 | 1392 | ||
1393 | eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header)); | 1393 | eablk = (u64 *)(indbh->b_data + sizeof(struct gfs2_meta_header)); |
1394 | bstart = 0; | 1394 | bstart = 0; |
1395 | blen = 0; | 1395 | blen = 0; |
1396 | 1396 | ||
1397 | for (; eablk < end; eablk++) { | 1397 | for (; eablk < end; eablk++) { |
1398 | uint64_t bn; | 1398 | u64 bn; |
1399 | 1399 | ||
1400 | if (!*eablk) | 1400 | if (!*eablk) |
1401 | break; | 1401 | break; |