xfs: convert xfs_log_commit_cil() to void
authorJie Liu <jeff.liu@oracle.com>
Fri, 7 Feb 2014 04:26:07 +0000 (15:26 +1100)
committerDave Chinner <david@fromorbit.com>
Fri, 7 Feb 2014 04:26:07 +0000 (15:26 +1100)
Convert xfs_log_commit_cil() to a void function since it return nothing
but 0 in any case, after that we can simplify the relative code logic
in xfs_trans_commit() accordingly.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_log.h
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_trans.c

index b0f4ef77fa70bd698749e2509e64d79f782fa8aa..2c4004475e71af25dbfa4a6e853af5cfd09bac75 100644 (file)
@@ -175,7 +175,7 @@ void          xlog_iodone(struct xfs_buf *);
 struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket);
 void     xfs_log_ticket_put(struct xlog_ticket *ticket);
 
-int    xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp,
+void   xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp,
                                xfs_lsn_t *commit_lsn, int flags);
 bool   xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
 
index cdebd832c3dba1fcd937869d1cedcebe09113c25..f034cbd958e48f454c880db6138c60e1253f9154 100644 (file)
@@ -710,7 +710,7 @@ xlog_cil_empty(
  * background commit, returns without it held once background commits are
  * allowed again.
  */
-int
+void
 xfs_log_commit_cil(
        struct xfs_mount        *mp,
        struct xfs_trans        *tp,
@@ -756,7 +756,6 @@ xfs_log_commit_cil(
        xlog_cil_push_background(log);
 
        up_read(&cil->xc_ctx_lock);
-       return 0;
 }
 
 /*
index c812c5c060de1caa7532f1cdcc63766a4a227207..54a57326d85b1e7b2fc84b5761773453a6c02eaf 100644 (file)
@@ -887,12 +887,7 @@ xfs_trans_commit(
                xfs_trans_apply_sb_deltas(tp);
        xfs_trans_apply_dquot_deltas(tp);
 
-       error = xfs_log_commit_cil(mp, tp, &commit_lsn, flags);
-       if (error == ENOMEM) {
-               xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR);
-               error = XFS_ERROR(EIO);
-               goto out_unreserve;
-       }
+       xfs_log_commit_cil(mp, tp, &commit_lsn, flags);
 
        current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
        xfs_trans_free(tp);
@@ -902,10 +897,7 @@ xfs_trans_commit(
         * log out now and wait for it.
         */
        if (sync) {
-               if (!error) {
-                       error = _xfs_log_force_lsn(mp, commit_lsn,
-                                     XFS_LOG_SYNC, NULL);
-               }
+               error = _xfs_log_force_lsn(mp, commit_lsn, XFS_LOG_SYNC, NULL);
                XFS_STATS_INC(xs_trans_sync);
        } else {
                XFS_STATS_INC(xs_trans_async);