yaffs Added more tests to direct/timothy_tests/mirror_tests
[yaffs2.git] / yaffs_yaffs2.c
index 97dac454f34cf3b8ed4649eae8e8f56a1d2b3e52..33397af7003d1fd6249cf7769a5e7683c594e431 100644 (file)
@@ -186,10 +186,9 @@ u32 yaffs2_find_refresh_block(struct yaffs_dev * dev)
        }
 
        if (oldest > 0) {
-               T(YAFFS_TRACE_GC,
-                 (TSTR
-                  ("GC refresh count %d selected block %d with seq_number %d"
-                   TENDSTR), dev->refresh_count, oldest, oldest_seq));
+               yaffs_trace(YAFFS_TRACE_GC,
+                       "GC refresh count %d selected block %d with seq_number %d",
+                       dev->refresh_count, oldest, oldest_seq);
        }
 
        return oldest;
@@ -402,12 +401,10 @@ static int taffs2_checkpt_obj_to_obj(struct yaffs_obj *obj,
        struct yaffs_obj *parent;
 
        if (obj->variant_type != cp->variant_type) {
-               T(YAFFS_TRACE_ERROR, (TSTR("Checkpoint read object %d type %d "
-                                          TCONT
-                                          ("chunk %d does not match existing object type %d")
-                                          TENDSTR), cp->obj_id,
-                                     cp->variant_type, cp->hdr_chunk,
-                                     obj->variant_type));
+               yaffs_trace(YAFFS_TRACE_ERROR,
+                       "Checkpoint read object %d type %d chunk %d does not match existing object type %d",
+                       cp->obj_id, cp->variant_type, cp->hdr_chunk,
+                       obj->variant_type);
                return 0;
        }
 
@@ -422,13 +419,11 @@ static int taffs2_checkpt_obj_to_obj(struct yaffs_obj *obj,
 
        if (parent) {
                if (parent->variant_type != YAFFS_OBJECT_TYPE_DIRECTORY) {
-                       T(YAFFS_TRACE_ALWAYS,
-                         (TSTR
-                          ("Checkpoint read object %d parent %d type %d"
-                           TCONT(" chunk %d Parent type, %d, not directory")
-                           TENDSTR), cp->obj_id, cp->parent_id,
-                          cp->variant_type, cp->hdr_chunk,
-                          parent->variant_type));
+                       yaffs_trace(YAFFS_TRACE_ALWAYS,
+                               "Checkpoint read object %d parent %d type %d chunk %d Parent type, %d, not directory",
+                               cp->obj_id, cp->parent_id,
+                               cp->variant_type, cp->hdr_chunk,
+                               parent->variant_type);
                        return 0;
                }
                yaffs_add_obj_to_dir(parent, obj);
@@ -536,8 +531,9 @@ static int yaffs2_rd_checkpt_tnodes(struct yaffs_obj *obj)
                if (tn) {
                        ok = (yaffs2_checkpt_rd(dev, tn, dev->tnode_size) ==
                              dev->tnode_size);
-               } else
+               } else {
                        ok = 0;
+                }
 
                if (tn && ok)
                        ok = yaffs_add_find_tnode_0(dev,
@@ -551,9 +547,9 @@ static int yaffs2_rd_checkpt_tnodes(struct yaffs_obj *obj)
 
        }
 
-       T(YAFFS_TRACE_CHECKPOINT,
-         (TSTR("Checkpoint read tnodes %d records, last %d. ok %d" TENDSTR),
-          nread, base_chunk, ok));
+       yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+               "Checkpoint read tnodes %d records, last %d. ok %d",
+               nread, base_chunk, ok);
 
        return ok ? 1 : 0;
 }
@@ -579,11 +575,10 @@ static int yaffs2_wr_checkpt_objs(struct yaffs_dev *dev)
                                        yaffs2_obj_checkpt_obj(&cp, obj);
                                        cp.struct_type = sizeof(cp);
 
