+/*
+ * Copyright (C) 2007 Oracle. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
unsigned long oid;
btrfs_init_path(&path);
ret = setup_key(radix, &key, 0);
- sprintf(buf, "str-%Lu\n", key.objectid);
+ sprintf(buf, "str-%llu\n", (unsigned long long)key.objectid);
ret = btrfs_insert_item(trans, 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 %llu\n", (unsigned long long)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-%llu\n", (unsigned long long)key.objectid);
ret = btrfs_insert_item(trans, root, &key, buf, strlen(buf));
if (ret != -EEXIST) {
- printf("insert on %Lu gave us %d\n", key.objectid, ret);
+ printf("insert on %llu gave us %d\n",
+ (unsigned long long)key.objectid, ret);
return 1;
}
return 0;
goto error;
return 0;
error:
- printf("failed to delete %Lu\n", key.objectid);
+ printf("failed to delete %llu\n", (unsigned long long)key.objectid);
return -1;
}
goto error;
return 0;
error:
- printf("unable to find key %Lu\n", key.objectid);
+ printf("unable to find key %llu\n", (unsigned long long)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 %llu\n",
+ (unsigned long long)key.objectid);
return -1;
}
{
struct btrfs_path path;
struct btrfs_key key;
- unsigned long found;
+ unsigned long found = 0;
int ret;
int slot;
int i;
if (ret) {
fprintf(stderr, "op %d failed %d:%d\n",
op, i, iterations);
- btrfs_print_tree(root, root->node);
+ btrfs_print_tree(root, root->node, 1);
fprintf(stderr, "op %d failed %d:%d\n",
op, i, iterations);
err = ret;