Skip to content

Commit

Permalink
reiserfs: cleanup, remove unnecessary parens
Browse files Browse the repository at this point in the history
The reiserfs code is littered with extra parens in places where the authors
may not have been certain about precedence of & vs ->. This patch cleans them
out.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Jeff Mahoney authored and Jan Kara committed May 6, 2014
1 parent cf776a7 commit a228bf8
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 130 deletions.
6 changes: 3 additions & 3 deletions fs/reiserfs/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value)
* up front so we need to account for it.
*/
if (unlikely(test_bit(REISERFS_OLD_FORMAT,
&(REISERFS_SB(s)->s_properties)))) {
&REISERFS_SB(s)->s_properties))) {
b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1;
if (block >= bmap1 &&
block <= bmap1 + bmap_count) {
Expand Down Expand Up @@ -524,7 +524,7 @@ static void __discard_prealloc(struct reiserfs_transaction_handle *th,
if (dirty)
reiserfs_update_sd(th, inode);
ei->i_prealloc_block = save;
list_del_init(&(ei->i_prealloc_list));
list_del_init(&ei->i_prealloc_list);
}

/* FIXME: It should be inline function */
Expand Down Expand Up @@ -1417,7 +1417,7 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb,
* I doubt there are any of these left, but just in case...
*/
if (unlikely(test_bit(REISERFS_OLD_FORMAT,
&(REISERFS_SB(sb)->s_properties))))
&REISERFS_SB(sb)->s_properties)))
block = REISERFS_SB(sb)->s_sbh->b_blocknr + 1 + bitmap;
else if (bitmap == 0)
block = (REISERFS_DISK_OFFSET_IN_BYTES >> sb->s_blocksize_bits) + 1;
Expand Down
2 changes: 1 addition & 1 deletion fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int reiserfs_readdir_inode(struct inode *inode, struct dir_context *ctx)
store_ih(&tmp_ih, ih);

/* we must have found item, that is item of this directory, */
RFALSE(COMP_SHORT_KEYS(&(ih->ih_key), &pos_key),
RFALSE(COMP_SHORT_KEYS(&ih->ih_key, &pos_key),
"vs-9000: found item %h does not match to dir we readdir %K",
ih, &pos_key);
RFALSE(item_num > B_NR_ITEMS(bh) - 1,
Expand Down
2 changes: 1 addition & 1 deletion fs/reiserfs/do_balan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ void do_balance(struct tree_balance *tb, struct item_head *ih,
return;
}

atomic_inc(&(fs_generation(tb->tb_sb)));
atomic_inc(&fs_generation(tb->tb_sb));
do_balance_starts(tb);

/*
Expand Down
16 changes: 8 additions & 8 deletions fs/reiserfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
if (atomic_add_unless(&REISERFS_I(inode)->openers, -1, 1))
return 0;

mutex_lock(&(REISERFS_I(inode)->tailpack));
mutex_lock(&REISERFS_I(inode)->tailpack);

if (!atomic_dec_and_test(&REISERFS_I(inode)->openers)) {
mutex_unlock(&(REISERFS_I(inode)->tailpack));
mutex_unlock(&REISERFS_I(inode)->tailpack);
return 0;
}

/* fast out for when nothing needs to be done */
if ((!(REISERFS_I(inode)->i_flags & i_pack_on_close_mask) ||
!tail_has_to_be_packed(inode)) &&
REISERFS_I(inode)->i_prealloc_count <= 0) {
mutex_unlock(&(REISERFS_I(inode)->tailpack));
mutex_unlock(&REISERFS_I(inode)->tailpack);
return 0;
}

Expand Down Expand Up @@ -116,7 +116,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
}
out:
reiserfs_write_unlock(inode->i_sb);
mutex_unlock(&(REISERFS_I(inode)->tailpack));
mutex_unlock(&REISERFS_I(inode)->tailpack);
return err;
}

Expand All @@ -126,18 +126,18 @@ static int reiserfs_file_open(struct inode *inode, struct file *file)

/* somebody might be tailpacking on final close; wait for it */
if (!atomic_inc_not_zero(&REISERFS_I(inode)->openers)) {
mutex_lock(&(REISERFS_I(inode)->tailpack));
mutex_lock(&REISERFS_I(inode)->tailpack);
atomic_inc(&REISERFS_I(inode)->openers);
mutex_unlock(&(REISERFS_I(inode)->tailpack));
mutex_unlock(&REISERFS_I(inode)->tailpack);
}
return err;
}

void reiserfs_vfs_truncate_file(struct inode *inode)
{
mutex_lock(&(REISERFS_I(inode)->tailpack));
mutex_lock(&REISERFS_I(inode)->tailpack);
reiserfs_truncate_file(inode, 1);
mutex_unlock(&(REISERFS_I(inode)->tailpack));
mutex_unlock(&REISERFS_I(inode)->tailpack);
}

/* Sync a reiserfs file. */
Expand Down
8 changes: 4 additions & 4 deletions fs/reiserfs/fix_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
ih = item_head(Sh, 0);

