2012-08-25 08:24:55

by Namjae Jeon

[permalink] [raw]
Subject: [PATCH 3/3] fat: simplify writeback_inode function.

Simplify writeback_inode function.

Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Amit Sahrawat <[email protected]>
---
fs/fat/inode.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 973296b..4bbb24e 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1457,18 +1457,14 @@ static int writeback_inode(struct inode *inode)
{

int ret;
- struct address_space *mapping = inode->i_mapping;
- struct writeback_control wbc = {
- .sync_mode = WB_SYNC_NONE,
- .nr_to_write = 0,
- };
- /* if we used WB_SYNC_ALL, sync_inode waits for the io for the
- * inode to finish. So WB_SYNC_NONE is sent down to sync_inode
+
+ /* if we used wait=1, sync_inode_metadata waits for the io for the
+ * inode to finish. So wait=0 is sent down to sync_inode_metadata
* and filemap_fdatawrite is used for the data blocks
*/
- ret = sync_inode(inode, &wbc);
+ ret = sync_inode_metadata(inode, 0);
if (!ret)
- ret = filemap_fdatawrite(mapping);
+ ret = filemap_fdatawrite(inode->i_mapping);
return ret;
}

--
1.7.9.5


2012-08-26 14:05:46

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [PATCH 3/3] fat: simplify writeback_inode function.

Namjae Jeon <[email protected]> writes:

> Simplify writeback_inode function.

Looks cleanup without logic change.

Acked-by: OGAWA Hirofumi <[email protected]>

> Signed-off-by: Namjae Jeon <[email protected]>
> Signed-off-by: Amit Sahrawat <[email protected]>
> ---
> fs/fat/inode.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 973296b..4bbb24e 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1457,18 +1457,14 @@ static int writeback_inode(struct inode *inode)
> {
>
> int ret;
> - struct address_space *mapping = inode->i_mapping;
> - struct writeback_control wbc = {
> - .sync_mode = WB_SYNC_NONE,
> - .nr_to_write = 0,
> - };
> - /* if we used WB_SYNC_ALL, sync_inode waits for the io for the
> - * inode to finish. So WB_SYNC_NONE is sent down to sync_inode
> +
> + /* if we used wait=1, sync_inode_metadata waits for the io for the
> + * inode to finish. So wait=0 is sent down to sync_inode_metadata
> * and filemap_fdatawrite is used for the data blocks
> */
> - ret = sync_inode(inode, &wbc);
> + ret = sync_inode_metadata(inode, 0);
> if (!ret)
> - ret = filemap_fdatawrite(mapping);
> + ret = filemap_fdatawrite(inode->i_mapping);
> return ret;
> }

--
OGAWA Hirofumi <[email protected]>