xfs
[Top] [All Lists]

Re: [PATCH 01/10] XFS: split out two helpers from xfs_syncsub

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 01/10] XFS: split out two helpers from xfs_syncsub
From: "Josef 'Jeff' Sipek" <jeffpc@xxxxxxxxxxxxxx>
Date: Sat, 13 Sep 2008 12:53:41 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1221314230-28618-2-git-send-email-david@xxxxxxxxxxxxx>
References: <1221314230-28618-1-git-send-email-david@xxxxxxxxxxxxx> <1221314230-28618-2-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Sat, Sep 13, 2008 at 11:57:01PM +1000, Dave Chinner wrote:
...
> diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
> index 53d85ec..59da332 100644
> --- a/fs/xfs/linux-2.6/xfs_sync.c
> +++ b/fs/xfs/linux-2.6/xfs_sync.c
> @@ -315,6 +315,93 @@ xfs_sync_inodes(
>       return XFS_ERROR(last_error);
>  }
>  
> +STATIC int
> +xfs_commit_dummy_trans(
> +     struct xfs_mount        *mp,
> +     uint                    log_flags)
> +{
> +     struct xfs_inode        *ip = mp->m_rootip;
> +     struct xfs_trans        *tp;
> +     int                     error;
> +
> +     /*
> +      * Put a dummy transaction in the log to tell recovery
> +      * that all others are OK.
> +      */
> +     tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1);
> +     error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0);
> +     if (error) {
> +             xfs_trans_cancel(tp, 0);
> +             return error;
> +     }
> +
> +     xfs_ilock(ip, XFS_ILOCK_EXCL);
> +
> +     xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
> +     xfs_trans_ihold(tp, ip);
> +     xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
> +     /* XXX(hch): ignoring the error here.. */

Why? Was this supposed to be ignored in the final version of these patches?

> +     error = xfs_trans_commit(tp, 0);
> +
> +     xfs_iunlock(ip, XFS_ILOCK_EXCL);
> +
> +     xfs_log_force(mp, 0, log_flags);
> +     return 0;
> +}

Josef 'Jeff' Sipek.

-- 
UNIX is user-friendly ... it's just selective about who its friends are

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