/* define the mergeability for 0-th item (if it is not being deleted) */
if (op_is_left_mergeable(&(ih->ih_key), Sh->b_size)
if (op_is_left_mergeable(&ih->ih_key, Sh->b_size)
&& (vn->vn_mode != M_DELETE || vn->vn_affected_item_num))
vn->vn_vi[0].vi_type |= VI_TYPE_LEFT_MERGEABLE;

Expand Down Expand Up @@ -682,7 +682,7 @@ static int is_leaf_removable(struct tree_balance *tb)
/* check whether we can divide 1 remaining item between neighbors */

/* get size of remaining item (in item units) */
size = op_unit_num(&(vn->vn_vi[to_left]));
size = op_unit_num(&vn->vn_vi[to_left]);

if (tb->lbytes + tb->rbytes >= size) {
set_parameters(tb, 0, to_left + 1, to_right + 1, 0, NULL,
Expand Down Expand Up @@ -720,7 +720,7 @@ static int are_leaves_removable(struct tree_balance *tb, int lfree, int rfree)

ih = item_head(S0, 0);
if (tb->CFR[0]
&& !comp_short_le_keys(&(ih->ih_key),
&& !comp_short_le_keys(&ih->ih_key,
internal_key(tb->CFR[0],
tb->rkey[0])))
/*
Expand Down Expand Up @@ -1287,7 +1287,7 @@ static inline int can_node_be_removed(int mode, int lfree, int sfree, int rfree,
/* shifting may merge items which might save space */
-
((!h
&& op_is_left_mergeable(&(ih->ih_key), Sh->b_size)) ? IH_SIZE : 0)
&& op_is_left_mergeable(&ih->ih_key, Sh->b_size)) ? IH_SIZE : 0)
-
((!h && r_key
&& op_is_left_mergeable(r_key, Sh->b_size)) ? IH_SIZE : 0)
Expand Down
4 changes: 2 additions & 2 deletions fs/reiserfs/ibalance.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ static void internal_insert_childs(struct buffer_info *cur_bi,

/* copy to_be_insert disk children */
for (i = 0; i < count; i++) {
put_dc_size(&(new_dc[i]),
put_dc_size(&new_dc[i],
MAX_CHILD_SIZE(bh[i]) - B_FREE_SPACE(bh[i]));
put_dc_block_number(&(new_dc[i]), bh[i]->b_blocknr);
put_dc_block_number(&new_dc[i], bh[i]->b_blocknr);
}
memcpy(dc, new_dc, DC_SIZE * count);

Expand Down
10 changes: 5 additions & 5 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
*/
make_cpu_key(&tmp_key, inode,
le_key_k_offset(version,
&(ih->ih_key)) +
&ih->ih_key) +
op_bytes_number(ih,
inode->i_sb->s_blocksize),
TYPE_INDIRECT, 3);
Expand Down Expand Up @@ -1243,9 +1243,9 @@ static void init_inode(struct inode *inode, struct treepath *path)
bh = PATH_PLAST_BUFFER(path);
ih = tp_item_head(path);

copy_key(INODE_PKEY(inode), &(ih->ih_key));
copy_key(INODE_PKEY(inode), &ih->ih_key);

INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list));
INIT_LIST_HEAD(&REISERFS_I(inode)->i_prealloc_list);
REISERFS_I(inode)->i_flags = 0;
REISERFS_I(inode)->i_prealloc_block = 0;
REISERFS_I(inode)->i_prealloc_count = 0;
Expand Down Expand Up @@ -1967,7 +1967,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
else
make_le_item_head(&ih, NULL, KEY_FORMAT_3_6, SD_OFFSET,
TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE);
memcpy(INODE_PKEY(inode), &ih.ih_key, KEY_SIZE);
args.dirid = le32_to_cpu(ih.ih_key.k_dir_id);

depth = reiserfs_write_unlock_nested(inode->i_sb);
Expand Down Expand Up @@ -2011,7 +2011,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
REISERFS_I(inode)->i_first_direct_byte = S_ISLNK(mode) ? 1 :
U32_MAX /*NO_BYTES_IN_DIRECT_ITEM */ ;

INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list));
INIT_LIST_HEAD(&REISERFS_I(inode)->i_prealloc_list);
REISERFS_I(inode)->i_flags = 0;
REISERFS_I(inode)->i_prealloc_block = 0;
REISERFS_I(inode)->i_prealloc_count = 0;
Expand Down
4 changes: 2 additions & 2 deletions fs/reiserfs/item_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ static int direntry_create_vi(struct virtual_node *vn,
j = old_entry_num(is_affected, i, vn->vn_pos_in_item,
vn->vn_mode);
dir_u->entry_sizes[i] =
(j ? deh_location(&(deh[j - 1])) : ih_item_len(vi->vi_ih)) -
deh_location(&(deh[j])) + DEH_SIZE;
(j ? deh_location(&deh[j - 1]) : ih_item_len(vi->vi_ih)) -
deh_location(&deh[j]) + DEH_SIZE;
}

size += (dir_u->entry_count * sizeof(short));
Expand Down
Loading

0 comments on commit a228bf8

Please sign in to comment.