xfs
[Top] [All Lists]

Re: [PATCH 3/5] xfs: convert ENOSPC inode flushing to use new syncd work

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/5] xfs: convert ENOSPC inode flushing to use new syncd workqueue
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 3 Mar 2011 10:34:10 -0500
Cc: xfs@xxxxxxxxxxx, chris.mason@xxxxxxxxxx
In-reply-to: <1298412969-14389-4-git-send-email-david@xxxxxxxxxxxxx>
References: <1298412969-14389-1-git-send-email-david@xxxxxxxxxxxxx> <1298412969-14389-4-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
I still don't see any point in having the ENOSPC flushing moved to a
different context.

Just add a mutex and flush inline, e.g.

void
xfs_flush_inodes(
        struct xfs_inode        *ip)
{
        struct xfs_mount        *mp = ip->i_mount;

        if (!mutex_trylock(&xfs_syncd_lock))
                return;         /* someone else is flushing right now */
        xfs_sync_data(mp, SYNC_TRYLOCK);
        xfs_sync_data(mp, SYNC_TRYLOCK | SYNC_WAIT);
        xfs_log_force(mp, XFS_LOG_SYNC);
        mutex_unlock(&xfs_syncd_lock);
}

<Prev in Thread] Current Thread [Next in Thread>