Commit cd915493 authored by Steven Whitehouse's avatar Steven Whitehouse

[GFS2] Change all types to uX style

This makes all fixed size types have consistent names.

Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent a91ea69f
......@@ -38,8 +38,8 @@ struct metapath {
};
typedef int (*block_call_t) (struct gfs2_inode *ip, struct buffer_head *dibh,
struct buffer_head *bh, uint64_t *top,
uint64_t *bottom, unsigned int height,
struct buffer_head *bh, u64 *top,
u64 *bottom, unsigned int height,
void *data);
struct strip_mine {
......@@ -58,7 +58,7 @@ struct strip_mine {
*/
static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
uint64_t block, struct page *page)
u64 block, struct page *page)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct inode *inode = &ip->i_inode;
......@@ -121,7 +121,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
{
struct buffer_head *bh, *dibh;
uint64_t block = 0;
u64 block = 0;
int isdir = gfs2_is_dir(ip);
int error;
......@@ -161,7 +161,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
if (ip->i_di.di_size) {
*(uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode)) =
*(u64 *)(dibh->b_data + sizeof(struct gfs2_dinode)) =
cpu_to_be64(block);
ip->i_di.di_blocks++;
}
......@@ -190,10 +190,10 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
* Returns: the height the tree should be
*/
static unsigned int calc_tree_height(struct gfs2_inode *ip, uint64_t size)
static unsigned int calc_tree_height(struct gfs2_inode *ip, u64 size)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
uint64_t *arr;
u64 *arr;
unsigned int max, height;
if (ip->i_di.di_size > size)
......@@ -336,11 +336,11 @@ static int build_height(struct inode *inode, unsigned height)
*
*/
static void find_metapath(struct gfs2_inode *ip, uint64_t block,
static void find_metapath(struct gfs2_inode *ip, u64 block,
struct metapath *mp)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
uint64_t b = block;
u64 b = block;
unsigned int i;
for (i = ip->i_di.di_height; i--;)
......@@ -390,10 +390,10 @@ static inline u64 *metapointer(struct buffer_head *bh, int *boundary,
static int lookup_block(struct gfs2_inode *ip, struct buffer_head *bh,
unsigned int height, struct metapath *mp, int create,
int *new, uint64_t *block)
int *new, u64 *block)
{
int boundary;
uint64_t *ptr = metapointer(bh, &boundary, height, mp);
u64 *ptr = metapointer(bh, &boundary, height, mp);
if (*ptr) {
*block = be64_to_cpu(*ptr);
......@@ -594,13 +594,13 @@ int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsi
static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
struct metapath *mp, unsigned int height,
uint64_t block, int first, block_call_t bc,
u64 block, int first, block_call_t bc,
void *data)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct buffer_head *bh = NULL;
uint64_t *top, *bottom;
uint64_t bn;
u64 *top, *bottom;
u64 bn;
int error;
int mh_size = sizeof(struct gfs2_meta_header);
......@@ -617,10 +617,10 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
if (error)
return error;
top = (uint64_t *)(bh->b_data + mh_size) +
top = (u64 *)(bh->b_data + mh_size) +
((first) ? mp->mp_list[height] : 0);
bottom = (uint64_t *)(bh->b_data + mh_size) + sdp->sd_inptrs;
bottom = (u64 *)(bh->b_data + mh_size) + sdp->sd_inptrs;
}
error = bc(ip, dibh, bh, top, bottom, height, data);
......@@ -659,15 +659,15 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
*/
static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
struct buffer_head *bh, uint64_t *top, uint64_t *bottom,
struct buffer_head *bh, u64 *top, u64 *bottom,
unsigned int height, void *data)
{
struct strip_mine *sm = data;
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_rgrp_list rlist;
uint64_t bn, bstart;
uint32_t blen;
uint64_t *p;
u64 bn, bstart;
u32 blen;
u64 *p;
unsigned int rg_blocks = 0;
int metadata;
unsigned int revokes = 0;
......@@ -804,7 +804,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
* Returns: errno
*/
static int do_grow(struct gfs2_inode *ip, uint64_t size)
static int do_grow(struct gfs2_inode *ip, u64 size)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al;
......@@ -949,7 +949,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
return err;
}
static int trunc_start(struct gfs2_inode *ip, uint64_t size)
static int trunc_start(struct gfs2_inode *ip, u64 size)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct buffer_head *dibh;
......@@ -974,7 +974,7 @@ static int trunc_start(struct gfs2_inode *ip, uint64_t size)
error = 1;
} else {
if (size & (uint64_t)(sdp->sd_sb.sb_bsize - 1))
if (size & (u64)(sdp->sd_sb.sb_bsize - 1))
error = gfs2_block_truncate_page(ip->i_inode.i_mapping);
if (!error) {
......@@ -993,10 +993,10 @@ static int trunc_start(struct gfs2_inode *ip, uint64_t size)
return error;
}
static int trunc_dealloc(struct gfs2_inode *ip, uint64_t size)
static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
{
unsigned int height = ip->i_di.di_height;
uint64_t lblock;
u64 lblock;
struct metapath mp;
int error;
......@@ -1076,7 +1076,7 @@ static int trunc_end(struct gfs2_inode *ip)
* Returns: errno
*/
static int do_shrink(struct gfs2_inode *ip, uint64_t size)
static int do_shrink(struct gfs2_inode *ip, u64 size)
{
int error;
......@@ -1104,7 +1104,7 @@ static int do_shrink(struct gfs2_inode *ip, uint64_t size)
* Returns: errno
*/
int gfs2_truncatei(struct gfs2_inode *ip, uint64_t size)
int gfs2_truncatei(struct gfs2_inode *ip, u64 size)
{
int error;
......@@ -1172,12 +1172,12 @@ void gfs2_write_calc_reserv(struct gfs2_inode *ip, unsigned int len,
* Returns: errno
*/
int gfs2_write_alloc_required(struct gfs2_inode *ip, uint64_t offset,
int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
unsigned int len, int *alloc_required)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
uint64_t lblock, lblock_stop, dblock;
uint32_t extlen;
u64 lblock, lblock_stop, dblock;
u32 extlen;
int new = 0;
int error = 0;
......
......@@ -14,14 +14,14 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page);
int gfs2_block_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, int *boundary);
int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen);
int gfs2_truncatei(struct gfs2_inode *ip, uint64_t size);
int gfs2_truncatei(struct gfs2_inode *ip, u64 size);
int gfs2_truncatei_resume(struct gfs2_inode *ip);
int gfs2_file_dealloc(struct gfs2_inode *ip);
void gfs2_write_calc_reserv(struct gfs2_inode *ip, unsigned int len,
unsigned int *data_blocks,
unsigned int *ind_blocks);
int gfs2_write_alloc_required(struct gfs2_inode *ip, uint64_t offset,
int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
unsigned int len, int *alloc_required);
#endif /* __BMAP_DOT_H__ */
This diff is collapsed.
......@@ -24,7 +24,7 @@
typedef int (*gfs2_filldir_t) (void *opaque,
const char *name, unsigned int length,
uint64_t offset,
u64 offset,
struct gfs2_inum *inum, unsigned int type);
int gfs2_dir_search(struct inode *dir, const struct qstr *filename,
......@@ -32,7 +32,7 @@ int gfs2_dir_search(struct inode *dir, const struct qstr *filename,
int gfs2_dir_add(struct inode *inode, const struct qstr *filename,
const struct gfs2_inum *inum, unsigned int type);
int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *filename);
int gfs2_dir_read(struct inode *inode, uint64_t * offset, void *opaque,
int gfs2_dir_read(struct inode *inode, u64 * offset, void *opaque,
gfs2_filldir_t filldir);
int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
struct gfs2_inum *new_inum, unsigned int new_type);
......@@ -41,10 +41,10 @@ int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip);
int gfs2_diradd_alloc_required(struct inode *dir,
const struct qstr *filename);
int gfs2_dir_get_new_buffer(struct gfs2_inode *ip, uint64_t block,
int gfs2_dir_get_new_buffer(struct gfs2_inode *ip, u64 block,
struct buffer_head **bhp);
static inline uint32_t gfs2_disk_hash(const char *data, int len)
static inline u32 gfs2_disk_hash(const char *data, int len)
{
return crc32_le(0xFFFFFFFF, data, len) ^ 0xFFFFFFFF;
}
......
......@@ -115,7 +115,7 @@ static int ea_foreach_i(struct gfs2_inode *ip, struct buffer_head *bh,
static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data)
{
struct buffer_head *bh, *eabh;
uint64_t *eablk, *end;
u64 *eablk, *end;
int error;
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)
goto out;
}
eablk = (uint64_t *)(bh->b_data + sizeof(struct gfs2_meta_header));
eablk = (u64 *)(bh->b_data + sizeof(struct gfs2_meta_header));
end = eablk + GFS2_SB(&ip->i_inode)->sd_inptrs;
for (; eablk < end; eablk++) {
uint64_t bn;
u64 bn;
if (!*eablk)
break;
......@@ -235,8 +235,8 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
struct gfs2_rgrpd *rgd;
struct gfs2_holder rg_gh;
struct buffer_head *dibh;
uint64_t *dataptrs, bn = 0;
uint64_t bstart = 0;
u64 *dataptrs, bn = 0;
u64 bstart = 0;
unsigned int blen = 0;
unsigned int blks = 0;
unsigned int x;
......@@ -296,7 +296,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
gfs2_free_meta(ip, bstart, blen);
if (prev && !leave) {
uint32_t len;
u32 len;
len = GFS2_EA_REC_LEN(prev) + GFS2_EA_REC_LEN(ea);
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,
struct buffer_head **bh;
unsigned int amount = GFS2_EA_DATA_LEN(ea);
unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize);
uint64_t *dataptrs = GFS2_EA2DATAPTRS(ea);
u64 *dataptrs = GFS2_EA2DATAPTRS(ea);
unsigned int x;
int error = 0;
......@@ -601,7 +601,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_ea_header *ea;
uint64_t block;
u64 block;
block = gfs2_alloc_meta(ip);
......@@ -649,7 +649,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
ea->ea_num_ptrs = 0;
memcpy(GFS2_EA2DATA(ea), er->er_data, er->er_data_len);
} else {
uint64_t *dataptr = GFS2_EA2DATAPTRS(ea);
u64 *dataptr = GFS2_EA2DATAPTRS(ea);
const char *data = er->er_data;
unsigned int data_len = er->er_data_len;
unsigned int copy;
......@@ -658,7 +658,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
ea->ea_num_ptrs = DIV_ROUND_UP(er->er_data_len, sdp->sd_jbsize);
for (x = 0; x < ea->ea_num_ptrs; x++) {
struct buffer_head *bh;
uint64_t block;
u64 block;
int mh_size = sizeof(struct gfs2_meta_header);
block = gfs2_alloc_meta(ip);
......@@ -676,7 +676,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
memset(bh->b_data + mh_size + copy, 0,
sdp->sd_jbsize - copy);
*dataptr++ = cpu_to_be64((uint64_t)bh->b_blocknr);
*dataptr++ = cpu_to_be64((u64)bh->b_blocknr);
data += copy;
data_len -= copy;
......@@ -792,10 +792,10 @@ static int ea_init(struct gfs2_inode *ip, struct gfs2_ea_request *er)
static struct gfs2_ea_header *ea_split_ea(struct gfs2_ea_header *ea)
{
uint32_t ea_size = GFS2_EA_SIZE(ea);
u32 ea_size = GFS2_EA_SIZE(ea);
struct gfs2_ea_header *new = (struct gfs2_ea_header *)((char *)ea +
ea_size);
uint32_t new_size = GFS2_EA_REC_LEN(ea) - ea_size;
u32 new_size = GFS2_EA_REC_LEN(ea) - ea_size;
int last = ea->ea_flags & GFS2_EAFLAG_LAST;
ea->ea_rec_len = cpu_to_be32(ea_size);
......@@ -812,7 +812,7 @@ static void ea_set_remove_stuffed(struct gfs2_inode *ip,
{
struct gfs2_ea_header *ea = el->el_ea;
struct gfs2_ea_header *prev = el->el_prev;
uint32_t len;
u32 len;
gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
......@@ -953,12 +953,12 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct buffer_head *indbh, *newbh;
uint64_t *eablk;
u64 *eablk;
int error;
int mh_size = sizeof(struct gfs2_meta_header);
if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) {
uint64_t *end;
u64 *end;
error = gfs2_meta_read(ip->i_gl, ip->i_di.di_eattr,
DIO_START | DIO_WAIT, &indbh);
......@@ -970,7 +970,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
goto out;
}
eablk = (uint64_t *)(indbh->b_data + mh_size);
eablk = (u64 *)(indbh->b_data + mh_size);
end = eablk + sdp->sd_inptrs;
for (; eablk < end; eablk++)
......@@ -984,7 +984,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
gfs2_trans_add_bh(ip->i_gl, indbh, 1);
} else {
uint64_t blk;
u64 blk;
blk = gfs2_alloc_meta(ip);
......@@ -993,7 +993,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
gfs2_buffer_clear_tail(indbh, mh_size);
eablk = (uint64_t *)(indbh->b_data + mh_size);
eablk = (u64 *)(indbh->b_data + mh_size);
*eablk = cpu_to_be64(ip->i_di.di_eattr);
ip->i_di.di_eattr = blk;
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,
if (error)
goto out;
*eablk = cpu_to_be64((uint64_t)newbh->b_blocknr);
*eablk = cpu_to_be64((u64)newbh->b_blocknr);
error = ea_write(ip, GFS2_EA_BH2FIRST(newbh), er);
brelse(newbh);
if (error)
......@@ -1140,7 +1140,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el)
gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
if (prev) {
uint32_t len;
u32 len;
len = GFS2_EA_REC_LEN(prev) + GFS2_EA_REC_LEN(ea);
prev->ea_rec_len = cpu_to_be32(len);
......@@ -1225,7 +1225,7 @@ static int ea_acl_chmod_unstuffed(struct gfs2_inode *ip,
struct buffer_head **bh;
unsigned int amount = GFS2_EA_DATA_LEN(ea);
unsigned int nptrs = DIV_ROUND_UP(amount, sdp->sd_jbsize);
uint64_t *dataptrs = GFS2_EA2DATAPTRS(ea);
u64 *dataptrs = GFS2_EA2DATAPTRS(ea);
unsigned int x;
int error;
......@@ -1325,9 +1325,9 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_rgrp_list rlist;
struct buffer_head *indbh, *dibh;
uint64_t *eablk, *end;
u64 *eablk, *end;
unsigned int rg_blocks = 0;
uint64_t bstart = 0;
u64 bstart = 0;
unsigned int blen = 0;
unsigned int blks = 0;
unsigned int x;
......@@ -1345,11 +1345,11 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
goto out;
}
eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header));
eablk = (u64 *)(indbh->b_data + sizeof(struct gfs2_meta_header));
end = eablk + sdp->sd_inptrs;
for (; eablk < end; eablk++) {
uint64_t bn;
u64 bn;
if (!*eablk)
break;
......@@ -1390,12 +1390,12 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
gfs2_trans_add_bh(ip->i_gl, indbh, 1);
eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header));
eablk = (u64 *)(indbh->b_data + sizeof(struct gfs2_meta_header));
bstart = 0;
blen = 0;
for (; eablk < end; eablk++) {
uint64_t bn;
u64 bn;
if (!*eablk)
break;
......
......@@ -16,7 +16,7 @@
#define GFS2_EA_SIZE(ea) \
ALIGN(sizeof(struct gfs2_ea_header) + (ea)->ea_name_len + \
((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \
(sizeof(uint64_t) * (ea)->ea_num_ptrs)), 8)
(sizeof(u64) * (ea)->ea_num_ptrs)), 8)
#define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs)
#define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST)
......@@ -26,13 +26,13 @@ ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + (er)->er_data_len, 8)
#define GFS2_EAREQ_SIZE_UNSTUFFED(sdp, er) \
ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + \
sizeof(uint64_t) * DIV_ROUND_UP((er)->er_data_len, (sdp)->sd_jbsize), 8)
sizeof(u64) * DIV_ROUND_UP((er)->er_data_len, (sdp)->sd_jbsize), 8)
#define GFS2_EA2NAME(ea) ((char *)((struct gfs2_ea_header *)(ea) + 1))
#define GFS2_EA2DATA(ea) (GFS2_EA2NAME(ea) + (ea)->ea_name_len)
#define GFS2_EA2DATAPTRS(ea) \
((uint64_t *)(GFS2_EA2NAME(ea) + ALIGN((ea)->ea_name_len, 8)))
((u64 *)(GFS2_EA2NAME(ea) + ALIGN((ea)->ea_name_len, 8)))
#define GFS2_EA2NEXT(ea) \
((struct gfs2_ea_header *)((char *)(ea) + GFS2_EA_REC_LEN(ea)))
......
......@@ -87,7 +87,7 @@ static unsigned int gl_hash(const struct lm_lockname *name)
{
unsigned int h;
h = jhash(&name->ln_number, sizeof(uint64_t), 0);
h = jhash(&name->ln_number, sizeof(u64), 0);
h = jhash(&name->ln_type, sizeof(unsigned int), h);
h &= GFS2_GL_HASH_MASK;
......@@ -255,7 +255,7 @@ static struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
* Returns: errno
*/
int gfs2_glock_get(struct gfs2_sbd *sdp, uint64_t number,
int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
const struct gfs2_glock_operations *glops, int create,
struct gfs2_glock **glp)
{
......@@ -1415,7 +1415,7 @@ void gfs2_glock_dq_uninit(struct gfs2_holder *gh)
* Returns: errno
*/
int gfs2_glock_nq_num(struct gfs2_sbd *sdp, uint64_t number,
int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
const struct gfs2_glock_operations *glops,
unsigned int state, int flags, struct gfs2_holder *gh)
{
......@@ -1613,7 +1613,7 @@ void gfs2_glock_dq_uninit_m(unsigned int num_gh, struct gfs2_holder *ghs)
* Returns: errno
*/
void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, u64 number,
const struct gfs2_glock_operations *glops,
unsigned int state, int flags)
{
......
......@@ -74,7 +74,7 @@ static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl)
}
int gfs2_glock_get(struct gfs2_sbd *sdp,
uint64_t number, const struct gfs2_glock_operations *glops,
u64 number, const struct gfs2_glock_operations *glops,
int create, struct gfs2_glock **glp);
void gfs2_glock_hold(struct gfs2_glock *gl);
int gfs2_glock_put(struct gfs2_glock *gl);
......@@ -96,14 +96,14 @@ int gfs2_glock_be_greedy(struct gfs2_glock *gl, unsigned int time);
void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
int gfs2_glock_nq_num(struct gfs2_sbd *sdp,
uint64_t number, const struct gfs2_glock_operations *glops,
u64 number, const struct gfs2_glock_operations *glops,
unsigned int state, int flags, struct gfs2_holder *gh);
int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs);
void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs);
void gfs2_glock_dq_uninit_m(unsigned int num_gh, struct gfs2_holder *ghs);
void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, u64 number,
const struct gfs2_glock_operations *glops,
unsigned int state, int flags);
void gfs2_glock_inode_squish(struct inode *inode);
......
......@@ -60,9 +60,9 @@ struct gfs2_log_element {
struct gfs2_bitmap {
struct buffer_head *bi_bh;
char *bi_clone;
uint32_t bi_offset;
uint32_t bi_start;
uint32_t bi_len;
u32 bi_offset;
u32 bi_start;
u32 bi_len;
};
struct gfs2_rgrpd {
......@@ -72,14 +72,14 @@ struct gfs2_rgrpd {
struct gfs2_glock *rd_gl; /* Glock for this rgrp */
struct gfs2_rindex rd_ri;
struct gfs2_rgrp rd_rg;
uint64_t rd_rg_vn;
u64 rd_rg_vn;
struct gfs2_bitmap *rd_bits;
unsigned int rd_bh_count;
struct mutex rd_mutex;
uint32_t rd_free_clone;
u32 rd_free_clone;
struct gfs2_log_element rd_le;
uint32_t rd_last_alloc_data;
uint32_t rd_last_alloc_meta;
u32 rd_last_alloc_data;
u32 rd_last_alloc_meta;
struct gfs2_sbd *rd_sbd;
};
......@@ -185,7 +185,7 @@ struct gfs2_glock {
char *gl_lvb;
atomic_t gl_lvb_count;
uint64_t gl_vn;
u64 gl_vn;
unsigned long gl_stamp;
void *gl_object;
......@@ -232,14 +232,14 @@ struct gfs2_inode {
unsigned long i_flags; /* GIF_... */
uint64_t i_vn;
u64 i_vn;
struct gfs2_dinode i_di; /* To be replaced by ref to block */
struct gfs2_glock *i_gl; /* Move into i_gh? */
struct gfs2_holder i_iopen_gh;
struct gfs2_holder i_gh; /* for prepare/commit_write only */
struct gfs2_alloc i_alloc;
uint64_t i_last_rg_alloc;
u64 i_last_rg_alloc;
spinlock_t i_spin;
struct rw_semaphore i_rw_mutex;
......@@ -277,12 +277,12 @@ struct gfs2_file {
struct gfs2_revoke {
struct gfs2_log_element rv_le;
uint64_t rv_blkno;
u64 rv_blkno;
};
struct gfs2_revoke_replay {
struct list_head rr_list;
uint64_t rr_blkno;
u64 rr_blkno;
unsigned int rr_where;
};
......@@ -304,11 +304,11 @@ struct gfs2_quota_data {
struct list_head qd_list;
unsigned int qd_count;
uint32_t qd_id;
u32 qd_id;
unsigned long qd_flags; /* QDF_... */
int64_t qd_change;
int64_t qd_change_sync;
s64 qd_change;
s64 qd_change_sync;
unsigned int qd_slot;
unsigned int qd_slot_count;
......@@ -320,7 +320,7 @@ struct gfs2_quota_data {
struct gfs2_glock *qd_gl;
struct gfs2_quota_lvb qd_qb;
uint64_t qd_sync_gen;
u64 qd_sync_gen;
unsigned long qd_last_warn;
unsigned long qd_last_touched;
};
......@@ -358,7 +358,7 @@ struct gfs2_ail {
struct list_head ai_ail1_list;
struct list_head ai_ail2_list;
uint64_t ai_sync_gen;
u64 ai_sync_gen;
};
struct gfs2_jdesc {
......@@ -466,20 +466,20 @@ struct gfs2_sbd {
/* Constants computed on mount */
uint32_t sd_fsb2bb;
uint32_t sd_fsb2bb_shift;
uint32_t sd_diptrs; /* Number of pointers in a dinode */
uint32_t sd_inptrs; /* Number of pointers in a indirect block */
uint32_t sd_jbsize; /* Size of a journaled data block */
uint32_t sd_hash_bsize; /* sizeof(exhash block) */
uint32_t sd_hash_bsize_shift;
uint32_t sd_hash_ptrs; /* Number of pointers in a hash block */
uint32_t sd_qc_per_block;
uint32_t sd_max_dirres; /* Max blocks needed to add a directory entry */
uint32_t sd_max_height; /* Max height of a file's metadata tree */
uint64_t sd_heightsize[GFS2_MAX_META_HEIGHT];
uint32_t sd_max_jheight; /* Max height of journaled file's meta tree */
uint64_t sd_jheightsize[GFS2_MAX_META_HEIGHT];
u32 sd_fsb2bb;
u32 sd_fsb2bb_shift;
u32 sd_diptrs; /* Number of pointers in a dinode */
u32 sd_inptrs; /* Number of pointers in a indirect block */
u32 sd_jbsize; /* Size of a journaled data block */
u32 sd_hash_bsize; /* sizeof(exhash block) */
u32 sd_hash_bsize_shift;
u32 sd_hash_ptrs; /* Number of pointers in a hash block */
u32 sd_qc_per_block;
u32 sd_max_dirres; /* Max blocks needed to add a directory entry */
u32 sd_max_height; /* Max height of a file's metadata tree */
u64 sd_heightsize[GFS2_MAX_META_HEIGHT];
u32 sd_max_jheight; /* Max height of journaled file's meta tree */
u64 sd_jheightsize[GFS2_MAX_META_HEIGHT];
struct gfs2_args sd_args; /* Mount arguments */
struct gfs2_tune sd_tune; /* Filesystem tuning structure */
......@@ -522,7 +522,7 @@ struct gfs2_sbd {
/* Resource group stuff */
uint64_t sd_rindex_vn;
u64 sd_rindex_vn;
spinlock_t sd_rindex_spin;
struct mutex sd_rindex_mutex;
struct list_head sd_rindex_list;
......@@ -567,7 +567,7 @@ struct gfs2_sbd {
unsigned int sd_quota_chunks;
unsigned char **sd_quota_bitmap;
uint64_t sd_quota_sync_gen;
u64 sd_quota_sync_gen;
unsigned long sd_quota_sync_time;
/* Log stuff */
......@@ -595,7 +595,7 @@ struct gfs2_sbd {
unsigned int sd_log_blks_free;
struct mutex sd_log_reserve_mutex;
uint64_t sd_log_sequence;
u64 sd_log_sequence;
unsigned int sd_log_head;
unsigned int sd_log_tail;
int sd_log_idle;
......@@ -605,11 +605,11 @@ struct gfs2_sbd {
struct list_head sd_log_flush_list;
unsigned int sd_log_flush_head;
uint64_t sd_log_flush_wrapped;
u64 sd_log_flush_wrapped;
struct list_head sd_ail1_list;
struct list_head sd_ail2_list;
uint64_t sd_ail_sync_gen;
u64 sd_ail_sync_gen;
/* Replay stuff */
......
......@@ -311,7 +311,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff)
{
struct gfs2_sbd *sdp = ip->i_inode.i_sb->s_fs_info;
struct buffer_head *dibh;
uint32_t nlink;
u32 nlink;
int error;
BUG_ON(ip->i_di.di_nlink != ip->i_inode.i_nlink);
......@@ -428,7 +428,7 @@ struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name,
return inode;
}
static int pick_formal_ino_1(struct gfs2_sbd *sdp, uint64_t *formal_ino)
static int pick_formal_ino_1(struct gfs2_sbd *sdp, u64 *formal_ino)
{
struct gfs2_inode *ip = GFS2_I(sdp->sd_ir_inode);
struct buffer_head *bh;
......@@ -469,7 +469,7 @@ static int pick_formal_ino_1(struct gfs2_sbd *sdp, uint64_t *formal_ino)
return 1;
}
static int pick_formal_ino_2(struct gfs2_sbd *sdp, uint64_t *formal_ino)
static int pick_formal_ino_2(struct gfs2_sbd *sdp, u64 *formal_ino)
{
struct gfs2_inode *ip = GFS2_I(sdp->sd_ir_inode);
struct gfs2_inode *m_ip = GFS2_I(sdp->sd_inum_inode);
......@@ -495,13 +495,13 @@ static int pick_formal_ino_2(struct gfs2_sbd *sdp, uint64_t *formal_ino)
if (!ir.ir_length) {
struct buffer_head *m_bh;
uint64_t x, y;
u64 x, y;
error = gfs2_meta_inode_buffer(m_ip, &m_bh);
if (error)
goto out_brelse;
x = *(uint64_t *)(m_bh->b_data + sizeof(struct gfs2_dinode));
x = *(u64 *)(m_bh->b_data + sizeof(struct gfs2_dinode));
x = y = be64_to_cpu(x);
ir.ir_start = x;
ir.ir_length = GFS2_INUM_QUANTUM;
......@@ -510,7 +510,7 @@ static int pick_formal_ino_2(struct gfs2_sbd *sdp, uint64_t *formal_ino)
gfs2_consist_inode(m_ip);
x = cpu_to_be64(x);
gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
*(uint64_t *)(m_bh->b_data + sizeof(struct gfs2_dinode)) = x;
*(u64 *)(m_bh->b_data + sizeof(struct gfs2_dinode)) = x;
brelse(m_bh);
}
......@@ -531,7 +531,7 @@ static int pick_formal_ino_2(struct gfs2_sbd *sdp, uint64_t *formal_ino)
return error;
}
static int pick_formal_ino(struct gfs2_sbd *sdp, uint64_t *inum)
static int pick_formal_ino(struct gfs2_sbd *sdp, u64 *inum)
{
int error;
......@@ -577,9 +577,9 @@ static int create_ok(struct gfs2_inode *dip, const struct qstr *name,
return error;
}
if (dip->i_di.di_entries == (uint32_t)-1)
if (dip->i_di.di_entries == (u32)-1)
return -EFBIG;
if (S_ISDIR(mode) && dip->i_di.di_nlink == (uint32_t)-1)
if (S_ISDIR(mode) && dip->i_di.di_nlink == (u32)-1)
return -EMLINK;
return 0;
......@@ -1131,7 +1131,7 @@ int gfs2_glock_nq_atime(struct gfs2_holder *gh)
struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_sbd;
struct gfs2_inode *ip = gl->gl_object;
int64_t curtime, quantum = gfs2_tune_get(sdp, gt_atime_quantum);
s64 curtime, quantum = gfs2_tune_get(sdp, gt_atime_quantum);
unsigned int state;
int flags;
int error;
......
......@@ -160,7 +160,7 @@ typedef void (*lm_callback_t) (lm_fsdata_t *fsdata, unsigned int type,
struct lm_lockname {
uint64_t ln_number;
u64 ln_number;
unsigned int ln_type;
};
......
......@@ -61,7 +61,7 @@ void gdlm_queue_delayed(struct gdlm_lock *lp)
/* convert gfs lock-state to dlm lock-mode */
static int16_t make_mode(int16_t lmstate)
static s16 make_mode(s16 lmstate)
{
switch (lmstate) {
case LM_ST_UNLOCKED:
......@@ -79,7 +79,7 @@ static int16_t make_mode(int16_t lmstate)
/* convert dlm lock-mode to gfs lock-state */
int16_t gdlm_make_lmstate(int16_t dlmmode)
s16 gdlm_make_lmstate(s16 dlmmode)
{
switch (dlmmode) {
case DLM_LOCK_IV:
......@@ -101,14 +101,14 @@ int16_t gdlm_make_lmstate(int16_t dlmmode)
static void check_cur_state(struct gdlm_lock *lp, unsigned int cur_state)
{
int16_t cur = make_mode(cur_state);
s16 cur = make_mode(cur_state);
if (lp->cur != DLM_LOCK_IV)
gdlm_assert(lp->cur == cur, "%d, %d", lp->cur, cur);
}
static inline unsigned int make_flags(struct gdlm_lock *lp,
unsigned int gfs_flags,
int16_t cur, int16_t req)
s16 cur, s16 req)
{
unsigned int lkf = 0;
......
......@@ -56,7 +56,7 @@ enum {
};
struct gdlm_ls {
uint32_t id;
u32 id;
int jid;
int first;
int first_done;
......@@ -77,7 +77,7 @@ struct gdlm_ls {
struct list_head delayed;
struct list_head submit;
struct list_head all_locks;
uint32_t all_locks_count;
u32 all_locks_count;
wait_queue_head_t wait_control;
struct task_struct *thread1;
struct task_struct *thread2;
......@@ -109,10 +109,10 @@ struct gdlm_lock {
char *lvb;
struct dlm_lksb lksb;
int16_t cur;
int16_t req;
int16_t prev_req;
uint32_t lkf; /* dlm flags DLM_LKF_ */
s16 cur;
s16 req;
s16 prev_req;
u32 lkf; /* dlm flags DLM_LKF_ */
unsigned long flags; /* lock_dlm flags LFL_ */
int bast_mode; /* protected by async_lock */
......@@ -158,7 +158,7 @@ void gdlm_release_threads(struct gdlm_ls *);
/* lock.c */
int16_t gdlm_make_lmstate(int16_t);
s16 gdlm_make_lmstate(s16);
void gdlm_queue_delayed(struct gdlm_lock *);
void gdlm_submit_delayed(struct gdlm_ls *);
int gdlm_release_all_locks(struct gdlm_ls *);
......
......@@ -48,7 +48,7 @@ static void process_complete(struct gdlm_lock *lp)
{
struct gdlm_ls *ls = lp->ls;
struct lm_async_cb acb;
int16_t prev_mode = lp->cur;
s16 prev_mode = lp->cur;
memset(&acb, 0, sizeof(acb));
......
......@@ -62,7 +62,7 @@ unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct,
void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags)
{
struct list_head *head = &sdp->sd_ail1_list;
uint64_t sync_gen;
u64 sync_gen;
struct list_head *first, *tmp;
struct gfs2_ail *first_ai, *ai;
......@@ -205,10 +205,10 @@ void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks)
up_read(&sdp->sd_log_flush_lock);
}
static uint64_t log_bmap(struct gfs2_sbd *sdp, unsigned int lbn)
static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn)
{
int new = 0;
uint64_t dbn;
u64 dbn;
int error;
int bdy;
......@@ -287,7 +287,7 @@ static inline void log_incr_head(struct gfs2_sbd *sdp)
struct buffer_head *gfs2_log_get_buf(struct gfs2_sbd *sdp)
{
uint64_t blkno = log_bmap(sdp, sdp->sd_log_flush_head);
u64 blkno = log_bmap(sdp, sdp->sd_log_flush_head);
struct gfs2_log_buf *lb;
struct buffer_head *bh;
......@@ -317,7 +317,7 @@ struct buffer_head *gfs2_log_get_buf(struct gfs2_sbd *sdp)
struct buffer_head *gfs2_log_fake_buf(struct gfs2_sbd *sdp,
struct buffer_head *real)
{
uint64_t blkno = log_bmap(sdp, sdp->sd_log_flush_head);
u64 blkno = log_bmap(sdp, sdp->sd_log_flush_head);
struct gfs2_log_buf *lb;
struct buffer_head *bh;
......@@ -361,13 +361,13 @@ static void log_pull_tail(struct gfs2_sbd *sdp, unsigned int new_tail, int pull)
* Returns: the initialized log buffer descriptor
*/
static void log_write_header(struct gfs2_sbd *sdp, uint32_t flags, int pull)
static void log_write_header(struct gfs2_sbd *sdp, u32 flags, int pull)
{
uint64_t blkno = log_bmap(sdp, sdp->sd_log_flush_head);
u64 blkno = log_bmap(sdp, sdp->sd_log_flush_head);
struct buffer_head *bh;
struct gfs2_log_header *lh;
unsigned int tail;
uint32_t hash;
u32 hash;
/* printk(KERN_INFO "log write header start (flags=%08x, pull=%d)\n", flags, pull); */
......@@ -523,7 +523,7 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
reserved += sdp->sd_log_commited_buf;
if (sdp->sd_log_commited_revoke)
reserved += gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke,
sizeof(uint64_t));
sizeof(u64));
if (reserved)
reserved++;
......
......@@ -202,7 +202,7 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
struct gfs2_glock *gl = ip->i_gl;
unsigned int blks = be32_to_cpu(ld->ld_data1);
struct buffer_head *bh_log, *bh_ip;
uint64_t blkno;
u64 blkno;
int error = 0;
if (pass != 1 || be32_to_cpu(ld->ld_type) != GFS2_LOG_DESC_METADATA)
......@@ -294,7 +294,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
ld->ld_header.mh_format = cpu_to_be32(GFS2_FORMAT_LD);
ld->ld_type = cpu_to_be32(GFS2_LOG_DESC_REVOKE);
ld->ld_length = cpu_to_be32(gfs2_struct2blk(sdp, sdp->sd_log_num_revoke,
sizeof(uint64_t)));
sizeof(u64)));
ld->ld_data1 = cpu_to_be32(sdp->sd_log_num_revoke);
ld->ld_data2 = cpu_to_be32(0);
memset(ld->ld_reserved, 0, sizeof(ld->ld_reserved));
......@@ -305,7 +305,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
list_del_init(&rv->rv_le.le_list);
sdp->sd_log_num_revoke--;
if (offset + sizeof(uint64_t) > sdp->sd_sb.sb_bsize) {
if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) {
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
......@@ -320,7 +320,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
*(__be64 *)(bh->b_data + offset) = cpu_to_be64(rv->rv_blkno);
kfree(rv);
offset += sizeof(uint64_t);
offset += sizeof(u64);
}
gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
......@@ -349,7 +349,7 @@ static int revoke_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
unsigned int revokes = be32_to_cpu(ld->ld_data1);
struct buffer_head *bh;
unsigned int offset;
uint64_t blkno;
u64 blkno;
int first = 1;
int error;
......@@ -366,7 +366,7 @@ static int revoke_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
if (!first)
gfs2_metatype_check(sdp, bh, GFS2_METATYPE_LB);
while (offset + sizeof(uint64_t) <= sdp->sd_sb.sb_bsize) {
while (offset + sizeof(u64) <= sdp->sd_sb.sb_bsize) {
blkno = be64_to_cpu(*(__be64 *)(bh->b_data + offset));
error = gfs2_revoke_add(sdp, blkno, start);
......@@ -377,7 +377,7 @@ static int revoke_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
if (!--revokes)
break;
offset += sizeof(uint64_t);
offset += sizeof(u64);
}
brelse(bh);
......@@ -677,8 +677,8 @@ static int databuf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
struct gfs2_glock *gl = ip->i_gl;
unsigned int blks = be32_to_cpu(ld->ld_data1);
struct buffer_head *bh_log, *bh_ip;
uint64_t blkno;
uint64_t esc;
u64 blkno;
u64 esc;
int error = 0;
if (pass != 1 || be32_to_cpu(ld->ld_type) != GFS2_LOG_DESC_JDATA)
......
......@@ -213,7 +213,7 @@ void gfs2_ail_empty_gl(struct gfs2_glock *gl)
struct list_head *head = &gl->gl_ail_list;
struct gfs2_bufdata *bd;
struct buffer_head *bh;
uint64_t blkno;
u64 blkno;
int error;
blocks = atomic_read(&gl->gl_ail_count);
......@@ -303,7 +303,7 @@ void gfs2_meta_sync(struct gfs2_glock *gl, int flags)
*/
static struct buffer_head *getbuf(struct gfs2_sbd *sdp, struct inode *aspace,
uint64_t blkno, int create)
u64 blkno, int create)
{
struct page *page;
struct buffer_head *bh;
......@@ -366,7 +366,7 @@ static void meta_prep_new(struct buffer_head *bh)
* Returns: The buffer
*/
struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, uint64_t blkno)
struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno)
{
struct buffer_head *bh;
bh = getbuf(gl->gl_sbd, gl->gl_aspace, blkno, CREATE);
......@@ -384,7 +384,7 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, uint64_t blkno)
* Returns: errno
*/
int gfs2_meta_read(struct gfs2_glock *gl, uint64_t blkno, int flags,
int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
struct buffer_head **bhp)
{
int error;
......@@ -549,7 +549,7 @@ void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
*
*/
void gfs2_meta_wipe(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct inode *aspace = ip->i_gl->gl_aspace;
......@@ -573,7 +573,7 @@ void gfs2_meta_wipe(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
if (bd) {
gfs2_log_lock(sdp);
if (bd->bd_ail) {
uint64_t blkno = bh->b_blocknr;
u64 blkno = bh->b_blocknr;
bd->bd_ail = NULL;
list_del(&bd->bd_ail_st_list);
list_del(&bd->bd_ail_gl_list);
......@@ -637,7 +637,7 @@ void gfs2_meta_cache_flush(struct gfs2_inode *ip)
* Returns: errno
*/
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
int new, struct buffer_head **bhp)
{
struct buffer_head *bh, **bh_slot = ip->i_cache + height;
......@@ -711,12 +711,12 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
*
*/
void gfs2_meta_ra(struct gfs2_glock *gl, uint64_t dblock, uint32_t extlen)
void gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
{
struct gfs2_sbd *sdp = gl->gl_sbd;
struct inode *aspace = gl->gl_aspace;
struct buffer_head *first_bh, *bh;
uint32_t max_ra = gfs2_tune_get(sdp, gt_max_readahead) >>
u32 max_ra = gfs2_tune_get(sdp, gt_max_readahead) >>
sdp->sd_sb.sb_bsize_shift;
int error;
......
......@@ -44,8 +44,8 @@ void gfs2_ail_empty_gl(struct gfs2_glock *gl);
void gfs2_meta_inval(struct gfs2_glock *gl);
void gfs2_meta_sync(struct gfs2_glock *gl, int flags);
struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, uint64_t blkno);
int gfs2_meta_read(struct gfs2_glock *gl, uint64_t blkno,
struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno);
int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno,
int flags, struct buffer_head **bhp);
int gfs2_meta_reread(struct gfs2_sbd *sdp, struct buffer_head *bh, int flags);
......@@ -55,10 +55,10 @@ void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
struct gfs2_ail *ai);
void gfs2_meta_wipe(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen);
void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
void gfs2_meta_cache_flush(struct gfs2_inode *ip);
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
int new, struct buffer_head **bhp);
static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
......@@ -67,7 +67,7 @@ static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
return gfs2_meta_indirect_buffer(ip, 0, ip->i_num.no_addr, 0, bhp);
}
void gfs2_meta_ra(struct gfs2_glock *gl, uint64_t dblock, uint32_t extlen);
void gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen);
void gfs2_meta_syncfs(struct gfs2_sbd *sdp);
#endif /* __DIO_DOT_H__ */
......
......@@ -66,7 +66,7 @@ int gfs2_get_block(struct inode *inode, sector_t lblock,
struct buffer_head *bh_result, int create)
{
int new = create;
uint64_t dblock;
u64 dblock;
int error;
int boundary;
......@@ -100,7 +100,7 @@ static int get_block_noalloc(struct inode *inode, sector_t lblock,
struct buffer_head *bh_result, int create)
{
int new = 0;
uint64_t dblock;
u64 dblock;
int error;
int boundary;
......@@ -510,10 +510,10 @@ static int gfs2_commit_write(struct file *file, struct page *page,
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
if (gfs2_is_stuffed(ip)) {
uint64_t file_size;
u64 file_size;
void *kaddr;
file_size = ((uint64_t)page->index << PAGE_CACHE_SHIFT) + to;
file_size = ((u64)page->index << PAGE_CACHE_SHIFT) + to;
kaddr = kmap_atomic(page, KM_USER0);
memcpy(dibh->b_data + sizeof(struct gfs2_dinode) + from,
......
......@@ -46,15 +46,15 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb,
switch (fh_type) {
case 10:
parent.no_formal_ino = ((uint64_t)be32_to_cpu(fh[4])) << 32;
parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32;
parent.no_formal_ino |= be32_to_cpu(fh[5]);
parent.no_addr = ((uint64_t)be32_to_cpu(fh[6])) << 32;
parent.no_addr = ((u64)be32_to_cpu(fh[6])) << 32;
parent.no_addr |= be32_to_cpu(fh[7]);
fh_obj.imode = be32_to_cpu(fh[8]);
case 4:
this->no_formal_ino = ((uint64_t)be32_to_cpu(fh[0])) << 32;
this->no_formal_ino = ((u64)be32_to_cpu(fh[0])) << 32;
this->no_formal_ino |= be32_to_cpu(fh[1]);
this->no_addr = ((uint64_t)be32_to_cpu(fh[2])) << 32;
this->no_addr = ((u64)be32_to_cpu(fh[2])) << 32;
this->no_addr |= be32_to_cpu(fh[3]);
break;
default:
......@@ -118,7 +118,7 @@ struct get_name_filldir {
};
static int get_name_filldir(void *opaque, const char *name, unsigned int length,
uint64_t offset, struct gfs2_inum *inum,
u64 offset, struct gfs2_inum *inum,
unsigned int type)
{
struct get_name_filldir *gnfd = (struct get_name_filldir *)opaque;
......@@ -140,7 +140,7 @@ static int gfs2_get_name(struct dentry *parent, char *name,
struct gfs2_inode *dip, *ip;
struct get_name_filldir gnfd;
struct gfs2_holder gh;
uint64_t offset = 0;
u64 offset = 0;
int error;
if (!dir)
......
......@@ -47,7 +47,7 @@
struct filldir_bad_entry {
char *fbe_name;
unsigned int fbe_length;
uint64_t fbe_offset;
u64 fbe_offset;
struct gfs2_inum fbe_inum;
unsigned int fbe_type;
};
......@@ -161,7 +161,7 @@ static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin)
*/
static int filldir_reg_func(void *opaque, const char *name, unsigned int length,
uint64_t offset, struct gfs2_inum *inum,
u64 offset, struct gfs2_inum *inum,
unsigned int type)
{
struct filldir_reg *fdr = (struct filldir_reg *)opaque;
......@@ -200,7 +200,7 @@ static int readdir_reg(struct file *file, void *dirent, filldir_t filldir)
struct gfs2_inode *dip = GFS2_I(dir);
struct filldir_reg fdr;
struct gfs2_holder d_gh;
uint64_t offset = file->f_pos;
u64 offset = file->f_pos;
int error;
fdr.fdr_sbd = GFS2_SB(dir);
......@@ -239,7 +239,7 @@ static int readdir_reg(struct file *file, void *dirent, filldir_t filldir)
*/
static int filldir_bad_func(void *opaque, const char *name, unsigned int length,
uint64_t offset, struct gfs2_inum *inum,
u64 offset, struct gfs2_inum *inum,
unsigned int type)
{
struct filldir_bad *fdb = (struct filldir_bad *)opaque;
......@@ -293,7 +293,7 @@ static int readdir_bad(struct file *file, void *dirent, filldir_t filldir)
unsigned int entries, size;
struct filldir_bad *fdb;
struct gfs2_holder d_gh;
uint64_t offset = file->f_pos;
u64 offset = file->f_pos;
unsigned int x;
struct filldir_bad_entry *fbe;
int error;
......
......@@ -172,7 +172,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
if (!dip->i_di.di_nlink)
goto out_gunlock;
error = -EFBIG;
if (dip->i_di.di_entries == (uint32_t)-1)
if (dip->i_di.di_entries == (u32)-1)
goto out_gunlock;
error = -EPERM;
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
......@@ -181,7 +181,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
if (!ip->i_di.di_nlink)
goto out_gunlock;
error = -EMLINK;
if (ip->i_di.di_nlink == (uint32_t)-1)
if (ip->i_di.di_nlink == (u32)-1)
goto out_gunlock;
alloc_required = error = gfs2_diradd_alloc_required(dir, &dentry->d_name);
......@@ -509,7 +509,7 @@ static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode,
struct gfs2_holder ghs[2];
struct inode *inode;
struct buffer_head *dibh;
uint32_t major = 0, minor = 0;
u32 major = 0, minor = 0;
int error;
switch (mode & S_IFMT) {
......@@ -670,12 +670,12 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
error = -EINVAL;
goto out_gunlock;
}
if (ndip->i_di.di_entries == (uint32_t)-1) {
if (ndip->i_di.di_entries == (u32)-1) {
error = -EFBIG;
goto out_gunlock;
}
if (S_ISDIR(ip->i_di.di_mode) &&
ndip->i_di.di_nlink == (uint32_t)-1) {
ndip->i_di.di_nlink == (u32)-1) {
error = -EMLINK;
goto out_gunlock;
}
......@@ -911,7 +911,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_sbd *sdp = GFS2_SB(inode);
struct buffer_head *dibh;
uint32_t ouid, ogid, nuid, ngid;
u32 ouid, ogid, nuid, ngid;
int error;
ouid = ip->i_di.di_uid;
......
......@@ -62,7 +62,7 @@ static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
unsigned long index = page->index;
uint64_t lblock = index << (PAGE_CACHE_SHIFT -
u64 lblock = index << (PAGE_CACHE_SHIFT -
sdp->sd_sb.sb_bsize_shift);
unsigned int blocks = PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift;
struct gfs2_alloc *al;
......@@ -101,7 +101,7 @@ static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
}
for (x = 0; x < blocks; ) {
uint64_t dblock;
u64 dblock;
unsigned int extlen;
int new = 1;
......
......@@ -65,17 +65,17 @@
#define QUOTA_USER 1
#define QUOTA_GROUP 0
static uint64_t qd2offset(struct gfs2_quota_data *qd)
static u64 qd2offset(struct gfs2_quota_data *qd)
{
uint64_t offset;
u64 offset;
offset = 2 * (uint64_t)qd->qd_id + !test_bit(QDF_USER, &qd->qd_flags);
offset = 2 * (u64)qd->qd_id + !test_bit(QDF_USER, &qd->qd_flags);
offset *= sizeof(struct gfs2_quota);
return offset;
}
static int qd_alloc(struct gfs2_sbd *sdp, int user, uint32_t id,
static int qd_alloc(struct gfs2_sbd *sdp, int user, u32 id,
struct gfs2_quota_data **qdp)
{
struct gfs2_quota_data *qd;
......@@ -91,7 +91,7 @@ static int qd_alloc(struct gfs2_sbd *sdp, int user, uint32_t id,
set_bit(QDF_USER, &qd->qd_flags);
qd->qd_slot = -1;
error = gfs2_glock_get(sdp, 2 * (uint64_t)id + !user,
error = gfs2_glock_get(sdp, 2 * (u64)id + !user,
&gfs2_quota_glops, CREATE, &qd->qd_gl);
if (error)
goto fail;
......@@ -110,7 +110,7 @@ static int qd_alloc(struct gfs2_sbd *sdp, int user, uint32_t id,
return error;
}
static int qd_get(struct gfs2_sbd *sdp, int user, uint32_t id, int create,
static int qd_get(struct gfs2_sbd *sdp, int user, u32 id, int create,
struct gfs2_quota_data **qdp)
{
struct gfs2_quota_data *qd = NULL, *new_qd = NULL;
......@@ -248,7 +248,7 @@ static int bh_get(struct gfs2_quota_data *qd)
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
unsigned int block, offset;
uint64_t dblock;
u64 dblock;
int new = 0;
struct buffer_head *bh;
int error;
......@@ -405,7 +405,7 @@ static void qd_unlock(struct gfs2_quota_data *qd)
qd_put(qd);
}
static int qdsb_get(struct gfs2_sbd *sdp, int user, uint32_t id, int create,
static int qdsb_get(struct gfs2_sbd *sdp, int user, u32 id, int create,
struct gfs2_quota_data **qdp)
{
int error;
......@@ -438,7 +438,7 @@ static void qdsb_put(struct gfs2_quota_data *qd)
qd_put(qd);
}
int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
......@@ -523,12 +523,12 @@ static int sort_qd(const void *a, const void *b)
return ret;
}
static void do_qc(struct gfs2_quota_data *qd, int64_t change)
static void do_qc(struct gfs2_quota_data *qd, s64 change)
{
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
struct gfs2_quota_change *qc = qd->qd_bh_qc;
int64_t x;
s64 x;
mutex_lock(&sdp->sd_quota_mutex);
gfs2_trans_add_bh(ip->i_gl, qd->qd_bh, 1);
......@@ -571,7 +571,7 @@ static void do_qc(struct gfs2_quota_data *qd, int64_t change)
* in turn mostly borrowed from ext3
*/
static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
int64_t change, struct gfs2_quota_data *qd)
s64 change, struct gfs2_quota_data *qd)
{
struct inode *inode = &ip->i_inode;
struct address_space *mapping = inode->i_mapping;
......@@ -811,7 +811,7 @@ static int do_glock(struct gfs2_quota_data *qd, int force_refresh,
return error;
}
int gfs2_quota_lock(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
......@@ -848,7 +848,7 @@ static int need_sync(struct gfs2_quota_data *qd)
{
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
struct gfs2_tune *gt = &sdp->sd_tune;
int64_t value;
s64 value;
unsigned int num, den;
int do_sync = 1;
......@@ -873,7 +873,7 @@ static int need_sync(struct gfs2_quota_data *qd)
value *= gfs2_jindex_size(sdp) * num;
do_div(value, den);
value += (s64)be64_to_cpu(qd->qd_qb.qb_value);
if (value < (int64_t)be64_to_cpu(qd->qd_qb.qb_limit))
if (value < (s64)be64_to_cpu(qd->qd_qb.qb_limit))
do_sync = 0;
}
......@@ -927,12 +927,12 @@ static int print_message(struct gfs2_quota_data *qd, char *type)
return 0;
}
int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
struct gfs2_quota_data *qd;
int64_t value;
s64 value;
unsigned int x;
int error = 0;
......@@ -954,12 +954,12 @@ int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
value += qd->qd_change;
spin_unlock(&sdp->sd_quota_spin);
if (be64_to_cpu(qd->qd_qb.qb_limit) && (int64_t)be64_to_cpu(qd->qd_qb.qb_limit) < value) {
if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) {
print_message(qd, "exceeded");
error = -EDQUOT;
break;
} else if (be64_to_cpu(qd->qd_qb.qb_warn) &&
(int64_t)be64_to_cpu(qd->qd_qb.qb_warn) < value &&
(s64)be64_to_cpu(qd->qd_qb.qb_warn) < value &&
time_after_eq(jiffies, qd->qd_last_warn +
gfs2_tune_get(sdp,
gt_quota_warn_period) * HZ)) {
......@@ -971,8 +971,8 @@ int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
return error;
}
void gfs2_quota_change(struct gfs2_inode *ip, int64_t change,
uint32_t uid, uint32_t gid)
void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
u32 uid, u32 gid)
{
struct gfs2_alloc *al = &ip->i_alloc;
struct gfs2_quota_data *qd;
......@@ -1038,7 +1038,7 @@ int gfs2_quota_sync(struct gfs2_sbd *sdp)
return error;
}
int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, uint32_t id)
int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id)
{
struct gfs2_quota_data *qd;
struct gfs2_holder q_gh;
......@@ -1058,7 +1058,7 @@ int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, uint32_t id)
}
#if 0
int gfs2_quota_read(struct gfs2_sbd *sdp, int user, uint32_t id,
int gfs2_quota_read(struct gfs2_sbd *sdp, int user, u32 id,
struct gfs2_quota *q)
{
struct gfs2_quota_data *qd;
......@@ -1100,8 +1100,8 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift;
unsigned int x, slot = 0;
unsigned int found = 0;
uint64_t dblock;
uint32_t extlen = 0;
u64 dblock;
u32 extlen = 0;
int error;
if (!ip->i_di.di_size ||
......
......@@ -10,20 +10,20 @@
#ifndef __QUOTA_DOT_H__
#define __QUOTA_DOT_H__
#define NO_QUOTA_CHANGE ((uint32_t)-1)
#define NO_QUOTA_CHANGE ((u32)-1)
int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid);
int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid);
void gfs2_quota_unhold(struct gfs2_inode *ip);
int gfs2_quota_lock(struct gfs2_inode *ip, uint32_t uid, uint32_t gid);
int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid);
void gfs2_quota_unlock(struct gfs2_inode *ip);
int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid);
void gfs2_quota_change(struct gfs2_inode *ip, int64_t change,
uint32_t uid, uint32_t gid);
int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid);
void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
u32 uid, u32 gid);
int gfs2_quota_sync(struct gfs2_sbd *sdp);
int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, uint32_t id);
int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id);
int gfs2_quota_init(struct gfs2_sbd *sdp);
void gfs2_quota_scan(struct gfs2_sbd *sdp);
......
......@@ -35,8 +35,8 @@ int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk,
struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
struct gfs2_glock *gl = ip->i_gl;
int new = 0;
uint64_t dblock;
uint32_t extlen;
u64 dblock;
u32 extlen;
int error;
error = gfs2_extent_map(&ip->i_inode, blk, &new, &dblock, &extlen);
......@@ -53,7 +53,7 @@ int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk,
return error;
}
int gfs2_revoke_add(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where)
int gfs2_revoke_add(struct gfs2_sbd *sdp, u64 blkno, unsigned int where)
{
struct list_head *head = &sdp->sd_revoke_list;
struct gfs2_revoke_replay *rr;
......@@ -82,7 +82,7 @@ int gfs2_revoke_add(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where)
return 1;
}
int gfs2_revoke_check(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where)
int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where)
{
struct gfs2_revoke_replay *rr;
int wrap, a, b, revoke;
......@@ -137,7 +137,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
{
struct buffer_head *bh;
struct gfs2_log_header lh;
uint32_t hash;
u32 hash;
int error;
error = gfs2_replay_read_block(jd, blk, &bh);
......@@ -249,7 +249,7 @@ static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
{
struct gfs2_log_header lh_1, lh_m;
uint32_t blk_1, blk_2, blk_m;
u32 blk_1, blk_2, blk_m;
int error;
blk_1 = 0;
......@@ -370,9 +370,9 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
unsigned int lblock;
int new = 0;
uint64_t dblock;
u64 dblock;
struct gfs2_log_header *lh;
uint32_t hash;
u32 hash;
struct buffer_head *bh;
int error;
int boundary;
......
......@@ -19,8 +19,8 @@ static inline void gfs2_replay_incr_blk(struct gfs2_sbd *sdp, unsigned int *blk)
int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk,
struct buffer_head **bh);
int gfs2_revoke_add(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where);
int gfs2_revoke_check(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where);
int gfs2_revoke_add(struct gfs2_sbd *sdp, u64 blkno, unsigned int where);
int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where);
void gfs2_revoke_clean(struct gfs2_sbd *sdp);
int gfs2_find_jhead(struct gfs2_jdesc *jd,
......
......@@ -60,7 +60,7 @@ static const char valid_change[16] = {
*/
static void gfs2_setbit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
unsigned int buflen, uint32_t block,
unsigned int buflen, u32 block,
unsigned char new_state)
{
unsigned char *byte, *end, cur_state;
......@@ -90,7 +90,7 @@ static void gfs2_setbit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
*/
static unsigned char gfs2_testbit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
unsigned int buflen, uint32_t block)
unsigned int buflen, u32 block)
{
unsigned char *byte, *end, cur_state;
unsigned int bit;
......@@ -122,12 +122,12 @@ static unsigned char gfs2_testbit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
* Return: the block number (bitmap buffer scope) that was found
*/
static uint32_t gfs2_bitfit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
unsigned int buflen, uint32_t goal,
static u32 gfs2_bitfit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
unsigned int buflen, u32 goal,
unsigned char old_state)
{
unsigned char *byte, *end, alloc;
uint32_t blk = goal;
u32 blk = goal;
unsigned int bit;
byte = buffer + (goal / GFS2_NBBY);
......@@ -169,7 +169,7 @@ static uint32_t gfs2_bitfit(struct gfs2_rgrpd *rgd, unsigned char *buffer,
* Returns: The number of bits
*/
static uint32_t gfs2_bitcount(struct gfs2_rgrpd *rgd, unsigned char *buffer,
static u32 gfs2_bitcount(struct gfs2_rgrpd *rgd, unsigned char *buffer,
unsigned int buflen, unsigned char state)
{
unsigned char *byte = buffer;
......@@ -177,7 +177,7 @@ static uint32_t gfs2_bitcount(struct gfs2_rgrpd *rgd, unsigned char *buffer,
unsigned char state1 = state << 2;
unsigned char state2 = state << 4;
unsigned char state3 = state << 6;
uint32_t count = 0;
u32 count = 0;
for (; byte < end; byte++) {
if (((*byte) & 0x03) == state)
......@@ -204,11 +204,11 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
{
struct gfs2_sbd *sdp = rgd->rd_sbd;
struct gfs2_bitmap *bi = NULL;
uint32_t length = rgd->rd_ri.ri_length;
uint32_t count[4], tmp;
u32 length = rgd->rd_ri.ri_length;
u32 count[4], tmp;
int buf, x;
memset(count, 0, 4 * sizeof(uint32_t));
memset(count, 0, 4 * sizeof(u32));
/* Count # blocks in each of 4 possible allocation states */
for (buf = 0; buf < length; buf++) {
......@@ -253,10 +253,10 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
}
static inline int rgrp_contains_block(struct gfs2_rindex *ri, uint64_t block)
static inline int rgrp_contains_block(struct gfs2_rindex *ri, u64 block)
{
uint64_t first = ri->ri_data0;
uint64_t last = first + ri->ri_data;
u64 first = ri->ri_data0;
u64 last = first + ri->ri_data;
return !!(first <= block && block < last);
}
......@@ -268,7 +268,7 @@ static inline int rgrp_contains_block(struct gfs2_rindex *ri, uint64_t block)
* Returns: The resource group, or NULL if not found
*/
struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk)
struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk)
{
struct gfs2_rgrpd *rgd;
......@@ -367,8 +367,8 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd)
{
struct gfs2_sbd *sdp = rgd->rd_sbd;
struct gfs2_bitmap *bi;
uint32_t length = rgd->rd_ri.ri_length; /* # blocks in hdr & bitmap */
uint32_t bytes_left, bytes;
u32 length = rgd->rd_ri.ri_length; /* # blocks in hdr & bitmap */
u32 bytes_left, bytes;
int x;
if (!length)
......@@ -444,7 +444,7 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
struct gfs2_rgrpd *rgd;
char buf[sizeof(struct gfs2_rindex)];
struct file_ra_state ra_state;
uint64_t junk = ip->i_di.di_size;
u64 junk = ip->i_di.di_size;
int error;
if (do_div(junk, sizeof(struct gfs2_rindex))) {
......@@ -741,7 +741,7 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al)
*/
static struct gfs2_rgrpd *recent_rgrp_first(struct gfs2_sbd *sdp,
uint64_t rglast)
u64 rglast)
{
struct gfs2_rgrpd *rgd = NULL;
......@@ -1037,10 +1037,10 @@ void gfs2_inplace_release(struct gfs2_inode *ip)
* Returns: The block type (GFS2_BLKST_*)
*/
unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, uint64_t block)
unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block)
{
struct gfs2_bitmap *bi = NULL;
uint32_t length, rgrp_block, buf_block;
u32 length, rgrp_block, buf_block;
unsigned int buf;
unsigned char type;
......@@ -1083,12 +1083,12 @@ unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, uint64_t block)
* Returns: the block number allocated
*/
static uint32_t rgblk_search(struct gfs2_rgrpd *rgd, uint32_t goal,
static u32 rgblk_search(struct gfs2_rgrpd *rgd, u32 goal,
unsigned char old_state, unsigned char new_state)
{
struct gfs2_bitmap *bi = NULL;
uint32_t length = rgd->rd_ri.ri_length;
uint32_t blk = 0;
u32 length = rgd->rd_ri.ri_length;
u32 blk = 0;
unsigned int buf, x;
/* Find bitmap block that contains bits for goal block */
......@@ -1148,12 +1148,12 @@ static uint32_t rgblk_search(struct gfs2_rgrpd *rgd, uint32_t goal,
* Returns: Resource group containing the block(s)
*/
static struct gfs2_rgrpd *rgblk_free(struct gfs2_sbd *sdp, uint64_t bstart,
uint32_t blen, unsigned char new_state)
static struct gfs2_rgrpd *rgblk_free(struct gfs2_sbd *sdp, u64 bstart,
u32 blen, unsigned char new_state)
{
struct gfs2_rgrpd *rgd;
struct gfs2_bitmap *bi = NULL;
uint32_t length, rgrp_blk, buf_blk;
u32 length, rgrp_blk, buf_blk;
unsigned int buf;
rgd = gfs2_blk2rgrpd(sdp, bstart);
......@@ -1206,8 +1206,8 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip)
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
struct gfs2_rgrpd *rgd = al->al_rgd;
uint32_t goal, blk;
uint64_t block;
u32 goal, blk;
u64 block;
if (rgrp_contains_block(&rgd->rd_ri, ip->i_di.di_goal_data))
goal = ip->i_di.di_goal_data - rgd->rd_ri.ri_data0;
......@@ -1250,8 +1250,8 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip)
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
struct gfs2_rgrpd *rgd = al->al_rgd;
uint32_t goal, blk;
uint64_t block;
u32 goal, blk;
u64 block;
if (rgrp_contains_block(&rgd->rd_ri, ip->i_di.di_goal_meta))
goal = ip->i_di.di_goal_meta - rgd->rd_ri.ri_data0;
......@@ -1332,7 +1332,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
*
*/
void gfs2_free_data(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_rgrpd *rgd;
......@@ -1349,7 +1349,7 @@ void gfs2_free_data(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
gfs2_trans_add_rg(rgd);
gfs2_statfs_change(sdp, 0, +blen, 0);
gfs2_quota_change(ip, -(int64_t)blen,
gfs2_quota_change(ip, -(s64)blen,
ip->i_di.di_uid, ip->i_di.di_gid);
}
......@@ -1361,7 +1361,7 @@ void gfs2_free_data(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
*
*/
void gfs2_free_meta(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen)
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_rgrpd *rgd;
......@@ -1378,7 +1378,7 @@ void gfs2_free_meta(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
gfs2_trans_add_rg(rgd);
gfs2_statfs_change(sdp, 0, +blen, 0);
gfs2_quota_change(ip, -(int64_t)blen, ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_quota_change(ip, -(s64)blen, ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_meta_wipe(ip, bstart, blen);
}
......@@ -1397,7 +1397,7 @@ void gfs2_unlink_di(struct inode *inode)
gfs2_trans_add_rg(rgd);
}
static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, uint64_t blkno)
static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, u64 blkno)
{
struct gfs2_sbd *sdp = rgd->rd_sbd;
struct gfs2_rgrpd *tmp_rgd;
......@@ -1440,7 +1440,7 @@ void gfs2_free_di(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip)
*/
void gfs2_rlist_add(struct gfs2_sbd *sdp, struct gfs2_rgrp_list *rlist,
uint64_t block)
u64 block)
{
struct gfs2_rgrpd *rgd;
struct gfs2_rgrpd **tmp;
......
......@@ -12,7 +12,7 @@
void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd);
struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk);
struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk);
struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp);
struct gfs2_rgrpd *gfs2_rgrpd_get_next(struct gfs2_rgrpd *rgd);
......@@ -35,14 +35,14 @@ gfs2_inplace_reserve_i((ip), __FILE__, __LINE__)
void gfs2_inplace_release(struct gfs2_inode *ip);
unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, uint64_t block);
unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block);
u64 gfs2_alloc_data(struct gfs2_inode *ip);
u64 gfs2_alloc_meta(struct gfs2_inode *ip);
u64 gfs2_alloc_di(struct gfs2_inode *ip, u64 *generation);
void gfs2_free_data(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen);
void gfs2_free_meta(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen);
void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen);
void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen);
void gfs2_free_di(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip);
void gfs2_unlink_di(struct inode *inode);
......@@ -54,7 +54,7 @@ struct gfs2_rgrp_list {
};
void gfs2_rlist_add(struct gfs2_sbd *sdp, struct gfs2_rgrp_list *rlist,
uint64_t block);
u64 block);
void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state,
int flags);
void gfs2_rlist_free(struct gfs2_rgrp_list *rlist);
......
......@@ -33,11 +33,11 @@
#include "trans.h"
#include "util.h"
static const uint32_t gfs2_old_fs_formats[] = {
static const u32 gfs2_old_fs_formats[] = {
0
};
static const uint32_t gfs2_old_multihost_formats[] = {
static const u32 gfs2_old_multihost_formats[] = {
0
};
......@@ -225,8 +225,8 @@ static struct page *gfs2_read_super(struct super_block *sb, sector_t sector)
int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent)
{
uint32_t hash_blocks, ind_blocks, leaf_blocks;
uint32_t tmp_blocks;
u32 hash_blocks, ind_blocks, leaf_blocks;
u32 tmp_blocks;
unsigned int x;
int error;
struct page *page;
......@@ -251,20 +251,20 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent)
GFS2_BASIC_BLOCK_SHIFT;
sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
sdp->sd_diptrs = (sdp->sd_sb.sb_bsize -
sizeof(struct gfs2_dinode)) / sizeof(uint64_t);
sizeof(struct gfs2_dinode)) / sizeof(u64);
sdp->sd_inptrs = (sdp->sd_sb.sb_bsize -
sizeof(struct gfs2_meta_header)) / sizeof(uint64_t);
sizeof(struct gfs2_meta_header)) / sizeof(u64);
sdp->sd_jbsize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header);
sdp->sd_hash_bsize = sdp->sd_sb.sb_bsize / 2;
sdp->sd_hash_bsize_shift = sdp->sd_sb.sb_bsize_shift - 1;
sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(uint64_t);
sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(u64);
sdp->sd_qc_per_block = (sdp->sd_sb.sb_bsize -
sizeof(struct gfs2_meta_header)) /
sizeof(struct gfs2_quota_change);
/* Compute maximum reservation required to add a entry to a directory */
hash_blocks = DIV_ROUND_UP(sizeof(uint64_t) * (1 << GFS2_DIR_MAX_DEPTH),
hash_blocks = DIV_ROUND_UP(sizeof(u64) * (1 << GFS2_DIR_MAX_DEPTH),
sdp->sd_jbsize);
ind_blocks = 0;
......@@ -281,8 +281,8 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent)
sizeof(struct gfs2_dinode);
sdp->sd_heightsize[1] = sdp->sd_sb.sb_bsize * sdp->sd_diptrs;
for (x = 2;; x++) {
uint64_t space, d;
uint32_t m;
u64 space, d;
u32 m;
space = sdp->sd_heightsize[x - 1] * sdp->sd_inptrs;
d = space;
......@@ -299,8 +299,8 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent)
sizeof(struct gfs2_dinode);
sdp->sd_jheightsize[1] = sdp->sd_jbsize * sdp->sd_diptrs;
for (x = 2;; x++) {
uint64_t space, d;
uint32_t m;
u64 space, d;
u32 m;
space = sdp->sd_jheightsize[x - 1] * sdp->sd_inptrs;
d = space;
......@@ -630,8 +630,8 @@ int gfs2_statfs_init(struct gfs2_sbd *sdp)
return 0;
}
void gfs2_statfs_change(struct gfs2_sbd *sdp, int64_t total, int64_t free,
int64_t dinodes)
void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
s64 dinodes)
{
struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
struct gfs2_statfs_change *l_sc = &sdp->sd_statfs_local;
......
......@@ -40,7 +40,7 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp);
int gfs2_statfs_init(struct gfs2_sbd *sdp);
void gfs2_statfs_change(struct gfs2_sbd *sdp,
int64_t total, int64_t free, int64_t dinodes);
s64 total, s64 free, s64 dinodes);
int gfs2_statfs_sync(struct gfs2_sbd *sdp);
int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc);
int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc);
......
......@@ -138,7 +138,7 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf,
static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,
size_t len)
{
uint32_t id;
u32 id;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
......@@ -152,7 +152,7 @@ static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,
static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf,
size_t len)
{
uint32_t id;
u32 id;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
......
......@@ -46,7 +46,7 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
tr->tr_reserved += 6 + blocks;
if (revokes)
tr->tr_reserved += gfs2_struct2blk(sdp, revokes,
sizeof(uint64_t));
sizeof(u64));
INIT_LIST_HEAD(&tr->tr_list_buf);
gfs2_holder_init(sdp->sd_trans_gl, LM_ST_SHARED, 0, &tr->tr_t_gh);
......@@ -142,7 +142,7 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
lops_add(sdp, &bd->bd_le);
}
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, uint64_t blkno)
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno)
{
struct gfs2_revoke *rv = kmalloc(sizeof(struct gfs2_revoke),
GFP_NOFS | __GFP_NOFAIL);
......@@ -151,7 +151,7 @@ void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, uint64_t blkno)
lops_add(sdp, &rv->rv_le);
}
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, uint64_t blkno)
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno)
{
struct gfs2_revoke *rv;
int found = 0;
......
......@@ -27,8 +27,8 @@ void gfs2_trans_end(struct gfs2_sbd *sdp);
void gfs2_trans_add_gl(struct gfs2_glock *gl);
void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta);
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, uint64_t blkno);
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, uint64_t blkno);
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno);
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno);
void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd);
#endif /* __TRANS_DOT_H__ */
......@@ -171,7 +171,7 @@ int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
*/
int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
uint16_t type, uint16_t t, const char *function,
u16 type, u16 t, const char *function,
char *file, unsigned int line)
{
int me;
......
......@@ -82,7 +82,7 @@ static inline int gfs2_meta_check_i(struct gfs2_sbd *sdp,
char *file, unsigned int line)
{
struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
uint32_t magic = mh->mh_magic;
u32 magic = mh->mh_magic;
magic = be32_to_cpu(magic);
if (unlikely(magic != GFS2_MAGIC))
return gfs2_meta_check_ii(sdp, bh, "magic number", function,
......@@ -95,19 +95,19 @@ gfs2_meta_check_i((sdp), (bh), __FUNCTION__, __FILE__, __LINE__)
int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
uint16_t type, uint16_t t,
u16 type, u16 t,
const char *function,
char *file, unsigned int line);
static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp,
struct buffer_head *bh,
uint16_t type,
u16 type,
const char *function,
char *file, unsigned int line)
{
struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
uint32_t magic = mh->mh_magic;
uint16_t t = be32_to_cpu(mh->mh_type);
u32 magic = mh->mh_magic;
u16 t = be32_to_cpu(mh->mh_type);
magic = be32_to_cpu(magic);
if (unlikely(magic != GFS2_MAGIC))
return gfs2_meta_check_ii(sdp, bh, "magic number", function,
......@@ -121,8 +121,8 @@ static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp,
#define gfs2_metatype_check(sdp, bh, type) \
gfs2_metatype_check_i((sdp), (bh), (type), __FUNCTION__, __FILE__, __LINE__)
static inline void gfs2_metatype_set(struct buffer_head *bh, uint16_t type,
uint16_t format)
static inline void gfs2_metatype_set(struct buffer_head *bh, u16 type,
u16 format)
{
struct gfs2_meta_header *mh;
mh = (struct gfs2_meta_header *)bh->b_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment