summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-27 06:25:01 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-27 06:25:01 -0400
commite6819928c848adf5cb2c41f963e4e38474e95915 (patch)
treee1bc5a3426a311a791e7363e5d771eceef7ca7bf
parent4200896a53cfa14bcc4f8dcbd105343a7b1dda96 (diff)
first free objectid fixes
-rw-r--r--ctree.h1
-rw-r--r--inode-map.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index 8fed41e3..00810f35 100644
--- a/ctree.h
+++ b/ctree.h
@@ -12,6 +12,7 @@ struct btrfs_trans_handle;
#define BTRFS_EXTENT_TREE_OBJECTID 2
#define BTRFS_INODE_MAP_OBJECTID 3
#define BTRFS_FS_TREE_OBJECTID 4
+#define BTRFS_FIRST_FREE_OBJECTID 5
/*
* the key defines the order in the tree, and so it also defines (optimal)
diff --git a/inode-map.c b/inode-map.c
index f412b339..cf9f42e4 100644
--- a/inode-map.c
+++ b/inode-map.c
@@ -28,6 +28,8 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
if (fs_root->fs_info->last_inode_alloc_dirid == dirid)
search_start = fs_root->fs_info->last_inode_alloc;
+ if (search_start < BTRFS_FIRST_FREE_OBJECTID)
+ search_start = BTRFS_FIRST_FREE_OBJECTID;
search_key.objectid = search_start;
search_key.flags = 0;
btrfs_set_key_type(&search_key, BTRFS_INODE_MAP_ITEM_KEY);