Skip to content

Commit

Permalink
Btrfs: fix compiler warnings on 32 bit systems
Browse files Browse the repository at this point in the history
The enospc tracing code added some interesting uses of
u64 pointer casts.

Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
chrismason-xx committed Feb 24, 2012
1 parent 5500cdb commit e77266e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/check-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(
static int btrfsic_process_superblock(struct btrfsic_state *state,
struct btrfs_fs_devices *fs_devices)
{
int ret;
int ret = 0;
struct btrfs_super_block *selected_super;
struct list_head *dev_head = &fs_devices->devices;
struct btrfs_device *device;
Expand Down
35 changes: 19 additions & 16 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3312,7 +3312,8 @@ int btrfs_check_data_free_space(struct inode *inode, u64 bytes)
}
data_sinfo->bytes_may_use += bytes;
trace_btrfs_space_reservation(root->fs_info, "space_info",
(u64)data_sinfo, bytes, 1);
(u64)(unsigned long)data_sinfo,
bytes, 1);
spin_unlock(&data_sinfo->lock);

return 0;
Expand All @@ -3333,7 +3334,8 @@ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes)
spin_lock(&data_sinfo->lock);
data_sinfo->bytes_may_use -= bytes;
trace_btrfs_space_reservation(root->fs_info, "space_info",
(u64)data_sinfo, bytes, 0);
(u64)(unsigned long)data_sinfo,
bytes, 0);
spin_unlock(&data_sinfo->lock);
}

Expand Down Expand Up @@ -3698,9 +3700,9 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
if (used + orig_bytes <= space_info->total_bytes) {
space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info,
"space_info",
(u64)space_info,
orig_bytes, 1);
"space_info",
(u64)(unsigned long)space_info,
orig_bytes, 1);
ret = 0;
} else {
/*
Expand Down Expand Up @@ -3769,9 +3771,9 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
if (used + num_bytes < space_info->total_bytes + avail) {
space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info,
"space_info",
(u64)space_info,
orig_bytes, 1);
"space_info",
(u64)(unsigned long)space_info,
orig_bytes, 1);
ret = 0;
} else {
wait_ordered = true;
Expand Down Expand Up @@ -3916,8 +3918,8 @@ static void block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
spin_lock(&space_info->lock);
space_info->bytes_may_use -= num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info",
(u64)space_info,
num_bytes, 0);
(u64)(unsigned long)space_info,
num_bytes, 0);
space_info->reservation_progress++;
spin_unlock(&space_info->lock);
}
Expand Down Expand Up @@ -4135,14 +4137,14 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
block_rsv->reserved += num_bytes;
sinfo->bytes_may_use += num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info",
(u64)sinfo, num_bytes, 1);
(u64)(unsigned long)sinfo, num_bytes, 1);
}

if (block_rsv->reserved >= block_rsv->size) {
num_bytes = block_rsv->reserved - block_rsv->size;
sinfo->bytes_may_use -= num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info",
(u64)sinfo, num_bytes, 0);
(u64)(unsigned long)sinfo, num_bytes, 0);
sinfo->reservation_progress++;
block_rsv->reserved = block_rsv->size;
block_rsv->full = 1;
Expand Down Expand Up @@ -4195,7 +4197,8 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
if (!trans->bytes_reserved)
return;

trace_btrfs_space_reservation(root->fs_info, "transaction", (u64)trans,
trace_btrfs_space_reservation(root->fs_info, "transaction",
(u64)(unsigned long)trans,
trans->bytes_reserved, 0);
btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
trans->bytes_reserved = 0;
Expand Down Expand Up @@ -4713,9 +4716,9 @@ static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
space_info->bytes_reserved += num_bytes;
if (reserve == RESERVE_ALLOC) {
trace_btrfs_space_reservation(cache->fs_info,
"space_info",
(u64)space_info,
num_bytes, 0);
"space_info",
(u64)(unsigned long)space_info,
num_bytes, 0);
space_info->bytes_may_use -= num_bytes;
}
}
Expand Down
6 changes: 4 additions & 2 deletions fs/btrfs/inode-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
trans->bytes_reserved);
if (ret)
goto out;
trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans,
trace_btrfs_space_reservation(root->fs_info, "ino_cache",
(u64)(unsigned long)trans,
trans->bytes_reserved, 1);
again:
inode = lookup_free_ino_inode(root, path);
Expand Down Expand Up @@ -500,7 +501,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
out_put:
iput(inode);
out_release:
trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans,
trace_btrfs_space_reservation(root->fs_info, "ino_cache",
(u64)(unsigned long)trans,
trans->bytes_reserved, 0);
btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
out:
Expand Down
3 changes: 2 additions & 1 deletion fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,

if (num_bytes) {
trace_btrfs_space_reservation(root->fs_info, "transaction",
(u64)h, num_bytes, 1);
(u64)(unsigned long)h,
num_bytes, 1);
h->block_rsv = &root->fs_info->trans_block_rsv;
h->bytes_reserved = num_bytes;
}
Expand Down

0 comments on commit e77266e

Please sign in to comment.