[PATCH 2/2] Fix several style errors in fs/btrfs/inode.c

From: Siddhartha Menon
Date: Sat Dec 31 2022 - 09:14:53 EST


Signed-off-by: Siddhartha Menon <siddharthamenon@xxxxxxxxxxx>
---
fs/btrfs/inode.c | 49 +++++++++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index cb95d47e4d02..ee7ca0e69aa1 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -366,6 +366,7 @@ static int insert_inline_extent(struct btrfs_trans_hand=
le *trans,
if (compress_type !=3D BTRFS_COMPRESS_NONE) {
struct page *cpage;
int i =3D 0;
+
while (compressed_size > 0) {
cpage =3D compressed_pages[i];
cur_size =3D min_t(unsigned long, compressed_size,
@@ -1221,7 +1222,7 @@ static noinline int cow_file_range(struct btrfs_inode=
*inode,
u64 blocksize =3D fs_info->sectorsize;
struct btrfs_key ins;
struct extent_map *em;
- unsigned clear_bits;
+ unsigned int clear_bits;
unsigned long page_ops;
bool extent_reserved =3D false;
int ret =3D 0;
@@ -1557,7 +1558,7 @@ static int cow_file_range_async(struct btrfs_inode *i=
node,
u64 num_chunks =3D DIV_ROUND_UP(end - start, SZ_512K);
int i;
bool should_compress;
- unsigned nofs_flag;
+ unsigned int nofs_flag;
const blk_opf_t write_flags =3D wbc_to_write_flags(wbc);
=20
unlock_extent(&inode->io_tree, start, end, NULL);
@@ -1575,7 +1576,7 @@ static int cow_file_range_async(struct btrfs_inode *i=
node,
memalloc_nofs_restore(nofs_flag);
=20
if (!ctx) {
- unsigned clear_bits =3D EXTENT_LOCKED | EXTENT_DELALLOC |
+ unsigned int clear_bits =3D EXTENT_LOCKED | EXTENT_DELALLOC |
EXTENT_DELALLOC_NEW | EXTENT_DEFRAG |
EXTENT_DO_ACCOUNTING;
unsigned long page_ops =3D PAGE_UNLOCK | PAGE_START_WRITEBACK |
@@ -3846,7 +3847,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
ret =3D PTR_ERR(trans);
goto out;
}
- btrfs_debug(fs_info, "auto deleting %Lu",
+ btrfs_debug(fs_info, "auto deleting %llu",
found_key.objectid);
ret =3D btrfs_del_orphan_item(trans, root,
found_key.objectid);
@@ -3892,8 +3893,8 @@ static noinline int acls_after_inode_item(struct exte=
nt_buffer *leaf,
{
u32 nritems =3D btrfs_header_nritems(leaf);
struct btrfs_key found_key;
- static u64 xattr_access =3D 0;
- static u64 xattr_default =3D 0;
+ static u64 xattr_access;
+ static u64 xattr_default;
int scanned =3D 0;
=20
if (!xattr_access) {
@@ -4920,7 +4921,7 @@ int btrfs_truncate_block(struct btrfs_inode *inode, l=
off_t from, loff_t len,
bool only_release_metadata =3D false;
u32 blocksize =3D fs_info->sectorsize;
pgoff_t index =3D from >> PAGE_SHIFT;
- unsigned offset =3D from & (blocksize - 1);
+ unsigned int offset =3D from & (blocksize - 1);
struct page *page;
gfp_t mask =3D btrfs_alloc_write_mask(mapping);
size_t write_bytes =3D blocksize;
@@ -5358,7 +5359,7 @@ static void evict_inode_truncate_pages(struct inode *=
inode)
struct extent_state *cached_state =3D NULL;
u64 start;
u64 end;
- unsigned state_flags;
+ unsigned int state_flags;
=20
node =3D rb_first(&io_tree->state);
state =3D rb_entry(node, struct extent_state, rb_node);
@@ -5842,7 +5843,7 @@ static struct inode *new_simple_dir(struct super_bloc=
k *s,
inode->i_op =3D &simple_dir_inode_operations;
inode->i_opflags &=3D ~IOP_XATTR;
inode->i_fop =3D &simple_dir_operations;
- inode->i_mode =3D S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO;
+ inode->i_mode =3D 0755;
inode->i_mtime =3D current_time(inode);
inode->i_atime =3D inode->i_mtime;
inode->i_ctime =3D inode->i_mtime;
@@ -5983,7 +5984,7 @@ static int btrfs_opendir(struct inode *inode, struct =
file *file)
struct dir_entry {
u64 ino;
u64 offset;
- unsigned type;
+ unsigned int type;
int name_len;
};
=20
@@ -6667,9 +6668,11 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
if (unlikely(ino =3D=3D BTRFS_FIRST_FREE_OBJECTID)) {
u64 local_index;
int err;
+
err =3D btrfs_del_root_ref(trans, key.objectid,
root->root_key.objectid, parent_ino,
&local_index, name);
+
if (err)
btrfs_abort_transaction(trans, err);
} else if (add_backref) {
@@ -8930,20 +8933,20 @@ void btrfs_destroy_inode(struct inode *vfs_inode)
=20
while (1) {
ordered =3D btrfs_lookup_first_ordered_extent(inode, (u64)-1);
+
if (!ordered)
break;
- else {
- btrfs_err(root->fs_info,
- "found ordered extent %llu %llu on inode cleanup",
- ordered->file_offset, ordered->num_bytes);
=20
- if (!freespace_inode)
- btrfs_lockdep_acquire(root->fs_info, btrfs_ordered_extent);
+ btrfs_err(root->fs_info,
+ "found ordered extent %llu %llu on inode cleanup",
+ ordered->file_offset, ordered->num_bytes);
=20
- btrfs_remove_ordered_extent(inode, ordered);
- btrfs_put_ordered_extent(ordered);
- btrfs_put_ordered_extent(ordered);
- }
+ if (!freespace_inode)
+ btrfs_lockdep_acquire(root->fs_info, btrfs_ordered_extent);
+
+ btrfs_remove_ordered_extent(inode, ordered);
+ btrfs_put_ordered_extent(ordered);
+ btrfs_put_ordered_extent(ordered);
}
btrfs_qgroup_check_reserved_leak(inode);
inode_tree_del(inode);
@@ -9357,10 +9360,10 @@ static int btrfs_rename(struct user_namespace *mnt_=
userns,
if (ret) {
if (ret =3D=3D -EEXIST) {
/* we shouldn't get
- * eexist without a new_inode */
- if (WARN_ON(!new_inode)) {
+ * eexist without a new_inode
+ */
+ if (WARN_ON(!new_inode))
goto out_fscrypt_names;
- }
} else {
/* maybe -EOVERFLOW */
goto out_fscrypt_names;
--=20
2.39.0