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 17jul #5

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9dc16aa
btrfs: tree-checker: Verify block_group_item
adam900710 Jul 3, 2018
bdc601c
btrfs: tree-checker: Detect invalid and empty essential trees
adam900710 Jul 3, 2018
3b35633
btrfs: relocation: Only remove reloc rb_trees if reloc control has be…
adam900710 Jul 3, 2018
78ae759
btrfs: declare fs_devices in btrfs_init_new_device()
asj Jul 3, 2018
6dcad0e
btrfs: drop devices declare in btrfs_init_new_device()
asj Jul 3, 2018
305e0b1
Btrfs: free space cache: make sure there is always room for generatio…
Jul 3, 2018
2465566
btrfs: simplify some assignments of inode numbers
kdave Jun 29, 2018
7480f14
btrfs: simplify pointer chasing of local fs_info variables
kdave Jun 29, 2018
fd59c5d
btrfs: use copy_page for copying pages instead of memcpy
kdave Jun 29, 2018
47fb155
btrfs: prune unused includes
kdave Jun 29, 2018
d396872
btrfs: pass only eb to num_extent_pages
kdave Jun 29, 2018
1e4b371
btrfs: use round_up wrapper in num_extent_pages
kdave Jul 4, 2018
a459821
btrfs: switch types to int when counting eb pages
kdave Mar 1, 2018
774e795
btrfs: open-code bio_set_op_attrs
kdave Jun 29, 2018
6035315
btrfs: raid56: add new helper for starting async work
kdave Jun 29, 2018
c483a65
btrfs: raid56: use new helper for async_rmw_stripe
kdave Jun 29, 2018
af3daae
btrfs: raid56: use new helper for async_read_rebuild
kdave Jun 29, 2018
7a43b08
btrfs: raid56: use new helper for async_scrub_parity
kdave Jun 29, 2018
21d11a2
btrfs: raid56: merge rbio_is_full helpers
kdave Jun 29, 2018
2e4da23
btrfs: raid56: catch errors from full_stripe_write
kdave Jun 29, 2018
72e75ed
btrfs: Add type check when reading a chunk
Jul 4, 2018
c9a6fe8
btrfs: qgroups: Move transaction management inside btrfs_quota_enable…
lorddoskias Jul 5, 2018
52723b0
btrfs: fix parent in memory total_devices after seed delete
asj Jul 3, 2018
d7fcbea
btrfs: fix missing superblock update in the device delete commit tran…
asj Jul 3, 2018
74e1cce
btrfs: remove unused parameter from btrfs_parse_subvol_options
Jul 9, 2018
1a484d0
btrfs: Remove unused function btrfs_account_dev_extents_size
adam900710 Jul 9, 2018
e3dcf1f
btrfs: close devices without offloading to a temporary list
lorddoskias Jun 29, 2018
c1d93bd
btrfs: restore uuid_mutex in btrfs_open_devices
kdave Jun 20, 2018
9679668
btrfs: do btrfs_free_stale_devices outside of device_list_add
asj May 29, 2018
7d3156f
btrfs: extend locked section when adding a new device in device_list_add
asj May 29, 2018
64a6ce4
btrfs: rename local devices for fs_devices in btrfs_free_stale_devices(
asj May 29, 2018
02c54e8
btrfs: use device_list_mutex when removing stale devices
asj May 29, 2018
bdf1a2a
btrfs: lift uuid_mutex to callers of btrfs_scan_one_device
kdave Jun 19, 2018
41575dc
btrfs: lift uuid_mutex to callers of btrfs_open_devices
kdave Jun 19, 2018
bd1fb92
btrfs: lift uuid_mutex to callers of btrfs_parse_early_options
kdave Jun 19, 2018
78742d6
btrfs: reorder initialization before the mount locks uuid_mutex
kdave Jun 19, 2018
32f792c
btrfs: fix mount and ioctl device scan ioctl race
kdave Jun 19, 2018
2b2e150
btrfs: make fs_devices a local variable
Jul 12, 2018
99d5e73
btrfs: return device pointer from btrfs_scan_one_device
Jul 12, 2018
36122f9
btrfs: use correct compare function of dirty_metadata_bytes
Jul 2, 2018
c5e9e54
btrfs: use customized batch size for total_bytes_pinned
Jul 13, 2018
570de0c
btrfs: Rewrite retry logic in do_chunk_alloc
lorddoskias Apr 18, 2018
a6c1dfd
btrfs: Use btrfs_mark_bg_unused to replace open code
adam900710 May 22, 2018
7a7e4f1
btrfs: drop uuid_mutex in btrfs_free_extra_devids()
asj Apr 12, 2018
2672975
btrfs: fix race between free_stale_devices and close_fs_devices
asj Jun 6, 2018
96b288f
btrfs: do device clone using the btrfs_scan_one_device
asj Jul 9, 2018
8914d00
btrfs: use the assigned fs_devices instead of the dereference
asj Jul 9, 2018
83b113d
btrfs: warn for num_devices below 0
asj Jul 10, 2018
8683add
btrfs: add helper btrfs_num_devices() to deduce num_devices
asj Jul 10, 2018
e140466
btrfs: add helper function check device delete able
asj Jul 10, 2018
f55e9b8
btrfs: rename btrfs_parse_early_options
asj Jul 16, 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
2 changes: 1 addition & 1 deletion fs/btrfs/check-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,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
9 changes: 9 additions & 0 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ static const int btrfs_csum_sizes[] = { 4 };

#define BTRFS_DIRTY_METADATA_THRESH SZ_32M

/*
* Use large batch size to reduce overhead of metadata updates. On the reader
* side, we only read it when we are close to ENOSPC and the read overhead is
* mostly related to the number of CPUs, so it is OK to use arbitrary large
* value here.
*/
#define BTRFS_TOTAL_BYTES_PINNED_BATCH SZ_128M

#define BTRFS_MAX_EXTENT_SIZE SZ_128M


Expand Down Expand Up @@ -2793,6 +2801,7 @@ void btrfs_wait_for_snapshot_creation(struct btrfs_root *root);
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);
void btrfs_mark_bg_unused(struct btrfs_block_group_cache *bg);

