aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/backref.c25
-rw-r--r--fs/btrfs/file-item.c2
-rw-r--r--fs/btrfs/qgroup.c32
-rw-r--r--fs/btrfs/send.c4
4 files changed, 32 insertions, 31 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 6655ca615364..e600857d3ca4 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -231,7 +231,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path,
231 } 231 }
232 if (!ret) { 232 if (!ret) {
233 ret = ulist_add(parents, eb->start, 233 ret = ulist_add(parents, eb->start,
234 (u64)eie, GFP_NOFS); 234 (uintptr_t)eie, GFP_NOFS);
235 if (ret < 0) 235 if (ret < 0)
236 break; 236 break;
237 if (!extent_item_pos) { 237 if (!extent_item_pos) {
@@ -363,8 +363,8 @@ static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info,
363 ULIST_ITER_INIT(&uiter); 363 ULIST_ITER_INIT(&uiter);
364 node = ulist_next(parents, &uiter); 364 node = ulist_next(parents, &uiter);
365 ref->parent = node ? node->val : 0; 365 ref->parent = node ? node->val : 0;
366 ref->inode_list = 366 ref->inode_list = node ?
367 node ? (struct extent_inode_elem *)node->aux : 0; 367 (struct extent_inode_elem *)(uintptr_t)node->aux : 0;
368 368
369 /* additional parents require new refs being added here */ 369 /* additional parents require new refs being added here */
370 while ((node = ulist_next(parents, &uiter))) { 370 while ((node = ulist_next(parents, &uiter))) {
@@ -375,8 +375,8 @@ static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info,
375 } 375 }
376 memcpy(new_ref, ref, sizeof(*ref)); 376 memcpy(new_ref, ref, sizeof(*ref));
377 new_ref->parent = node->val; 377 new_ref->parent = node->val;
378 new_ref->inode_list = 378 new_ref->inode_list = (struct extent_inode_elem *)
379 (struct extent_inode_elem *)node->aux; 379 (uintptr_t)node->aux;
380 list_add(&new_ref->list, &ref->list); 380 list_add(&new_ref->list, &ref->list);
381 } 381 }
382 ulist_reinit(parents); 382 ulist_reinit(parents);
@@ -914,7 +914,7 @@ again:
914 free_extent_buffer(eb); 914 free_extent_buffer(eb);
915 } 915 }
916 ret = ulist_add_merge(refs, ref->parent, 916 ret = ulist_add_merge(refs, ref->parent,
917 (u64)ref->inode_list, 917 (uintptr_t)ref->inode_list,
918 (u64 *)&eie, GFP_NOFS); 918 (u64 *)&eie, GFP_NOFS);
919 if (!ret && extent_item_pos) { 919 if (!ret && extent_item_pos) {
920 /* 920 /*
@@ -959,7 +959,7 @@ static void free_leaf_list(struct ulist *blocks)
959 while ((node = ulist_next(blocks, &uiter))) { 959 while ((node = ulist_next(blocks, &uiter))) {
960 if (!node->aux) 960 if (!node->aux)
961 continue; 961 continue;
962 eie = (struct extent_inode_elem *)node->aux; 962 eie = (struct extent_inode_elem *)(uintptr_t)node->aux;
963 for (; eie; eie = eie_next) { 963 for (; eie; eie = eie_next) {
964 eie_next = eie->next; 964 eie_next = eie->next;
965 kfree(eie); 965 kfree(eie);
@@ -1405,11 +1405,12 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
1405 while (!ret && (root_node = ulist_next(roots, &root_uiter))) { 1405 while (!ret && (root_node = ulist_next(roots, &root_uiter))) {
1406 pr_debug("root %llu references leaf %llu, data list " 1406 pr_debug("root %llu references leaf %llu, data list "
1407 "%#llx\n", root_node->val, ref_node->val, 1407 "%#llx\n", root_node->val, ref_node->val,
1408 ref_node->aux); 1408 (long long)ref_node->aux);
1409 ret = iterate_leaf_refs( 1409 ret = iterate_leaf_refs((struct extent_inode_elem *)
1410 (struct extent_inode_elem *)ref_node->aux, 1410 (uintptr_t)ref_node->aux,
1411 root_node->val, extent_item_objectid, 1411 root_node->val,
1412 iterate, ctx); 1412 extent_item_objectid,
1413 iterate, ctx);
1413 } 1414 }
1414 ulist_free(roots); 1415 ulist_free(roots);
1415 roots = NULL; 1416 roots = NULL;
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 857d93cd01dc..54f03354bed1 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -25,7 +25,7 @@
25#include "transaction.h" 25#include "transaction.h"
26#include "print-tree.h" 26#include "print-tree.h"
27 27
28#define __MAX_CSUM_ITEMS(r, size) ((((BTRFS_LEAF_DATA_SIZE(r) - \ 28#define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \
29 sizeof(struct btrfs_item) * 2) / \ 29 sizeof(struct btrfs_item) * 2) / \
30 size) - 1)) 30 size) - 1))
31 31
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 24f6adcdf339..9b707ba5c6c4 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1145,12 +1145,12 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
1145 1145
1146 ulist_reinit(tmp); 1146 ulist_reinit(tmp);
1147 /* XXX id not needed */ 1147 /* XXX id not needed */
1148 ulist_add(tmp, qg->qgroupid, (u64)qg, GFP_ATOMIC); 1148 ulist_add(tmp, qg->qgroupid, (u64)(uintptr_t)qg, GFP_ATOMIC);
1149 ULIST_ITER_INIT(&tmp_uiter); 1149 ULIST_ITER_INIT(&tmp_uiter);
1150 while ((tmp_unode = ulist_next(tmp, &tmp_uiter))) { 1150 while ((tmp_unode = ulist_next(tmp, &tmp_uiter))) {
1151 struct btrfs_qgroup_list *glist; 1151 struct btrfs_qgroup_list *glist;
1152 1152
1153 qg = (struct btrfs_qgroup *)tmp_unode->aux; 1153 qg = (struct btrfs_qgroup *)(uintptr_t)tmp_unode->aux;
1154 if (qg->refcnt < seq) 1154 if (qg->refcnt < seq)
1155 qg->refcnt = seq + 1; 1155 qg->refcnt = seq + 1;
1156 else 1156 else
@@ -1158,7 +1158,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
1158 1158
1159 list_for_each_entry(glist, &qg->groups, next_group) { 1159 list_for_each_entry(glist, &qg->groups, next_group) {
1160 ulist_add(tmp, glist->group->qgroupid, 1160 ulist_add(tmp, glist->group->qgroupid,
1161 (u64)glist->group, 1161 (u64)(uintptr_t)glist->group,
1162 GFP_ATOMIC); 1162 GFP_ATOMIC);
1163 } 1163 }
1164 } 1164 }
@@ -1168,13 +1168,13 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
1168 * step 2: walk from the new root 1168 * step 2: walk from the new root
1169 */ 1169 */
1170 ulist_reinit(tmp); 1170 ulist_reinit(tmp);
1171 ulist_add(tmp, qgroup->qgroupid, (u64)qgroup, GFP_ATOMIC); 1171 ulist_add(tmp, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC);
1172 ULIST_ITER_INIT(&uiter); 1172 ULIST_ITER_INIT(&uiter);
1173 while ((unode = ulist_next(tmp, &uiter))) { 1173 while ((unode = ulist_next(tmp, &uiter))) {
1174 struct btrfs_qgroup *qg; 1174 struct btrfs_qgroup *qg;
1175 struct btrfs_qgroup_list *glist; 1175 struct btrfs_qgroup_list *glist;
1176 1176
1177 qg = (struct btrfs_qgroup *)unode->aux; 1177 qg = (struct btrfs_qgroup *)(uintptr_t)unode->aux;
1178 if (qg->refcnt < seq) { 1178 if (qg->refcnt < seq) {
1179 /* not visited by step 1 */ 1179 /* not visited by step 1 */
1180 qg->rfer += sgn * node->num_bytes; 1180 qg->rfer += sgn * node->num_bytes;
@@ -1190,7 +1190,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
1190 1190
1191 list_for_each_entry(glist, &qg->groups, next_group) { 1191 list_for_each_entry(glist, &qg->groups, next_group) {
1192 ulist_add(tmp, glist->group->qgroupid, 1192 ulist_add(tmp, glist->group->qgroupid,
1193 (u64)glist->group, GFP_ATOMIC); 1193 (uintptr_t)glist->group, GFP_ATOMIC);
1194 } 1194 }
1195 } 1195 }
1196 1196
@@ -1208,12 +1208,12 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
1208 continue; 1208 continue;
1209 1209
1210 ulist_reinit(tmp); 1210 ulist_reinit(tmp);
1211 ulist_add(tmp, qg->qgroupid, (u64)qg, GFP_ATOMIC); 1211 ulist_add(tmp, qg->qgroupid, (uintptr_t)qg, GFP_ATOMIC);
1212 ULIST_ITER_INIT(&tmp_uiter); 1212 ULIST_ITER_INIT(&tmp_uiter);
1213 while ((tmp_unode = ulist_next(tmp, &tmp_uiter))) { 1213 while ((tmp_unode = ulist_next(tmp, &tmp_uiter))) {
1214 struct btrfs_qgroup_list *glist; 1214 struct btrfs_qgroup_list *glist;
1215 1215
1216 qg = (struct btrfs_qgroup *)tmp_unode->aux; 1216 qg = (struct btrfs_qgroup *)(uintptr_t)tmp_unode->aux;
1217 if (qg->tag == seq) 1217 if (qg->tag == seq)
1218 continue; 1218 continue;
1219 1219
@@ -1225,7 +1225,7 @@ int btrfs_qgroup_account_ref(struct btrfs_trans_handle *trans,
1225 1225
1226 list_for_each_entry(glist, &qg->groups, next_group) { 1226 list_for_each_entry(glist, &qg->groups, next_group) {
1227 ulist_add(tmp, glist->group->qgroupid, 1227 ulist_add(tmp, glist->group->qgroupid,
1228 (u64)glist->group, 1228 (uintptr_t)glist->group,
1229 GFP_ATOMIC); 1229 GFP_ATOMIC);
1230 } 1230 }
1231 } 1231 }
@@ -1469,13 +1469,13 @@ int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes)
1469 * be exceeded 1469 * be exceeded
1470 */ 1470 */
1471 ulist = ulist_alloc(GFP_ATOMIC); 1471 ulist = ulist_alloc(GFP_ATOMIC);
1472 ulist_add(ulist, qgroup->qgroupid, (u64)qgroup, GFP_ATOMIC); 1472 ulist_add(ulist, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC);
1473 ULIST_ITER_INIT(&uiter); 1473 ULIST_ITER_INIT(&uiter);
1474 while ((unode = ulist_next(ulist, &uiter))) { 1474 while ((unode = ulist_next(ulist, &uiter))) {
1475 struct btrfs_qgroup *qg; 1475 struct btrfs_qgroup *qg;
1476 struct btrfs_qgroup_list *glist; 1476 struct btrfs_qgroup_list *glist;
1477 1477
1478 qg = (struct btrfs_qgroup *)unode->aux; 1478 qg = (struct btrfs_qgroup *)(uintptr_t)unode->aux;
1479 1479
1480 if ((qg->lim_flags & BTRFS_QGROUP_LIMIT_MAX_RFER) && 1480 if ((qg->lim_flags & BTRFS_QGROUP_LIMIT_MAX_RFER) &&
1481 qg->reserved + qg->rfer + num_bytes > 1481 qg->reserved + qg->rfer + num_bytes >
@@ -1489,7 +1489,7 @@ int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes)
1489 1489
1490 list_for_each_entry(glist, &qg->groups, next_group) { 1490 list_for_each_entry(glist, &qg->groups, next_group) {
1491 ulist_add(ulist, glist->group->qgroupid, 1491 ulist_add(ulist, glist->group->qgroupid,
1492 (u64)glist->group, GFP_ATOMIC); 1492 (uintptr_t)glist->group, GFP_ATOMIC);
1493 } 1493 }
1494 } 1494 }
1495 if (ret) 1495 if (ret)
@@ -1502,7 +1502,7 @@ int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes)
1502 while ((unode = ulist_next(ulist, &uiter))) { 1502 while ((unode = ulist_next(ulist, &uiter))) {
1503 struct btrfs_qgroup *qg; 1503 struct btrfs_qgroup *qg;
1504 1504
1505 qg = (struct btrfs_qgroup *)unode->aux; 1505 qg = (struct btrfs_qgroup *)(uintptr_t)unode->aux;
1506 1506
1507 qg->reserved += num_bytes; 1507 qg->reserved += num_bytes;
1508 } 1508 }
@@ -1541,19 +1541,19 @@ void btrfs_qgroup_free(struct btrfs_root *root, u64 num_bytes)
1541 goto out; 1541 goto out;
1542 1542
1543 ulist = ulist_alloc(GFP_ATOMIC); 1543 ulist = ulist_alloc(GFP_ATOMIC);
1544 ulist_add(ulist, qgroup->qgroupid, (u64)qgroup, GFP_ATOMIC); 1544 ulist_add(ulist, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC);
1545 ULIST_ITER_INIT(&uiter); 1545 ULIST_ITER_INIT(&uiter);
1546 while ((unode = ulist_next(ulist, &uiter))) { 1546 while ((unode = ulist_next(ulist, &uiter))) {
1547 struct btrfs_qgroup *qg; 1547 struct btrfs_qgroup *qg;
1548 struct btrfs_qgroup_list *glist; 1548 struct btrfs_qgroup_list *glist;
1549 1549
1550 qg = (struct btrfs_qgroup *)unode->aux; 1550 qg = (struct btrfs_qgroup *)(uintptr_t)unode->aux;
1551 1551
1552 qg->reserved -= num_bytes; 1552 qg->reserved -= num_bytes;
1553 1553
1554 list_for_each_entry(glist, &qg->groups, next_group) { 1554 list_for_each_entry(glist, &qg->groups, next_group) {
1555 ulist_add(ulist, glist->group->qgroupid, 1555 ulist_add(ulist, glist->group->qgroupid,
1556 (u64)glist->group, GFP_ATOMIC); 1556 (uintptr_t)glist->group, GFP_ATOMIC);
1557 } 1557 }
1558 } 1558 }
1559 1559
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index f22fdd41ff49..e5c867996aa0 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -1035,7 +1035,7 @@ struct backref_ctx {
1035 1035
1036static int __clone_root_cmp_bsearch(const void *key, const void *elt) 1036static int __clone_root_cmp_bsearch(const void *key, const void *elt)
1037{ 1037{
1038 u64 root = (u64)key; 1038 u64 root = (u64)(uintptr_t)key;
1039 struct clone_root *cr = (struct clone_root *)elt; 1039 struct clone_root *cr = (struct clone_root *)elt;
1040 1040
1041 if (root < cr->root->objectid) 1041 if (root < cr->root->objectid)
@@ -1069,7 +1069,7 @@ static int __iterate_backrefs(u64 ino, u64 offset, u64 root, void *ctx_)
1069 u64 i_size; 1069 u64 i_size;
1070 1070
1071 /* First check if the root is in the list of accepted clone sources */ 1071 /* First check if the root is in the list of accepted clone sources */
1072 found = bsearch((void *)root, bctx->sctx->clone_roots, 1072 found = bsearch((void *)(uintptr_t)root, bctx->sctx->clone_roots,
1073 bctx->sctx->clone_roots_cnt, 1073 bctx->sctx->clone_roots_cnt,
1074 sizeof(struct clone_root), 1074 sizeof(struct clone_root),
1075 __clone_root_cmp_bsearch); 1075 __clone_root_cmp_bsearch);