Commit f85b7379 authored by David Sterba's avatar David Sterba

btrfs: fix over-80 lines introduced by previous cleanups

This goes as a separate patch because fixing that inside the patches
caused too many many conflicts.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f329e319
...@@ -72,7 +72,8 @@ static inline int btrfs_is_continuous_delayed_item( ...@@ -72,7 +72,8 @@ static inline int btrfs_is_continuous_delayed_item(
return 0; return 0;
} }
static struct btrfs_delayed_node *btrfs_get_delayed_node(struct btrfs_inode *btrfs_inode) static struct btrfs_delayed_node *btrfs_get_delayed_node(
struct btrfs_inode *btrfs_inode)
{ {
struct btrfs_root *root = btrfs_inode->root; struct btrfs_root *root = btrfs_inode->root;
u64 ino = btrfs_ino(btrfs_inode); u64 ino = btrfs_ino(btrfs_inode);
......
...@@ -174,8 +174,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root ...@@ -174,8 +174,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_release_path(path); btrfs_release_path(path);
ret2 = btrfs_insert_delayed_dir_index(trans, root->fs_info, name, ret2 = btrfs_insert_delayed_dir_index(trans, root->fs_info, name,
name_len, BTRFS_I(dir), &disk_key, type, name_len, BTRFS_I(dir), &disk_key, type, index);
index);
out_free: out_free:
btrfs_free_path(path); btrfs_free_path(path);
if (ret) if (ret)
......
...@@ -4413,8 +4413,8 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -4413,8 +4413,8 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
* lookup the last file extent. We're not using i_size here * lookup the last file extent. We're not using i_size here
* because there might be preallocation past i_size * because there might be preallocation past i_size
*/ */
ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(BTRFS_I(inode)), -1, ret = btrfs_lookup_file_extent(NULL, root, path,
0); btrfs_ino(BTRFS_I(inode)), -1, 0);
if (ret < 0) { if (ret < 0) {
btrfs_free_path(path); btrfs_free_path(path);
return ret; return ret;
......
...@@ -2285,9 +2285,8 @@ static int fill_holes(struct btrfs_trans_handle *trans, struct inode *inode, ...@@ -2285,9 +2285,8 @@ static int fill_holes(struct btrfs_trans_handle *trans, struct inode *inode,
} }
btrfs_release_path(path); btrfs_release_path(path);
ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), offset, ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)),
0, 0, end - offset, 0, end - offset, offset, 0, 0, end - offset, 0, end - offset, 0, 0, 0);
0, 0, 0);
if (ret) if (ret)
return ret; return ret;
......
...@@ -2182,8 +2182,7 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans, ...@@ -2182,8 +2182,7 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
ins.offset = disk_num_bytes; ins.offset = disk_num_bytes;
ins.type = BTRFS_EXTENT_ITEM_KEY; ins.type = BTRFS_EXTENT_ITEM_KEY;
ret = btrfs_alloc_reserved_file_extent(trans, root->root_key.objectid, ret = btrfs_alloc_reserved_file_extent(trans, root->root_key.objectid,
btrfs_ino(BTRFS_I(inode)), file_pos, btrfs_ino(BTRFS_I(inode)), file_pos, ram_bytes, &ins);
ram_bytes, &ins);
/* /*
* Release the reserved range from inode dirty range map, as it is * Release the reserved range from inode dirty range map, as it is
* already moved into delayed_ref_head * already moved into delayed_ref_head
...@@ -3314,7 +3313,8 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) ...@@ -3314,7 +3313,8 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)
/* insert an orphan item to track this unlinked/truncated file */ /* insert an orphan item to track this unlinked/truncated file */
if (insert >= 1) { if (insert >= 1) {
ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(BTRFS_I(inode))); ret = btrfs_insert_orphan_item(trans, root,
btrfs_ino(BTRFS_I(inode)));
if (ret) { if (ret) {
atomic_dec(&root->orphan_inodes); atomic_dec(&root->orphan_inodes);
if (reserve) { if (reserve) {
...@@ -4863,8 +4863,8 @@ static int maybe_insert_hole(struct btrfs_root *root, struct inode *inode, ...@@ -4863,8 +4863,8 @@ static int maybe_insert_hole(struct btrfs_root *root, struct inode *inode,
return ret; return ret;
} }
ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), offset, ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)),
0, 0, len, 0, len, 0, 0, 0); offset, 0, 0, len, 0, len, 0, 0, 0);
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
else else
...@@ -5422,8 +5422,8 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry, ...@@ -5422,8 +5422,8 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry,
if (!path) if (!path)
return -ENOMEM; return -ENOMEM;
di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), name, di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)),
namelen, 0); name, namelen, 0);
if (IS_ERR(di)) if (IS_ERR(di))
ret = PTR_ERR(di); ret = PTR_ERR(di);
...@@ -7295,8 +7295,8 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, ...@@ -7295,8 +7295,8 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len,
if (!path) if (!path)
return -ENOMEM; return -ENOMEM;
ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(BTRFS_I(inode)), ret = btrfs_lookup_file_extent(NULL, root, path,
offset, 0); btrfs_ino(BTRFS_I(inode)), offset, 0);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -8245,7 +8245,8 @@ static void btrfs_end_dio_bio(struct bio *bio) ...@@ -8245,7 +8245,8 @@ static void btrfs_end_dio_bio(struct bio *bio)
if (err) if (err)
btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
"direct IO failed ino %llu rw %d,%u sector %#Lx len %u err no %d", "direct IO failed ino %llu rw %d,%u sector %#Lx len %u err no %d",
btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), bio->bi_opf, btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio),
bio->bi_opf,
(unsigned long long)bio->bi_iter.bi_sector, (unsigned long long)bio->bi_iter.bi_sector,
bio->bi_iter.bi_size, err); bio->bi_iter.bi_size, err);
...@@ -9560,7 +9561,8 @@ static int btrfs_rename_exchange(struct inode *old_dir, ...@@ -9560,7 +9561,8 @@ static int btrfs_rename_exchange(struct inode *old_dir,
new_dentry->d_name.name, new_dentry->d_name.name,
new_dentry->d_name.len, new_dentry->d_name.len,
old_ino, old_ino,
btrfs_ino(BTRFS_I(new_dir)), old_idx); btrfs_ino(BTRFS_I(new_dir)),
old_idx);
if (ret) if (ret)
goto out_fail; goto out_fail;
} }
...@@ -9576,7 +9578,8 @@ static int btrfs_rename_exchange(struct inode *old_dir, ...@@ -9576,7 +9578,8 @@ static int btrfs_rename_exchange(struct inode *old_dir,
old_dentry->d_name.name, old_dentry->d_name.name,
old_dentry->d_name.len, old_dentry->d_name.len,
new_ino, new_ino,
btrfs_ino(BTRFS_I(old_dir)), new_idx); btrfs_ino(BTRFS_I(old_dir)),
new_idx);
if (ret) if (ret)
goto out_fail; goto out_fail;
} }
...@@ -9592,8 +9595,10 @@ static int btrfs_rename_exchange(struct inode *old_dir, ...@@ -9592,8 +9595,10 @@ static int btrfs_rename_exchange(struct inode *old_dir,
new_inode->i_ctime = ctime; new_inode->i_ctime = ctime;
if (old_dentry->d_parent != new_dentry->d_parent) { if (old_dentry->d_parent != new_dentry->d_parent) {
btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), BTRFS_I(old_inode), 1); btrfs_record_unlink_dir(trans, BTRFS_I(old_dir),
btrfs_record_unlink_dir(trans, BTRFS_I(new_dir), BTRFS_I(new_inode), 1); BTRFS_I(old_inode), 1);
btrfs_record_unlink_dir(trans, BTRFS_I(new_dir),
BTRFS_I(new_inode), 1);
} }
/* src is a subvolume */ /* src is a subvolume */
...@@ -9659,13 +9664,15 @@ static int btrfs_rename_exchange(struct inode *old_dir, ...@@ -9659,13 +9664,15 @@ static int btrfs_rename_exchange(struct inode *old_dir,
if (root_log_pinned) { if (root_log_pinned) {
parent = new_dentry->d_parent; parent = new_dentry->d_parent;
btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), parent); btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir),
parent);
btrfs_end_log_trans(root); btrfs_end_log_trans(root);
root_log_pinned = false; root_log_pinned = false;
} }
if (dest_log_pinned) { if (dest_log_pinned) {
parent = old_dentry->d_parent; parent = old_dentry->d_parent;
btrfs_log_new_name(trans, BTRFS_I(new_inode), BTRFS_I(new_dir), parent); btrfs_log_new_name(trans, BTRFS_I(new_inode), BTRFS_I(new_dir),
parent);
btrfs_end_log_trans(dest); btrfs_end_log_trans(dest);
dest_log_pinned = false; dest_log_pinned = false;
} }
...@@ -9872,7 +9879,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -9872,7 +9879,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
old_inode->i_ctime = current_time(old_dir); old_inode->i_ctime = current_time(old_dir);
if (old_dentry->d_parent != new_dentry->d_parent) if (old_dentry->d_parent != new_dentry->d_parent)
btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), BTRFS_I(old_inode), 1); btrfs_record_unlink_dir(trans, BTRFS_I(old_dir),
BTRFS_I(old_inode), 1);
if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) { if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) {
root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;
...@@ -9931,7 +9939,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -9931,7 +9939,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (log_pinned) { if (log_pinned) {
struct dentry *parent = new_dentry->d_parent; struct dentry *parent = new_dentry->d_parent;
btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), parent); btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir),
parent);
btrfs_end_log_trans(root); btrfs_end_log_trans(root);
log_pinned = false; log_pinned = false;
} }
...@@ -10226,8 +10235,8 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, ...@@ -10226,8 +10235,8 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
goto out_unlock; goto out_unlock;
inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, dentry->d_name.len, btrfs_ino(BTRFS_I(dir)),
S_IFLNK|S_IRWXUGO, &index); objectid, S_IFLNK|S_IRWXUGO, &index);
if (IS_ERR(inode)) { if (IS_ERR(inode)) {
err = PTR_ERR(inode); err = PTR_ERR(inode);
goto out_unlock; goto out_unlock;
......
...@@ -1609,8 +1609,8 @@ static int get_new_location(struct inode *reloc_inode, u64 *new_bytenr, ...@@ -1609,8 +1609,8 @@ static int get_new_location(struct inode *reloc_inode, u64 *new_bytenr,
return -ENOMEM; return -ENOMEM;
bytenr -= BTRFS_I(reloc_inode)->index_cnt; bytenr -= BTRFS_I(reloc_inode)->index_cnt;
ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(BTRFS_I(reloc_inode)), ret = btrfs_lookup_file_extent(NULL, root, path,
bytenr, 0); btrfs_ino(BTRFS_I(reloc_inode)), bytenr, 0);
if (ret < 0) if (ret < 0)
goto out; goto out;
if (ret > 0) { if (ret > 0) {
......
...@@ -631,8 +631,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, ...@@ -631,8 +631,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
* file. This must be done before the btrfs_drop_extents run * file. This must be done before the btrfs_drop_extents run
* so we don't try to drop this extent. * so we don't try to drop this extent.
*/ */
ret = btrfs_lookup_file_extent(trans, root, path, btrfs_ino(BTRFS_I(inode)), ret = btrfs_lookup_file_extent(trans, root, path,
start, 0); btrfs_ino(BTRFS_I(inode)), start, 0);
if (ret == 0 && if (ret == 0 &&
(found_type == BTRFS_FILE_EXTENT_REG || (found_type == BTRFS_FILE_EXTENT_REG ||
...@@ -1296,8 +1296,9 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, ...@@ -1296,8 +1296,9 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
goto out; goto out;
/* if we already have a perfect match, we're done */ /* if we already have a perfect match, we're done */
if (!inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), btrfs_ino(BTRFS_I(inode)), if (!inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)),
ref_index, name, namelen)) { btrfs_ino(BTRFS_I(inode)), ref_index,
name, namelen)) {
/* /*
* look for a conflicting back reference in the * look for a conflicting back reference in the
* metadata. if we find one we have to unlink that name * metadata. if we find one we have to unlink that name
...@@ -3676,7 +3677,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, ...@@ -3676,7 +3677,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
dst_path->slots[0], dst_path->slots[0],
struct btrfs_inode_item); struct btrfs_inode_item);
fill_inode_item(trans, dst_path->nodes[0], inode_item, fill_inode_item(trans, dst_path->nodes[0], inode_item,
&inode->vfs_inode, inode_only == LOG_INODE_EXISTS, &inode->vfs_inode,
inode_only == LOG_INODE_EXISTS,
logged_isize); logged_isize);
} else { } else {
copy_extent_buffer(dst_path->nodes[0], src, dst_offset, copy_extent_buffer(dst_path->nodes[0], src, dst_offset,
...@@ -3826,7 +3828,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, ...@@ -3826,7 +3828,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
if (need_find_last_extent) { if (need_find_last_extent) {
/* btrfs_prev_leaf could return 1 without releasing the path */ /* btrfs_prev_leaf could return 1 without releasing the path */
btrfs_release_path(src_path); btrfs_release_path(src_path);
ret = btrfs_search_slot(NULL, inode->root, &first_key, src_path, 0, 0); ret = btrfs_search_slot(NULL, inode->root, &first_key,
src_path, 0, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
ASSERT(ret == 0); ASSERT(ret == 0);
...@@ -4071,8 +4074,8 @@ static int log_one_extent(struct btrfs_trans_handle *trans, ...@@ -4071,8 +4074,8 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
int extent_inserted = 0; int extent_inserted = 0;
bool ordered_io_err = false; bool ordered_io_err = false;
ret = wait_ordered_extents(trans, &inode->vfs_inode, root, em, logged_list, ret = wait_ordered_extents(trans, &inode->vfs_inode, root, em,
&ordered_io_err); logged_list, &ordered_io_err);
if (ret) if (ret)
return ret; return ret;
...@@ -5810,7 +5813,7 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans, ...@@ -5810,7 +5813,7 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans,
struct dentry *parent) struct dentry *parent)
{ {
struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb); struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
struct btrfs_root * root = inode->root; struct btrfs_root *root = inode->root;
/* /*
* this will force the logging code to walk the dentry chain * this will force the logging code to walk the dentry chain
......
...@@ -47,8 +47,8 @@ ssize_t __btrfs_getxattr(struct inode *inode, const char *name, ...@@ -47,8 +47,8 @@ ssize_t __btrfs_getxattr(struct inode *inode, const char *name,
return -ENOMEM; return -ENOMEM;
/* lookup the xattr by name */ /* lookup the xattr by name */
di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(BTRFS_I(inode)), name, di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(BTRFS_I(inode)),
strlen(name), 0); name, strlen(name), 0);
if (!di) { if (!di) {
ret = -ENODATA; ret = -ENODATA;
goto out; goto out;
...@@ -108,8 +108,8 @@ static int do_setxattr(struct btrfs_trans_handle *trans, ...@@ -108,8 +108,8 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
path->skip_release_on_error = 1; path->skip_release_on_error = 1;
if (!value) { if (!value) {
di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(BTRFS_I(inode)), di = btrfs_lookup_xattr(trans, root, path,
name, name_len, -1); btrfs_ino(BTRFS_I(inode)), name, name_len, -1);
if (!di && (flags & XATTR_REPLACE)) if (!di && (flags & XATTR_REPLACE))
ret = -ENODATA; ret = -ENODATA;
else if (IS_ERR(di)) else if (IS_ERR(di))
...@@ -128,8 +128,8 @@ static int do_setxattr(struct btrfs_trans_handle *trans, ...@@ -128,8 +128,8 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
*/ */
if (flags & XATTR_REPLACE) { if (flags & XATTR_REPLACE) {
ASSERT(inode_is_locked(inode)); ASSERT(inode_is_locked(inode));
di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(BTRFS_I(inode)), di = btrfs_lookup_xattr(NULL, root, path,
name, name_len, 0); btrfs_ino(BTRFS_I(inode)), name, name_len, 0);
if (!di) if (!di)
ret = -ENODATA; ret = -ENODATA;
else if (IS_ERR(di)) else if (IS_ERR(di))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment