From c0af17d07f1122eff07c751dafef3954bcffc822 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 3 Dec 2014 12:18:29 +0800 Subject: btrfs-progs: Import lookup/del_inode_ref() function. Import lookup/del_inode_ref() function in inode-item.c, as base functions for the incoming btrfs_add_link() and btrfs_unlink() functions. Also modify btrfs_insert_inode_ref() and split_leaf() making them able to deal with EXTENT_IREF incompat flag. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- ctree.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ctree.c') diff --git a/ctree.c b/ctree.c index 23399e2..bd6cb12 100644 --- a/ctree.c +++ b/ctree.c @@ -2015,6 +2015,12 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, int split; int num_doubles = 0; + l = path->nodes[0]; + slot = path->slots[0]; + if (extend && data_size + btrfs_item_size_nr(l, slot) + + sizeof(struct btrfs_item) > BTRFS_LEAF_DATA_SIZE(root)) + return -EOVERFLOW; + /* first try to make some room by pushing left and right */ if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY) { wret = push_leaf_right(trans, root, path, data_size, 0); -- cgit v1.2.1