Skip to content

Commit

Permalink
Merge branch 'misc-for-4.5' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/kdave/linux into for-linus-4.5
  • Loading branch information
Chris Mason committed Jan 11, 2016
2 parents 511711a + ee592d0 commit a305810
Show file tree
Hide file tree
Showing 22 changed files with 186 additions and 144 deletions.
4 changes: 4 additions & 0 deletions fs/btrfs/btrfs_inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ struct btrfs_inode {
/* File creation time. */
struct timespec i_otime;

/* Hook into fs_info->delayed_iputs */
struct list_head delayed_iput;
long delayed_iput_count;

struct inode vfs_inode;
};

Expand Down
9 changes: 4 additions & 5 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,6 @@ static void reada_for_search(struct btrfs_root *root,
u64 target;
u64 nread = 0;
u64 gen;
int direction = path->reada;
struct extent_buffer *eb;
u32 nr;
u32 blocksize;
Expand Down Expand Up @@ -2276,16 +2275,16 @@ static void reada_for_search(struct btrfs_root *root,
nr = slot;

while (1) {
if (direction < 0) {
if (path->reada == READA_BACK) {
if (nr == 0)
break;
nr--;
} else if (direction > 0) {
} else if (path->reada == READA_FORWARD) {
nr++;
if (nr >= nritems)
break;
}
if (path->reada < 0 && objectid) {
if (path->reada == READA_BACK && objectid) {
btrfs_node_key(node, &disk_key, nr);
if (btrfs_disk_key_objectid(&disk_key) != objectid)
break;
Expand Down Expand Up @@ -2493,7 +2492,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
btrfs_set_path_blocking(p);

free_extent_buffer(tmp);
if (p->reada)
if (p->reada != READA_NONE)
reada_for_search(root, p, level, slot, key->objectid);

btrfs_release_path(p);
Expand Down
9 changes: 5 additions & 4 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct btrfs_ordered_sum;
/* csum types */
#define BTRFS_CSUM_TYPE_CRC32 0

static int btrfs_csum_sizes[] = { 4 };
static const int btrfs_csum_sizes[] = { 4 };

/* four bytes for CRC32 */
#define BTRFS_EMPTY_DIR_SIZE 0
Expand Down Expand Up @@ -598,14 +598,15 @@ struct btrfs_node {
* The slots array records the index of the item or block pointer
* used while walking the tree.
*/
enum { READA_NONE = 0, READA_BACK, READA_FORWARD };
struct btrfs_path {
struct extent_buffer *nodes[BTRFS_MAX_LEVEL];
int slots[BTRFS_MAX_LEVEL];
/* if there is real range locking, this locks field will change */
int locks[BTRFS_MAX_LEVEL];
int reada;
u8 locks[BTRFS_MAX_LEVEL];
u8 reada;
/* keep some upper locks as we walk down */
int lowest_level;
u8 lowest_level;

/*
* set by btrfs_split_item, tells search_slot to keep all locks
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/delayed-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,12 @@ update_existing_head_ref(struct btrfs_delayed_ref_root *delayed_refs,
memcpy(&existing_ref->extent_op->key,
&ref->extent_op->key,
sizeof(ref->extent_op->key));
existing_ref->extent_op->update_key = 1;
existing_ref->extent_op->update_key = true;
}
if (ref->extent_op->update_flags) {
existing_ref->extent_op->flags_to_set |=
ref->extent_op->flags_to_set;
existing_ref->extent_op->update_flags = 1;
existing_ref->extent_op->update_flags = true;
}
btrfs_free_delayed_extent_op(ref->extent_op);
}
Expand Down
8 changes: 4 additions & 4 deletions fs/btrfs/delayed-ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ struct btrfs_delayed_ref_node {

struct btrfs_delayed_extent_op {
struct btrfs_disk_key key;
u8 level;
bool update_key;
bool update_flags;
bool is_data;
u64 flags_to_set;
int level;
unsigned int update_key:1;
unsigned int update_flags:1;
unsigned int is_data:1;
};

/*
Expand Down
1 change: 1 addition & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2682,6 +2682,7 @@ int open_ctree(struct super_block *sb,
if (btrfs_check_super_csum(bh->b_data)) {
printk(KERN_ERR "BTRFS: superblock checksum mismatch\n");
err = -EINVAL;
brelse(bh);
goto fail_alloc;
}

Expand Down
27 changes: 12 additions & 15 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
*/
path->skip_locking = 1;
path->search_commit_root = 1;
path->reada = 1;
path->reada = READA_FORWARD;

key.objectid = last;
key.offset = 0;
Expand Down Expand Up @@ -2131,7 +2131,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
if (!path)
return -ENOMEM;

path->reada = 1;
path->reada = READA_FORWARD;
path->leave_spinning = 1;
/* this will setup the path even if it fails to insert the back ref */
ret = insert_inline_extent_backref(trans, fs_info->extent_root, path,
Expand All @@ -2157,7 +2157,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(path);

path->reada = 1;
path->reada = READA_FORWARD;
path->leave_spinning = 1;
/* now insert the actual backref */
ret = insert_extent_backref(trans, root->fs_info->extent_root,
Expand Down Expand Up @@ -2270,7 +2270,7 @@ static int run_delayed_extent_op(struct btrfs_trans_handle *trans,
}

again:
path->reada = 1;
path->reada = READA_FORWARD;
path->leave_spinning = 1;
ret = btrfs_search_slot(trans, root->fs_info->extent_root, &key,
path, 0, 1);
Expand Down Expand Up @@ -3007,9 +3007,9 @@ int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans,
return -ENOMEM;

extent_op->flags_to_set = flags;
extent_op->update_flags = 1;
extent_op->update_key = 0;
extent_op->is_data = is_data ? 1 : 0;
extent_op->update_flags = true;
extent_op->update_key = false;
extent_op->is_data = is_data ? true : false;
extent_op->level = level;

ret = btrfs_add_delayed_extent_op(root->fs_info, trans, bytenr,
Expand Down Expand Up @@ -6472,7 +6472,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
if (!path)
return -ENOMEM;

path->reada = 1;
path->reada = READA_FORWARD;
path->leave_spinning = 1;

is_data = owner_objectid >= BTRFS_FIRST_FREE_OBJECTID;
Expand Down Expand Up @@ -8031,12 +8031,9 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
else
memset(&extent_op->key, 0, sizeof(extent_op->key));
extent_op->flags_to_set = flags;
if (skinny_metadata)
extent_op->update_key = 0;
else
extent_op->update_key = 1;
extent_op->update_flags = 1;
extent_op->is_data = 0;
extent_op->update_key = skinny_metadata ? false : true;
extent_op->update_flags = true;
extent_op->is_data = false;
extent_op->level = level;

ret = btrfs_add_delayed_tree_ref(root->fs_info, trans,
Expand Down Expand Up @@ -9745,7 +9742,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = 1;
path->reada = READA_FORWARD;

cache_gen = btrfs_super_cache_generation(root->fs_info->super_copy);
if (btrfs_test_opt(root, SPACE_CACHE) &&
Expand Down
Empty file removed fs/btrfs/extent-tree.h
Empty file.
4 changes: 2 additions & 2 deletions fs/btrfs/file-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
}

if (bio->bi_iter.bi_size > PAGE_CACHE_SIZE * 8)
path->reada = 2;
path->reada = READA_FORWARD;

WARN_ON(bio->bi_vcnt <= 0);

Expand Down Expand Up @@ -328,7 +328,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,

if (search_commit) {
path->skip_locking = 1;
path->reada = 2;
path->reada = READA_FORWARD;
path->search_commit_root = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
return true;
}

static struct btrfs_free_space_op free_space_op = {
static const struct btrfs_free_space_op free_space_op = {
.recalc_thresholds = recalculate_thresholds,
.use_bitmap = use_bitmap,
};
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/free-space-cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct btrfs_free_space_ctl {
int total_bitmaps;
int unit;
u64 start;
struct btrfs_free_space_op *op;
const struct btrfs_free_space_op *op;
void *private;
struct mutex cache_writeout_mutex;
struct list_head trimming_ranges;
Expand Down
6 changes: 3 additions & 3 deletions fs/btrfs/inode-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int caching_kthread(void *data)
/* Since the commit root is read-only, we can safely skip locking. */
path->skip_locking = 1;
path->search_commit_root = 1;
path->reada = 2;
path->reada = READA_FORWARD;

key.objectid = BTRFS_FIRST_FREE_OBJECTID;
key.offset = 0;
Expand Down Expand Up @@ -334,7 +334,7 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
return true;
}

static struct btrfs_free_space_op free_ino_op = {
static const struct btrfs_free_space_op free_ino_op = {
.recalc_thresholds = recalculate_thresholds,
.use_bitmap = use_bitmap,
};
Expand All @@ -356,7 +356,7 @@ static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl,
return false;
}

static struct btrfs_free_space_op pinned_free_ino_op = {
static const struct btrfs_free_space_op pinned_free_ino_op = {
.recalc_thresholds = pinned_recalc_thresholds,
.use_bitmap = pinned_use_bitmap,
};
Expand Down
Loading

0 comments on commit a305810

Please sign in to comment.