mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-24 07:02:45 +00:00
first free objectid fixes
This commit is contained in:
parent
4200896a53
commit
e6819928c8
1
ctree.h
1
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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user