-                                       T(YAFFS_TRACE_CHECKPOINT,
-                                         (TSTR
-                                          ("Checkpoint write object %d parent %d type %d chunk %d obj addr %p"
-                                           TENDSTR), cp.obj_id, cp.parent_id,
-                                          cp.variant_type, cp.hdr_chunk, obj));
+                                       yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                                               "Checkpoint write object %d parent %d type %d chunk %d obj addr %p",
+                                               cp.obj_id, cp.parent_id,
+                                               cp.variant_type, cp.hdr_chunk, obj);
 
                                        ok = (yaffs2_checkpt_wr
                                              (dev, &cp,
@@ -620,21 +615,20 @@ static int yaffs2_rd_checkpt_objs(struct yaffs_dev *dev)
        while (ok && !done) {
                ok = (yaffs2_checkpt_rd(dev, &cp, sizeof(cp)) == sizeof(cp));
                if (cp.struct_type != sizeof(cp)) {
-                       T(YAFFS_TRACE_CHECKPOINT,
-                         (TSTR("struct size %d instead of %d ok %d" TENDSTR),
-                          cp.struct_type, (int)sizeof(cp), ok));
+                       yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                               "struct size %d instead of %d ok %d",
+                               cp.struct_type, (int)sizeof(cp), ok);
                        ok = 0;
                }
 
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR
-                  ("Checkpoint read object %d parent %d type %d chunk %d "
-                   TENDSTR), cp.obj_id, cp.parent_id, cp.variant_type,
-                  cp.hdr_chunk));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "Checkpoint read object %d parent %d type %d chunk %d ",
+                       cp.obj_id, cp.parent_id, cp.variant_type,
+                       cp.hdr_chunk);
 
-               if (ok && cp.obj_id == ~0)
+               if (ok && cp.obj_id == ~0) {
                        done = 1;
-               else if (ok) {
+               else if (ok) {
                        obj =
                            yaffs_find_or_create_by_number(dev, cp.obj_id,
                                                           cp.variant_type);
@@ -650,8 +644,9 @@ static int yaffs2_rd_checkpt_objs(struct yaffs_dev *dev)
                                            (struct list_head *)hard_list;
                                        hard_list = obj;
                                }
-                       } else
+                       } else {
                                ok = 0;
+                        }
                }
        }
 
@@ -702,8 +697,8 @@ static int yaffs2_wr_checkpt_data(struct yaffs_dev *dev)
        int ok = 1;
 
        if (!yaffs2_checkpt_required(dev)) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("skipping checkpoint write" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "skipping checkpoint write");
                ok = 0;
        }
 
@@ -711,23 +706,23 @@ static int yaffs2_wr_checkpt_data(struct yaffs_dev *dev)
                ok = yaffs2_checkpt_open(dev, 1);
 
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("write checkpoint validity" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "write checkpoint validity");
                ok = yaffs2_wr_checkpt_validity_marker(dev, 1);
        }
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("write checkpoint device" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "write checkpoint device");
                ok = yaffs2_wr_checkpt_dev(dev);
        }
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("write checkpoint objects" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "write checkpoint objects");
                ok = yaffs2_wr_checkpt_objs(dev);
        }
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("write checkpoint validity" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "write checkpoint validity");
                ok = yaffs2_wr_checkpt_validity_marker(dev, 0);
        }
 
@@ -753,39 +748,39 @@ static int yaffs2_rd_checkpt_data(struct yaffs_dev *dev)
                ok = 0;
 
        if (ok && dev->param.skip_checkpt_rd) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("skipping checkpoint read" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "skipping checkpoint read");
                ok = 0;
        }
 
        if (ok)
-               ok = yaffs2_checkpt_open(dev, 0);       /* open for read */
+               ok = yaffs2_checkpt_open(dev, 0); /* open for read */
 
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("read checkpoint validity" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "read checkpoint validity");
                ok = yaffs2_rd_checkpt_validity_marker(dev, 1);
        }
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("read checkpoint device" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "read checkpoint device");
                ok = yaffs2_rd_checkpt_dev(dev);
        }
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("read checkpoint objects" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "read checkpoint objects");
                ok = yaffs2_rd_checkpt_objs(dev);
        }
        if (ok) {
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("read checkpoint validity" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "read checkpoint validity");
                ok = yaffs2_rd_checkpt_validity_marker(dev, 0);
        }
 
        if (ok) {
                ok = yaffs2_rd_checkpt_sum(dev);
-               T(YAFFS_TRACE_CHECKPOINT,
-                 (TSTR("read checkpoint checksum %d" TENDSTR), ok));
+               yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+                       "read checkpoint checksum %d", ok);
        }
 
        if (!yaffs_checkpt_close(dev))
@@ -813,9 +808,9 @@ void yaffs2_checkpt_invalidate(struct yaffs_dev *dev)
 int yaffs_checkpoint_save(struct yaffs_dev *dev)
 {
 
-       T(YAFFS_TRACE_CHECKPOINT,
-         (TSTR("save entry: is_checkpointed %d" TENDSTR),
-          dev->is_checkpointed));
+       yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+               "save entry: is_checkpointed %d",
+               dev->is_checkpointed);
 
        yaffs_verify_objects(dev);
        yaffs_verify_blocks(dev);