/* ctree.c */
int btrfs_bin_search(struct extent_buffer *eb, const struct btrfs_key *key,
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/delayed-inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans,

int btrfs_commit_inode_delayed_inode(struct btrfs_inode *inode)
{
struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct btrfs_trans_handle *trans;
struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(inode);
struct btrfs_path *path;
Expand Down Expand Up @@ -1837,7 +1837,7 @@ int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans,

int btrfs_delayed_delete_inode_ref(struct btrfs_inode *inode)
{
struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct btrfs_delayed_node *delayed_node;

/*
Expand Down
5 changes: 0 additions & 5 deletions fs/btrfs/dev-replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@
#include <linux/sched.h>
#include <linux/bio.h>
#include <linux/slab.h>
#include <linux/buffer_head.h>
#include <linux/blkdev.h>
#include <linux/random.h>
#include <linux/iocontext.h>
#include <linux/capability.h>
#include <linux/kthread.h>
#include <linux/math64.h>
#include <asm/div64.h>
#include "ctree.h"
#include "extent_map.h"
#include "disk-io.h"
Expand Down
14 changes: 7 additions & 7 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/scatterlist.h>
#include <linux/swap.h>
#include <linux/radix-tree.h>
#include <linux/writeback.h>
#include <linux/buffer_head.h>
Expand Down Expand Up @@ -212,7 +210,7 @@ struct extent_map *btree_get_extent(struct btrfs_inode *inode,
struct page *page, size_t pg_offset, u64 start, u64 len,
int create)
{
struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct extent_map_tree *em_tree = &inode->extent_tree;
struct extent_map *em;
int ret;
Expand Down Expand Up @@ -961,8 +959,9 @@ static int btree_writepages(struct address_space *mapping,

fs_info = BTRFS_I(mapping->host)->root->fs_info;
/* this is a bit racy, but that's ok */
ret = percpu_counter_compare(&fs_info->dirty_metadata_bytes,
BTRFS_DIRTY_METADATA_THRESH);
ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes,
BTRFS_DIRTY_METADATA_THRESH,
fs_info->dirty_metadata_batch);
if (ret < 0)
return 0;
}
Expand Down Expand Up @@ -4136,8 +4135,9 @@ static void __btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info,
if (flush_delayed)
btrfs_balance_delayed_items(fs_info);

ret = percpu_counter_compare(&fs_info->dirty_metadata_bytes,
BTRFS_DIRTY_METADATA_THRESH);
ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes,
BTRFS_DIRTY_METADATA_THRESH,
fs_info->dirty_metadata_batch);
if (ret > 0) {
balance_dirty_pages_ratelimited(fs_info->btree_inode->i_mapping);
}
Expand Down
Loading