Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174700
b: refs/heads/master
c: d501d73
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent d44b7a8 commit 49f38f7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b34a65069caa56b691ebab5ae0b8e54d16406d16
refs/heads/master: d501d7368937740e8d06671a4bfe4e236ed25bd0
26 changes: 26 additions & 0 deletions trunk/fs/nilfs2/btnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,32 @@ void nilfs_btnode_cache_clear(struct address_space *btnc)
truncate_inode_pages(btnc, 0);
}

struct buffer_head *
nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr)
{
struct inode *inode = NILFS_BTNC_I(btnc);
struct buffer_head *bh;

bh = nilfs_grab_buffer(inode, btnc, blocknr, 1 << BH_NILFS_Node);
if (unlikely(!bh))
return NULL;

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);

unlock_page(bh->b_page);
page_cache_release(bh->b_page);
return bh;
}

int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
sector_t pblocknr, struct buffer_head **pbh,
int newblk)
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/nilfs2/btnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ struct nilfs_btnode_chkey_ctxt {
void nilfs_btnode_cache_init_once(struct address_space *);
void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *);
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);
int nilfs_btnode_get(struct address_space *, __u64, sector_t,
Expand Down

0 comments on commit 49f38f7

Please sign in to comment.