@@ -826,9 +821,9 @@ int yaffs_checkpoint_save(struct yaffs_dev *dev)
                yaffs2_wr_checkpt_data(dev);
        }
 
-       T(YAFFS_TRACE_ALWAYS,
-         (TSTR("save exit: is_checkpointed %d" TENDSTR),
-          dev->is_checkpointed));
+       yaffs_trace(YAFFS_TRACE_CHECKPOINT | YAFFS_TRACE_MOUNT,
+               "save exit: is_checkpointed %d",
+               dev->is_checkpointed);
 
        return dev->is_checkpointed;
 }
@@ -836,9 +831,9 @@ int yaffs_checkpoint_save(struct yaffs_dev *dev)
 int yaffs2_checkpt_restore(struct yaffs_dev *dev)
 {
        int retval;
-       T(YAFFS_TRACE_CHECKPOINT,
-         (TSTR("restore entry: is_checkpointed %d" TENDSTR),
-          dev->is_checkpointed));
+       yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+               "restore entry: is_checkpointed %d",
+               dev->is_checkpointed);
 
        retval = yaffs2_rd_checkpt_data(dev);
 
@@ -848,9 +843,9 @@ int yaffs2_checkpt_restore(struct yaffs_dev *dev)
                yaffs_verify_free_chunks(dev);
        }
 
-       T(YAFFS_TRACE_CHECKPOINT,
-         (TSTR("restore exit: is_checkpointed %d" TENDSTR),
-          dev->is_checkpointed));
+       yaffs_trace(YAFFS_TRACE_CHECKPOINT,
+               "restore exit: is_checkpointed %d",
+               dev->is_checkpointed);
 
        return retval;
 }
@@ -918,8 +913,9 @@ int yaffs2_handle_hole(struct yaffs_obj *obj, loff_t new_size)
                        if (written == this_write) {
                                pos += this_write;
                                increase -= this_write;
-                       } else
+                       } else {
                                small_increase_ok = 0;
+                        }
                }
 
                yaffs_release_temp_buffer(dev, local_buffer, __LINE__);
@@ -991,26 +987,25 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
        struct yaffs_block_index *block_index = NULL;
        int alt_block_index = 0;
 
-       T(YAFFS_TRACE_SCAN,
-         (TSTR
-          ("yaffs2_scan_backwards starts  intstartblk %d intendblk %d..."
-           TENDSTR), dev->internal_start_block, dev->internal_end_block));
+       yaffs_trace(YAFFS_TRACE_SCAN,
+               "yaffs2_scan_backwards starts  intstartblk %d intendblk %d...",
+               dev->internal_start_block, dev->internal_end_block);
 
        dev->seq_number = YAFFS_LOWEST_SEQUENCE_NUMBER;
 
-       block_index = YMALLOC(n_blocks * sizeof(struct yaffs_block_index));
+       block_index = kmalloc(n_blocks * sizeof(struct yaffs_block_index),
+                       GFP_NOFS);
 
        if (!block_index) {
                block_index =
-                   YMALLOC_ALT(n_blocks * sizeof(struct yaffs_block_index));
+                   vmalloc(n_blocks * sizeof(struct yaffs_block_index));
                alt_block_index = 1;
        }
 
        if (!block_index) {
-               T(YAFFS_TRACE_SCAN,
-                 (TSTR
-                  ("yaffs2_scan_backwards() could not allocate block index!"
-                   TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_SCAN,
+                       "yaffs2_scan_backwards() could not allocate block index!"
+                       );
                return YAFFS_FAIL;
        }
 
@@ -1036,19 +1031,18 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                if (bi->seq_number == YAFFS_SEQUENCE_BAD_BLOCK)
                        bi->block_state = state = YAFFS_BLOCK_STATE_DEAD;
 
-               T(YAFFS_TRACE_SCAN_DEBUG,
-                 (TSTR("Block scanning block %d state %d seq %d" TENDSTR), blk,
-                  state, seq_number));
+               yaffs_trace(YAFFS_TRACE_SCAN_DEBUG,
+                       "Block scanning block %d state %d seq %d",
+                       blk, state, seq_number);
 
                if (state == YAFFS_BLOCK_STATE_CHECKPOINT) {
                        dev->blocks_in_checkpt++;
 
                } else if (state == YAFFS_BLOCK_STATE_DEAD) {
-                       T(YAFFS_TRACE_BAD_BLOCKS,
-                         (TSTR("block %d is bad" TENDSTR), blk));
+                       yaffs_trace(YAFFS_TRACE_BAD_BLOCKS,
+                               "block %d is bad", blk);
                } else if (state == YAFFS_BLOCK_STATE_EMPTY) {
-                       T(YAFFS_TRACE_SCAN_DEBUG,
-                         (TSTR("Block empty " TENDSTR)));
+                       yaffs_trace(YAFFS_TRACE_SCAN_DEBUG, "Block empty ");
                        dev->n_erased_blocks++;
                        dev->n_free_chunks += dev->param.chunks_per_block;
                } else if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING) {
@@ -1066,41 +1060,38 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                        dev->seq_number = seq_number;
                        } else {
                                /* TODO: Nasty sequence number! */
-                               T(YAFFS_TRACE_SCAN,
-                                 (TSTR
-                                  ("Block scanning block %d has bad sequence number %d"
-                                   TENDSTR), blk, seq_number));
+                               yaffs_trace(YAFFS_TRACE_SCAN,
+                                       "Block scanning block %d has bad sequence number %d",
+                                       blk, seq_number);
 
                        }
                }
                bi++;
        }
 
