Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6c0cb37 authored by Chris Mason's avatar Chris Mason
Browse files

Merge branch 'cleanups_and_fixes' into inode_numbers



Conflicts:
	fs/btrfs/tree-log.c
	fs/btrfs/volumes.c

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parents 8e531cdf 1f78160c
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -3211,7 +3211,6 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
			struct btrfs_path *path,
			u32 new_size, int from_end)
{
	int ret = 0;
	int slot;
	struct extent_buffer *leaf;
	struct btrfs_item *item;
@@ -3309,12 +3308,11 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
	btrfs_set_item_size(leaf, item, new_size);
	btrfs_mark_buffer_dirty(leaf);

	ret = 0;
	if (btrfs_leaf_free_space(root, leaf) < 0) {
		btrfs_print_leaf(root, leaf);
		BUG();
	}
	return ret;
	return 0;
}

/*
@@ -3324,7 +3322,6 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
		      struct btrfs_root *root, struct btrfs_path *path,
		      u32 data_size)
{
	int ret = 0;
	int slot;
	struct extent_buffer *leaf;
	struct btrfs_item *item;
@@ -3389,12 +3386,11 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
	btrfs_set_item_size(leaf, item, old_size + data_size);
	btrfs_mark_buffer_dirty(leaf);

	ret = 0;
	if (btrfs_leaf_free_space(root, leaf) < 0) {
		btrfs_print_leaf(root, leaf);
		BUG();
	}
	return ret;
	return 0;
}

/*
+0 −3
Original line number Diff line number Diff line
@@ -1113,9 +1113,6 @@ struct btrfs_fs_info {
struct btrfs_root {
	struct extent_buffer *node;

	/* the node lock is held while changing the node pointer */
	spinlock_t node_lock;

	struct extent_buffer *commit_root;
	struct btrfs_root *log_root;
	struct btrfs_root *reloc_root;
+1 −2
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ static struct btrfs_dir_item *insert_with_overflow(struct btrfs_trans_handle
		if (di)
			return ERR_PTR(-EEXIST);
		ret = btrfs_extend_item(trans, root, path, data_size);
		WARN_ON(ret > 0);
	}
	if (ret < 0)
		return ERR_PTR(ret);
@@ -438,7 +437,7 @@ int verify_dir_item(struct btrfs_root *root,
		namelen = XATTR_NAME_MAX;

	if (btrfs_dir_name_len(leaf, dir_item) > namelen) {
		printk(KERN_CRIT "btrfS: invalid dir item name len: %u\n",
		printk(KERN_CRIT "btrfs: invalid dir item name len: %u\n",
		       (unsigned)btrfs_dir_data_len(leaf, dir_item));
		return 1;
	}
+7 −6
Original line number Diff line number Diff line
@@ -1053,7 +1053,6 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
	INIT_LIST_HEAD(&root->dirty_list);
	INIT_LIST_HEAD(&root->orphan_list);
	INIT_LIST_HEAD(&root->root_list);
	spin_lock_init(&root->node_lock);
	spin_lock_init(&root->orphan_lock);
	spin_lock_init(&root->inode_lock);
	spin_lock_init(&root->accounting_lock);
@@ -1363,7 +1362,8 @@ static int btrfs_congested_fn(void *congested_data, int bdi_bits)
	struct btrfs_device *device;
	struct backing_dev_info *bdi;

	list_for_each_entry(device, &info->fs_devices->devices, dev_list) {
	rcu_read_lock();
	list_for_each_entry_rcu(device, &info->fs_devices->devices, dev_list) {
		if (!device->bdev)
			continue;
		bdi = blk_get_backing_dev_info(device->bdev);
@@ -1372,6 +1372,7 @@ static int btrfs_congested_fn(void *congested_data, int bdi_bits)
			break;
		}
	}
	rcu_read_unlock();
	return ret;
}

@@ -2305,9 +2306,9 @@ int write_all_supers(struct btrfs_root *root, int max_mirrors)
	sb = &root->fs_info->super_for_commit;
	dev_item = &sb->dev_item;

	mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
	rcu_read_lock();
	head = &root->fs_info->fs_devices->devices;
	list_for_each_entry(dev, head, dev_list) {
	list_for_each_entry_rcu(dev, head, dev_list) {
		if (!dev->bdev) {
			total_errors++;
			continue;
@@ -2340,7 +2341,7 @@ int write_all_supers(struct btrfs_root *root, int max_mirrors)
	}

	total_errors = 0;
	list_for_each_entry(dev, head, dev_list) {
	list_for_each_entry_rcu(dev, head, dev_list) {
		if (!dev->bdev)
			continue;
		if (!dev->in_fs_metadata || !dev->writeable)
@@ -2350,7 +2351,7 @@ int write_all_supers(struct btrfs_root *root, int max_mirrors)
		if (ret)
			total_errors++;
	}
	mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
	rcu_read_unlock();
	if (total_errors > max_errors) {
		printk(KERN_ERR "btrfs: %d errors while writing supers\n",
		       total_errors);
+4 −3
Original line number Diff line number Diff line
@@ -952,7 +952,6 @@ static int convert_extent_item_v0(struct btrfs_trans_handle *trans,
	BUG_ON(ret);

	ret = btrfs_extend_item(trans, root, path, new_size);
	BUG_ON(ret);

	leaf = path->nodes[0];
	item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
@@ -1560,7 +1559,6 @@ int setup_inline_extent_backref(struct btrfs_trans_handle *trans,
	size = btrfs_extent_inline_ref_size(type);

	ret = btrfs_extend_item(trans, root, path, size);
	BUG_ON(ret);

	ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
	refs = btrfs_extent_refs(leaf, ei);
@@ -1689,7 +1687,6 @@ int update_inline_extent_backref(struct btrfs_trans_handle *trans,
					      end - ptr - size);
		item_size -= size;
		ret = btrfs_truncate_item(trans, root, path, item_size, 1);
		BUG_ON(ret);
	}
	btrfs_mark_buffer_dirty(leaf);
	return 0;
@@ -3307,6 +3304,10 @@ static int shrink_delalloc(struct btrfs_trans_handle *trans,
	if (reserved == 0)
		return 0;

	/* nothing to shrink - nothing to reclaim */
	if (root->fs_info->delalloc_bytes == 0)
		return 0;

	max_reclaim = min(reserved, to_reclaim);

	while (loops < 1024) {
Loading