All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
To: users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org
Cc: Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>,
	Ryusuke Konishi
	<konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
Subject: [PATCH 6/9] nilfs2: change return type of nilfs_commit_chunk
Date: Fri, 27 Nov 2009 16:02:01 +0900	[thread overview]
Message-ID: <1259305324-28050-7-git-send-email-jir@unicus.jp> (raw)
In-Reply-To: <1259305324-28050-1-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>

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-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
---
 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 4f3fa00..173530d 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -99,9 +99,9 @@ static int nilfs_prepare_chunk(struct page *page,
 				 NULL, nilfs_get_block);
 }
 
-static int nilfs_commit_chunk(struct page *page,
-			      struct address_space *mapping,
-			      unsigned from, unsigned to)
+static void nilfs_commit_chunk(struct page *page,
+			       struct address_space *mapping,
+			       unsigned from, unsigned to)
 {
 	struct inode *dir = mapping->host;
 	struct nilfs_sb_info *sbi = NILFS_SB(dir->i_sb);
@@ -119,8 +119,8 @@ static int nilfs_commit_chunk(struct page *page,
 	if (IS_DIRSYNC(dir))
 		nilfs_set_transaction_flag(NILFS_TI_SYNC);
 	err = nilfs_set_file_dirty(sbi, dir, nr_dirty);
+	WARN_ON(err); /* do not happen */
 	unlock_page(page);
-	return err;
 }
 
 static void nilfs_check_page(struct page *page)
@@ -455,7 +455,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de,
 	BUG_ON(err);
 	de->inode = cpu_to_le64(inode->i_ino);
 	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);
 	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 /*	NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
@@ -547,7 +547,7 @@ got_it:
 	memcpy(de->name, name, namelen);
 	de->inode = cpu_to_le64(inode->i_ino);
 	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;
 /*	NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
 	mark_inode_dirty(dir);
@@ -594,7 +594,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page)
 	if (pde)
 		pde->rec_len = cpu_to_le16(to - from);
 	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;
 /*	NILFS_I(inode)->i_flags &= ~NILFS_BTREE_FL; */
 	mark_inode_dirty(inode);
@@ -639,7 +639,7 @@ int nilfs_make_empty(struct inode *inode, struct inode *parent)
 	memcpy(de->name, "..\0", 4);
 	nilfs_set_de_type(de, inode);
 	kunmap_atomic(kaddr, KM_USER0);
-	err = nilfs_commit_chunk(page, mapping, 0, chunk_size);
+	nilfs_commit_chunk(page, mapping, 0, chunk_size);
 fail:
 	page_cache_release(page);
 	return err;
-- 
1.5.6.5

  parent reply	other threads:[~2009-11-27  7:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-27  7:01 [PATCH 0/9] nilfs2: reduce redandunt mark_inode_dirty calls Jiro SEKIBA
     [not found] ` <1259305324-28050-1-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-11-27  7:01   ` [PATCH 1/9] nilfs2: delete mark_inode_dirty in nilfs_new_inode Jiro SEKIBA
2009-11-27  7:01   ` [PATCH 2/9] nilfs2: delete mark_inode_dirty in nilfs_set_link Jiro SEKIBA
2009-11-27  7:01   ` [PATCH 3/9] nilfs2: expand inode_inc_link_count and inode_dec_link_count Jiro SEKIBA
2009-11-27  7:01   ` [PATCH 4/9] nilfs2: delete redundant mark_inode_dirty Jiro SEKIBA
     [not found]     ` <1259305324-28050-5-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-11-27 10:13       ` Ryusuke Konishi
2009-11-27  7:02   ` [PATCH 5/9] nilfs2: split nilfs_unlink as nilfs_do_unlink and nilfs_unlink Jiro SEKIBA
2009-11-27  7:02   ` Jiro SEKIBA [this message]
2009-11-27  7:02   ` [PATCH 7/9] nilfs2: delete mark_inode_dirty in nilfs_commit_chunk Jiro SEKIBA
2009-11-27  7:02   ` [PATCH 8/9] nilfs2: delete mark_inode_dirty in nilfs_delete_entry Jiro SEKIBA
     [not found]     ` <1259305324-28050-9-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-11-27  9:38       ` Ryusuke Konishi
2009-11-27  7:02   ` [PATCH 9/9] nilfs2: replace mark_inode_dirty as nilfs_mark_inode_dirty Jiro SEKIBA
2009-11-27  8:10   ` [PATCH 0/9] nilfs2: reduce redandunt mark_inode_dirty calls Ryusuke Konishi
     [not found]     ` <20091127.171048.94127793.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-11-27  9:30       ` Ryusuke Konishi
     [not found]         ` <20091127.183015.04646931.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-11-27 10:31           ` Jiro SEKIBA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1259305324-28050-7-git-send-email-jir@unicus.jp \
    --to=jir-hfpbi5wx9j54eiagz67ipq@public.gmane.org \
    --cc=konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org \
    --cc=users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.