$(objects) : $(headers)
clean :
- rm ctree *.o
+ rm debug-tree tester *.o
ret = search_slot(extent_root, &key, &path, 0);
if (ret) {
print_tree(extent_root, extent_root->node);
- printf("unable to find %lu\n", key.objectid);
+ printf("unable to find %Lu\n", key.objectid);
BUG();
// FIXME undo it and return sane
return ret;
ret = search_slot(extent_root, &key, &path, 0);
if (ret) {
print_tree(extent_root, extent_root->node);
- printf("failed to find %lu\n", key.objectid);
+ printf("failed to find %Lu\n", key.objectid);
BUG();
}
ret = del_item(extent_root, &path);
#define BUG() abort()
typedef unsigned int u32;
-typedef unsigned long u64;
+typedef unsigned long long u64;
typedef unsigned char u8;
typedef unsigned short u16;
int nr = l->header.nritems;
struct item *item;
struct extent_item *ei;
- printf("leaf %lu total ptrs %d free space %d\n", l->header.blocknr, nr,
+ printf("leaf %Lu total ptrs %d free space %d\n", l->header.blocknr, nr,
leaf_free_space(l));
fflush(stdout);
for (i = 0 ; i < nr ; i++) {
item = l->items + i;
- printf("\titem %d key (%lu %u %lu) itemoff %d itemsize %d\n",
+ printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n",
i,
item->key.objectid, item->key.flags, item->key.offset,
item->offset, item->size);
fflush(stdout);
printf("\t\titem data %.*s\n", item->size, l->data+item->offset);
ei = (struct extent_item *)(l->data + item->offset);
- printf("\t\textent data %u %lu\n", ei->refs, ei->owner);
+ printf("\t\textent data %u %Lu\n", ei->refs, ei->owner);
fflush(stdout);
}
}
print_leaf((struct leaf *)c);
return;
}
- printf("node %lu level %d total ptrs %d free spc %lu\n", t->blocknr,
+ printf("node %Lu level %d total ptrs %d free spc %lu\n", t->blocknr,
node_level(c->header.flags), c->header.nritems,
NODEPTRS_PER_BLOCK - c->header.nritems);
fflush(stdout);
for (i = 0; i < nr; i++) {
- printf("\tkey %d (%lu %u %lu) block %lu\n",
+ printf("\tkey %d (%Lu %u %Lu) block %Lu\n",
i,
c->keys[i].objectid, c->keys[i].flags, c->keys[i].offset,
c->blockptrs[i]);
char buf[128];
init_path(&path);
ret = setup_key(radix, &key, 0);
- sprintf(buf, "str-%lu\n", key.objectid);
+ sprintf(buf, "str-%Lu\n", key.objectid);
ret = insert_item(root, &key, buf, strlen(buf));
if (ret)
goto error;
goto error;
return ret;
error:
- printf("failed to insert %lu\n", key.objectid);
+ printf("failed to insert %Lu\n", key.objectid);
return -1;
}
ret = setup_key(radix, &key, 1);
if (ret < 0)
return 0;
- sprintf(buf, "str-%lu\n", key.objectid);
+ sprintf(buf, "str-%Lu\n", key.objectid);
ret = insert_item(root, &key, buf, strlen(buf));
if (ret != -EEXIST) {
- printf("insert on %lu gave us %d\n", key.objectid, ret);
+ printf("insert on %Lu gave us %d\n", key.objectid, ret);
return 1;
}
return 0;
goto error;
return 0;
error:
- printf("failed to delete %lu\n", key.objectid);
+ printf("failed to delete %Lu\n", key.objectid);
return -1;
}
goto error;
return 0;
error:
- printf("unable to find key %lu\n", key.objectid);
+ printf("unable to find key %Lu\n", key.objectid);
return -1;
}
goto error;
return 0;
error:
- printf("able to find key that should not exist %lu\n", key.objectid);
+ printf("able to find key that should not exist %Lu\n", key.objectid);
return -1;
}
{
struct ctree_path path;
struct key key;
- u64 found;
+ unsigned long found;
int ret;
int slot;
int i;