diff options
author | Jiro SEKIBA <jir@unicus.jp> | 2009-11-27 05:41:11 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-27 06:05:15 -0500 |
commit | 2093abf9cbcec3cb1409a67d8bce51854595b1d5 (patch) | |
tree | 039e2b5f9108a9285ac8f01a34ee7f4515ef1f6a /fs/nilfs2 | |
parent | 4cd76c3c930993cf70657775bb521cad006e37b4 (diff) |
nilfs2: change return type of nilfs_commit_chunk
change return type of nilfs_commit_chunk() as void from int,
for nilfs_set_file_dirty() usually does not return error.
This is an intermediate patch to reduce mark_inode_dirty() in
nilfs_commit_chunk().
Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/dir.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index 4f3fa0030e2c..173530d14866 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c | |||
@@ -99,9 +99,9 @@ static int nilfs_prepare_chunk(struct page *page, | |||
99 | NULL, nilfs_get_block); | 99 | NULL, nilfs_get_block); |
100 | } | 100 | } |
101 | 101 | ||
102 | static int nilfs_commit_chunk(struct page *page, | 102 | static void nilfs_commit_chunk(struct page *page, |
103 | struct address_space *mapping, | 103 | struct address_space *mapping, |
104 | unsigned from, unsigned to) | 104 | unsigned from, unsigned to) |
105 | { | 105 | { |
106 | struct inode *dir = mapping->host; | 106 | struct inode *dir = mapping->host; |
107 | struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb); | 107 | struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb); |
@@ -119,8 +119,8 @@ static int nilfs_commit_chunk(struct page *page, | |||
119 | if (IS_DIRSYNC(dir)) | 119 | if (IS_DIRSYNC(dir)) |
120 | nilfs_set_transaction_flag(NILFS_TI_SYNC); | 120 | nilfs_set_transaction_flag(NILFS_TI_SYNC); |
121 | err = nilfs_set_file_dirty(sbi, dir, nr_dirty); | 121 | err = nilfs_set_file_dirty(sbi, dir, nr_dirty); |
122 | WARN_ON(err); /* do not happen */ | ||
122 | unlock_page(page); | 123 | unlock_page(page); |
123 | return err; | ||
124 | } | 124 | } |
125 | 125 | ||
126 | static void nilfs_check_page(struct page *page) | 126 | static void nilfs_check_page(struct page *page) |
@@ -455,7 +455,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, | |||
455 | BUG_ON(err); | 455 | BUG_ON(err); |
456 | de->inode = cpu_to_le64(inode->i_ino); | 456 | de->inode = cpu_to_le64(inode->i_ino); |
457 | nilfs_set_de_type(de, inode); | 457 | nilfs_set_de_type(de, inode); |
458 | err = nilfs_commit_chunk(page, mapping, from, to); | 458 | nilfs_commit_chunk(page, mapping, from, to); |
459 | nilfs_put_page(page); | 459 | nilfs_put_page(page); |
460 | dir->i_mtime = dir->i_ctime = CURRENT_TIME; | 460 | dir->i_mtime = dir->i_ctime = CURRENT_TIME; |
461 | /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ | 461 | /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ |
@@ -547,7 +547,7 @@ got_it: | |||
547 | memcpy(de->name, name, namelen); | 547 | memcpy(de->name, name, namelen); |
548 | de->inode = cpu_to_le64(inode->i_ino); | 548 | de->inode = cpu_to_le64(inode->i_ino); |
549 | nilfs_set_de_type(de, inode); | 549 | nilfs_set_de_type(de, inode); |
550 | err = nilfs_commit_chunk(page, page->mapping, from, to); | 550 | nilfs_commit_chunk(page, page->mapping, from, to); |
551 | dir->i_mtime = dir->i_ctime = CURRENT_TIME; | 551 | dir->i_mtime = dir->i_ctime = CURRENT_TIME; |
552 | /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ | 552 | /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ |
553 | mark_inode_dirty(dir); | 553 | mark_inode_dirty(dir); |
@@ -594,7 +594,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) | |||
594 | if (pde) | 594 | if (pde) |
595 | pde->rec_len = cpu_to_le16(to - from); | 595 | pde->rec_len = cpu_to_le16(to - from); |
596 | dir->inode = 0; | 596 | dir->inode = 0; |
597 | err = nilfs_commit_chunk(page, mapping, from, to); | 597 | nilfs_commit_chunk(page, mapping, from, to); |
598 | inode->i_ctime = inode->i_mtime = CURRENT_TIME; | 598 | inode->i_ctime = inode->i_mtime = CURRENT_TIME; |
599 | /* NILFS_I(inode)->i_flags &= ~NILFS_BTREE_FL; */ | 599 | /* NILFS_I(inode)->i_flags &= ~NILFS_BTREE_FL; */ |
600 | mark_inode_dirty(inode); | 600 | mark_inode_dirty(inode); |
@@ -639,7 +639,7 @@ int nilfs_make_empty(struct inode *inode, struct inode *parent) | |||
639 | memcpy(de->name, "..\0", 4); | 639 | memcpy(de->name, "..\0", 4); |
640 | nilfs_set_de_type(de, inode); | 640 | nilfs_set_de_type(de, inode); |
641 | kunmap_atomic(kaddr, KM_USER0); | 641 | kunmap_atomic(kaddr, KM_USER0); |
642 | err = nilfs_commit_chunk(page, mapping, 0, chunk_size); | 642 | nilfs_commit_chunk(page, mapping, 0, chunk_size); |
643 | fail: | 643 | fail: |
644 | page_cache_release(page); | 644 | page_cache_release(page); |
645 | return err; | 645 | return err; |