Skip to content

Commit 2093abf

Browse files
Jiro SEKIBAkonis
authored andcommitted
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>
1 parent 4cd76c3 commit 2093abf

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎fs/nilfs2/dir.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ static int nilfs_prepare_chunk(struct page *page,
9999
NULL, nilfs_get_block);
100100
}
101101

102-
static int nilfs_commit_chunk(struct page *page,
103-
struct address_space *mapping,
104-
unsigned from, unsigned to)
102+
static void nilfs_commit_chunk(struct page *page,
103+
struct address_space *mapping,
104+
unsigned from, unsigned to)
105105
{
106106
struct inode *dir = mapping->host;
107107
struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb);
@@ -119,8 +119,8 @@ static int nilfs_commit_chunk(struct page *page,
119119
if (IS_DIRSYNC(dir))
120120
nilfs_set_transaction_flag(NILFS_TI_SYNC);
121121
err = nilfs_set_file_dirty(sbi, dir, nr_dirty);
122+
WARN_ON(err); /* do not happen */
122123
unlock_page(page);
123-
return err;
124124
}
125125

126126
static void nilfs_check_page(struct page *page)
@@ -455,7 +455,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de,
455455
BUG_ON(err);
456456
de->inode = cpu_to_le64(inode->i_ino);
457457
nilfs_set_de_type(de, inode);
458-
err = nilfs_commit_chunk(page, mapping, from, to);
458+
nilfs_commit_chunk(page, mapping, from, to);
459459
nilfs_put_page(page);
460460
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
461461
/* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
@@ -547,7 +547,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)
547547
memcpy(de->name, name, namelen);
548548
de->inode = cpu_to_le64(inode->i_ino);
549549
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);
551551
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
552552
/* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
553553
mark_inode_dirty(dir);
@@ -594,7 +594,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page)
594594
if (pde)
595595
pde->rec_len = cpu_to_le16(to - from);
596596
dir->inode = 0;
597-
err = nilfs_commit_chunk(page, mapping, from, to);
597+
nilfs_commit_chunk(page, mapping, from, to);
598598
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
599599
/* NILFS_I(inode)->i_flags &= ~NILFS_BTREE_FL; */
600600
mark_inode_dirty(inode);
@@ -639,7 +639,7 @@ int nilfs_make_empty(struct inode *inode, struct inode *parent)
639639
memcpy(de->name, "..\0", 4);
640640
nilfs_set_de_type(de, inode);
641641
kunmap_atomic(kaddr, KM_USER0);
642-
err = nilfs_commit_chunk(page, mapping, 0, chunk_size);
642+
nilfs_commit_chunk(page, mapping, 0, chunk_size);
643643
fail:
644644
page_cache_release(page);
645645
return err;

0 commit comments

Comments
 (0)