Skip to content

Commit 75f65ed

Browse files
committed
nilfs2: remove newblk argument from nilfs_btnode_submit_block
This removes the obsolete argument from nilfs_btnode_submit_block(). This will complete separating a create function of btree node. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1 parent 45f4910 commit 75f65ed

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

‎fs/nilfs2/btnode.c‎

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr)
9595
}
9696

9797
int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
98-
sector_t pblocknr, struct buffer_head **pbh,
99-
int newblk)
98+
sector_t pblocknr, struct buffer_head **pbh)
10099
{
101100
struct buffer_head *bh;
102101
struct inode *inode = NILFS_BTNC_I(btnc);
@@ -107,19 +106,6 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
107106
return -ENOMEM;
108107

109108
err = -EEXIST; /* internal code */
110-
if (newblk) {
111-
if (unlikely(buffer_mapped(bh) || buffer_uptodate(bh) ||
112-
buffer_dirty(bh))) {
113-
brelse(bh);
114-
BUG();
115-
}
116-
memset(bh->b_data, 0, 1 << inode->i_blkbits);
117-
bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev;
118-
bh->b_blocknr = blocknr;
119-
set_buffer_mapped(bh);
120-
set_buffer_uptodate(bh);
121-
goto found;
122-
}
123109

124110
if (buffer_uptodate(bh) || buffer_dirty(bh))
125111
goto found;
@@ -162,12 +148,12 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
162148
}
163149

164150
int nilfs_btnode_get(struct address_space *btnc, __u64 blocknr,
165-
sector_t pblocknr, struct buffer_head **pbh, int newblk)
151+
sector_t pblocknr, struct buffer_head **pbh)
166152
{
167153
struct buffer_head *bh;
168154
int err;
169155

170-
err = nilfs_btnode_submit_block(btnc, blocknr, pblocknr, pbh, newblk);
156+
err = nilfs_btnode_submit_block(btnc, blocknr, pblocknr, pbh);
171157
if (err == -EEXIST) /* internal code (cache hit) */
172158
return 0;
173159
if (unlikely(err))

‎fs/nilfs2/btnode.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ void nilfs_btnode_cache_clear(struct address_space *);
4343
struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
4444
__u64 blocknr);
4545
int nilfs_btnode_submit_block(struct address_space *, __u64, sector_t,
46-
struct buffer_head **, int);
46+
struct buffer_head **);
4747
int nilfs_btnode_get(struct address_space *, __u64, sector_t,
48-
struct buffer_head **, int);
48+
struct buffer_head **);
4949
void nilfs_btnode_delete(struct buffer_head *);
5050
int nilfs_btnode_prepare_change_key(struct address_space *,
5151
struct nilfs_btnode_chkey_ctxt *);

‎fs/nilfs2/gcinode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn,
149149
__u64 vbn, struct buffer_head **out_bh)
150150
{
151151
int ret = nilfs_btnode_submit_block(&NILFS_I(inode)->i_btnode_cache,
152-
vbn ? : pbn, pbn, out_bh, 0);
152+
vbn ? : pbn, pbn, out_bh);
153153
if (ret == -EEXIST) /* internal code (cache hit) */
154154
ret = 0;
155155
return ret;

0 commit comments

Comments
 (0)