-       T(YAFFS_TRACE_SCAN,
-         (TSTR("%d blocks to be sorted..." TENDSTR), n_to_scan));
+       yaffs_trace(YAFFS_TRACE_SCAN, "%d blocks to be sorted...", n_to_scan);
 
-       YYIELD();
+       cond_resched();
 
        /* Sort the blocks by sequence number */
-       yaffs_sort(block_index, n_to_scan, sizeof(struct yaffs_block_index),
-                  yaffs2_ybicmp);
+       sort(block_index, n_to_scan, sizeof(struct yaffs_block_index),
+                  yaffs2_ybicmp, NULL);
 
-       YYIELD();
+       cond_resched();
 
-       T(YAFFS_TRACE_SCAN, (TSTR("...done" TENDSTR)));
+       yaffs_trace(YAFFS_TRACE_SCAN, "...done");
 
        /* Now scan the blocks looking at the data. */
        start_iter = 0;
        end_iter = n_to_scan - 1;
-       T(YAFFS_TRACE_SCAN_DEBUG,
-         (TSTR("%d blocks to be scanned" TENDSTR), n_to_scan));
+       yaffs_trace(YAFFS_TRACE_SCAN_DEBUG, "%d blocks to scan", n_to_scan);
 
        /* For each block.... backwards */
        for (block_iter = end_iter; !alloc_failed && block_iter >= start_iter;
             block_iter--) {
                /* Cooperative multitasking! This loop can run for so
                   long that watchdog timers expire. */
-               YYIELD();
+               cond_resched();
 
                /* get the block to scan in the correct order */
                blk = block_index[block_iter].block;
@@ -1153,10 +1144,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                                    bi->seq_number) {
                                                        /* this is the block being allocated from */
 
-                                                       T(YAFFS_TRACE_SCAN,
-                                                         (TSTR
-                                                          (" Allocating from %d %d"
-                                                           TENDSTR), blk, c));
+                                                       yaffs_trace(YAFFS_TRACE_SCAN,
+                                                               " Allocating from %d %d",
+                                                               blk, c);
 
                                                        state =
                                                            YAFFS_BLOCK_STATE_ALLOCATING;
@@ -1170,10 +1160,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                                         * the current allocation block.
                                                         */
 
-                                                       T(YAFFS_TRACE_SCAN,
-                                                         (TSTR
-                                                          ("Partially written block %d detected"
-                                                           TENDSTR), blk));
+                                                       yaffs_trace(YAFFS_TRACE_SCAN,
+                                                               "Partially written block %d detected",
+                                                               blk);
                                                }
                                        }
                                }
