Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174703
b: refs/heads/master
c: 1376e93
h: refs/heads/master
i:
  174701: 454f7b9
  174699: d44b7a8
  174695: a3a8851
  174687: 04c475a
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent 6a0bd1c commit 5ac7b26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 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: 75f65edfcc4a19d14fc8ab860846fad070c8db49
refs/heads/master: 1376e931b75f954057b1547ba25fcba594cef804
21 changes: 0 additions & 21 deletions trunk/fs/nilfs2/btnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,6 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
return err;
}

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

err = nilfs_btnode_submit_block(btnc, blocknr, pblocknr, pbh);
if (err == -EEXIST) /* internal code (cache hit) */
return 0;
if (unlikely(err))
return err;

bh = *pbh;
wait_on_buffer(bh);
if (!buffer_uptodate(bh)) {
brelse(bh);
return -EIO;
}
return 0;
}

/**
* nilfs_btnode_delete - delete B-tree node buffer
* @bh: buffer to be deleted
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/nilfs2/btnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ 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 nilfs_btnode_get(struct address_space *, __u64, sector_t,
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
13 changes: 12 additions & 1 deletion trunk/fs/nilfs2/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,18 @@ static int nilfs_btree_get_block(const struct nilfs_btree *btree, __u64 ptr,
{
struct address_space *btnc =
&NILFS_BMAP_I((struct nilfs_bmap *)btree)->i_btnode_cache;
return nilfs_btnode_get(btnc, ptr, 0, bhp, 0);
int err;

err = nilfs_btnode_submit_block(btnc, ptr, 0, bhp);
if (err)
return err == -EEXIST ? 0 : err;

wait_on_buffer(*bhp);
if (!buffer_uptodate(*bhp)) {
brelse(*bhp);
return -EIO;
}
return 0;
}

static int nilfs_btree_get_new_block(const struct nilfs_btree *btree,
Expand Down

0 comments on commit 5ac7b26

Please sign in to comment.