ctree.c (eced687e224eb3cc5a501cf53ad9291337c8dbc5) ctree.c (11d6ae03557e34dd2bc9e57d1a5139ab3c7be54f)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2007,2008 Oracle. All rights reserved.
4 */
5
6#include <linux/sched.h>
7#include <linux/slab.h>
8#include <linux/rbtree.h>

--- 1294 unchanged lines hidden (view full) ---

1303 if (wret < 0)
1304 ret = wret;
1305 if (wret == 0) {
1306 struct btrfs_disk_key disk_key;
1307 orig_slot += left_nr;
1308 btrfs_node_key(mid, &disk_key, 0);
1309 ret = btrfs_tree_mod_log_insert_key(parent, pslot,
1310 BTRFS_MOD_LOG_KEY_REPLACE);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2007,2008 Oracle. All rights reserved.
4 */
5
6#include <linux/sched.h>
7#include <linux/slab.h>
8#include <linux/rbtree.h>

--- 1294 unchanged lines hidden (view full) ---

1303 if (wret < 0)
1304 ret = wret;
1305 if (wret == 0) {
1306 struct btrfs_disk_key disk_key;
1307 orig_slot += left_nr;
1308 btrfs_node_key(mid, &disk_key, 0);
1309 ret = btrfs_tree_mod_log_insert_key(parent, pslot,
1310 BTRFS_MOD_LOG_KEY_REPLACE);
1311 BUG_ON(ret < 0);
1311 if (ret < 0) {
1312 btrfs_tree_unlock(left);
1313 free_extent_buffer(left);
1314 btrfs_abort_transaction(trans, ret);
1315 return ret;
1316 }
1312 btrfs_set_node_key(parent, &disk_key, pslot);
1313 btrfs_mark_buffer_dirty(parent);
1314 if (btrfs_header_nritems(left) > orig_slot) {
1315 path->nodes[level] = left;
1316 path->slots[level + 1] -= 1;
1317 path->slots[level] = orig_slot;
1318 btrfs_tree_unlock(mid);
1319 free_extent_buffer(mid);

--- 38 unchanged lines hidden (view full) ---

1358 if (wret < 0)
1359 ret = wret;
1360 if (wret == 0) {
1361 struct btrfs_disk_key disk_key;
1362
1363 btrfs_node_key(right, &disk_key, 0);
1364 ret = btrfs_tree_mod_log_insert_key(parent, pslot + 1,
1365 BTRFS_MOD_LOG_KEY_REPLACE);
1317 btrfs_set_node_key(parent, &disk_key, pslot);
1318 btrfs_mark_buffer_dirty(parent);
1319 if (btrfs_header_nritems(left) > orig_slot) {
1320 path->nodes[level] = left;
1321 path->slots[level + 1] -= 1;
1322 path->slots[level] = orig_slot;
1323 btrfs_tree_unlock(mid);
1324 free_extent_buffer(mid);

--- 38 unchanged lines hidden (view full) ---

1363 if (wret < 0)
1364 ret = wret;
1365 if (wret == 0) {
1366 struct btrfs_disk_key disk_key;
1367
1368 btrfs_node_key(right, &disk_key, 0);
1369 ret = btrfs_tree_mod_log_insert_key(parent, pslot + 1,
1370 BTRFS_MOD_LOG_KEY_REPLACE);
1366 BUG_ON(ret < 0);
1371 if (ret < 0) {
1372 btrfs_tree_unlock(right);
1373 free_extent_buffer(right);
1374 btrfs_abort_transaction(trans, ret);
1375 return ret;
1376 }
1367 btrfs_set_node_key(parent, &disk_key, pslot + 1);
1368 btrfs_mark_buffer_dirty(parent);
1369
1370 if (btrfs_header_nritems(mid) <= orig_slot) {
1371 path->nodes[level] = right;
1372 path->slots[level + 1] += 1;
1373 path->slots[level] = orig_slot -
1374 btrfs_header_nritems(mid);

--- 3725 unchanged lines hidden ---
1377 btrfs_set_node_key(parent, &disk_key, pslot + 1);
1378 btrfs_mark_buffer_dirty(parent);
1379
1380 if (btrfs_header_nritems(mid) <= orig_slot) {
1381 path->nodes[level] = right;
1382 path->slots[level + 1] += 1;
1383 path->slots[level] = orig_slot -
1384 btrfs_header_nritems(mid);

--- 3725 unchanged lines hidden ---