ctree.c (0bd40a718444b28793283b70286f9e29d464a189) | ctree.c (7b1287662304c3cb05cb38f5e3e2d69f386e8f10) |
---|---|
1/* 2 * Copyright (C) 2007 Oracle. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public 6 * License v2 as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, --- 2608 unchanged lines hidden (view full) --- 2617 u32 total_data = 0; 2618 unsigned int data_end; 2619 struct btrfs_disk_key disk_key; 2620 2621 for (i = 0; i < nr; i++) { 2622 total_data += data_size[i]; 2623 } 2624 | 1/* 2 * Copyright (C) 2007 Oracle. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public 6 * License v2 as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, --- 2608 unchanged lines hidden (view full) --- 2617 u32 total_data = 0; 2618 unsigned int data_end; 2619 struct btrfs_disk_key disk_key; 2620 2621 for (i = 0; i < nr; i++) { 2622 total_data += data_size[i]; 2623 } 2624 |
2625 total_size = total_data + (nr - 1) * sizeof(struct btrfs_item); | 2625 total_size = total_data + (nr * sizeof(struct btrfs_item)); |
2626 ret = btrfs_search_slot(trans, root, cpu_key, path, total_size, 1); 2627 if (ret == 0) { 2628 return -EEXIST; 2629 } 2630 if (ret < 0) 2631 goto out; 2632 2633 slot_orig = path->slots[0]; --- 642 unchanged lines hidden --- | 2626 ret = btrfs_search_slot(trans, root, cpu_key, path, total_size, 1); 2627 if (ret == 0) { 2628 return -EEXIST; 2629 } 2630 if (ret < 0) 2631 goto out; 2632 2633 slot_orig = path->slots[0]; --- 642 unchanged lines hidden --- |