* write_inode_now in ocfs2_cleanup_delete_inode
@ 2011-11-07 10:49 Christoph Hellwig
2011-11-07 23:20 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2011-11-07 10:49 UTC (permalink / raw)
To: mfasheh, jlbec; +Cc: linux-fsdevel
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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: write_inode_now in ocfs2_cleanup_delete_inode
2011-11-07 10:49 write_inode_now in ocfs2_cleanup_delete_inode Christoph Hellwig
@ 2011-11-07 23:20 ` Jan Kara
2011-11-17 10:20 ` Joel Becker
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2011-11-07 23:20 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: mfasheh, jlbec, linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
On Mon 07-11-11 05:49:01, Christoph Hellwig wrote:
> 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
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
[-- Attachment #2: 0001-ocfs2-Use-filemap_write_and_wait-instead-of-write_in.patch --]
[-- Type: text/x-patch, Size: 1012 bytes --]
>From e26a640bde3a38b8d57c02085219fc5733a8d724 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
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...
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ocfs2/inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index a22d2c0..17454a9 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -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);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: write_inode_now in ocfs2_cleanup_delete_inode
2011-11-07 23:20 ` Jan Kara
@ 2011-11-17 10:20 ` Joel Becker
0 siblings, 0 replies; 3+ messages in thread
From: Joel Becker @ 2011-11-17 10:20 UTC (permalink / raw)
To: Jan Kara; +Cc: Christoph Hellwig, mfasheh, linux-fsdevel
On Tue, Nov 08, 2011 at 12:20:39AM +0100, Jan Kara wrote:
> On Mon 07-11-11 05:49:01, Christoph Hellwig wrote:
> > 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
> Honza
> --
> Jan Kara <jack@suse.cz>
> SUSE Labs, CR
> >From e26a640bde3a38b8d57c02085219fc5733a8d724 Mon Sep 17 00:00:00 2001
> From: Jan Kara <jack@suse.cz>
> 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...
>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
> fs/ocfs2/inode.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index a22d2c0..17454a9 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -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);
> }
>
> --
> 1.7.1
>
--
"Get right to the heart of matters.
It's the heart that matters more."
http://www.jlbec.org/
jlbec@evilplan.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-17 10:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 10:49 write_inode_now in ocfs2_cleanup_delete_inode Christoph Hellwig
2011-11-07 23:20 ` Jan Kara
2011-11-17 10:20 ` Joel Becker
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).