Commit e77266e4 authored by Chris Mason's avatar Chris Mason

Btrfs: fix compiler warnings on 32 bit systems

The enospc tracing code added some interesting uses of
u64 pointer casts.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 5500cdbe
...@@ -644,7 +644,7 @@ static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup( ...@@ -644,7 +644,7 @@ static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(
static int btrfsic_process_superblock(struct btrfsic_state *state, static int btrfsic_process_superblock(struct btrfsic_state *state,
struct btrfs_fs_devices *fs_devices) struct btrfs_fs_devices *fs_devices)
{ {
int ret; int ret = 0;
struct btrfs_super_block *selected_super; struct btrfs_super_block *selected_super;
struct list_head *dev_head = &fs_devices->devices; struct list_head *dev_head = &fs_devices->devices;
struct btrfs_device *device; struct btrfs_device *device;
......
...@@ -3312,7 +3312,8 @@ int btrfs_check_data_free_space(struct inode *inode, u64 bytes) ...@@ -3312,7 +3312,8 @@ int btrfs_check_data_free_space(struct inode *inode, u64 bytes)
} }
data_sinfo->bytes_may_use += bytes; data_sinfo->bytes_may_use += bytes;
trace_btrfs_space_reservation(root->fs_info, "space_info", 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); spin_unlock(&data_sinfo->lock);
return 0; return 0;
...@@ -3333,7 +3334,8 @@ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes) ...@@ -3333,7 +3334,8 @@ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes)
spin_lock(&data_sinfo->lock); spin_lock(&data_sinfo->lock);
data_sinfo->bytes_may_use -= bytes; data_sinfo->bytes_may_use -= bytes;
trace_btrfs_space_reservation(root->fs_info, "space_info", 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); spin_unlock(&data_sinfo->lock);
} }
...@@ -3699,7 +3701,7 @@ static int reserve_metadata_bytes(struct btrfs_root *root, ...@@ -3699,7 +3701,7 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
space_info->bytes_may_use += orig_bytes; space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info, trace_btrfs_space_reservation(root->fs_info,
"space_info", "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
orig_bytes, 1); orig_bytes, 1);
ret = 0; ret = 0;
} else { } else {
...@@ -3770,7 +3772,7 @@ static int reserve_metadata_bytes(struct btrfs_root *root, ...@@ -3770,7 +3772,7 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
space_info->bytes_may_use += orig_bytes; space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info, trace_btrfs_space_reservation(root->fs_info,
"space_info", "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
orig_bytes, 1); orig_bytes, 1);
ret = 0; ret = 0;
} else { } else {
...@@ -3916,7 +3918,7 @@ static void block_rsv_release_bytes(struct btrfs_fs_info *fs_info, ...@@ -3916,7 +3918,7 @@ static void block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
spin_lock(&space_info->lock); spin_lock(&space_info->lock);
space_info->bytes_may_use -= num_bytes; space_info->bytes_may_use -= num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info", trace_btrfs_space_reservation(fs_info, "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
num_bytes, 0); num_bytes, 0);
space_info->reservation_progress++; space_info->reservation_progress++;
spin_unlock(&space_info->lock); spin_unlock(&space_info->lock);
...@@ -4135,14 +4137,14 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info) ...@@ -4135,14 +4137,14 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
block_rsv->reserved += num_bytes; block_rsv->reserved += num_bytes;
sinfo->bytes_may_use += num_bytes; sinfo->bytes_may_use += num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info", 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) { if (block_rsv->reserved >= block_rsv->size) {
num_bytes = block_rsv->reserved - block_rsv->size; num_bytes = block_rsv->reserved - block_rsv->size;
sinfo->bytes_may_use -= num_bytes; sinfo->bytes_may_use -= num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info", trace_btrfs_space_reservation(fs_info, "space_info",
(u64)sinfo, num_bytes, 0); (u64)(unsigned long)sinfo, num_bytes, 0);
sinfo->reservation_progress++; sinfo->reservation_progress++;
block_rsv->reserved = block_rsv->size; block_rsv->reserved = block_rsv->size;
block_rsv->full = 1; block_rsv->full = 1;
...@@ -4195,7 +4197,8 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, ...@@ -4195,7 +4197,8 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
if (!trans->bytes_reserved) if (!trans->bytes_reserved)
return; 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); trans->bytes_reserved, 0);
btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
trans->bytes_reserved = 0; trans->bytes_reserved = 0;
...@@ -4714,7 +4717,7 @@ static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache, ...@@ -4714,7 +4717,7 @@ static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
if (reserve == RESERVE_ALLOC) { if (reserve == RESERVE_ALLOC) {
trace_btrfs_space_reservation(cache->fs_info, trace_btrfs_space_reservation(cache->fs_info,
"space_info", "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
num_bytes, 0); num_bytes, 0);
space_info->bytes_may_use -= num_bytes; space_info->bytes_may_use -= num_bytes;
} }
......
...@@ -438,7 +438,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root, ...@@ -438,7 +438,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
trans->bytes_reserved); trans->bytes_reserved);
if (ret) if (ret)
goto out; 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); trans->bytes_reserved, 1);
again: again:
inode = lookup_free_ino_inode(root, path); inode = lookup_free_ino_inode(root, path);
...@@ -500,7 +501,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root, ...@@ -500,7 +501,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
out_put: out_put:
iput(inode); iput(inode);
out_release: 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); trans->bytes_reserved, 0);
btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
out: out:
......
...@@ -327,7 +327,8 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root, ...@@ -327,7 +327,8 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
if (num_bytes) { if (num_bytes) {
trace_btrfs_space_reservation(root->fs_info, "transaction", 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->block_rsv = &root->fs_info->trans_block_rsv;
h->bytes_reserved = num_bytes; h->bytes_reserved = num_bytes;
} }
......
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