*     calculate new value of i_nextsync which determines when
  *     this code is called again.
  *
- *     this is called only from lmLog().
- *
- * PARAMETER:  ip      - pointer to logs inode.
+ * PARAMETERS: log     - log structure
+ *             nosyncwait - 1 if called asynchronously
  *
  * RETURN:     0
  *                     
        return lsn;
 }
 
+/*
+ * NAME:       jfs_syncpt
+ *
+ * FUNCTION:   write log SYNCPT record for specified log
+ *
+ * PARAMETERS: log     - log structure
+ */
+void jfs_syncpt(struct jfs_log *log)
+{      LOG_LOCK(log);
+       lmLogSync(log, 1);
+       LOG_UNLOCK(log);
+}
 
 /*
  * NAME:       lmLogOpen()
 
 extern int lmLogInit(struct jfs_log * log);
 extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize);
 extern void jfs_flush_journal(struct jfs_log * log, int wait);
+extern void jfs_syncpt(struct jfs_log *log);
 
 #endif                         /* _H_JFS_LOGMGR */
 
                 * synchronize with logsync barrier
                 */
                if (test_bit(log_SYNCBARRIER, &log->flag)) {
-                       /* forward log syncpt */
-                       /* lmSync(log); */
-
                        jfs_info("log barrier off: 0x%x", log->lsn);
 
                        /* enable new transactions start */
 
                        /* wakeup all waitors for logsync barrier */
                        TXN_WAKEUP(&log->syncwait);
+
+                       TXN_UNLOCK();
+
+                       /* forward log syncpt */
+                       jfs_syncpt(log);
+
+                       goto wakeup;
                }
        }
 
+       TXN_UNLOCK();
+wakeup:
        /*
         * wakeup all waitors for a free tblock
         */
        TXN_WAKEUP(&TxAnchor.freewait);
-
-       TXN_UNLOCK();
 }
 
 
 
        struct jfs_log *log = JFS_SBI(sb)->log;
 
        /* log == NULL indicates read-only mount */
-       if (log)
+       if (log) {
                jfs_flush_journal(log, wait);
+               jfs_syncpt(log);
+       }
 
        return 0;
 }