@@ -1181,10 +1170,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                dev->n_free_chunks++;
 
                        } else if (tags.ecc_result == YAFFS_ECC_RESULT_UNFIXED) {
-                               T(YAFFS_TRACE_SCAN,
-                                 (TSTR
-                                  (" Unfixed ECC in chunk(%d:%d), chunk ignored"
-                                   TENDSTR), blk, c));
+                               yaffs_trace(YAFFS_TRACE_SCAN,
+                                       " Unfixed ECC in chunk(%d:%d), chunk ignored",
+                                       blk, c);
 
                                dev->n_free_chunks++;
 
@@ -1193,11 +1181,10 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                   (tags.chunk_id > 0
                                    && tags.n_bytes > dev->data_bytes_per_chunk)
                                   || tags.seq_number != bi->seq_number) {
-                               T(YAFFS_TRACE_SCAN,
-                                 (TSTR
-                                  ("Chunk (%d:%d) with bad tags:obj = %d, chunk_id = %d, n_bytes = %d, ignored"
-                                   TENDSTR), blk, c, tags.obj_id,
-                                  tags.chunk_id, tags.n_bytes));
+                               yaffs_trace(YAFFS_TRACE_SCAN,
+                                       "Chunk (%d:%d) with bad tags:obj = %d, chunk_id = %d, n_bytes = %d, ignored",
+                                       blk, c, tags.obj_id,
+                                       tags.chunk_id, tags.n_bytes);
 
                                dev->n_free_chunks++;
 
@@ -1314,10 +1301,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
 
                                if (!in) {
                                        /* TODO Hoosterman we have a problem! */
-                                       T(YAFFS_TRACE_ERROR,
-                                         (TSTR
-                                          ("yaffs tragedy: Could not make object for object  %d at chunk %d during scan"
-                                           TENDSTR), tags.obj_id, chunk));
+                                       yaffs_trace(YAFFS_TRACE_ERROR,
+                                               "yaffs tragedy: Could not make object for object  %d at chunk %d during scan",
+                                               tags.obj_id, chunk);
                                        continue;
                                }
 
@@ -1387,16 +1373,12 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
 
                                if (!in->valid && in->variant_type !=
                                    (oh ? oh->type : tags.extra_obj_type))
-                                       T(YAFFS_TRACE_ERROR,
-                                         (TSTR
-                                          ("yaffs tragedy: Bad object type, "
-                                           TCONT
-                                           ("%d != %d, for object %d at chunk ")
-                                           TCONT("%d during scan")
-                                           TENDSTR), oh ?
-                                          oh->type : tags.extra_obj_type,
-                                          in->variant_type, tags.obj_id,
-                                          chunk));
+                                       yaffs_trace(YAFFS_TRACE_ERROR,
+                                               "yaffs tragedy: Bad object type, %d != %d, for object %d at chunk %d during scan",
+                                               oh ?
+                                               oh->type : tags.extra_obj_type,
+                                               in->variant_type, tags.obj_id,
+                                               chunk);
 
                                if (!in->valid &&
                                    (tags.obj_id == YAFFS_OBJECTID_ROOT ||
@@ -1410,9 +1392,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                                in->yst_mode = oh->yst_mode;
                                                yaffs_load_attribs(in, oh);
                                                in->lazy_loaded = 0;
-                                       } else
+                                       } else {
                                                in->lazy_loaded = 1;
-
+                                        }
                                        in->hdr_chunk = chunk;
 
                                } else if (!in->valid) {
@@ -1476,16 +1458,14 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
                                                               variant.dir_variant.children);
                                        } else if (!parent
                                                   || parent->variant_type !=
-                                                  YAFFS_OBJECT_TYPE_DIRECTORY)
-                                       {
+                                                  YAFFS_OBJECT_TYPE_DIRECTORY) {
                                                /* Hoosterman, another problem....
                                                 * We're trying to use a non-directory as a directory
                                                 */
 
-                                               T(YAFFS_TRACE_ERROR,
-                                                 (TSTR
-                                                  ("yaffs tragedy: attempting to use non-directory as a directory in scan. Put in lost+found."
-                                                   TENDSTR)));
+                                               yaffs_trace(YAFFS_TRACE_ERROR,
+                                                       "yaffs tragedy: attempting to use non-directory as a directory in scan. Put in lost+found."
+                                                       );
                                                parent = dev->lost_n_found;
                                        }
 
@@ -1596,9 +1576,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
        yaffs_skip_rest_of_block(dev);
 
        if (alt_block_index)
-               YFREE_ALT(block_index);
+               vfree(block_index);
        else
-               YFREE(block_index);
+               kfree(block_index);
 
        /* Ok, we've done all the scanning.
         * Fix up the hard link chains.
@@ -1612,7 +1592,7 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev)
        if (alloc_failed)
                return YAFFS_FAIL;
 
-       T(YAFFS_TRACE_SCAN, (TSTR("yaffs2_scan_backwards ends" TENDSTR)));
+       yaffs_trace(YAFFS_TRACE_SCAN, "yaffs2_scan_backwards ends");
 
        return YAFFS_OK;
 }