Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc next for kdave #4

Closed
wants to merge 109 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
5404b5b
btrfs: replace get_seconds with new 64bit time API
Jun 12, 2018
5d71a10
btrfs: scrub: Remove unused copy_nocow_pages and its callchain
adam900710 Jun 6, 2018
25f8034
btrfs: Document __btrfs_inc_extent_ref
lorddoskias Jun 18, 2018
91b93bc
btrfs: Fix comment in lookup_inline_extent_backref
lorddoskias Jun 18, 2018
ef67e80
btrfs: always wait on ordered extents at fsync time
May 23, 2018
7c925d1
btrfs: remove the wait ordered logic in the log_one_extent path
May 23, 2018
43c9d3f
btrfs: clean up the left over logged_list usage
May 23, 2018
c885ef9
btrfs: remove the logged extents infrastructure
May 23, 2018
4b9cf1f
btrfs: Streamline log_extent_csums a bit
lorddoskias Jun 20, 2018
a2b8511
btrfs: Fix misleading indentation reported by smatch
KAGA-KOKO Jun 20, 2018
3413bac
btrfs: Annotate fall-through when parsing mount option
KAGA-KOKO Jun 20, 2018
4eed8ce
btrfs: Fix a C compliance issue
KAGA-KOKO Jun 20, 2018
5e313b9
btrfs: Remove fs_info from insert_tree_block_ref
lorddoskias Jun 20, 2018
88c53fd
btrfs: Remove fs_info from insert_extent_data_ref
lorddoskias Jun 20, 2018
ec77c23
btrfs: Remove fs_info argument from insert_extent_backref
lorddoskias Jun 20, 2018
112715b
btrfs: Remove fs_info from remove_extent_data_ref
lorddoskias Jun 20, 2018
5ee507b
btrfs: Remove fs_info from fixup_low_keys
lorddoskias Jun 20, 2018
9c509d8
btrfs: Remove fs_info from lookup_inline_extent_backref
lorddoskias Jun 20, 2018
9cfeb0c
btrfs: Remove fs_info argument from update_inline_extent_backref
lorddoskias Jun 20, 2018
6366672
btrfs: Remove fs_info argument from lookup_tree_block_ref
lorddoskias Jun 20, 2018
67408ba
btrfs: Remove fs_info argument from lookup_extent_data_ref
lorddoskias Jun 20, 2018
41e3447
btrfs: Remove fs_info from lookup_extent_backref
lorddoskias Jun 20, 2018
d85812c
btrfs: Remove fs_info from btrfs_add_delayed_tree_ref
lorddoskias Jun 20, 2018
d27f7b9
btrfs: Remove fs_info from btrfs_add_delayed_data_ref
lorddoskias Jun 20, 2018
577e7b8
btrfs: Remove fs_info from btrfs_make_block_group
lorddoskias Jun 20, 2018
baf24ba
btrfs: Remove fs_info from btrfs_remove_block_group
lorddoskias Jun 20, 2018
7b7eec0
btrfs: Remove fs_info from __btrfs_free_extent
lorddoskias Jun 20, 2018
34dffe3
btrfs: Remove fs_info from alloc_reserved_file_extent
lorddoskias Jun 20, 2018
cf50ae6
btrfs: Remove fs_info argument from __btrfs_inc_extent_ref
lorddoskias Jun 20, 2018
555169c
btrfs: Remove fs_info from run_delayed_data_ref
lorddoskias Jun 20, 2018
bbd43a1
btrfs: Remove fs_info from run_delayed_extent_op
lorddoskias Jun 20, 2018
2794f67
btrfs: Remove unused fs_info from cleanup_extent_op
lorddoskias Jun 20, 2018
8a4e770
btrfs: Remove fs_info from cleanup_ref_head
lorddoskias Jun 20, 2018
1a571b4
btrfs: Remove fs_info from run_delayed_tree_ref
lorddoskias Jun 20, 2018
9514f89
btrfs: Remove fs_info from do_chunk_alloc
lorddoskias Jun 20, 2018
f79b583
btrfs: Remove fs_info from btrfs_alloc_chunk
lorddoskias Jun 20, 2018
10979b6
btrfs: Remove fs_info from check_system_chunk
lorddoskias Jun 20, 2018
16c6c39
btrfs: Remove fs_info from free_excluded_extents
lorddoskias Jun 20, 2018
e7affd7
btrfs: Remove fs_info from exclude_super_stripes
lorddoskias Jun 20, 2018
9e2ce95
btrfs: Remove fs_info from insert_inline_extent_backref
lorddoskias Jun 20, 2018
1dd4131
btrfs: Remove fs_info from run_one_delayed_ref
lorddoskias Jun 20, 2018
e7ee66a
btrfs: Remove fs_info from remove_extent_backref
lorddoskias Jun 20, 2018
78d9919
btrfs: Remove fs_info from btrfs_alloc_logged_file_extent
lorddoskias Jun 20, 2018
fa54035
btrfs: Remove fs_info from btrfs_inc_block_group_ro
lorddoskias Jun 20, 2018
dee5037
btrfs: Remove fs_info from btrfs_force_chunk_alloc
lorddoskias Jun 20, 2018
4d62f5d
btrfs: check-integrity: Fix NULL pointer dereference for degraded mount
adam900710 Jun 20, 2018
89d7839
btrfs: Deduplicate extent_buffer init code
lorddoskias Jun 18, 2018
25c349e
btrfs: Get rid of the confusing btrfs_file_extent_inline_len
adam900710 Jun 6, 2018
dd031cc
btrfs: use monotonic time for transaction handling
arndb Jun 21, 2018
912c10a
btrfs: use timespec64 for i_otime
arndb Jun 21, 2018
443f183
btrfs: Refactor count handling in btrfs_unpin_free_ino()
geertu Jun 22, 2018
f82c594
btrfs: Don't remove block group still has pinned down bytes
adam900710 Jun 22, 2018
7d9869a
btrfs: Streamline memory allocation failure handling in btrfs_add_del…
lorddoskias Jun 20, 2018
727131d
btrfs: Add more details while checking tree block
Jun 22, 2018
aff91d0
btrfs: Use iocb to derive pos instead of passing a separate parameter
goldwynr Jun 17, 2018
6bc5404
btrfs: return EUCLEAN if extent_inline_ref type is invalid
Jun 22, 2018
6ca0cef
btrfs: return error instead of crash when detecting unexpected type i…
Jun 27, 2018
0b1221d
btrfs: replace empty string with NULL when getting attribute length i…
Jun 27, 2018
0d6d54e
btrfs: remove unnecessary -ERANGE check in btrfs_get_acl
Jun 27, 2018
815d52e
btrfs: avoid error code override in btrfs_get_acl
Jun 27, 2018
b0b6d38
btrfs: remove unnecessary bracket in btrfs_get_acl()
Jun 27, 2018
0ca0f6f
btrfs: Remove V0 extent support
lorddoskias Jun 21, 2018
8a565a9
btrfs: Add graceful handling of V0 extents
lorddoskias Jun 26, 2018
5bc1d37
btrfs: annotate unlikely branches after V0 extent type removal
kdave Jun 26, 2018
c7046e2
btrfs: tree-checker: Verify block_group_item
adam900710 Jul 3, 2018
6f71d12
btrfs: tree-checker: Detect invalid and empty essential trees
adam900710 Jul 3, 2018
0586455
btrfs: relocation: Only remove reloc rb_trees if reloc control has be…
adam900710 Jul 3, 2018
697f2b6
btrfs: declare fs_devices in btrfs_init_new_device()
asj Jul 3, 2018
d812f3c
btrfs: drop devices declare in btrfs_init_new_device()
asj Jul 3, 2018
efe471e
Btrfs: free space cache: make sure there is always room for generatio…
Jul 3, 2018
d144203
btrfs: simplify some assignments of inode numbers
kdave Jun 29, 2018
27dd30f
btrfs: simplify pointer chasing of local fs_info variables
kdave Jun 29, 2018
b6975bc
btrfs: use copy_page for copying pages instead of memcpy
kdave Jun 29, 2018
2f9c322
btrfs: prune unused includes
kdave Jun 29, 2018
b1ddf22
btrfs: pass only eb to num_extent_pages
kdave Jun 29, 2018
5e6f7bb
btrfs: use round_up wrapper in num_extent_pages
kdave Jul 4, 2018
8744150
btrfs: switch types to int when counting eb pages
kdave Mar 1, 2018
6d7db73
btrfs: open-code bio_set_op_attrs
kdave Jun 29, 2018
35134c1
btrfs: raid56: add new helper for starting async work
kdave Jun 29, 2018
7b1849c
btrfs: raid56: use new helper for async_rmw_stripe
kdave Jun 29, 2018
6ed8bb8
btrfs: raid56: use new helper for async_read_rebuild
kdave Jun 29, 2018
7c6025e
btrfs: raid56: use new helper for async_scrub_parity
kdave Jun 29, 2018
82a65e5
btrfs: raid56: merge rbio_is_full helpers
kdave Jun 29, 2018
fbb674b
btrfs: raid56: catch errors from full_stripe_write
kdave Jun 29, 2018
a88f312
btrfs: use correct compare function of dirty_metadata_bytes
Jul 2, 2018
9aa90f7
btrfs: Add type check when reading a chunk
Jul 4, 2018
1497331
btrfs: qgroups: Move transaction management inside btrfs_quota_enable…
lorddoskias Jul 5, 2018
4e89923
btrfs: fix parent in memory total_devices after seed delete
asj Jul 3, 2018
d3de40e
btrfs: fix missing superblock update in the device delete commit tran…
asj Jul 3, 2018
a20b69f
btrfs: remove unused parameter from btrfs_parse_subvol_options
Jul 9, 2018
fc21053
btrfs: Remove unused function btrfs_account_dev_extents_size()
adam900710 Jul 9, 2018
4da8563
btrfs: drop pending list in device close
lorddoskias Jun 29, 2018
7302fc0
btrfs: restore uuid_mutex in btrfs_open_devices
kdave Jun 20, 2018
622f0a7
btrfs: do btrfs_free_stale_devices() outside of device_list_add()
asj May 29, 2018
0dd1ff5
btrfs: fix device_list_add() missing device_list_mutex()
asj May 29, 2018
bdc6cc8
btrfs: btrfs_free_stale_devices() rename local variables
asj May 29, 2018
e735e86
btrfs: fix btrfs_free_stale_devices() with needed locks
asj May 29, 2018
39a2036
btrfs: lift uuid_mutex to callers of btrfs_scan_one_device
kdave Jun 20, 2018
8ffc96e
btrfs: lift uuid_mutex to callers of btrfs_open_devices
kdave Jun 20, 2018
2c5058c
btrfs: lift uuid_mutex to callers of btrfs_parse_early_options
kdave Jun 20, 2018
e9f25a7
btrfs: reorder initialization before the mount locks uuid_mutex
kdave Jun 20, 2018
6fa6985
btrfs: fix mount and ioctl device scan ioctl race
kdave Jun 20, 2018
0dfd681
btrfs: drop uuid_mutex in btrfs_free_extra_devids()
asj Apr 12, 2018
89325c8
btrfs: fix race between free_stale_devices and close_fs_devices
asj Jun 6, 2018
e2f7c8a
btrfs: do device clone using the btrfs_scan_one_device
asj Jul 9, 2018
17c285a
btrfs: use the assigned fs_devices instead of the dereference
asj Jul 9, 2018
dd61850
btrfs: warn for num_devices below 0
asj Jul 10, 2018
8c96747
btrfs: add helper btrfs_num_devices() to deduce num_devices
asj Jul 10, 2018
6049bd5
btrfs: add helper function check device delete able
asj Jul 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
name = XATTR_NAME_POSIX_ACL_DEFAULT;
break;
default:
BUG();
return ERR_PTR(-EINVAL);
}

