Skip to content

Commit

Permalink
nilfs2: trivial coding style fix
Browse files Browse the repository at this point in the history
This is a trivial style fix patch to mend errors/warnings
reported by "checkpatch.pl --file".

Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
  • Loading branch information
Jiro SEKIBA authored and konis committed Dec 25, 2009
1 parent 6b7b284 commit 5ee5814
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions fs/nilfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ __u64 nilfs_bmap_data_get_key(const struct nilfs_bmap *bmap,

key = page_index(bh->b_page) << (PAGE_CACHE_SHIFT -
bmap->b_inode->i_blkbits);
for (pbh = page_buffers(bh->b_page); pbh != bh;
pbh = pbh->b_this_page, key++);
for (pbh = page_buffers(bh->b_page); pbh != bh; pbh = pbh->b_this_page)
key++;

return key;
}
Expand Down
31 changes: 18 additions & 13 deletions fs/nilfs2/cpfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,24 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
tnicps += nicps;
nilfs_mdt_mark_buffer_dirty(cp_bh);
nilfs_mdt_mark_dirty(cpfile);
if (!nilfs_cpfile_is_in_first(cpfile, cno) &&
(count = nilfs_cpfile_block_sub_valid_checkpoints(
cpfile, cp_bh, kaddr, nicps)) == 0) {
/* make hole */
kunmap_atomic(kaddr, KM_USER0);
brelse(cp_bh);
ret = nilfs_cpfile_delete_checkpoint_block(
cpfile, cno);
if (ret == 0)
continue;
printk(KERN_ERR "%s: cannot delete block\n",
__func__);
break;
if (!nilfs_cpfile_is_in_first(cpfile, cno)) {
count =
nilfs_cpfile_block_sub_valid_checkpoints(
cpfile, cp_bh, kaddr, nicps);
if (count == 0) {
/* make hole */
kunmap_atomic(kaddr, KM_USER0);
brelse(cp_bh);
ret =
nilfs_cpfile_delete_checkpoint_block(
cpfile, cno);
if (ret == 0)
continue;
printk(KERN_ERR
"%s: cannot delete block\n",
__func__);
break;
}
}
}

Expand Down
17 changes: 9 additions & 8 deletions fs/nilfs2/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ static int nilfs_direct_lookup(const struct nilfs_bmap *bmap,
struct nilfs_direct *direct;
__u64 ptr;

direct = (struct nilfs_direct *)bmap;
if ((key > NILFS_DIRECT_KEY_MAX) ||
(level != 1) || /* XXX: use macro for level 1 */
((ptr = nilfs_direct_get_ptr(direct, key)) ==
NILFS_BMAP_INVALID_PTR))
direct = (struct nilfs_direct *)bmap; /* XXX: use macro for level 1 */
if (key > NILFS_DIRECT_KEY_MAX || level != 1)
return -ENOENT;
ptr = nilfs_direct_get_ptr(direct, key);
if (ptr == NILFS_BMAP_INVALID_PTR)
return -ENOENT;

if (ptrp != NULL)
Expand All @@ -73,9 +73,10 @@ static int nilfs_direct_lookup_contig(const struct nilfs_bmap *bmap,
sector_t blocknr;
int ret, cnt;

if (key > NILFS_DIRECT_KEY_MAX ||
(ptr = nilfs_direct_get_ptr(direct, key)) ==
NILFS_BMAP_INVALID_PTR)
if (key > NILFS_DIRECT_KEY_MAX)
return -ENOENT;
ptr = nilfs_direct_get_ptr(direct, key);
if (ptr == NILFS_BMAP_INVALID_PTR)
return -ENOENT;

if (NILFS_BMAP_USE_VBN(bmap)) {
Expand Down

0 comments on commit 5ee5814

Please sign in to comment.