Skip to contentSkip to conversation

write_inode_now in ocfs2_cleanup_delete_inode

DISCUSSION Christoph Hellwig 3 participants 3 messages Nov 7, 2011 – Nov 17, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

It seems like that function only uses write_inode_now to write out file data. Any chance you could switch to simply using filemap_write_and_wait here?

reviewer
#1 lore raw
Quoted 3 lines · Christoph Hellwig

It seems like that function only uses write_inode_now to write out file data. Any chance you could switch to simply using filemap_write_and_wait here?

Since ocfs2 does not have ->write_inode method, this is clearly fine.
The patch is attached.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
Quoted 1 line

From e26a640bde3a38b8d57c02085219fc5733a8d724 Mon Sep 17 00:00:00 2001

From: Jan Kara <[email protected]>
Date: Tue, 8 Nov 2011 00:11:32 +0100
Subject: [PATCH] ocfs2: Use filemap_write_and_wait() instead of write_inode_now()

Since ocfs2 has no ->write_inode method, there's no point in calling write_inode_now() from ocfs2_cleanup_delete_inode(). Use filemap_write_and_wait() instead. This helps us to cleanup inode writing interfaces...

---
 fs/ocfs2/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/inode.c +1 -1
index a22d2c0..17454a9 100644
@@ -951,7 +951,7 @@ static void ocfs2_cleanup_delete_inode(struct inode *inode,
 	trace_ocfs2_cleanup_delete_inode(
 		(unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data);
 	if (sync_data)
-		write_inode_now(inode, 1);
+		filemap_write_and_wait(inode->i_mapping);
 	truncate_inode_pages(&inode->i_data, 0);
 }
 
Signature · 1 line
1.7.1
maintainer
#2 lore raw
Quoted 7 lines · Jan Kara
Quoted 3 lines · Christoph Hellwig

It seems like that function only uses write_inode_now to write out file data. Any chance you could switch to simply using filemap_write_and_wait here?

Since ocfs2 does not have ->write_inode method, this is clearly fine.
The patch is attached.

Snarfed.

Joel

Quoted 36 lines

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
Quoted 1 line

From e26a640bde3a38b8d57c02085219fc5733a8d724 Mon Sep 17 00:00:00 2001

From: Jan Kara <[email protected]>
Date: Tue, 8 Nov 2011 00:11:32 +0100
Subject: [PATCH] ocfs2: Use filemap_write_and_wait() instead of write_inode_now()

Since ocfs2 has no ->write_inode method, there's no point in calling write_inode_now() from ocfs2_cleanup_delete_inode(). Use filemap_write_and_wait() instead. This helps us to cleanup inode writing interfaces...

---
 fs/ocfs2/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/inode.c +1 -1
index a22d2c0..17454a9 100644
@@ -951,7 +951,7 @@ static void ocfs2_cleanup_delete_inode(struct inode *inode,
 	trace_ocfs2_cleanup_delete_inode(
 		(unsigned long long)OCFS2_I(inode)->ip_blkno, sync_data);
 	if (sync_data)
-		write_inode_now(inode, 1);
+		filemap_write_and_wait(inode->i_mapping);
 	truncate_inode_pages(&inode->i_data, 0);
 }
 
Signature · 1 line
1.7.1
Signature · 5 lines
"Get right to the heart of matters.
 It's the heart that matters more."

			http://www.jlbec.org/
			[email protected]