Commit 2093abf9 authored by Jiro SEKIBA's avatar Jiro SEKIBA Committed by Ryusuke Konishi

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: default avatarJiro SEKIBA <jir@unicus.jp>
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
parent 4cd76c3c
...@@ -99,9 +99,9 @@ static int nilfs_prepare_chunk(struct page *page, ...@@ -99,9 +99,9 @@ static int nilfs_prepare_chunk(struct page *page,
NULL, nilfs_get_block); NULL, nilfs_get_block);
} }
static int nilfs_commit_chunk(struct page *page, static void nilfs_commit_chunk(struct page *page,
struct address_space *mapping, struct address_space *mapping,
unsigned from, unsigned to) unsigned from, unsigned to)
{ {
struct inode *dir = mapping->host; struct inode *dir = mapping->host;
struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb); struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb);
...@@ -119,8 +119,8 @@ static int nilfs_commit_chunk(struct page *page, ...@@ -119,8 +119,8 @@ static int nilfs_commit_chunk(struct page *page,
if (IS_DIRSYNC(dir)) if (IS_DIRSYNC(dir))
nilfs_set_transaction_flag(NILFS_TI_SYNC); nilfs_set_transaction_flag(NILFS_TI_SYNC);
err = nilfs_set_file_dirty(sbi, dir, nr_dirty); err = nilfs_set_file_dirty(sbi, dir, nr_dirty);
WARN_ON(err); /* do not happen */
unlock_page(page); unlock_page(page);
return err;
} }
static void nilfs_check_page(struct page *page) 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,7 +455,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de,
BUG_ON(err); BUG_ON(err);
de->inode = cpu_to_le64(inode->i_ino); de->inode = cpu_to_le64(inode->i_ino);
nilfs_set_de_type(de, inode); nilfs_set_de_type(de, inode);
err = nilfs_commit_chunk(page, mapping, from, to); nilfs_commit_chunk(page, mapping, from, to);
nilfs_put_page(page); nilfs_put_page(page);
dir->i_mtime = dir->i_ctime = CURRENT_TIME; dir->i_mtime = dir->i_ctime = CURRENT_TIME;
/* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
...@@ -547,7 +547,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode) ...@@ -547,7 +547,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)
memcpy(de->name, name, namelen); memcpy(de->name, name, namelen);
de->inode = cpu_to_le64(inode->i_ino); de->inode = cpu_to_le64(inode->i_ino);
nilfs_set_de_type(de, inode); nilfs_set_de_type(de, inode);
err = nilfs_commit_chunk(page, page->mapping, from, to); nilfs_commit_chunk(page, page->mapping, from, to);
dir->i_mtime = dir->i_ctime = CURRENT_TIME; dir->i_mtime = dir->i_ctime = CURRENT_TIME;
/* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
mark_inode_dirty(dir); mark_inode_dirty(dir);
...@@ -594,7 +594,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) ...@@ -594,7 +594,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page)
if (pde) if (pde)
pde->rec_len = cpu_to_le16(to - from); pde->rec_len = cpu_to_le16(to - from);
dir->inode = 0; dir->inode = 0;
err = nilfs_commit_chunk(page, mapping, from, to); nilfs_commit_chunk(page, mapping, from, to);
inode->i_ctime = inode->i_mtime = CURRENT_TIME; inode->i_ctime = inode->i_mtime = CURRENT_TIME;
/* NILFS_I(inode)->i_flags &= ~NILFS_BTREE_FL; */ /* NILFS_I(inode)->i_flags &= ~NILFS_BTREE_FL; */
mark_inode_dirty(inode); mark_inode_dirty(inode);
...@@ -639,7 +639,7 @@ int nilfs_make_empty(struct inode *inode, struct inode *parent) ...@@ -639,7 +639,7 @@ int nilfs_make_empty(struct inode *inode, struct inode *parent)
memcpy(de->name, "..\0", 4); memcpy(de->name, "..\0", 4);
nilfs_set_de_type(de, inode); nilfs_set_de_type(de, inode);
kunmap_atomic(kaddr, KM_USER0); kunmap_atomic(kaddr, KM_USER0);
err = nilfs_commit_chunk(page, mapping, 0, chunk_size); nilfs_commit_chunk(page, mapping, 0, chunk_size);
fail: fail:
page_cache_release(page); page_cache_release(page);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment