--- initial
+++ final
@@ -1,126 +1,126 @@
 static int ubifs_remount_rw(struct ubifs_info *c) {
   int err, lnum;
   if (c->rw_incompat) {
     ubifs_err(c, "the file-system is not R/W-compatible");
     ubifs_msg(c, "on-flash format version is w%d/r%d, but software only supports up to version w%d/r%d", c->fmt_version, c->ro_compat_version, UBIFS_FORMAT_VERSION, UBIFS_RO_COMPAT_VERSION);
     return -EROFS;
   }
   mutex_lock(&c->umount_mutex);
   dbg_save_space_info(c);
   c->remounting_rw = 1;
   c->ro_mount = 0;
   if (c->space_fixup) {
     err = ubifs_fixup_free_space(c);
     if (err) goto out;
   }
   err = check_free_space(c);
   if (err) goto out;
   if (c->old_leb_cnt != c->leb_cnt) {
     struct ubifs_sb_node *sup;
     sup = ubifs_read_sb_node(c);
     if (IS_ERR(sup)) {
       err = PTR_ERR(sup);
       goto out;
     }
     sup->leb_cnt = cpu_to_le32(c->leb_cnt);
     err = ubifs_write_sb_node(c, sup);
     kfree(sup);
     if (err) goto out;
   }
   if (c->need_recovery) {
     ubifs_msg(c, "completing deferred recovery");
     err = ubifs_write_rcvrd_mst_node(c);
     if (err) goto out;
     err = ubifs_recover_size(c);
     if (err) goto out;
     err = ubifs_clean_lebs(c, c->sbuf);
     if (err) goto out;
     err = ubifs_recover_inl_heads(c, c->sbuf);
     if (err) goto out;
   } else {
     /* A readonly mount is not allowed to have orphans */
-    ubifs_assert(c->tot_orphans == 0);
+    ubifs_assert(c, c->tot_orphans == 0);
     err = ubifs_clear_orphans(c);
     if (err) goto out;
   }
   if (!(c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY))) {
     c->mst_node->flags |= cpu_to_le32(UBIFS_MST_DIRTY);
     err = ubifs_write_master(c);
     if (err) goto out;
   }
   c->ileb_buf = vmalloc(c->leb_size);
   if (!c->ileb_buf) {
     err = -ENOMEM;
     goto out;
   }
   c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ + UBIFS_CIPHER_BLOCK_SIZE, GFP_KERNEL);
   if (!c->write_reserve_buf) {
     err = -ENOMEM;
     goto out;
   }
   err = ubifs_lpt_init(c, 0, 1);
   if (err) goto out;
   /* Create background thread */
   c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name);
   if (IS_ERR(c->bgt)) {
     err = PTR_ERR(c->bgt);
     c->bgt = NULL;
     ubifs_err(c, "cannot spawn \"%s\", error %d", c->bgt_name, err);
     goto out;
   }
   wake_up_process(c->bgt);
   c->orph_buf = vmalloc(c->leb_size);
   if (!c->orph_buf) {
     err = -ENOMEM;
     goto out;
   }
   /* Check for enough log space */
   lnum = c->lhead_lnum + 1;
   if (lnum >= UBIFS_LOG_LNUM + c->log_lebs) lnum = UBIFS_LOG_LNUM;
   if (lnum == c->ltail_lnum) {
     err = ubifs_consolidate_log(c);
     if (err) goto out;
   }
   if (c->need_recovery)
     err = ubifs_rcvry_gc_commit(c);
   else
     err = ubifs_leb_unmap(c, c->gc_lnum);
   if (err) goto out;
   dbg_gen("re-mounted read-write");
   c->remounting_rw = 0;
   if (c->need_recovery) {
     c->need_recovery = 0;
     ubifs_msg(c, "deferred recovery completed");
   } else {
     /*
      * Do not run the debugging space check if the were doing
      * recovery, because when we saved the information we had the
      * file-system in a state where the TNC and lprops has been
      * modified in memory, but all the I/O operations (including a
      * commit) were deferred. So the file-system was in
      * "non-committed" state. Now the file-system is in committed
      * state, and of course the amount of free space will change
      * because, for example, the old index size was imprecise.
      */
     err = dbg_check_space_info(c);
   }
   mutex_unlock(&c->umount_mutex);
   return err;
 out:
   c->ro_mount = 1;
   vfree(c->orph_buf);
   c->orph_buf = NULL;
   if (c->bgt) {
     kthread_stop(c->bgt);
     c->bgt = NULL;
   }
   free_wbufs(c);
   kfree(c->write_reserve_buf);
   c->write_reserve_buf = NULL;
   vfree(c->ileb_buf);
   c->ileb_buf = NULL;
   ubifs_lpt_free(c, 1);
   c->remounting_rw = 0;
   mutex_unlock(&c->umount_mutex);
   return err;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}