aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/inode.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-12-26 10:05:49 -0500
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-01-10 00:37:54 -0500
commitbcbc8c648d6cc88f771435d8031c1a13e00945ed (patch)
treef74a2e7fffb5669823066f8fb875fff535ab8529 /fs/nilfs2/inode.c
parent06df0f999247a3153c3ec284c7ada36ef785eb97 (diff)
nilfs2: do not pass sbi to functions which can get it from inode
This removes argument for passing nilfs_sb_info structure from nilfs_set_file_dirty and nilfs_load_inode_block functions. We can get a pointer to the structure from inodes. [Stephen Rothwell <sfr@canb.auug.org.au>: fix conflict with commit b74c79e99389cd79b31fcc08f82c24e492e63c7e] Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r--fs/nilfs2/inode.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index b2a815033ee3..43416470e07b 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -181,10 +181,9 @@ static int nilfs_set_page_dirty(struct page *page)
181 181
182 if (ret) { 182 if (ret) {
183 struct inode *inode = page->mapping->host; 183 struct inode *inode = page->mapping->host;
184 struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb);
185 unsigned nr_dirty = 1 << (PAGE_SHIFT - inode->i_blkbits); 184 unsigned nr_dirty = 1 << (PAGE_SHIFT - inode->i_blkbits);
186 185
187 nilfs_set_file_dirty(sbi, inode, nr_dirty); 186 nilfs_set_file_dirty(inode, nr_dirty);
188 } 187 }
189 return ret; 188 return ret;
190} 189}
@@ -225,7 +224,7 @@ static int nilfs_write_end(struct file *file, struct address_space *mapping,
225 start + copied); 224 start + copied);
226 copied = generic_write_end(file, mapping, pos, len, copied, page, 225 copied = generic_write_end(file, mapping, pos, len, copied, page,
227 fsdata); 226 fsdata);
228 nilfs_set_file_dirty(NILFS_SB(inode->i_sb), inode, nr_dirty); 227 nilfs_set_file_dirty(inode, nr_dirty);
229 err = nilfs_transaction_commit(inode->i_sb); 228 err = nilfs_transaction_commit(inode->i_sb);
230 return err ? : copied; 229 return err ? : copied;
231} 230}
@@ -674,7 +673,7 @@ void nilfs_truncate(struct inode *inode)
674 nilfs_set_transaction_flag(NILFS_TI_SYNC); 673 nilfs_set_transaction_flag(NILFS_TI_SYNC);
675 674
676 nilfs_mark_inode_dirty(inode); 675 nilfs_mark_inode_dirty(inode);
677 nilfs_set_file_dirty(NILFS_SB(sb), inode, 0); 676 nilfs_set_file_dirty(inode, 0);
678 nilfs_transaction_commit(sb); 677 nilfs_transaction_commit(sb);
679 /* May construct a logical segment and may fail in sync mode. 678 /* May construct a logical segment and may fail in sync mode.
680 But truncate has no return value. */ 679 But truncate has no return value. */
@@ -792,9 +791,9 @@ int nilfs_permission(struct inode *inode, int mask, unsigned int flags)
792 return generic_permission(inode, mask, flags, NULL); 791 return generic_permission(inode, mask, flags, NULL);
793} 792}
794 793
795int nilfs_load_inode_block(struct nilfs_sb_info *sbi, struct inode *inode, 794int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh)
796 struct buffer_head **pbh)
797{ 795{
796 struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb);
798 struct nilfs_inode_info *ii = NILFS_I(inode); 797 struct nilfs_inode_info *ii = NILFS_I(inode);
799 int err; 798 int err;
800 799
@@ -835,9 +834,9 @@ int nilfs_inode_dirty(struct inode *inode)
835 return ret; 834 return ret;
836} 835}
837 836
838int nilfs_set_file_dirty(struct nilfs_sb_info *sbi, struct inode *inode, 837int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty)
839 unsigned nr_dirty)
840{ 838{
839 struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb);
841 struct nilfs_inode_info *ii = NILFS_I(inode); 840 struct nilfs_inode_info *ii = NILFS_I(inode);
842 841
843 atomic_add(nr_dirty, &sbi->s_nilfs->ns_ndirtyblks); 842 atomic_add(nr_dirty, &sbi->s_nilfs->ns_ndirtyblks);
@@ -870,11 +869,10 @@ int nilfs_set_file_dirty(struct nilfs_sb_info *sbi, struct inode *inode,
870 869
871int nilfs_mark_inode_dirty(struct inode *inode) 870int nilfs_mark_inode_dirty(struct inode *inode)
872{ 871{
873 struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb);
874 struct buffer_head *ibh; 872 struct buffer_head *ibh;
875 int err; 873 int err;
876 874
877 err = nilfs_load_inode_block(sbi, inode, &ibh); 875 err = nilfs_load_inode_block(inode, &ibh);
878 if (unlikely(err)) { 876 if (unlikely(err)) {
879 nilfs_warning(inode->i_sb, __func__, 877 nilfs_warning(inode->i_sb, __func__,
880 "failed to reget inode block.\n"); 878 "failed to reget inode block.\n");