linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] fs/block_dev.c: need not to check inode->i_bdev in bd_forget()
@ 2012-09-26 11:38 Yan Hong
  2012-09-26 11:38 ` [PATCH 2/3] fs/debugsfs: get rid of unnecessary inode->i_private initialization Yan Hong
  2012-09-26 11:38 ` [PATCH 3/3] fs/fs-writeback.c: remove unneccesary parameter of __writeback_single_inode() Yan Hong
  0 siblings, 2 replies; 4+ messages in thread
From: Yan Hong @ 2012-09-26 11:38 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel, linux-kernel

Its only caller evict() has promised a non-NULL inode->i_bdev.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
 fs/block_dev.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 38e721b..9bdbd9b 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -669,11 +669,9 @@ void bd_forget(struct inode *inode)
 	struct block_device *bdev = NULL;
 
 	spin_lock(&bdev_lock);
-	if (inode->i_bdev) {
-		if (!sb_is_blkdev_sb(inode->i_sb))
-			bdev = inode->i_bdev;
-		__bd_forget(inode);
-	}
+	if (!sb_is_blkdev_sb(inode->i_sb))
+		bdev = inode->i_bdev;
+	__bd_forget(inode);
 	spin_unlock(&bdev_lock);
 
 	if (bdev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] fs/debugsfs: get rid of unnecessary inode->i_private initialization
  2012-09-26 11:38 [PATCH 1/3] fs/block_dev.c: need not to check inode->i_bdev in bd_forget() Yan Hong
@ 2012-09-26 11:38 ` Yan Hong
  2012-09-26 11:38 ` [PATCH 3/3] fs/fs-writeback.c: remove unneccesary parameter of __writeback_single_inode() Yan Hong
  1 sibling, 0 replies; 4+ messages in thread
From: Yan Hong @ 2012-09-26 11:38 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel, linux-kernel

inode->i_private is promised to be NULL on allocation, no need to set
it explicitly.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
 fs/debugfs/inode.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 4733eab..de2698d 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -59,7 +59,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb, umode_t mode, dev
 		case S_IFDIR:
 			inode->i_op = &simple_dir_inode_operations;
 			inode->i_fop = &simple_dir_operations;
-			inode->i_private = NULL;
 
 			/* directory inodes start off with i_nlink == 2
 			 * (for "." entry) */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] fs/fs-writeback.c: remove unneccesary parameter of __writeback_single_inode()
  2012-09-26 11:38 [PATCH 1/3] fs/block_dev.c: need not to check inode->i_bdev in bd_forget() Yan Hong
  2012-09-26 11:38 ` [PATCH 2/3] fs/debugsfs: get rid of unnecessary inode->i_private initialization Yan Hong
@ 2012-09-26 11:38 ` Yan Hong
  2012-09-26 12:51   ` Fengguang Wu
  1 sibling, 1 reply; 4+ messages in thread
From: Yan Hong @ 2012-09-26 11:38 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel, linux-kernel, Wu Fengguang

The parameter 'wb' is never used in this function.

Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
 fs/fs-writeback.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index be3efc4..da746e8 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -438,8 +438,7 @@ static void requeue_inode(struct inode *inode, struct bdi_writeback *wb,
  * setting I_SYNC flag and calling inode_sync_complete() to clear it.
  */
 static int
-__writeback_single_inode(struct inode *inode, struct bdi_writeback *wb,
-			 struct writeback_control *wbc)
+__writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
 {
 	struct address_space *mapping = inode->i_mapping;
 	long nr_to_write = wbc->nr_to_write;
@@ -526,7 +525,7 @@ writeback_single_inode(struct inode *inode, struct bdi_writeback *wb,
 	inode->i_state |= I_SYNC;
 	spin_unlock(&inode->i_lock);
 
-	ret = __writeback_single_inode(inode, wb, wbc);
+	ret = __writeback_single_inode(inode, wbc);
 
 	spin_lock(&wb->list_lock);
 	spin_lock(&inode->i_lock);
@@ -673,7 +672,7 @@ static long writeback_sb_inodes(struct super_block *sb,
 		 * We use I_SYNC to pin the inode in memory. While it is set
 		 * evict_inode() will wait so the inode cannot be freed.
 		 */
-		__writeback_single_inode(inode, wb, &wbc);
+		__writeback_single_inode(inode, &wbc);
 
 		work->nr_pages -= write_chunk - wbc.nr_to_write;
 		wrote += write_chunk - wbc.nr_to_write;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] fs/fs-writeback.c: remove unneccesary parameter of __writeback_single_inode()
  2012-09-26 11:38 ` [PATCH 3/3] fs/fs-writeback.c: remove unneccesary parameter of __writeback_single_inode() Yan Hong
@ 2012-09-26 12:51   ` Fengguang Wu
  0 siblings, 0 replies; 4+ messages in thread
From: Fengguang Wu @ 2012-09-26 12:51 UTC (permalink / raw)
  To: Yan Hong; +Cc: akpm, linux-fsdevel, linux-kernel

On Wed, Sep 26, 2012 at 07:38:30PM +0800, Yan Hong wrote:
> The parameter 'wb' is never used in this function.

Good spot!

Acked-by: Fengguang Wu <fengguang.wu@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-26 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-26 11:38 [PATCH 1/3] fs/block_dev.c: need not to check inode->i_bdev in bd_forget() Yan Hong
2012-09-26 11:38 ` [PATCH 2/3] fs/debugsfs: get rid of unnecessary inode->i_private initialization Yan Hong
2012-09-26 11:38 ` [PATCH 3/3] fs/fs-writeback.c: remove unneccesary parameter of __writeback_single_inode() Yan Hong
2012-09-26 12:51   ` Fengguang Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).