Skip to contentSkip to conversation

vfs: del redundant BH_new flag on unrelated buffer heads.

RFC In review chishanmingshen 2 participants 2 messages Jun 5, 2014 – Jun 23, 2014 VFS

lore
Share & tools
lore
#0 lore raw

RFC 1/1 vfs: del redundant BH_new flag on unrelated buffer heads.

Just skip the unrelated buffer heads when clear buffer head's BH_new flag. This patch is *untested*.

---
 fs/buffer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/buffer.c +1 -1
index 9ddb9fc..a28a1a1 100644
@@ -1987,8 +1987,8 @@ static int __block_commit_write(struct inode *inode, struct page *page,
 		} else {
 			set_buffer_uptodate(bh);
 			mark_buffer_dirty(bh);
+			clear_buffer_new(bh);
 		}
-		clear_buffer_new(bh);
 
 		block_start = block_end;
 		bh = bh->b_this_page;
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · chishanmingshen

Date: Thu, 5 Jun 2014 19:55:09 +0800
From: chishanmingshen <[email protected]>
To: Alexander Viro <[email protected]>
Cc: [email protected], chishanmingshen <[email protected]>
Subject: [RFC 1/1] vfs: del redundant BH_new flag on unrelated buffer heads.

Just skip the unrelated buffer heads when clear buffer head's BH_new flag.

I can see that from the code, but can you explain why in the commit description ?

Thanks!
-Lukas

Quoted 22 lines

This patch is *untested*.

---
 fs/buffer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/buffer.c +1 -1
index 9ddb9fc..a28a1a1 100644
@@ -1987,8 +1987,8 @@ static int __block_commit_write(struct inode *inode, struct page *page,
 		} else {
 			set_buffer_uptodate(bh);
 			mark_buffer_dirty(bh);
+			clear_buffer_new(bh);
 		}
-		clear_buffer_new(bh);
 
 		block_start = block_end;
 		bh = bh->b_this_page;