size = btrfs_getxattr(inode, name, "", 0);
size = btrfs_getxattr(inode, name, NULL, 0);
if (size > 0) {
value = kzalloc(size, GFP_KERNEL);
if (!value)
return ERR_PTR(-ENOMEM);
size = btrfs_getxattr(inode, name, value, size);
}
if (size > 0) {
if (size > 0)
acl = posix_acl_from_xattr(&init_user_ns, value, size);
} else if (size == -ERANGE || size == -ENODATA || size == 0) {
else if (size == -ENODATA || size == 0)
acl = NULL;
} else {
acl = ERR_PTR(-EIO);
}
else
acl = ERR_PTR(size);
kfree(value);

return acl;
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ static int add_inline_refs(const struct btrfs_fs_info *fs_info,
type = btrfs_get_extent_inline_ref_type(leaf, iref,
BTRFS_REF_TYPE_ANY);
if (type == BTRFS_REF_TYPE_INVALID)
return -EINVAL;
return -EUCLEAN;

offset = btrfs_extent_inline_ref_offset(leaf, iref);

Expand Down Expand Up @@ -1793,7 +1793,7 @@ static int get_extent_inline_ref(unsigned long *ptr,
*out_type = btrfs_get_extent_inline_ref_type(eb, *out_eiref,
BTRFS_REF_TYPE_ANY);
if (*out_type == BTRFS_REF_TYPE_INVALID)
return -EINVAL;
return -EUCLEAN;

*ptr += btrfs_extent_inline_ref_size(*out_type);
WARN_ON(*ptr > end);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/btrfs_inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ struct btrfs_inode {
struct btrfs_delayed_node *delayed_node;

/* File creation time. */
struct timespec i_otime;
struct timespec64 i_otime;

/* Hook into fs_info->delayed_iputs */
struct list_head delayed_iput;
Expand Down
9 changes: 7 additions & 2 deletions fs/btrfs/check-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,12 @@ static int btrfsic_map_block(struct btrfsic_state *state, u64 bytenr, u32 len,
}

device = multi->stripes[0].dev;
block_ctx_out->dev = btrfsic_dev_state_lookup(device->bdev->bd_dev);
if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state) ||
!device->bdev || !device->name)
block_ctx_out->dev = NULL;
else
block_ctx_out->dev = btrfsic_dev_state_lookup(
device->bdev->bd_dev);
block_ctx_out->dev_bytenr = multi->stripes[0].physical;
block_ctx_out->start = bytenr;
block_ctx_out->len = len;
Expand Down Expand Up @@ -1624,7 +1629,7 @@ static int btrfsic_read_block(struct btrfsic_state *state,
bio = btrfs_io_bio_alloc(num_pages - i);
bio_set_dev(bio, block_ctx->dev->bdev);
bio->bi_iter.bi_sector = dev_bytenr >> 9;
bio_set_op_attrs(bio, REQ_OP_READ, 0);
bio->bi_opf = REQ_OP_READ;

for (j = i; j < num_pages; j++) {
ret = bio_add_page(bio, block_ctx->pagev[j],
Expand Down
8 changes: 2 additions & 6 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <linux/kernel.h>
#include <linux/bio.h>
#include <linux/buffer_head.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
Expand All @@ -14,10 +13,7 @@
#include <linux/init.h>
#include <linux/string.h>
#include <linux/backing-dev.h>
#include <linux/mpage.h>
#include <linux/swap.h>
#include <linux/writeback.h>
#include <linux/bit_spinlock.h>
#include <linux/slab.h>
#include <linux/sched/mm.h>
#include <linux/log2.h>
Expand Down Expand Up @@ -613,7 +609,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
cb->len = bio->bi_iter.bi_size;

comp_bio = btrfs_bio_alloc(bdev, cur_disk_byte);
bio_set_op_attrs (comp_bio, REQ_OP_READ, 0);
comp_bio->bi_opf = REQ_OP_READ;
comp_bio->bi_private = cb;
comp_bio->bi_end_io = end_compressed_bio_read;
refcount_set(&cb->pending_bios, 1);
Expand Down Expand Up @@ -660,7 +656,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
}

comp_bio = btrfs_bio_alloc(bdev, cur_disk_byte);
bio_set_op_attrs(comp_bio, REQ_OP_READ, 0);
comp_bio->bi_opf = REQ_OP_READ;
comp_bio->bi_private = cb;
comp_bio->bi_end_io = end_compressed_bio_read;

Expand Down
53 changes: 10 additions & 43 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,7 @@ int btrfs_block_can_be_shared(struct btrfs_root *root,
btrfs_root_last_snapshot(&root->root_item) ||
btrfs_header_flag(buf, BTRFS_HEADER_FLAG_RELOC)))
return 1;
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
if (test_bit(BTRFS_ROOT_REF_COWS, &root->state) &&
btrfs_header_backref_rev(buf) < BTRFS_MIXED_BACKREF_REV)
return 1;
#endif

return 0;
}

Expand Down Expand Up @@ -3128,8 +3124,7 @@ int btrfs_search_slot_for_read(struct btrfs_root *root,
* higher levels
*
*/
static void fixup_low_keys(struct btrfs_fs_info *fs_info,
struct btrfs_path *path,
static void fixup_low_keys(struct btrfs_path *path,
struct btrfs_disk_key *key, int level)
{
int i;
Expand Down Expand Up @@ -3181,7 +3176,7 @@ void btrfs_set_item_key_safe(struct btrfs_fs_info *fs_info,
btrfs_set_item_key(eb, &disk_key, slot);
btrfs_mark_buffer_dirty(eb);
if (slot == 0)
fixup_low_keys(fs_info, path, &disk_key, 1);
fixup_low_keys(path, &disk_key, 1);
}

/*
Expand Down Expand Up @@ -3359,17 +3354,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,

root_add_used(root, fs_info->nodesize);

memzero_extent_buffer(c, 0, sizeof(struct btrfs_header));
btrfs_set_header_nritems(c, 1);
btrfs_set_header_level(c, level);
btrfs_set_header_bytenr(c, c->start);
btrfs_set_header_generation(c, trans->transid);
btrfs_set_header_backref_rev(c, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(c, root->root_key.objectid);

write_extent_buffer_fsid(c, fs_info->fsid);
write_extent_buffer_chunk_tree_uuid(c, fs_info->chunk_tree_uuid);

btrfs_set_node_key(c, &lower_key, 0);
btrfs_set_node_blockptr(c, 0, lower->start);
lower_gen = btrfs_header_generation(lower);
Expand Down Expand Up @@ -3498,15 +3483,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
return PTR_ERR(split);

root_add_used(root, fs_info->nodesize);

memzero_extent_buffer(split, 0, sizeof(struct btrfs_header));
btrfs_set_header_level(split, btrfs_header_level(c));
btrfs_set_header_bytenr(split, split->start);
btrfs_set_header_generation(split, trans->transid);
btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(split, root->root_key.objectid);
write_extent_buffer_fsid(split, fs_info->fsid);
write_extent_buffer_chunk_tree_uuid(split, fs_info->chunk_tree_uuid);
ASSERT(btrfs_header_level(c) == level);

ret = tree_mod_log_eb_copy(fs_info, split, c, 0, mid, c_nritems - mid);
if (ret) {
Expand Down Expand Up @@ -3945,7 +3922,7 @@ static noinline int __push_leaf_left(struct btrfs_fs_info *fs_info,
clean_tree_block(fs_info, right);

btrfs_item_key(right, &disk_key, 0);
fixup_low_keys(fs_info, path, &disk_key, 1);
fixup_low_keys(path, &disk_key, 1);

/* then fixup the leaf pointer in the path */
if (path->slots[0] < push_items) {
Expand Down Expand Up @@ -4292,15 +4269,6 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,

root_add_used(root, fs_info->nodesize);

memzero_extent_buffer(right, 0, sizeof(struct btrfs_header));
btrfs_set_header_bytenr(right, right->start);
btrfs_set_header_generation(right, trans->transid);
btrfs_set_header_backref_rev(right, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(right, root->root_key.objectid);
btrfs_set_header_level(right, 0);
write_extent_buffer_fsid(right, fs_info->fsid);
write_extent_buffer_chunk_tree_uuid(right, fs_info->chunk_tree_uuid);

if (split == 0) {
if (mid <= slot) {
btrfs_set_header_nritems(right, 0);
Expand All @@ -4320,7 +4288,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
path->nodes[0] = right;
path->slots[0] = 0;
if (path->slots[1] == 0)
fixup_low_keys(fs_info, path, &disk_key, 1);
fixup_low_keys(path, &disk_key, 1);
}
/*
* We create a new leaf 'right' for the required ins_len and
Expand Down Expand Up @@ -4642,7 +4610,7 @@ void btrfs_truncate_item(struct btrfs_fs_info *fs_info,
btrfs_set_disk_key_offset(&disk_key, offset + size_diff);
btrfs_set_item_key(leaf, &disk_key, slot);
if (slot == 0)
fixup_low_keys(fs_info, path, &disk_key, 1);
fixup_low_keys(path, &disk_key, 1);
}

item = btrfs_item_nr(slot);
Expand Down Expand Up @@ -4744,7 +4712,7 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,

if (path->slots[0] == 0) {
btrfs_cpu_key_to_disk(&disk_key, cpu_key);
fixup_low_keys(fs_info, path, &disk_key, 1);
fixup_low_keys(path, &disk_key, 1);
}
btrfs_unlock_up_safe(path, 1);

Expand Down Expand Up @@ -4886,7 +4854,6 @@ int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root,
static void del_ptr(struct btrfs_root *root, struct btrfs_path *path,
int level, int slot)
{
struct btrfs_fs_info *fs_info = root->fs_info;
struct extent_buffer *parent = path->nodes[level];
u32 nritems;
int ret;
Expand Down Expand Up @@ -4919,7 +4886,7 @@ static void del_ptr(struct btrfs_root *root, struct btrfs_path *path,
struct btrfs_disk_key disk_key;

btrfs_node_key(parent, &disk_key, 0);
fixup_low_keys(fs_info, path, &disk_key, level + 1);
fixup_low_keys(path, &disk_key, level + 1);
}
btrfs_mark_buffer_dirty(parent);
}
Expand Down Expand Up @@ -5022,7 +4989,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct btrfs_disk_key disk_key;

btrfs_item_key(leaf, &disk_key, 0);
fixup_low_keys(fs_info, path, &disk_key, 1);
fixup_low_keys(path, &disk_key, 1);
}

/* delete the leaf if it is mostly empty */
Expand Down
56 changes: 15 additions & 41 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ struct btrfs_ordered_sum;

#define BTRFS_OLDEST_GENERATION 0ULL

#define BTRFS_COMPAT_EXTENT_TREE_V0

/*
* the max metadata block size. This limit is somewhat artificial,
* but the memmove costs go through the roof for larger blocks.
Expand Down Expand Up @@ -342,8 +340,8 @@ struct btrfs_path {
sizeof(struct btrfs_item))
struct btrfs_dev_replace {
u64 replace_state; /* see #define above */
u64 time_started; /* seconds since 1-Jan-1970 */
u64 time_stopped; /* seconds since 1-Jan-1970 */
time64_t time_started; /* seconds since 1-Jan-1970 */
time64_t time_stopped; /* seconds since 1-Jan-1970 */
atomic64_t num_write_errors;
atomic64_t num_uncorrectable_read_errors;

Expand Down Expand Up @@ -2428,32 +2426,6 @@ static inline u32 btrfs_file_extent_inline_item_len(
return btrfs_item_size(eb, e) - BTRFS_FILE_EXTENT_INLINE_DATA_START;
}

/* this returns the number of file bytes represented by the inline item.
* If an item is compressed, this is the uncompressed size
*/
static inline u32 btrfs_file_extent_inline_len(const struct extent_buffer *eb,
int slot,
const struct btrfs_file_extent_item *fi)
{
struct btrfs_map_token token;

btrfs_init_map_token(&token);
/*
* return the space used on disk if this item isn't
* compressed or encoded
*/
if (btrfs_token_file_extent_compression(eb, fi, &token) == 0 &&
btrfs_token_file_extent_encryption(eb, fi, &token) == 0 &&
btrfs_token_file_extent_other_encoding(eb, fi, &token) == 0) {
return btrfs_file_extent_inline_item_len(eb,
btrfs_item_nr(slot));
}

/* otherwise use the ram bytes field */
return btrfs_token_file_extent_ram_bytes(eb, fi, &token);
}


/* btrfs_dev_stats_item */
static inline u64 btrfs_dev_stats_value(const struct extent_buffer *eb,
const struct btrfs_dev_stats_item *ptr,
Expand Down Expand Up @@ -2676,7 +2648,6 @@ int btrfs_alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
u64 offset, u64 ram_bytes,
struct btrfs_key *ins);
int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info,
u64 root_objectid, u64 owner, u64 offset,
struct btrfs_key *ins);
int btrfs_reserve_extent(struct btrfs_root *root, u64 ram_bytes, u64 num_bytes,
Expand Down Expand Up @@ -2716,15 +2687,14 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info);
int btrfs_read_block_groups(struct btrfs_fs_info *info);
int btrfs_can_relocate(struct btrfs_fs_info *fs_info, u64 bytenr);
int btrfs_make_block_group(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 bytes_used,
u64 type, u64 chunk_offset, u64 size);
u64 bytes_used, u64 type, u64 chunk_offset,
u64 size);
void btrfs_add_raid_kobjects(struct btrfs_fs_info *fs_info);
struct btrfs_trans_handle *btrfs_start_trans_remove_block_group(
struct btrfs_fs_info *fs_info,
const u64 chunk_offset);
int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 group_start,
struct extent_map *em);
u64 group_start, struct extent_map *em);
void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info);
void btrfs_get_block_group_trimming(struct btrfs_block_group_cache *cache);
void btrfs_put_block_group_trimming(struct btrfs_block_group_cache *cache);
Expand Down Expand Up @@ -2803,17 +2773,15 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
struct btrfs_block_rsv *block_rsv,
u64 num_bytes);
int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache *cache);
int btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache);
void btrfs_dec_block_group_ro(struct btrfs_block_group_cache *cache);
void btrfs_put_block_group_cache(struct btrfs_fs_info *info);
u64 btrfs_account_ro_block_groups_free_space(struct btrfs_space_info *sinfo);
int btrfs_error_unpin_extent_range(struct btrfs_fs_info *fs_info,
u64 start, u64 end);
int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr,
u64 num_bytes, u64 *actual_bytes);
int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 type);
int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type);
int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range);

int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
Expand All @@ -2822,8 +2790,7 @@ int btrfs_delayed_refs_qgroup_accounting(struct btrfs_trans_handle *trans,
int btrfs_start_write_no_snapshotting(struct btrfs_root *root);
void btrfs_end_write_no_snapshotting(struct btrfs_root *root);
void btrfs_wait_for_snapshot_creation(struct btrfs_root *root);
void check_system_chunk(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, const u64 type);
void check_system_chunk(struct btrfs_trans_handle *trans, const u64 type);
u64 add_new_free_space(struct btrfs_block_group_cache *block_group,
u64 start, u64 end);

Expand Down Expand Up @@ -3465,6 +3432,13 @@ static inline void assfail(char *expr, char *file, int line)
#define ASSERT(expr) ((void)0)
#endif

__cold
static inline void btrfs_print_v0_err(struct btrfs_fs_info *fs_info)
{
btrfs_err(fs_info,
"Unsupported V0 extent filesystem detected. Aborting. Please re-create your filesystem with a newer kernel");
}

__printf(5, 6)
__cold
void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function,
Expand Down
Loading