diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-05-04 23:56:51 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-05-10 09:21:56 -0400 |
commit | 0ef28f9aec4dccfba33cef74412f601c1b48b658 (patch) | |
tree | 12018cde66a20b8e8804c11296ac19a3aec59fea /fs/nilfs2/btnode.c | |
parent | 0cc1283881d3fcc9011c713e067795ccec322ae7 (diff) |
nilfs2: get rid of NILFS_I_NILFS
This replaces all references of NILFS_I_NILFS(inode)->ns_bdev with
inode->i_sb->s_bdev and unfolds remaining uses of NILFS_I_NILFS inline
function.
Before 2.6.37, referring to a nilfs object from inodes needed a
conditional judgement, and NILFS_I_NILFS was helpful to simplify it.
But now we can simply do it by going through a super block instance
like inode->i_sb->s_fs_info.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/btnode.c')
-rw-r--r-- | fs/nilfs2/btnode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index 609cd223eea8..481756042423 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c | |||
@@ -62,7 +62,7 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr) | |||
62 | BUG(); | 62 | BUG(); |
63 | } | 63 | } |
64 | memset(bh->b_data, 0, 1 << inode->i_blkbits); | 64 | memset(bh->b_data, 0, 1 << inode->i_blkbits); |
65 | bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev; | 65 | bh->b_bdev = inode->i_sb->s_bdev; |
66 | bh->b_blocknr = blocknr; | 66 | bh->b_blocknr = blocknr; |
67 | set_buffer_mapped(bh); | 67 | set_buffer_mapped(bh); |
68 | set_buffer_uptodate(bh); | 68 | set_buffer_uptodate(bh); |
@@ -94,10 +94,11 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, | |||
94 | if (pblocknr == 0) { | 94 | if (pblocknr == 0) { |
95 | pblocknr = blocknr; | 95 | pblocknr = blocknr; |
96 | if (inode->i_ino != NILFS_DAT_INO) { | 96 | if (inode->i_ino != NILFS_DAT_INO) { |
97 | struct inode *dat = NILFS_I_NILFS(inode)->ns_dat; | 97 | struct the_nilfs *nilfs = inode->i_sb->s_fs_info; |
98 | 98 | ||
99 | /* blocknr is a virtual block number */ | 99 | /* blocknr is a virtual block number */ |
100 | err = nilfs_dat_translate(dat, blocknr, &pblocknr); | 100 | err = nilfs_dat_translate(nilfs->ns_dat, blocknr, |
101 | &pblocknr); | ||
101 | if (unlikely(err)) { | 102 | if (unlikely(err)) { |
102 | brelse(bh); | 103 | brelse(bh); |
103 | goto out_locked; | 104 | goto out_locked; |
@@ -120,7 +121,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, | |||
120 | goto found; | 121 | goto found; |
121 | } | 122 | } |
122 | set_buffer_mapped(bh); | 123 | set_buffer_mapped(bh); |
123 | bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev; | 124 | bh->b_bdev = inode->i_sb->s_bdev; |
124 | bh->b_blocknr = pblocknr; /* set block address for read */ | 125 | bh->b_blocknr = pblocknr; /* set block address for read */ |
125 | bh->b_end_io = end_buffer_read_sync; | 126 | bh->b_end_io = end_buffer_read_sync; |
126 | get_bh(bh); | 127 | get_bh(bh); |