Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174702
b: refs/heads/master
c: 75f65ed
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent 454f7b9 commit 6a0bd1c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45f4910bc0bb904bcf53aa04ee1b807abe1387a6
refs/heads/master: 75f65edfcc4a19d14fc8ab860846fad070c8db49
20 changes: 3 additions & 17 deletions trunk/fs/nilfs2/btnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr)
}

int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
sector_t pblocknr, struct buffer_head **pbh,
int newblk)
sector_t pblocknr, struct buffer_head **pbh)
{
struct buffer_head *bh;
struct inode *inode = NILFS_BTNC_I(btnc);
Expand All @@ -107,19 +106,6 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
return -ENOMEM;

err = -EEXIST; /* internal code */
if (newblk) {
if (unlikely(buffer_mapped(bh) || buffer_uptodate(bh) ||
buffer_dirty(bh))) {
brelse(bh);
BUG();
}
memset(bh->b_data, 0, 1 << inode->i_blkbits);
bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev;
bh->b_blocknr = blocknr;
set_buffer_mapped(bh);
set_buffer_uptodate(bh);
goto found;
}

if (buffer_uptodate(bh) || buffer_dirty(bh))
goto found;
Expand Down Expand Up @@ -162,12 +148,12 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
}

int nilfs_btnode_get(struct address_space *btnc, __u64 blocknr,
sector_t pblocknr, struct buffer_head **pbh, int newblk)
sector_t pblocknr, struct buffer_head **pbh)
{
struct buffer_head *bh;
int err;

err = nilfs_btnode_submit_block(btnc, blocknr, pblocknr, pbh, newblk);
err = nilfs_btnode_submit_block(btnc, blocknr, pblocknr, pbh);
if (err == -EEXIST) /* internal code (cache hit) */
return 0;
if (unlikely(err))
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nilfs2/btnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ void nilfs_btnode_cache_clear(struct address_space *);
struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
__u64 blocknr);
int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t,
struct buffer_head **, int);
struct buffer_head **);
int nilfs_btnode_get(struct address_space *, __u64, sector_t,
struct buffer_head **, int);
struct buffer_head **);
void nilfs_btnode_delete(struct buffer_head *);
int nilfs_btnode_prepare_change_key(struct address_space *,
struct nilfs_btnode_chkey_ctxt *);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/nilfs2/gcinode.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn,
__u64 vbn, struct buffer_head **out_bh)
{
int ret = nilfs_btnode_submit_block(&NILFS_I(inode)->i_btnode_cache,
vbn ? : pbn, pbn, out_bh, 0);
vbn ? : pbn, pbn, out_bh);
if (ret == -EEXIST) /* internal code (cache hit) */
ret = 0;
return ret;
Expand Down

0 comments on commit 6a0bd1c

Please sign in to comment.