Re: [PATCH 1/7] xfs: split inode data writeback from xfs_sync_inodes_ag

Sujit Karataparambil
2009-05-15T04:49:05Z

> +STATIC int
> +xfs_sync_inode_data(
> +       struct xfs_inode        *ip,
> +       int                     flags)
> +{
> +       struct inode    *inode = VFS_I(ip);
> +       struct address_space *mapping = inode->i_mapping;
> +       int             error = 0;
> +
> +       if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
> +               if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) {
> +                       if (flags & SYNC_TRYLOCK)
> +                               goto out_wait;
> +                       xfs_ilock(ip, XFS_IOLOCK_SHARED);
> +               }
> +
> +               error = xfs_flush_pages(ip, 0, -1, (flags & SYNC_WAIT) ?
> +                                       0 : XFS_B_ASYNC, FI_NONE);
> +               xfs_iunlock(ip, XFS_IOLOCK_SHARED);
> +       }
> +
> + out_wait:
> +       if (flags & SYNC_IOWAIT)
> +               xfs_ioend_wait(ip);
> +       return error;
> +}
> +
should not there be an.

error = xfs_flush_pages(ip, 0, -1, (flags & SYNC_WAIT) ?
0 : XFS_B_ASYNC, FI_NONE);

for the out_wait. This will ensure flush while the xfs_ioend_wait is being
waited for. Would this be an better way to flush the data than waiting for
the inode to be flushed during power off or scheduler cycles.
Would this be an performance hit.

or better use

error = xfs_sync_inode_data(ip, flags);

--
-- Sujit K M