inode.c (4d4ab6d6bc05ba65169de9a5391e6ccbe09d8719) inode.c (e4058b54d1e442b6b3eca949f0d63d49ba2b020d)
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,

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

3337 if (cmpxchg(&root->orphan_cleanup_state, 0, ORPHAN_CLEANUP_STARTED))
3338 return 0;
3339
3340 path = btrfs_alloc_path();
3341 if (!path) {
3342 ret = -ENOMEM;
3343 goto out;
3344 }
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,

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

3337 if (cmpxchg(&root->orphan_cleanup_state, 0, ORPHAN_CLEANUP_STARTED))
3338 return 0;
3339
3340 path = btrfs_alloc_path();
3341 if (!path) {
3342 ret = -ENOMEM;
3343 goto out;
3344 }
3345 path->reada = -1;
3345 path->reada = READA_BACK;
3346
3347 key.objectid = BTRFS_ORPHAN_OBJECTID;
3348 key.type = BTRFS_ORPHAN_ITEM_KEY;
3349 key.offset = (u64)-1;
3350
3351 while (1) {
3352 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3353 if (ret < 0)

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

4303 */
4304 if (!btrfs_is_free_space_inode(inode) &&
4305 test_bit(BTRFS_ROOT_REF_COWS, &root->state))
4306 be_nice = 1;
4307
4308 path = btrfs_alloc_path();
4309 if (!path)
4310 return -ENOMEM;
3346
3347 key.objectid = BTRFS_ORPHAN_OBJECTID;
3348 key.type = BTRFS_ORPHAN_ITEM_KEY;
3349 key.offset = (u64)-1;
3350
3351 while (1) {
3352 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3353 if (ret < 0)

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

4303 */
4304 if (!btrfs_is_free_space_inode(inode) &&
4305 test_bit(BTRFS_ROOT_REF_COWS, &root->state))
4306 be_nice = 1;
4307
4308 path = btrfs_alloc_path();
4309 if (!path)
4310 return -ENOMEM;
4311 path->reada = -1;
4311 path->reada = READA_BACK;
4312
4313 /*
4314 * We want to drop from the next block forward in case this new size is
4315 * not block aligned since we will be keeping the last block of the
4316 * extent just the way it is.
4317 */
4318 if (test_bit(BTRFS_ROOT_REF_COWS, &root->state) ||
4319 root == root->fs_info->tree_root)

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

5739
5740 if (!dir_emit_dots(file, ctx))
5741 return 0;
5742
5743 path = btrfs_alloc_path();
5744 if (!path)
5745 return -ENOMEM;
5746
4312
4313 /*
4314 * We want to drop from the next block forward in case this new size is
4315 * not block aligned since we will be keeping the last block of the
4316 * extent just the way it is.
4317 */
4318 if (test_bit(BTRFS_ROOT_REF_COWS, &root->state) ||
4319 root == root->fs_info->tree_root)

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

5739
5740 if (!dir_emit_dots(file, ctx))
5741 return 0;
5742
5743 path = btrfs_alloc_path();
5744 if (!path)
5745 return -ENOMEM;
5746
5747 path->reada = 1;
5747 path->reada = READA_FORWARD;
5748
5749 if (key_type == BTRFS_DIR_INDEX_KEY) {
5750 INIT_LIST_HEAD(&ins_list);
5751 INIT_LIST_HEAD(&del_list);
5752 btrfs_get_delayed_items(inode, &ins_list, &del_list);
5753 }
5754
5755 key.type = key_type;

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

6770 if (!path) {
6771 err = -ENOMEM;
6772 goto out;
6773 }
6774 /*
6775 * Chances are we'll be called again, so go ahead and do
6776 * readahead
6777 */
5748
5749 if (key_type == BTRFS_DIR_INDEX_KEY) {
5750 INIT_LIST_HEAD(&ins_list);
5751 INIT_LIST_HEAD(&del_list);
5752 btrfs_get_delayed_items(inode, &ins_list, &del_list);
5753 }
5754
5755 key.type = key_type;

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

6770 if (!path) {
6771 err = -ENOMEM;
6772 goto out;
6773 }
6774 /*
6775 * Chances are we'll be called again, so go ahead and do
6776 * readahead
6777 */
6778 path->reada = 1;
6778 path->reada = READA_FORWARD;
6779 }
6780
6781 ret = btrfs_lookup_file_extent(trans, root, path,
6782 objectid, start, trans != NULL);
6783 if (ret < 0) {
6784 err = ret;
6785 goto out;
6786 }

--- 3323 unchanged lines hidden ---
6779 }
6780
6781 ret = btrfs_lookup_file_extent(trans, root, path,
6782 objectid, start, trans != NULL);
6783 if (ret < 0) {
6784 err = ret;
6785 goto out;
6786 }

--- 3323 unchanged lines hidden ---