ALLOBJS = $(sort $(YAFFSTESTOBJS))
YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
- yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
+ yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
yaffs_nameval.c yaffs_nameval.h \
- yaffs_qsort.c yaffs_qsort.h yaffs_trace.h \
+ yaffs_qsort.h yaffs_trace.h \
yaffs_allocator.c yaffs_allocator.h \
yaffs_yaffs1.c yaffs_yaffs1.h \
yaffs_yaffs2.c yaffs_yaffs2.h \
YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
- yaffs_nandif.c yaffs_nandif.h
+ yaffs_flashif.c yaffscfg.h yaffs_qsort.c\
+ yaffs_nandif.c yaffs_nandif.h yaffs_nandemul2k.h
DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
--- /dev/null
+../../../devextras.h
\ No newline at end of file
return "Unknown error code";
}
-void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[]){
+void yaffs_check_for_errors(int output, buffer *message_buffer,char error_message[],char success_message[]){
char dummy[10];
unsigned int x=0;
int yaffs_error=-1;
if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL) printf("%d\n",yaffs_error); /*cannot yet add int types to buffer. this is a quick fix*/
add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
- exit(1);
- //scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
+
+ scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
//print_buffer(message_buffer,PRINT_ALL);
}
#include "message_buffer.h"
#include "yaffsfs.h"
#define DEBUG_LEVEL 5 /*set the debug level. this is used to display the relevent debug messages*/
-void yaffs_check_for_errors(char output, buffer *message_buffer, char error_message[], char success_message[]);
+void yaffs_check_for_errors(int output, buffer *message_buffer, char error_message[], char success_message[]);
#endif
--- /dev/null
+log file for yaffs tester
+welcome to the yaffs tester
+setting seed to 1288571042
+joining paths:/yaffs2/test_dir and apple
+number of opened handles: 0
+joining paths:/yaffs2/test_dir and GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
+trying to open file: /yaffs2/test_dir/GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
+file does not exists, creating file
+handle array id 14
+yaffs handle: -1
+stored handle: -1
+
+error##########
+failed to open file
+error_code:
+EACCES
+
+
--- /dev/null
+../../../yaffs_allocator.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_allocator.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_bitmap.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_bitmap.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_checkptrw.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_checkptrw.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_ecc.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_ecc.h
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_fileem.c
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_fileem2k.c
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_fileem2k.h
\ No newline at end of file
--- /dev/null
+../../yaffs_flashif.c
\ No newline at end of file
--- /dev/null
+../../yaffs_flashif.h
\ No newline at end of file
--- /dev/null
+../../yaffs_flashif2.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_getblockinfo.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_guts.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_guts.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_list.h
\ No newline at end of file
--- /dev/null
+../../yaffs_malloc.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_nameval.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_nameval.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_nand.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_nand.h
\ No newline at end of file
--- /dev/null
+../../yaffs_nandemul2k.h
\ No newline at end of file
--- /dev/null
+../../yaffs_nandif.c
\ No newline at end of file
--- /dev/null
+../../yaffs_nandif.h
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_norif1.c
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_norif1.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_packedtags1.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_packedtags1.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_packedtags2.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_packedtags2.h
\ No newline at end of file
--- /dev/null
+../../yaffs_qsort.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_qsort.h
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_ramdisk.c
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_ramdisk.h
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffs_ramem2k.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_tagscompat.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_tagscompat.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_tagsvalidity.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_tagsvalidity.h
\ No newline at end of file
append_int_to_buffer(&message_buffer,stat.st_mode,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
}
else {
- add_to_buffer(&message_buffer,"file does not exists, creating file",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ add_to_buffer(&message_buffer,"file does not exists, creating file",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
}
output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE);
}
+void stat_file(char *path){
+ int output=0;
+ struct yaffs_stat stat;
+ if (yaffs_access(path,0)==0){
+ add_to_buffer(&message_buffer,"file exists, trying to stat: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
+ output=yaffs_lstat(path,&stat);
+ yaffs_check_for_errors(output, &message_buffer,"failed to stat file","statted file");
+ //stat.st_ino,(int)stat.st_size,stat.st_mode
+ add_to_buffer(&message_buffer,"yaffs inode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ append_int_to_buffer(&message_buffer,stat.st_ino,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ append_to_buffer(&message_buffer," file size: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ append_int_to_buffer(&message_buffer,(int)stat.st_size,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ append_to_buffer(&message_buffer," file mode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ append_int_to_buffer(&message_buffer,stat.st_mode,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
+ }
+ else{
+ add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
+ append_to_buffer(&message_buffer," does not exist,could not stat",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
+ }
+}
+
--- /dev/null
+../../../yaffs_trace.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_verify.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_verify.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_yaffs1.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_yaffs1.h
\ No newline at end of file
--- /dev/null
+../../../yaffs_yaffs2.c
\ No newline at end of file
--- /dev/null
+../../../yaffs_yaffs2.h
\ No newline at end of file
--- /dev/null
+../../yaffscfg.h
\ No newline at end of file
--- /dev/null
+../../basic-test/yaffscfg2k.c
\ No newline at end of file
--- /dev/null
+../../yaffsfs.c
\ No newline at end of file
--- /dev/null
+../../yaffsfs.h
\ No newline at end of file
--- /dev/null
+../../../yaffsinterface.h
\ No newline at end of file
--- /dev/null
+../../ydirectenv.h
\ No newline at end of file
--- /dev/null
+../../basic-test/ynorsim.c
\ No newline at end of file
--- /dev/null
+../../basic-test/ynorsim.h
\ No newline at end of file
--- /dev/null
+../../../yportenv.h
\ No newline at end of file
+++ /dev/null
-# Makefile for YAFFS direct stress tests
-#
-#
-# YAFFS: Yet another Flash File System. A NAND-flash specific file system.
-#
-# Copyright (C) 2003-2010 Aleph One Ltd.
-#
-#
-# Created by Charles Manning <charles@aleph1.co.uk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# NB Warning this Makefile does not include header dependencies.
-#
-# $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
-
-#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
-
-CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2
-CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
-CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
-#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O0
-CFLAGS += -Wextra -Wpointer-arith
-#CFLAGS += -DCONFIG_YAFFS_VALGRIND_TEST
-
-#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
-#CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
-
-
-COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
- yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
- yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
- yaffs_checkptrw.o yaffs_qsort.o\
- yaffs_nameval.o \
- yaffs_norif1.o ynorsim.o \
- yaffs_allocator.o \
- yaffs_bitmap.o \
- yaffs_yaffs1.o \
- yaffs_yaffs2.o \
- yaffs_verify.o
-
-# yaffs_checkptrwtest.o\
-
-YAFFSTESTOBJS = $(COMMONTESTOBJS) yaffs_tester.o message_buffer.o error_handler.o
-
-
-ALLOBJS = $(sort $(YAFFSTESTOBJS))
-
-YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
- yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
- yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
- yaffs_nameval.c yaffs_nameval.h \
- yaffs_qsort.c yaffs_qsort.h yaffs_trace.h \
- yaffs_allocator.c yaffs_allocator.h \
- yaffs_yaffs1.c yaffs_yaffs1.h \
- yaffs_yaffs2.c yaffs_yaffs2.h \
- yaffs_bitmap.c yaffs_bitmap.h \
- yaffs_verify.c yaffs_verify.h
-
-YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
- yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
- yaffs_nandif.c yaffs_nandif.h
-
-
-DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
- yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
- yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
- ynorsim.h ynorsim.c
-
-SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS)
-#all: directtest2k boottest
-
-all: yaffs_tester
-
-$(ALLOBJS): %.o: %.c
- gcc -c $(CFLAGS) -o $@ $<
-
-
-$(YAFFSSYMLINKS):
- ln -s ../../../$@ $@
-
-$(YAFFSDIRECTSYMLINKS):
- ln -s ../../$@ $@
-
-$(DIRECTEXTRASYMLINKS):
- ln -s ../../basic-test/$@ $@
-
-
-yaffs_tester: $(SYMLINKS) $(YAFFSTESTOBJS)
- gcc $(CFLLAG) -o $@ $(YAFFSTESTOBJS)
-
-
-
-
-
-
-clean:
- rm -f yaffs_tester $(ALLOBJS) core $(SYMLINKS) log.txt
+++ /dev/null
-
-
-yaffs_tester.c lseeks and writes to a file in for loop then suddenly lseek( on line 238) returns the error EACCES.
-The handle to the file has not changed nor has the handle been closed.
-There is no reason for this error to happen and is therefor logged as a bug.
-
-if the emfile contains quite a few files then the same lseek will return a error code of 0 (see lseek_error_code_0_bug directory).
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * error_handler.c contains code for checking yaffs function calls for errors.
- */
-#include "error_handler.h"
-
-
-typedef struct error_codes_template {
- int code;
- char * text;
-}error_entry;
-
-const error_entry error_list[] = {
- { ENOMEM , "ENOMEM" },
- { EBUSY , "EBUSY"},
- { ENODEV , "ENODEV"},
- { EINVAL , "EINVAL"},
- { EBADF , "EBADF"},
- { EACCES , "EACCES"},
- { EXDEV , "EXDEV" },
- { ENOENT , "ENOENT"},
- { ENOSPC , "ENOSPC"},
- { ERANGE , "ERANGE"},
- { ENODATA, "ENODATA"},
- { ENOTEMPTY, "ENOTEMPTY"},
- { ENAMETOOLONG,"ENAMETOOLONG"},
- { ENOMEM , "ENOMEM"},
- { EEXIST , "EEXIST"},
- { ENOTDIR , "ENOTDIR"},
- { EISDIR , "EISDIR"},
- { 0, NULL }
-};
-
-const char * error_to_str(int err)
-{
- error_entry *e = error_list;
- if (err < 0)
- err = -err;
- while(e->code && e->text){
- if(err == e->code)
- return e->text;
- e++;
- }
- return "Unknown error code";
-}
-
-void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[]){
- char dummy[10];
- unsigned int x=0;
- int yaffs_error=-1;
- char error_found=0;
- if (output==-1)
- {
- add_to_buffer(message_buffer, "\nerror##########",MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,NPRINT);
- yaffs_error=yaffs_get_error();
- append_int_to_buffer(message_buffer, yaffs_error,MESSAGE_LEVEL_ERROR,PRINT);
-
- add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
- append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
- quit_program();
- //scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
- //print_buffer(message_buffer,PRINT_ALL);
-
- }
- else{
- add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __error_handler_h__
-#define __error_handler_h__
-#include <stdio.h>
-#include "message_buffer.h"
-#include "yaffsfs.h"
-#define DEBUG_LEVEL 5 /*set the debug level. this is used to display the relevent debug messages*/
-void yaffs_check_for_errors(char output, buffer *message_buffer, char error_message[], char success_message[]);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * message_buffer.c contains code for a message buffer .
- */
-
-#include "message_buffer.h"
-
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print){
- FILE *log_handle;
-
- if (append==APPEND_MESSAGE){ /* append current message*/
- strncat(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH);
- }
- else {
-
- /*move the head up one. the head always points at the last written data*/
- p_Buffer->head++;
-
- /*printf("p_Buffer->tail=%d\n",p_Buffer->tail);*/
- /*printf("p_Buffer->head=%d\n",p_Buffer->head);*/
- if (p_Buffer->head >=BUFFER_SIZE-1) {
- /*printf("buffer overflow\n");*/
- p_Buffer->head -= (BUFFER_SIZE-1); /*wrap the head around the buffer*/
- /*printf("new p_Buffer->head=%d\n",p_Buffer->head);*/
- }
- /*if the buffer is full then delete last entry by moving the tail*/
- if (p_Buffer->head==p_Buffer->tail){
- /*printf("moving buffer tail from %d to ",p_Buffer->tail);*/
- p_Buffer->tail++;
- if (p_Buffer->tail >=BUFFER_SIZE) p_Buffer->tail -= BUFFER_SIZE;/*wrap the tail around the buffer*/
- /*printf("%d\n",p_Buffer->tail);*/
-
- }
-
- p_Buffer->message_level[p_Buffer->head]=message_level; /*copy the message level*/
- strncpy(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH); /*copy the message*/
- /*printf("copied %s into p_Buffer->message[p_Buffer->head]: %s\n",message,p_Buffer->message[p_Buffer->head]);
- printf("extra %s\n",p_Buffer->message[p_Buffer->head]);*/
- }
- if ((p_Buffer->message_level[p_Buffer->head]<=DEBUG_LEVEL)&& (print==PRINT)){
- /*printf("printing buffer 1\n");
- // the print buffer function is not working this is just a quick fix
- print_buffer(p_Buffer,1); //if the debug level is higher enough then print the new message
- */
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- log_handle=fopen(LOG_FILE,"a");
- if (log_handle!=NULL){
- fputs(p_Buffer->message[p_Buffer->head],log_handle);
- fputs("\n",log_handle);
- fclose(log_handle);
- }
- }
-}
-
-
-
-void print_buffer(buffer *p_Buffer, int number_of_messages_to_print){
- int x=0;
- int i=0;
- printf("print buffer\n");
- printf("buffer head:%d\n",p_Buffer->head);
- printf("buffer tail:%d\n",p_Buffer->tail);
-
- if (number_of_messages_to_print==PRINT_ALL) number_of_messages_to_print=BUFFER_SIZE;
-// printf("number_of_messages_to_print=%d\n",number_of_messages_to_print);
- for (i=0,x=0; (x>=p_Buffer->tail) && (i<number_of_messages_to_print); i++, x--){
-// printf("printing buffer\n");
-// printf("x:%d\n",x);
- if (x<0) x = BUFFER_SIZE-1; /*wrap x around buffer*/
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- printf("printed buffer\n");
- }
-
-}
-
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __message_buffer__
-#define __message_buffer__
-
-#include <stdio.h>
-#include <string.h>
-#define PRINT 1
-#define NPRINT 0
-#define APPEND_MESSAGE 1
-#define DO_NOT_APPEND_MESSAGE 0
-#define PRINT_ALL -1 /*this is used to print all of the messages in a buffer*/
-#define BUFFER_MESSAGE_LENGTH 60 /*number of char in message*/
-#define BUFFER_SIZE 50 /*number of messages in buffer*/
-#define MESSAGE_LEVEL_ERROR 0
-#define MESSAGE_LEVEL_BASIC_TASKS 1
-
-#define LOG_FILE "log.txt"
-typedef struct buffer_template{
- char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
- int head;
- int tail;
- char message_level[BUFFER_SIZE];
-}buffer;
-#include "error_handler.h" /*include this for the debug level*/
-
-
-void print_buffer(buffer *p_Buffer,int number_of_messages_to_print); /*print messages in the buffer*/
-/*wrapper functions for add_to_buffer_root_function*/
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * yaffs_tester.c designed to stress test yaffs2 direct.
- */
-
-
-#include "yaffs_tester.h"
-
-
-
-int random_seed;
-int simulate_power_failure = 0;
-
-
-buffer message_buffer; /*create message_buffer */
-
-char yaffs_test_dir[] ="/yaffs2/test_dir"; /*the path to the directory where all of the testing will take place*/
-char yaffs_mount_dir[]="/yaffs2/"; /*the path to the mount point which yaffs will mount*/
-
-
-int main(int argc, char *argv[]){
-
-
- init(yaffs_test_dir,yaffs_mount_dir,argc,argv);
- test(yaffs_test_dir);
- yaffs_unmount(yaffs_mount_dir);
- return 0;
-}
-
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]){
- char output=0;
- int x=0;
- int seed=-1;
- FILE *log_handle;
- /*these variables are already set to zero, but it is better not to take chances*/
- message_buffer.head=0;
- message_buffer.tail=0;
-
-
- log_handle=fopen(LOG_FILE,"w");
- if (log_handle!=NULL){
- fputs("log file for yaffs tester\n",log_handle);
- fclose(log_handle);
- }
- add_to_buffer(&message_buffer,"welcome to the yaffs tester",MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
- yaffs_start_up();
- yaffs_mount(yaffs_mount_dir);
- for (x=0;x<argc;x++){
-// add_to_buffer(&message_buffer,"argv ",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-// add_to_buffer(&message_buffer,argv[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (strcmp("-seed",argv[x])==0){ /*warning only compares the length of the strings, quick fix*/
- seed= atoi(argv[x+1]);
- /*add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,"\n",MESSAGE_LEVEL_BASIC_TASKS,PRINT);*/
- }
- }
- if (seed==-1){
- seed=time(NULL);
- srand(seed);
- }
- else {
- srand(seed);
- }
- add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
-
- if (yaffs_access(yaffs_test_dir,0)) /* if the test folder does not exist then create it */
- {
- add_to_buffer(&message_buffer,"creating dir: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,yaffs_test_dir,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_mkdir(yaffs_test_dir,S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"could not create dir","created dir\n\n");
- }
-
-}
-
-void quit_program(){
- yaffs_unmount(yaffs_mount_dir);
- exit(1);
-}
-void join_paths(char *path1,char *path2,char *new_path ){
-
-/* printf("strlen path1:%d\n",strlen(path1));
- printf("strlen path2:%d\n",strlen(path2));
- printf("path1; %s\n",path1);
-*/
- add_to_buffer(&message_buffer, "joining paths:",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path1,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, " and ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, path2,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') {
- /*paths are compatiable. concatanate them. note -2 is because of \0*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') {
- /*paths are compatiable. concatanate them*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') {
- /*need to add a "/". */
- strcat(new_path,path1);
- strcat(new_path,"/");
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strcat("/\0",path2)));
-
-#if 0
- copy_array(path1,new_path,0,0);
- copy_array('\0',new_path,0,(sizeof(path1)/sizeof(char)));
- copy_array(path2,new_path,0,(sizeof(path1)/sizeof(char))+1);
- old method now trying to use copy_array
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))+1];
- for (x=0;x<=(sizeof(path1)/sizeof(char))-1;x++){
- new_path[x]=path1[x];
- }
- new_path[x+1]='/';
- for (x=(sizeof(path1)/sizeof(char)) ,i=0 ;i<=(sizeof(path2)/sizeof(char));x++,i++){
- new_path[x]=path2[i];
- }
-#endif
-
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') {
- /*need to remove a "/". */
- /*yaffs does not mind the extra slash. */
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))-1];
-
- strcat(new_path,path1);
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strncat("",path2,(sizeof(path1)/sizeof(char))-1)));
- //return new_path;
- }
- else{
- //error
- //return -1;
- }
-}
-
-void open_random_file(char *yaffs_test_dir, handle_regster *P_open_handles_array){
- int output=0;
- int x=0;
- char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- char path[MAX_FILE_NAME_SIZE+strlen(yaffs_test_dir)];
- path[0]='\0';// this should clear the path
- add_to_buffer(&message_buffer,"\n\number of opened handles: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,P_open_handles_array->number_of_open_handles,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (P_open_handles_array->number_of_open_handles<MAX_NUMBER_OF_OPENED_HANDLES)
- {
- generate_random_string(name,MAX_FILE_NAME_SIZE);
- printf("before %d %d %d\n",strlen(yaffs_test_dir),strlen(name),strlen(path));
- join_paths(yaffs_test_dir,name,path);//bug###################### here
- printf("after %d %d %d\n",strlen(yaffs_test_dir),strlen(name),strlen(path));
- add_to_buffer(&message_buffer,"trying to open file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (yaffs_access(path,0)==0){
- stat_file(path);
- }
- else {
- add_to_buffer(&message_buffer,"file does not exists, creating file",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- }
-
- output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE);
- x=0;
- for (x=0;P_open_handles_array->handle[x]!=-3 && x<MAX_NUMBER_OF_OPENED_HANDLES;x++){} /*find an empty handle*/
-
- add_to_buffer(&message_buffer,"handle array id ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,x,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
- //for (x=0;handle_pointers[x]!=NULL;x++){}
- P_open_handles_array->handle[x]=output;
- P_open_handles_array->path[x][0]='\0';
- strcat(P_open_handles_array->path[x],path);
- add_to_buffer(&message_buffer,"yaffs handle: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,output,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- add_to_buffer(&message_buffer,"stored handle: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
-
- //yaffs_open will return a null pointer if it cannot open a file. check for errors will not work.
- yaffs_check_for_errors(output, &message_buffer,"failed to open file","opened file");
-
- P_open_handles_array->number_of_open_handles++;
- }
- else close_random_file(P_open_handles_array);
-
-}
-
-void write_to_random_file(handle_regster *P_open_handles_array){
- int number_of_lines_of_text=0;
- int length=100;
- char text[length+1];
- text[0]='\0';
- int seek=0;
- int x=0;
- int output=0;
- if (P_open_handles_array->number_of_open_handles>0){
-
- while (P_open_handles_array->handle[x]==-3){ /*find a random open handle*/
- x=rand() % (MAX_NUMBER_OF_OPENED_HANDLES-1);
- }
- add_to_buffer(&message_buffer,"\n\ntrying to write to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,P_open_handles_array->path[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
- stat_file(P_open_handles_array->path[x]);
- number_of_lines_of_text=rand() %1000;
- add_to_buffer(&message_buffer,"writing ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,number_of_lines_of_text,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," lines of text",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
-
- for (;number_of_lines_of_text>0;number_of_lines_of_text--)
- {
- generate_random_string(text,length);
- seek=rand()%1000;
- add_to_buffer(&message_buffer,"trying to seek to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seek,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_lseek(P_open_handles_array->handle[x],seek,SEEK_SET);
- yaffs_check_for_errors(output, &message_buffer,"failed to seek","seeked file");
- add_to_buffer(&message_buffer,"trying to write to file",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_write(P_open_handles_array->handle[x], text, strlen(text));
- yaffs_check_for_errors(output, &message_buffer,"failed to write text","wrote text");
-
- }
- }
-}
-
-void close_random_file(handle_regster *P_open_handles_array){
- /*run out of space on the handle pointer array*/
- /*make space*/
- int x=0;
- int output=0;
- while (P_open_handles_array->handle[x]==-3){
- x=rand() % (MAX_NUMBER_OF_OPENED_HANDLES-1);
- }
- add_to_buffer(&message_buffer,"\n\ntrying to close file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,P_open_handles_array->path[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- add_to_buffer(&message_buffer,"file handle: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,P_open_handles_array->handle[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
- stat_file(P_open_handles_array->path[x]);
- output=yaffs_close(P_open_handles_array->handle[x]);
-
- if (output==-1) yaffs_check_for_errors(output, &message_buffer,"failed to close file","closed file");
- else {
- yaffs_check_for_errors(output, &message_buffer,"failed to close file","closed file");
- P_open_handles_array->handle[x]=-3;
- P_open_handles_array->path[x][0]='\0';
- P_open_handles_array->number_of_open_handles--;
- }
-}
-
-void stat_file(char *path){
- int output=0;
- struct yaffs_stat stat;
- if (yaffs_access(path,0)==0){
- add_to_buffer(&message_buffer,"file exists, trying to stat: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_lstat(path,&stat);
- yaffs_check_for_errors(output, &message_buffer,"failed to stat file","statted file");
- //stat.st_ino,(int)stat.st_size,stat.st_mode
- add_to_buffer(&message_buffer,"yaffs inode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,stat.st_ino,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," file size: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,(int)stat.st_size,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," file mode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,stat.st_mode,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
- else{
- add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," does not exist,could not stat",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-void test(char*yaffs_test_dir){
- struct yaffs_stat stat;
- int output=0;
- //char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- //char path[MAX_FILE_NAME_SIZE];
- handle_regster open_handles_array;
- //int handle_pointers[MAX_NUMBER_OF_OPENED_HANDLES];
- //int number_of_opened_handles=0;
- int x=0;
-
-
- open_handles_array.number_of_open_handles=0;
- for (x=0;x<MAX_NUMBER_OF_OPENED_HANDLES;x++){
- open_handles_array.handle[x]=-3;
- open_handles_array.path[x][0]='\0';
-
- }
- while(1)
- {
- x=rand() % 2;
- switch(x){
- case 0 :open_random_file(yaffs_test_dir,&open_handles_array);break;
- case 1 :write_to_random_file(&open_handles_array);break;
- case 2 :close_random_file(&open_handles_array);break;
- }
- }
-}
-void generate_random_string(char *ptr,int length_of_str){
- unsigned int x;
- unsigned int length=((rand() %length_of_str)+1); /*creates a int with the number of charecters been between 1 and 51*/
- char letter='\0';
-
- //printf("generating string\n");
- //printf("string length is %d\n",length);
- for (x=0; x <= (length-2) &&length>2 ; x++)
- {
- //printf("x=%d\n",x);
- /* keep generating a charecter until the charecter is legal*/
- while((letter=='\0' )||(letter=='/')||(letter=='\\')){
- letter=(rand() % 126-32)+32; /*generate a number between 32 and 126 and uses it as a charecter (letter) */
- }
- ptr[x]=letter;
- //printf("charecter generated is %c\n",ptr[x]);
- }
- ptr[x+1]='\0'; /*adds NULL charecter to turn it into a string*/
-
-}
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __YAFFS_TESTER_H__
- #define __YAFFS_TESTER_H__
-
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-
-#include "yaffsfs.h" /* it is in "yaffs2/direct/" link it in the Makefile */
-#include "message_buffer.h"
-#include "error_handler.h"
-
-#define MAX_NUMBER_OF_OPENED_HANDLES 50
-#define MAX_FILE_NAME_SIZE 51
-
-typedef struct handle_regster_template{
- int handle[MAX_NUMBER_OF_OPENED_HANDLES];
- char path[MAX_NUMBER_OF_OPENED_HANDLES][100];
- int number_of_open_handles;
-}handle_regster;
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]); /*sets up yaffs and mounts yaffs */
-void test(char *yaffs_test_dir); /*contains the test code*/
-void generate_random_string(char *ptr,int length_of_str); /*generates a random string of letters to be used for a name*/
-void join_paths(char *path1,char *path2,char *newpath );
-void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset);
-void stat_file(char *path);
-void write_to_random_file(handle_regster *P_open_handles_array);
-void close_random_file(handle_regster *P_open_handles_array);
-void quit_program();
-#endif
+++ /dev/null
-# Makefile for YAFFS direct stress tests
-#
-#
-# YAFFS: Yet another Flash File System. A NAND-flash specific file system.
-#
-# Copyright (C) 2003-2010 Aleph One Ltd.
-#
-#
-# Created by Charles Manning <charles@aleph1.co.uk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# NB Warning this Makefile does not include header dependencies.
-#
-# $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
-
-#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
-
-CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2
-CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
-CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
-#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O0
-CFLAGS += -Wextra -Wpointer-arith
-#CFLAGS += -DCONFIG_YAFFS_VALGRIND_TEST
-
-#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
-#CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
-
-
-COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
- yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
- yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
- yaffs_checkptrw.o yaffs_qsort.o\
- yaffs_nameval.o \
- yaffs_norif1.o ynorsim.o \
- yaffs_allocator.o \
- yaffs_bitmap.o \
- yaffs_yaffs1.o \
- yaffs_yaffs2.o \
- yaffs_verify.o
-
-# yaffs_checkptrwtest.o\
-
-YAFFSTESTOBJS = $(COMMONTESTOBJS) yaffs_tester.o message_buffer.o error_handler.o
-
-
-ALLOBJS = $(sort $(YAFFSTESTOBJS))
-
-YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
- yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
- yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
- yaffs_nameval.c yaffs_nameval.h \
- yaffs_qsort.c yaffs_qsort.h yaffs_trace.h \
- yaffs_allocator.c yaffs_allocator.h \
- yaffs_yaffs1.c yaffs_yaffs1.h \
- yaffs_yaffs2.c yaffs_yaffs2.h \
- yaffs_bitmap.c yaffs_bitmap.h \
- yaffs_verify.c yaffs_verify.h
-
-YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
- yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
- yaffs_nandif.c yaffs_nandif.h
-
-
-DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
- yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
- yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
- ynorsim.h ynorsim.c
-
-SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS)
-#all: directtest2k boottest
-
-all: yaffs_tester
-
-$(ALLOBJS): %.o: %.c
- gcc -c $(CFLAGS) -o $@ $<
-
-
-$(YAFFSSYMLINKS):
- ln -s ../../../$@ $@
-
-$(YAFFSDIRECTSYMLINKS):
- ln -s ../../$@ $@
-
-$(DIRECTEXTRASYMLINKS):
- ln -s ../../basic-test/$@ $@
-
-
-yaffs_tester: $(SYMLINKS) $(YAFFSTESTOBJS)
- gcc $(CFLLAG) -o $@ $(YAFFSTESTOBJS)
-
-
-
-
-
-
-clean:
- rm -f yaffs_tester $(ALLOBJS) core $(SYMLINKS) log.txt
+++ /dev/null
-
-
-yaffs_tester.c lseeks and writes to a file in for loop then suddenly lseek( on line 238) returns the error EACCES.
-The handle to the file has not changed nor has the handle been closed.
-There is no reason for this error to happen and is therefor logged as a bug.
-
-if the emfile contains quite a few files then the same lseek will return a error code of 0 (see lseek_error_code_0_bug directory).
-use the bug_emkfile to generate the error. The error only seems to happen now and again so the yaffs_tester may need to be run multiple times.
+++ /dev/null
-log file for yaffs tester
-welcome to the yaffs tester
-setting seed to 1288226434
-
-
-umber of opened handles: 0
-joining paths:/yaffs2/test_dir and \ 1\ 1\ 1\ 1\ 1\ 1\ 1
-trying to open file: /yaffs2/test_dir/\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-/yaffs2/test_dir/\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-statted file
-yaffs inode: 659 file size: 0 file mode: 33152
-handle array id 0
-yaffs handle: 0
-opened file
-
-
-umber of opened handles: 1
-joining paths:/yaffs2/test_dir and +++++++++++++++++++++++++++++
-trying to open file: /yaffs2/test_dir/+++++++++++++++++++++++++++++
-/yaffs2/test_dir/+++++++++++++++++++++++++++++
-statted file
-yaffs inode: 2495 file size: 0 file mode: 33152
-handle array id 1
-yaffs handle: 1
-opened file
-
-
-umber of opened handles: 2
-joining paths:/yaffs2/test_dir and ==================================================
-trying to open file: /yaffs2/test_dir/===========================================
-/yaffs2/test_dir/===========================================
-statted file
-yaffs inode: 3110 file size: 0 file mode: 33152
-handle array id 2
-yaffs handle: 2
-opened file
-
-
-trying to write to /yaffs2/test_dir/\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-/yaffs2/test_dir/\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-statted file
-yaffs inode: 659 file size: 0 file mode: 33152
-writing 911 lines of text
-trying to seek to 392
-seeked file
-trying to write to file
-wrote text
-trying to seek to 931
-seeked file
-trying to write to file
-wrote text
-trying to seek to 165
-seeked file
-trying to write to file
-wrote text
-trying to seek to 293
-seeked file
-trying to write to file
-wrote text
-trying to seek to 637
-seeked file
-trying to write to file
-wrote text
-trying to seek to 698
-seeked file
-trying to write to file
-wrote text
-trying to seek to 803
-seeked file
-trying to write to file
-wrote text
-trying to seek to 435
-seeked file
-trying to write to file
-wrote text
-trying to seek to 845
-seeked file
-trying to write to file
-wrote text
-trying to seek to 476
-seeked file
-trying to write to file
-wrote text
-trying to seek to 507
-seeked file
-trying to write to file
-wrote text
-trying to seek to 126
-seeked file
-trying to write to file
-wrote text
-trying to seek to 453
-seeked file
-trying to write to file
-wrote text
-trying to seek to 501
-seeked file
-trying to write to file
-wrote text
-trying to seek to 277
-seeked file
-trying to write to file
-wrote text
-trying to seek to 713
-seeked file
-trying to write to file
-wrote text
-trying to seek to 623
-seeked file
-trying to write to file
-wrote text
-trying to seek to 197
-seeked file
-trying to write to file
-wrote text
-trying to seek to 181
-seeked file
-trying to write to file
-wrote text
-trying to seek to 339
-seeked file
-trying to write to file
-wrote text
-trying to seek to 849
-seeked file
-trying to write to file
-wrote text
-trying to seek to 980
-seeked file
-trying to write to file
-wrote text
-trying to seek to 333
-seeked file
-trying to write to file
-wrote text
-trying to seek to 320
-seeked file
-trying to write to file
-wrote text
-trying to seek to 6
-seeked file
-trying to write to file
-wrote text
-trying to seek to 556
-seeked file
-trying to write to file
-wrote text
-trying to seek to 702
-seeked file
-trying to write to file
-wrote text
-trying to seek to 261
-seeked file
-trying to write to file
-wrote text
-trying to seek to 164
-seeked file
-trying to write to file
-wrote text
-trying to seek to 973
-seeked file
-trying to write to file
-wrote text
-trying to seek to 248
-seeked file
-trying to write to file
-wrote text
-trying to seek to 85
-seeked file
-trying to write to file
-wrote text
-trying to seek to 416
-seeked file
-trying to write to file
-wrote text
-trying to seek to 758
-seeked file
-trying to write to file
-wrote text
-trying to seek to 403
-seeked file
-trying to write to file
-wrote text
-trying to seek to 990
-seeked file
-trying to write to file
-wrote text
-trying to seek to 569
-seeked file
-trying to write to file
-wrote text
-trying to seek to 943
-seeked file
-trying to write to file
-wrote text
-trying to seek to 900
-seeked file
-trying to write to file
-wrote text
-trying to seek to 580
-seeked file
-trying to write to file
-wrote text
-trying to seek to 517
-seeked file
-trying to write to file
-wrote text
-trying to seek to 514
-seeked file
-trying to write to file
-wrote text
-trying to seek to 402
-seeked file
-trying to write to file
-wrote text
-trying to seek to 985
-seeked file
-trying to write to file
-wrote text
-trying to seek to 766
-seeked file
-trying to write to file
-wrote text
-trying to seek to 22
-seeked file
-trying to write to file
-wrote text
-trying to seek to 171
-seeked file
-trying to write to file
-wrote text
-trying to seek to 483
-seeked file
-trying to write to file
-wrote text
-trying to seek to 508
-seeked file
-trying to write to file
-wrote text
-trying to seek to 427
-seeked file
-trying to write to file
-wrote text
-trying to seek to 635
-seeked file
-trying to write to file
-wrote text
-trying to seek to 631
-seeked file
-trying to write to file
-wrote text
-trying to seek to 745
-seeked file
-trying to write to file
-wrote text
-trying to seek to 312
-seeked file
-trying to write to file
-wrote text
-trying to seek to 742
-seeked file
-trying to write to file
-wrote text
-trying to seek to 116
-seeked file
-trying to write to file
-wrote text
-trying to seek to 287
-seeked file
-trying to write to file
-wrote text
-trying to seek to 770
-seeked file
-trying to write to file
-wrote text
-trying to seek to 630
-seeked file
-trying to write to file
-wrote text
-trying to seek to 57
-seeked file
-trying to write to file
-wrote text
-trying to seek to 45
-seeked file
-trying to write to file
-wrote text
-trying to seek to 676
-seeked file
-trying to write to file
-wrote text
-trying to seek to 421
-seeked file
-trying to write to file
-wrote text
-trying to seek to 86
-seeked file
-trying to write to file
-wrote text
-trying to seek to 442
-seeked file
-trying to write to file
-wrote text
-trying to seek to 622
-seeked file
-trying to write to file
-wrote text
-trying to seek to 313
-seeked file
-trying to write to file
-wrote text
-trying to seek to 609
-seeked file
-trying to write to file
-wrote text
-trying to seek to 514
-seeked file
-trying to write to file
-wrote text
-trying to seek to 546
-seeked file
-trying to write to file
-wrote text
-trying to seek to 847
-seeked file
-trying to write to file
-wrote text
-trying to seek to 509
-seeked file
-trying to write to file
-wrote text
-trying to seek to 62
-seeked file
-trying to write to file
-wrote text
-trying to seek to 749
-seeked file
-trying to write to file
-wrote text
-trying to seek to 625
-seeked file
-trying to write to file
-wrote text
-trying to seek to 152
-seeked file
-trying to write to file
-wrote text
-trying to seek to 779
-seeked file
-trying to write to file
-wrote text
-trying to seek to 526
-seeked file
-trying to write to file
-wrote text
-trying to seek to 62
-seeked file
-trying to write to file
-wrote text
-trying to seek to 657
-seeked file
-trying to write to file
-wrote text
-trying to seek to 755
-seeked file
-trying to write to file
-wrote text
-trying to seek to 79
-seeked file
-trying to write to file
-wrote text
-trying to seek to 511
-
-error##########
-failed to seek
-error_code: 0
-Unknown error code
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * error_handler.c contains code for checking yaffs function calls for errors.
- */
-#include "error_handler.h"
-
-
-typedef struct error_codes_template {
- int code;
- char * text;
-}error_entry;
-
-const error_entry error_list[] = {
- { ENOMEM , "ENOMEM" },
- { EBUSY , "EBUSY"},
- { ENODEV , "ENODEV"},
- { EINVAL , "EINVAL"},
- { EBADF , "EBADF"},
- { EACCES , "EACCES"},
- { EXDEV , "EXDEV" },
- { ENOENT , "ENOENT"},
- { ENOSPC , "ENOSPC"},
- { ERANGE , "ERANGE"},
- { ENODATA, "ENODATA"},
- { ENOTEMPTY, "ENOTEMPTY"},
- { ENAMETOOLONG,"ENAMETOOLONG"},
- { ENOMEM , "ENOMEM"},
- { EEXIST , "EEXIST"},
- { ENOTDIR , "ENOTDIR"},
- { EISDIR , "EISDIR"},
- { 0, NULL }
-};
-
-const char * error_to_str(int err)
-{
- error_entry *e = error_list;
- if (err < 0)
- err = -err;
- while(e->code && e->text){
- if(err == e->code)
- return e->text;
- e++;
- }
- return "Unknown error code";
-}
-
-void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[]){
- char dummy[10];
- unsigned int x=0;
- int yaffs_error=-1;
- char error_found=0;
- if (output==-1)
- {
- add_to_buffer(message_buffer, "\nerror##########",MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,NPRINT);
- yaffs_error=yaffs_get_error();
- append_int_to_buffer(message_buffer, yaffs_error,MESSAGE_LEVEL_ERROR,PRINT);
-
- add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
- append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
- quit_program();
- //scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
- //print_buffer(message_buffer,PRINT_ALL);
-
- }
- else{
- add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __error_handler_h__
-#define __error_handler_h__
-#include <stdio.h>
-#include "message_buffer.h"
-#include "yaffsfs.h"
-#define DEBUG_LEVEL 5 /*set the debug level. this is used to display the relevent debug messages*/
-void yaffs_check_for_errors(char output, buffer *message_buffer, char error_message[], char success_message[]);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * message_buffer.c contains code for a message buffer .
- */
-
-#include "message_buffer.h"
-
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print){
- FILE *log_handle;
-
- if (append==APPEND_MESSAGE){ /* append current message*/
- strncat(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH);
- }
- else {
-
- /*move the head up one. the head always points at the last written data*/
- p_Buffer->head++;
-
- /*printf("p_Buffer->tail=%d\n",p_Buffer->tail);*/
- /*printf("p_Buffer->head=%d\n",p_Buffer->head);*/
- if (p_Buffer->head >=BUFFER_SIZE-1) {
- /*printf("buffer overflow\n");*/
- p_Buffer->head -= (BUFFER_SIZE-1); /*wrap the head around the buffer*/
- /*printf("new p_Buffer->head=%d\n",p_Buffer->head);*/
- }
- /*if the buffer is full then delete last entry by moving the tail*/
- if (p_Buffer->head==p_Buffer->tail){
- /*printf("moving buffer tail from %d to ",p_Buffer->tail);*/
- p_Buffer->tail++;
- if (p_Buffer->tail >=BUFFER_SIZE) p_Buffer->tail -= BUFFER_SIZE;/*wrap the tail around the buffer*/
- /*printf("%d\n",p_Buffer->tail);*/
-
- }
-
- p_Buffer->message_level[p_Buffer->head]=message_level; /*copy the message level*/
- strncpy(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH); /*copy the message*/
- /*printf("copied %s into p_Buffer->message[p_Buffer->head]: %s\n",message,p_Buffer->message[p_Buffer->head]);
- printf("extra %s\n",p_Buffer->message[p_Buffer->head]);*/
- }
- if ((p_Buffer->message_level[p_Buffer->head]<=DEBUG_LEVEL)&& (print==PRINT)){
- /*printf("printing buffer 1\n");
- // the print buffer function is not working this is just a quick fix
- print_buffer(p_Buffer,1); //if the debug level is higher enough then print the new message
- */
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- log_handle=fopen(LOG_FILE,"a");
- if (log_handle!=NULL){
- fputs(p_Buffer->message[p_Buffer->head],log_handle);
- fputs("\n",log_handle);
- fclose(log_handle);
- }
- }
-}
-
-
-
-void print_buffer(buffer *p_Buffer, int number_of_messages_to_print){
- int x=0;
- int i=0;
- printf("print buffer\n");
- printf("buffer head:%d\n",p_Buffer->head);
- printf("buffer tail:%d\n",p_Buffer->tail);
-
- if (number_of_messages_to_print==PRINT_ALL) number_of_messages_to_print=BUFFER_SIZE;
-// printf("number_of_messages_to_print=%d\n",number_of_messages_to_print);
- for (i=0,x=0; (x>=p_Buffer->tail) && (i<number_of_messages_to_print); i++, x--){
-// printf("printing buffer\n");
-// printf("x:%d\n",x);
- if (x<0) x = BUFFER_SIZE-1; /*wrap x around buffer*/
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- printf("printed buffer\n");
- }
-
-}
-
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __message_buffer__
-#define __message_buffer__
-
-#include <stdio.h>
-#include <string.h>
-#define PRINT 1
-#define NPRINT 0
-#define APPEND_MESSAGE 1
-#define DO_NOT_APPEND_MESSAGE 0
-#define PRINT_ALL -1 /*this is used to print all of the messages in a buffer*/
-#define BUFFER_MESSAGE_LENGTH 60 /*number of char in message*/
-#define BUFFER_SIZE 50 /*number of messages in buffer*/
-#define MESSAGE_LEVEL_ERROR 0
-#define MESSAGE_LEVEL_BASIC_TASKS 1
-
-#define LOG_FILE "log.txt"
-typedef struct buffer_template{
- char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
- int head;
- int tail;
- char message_level[BUFFER_SIZE];
-}buffer;
-#include "error_handler.h" /*include this for the debug level*/
-
-
-void print_buffer(buffer *p_Buffer,int number_of_messages_to_print); /*print messages in the buffer*/
-/*wrapper functions for add_to_buffer_root_function*/
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * yaffs_tester.c designed to stress test yaffs2 direct.
- */
-
-
-#include "yaffs_tester.h"
-
-
-
-int random_seed;
-int simulate_power_failure = 0;
-
-
-buffer message_buffer; /*create message_buffer */
-
-char yaffs_test_dir[] ="/yaffs2/test_dir"; /*the path to the directory where all of the testing will take place*/
-char yaffs_mount_dir[]="/yaffs2/"; /*the path to the mount point which yaffs will mount*/
-
-
-int main(int argc, char *argv[]){
-
-
- init(yaffs_test_dir,yaffs_mount_dir,argc,argv);
- test(yaffs_test_dir);
- yaffs_unmount(yaffs_mount_dir);
- return 0;
-}
-
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]){
- char output=0;
- int x=0;
- int seed=-1;
- FILE *log_handle;
- /*these variables are already set to zero, but it is better not to take chances*/
- message_buffer.head=0;
- message_buffer.tail=0;
-
-
- log_handle=fopen(LOG_FILE,"w");
- if (log_handle!=NULL){
- fputs("log file for yaffs tester\n",log_handle);
- fclose(log_handle);
- }
- add_to_buffer(&message_buffer,"welcome to the yaffs tester",MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
- yaffs_start_up();
- yaffs_mount(yaffs_mount_dir);
- for (x=0;x<argc;x++){
-// add_to_buffer(&message_buffer,"argv ",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-// add_to_buffer(&message_buffer,argv[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (strcmp("-seed",argv[x])==0){ /*warning only compares the length of the strings, quick fix*/
- seed= atoi(argv[x+1]);
- /*add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,"\n",MESSAGE_LEVEL_BASIC_TASKS,PRINT);*/
- }
- }
- if (seed==-1){
- seed=time(NULL);
- srand(seed);
- }
- else {
- srand(seed);
- }
- add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
-
- if (yaffs_access(yaffs_test_dir,0)) /* if the test folder does not exist then create it */
- {
- add_to_buffer(&message_buffer,"creating dir: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,yaffs_test_dir,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_mkdir(yaffs_test_dir,S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"could not create dir","created dir\n\n");
- }
-
-}
-
-void quit_program(){
- yaffs_unmount(yaffs_mount_dir);
- exit(1);
-}
-void join_paths(char *path1,char *path2,char *new_path ){
-
-/* printf("strlen path1:%d\n",strlen(path1));
- printf("strlen path2:%d\n",strlen(path2));
- printf("path1; %s\n",path1);
-*/
- add_to_buffer(&message_buffer, "joining paths:",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path1,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, " and ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, path2,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') {
- /*paths are compatiable. concatanate them. note -2 is because of \0*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') {
- /*paths are compatiable. concatanate them*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') {
- /*need to add a "/". */
- strcat(new_path,path1);
- strcat(new_path,"/");
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strcat("/\0",path2)));
-
-#if 0
- copy_array(path1,new_path,0,0);
- copy_array('\0',new_path,0,(sizeof(path1)/sizeof(char)));
- copy_array(path2,new_path,0,(sizeof(path1)/sizeof(char))+1);
- old method now trying to use copy_array
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))+1];
- for (x=0;x<=(sizeof(path1)/sizeof(char))-1;x++){
- new_path[x]=path1[x];
- }
- new_path[x+1]='/';
- for (x=(sizeof(path1)/sizeof(char)) ,i=0 ;i<=(sizeof(path2)/sizeof(char));x++,i++){
- new_path[x]=path2[i];
- }
-#endif
-
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') {
- /*need to remove a "/". */
- /*yaffs does not mind the extra slash. */
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))-1];
-
- strcat(new_path,path1);
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strncat("",path2,(sizeof(path1)/sizeof(char))-1)));
- //return new_path;
- }
- else{
- //error
- //return -1;
- }
-}
-
-void open_random_file(char *yaffs_test_dir, handle_regster *P_open_handles_array){
- int output=0;
- int x=0;
- char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- char path[MAX_FILE_NAME_SIZE+strlen(yaffs_test_dir)];
- path[0]='\0';// this should clear the path
- add_to_buffer(&message_buffer,"\n\number of opened handles: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,P_open_handles_array->number_of_open_handles,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (P_open_handles_array->number_of_open_handles<MAX_NUMBER_OF_OPENED_HANDLES)
- {
- generate_random_string(name,MAX_FILE_NAME_SIZE);
- printf("before %d %d %d\n",strlen(yaffs_test_dir),strlen(name),strlen(path));
- join_paths(yaffs_test_dir,name,path);//bug###################### here
- printf("after %d %d %d\n",strlen(yaffs_test_dir),strlen(name),strlen(path));
- add_to_buffer(&message_buffer,"trying to open file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (yaffs_access(path,0)==0){
- stat_file(path);
- }
- else {
- add_to_buffer(&message_buffer,"file does not exists, creating file",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- }
-
- output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE);
- x=0;
- for (x=0;P_open_handles_array->handle[x]!=-3 && x<MAX_NUMBER_OF_OPENED_HANDLES;x++){} /*find an empty handle*/
-
- add_to_buffer(&message_buffer,"handle array id ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,x,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
- //for (x=0;handle_pointers[x]!=NULL;x++){}
- P_open_handles_array->handle[x]=output;
- P_open_handles_array->path[x][0]='\0';
- strcat(P_open_handles_array->path[x],path);
- add_to_buffer(&message_buffer,"yaffs handle: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,output,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- add_to_buffer(&message_buffer,"stored handle: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
-
- //yaffs_open will return a null pointer if it cannot open a file. check for errors will not work.
- yaffs_check_for_errors(output, &message_buffer,"failed to open file","opened file");
-
- P_open_handles_array->number_of_open_handles++;
- }
- else close_random_file(P_open_handles_array);
-
-}
-
-void write_to_random_file(handle_regster *P_open_handles_array){
- int number_of_lines_of_text=0;
- int length=100;
- char text[length+1];
- text[0]='\0';
- int seek=0;
- int x=0;
- int output=0;
- if (P_open_handles_array->number_of_open_handles>0){
-
- while (P_open_handles_array->handle[x]==-3){ /*find a random open handle*/
- x=rand() % (MAX_NUMBER_OF_OPENED_HANDLES-1);
- }
- add_to_buffer(&message_buffer,"\n\ntrying to write to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,P_open_handles_array->path[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
- stat_file(P_open_handles_array->path[x]);
- number_of_lines_of_text=rand() %1000;
- add_to_buffer(&message_buffer,"writing ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,number_of_lines_of_text,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," lines of text",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
-
- for (;number_of_lines_of_text>0;number_of_lines_of_text--)
- {
- generate_random_string(text,length);
- seek=rand()%1000;
- add_to_buffer(&message_buffer,"trying to seek to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seek,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_lseek(P_open_handles_array->handle[x],seek,SEEK_SET);
- yaffs_check_for_errors(output, &message_buffer,"failed to seek","seeked file");
- add_to_buffer(&message_buffer,"trying to write to file",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_write(P_open_handles_array->handle[x], text, strlen(text));
- yaffs_check_for_errors(output, &message_buffer,"failed to write text","wrote text");
-
- }
- }
-}
-
-void close_random_file(handle_regster *P_open_handles_array){
- /*run out of space on the handle pointer array*/
- /*make space*/
- int x=0;
- int output=0;
- while (P_open_handles_array->handle[x]==-3){
- x=rand() % (MAX_NUMBER_OF_OPENED_HANDLES-1);
- }
- add_to_buffer(&message_buffer,"\n\ntrying to close file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,P_open_handles_array->path[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- add_to_buffer(&message_buffer,"file handle: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,P_open_handles_array->handle[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-
- stat_file(P_open_handles_array->path[x]);
- output=yaffs_close(P_open_handles_array->handle[x]);
-
- if (output==-1) yaffs_check_for_errors(output, &message_buffer,"failed to close file","closed file");
- else {
- yaffs_check_for_errors(output, &message_buffer,"failed to close file","closed file");
- P_open_handles_array->handle[x]=-3;
- P_open_handles_array->path[x][0]='\0';
- P_open_handles_array->number_of_open_handles--;
- }
-}
-
-void stat_file(char *path){
- int output=0;
- struct yaffs_stat stat;
- if (yaffs_access(path,0)==0){
- add_to_buffer(&message_buffer,"file exists, trying to stat: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_lstat(path,&stat);
- yaffs_check_for_errors(output, &message_buffer,"failed to stat file","statted file");
- //stat.st_ino,(int)stat.st_size,stat.st_mode
- add_to_buffer(&message_buffer,"yaffs inode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,stat.st_ino,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," file size: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,(int)stat.st_size,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," file mode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,stat.st_mode,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
- else{
- add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer," does not exist,could not stat",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-void test(char*yaffs_test_dir){
- struct yaffs_stat stat;
- int output=0;
- //char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- //char path[MAX_FILE_NAME_SIZE];
- handle_regster open_handles_array;
- //int handle_pointers[MAX_NUMBER_OF_OPENED_HANDLES];
- //int number_of_opened_handles=0;
- int x=0;
-
-
- open_handles_array.number_of_open_handles=0;
- for (x=0;x<MAX_NUMBER_OF_OPENED_HANDLES;x++){
- open_handles_array.handle[x]=-3;
- open_handles_array.path[x][0]='\0';
-
- }
- while(1)
- {
- x=rand() % 2;
- switch(x){
- case 0 :open_random_file(yaffs_test_dir,&open_handles_array);break;
- case 1 :write_to_random_file(&open_handles_array);break;
- case 2 :close_random_file(&open_handles_array);break;
- }
- }
-}
-void generate_random_string(char *ptr,int length_of_str){
- unsigned int x;
- unsigned int length=((rand() %length_of_str)+1); /*creates a int with the number of charecters been between 1 and 51*/
- char letter='\0';
-
- //printf("generating string\n");
- //printf("string length is %d\n",length);
- for (x=0; x <= (length-2) &&length>2 ; x++)
- {
- //printf("x=%d\n",x);
- /* keep generating a charecter until the charecter is legal*/
- while((letter=='\0' )||(letter=='/')||(letter=='\\')){
- letter=(rand() % 126-32)+32; /*generate a number between 32 and 126 and uses it as a charecter (letter) */
- }
- ptr[x]=letter;
- //printf("charecter generated is %c\n",ptr[x]);
- }
- ptr[x+1]='\0'; /*adds NULL charecter to turn it into a string*/
-
-}
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __YAFFS_TESTER_H__
- #define __YAFFS_TESTER_H__
-
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-
-#include "yaffsfs.h" /* it is in "yaffs2/direct/" link it in the Makefile */
-#include "message_buffer.h"
-#include "error_handler.h"
-
-#define MAX_NUMBER_OF_OPENED_HANDLES 50
-#define MAX_FILE_NAME_SIZE 51
-
-typedef struct handle_regster_template{
- int handle[MAX_NUMBER_OF_OPENED_HANDLES];
- char path[MAX_NUMBER_OF_OPENED_HANDLES][100];
- int number_of_open_handles;
-}handle_regster;
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]); /*sets up yaffs and mounts yaffs */
-void test(char *yaffs_test_dir); /*contains the test code*/
-void generate_random_string(char *ptr,int length_of_str); /*generates a random string of letters to be used for a name*/
-void join_paths(char *path1,char *path2,char *newpath );
-void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset);
-void stat_file(char *path);
-void write_to_random_file(handle_regster *P_open_handles_array);
-void close_random_file(handle_regster *P_open_handles_array);
-void quit_program();
-#endif
+++ /dev/null
-# Makefile for YAFFS direct stress tests
-#
-#
-# YAFFS: Yet another Flash File System. A NAND-flash specific file system.
-#
-# Copyright (C) 2003-2010 Aleph One Ltd.
-#
-#
-# Created by Charles Manning <charles@aleph1.co.uk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# NB Warning this Makefile does not include header dependencies.
-#
-# $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
-
-#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
-
-CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2
-CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
-CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
-#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O0
-CFLAGS += -Wextra -Wpointer-arith
-#CFLAGS += -DCONFIG_YAFFS_VALGRIND_TEST
-
-#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
-#CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
-
-
-COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
- yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
- yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
- yaffs_checkptrw.o yaffs_qsort.o\
- yaffs_nameval.o \
- yaffs_norif1.o ynorsim.o \
- yaffs_allocator.o \
- yaffs_bitmap.o \
- yaffs_yaffs1.o \
- yaffs_yaffs2.o \
- yaffs_verify.o
-
-# yaffs_checkptrwtest.o\
-
-YAFFSTESTOBJS = $(COMMONTESTOBJS) yaffs_tester.o message_buffer.o error_handler.o
-
-
-ALLOBJS = $(sort $(YAFFSTESTOBJS))
-
-YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
- yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
- yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
- yaffs_nameval.c yaffs_nameval.h \
- yaffs_qsort.c yaffs_qsort.h yaffs_trace.h \
- yaffs_allocator.c yaffs_allocator.h \
- yaffs_yaffs1.c yaffs_yaffs1.h \
- yaffs_yaffs2.c yaffs_yaffs2.h \
- yaffs_bitmap.c yaffs_bitmap.h \
- yaffs_verify.c yaffs_verify.h
-
-YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
- yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
- yaffs_nandif.c yaffs_nandif.h
-
-
-DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
- yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
- yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
- ynorsim.h ynorsim.c
-
-SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS)
-#all: directtest2k boottest
-
-all: yaffs_tester
-
-$(ALLOBJS): %.o: %.c
- gcc -c $(CFLAGS) -o $@ $<
-
-
-$(YAFFSSYMLINKS):
- ln -s ../../../$@ $@
-
-$(YAFFSDIRECTSYMLINKS):
- ln -s ../../$@ $@
-
-$(DIRECTEXTRASYMLINKS):
- ln -s ../../basic-test/$@ $@
-
-
-yaffs_tester: $(SYMLINKS) $(YAFFSTESTOBJS)
- gcc $(CFLLAG) -o $@ $(YAFFSTESTOBJS)
-
-
-
-
-
-
-clean:
- rm -f yaffs_tester $(ALLOBJS) core $(SYMLINKS) log.txt
+++ /dev/null
-Yaffs bug
-
-Yaffs' mkdir function will not work if the path ends in a slash.
-i.e. /yaffs2/new_dir/
-This bug is known and is not likely to be fixed.
-To get around this bug remove the slash on the end.
-i.e. /yaffs2/new_dir
-
-Running the program with any seed will work.
-./yaffs_tester
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * error_handler.c contains code for checking yaffs function calls for errors.
- */
-#include "error_handler.h"
-
-
-typedef struct error_codes_template {
- int code;
- char * text;
-}error_entry;
-
-const error_entry error_list[] = {
- { ENOMEM , "ENOMEM" },
- { EBUSY , "EBUSY"},
- { ENODEV , "ENODEV"},
- { EINVAL , "EINVAL"},
- { EBADF , "EBADF"},
- { EACCES , "EACCES"},
- { EXDEV , "EXDEV" },
- { ENOENT , "ENOENT"},
- { ENOSPC , "ENOSPC"},
- { ERANGE , "ERANGE"},
- { ENODATA, "ENODATA"},
- { ENOTEMPTY, "ENOTEMPTY"},
- { ENAMETOOLONG,"ENAMETOOLONG"},
- { ENOMEM , "ENOMEM"},
- { EEXIST , "EEXIST"},
- { ENOTDIR , "ENOTDIR"},
- { EISDIR , "EISDIR"},
- { 0, NULL }
-};
-
-const char * error_to_str(int err)
-{
- error_entry *e = error_list;
- if (err < 0)
- err = -err;
- while(e->code && e->text){
- if(err == e->code)
- return e->text;
- e++;
- }
- return "Unknown error code";
-}
-
-void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[]){
- char dummy[10];
- unsigned int x=0;
- int yaffs_error=-1;
- char error_found=0;
- if (output==-1)
- {
- add_to_buffer(message_buffer, "\nerror##########",MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,PRINT);
- yaffs_error=yaffs_get_error();
- if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL) printf("%d\n",yaffs_error); /*cannot yet add int types to buffer. this is a quick fix*/
- add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
- append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
-
- scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
- //print_buffer(message_buffer,PRINT_ALL);
-
- }
- else{
- add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __error_handler_h__
-#define __error_handler_h__
-#include <stdio.h>
-#include "message_buffer.h"
-#include "yaffsfs.h"
-#define DEBUG_LEVEL 5 /*set the debug level. this is used to display the relevent debug messages*/
-void yaffs_check_for_errors(char output, buffer *message_buffer, char error_message[], char success_message[]);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * message_buffer.c contains code for a message buffer .
- */
-
-#include "message_buffer.h"
-
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print){
- FILE *log_handle;
-
- if (append==APPEND_MESSAGE){ /* append current message*/
- strncat(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH);
- }
- else {
-
- /*move the head up one. the head always points at the last written data*/
- p_Buffer->head++;
-
- /*printf("p_Buffer->tail=%d\n",p_Buffer->tail);*/
- /*printf("p_Buffer->head=%d\n",p_Buffer->head);*/
- if (p_Buffer->head >=BUFFER_SIZE-1) {
- /*printf("buffer overflow\n");*/
- p_Buffer->head -= (BUFFER_SIZE-1); /*wrap the head around the buffer*/
- /*printf("new p_Buffer->head=%d\n",p_Buffer->head);*/
- }
- /*if the buffer is full then delete last entry by moving the tail*/
- if (p_Buffer->head==p_Buffer->tail){
- /*printf("moving buffer tail from %d to ",p_Buffer->tail);*/
- p_Buffer->tail++;
- if (p_Buffer->tail >=BUFFER_SIZE) p_Buffer->tail -= BUFFER_SIZE;/*wrap the tail around the buffer*/
- /*printf("%d\n",p_Buffer->tail);*/
-
- }
-
- p_Buffer->message_level[p_Buffer->head]=message_level; /*copy the message level*/
- strncpy(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH); /*copy the message*/
- /*printf("copied %s into p_Buffer->message[p_Buffer->head]: %s\n",message,p_Buffer->message[p_Buffer->head]);
- printf("extra %s\n",p_Buffer->message[p_Buffer->head]);*/
- }
- if ((p_Buffer->message_level[p_Buffer->head]<=DEBUG_LEVEL)&& (print==PRINT)){
- /*printf("printing buffer 1\n");
- // the print buffer function is not working this is just a quick fix
- print_buffer(p_Buffer,1); //if the debug level is higher enough then print the new message
- */
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- log_handle=fopen(LOG_FILE,"a");
- if (log_handle!=NULL){
- fputs(p_Buffer->message[p_Buffer->head],log_handle);
- fputs("\n",log_handle);
- fclose(log_handle);
- }
- }
-}
-
-
-
-void print_buffer(buffer *p_Buffer, int number_of_messages_to_print){
- int x=0;
- int i=0;
- printf("print buffer\n");
- printf("buffer head:%d\n",p_Buffer->head);
- printf("buffer tail:%d\n",p_Buffer->tail);
-
- if (number_of_messages_to_print==PRINT_ALL) number_of_messages_to_print=BUFFER_SIZE;
-// printf("number_of_messages_to_print=%d\n",number_of_messages_to_print);
- for (i=0,x=0; (x>=p_Buffer->tail) && (i<number_of_messages_to_print); i++, x--){
-// printf("printing buffer\n");
-// printf("x:%d\n",x);
- if (x<0) x = BUFFER_SIZE-1; /*wrap x around buffer*/
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- printf("printed buffer\n");
- }
-
-}
-
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __message_buffer__
-#define __message_buffer__
-
-#include <stdio.h>
-#include <string.h>
-#define PRINT 1
-#define NPRINT 0
-#define APPEND_MESSAGE 1
-#define DO_NOT_APPEND_MESSAGE 0
-#define PRINT_ALL -1 /*this is used to print all of the messages in a buffer*/
-#define BUFFER_MESSAGE_LENGTH 60 /*number of char in message*/
-#define BUFFER_SIZE 50 /*number of messages in buffer*/
-#define MESSAGE_LEVEL_ERROR 0
-#define MESSAGE_LEVEL_BASIC_TASKS 1
-
-#define LOG_FILE "log.txt"
-typedef struct buffer_template{
- char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
- int head;
- int tail;
- char message_level[BUFFER_SIZE];
-}buffer;
-#include "error_handler.h" /*include this for the debug level*/
-
-
-void print_buffer(buffer *p_Buffer,int number_of_messages_to_print); /*print messages in the buffer*/
-/*wrapper functions for add_to_buffer_root_function*/
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * yaffs_tester.c designed to stress test yaffs2 direct.
- */
-
-
-#include "yaffs_tester.h"
-
-
-
-int random_seed;
-int simulate_power_failure = 0;
-
-
-buffer message_buffer; /*create message_buffer */
-
-
-
-int main(int argc, char *argv[]){
- char yaffs_test_dir[] ="/yaffs2/test_dir/"; /*the path to the directory where all of the testing will take place*/
- char yaffs_mount_dir[]="/yaffs2/"; /*the path to the mount point which yaffs will mount*/
-
- init(yaffs_test_dir,yaffs_mount_dir,argc,argv);
- test(yaffs_test_dir);
- yaffs_unmount(yaffs_mount_dir);
- return 0;
-}
-
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]){
- char output=0;
- int x=0;
- int seed=-1;
- FILE *log_handle;
- /*these variables are already set to zero, but it is better not to take chances*/
- message_buffer.head=0;
- message_buffer.tail=0;
-
-
- log_handle=fopen(LOG_FILE,"w");
- if (log_handle!=NULL){
- fputs("log file for yaffs tester\n",log_handle);
- fclose(log_handle);
- }
- add_to_buffer(&message_buffer,"welcome to the yaffs tester",MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
- yaffs_start_up();
- yaffs_mount(yaffs_mount_dir);
- for (x=0;x<argc;x++){
-// add_to_buffer(&message_buffer,"argv ",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-// add_to_buffer(&message_buffer,argv[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (strcmp("-seed",argv[x])==0){ /*warning only compares the length of the strings, quick fix*/
- seed= atoi(argv[x+1]);
- /*add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,"\n",MESSAGE_LEVEL_BASIC_TASKS,PRINT);*/
- }
- }
- if (seed==-1){
- seed=time(NULL);
- srand(seed);
- }
- else {
- srand(seed);
- }
- add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
-
- if (yaffs_access(yaffs_test_dir,0)) /* if the test folder does not exist then create it */
- {
- add_to_buffer(&message_buffer,"creating dir: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,yaffs_test_dir,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_mkdir(yaffs_test_dir,S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"could not create dir","created dir\n\n");
- }
-
-}
-void join_paths(char *path1,char *path2,char *new_path ){
-
-/* printf("strlen path1:%d\n",strlen(path1));
- printf("strlen path2:%d\n",strlen(path2));
- printf("path1; %s\n",path1);
-*/
- add_to_buffer(&message_buffer, "joining paths:",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path1,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, " and ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, path2,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') {
- /*paths are compatiable. concatanate them. note -2 is because of \0*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') {
- /*paths are compatiable. concatanate them*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') {
- /*need to add a "/". */
- strcat(new_path,path1);
- strcat(new_path,"/");
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strcat("/\0",path2)));
-
-#if 0
- copy_array(path1,new_path,0,0);
- copy_array('\0',new_path,0,(sizeof(path1)/sizeof(char)));
- copy_array(path2,new_path,0,(sizeof(path1)/sizeof(char))+1);
- old method now trying to use copy_array
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))+1];
- for (x=0;x<=(sizeof(path1)/sizeof(char))-1;x++){
- new_path[x]=path1[x];
- }
- new_path[x+1]='/';
- for (x=(sizeof(path1)/sizeof(char)) ,i=0 ;i<=(sizeof(path2)/sizeof(char));x++,i++){
- new_path[x]=path2[i];
- }
-#endif
-
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') {
- /*need to remove a "/". */
- /*yaffs does not mind the extra slash. */
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))-1];
-
- strcat(new_path,path1);
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strncat("",path2,(sizeof(path1)/sizeof(char))-1)));
- //return new_path;
- }
- else{
- //error
- //return -1;
- }
-}
-
-
-
-void test(char*yaffs_test_dir){
- char output=0;
- char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- char path[MAX_FILE_NAME_SIZE];
- join_paths(yaffs_test_dir,name,path);
- while(1)
- {
- path[0]='\0';// this should clear the path
- generate_random_string(name);
- join_paths(yaffs_test_dir,name,path);
- add_to_buffer(&message_buffer,"trying to open file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"failed to open file","opened file");
- }
-}
-void generate_random_string(char *ptr){
- unsigned int x;
- unsigned int length=((rand() %MAX_FILE_NAME_SIZE)+1); /*creates a int with the number of charecters been between 1 and 51*/
- char letter='\0';
- //printf("generating string\n");
- //printf("string length is %d\n",length);
- for (x=0; x <= (length-2) &&length>2 ; x++)
- {
- //printf("x=%d\n",x);
- /* keep generating a charecter until the charecter is legal*/
- while((letter=='\0' )||(letter=='/')||(letter=='\\')){
- letter=(rand() % 126-32)+32; /*generate a number between 32 and 126 and uses it as a charecter (letter) */
- }
- ptr[x]=letter;
- //printf("charecter generated is %c\n",ptr[x]);
- }
- ptr[x+1]='\0'; /*adds NULL charecter to turn it into a string*/
-
-}
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __YAFFS_TESTER_H__
- #define __YAFFS_TESTER_H__
-
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-
-#include "yaffsfs.h" /* it is in "yaffs2/direct/" link it in the Makefile */
-#include "message_buffer.h"
-#include "error_handler.h"
-
-
-#define MAX_FILE_NAME_SIZE 51
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]); /*sets up yaffs and mounts yaffs */
-void test(char *yaffs_test_dir); /*contains the test code*/
-void generate_random_string(char *ptr); /*generates a random string of letters to be used for a name*/
-void join_paths(char *path1,char *path2,char *newpath );
-void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset);
-#endif
+++ /dev/null
-# Makefile for YAFFS direct stress tests
-#
-#
-# YAFFS: Yet another Flash File System. A NAND-flash specific file system.
-#
-# Copyright (C) 2003-2010 Aleph One Ltd.
-#
-#
-# Created by Charles Manning <charles@aleph1.co.uk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# NB Warning this Makefile does not include header dependencies.
-#
-# $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
-
-#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
-
-CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2
-CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
-CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
-#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O0
-CFLAGS += -Wextra -Wpointer-arith
-#CFLAGS += -DCONFIG_YAFFS_VALGRIND_TEST
-
-#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
-#CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
-
-
-COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
- yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
- yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
- yaffs_checkptrw.o yaffs_qsort.o\
- yaffs_nameval.o \
- yaffs_norif1.o ynorsim.o \
- yaffs_allocator.o \
- yaffs_bitmap.o \
- yaffs_yaffs1.o \
- yaffs_yaffs2.o \
- yaffs_verify.o
-
-# yaffs_checkptrwtest.o\
-
-YAFFSTESTOBJS = $(COMMONTESTOBJS) yaffs_tester.o message_buffer.o error_handler.o
-
-
-ALLOBJS = $(sort $(YAFFSTESTOBJS))
-
-YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
- yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
- yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
- yaffs_nameval.c yaffs_nameval.h \
- yaffs_qsort.c yaffs_qsort.h yaffs_trace.h \
- yaffs_allocator.c yaffs_allocator.h \
- yaffs_yaffs1.c yaffs_yaffs1.h \
- yaffs_yaffs2.c yaffs_yaffs2.h \
- yaffs_bitmap.c yaffs_bitmap.h \
- yaffs_verify.c yaffs_verify.h
-
-YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
- yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
- yaffs_nandif.c yaffs_nandif.h
-
-
-DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
- yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
- yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
- ynorsim.h ynorsim.c
-
-SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS)
-#all: directtest2k boottest
-
-all: yaffs_tester
-
-$(ALLOBJS): %.o: %.c
- gcc -c $(CFLAGS) -o $@ $<
-
-
-$(YAFFSSYMLINKS):
- ln -s ../../../$@ $@
-
-$(YAFFSDIRECTSYMLINKS):
- ln -s ../../$@ $@
-
-$(DIRECTEXTRASYMLINKS):
- ln -s ../../basic-test/$@ $@
-
-
-yaffs_tester: $(SYMLINKS) $(YAFFSTESTOBJS)
- gcc $(CFLLAG) -o $@ $(YAFFSTESTOBJS)
-
-
-
-
-
-
-clean:
- rm -f yaffs_tester $(ALLOBJS) core $(SYMLINKS) log.txt
+++ /dev/null
-This directory "freezes" the yaffs_tester programs in the state in which they produce a specific bug.
-
-ENOENT error is generated when opening a new file with O_CREATE.
-This should not be happening and has been logged as an error.
-To regenerate this error remove the emfile and use the seed 1288064149
-
-./yaffs_tester -seed 1288064149
-For more information on this bug see the error_log.txt file
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * error_handler.c contains code for checking yaffs function calls for errors.
- */
-#include "error_handler.h"
-
-
-typedef struct error_codes_template {
- int code;
- char * text;
-}error_entry;
-
-const error_entry error_list[] = {
- { ENOMEM , "ENOMEM" },
- { EBUSY , "EBUSY"},
- { ENODEV , "ENODEV"},
- { EINVAL , "EINVAL"},
- { EBADF , "EBADF"},
- { EACCES , "EACCES"},
- { EXDEV , "EXDEV" },
- { ENOENT , "ENOENT"},
- { ENOSPC , "ENOSPC"},
- { ERANGE , "ERANGE"},
- { ENODATA, "ENODATA"},
- { ENOTEMPTY, "ENOTEMPTY"},
- { ENAMETOOLONG,"ENAMETOOLONG"},
- { ENOMEM , "ENOMEM"},
- { EEXIST , "EEXIST"},
- { ENOTDIR , "ENOTDIR"},
- { EISDIR , "EISDIR"},
- { 0, NULL }
-};
-
-const char * error_to_str(int err)
-{
- error_entry *e = error_list;
- if (err < 0)
- err = -err;
- while(e->code && e->text){
- if(err == e->code)
- return e->text;
- e++;
- }
- return "Unknown error code";
-}
-
-void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[]){
- char dummy[10];
- unsigned int x=0;
- int yaffs_error=-1;
- char error_found=0;
- if (output==-1)
- {
- add_to_buffer(message_buffer, "\nerror##########",MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,PRINT);
- yaffs_error=yaffs_get_error();
- if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL) printf("%d\n",yaffs_error); /*cannot yet add int types to buffer. this is a quick fix*/
- add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
- append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
-
- scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
- //print_buffer(message_buffer,PRINT_ALL);
-
- }
- else{
- add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __error_handler_h__
-#define __error_handler_h__
-#include <stdio.h>
-#include "message_buffer.h"
-#include "yaffsfs.h"
-#define DEBUG_LEVEL 5 /*set the debug level. this is used to display the relevent debug messages*/
-void yaffs_check_for_errors(char output, buffer *message_buffer, char error_message[], char success_message[]);
-#endif
+++ /dev/null
-log file for yaffs tester
-welcome to the yaffs tester
-setting seed to 1288064149
-creating dir: /yaffs2/test_dir
-created dir
-
-
-joining paths:/yaffs2/test_dir and apple
-joining paths:/yaffs2/test_dir and \ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3
-trying to open file: /yaffs2/test_dir/\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3
-opened file
-joining paths:/yaffs2/test_dir and \12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12
-trying to open file: /yaffs2/test_dir/\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12\12
-opened file
-joining paths:/yaffs2/test_dir and SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
-trying to open file: /yaffs2/test_dir/SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
-opened file
-joining paths:/yaffs2/test_dir and &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-trying to open file: /yaffs2/test_dir/&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-opened file
-joining paths:/yaffs2/test_dir and &
-trying to open file: /yaffs2/test_dir/&
-opened file
-joining paths:/yaffs2/test_dir and )))))))))))))))))))))))))))))))))))))))))))
-trying to open file: /yaffs2/test_dir/)))))))))))))))))))))))))))))))))))))))))))
-opened file
-joining paths:/yaffs2/test_dir and ``````````````````````````````)
-trying to open file: /yaffs2/test_dir/``````````````````````````````)
-opened file
-joining paths:/yaffs2/test_dir and bbbbbbbbbbbbbbb`
-trying to open file: /yaffs2/test_dir/bbbbbbbbbbbbbbb`
-opened file
-joining paths:/yaffs2/test_dir and rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
-trying to open file: /yaffs2/test_dir/rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
-opened file
-joining paths:/yaffs2/test_dir and TTTTTTTTTr
-trying to open file: /yaffs2/test_dir/TTTTTTTTTr
-opened file
-joining paths:/yaffs2/test_dir and xxxxxxxxxxxxxr
-trying to open file: /yaffs2/test_dir/xxxxxxxxxxxxxr
-opened file
-joining paths:/yaffs2/test_dir and \r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\rr
-trying to open file: /yaffs2/test_dir/\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\rr
-opened file
-joining paths:/yaffs2/test_dir and 33333333333333333333\r
-trying to open file: /yaffs2/test_dir/33333333333333333333\r
-opened file
-joining paths:/yaffs2/test_dir and =================3
-trying to open file: /yaffs2/test_dir/=================3
-opened file
-joining paths:/yaffs2/test_dir and \1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1ar
-trying to open file: /yaffs2/test_dir/\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1a\1ar
-opened file
-joining paths:/yaffs2/test_dir and <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\1a
-trying to open file: /yaffs2/test_dir/<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\1a
-opened file
-joining paths:/yaffs2/test_dir and
-trying to open file: /yaffs2/test_dir/
-opened file
-joining paths:/yaffs2/test_dir and \v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v
-trying to open file: /yaffs2/test_dir/\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v
-opened file
-joining paths:/yaffs2/test_dir and >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-trying to open file: /yaffs2/test_dir/>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-opened file
-joining paths:/yaffs2/test_dir and \18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18>
-trying to open file: /yaffs2/test_dir/\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18\18>
-opened file
-joining paths:/yaffs2/test_dir and \a\a\a\a\a\a\a\a\a\a\a\18
-trying to open file: /yaffs2/test_dir/\a\a\a\a\a\a\a\a\a\a\a\18
-opened file
-joining paths:/yaffs2/test_dir and yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
-trying to open file: /yaffs2/test_dir/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
-opened file
-joining paths:/yaffs2/test_dir and \ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-trying to open file: /yaffs2/test_dir/\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-opened file
-joining paths:/yaffs2/test_dir and \v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\ 1
-trying to open file: /yaffs2/test_dir/\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\ 1
-opened file
-joining paths:/yaffs2/test_dir and ppppppppppppppppppp\v
-trying to open file: /yaffs2/test_dir/ppppppppppppppppppp\v
-opened file
-joining paths:/yaffs2/test_dir and jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj\ 1
-trying to open file: /yaffs2/test_dir/jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
-opened file
-joining paths:/yaffs2/test_dir and """""""j
-trying to open file: /yaffs2/test_dir/"""""""j
-opened file
-joining paths:/yaffs2/test_dir and <<<<<<<<<<<<<<<<<<<<<<j
-trying to open file: /yaffs2/test_dir/<<<<<<<<<<<<<<<<<<<<<<j
-opened file
-joining paths:/yaffs2/test_dir and ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-trying to open file: /yaffs2/test_dir/,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-opened file
-joining paths:/yaffs2/test_dir and nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn,
-trying to open file: /yaffs2/test_dir/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn,
-opened file
-joining paths:/yaffs2/test_dir and ````n
-trying to open file: /yaffs2/test_dir/````n
-opened file
-joining paths:/yaffs2/test_dir and ,
-trying to open file: /yaffs2/test_dir/
-opened file
-joining paths:/yaffs2/test_dir and fffffffff
-trying to open file: /yaffs2/test_dir/fffffffff
-opened file
-joining paths:/yaffs2/test_dir and \1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c
-trying to open file: /yaffs2/test_dir/\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c
-opened file
-joining paths:/yaffs2/test_dir and nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
-trying to open file: /yaffs2/test_dir/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
-opened file
-joining paths:/yaffs2/test_dir and \1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1en
-trying to open file: /yaffs2/test_dir/\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1en
-opened file
-joining paths:/yaffs2/test_dir and \ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\1e
-trying to open file: /yaffs2/test_dir/\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\1e
-opened file
-joining paths:/yaffs2/test_dir and iiiiiiiiiiiiiiiiii\1e
-trying to open file: /yaffs2/test_dir/iiiiiiiiiiiiiiiiii\1e
-opened file
-joining paths:/yaffs2/test_dir and hhhhhhhhhhhhhi
-trying to open file: /yaffs2/test_dir/hhhhhhhhhhhhhi
-opened file
-joining paths:/yaffs2/test_dir and uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
-trying to open file: /yaffs2/test_dir/uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
-opened file
-joining paths:/yaffs2/test_dir and \1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1cu
-trying to open file: /yaffs2/test_dir/\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1c\1cu
-opened file
-joining paths:/yaffs2/test_dir and jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj\1c
-trying to open file: /yaffs2/test_dir/jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj\1c
-opened file
-joining paths:/yaffs2/test_dir and 777777j
-trying to open file: /yaffs2/test_dir/777777j
-opened file
-joining paths:/yaffs2/test_dir and <<<<<<<<<<<<<<j
-trying to open file: /yaffs2/test_dir/<<<<<<<<<<<<<<j
-opened file
-joining paths:/yaffs2/test_dir and ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-trying to open file: /yaffs2/test_dir/;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-opened file
-joining paths:/yaffs2/test_dir and ____________________________;
-trying to open file: /yaffs2/test_dir/____________________________;
-opened file
-joining paths:/yaffs2/test_dir and tttttttt_
-trying to open file: /yaffs2/test_dir/tttttttt_
-opened file
-joining paths:/yaffs2/test_dir and \ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3_
-trying to open file: /yaffs2/test_dir/\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3_
-opened file
-joining paths:/yaffs2/test_dir and VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV;
-trying to open file: /yaffs2/test_dir/VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV;
-opened file
-joining paths:/yaffs2/test_dir and ssssssssssssssssssssssssssssssssssssssssss;
-trying to open file: /yaffs2/test_dir/ssssssssssssssssssssssssssssssssssssssssss;
-opened file
-joining paths:/yaffs2/test_dir and \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bs
-trying to open file: /yaffs2/test_dir/\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bs
-opened file
-joining paths:/yaffs2/test_dir and ))))))))))\b
-trying to open file: /yaffs2/test_dir/))))))))))\b
-opened file
-joining paths:/yaffs2/test_dir and <<<<<<<<)
-trying to open file: /yaffs2/test_dir/<<<<<<<<)
-opened file
-joining paths:/yaffs2/test_dir and 999999999999999999999999999999999999999999999u
-trying to open file: /yaffs2/test_dir/9999999999999999999999999999999999999999999
-opened file
-joining paths:/yaffs2/test_dir and #########################9
-trying to open file: /yaffs2/test_dir/#########################9
-opened file
-joining paths:/yaffs2/test_dir and \ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5#
-trying to open file: /yaffs2/test_dir/\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5#
-opened file
-joining paths:/yaffs2/test_dir and \r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r9
-trying to open file: /yaffs2/test_dir/\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r9
-opened file
-joining paths:/yaffs2/test_dir and **********************************9
-trying to open file: /yaffs2/test_dir/**********************************9
-opened file
-joining paths:/yaffs2/test_dir and MMMMMM*
-trying to open file: /yaffs2/test_dir/MMMMMM*
-opened file
-joining paths:/yaffs2/test_dir and UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU9
-trying to open file: /yaffs2/test_dir/UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU9
-opened file
-joining paths:/yaffs2/test_dir and [[[[[[[[[[[[[[[[[[[U
-trying to open file: /yaffs2/test_dir/[[[[[[[[[[[[[[[[[[[U
-opened file
-joining paths:/yaffs2/test_dir and \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bu
-trying to open file: /yaffs2/test_dir/\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b
-opened file
-joining paths:/yaffs2/test_dir and \ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6
-trying to open file: /yaffs2/test_dir/\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6\ 6
-opened file
-joining paths:/yaffs2/test_dir and CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\ 6
-trying to open file: /yaffs2/test_dir/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\ 6
-opened file
-joining paths:/yaffs2/test_dir and 0000000000000000000000000000000000000000000000\ 6
-trying to open file: /yaffs2/test_dir/0000000000000000000000000000000000000000000
-opened file
-joining paths:/yaffs2/test_dir and RRRRRRR0
-trying to open file: /yaffs2/test_dir/RRRRRRR0
-opened file
-joining paths:/yaffs2/test_dir and nnnnnnnnnnnnnnnnn0
-trying to open file: /yaffs2/test_dir/nnnnnnnnnnnnnnnnn0
-opened file
-joining paths:/yaffs2/test_dir and
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-trying to open file: /yaffs2/test_dir/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-opened file
-joining paths:/yaffs2/test_dir and
-
-trying to open file: /yaffs2/test_dir/
-
-opened file
-joining paths:/yaffs2/test_dir and 77
-trying to open file: /yaffs2/test_dir/77
-opened file
-joining paths:/yaffs2/test_dir and ((((((((((((((((((((((((((((((((((((((((((((((((((
-trying to open file: /yaffs2/test_dir/(((((((((((((((((((((((((((((((((((((((((((
-opened file
-joining paths:/yaffs2/test_dir and JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ(
-trying to open file: /yaffs2/test_dir/JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
-opened file
-joining paths:/yaffs2/test_dir and ..................................................
-trying to open file: /yaffs2/test_dir/...........................................
-opened file
-joining paths:/yaffs2/test_dir and mmmmmmmmmmmmmmmm.
-trying to open file: /yaffs2/test_dir/mmmmmmmmmmmmmmmm.
-opened file
-joining paths:/yaffs2/test_dir and CCCCCCCCCCCCCCCCCC.
-trying to open file: /yaffs2/test_dir/CCCCCCCCCCCCCCCCCC.
-opened file
-joining paths:/yaffs2/test_dir and UUC
-trying to open file: /yaffs2/test_dir/UUC
-opened file
-joining paths:/yaffs2/test_dir and ********************************************.
-trying to open file: /yaffs2/test_dir/*******************************************
-opened file
-joining paths:/yaffs2/test_dir and """""*
-trying to open file: /yaffs2/test_dir/"""""*
-opened file
-joining paths:/yaffs2/test_dir and TTTTTTTTTTTTTTTTTTTT*
-trying to open file: /yaffs2/test_dir/TTTTTTTTTTTTTTTTTTTT*
-opened file
-joining paths:/yaffs2/test_dir and \ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e*
-trying to open file: /yaffs2/test_dir/\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e\ e*
-opened file
-joining paths:/yaffs2/test_dir and \ e
-trying to open file: /yaffs2/test_dir/\ e
-opened file
-joining paths:/yaffs2/test_dir and 000000000000000000000000000000000000000000000000.
-trying to open file: /yaffs2/test_dir/0000000000000000000000000000000000000000000
-opened file
-joining paths:/yaffs2/test_dir and 0
-trying to open file: /yaffs2/test_dir/
-opened file
-joining paths:/yaffs2/test_dir and qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
-trying to open file: /yaffs2/test_dir/qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
-opened file
-joining paths:/yaffs2/test_dir and \a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\aq
-trying to open file: /yaffs2/test_dir/\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\aq
-opened file
-joining paths:/yaffs2/test_dir and CCCCCCCC\a
-trying to open file: /yaffs2/test_dir/CCCCCCCC\a
-opened file
-joining paths:/yaffs2/test_dir and vvvvvvvvvv\a
-trying to open file: /yaffs2/test_dir/vvvvvvvvvv\a
-opened file
-joining paths:/yaffs2/test_dir and PPPPPPv
-trying to open file: /yaffs2/test_dir/PPPPPPv
-opened file
-joining paths:/yaffs2/test_dir and YYYYYP
-trying to open file: /yaffs2/test_dir/YYYYYP
-opened file
-joining paths:/yaffs2/test_dir and ?????????????????????????????????????????????
-trying to open file: /yaffs2/test_dir/???????????????????????????????????????????
-opened file
-joining paths:/yaffs2/test_dir and JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
-trying to open file: /yaffs2/test_dir/JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
-opened file
-joining paths:/yaffs2/test_dir and IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJ
-trying to open file: /yaffs2/test_dir/IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJ
-opened file
-joining paths:/yaffs2/test_dir and qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqJ
-trying to open file: /yaffs2/test_dir/qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqJ
-opened file
-joining paths:/yaffs2/test_dir and \a\a\a\a\a\a\a\a\a\a\a\a\aq
-trying to open file: /yaffs2/test_dir/\a\a\a\a\a\a\a\a\a\a\a\a\aq
-opened file
-joining paths:/yaffs2/test_dir and \1f\1f\1f\1f\1f\1f\1f\1f\1f\1f\a
-trying to open file: /yaffs2/test_dir/\1f\1f\1f\1f\1f\1f\1f\1f\1f\1f\a
-opened file
-joining paths:/yaffs2/test_dir and _________\1f
-trying to open file: /yaffs2/test_dir/_________\1f
-opened file
-joining paths:/yaffs2/test_dir and lllllllllllllllllllllllllllllllllllllllq
-trying to open file: /yaffs2/test_dir/lllllllllllllllllllllllllllllllllllllllq
-opened file
-joining paths:/yaffs2/test_dir and \10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10l
-trying to open file: /yaffs2/test_dir/\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10\10l
-opened file
-joining paths:/yaffs2/test_dir and \13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13l
-trying to open file: /yaffs2/test_dir/\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13\13l
-opened file
-joining paths:/yaffs2/test_dir and ddddddddddddddddddddddd\13
-trying to open file: /yaffs2/test_dir/ddddddddddddddddddddddd\13
-opened file
-joining paths:/yaffs2/test_dir and QQQQQQQQQQQQQQQQQQQQQQQQ
-trying to open file: /yaffs2/test_dir/QQQQQQQQQQQQQQQQQQQQQQQQ
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and \e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\13
-trying to open file: /yaffs2/test_dir/\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\e\13
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and \e
-trying to open file: /yaffs2/test_dir/\e
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and mmmmmmmmmmmmmmm\e
-trying to open file: /yaffs2/test_dir/mmmmmmmmmmmmmmm\e
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and GGGGGGGGGGGGGGGGGGGGGGG\e
-trying to open file: /yaffs2/test_dir/GGGGGGGGGGGGGGGGGGGGGGG\e
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and ZZZZZZZZZZZZZZZZZZZZZZZZZ\e
-trying to open file: /yaffs2/test_dir/ZZZZZZZZZZZZZZZZZZZZZZZZZ\e
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and ttttttttttttttttttttttttttttt\e
-trying to open file: /yaffs2/test_dir/ttttttttttttttttttttttttttttt\e
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and qqqqqqqqqqqqqqqt
-trying to open file: /yaffs2/test_dir/qqqqqqqqqqqqqqqt
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
-joining paths:/yaffs2/test_dir and \11\11q
-trying to open file: /yaffs2/test_dir/\11\11q
-
-error##########
-failed to open file
-error_code:
-ENOENT
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * message_buffer.c contains code for a message buffer .
- */
-
-#include "message_buffer.h"
-
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print){
- FILE *log_handle;
-
- if (append==APPEND_MESSAGE){ /* append current message*/
- strncat(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH);
- }
- else {
-
- /*move the head up one. the head always points at the last written data*/
- p_Buffer->head++;
-
- /*printf("p_Buffer->tail=%d\n",p_Buffer->tail);*/
- /*printf("p_Buffer->head=%d\n",p_Buffer->head);*/
- if (p_Buffer->head >=BUFFER_SIZE-1) {
- /*printf("buffer overflow\n");*/
- p_Buffer->head -= (BUFFER_SIZE-1); /*wrap the head around the buffer*/
- /*printf("new p_Buffer->head=%d\n",p_Buffer->head);*/
- }
- /*if the buffer is full then delete last entry by moving the tail*/
- if (p_Buffer->head==p_Buffer->tail){
- /*printf("moving buffer tail from %d to ",p_Buffer->tail);*/
- p_Buffer->tail++;
- if (p_Buffer->tail >=BUFFER_SIZE) p_Buffer->tail -= BUFFER_SIZE;/*wrap the tail around the buffer*/
- /*printf("%d\n",p_Buffer->tail);*/
-
- }
-
- p_Buffer->message_level[p_Buffer->head]=message_level; /*copy the message level*/
- strncpy(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH); /*copy the message*/
- /*printf("copied %s into p_Buffer->message[p_Buffer->head]: %s\n",message,p_Buffer->message[p_Buffer->head]);
- printf("extra %s\n",p_Buffer->message[p_Buffer->head]);*/
- }
- if ((p_Buffer->message_level[p_Buffer->head]<=DEBUG_LEVEL)&& (print==PRINT)){
- /*printf("printing buffer 1\n");
- // the print buffer function is not working this is just a quick fix
- print_buffer(p_Buffer,1); //if the debug level is higher enough then print the new message
- */
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- log_handle=fopen(LOG_FILE,"a");
- if (log_handle!=NULL){
- fputs(p_Buffer->message[p_Buffer->head],log_handle);
- fputs("\n",log_handle);
- fclose(log_handle);
- }
- }
-}
-
-
-
-void print_buffer(buffer *p_Buffer, int number_of_messages_to_print){
- int x=0;
- int i=0;
- printf("print buffer\n");
- printf("buffer head:%d\n",p_Buffer->head);
- printf("buffer tail:%d\n",p_Buffer->tail);
-
- if (number_of_messages_to_print==PRINT_ALL) number_of_messages_to_print=BUFFER_SIZE;
-// printf("number_of_messages_to_print=%d\n",number_of_messages_to_print);
- for (i=0,x=0; (x>=p_Buffer->tail) && (i<number_of_messages_to_print); i++, x--){
-// printf("printing buffer\n");
-// printf("x:%d\n",x);
- if (x<0) x = BUFFER_SIZE-1; /*wrap x around buffer*/
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- printf("printed buffer\n");
- }
-
-}
-
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __message_buffer__
-#define __message_buffer__
-
-#include <stdio.h>
-#include <string.h>
-#define PRINT 1
-#define NPRINT 0
-#define APPEND_MESSAGE 1
-#define DO_NOT_APPEND_MESSAGE 0
-#define PRINT_ALL -1 /*this is used to print all of the messages in a buffer*/
-#define BUFFER_MESSAGE_LENGTH 60 /*number of char in message*/
-#define BUFFER_SIZE 50 /*number of messages in buffer*/
-#define MESSAGE_LEVEL_ERROR 0
-#define MESSAGE_LEVEL_BASIC_TASKS 1
-
-#define LOG_FILE "log.txt"
-typedef struct buffer_template{
- char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
- int head;
- int tail;
- char message_level[BUFFER_SIZE];
-}buffer;
-#include "error_handler.h" /*include this for the debug level*/
-
-
-void print_buffer(buffer *p_Buffer,int number_of_messages_to_print); /*print messages in the buffer*/
-/*wrapper functions for add_to_buffer_root_function*/
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * yaffs_tester.c designed to stress test yaffs2 direct.
- */
-
-
-#include "yaffs_tester.h"
-
-
-
-int random_seed;
-int simulate_power_failure = 0;
-
-
-buffer message_buffer; /*create message_buffer */
-
-
-
-int main(int argc, char *argv[]){
- char yaffs_test_dir[] ="/yaffs2/test_dir"; /*the path to the directory where all of the testing will take place*/
- char yaffs_mount_dir[]="/yaffs2/"; /*the path to the mount point which yaffs will mount*/
-
- init(yaffs_test_dir,yaffs_mount_dir,argc,argv);
- test(yaffs_test_dir);
- yaffs_unmount(yaffs_mount_dir);
- return 0;
-}
-
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]){
- char output=0;
- int x=0;
- int seed=-1;
- FILE *log_handle;
- /*these variables are already set to zero, but it is better not to take chances*/
- message_buffer.head=0;
- message_buffer.tail=0;
-
-
- log_handle=fopen(LOG_FILE,"w");
- if (log_handle!=NULL){
- fputs("log file for yaffs tester\n",log_handle);
- fclose(log_handle);
- }
- add_to_buffer(&message_buffer,"welcome to the yaffs tester",MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
- yaffs_start_up();
- yaffs_mount(yaffs_mount_dir);
- for (x=0;x<argc;x++){
-// add_to_buffer(&message_buffer,"argv ",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-// add_to_buffer(&message_buffer,argv[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (strcmp("-seed",argv[x])==0){ /*warning only compares the length of the strings, quick fix*/
- seed= atoi(argv[x+1]);
- /*add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,"\n",MESSAGE_LEVEL_BASIC_TASKS,PRINT);*/
- }
- }
- if (seed==-1){
- seed=time(NULL);
- srand(seed);
- }
- else {
- srand(seed);
- }
- add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
-
- if (yaffs_access(yaffs_test_dir,0)) /* if the test folder does not exist then create it */
- {
- add_to_buffer(&message_buffer,"creating dir: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,yaffs_test_dir,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_mkdir(yaffs_test_dir,S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"could not create dir","created dir\n\n");
- }
-
-}
-void join_paths(char *path1,char *path2,char *new_path ){
-
-/* printf("strlen path1:%d\n",strlen(path1));
- printf("strlen path2:%d\n",strlen(path2));
- printf("path1; %s\n",path1);
-*/
- add_to_buffer(&message_buffer, "joining paths:",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path1,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, " and ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, path2,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') {
- /*paths are compatiable. concatanate them. note -2 is because of \0*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') {
- /*paths are compatiable. concatanate them*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') {
- /*need to add a "/". */
- strcat(new_path,path1);
- strcat(new_path,"/");
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strcat("/\0",path2)));
-
-#if 0
- copy_array(path1,new_path,0,0);
- copy_array('\0',new_path,0,(sizeof(path1)/sizeof(char)));
- copy_array(path2,new_path,0,(sizeof(path1)/sizeof(char))+1);
- old method now trying to use copy_array
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))+1];
- for (x=0;x<=(sizeof(path1)/sizeof(char))-1;x++){
- new_path[x]=path1[x];
- }
- new_path[x+1]='/';
- for (x=(sizeof(path1)/sizeof(char)) ,i=0 ;i<=(sizeof(path2)/sizeof(char));x++,i++){
- new_path[x]=path2[i];
- }
-#endif
-
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') {
- /*need to remove a "/". */
- /*yaffs does not mind the extra slash. */
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))-1];
-
- strcat(new_path,path1);
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strncat("",path2,(sizeof(path1)/sizeof(char))-1)));
- //return new_path;
- }
- else{
- //error
- //return -1;
- }
-}
-
-
-
-void test(char*yaffs_test_dir){
- char output=0;
- char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- char path[MAX_FILE_NAME_SIZE];
- join_paths(yaffs_test_dir,name,path);
- while(1)
- {
- path[0]='\0';// this should clear the path
- generate_random_string(name);
- join_paths(yaffs_test_dir,name,path);
- add_to_buffer(&message_buffer,"trying to open file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"failed to open file","opened file");
- }
-}
-void generate_random_string(char *ptr){
- unsigned int x;
- unsigned int length=((rand() %MAX_FILE_NAME_SIZE)+1); /*creates a int with the number of charecters been between 1 and 51*/
- char letter='\0';
- //printf("generating string\n");
- //printf("string length is %d\n",length);
- for (x=0; x <= (length-2) &&length>2 ; x++)
- {
- //printf("x=%d\n",x);
- /* keep generating a charecter until the charecter is legal*/
- while((letter=='\0' )||(letter=='/')||(letter=='\\')){
- letter=(rand() % 126-32)+32; /*generate a number between 32 and 126 and uses it as a charecter (letter) */
- }
- ptr[x]=letter;
- //printf("charecter generated is %c\n",ptr[x]);
- }
- ptr[x+1]='\0'; /*adds NULL charecter to turn it into a string*/
-
-}
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __YAFFS_TESTER_H__
- #define __YAFFS_TESTER_H__
-
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-
-#include "yaffsfs.h" /* it is in "yaffs2/direct/" link it in the Makefile */
-#include "message_buffer.h"
-#include "error_handler.h"
-
-
-#define MAX_FILE_NAME_SIZE 51
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]); /*sets up yaffs and mounts yaffs */
-void test(char *yaffs_test_dir); /*contains the test code*/
-void generate_random_string(char *ptr); /*generates a random string of letters to be used for a name*/
-void join_paths(char *path1,char *path2,char *newpath );
-void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset);
-#endif
+++ /dev/null
-# Makefile for YAFFS direct stress tests
-#
-#
-# YAFFS: Yet another Flash File System. A NAND-flash specific file system.
-#
-# Copyright (C) 2003-2010 Aleph One Ltd.
-#
-#
-# Created by Charles Manning <charles@aleph1.co.uk>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# NB Warning this Makefile does not include header dependencies.
-#
-# $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
-
-#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
-
-CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2
-CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
-CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
-#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O0
-CFLAGS += -Wextra -Wpointer-arith
-#CFLAGS += -DCONFIG_YAFFS_VALGRIND_TEST
-
-#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
-#CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
-
-
-COMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
- yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
- yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
- yaffs_checkptrw.o yaffs_qsort.o\
- yaffs_nameval.o \
- yaffs_norif1.o ynorsim.o \
- yaffs_allocator.o \
- yaffs_bitmap.o \
- yaffs_yaffs1.o \
- yaffs_yaffs2.o \
- yaffs_verify.o
-
-# yaffs_checkptrwtest.o\
-
-YAFFSTESTOBJS = $(COMMONTESTOBJS) yaffs_tester.o message_buffer.o error_handler.o
-
-
-ALLOBJS = $(sort $(YAFFSTESTOBJS))
-
-YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsinterface.h yportenv.h yaffs_tagscompat.c yaffs_tagscompat.h \
- yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h yaffs_nandemul2k.h \
- yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h yaffs_list.h \
- yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
- yaffs_nameval.c yaffs_nameval.h \
- yaffs_qsort.c yaffs_qsort.h yaffs_trace.h \
- yaffs_allocator.c yaffs_allocator.h \
- yaffs_yaffs1.c yaffs_yaffs1.h \
- yaffs_yaffs2.c yaffs_yaffs2.h \
- yaffs_bitmap.c yaffs_bitmap.h \
- yaffs_verify.c yaffs_verify.h
-
-YAFFSDIRECTSYMLINKS = yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
- yaffsfs.h yaffs_malloc.h ydirectenv.h \
- yaffs_flashif.c yaffscfg.h \
- yaffs_nandif.c yaffs_nandif.h
-
-
-DIRECTEXTRASYMLINKS = yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
- yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
- yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
- ynorsim.h ynorsim.c
-
-SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS)
-#all: directtest2k boottest
-
-all: yaffs_tester
-
-$(ALLOBJS): %.o: %.c
- gcc -c $(CFLAGS) -o $@ $<
-
-
-$(YAFFSSYMLINKS):
- ln -s ../../../$@ $@
-
-$(YAFFSDIRECTSYMLINKS):
- ln -s ../../$@ $@
-
-$(DIRECTEXTRASYMLINKS):
- ln -s ../../basic-test/$@ $@
-
-
-yaffs_tester: $(SYMLINKS) $(YAFFSTESTOBJS)
- gcc $(CFLLAG) -o $@ $(YAFFSTESTOBJS)
-
-
-
-
-
-
-clean:
- rm -f yaffs_tester $(ALLOBJS) core $(SYMLINKS) log.txt
+++ /dev/null
-This directory "freezes" the yaffs_tester programs in the state in which they produce a specific bug.
-
-This yaffs_tester testes the bug "error code 0, when yaffs has run out of handles"
-the yaffs_tester program may crash with another error before running out of handles.
-To fix this use remove the emkfile and use the seed 1288065181
-
-./yaffs_tester -seed 1288065181
-
-
-for more information on this bug see the error.txt file
+++ /dev/null
-log file for yaffs tester
-welcome to the yaffs tester
-setting seed to 1288065181
-joining paths:/yaffs2/test_dir and apple
-joining paths:/yaffs2/test_dir and ,,,,,,,,
-trying to open file: /yaffs2/test_dir/,,,,,,,,
-opened file
-joining paths:/yaffs2/test_dir and 3333,
-trying to open file: /yaffs2/test_dir/3333,
-opened file
-joining paths:/yaffs2/test_dir and qqqqqqqqqqqqqqqqqqqqqqqqqqq
-trying to open file: /yaffs2/test_dir/qqqqqqqqqqqqqqqqqqqqqqqqqqq
-opened file
-joining paths:/yaffs2/test_dir and }}}}}}}}}}}}}}}}}}}}}}q
-trying to open file: /yaffs2/test_dir/}}}}}}}}}}}}}}}}}}}}}}q
-opened file
-joining paths:/yaffs2/test_dir and \f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f
-trying to open file: /yaffs2/test_dir/\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f
-opened file
-joining paths:/yaffs2/test_dir and \f
-trying to open file: /yaffs2/test_dir/\f
-opened file
-joining paths:/yaffs2/test_dir and 22222222222\f
-trying to open file: /yaffs2/test_dir/22222222222\f
-opened file
-joining paths:/yaffs2/test_dir and zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
-trying to open file: /yaffs2/test_dir/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
-opened file
-joining paths:/yaffs2/test_dir and LLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
-trying to open file: /yaffs2/test_dir/LLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
-opened file
-joining paths:/yaffs2/test_dir and \1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e
-trying to open file: /yaffs2/test_dir/\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e\1e
-opened file
-joining paths:/yaffs2/test_dir and \1e
-trying to open file: /yaffs2/test_dir/\1e
-opened file
-joining paths:/yaffs2/test_dir and %%%%%%%%%\1e
-trying to open file: /yaffs2/test_dir/%%%%%%%%%\1e
-opened file
-joining paths:/yaffs2/test_dir and WWWWWWWWWWWWWWWW\1e
-trying to open file: /yaffs2/test_dir/WWWWWWWWWWWWWWWW\1e
-opened file
-joining paths:/yaffs2/test_dir and mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
-trying to open file: /yaffs2/test_dir/mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
-opened file
-joining paths:/yaffs2/test_dir and nnnnnnnnm
-trying to open file: /yaffs2/test_dir/nnnnnnnnm
-opened file
-joining paths:/yaffs2/test_dir and bbbbbbbbbbbbbbbbbbbbbbbbbbbm
-trying to open file: /yaffs2/test_dir/bbbbbbbbbbbbbbbbbbbbbbbbbbbm
-opened file
-joining paths:/yaffs2/test_dir and ffffffffffffffb
-trying to open file: /yaffs2/test_dir/ffffffffffffffb
-opened file
-joining paths:/yaffs2/test_dir and f
-trying to open file: /yaffs2/test_dir/f
-opened file
-joining paths:/yaffs2/test_dir and 22222222222222b
-trying to open file: /yaffs2/test_dir/22222222222222b
-opened file
-joining paths:/yaffs2/test_dir and IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIm
-trying to open file: /yaffs2/test_dir/IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIm
-opened file
-joining paths:/yaffs2/test_dir and yyyyyyyyyyI
-trying to open file: /yaffs2/test_dir/yyyyyyyyyyI
-opened file
-joining paths:/yaffs2/test_dir and KKKKKKy
-trying to open file: /yaffs2/test_dir/KKKKKKy
-opened file
-joining paths:/yaffs2/test_dir and vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvI
-trying to open file: /yaffs2/test_dir/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvI
-opened file
-joining paths:/yaffs2/test_dir and +++++++++++++++++++++++++++++++++m
-trying to open file: /yaffs2/test_dir/+++++++++++++++++++++++++++++++++m
-opened file
-joining paths:/yaffs2/test_dir and YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
-trying to open file: /yaffs2/test_dir/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
-opened file
-joining paths:/yaffs2/test_dir and 2222222222222222222222222222222222222222222222Y
-trying to open file: /yaffs2/test_dir/2222222222222222222222222222222222222222222
-opened file
-joining paths:/yaffs2/test_dir and UUUUUUUUUUUUUUUUUUU2
-trying to open file: /yaffs2/test_dir/UUUUUUUUUUUUUUUUUUU2
-opened file
-joining paths:/yaffs2/test_dir and U
-trying to open file: /yaffs2/test_dir/U
-opened file
-joining paths:/yaffs2/test_dir and \1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d2
-trying to open file: /yaffs2/test_dir/\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d\1d2
-opened file
-joining paths:/yaffs2/test_dir and IIIIIIIIIIIIIIIIIIIII\1d
-trying to open file: /yaffs2/test_dir/IIIIIIIIIIIIIIIIIIIII\1d
-opened file
-joining paths:/yaffs2/test_dir and AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-trying to open file: /yaffs2/test_dir/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-opened file
-joining paths:/yaffs2/test_dir and \ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5A
-trying to open file: /yaffs2/test_dir/\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5A
-opened file
-joining paths:/yaffs2/test_dir and
-trying to open file: /yaffs2/test_dir/
-opened file
-joining paths:/yaffs2/test_dir and VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
-trying to open file: /yaffs2/test_dir/VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
-opened file
-joining paths:/yaffs2/test_dir and XXXXXXXXXXXXXXV
-trying to open file: /yaffs2/test_dir/XXXXXXXXXXXXXXV
-opened file
-joining paths:/yaffs2/test_dir and HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHV
-trying to open file: /yaffs2/test_dir/HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
-opened file
-joining paths:/yaffs2/test_dir and DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDH
-trying to open file: /yaffs2/test_dir/DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDH
-opened file
-joining paths:/yaffs2/test_dir and -------------------------------------D
-trying to open file: /yaffs2/test_dir/-------------------------------------D
-opened file
-joining paths:/yaffs2/test_dir and rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrD
-trying to open file: /yaffs2/test_dir/rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrD
-opened file
-joining paths:/yaffs2/test_dir and pppppppppr
-trying to open file: /yaffs2/test_dir/pppppppppr
-opened file
-joining paths:/yaffs2/test_dir and |||||||||||||||||||||||||r
-trying to open file: /yaffs2/test_dir/|||||||||||||||||||||||||r
-opened file
-joining paths:/yaffs2/test_dir and \19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19r
-trying to open file: /yaffs2/test_dir/\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19\19r
-opened file
-joining paths:/yaffs2/test_dir and MM\19
-trying to open file: /yaffs2/test_dir/MM\19
-opened file
-joining paths:/yaffs2/test_dir and
-trying to open file: /yaffs2/test_dir/
-opened file
-joining paths:/yaffs2/test_dir and ppppppppp
-trying to open file: /yaffs2/test_dir/ppppppppp
-opened file
-joining paths:/yaffs2/test_dir and ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-trying to open file: /yaffs2/test_dir/;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-opened file
-joining paths:/yaffs2/test_dir and 55555;
-trying to open file: /yaffs2/test_dir/55555;
-opened file
-joining paths:/yaffs2/test_dir and *******************************************H
-trying to open file: /yaffs2/test_dir/*******************************************
-opened file
-joining paths:/yaffs2/test_dir and @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*
-trying to open file: /yaffs2/test_dir/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*
-opened file
-joining paths:/yaffs2/test_dir and fffffffffffffffffffffffff@
-trying to open file: /yaffs2/test_dir/fffffffffffffffffffffffff@
-opened file
-joining paths:/yaffs2/test_dir and #############################@
-trying to open file: /yaffs2/test_dir/#############################@
-opened file
-joining paths:/yaffs2/test_dir and YYYYYYYYYYYYYYYYYYY#
-trying to open file: /yaffs2/test_dir/YYYYYYYYYYYYYYYYYYY#
-opened file
-joining paths:/yaffs2/test_dir and 8888888888888888888888888888888888
-trying to open file: /yaffs2/test_dir/8888888888888888888888888888888888
-opened file
-joining paths:/yaffs2/test_dir and \ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3*
-trying to open file: /yaffs2/test_dir/\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3\ 3*
-opened file
-joining paths:/yaffs2/test_dir and \v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\ 3
-trying to open file: /yaffs2/test_dir/\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\ 3
-opened file
-joining paths:/yaffs2/test_dir and %%%%%%%%%%%%%%%%%%%%%%%%\ 3
-trying to open file: /yaffs2/test_dir/%%%%%%%%%%%%%%%%%%%%%%%%\ 3
-opened file
-joining paths:/yaffs2/test_dir and %
-trying to open file: /yaffs2/test_dir/%
-opened file
-joining paths:/yaffs2/test_dir and llllllllllllllllllllllllllllllllllllllllll*
-trying to open file: /yaffs2/test_dir/llllllllllllllllllllllllllllllllllllllllll*
-opened file
-joining paths:/yaffs2/test_dir and ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
-trying to open file: /yaffs2/test_dir/]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
-opened file
-joining paths:/yaffs2/test_dir and ]
-trying to open file: /yaffs2/test_dir/]
-opened file
-joining paths:/yaffs2/test_dir and ]
-trying to open file: /yaffs2/test_dir/]
-opened file
-joining paths:/yaffs2/test_dir and ]
-trying to open file: /yaffs2/test_dir/]
-opened file
-joining paths:/yaffs2/test_dir and JJJ]
-trying to open file: /yaffs2/test_dir/JJJ]
-opened file
-joining paths:/yaffs2/test_dir and DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD]
-trying to open file: /yaffs2/test_dir/DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD]
-opened file
-joining paths:/yaffs2/test_dir and [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]
-trying to open file: /yaffs2/test_dir/[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
-opened file
-joining paths:/yaffs2/test_dir and $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$[
-trying to open file: /yaffs2/test_dir/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$[
-opened file
-joining paths:/yaffs2/test_dir and 99999999999999999$
-trying to open file: /yaffs2/test_dir/99999999999999999$
-opened file
-joining paths:/yaffs2/test_dir and [
-trying to open file: /yaffs2/test_dir/ [
-opened file
-joining paths:/yaffs2/test_dir and YYYYYYYYYYYYYYY
-trying to open file: /yaffs2/test_dir/YYYYYYYYYYYYYYY
-opened file
-joining paths:/yaffs2/test_dir and aaaaaaaaaaaaaaaaaaaaaaaa
-trying to open file: /yaffs2/test_dir/aaaaaaaaaaaaaaaaaaaaaaaa
-opened file
-joining paths:/yaffs2/test_dir and &&&&&&&&&&&&&&&&&&&&&&&&
-trying to open file: /yaffs2/test_dir/&&&&&&&&&&&&&&&&&&&&&&&&
-opened file
-joining paths:/yaffs2/test_dir and >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-trying to open file: /yaffs2/test_dir/>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-opened file
-joining paths:/yaffs2/test_dir and BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB[
-trying to open file: /yaffs2/test_dir/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
-opened file
-joining paths:/yaffs2/test_dir and \ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4
-trying to open file: /yaffs2/test_dir/\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4\ 4
-opened file
-joining paths:/yaffs2/test_dir and ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\ 4
-trying to open file: /yaffs2/test_dir/,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\ 4
-opened file
-joining paths:/yaffs2/test_dir and ===================================,
-trying to open file: /yaffs2/test_dir/===================================,
-opened file
-joining paths:/yaffs2/test_dir and hhhhhh=
-trying to open file: /yaffs2/test_dir/hhhhhh=
-opened file
-joining paths:/yaffs2/test_dir and h
-trying to open file: /yaffs2/test_dir/h
-opened file
-joining paths:/yaffs2/test_dir and CCCCCCCC=
-trying to open file: /yaffs2/test_dir/CCCCCCCC=
-opened file
-joining paths:/yaffs2/test_dir and 9999C
-trying to open file: /yaffs2/test_dir/9999C
-opened file
-joining paths:/yaffs2/test_dir and qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq=
-trying to open file: /yaffs2/test_dir/qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq=
-opened file
-joining paths:/yaffs2/test_dir and YYYYYYYYYYYq
-trying to open file: /yaffs2/test_dir/YYYYYYYYYYYq
-opened file
-joining paths:/yaffs2/test_dir and AAAAAAAAAAAAAq
-trying to open file: /yaffs2/test_dir/AAAAAAAAAAAAAq
-opened file
-joining paths:/yaffs2/test_dir and ddddddddddddddddddddddddddddddddddddddddd\ 4
-trying to open file: /yaffs2/test_dir/ddddddddddddddddddddddddddddddddddddddddd\ 4
-opened file
-joining paths:/yaffs2/test_dir and [[[[[[[[[[[[[[[[[[[d
-trying to open file: /yaffs2/test_dir/[[[[[[[[[[[[[[[[[[[d
-opened file
-joining paths:/yaffs2/test_dir and BBBBBBBBBBBBB[
-trying to open file: /yaffs2/test_dir/BBBBBBBBBBBBB[
-opened file
-joining paths:/yaffs2/test_dir and 99999999999999999999999999999999d
-trying to open file: /yaffs2/test_dir/99999999999999999999999999999999d
-opened file
-joining paths:/yaffs2/test_dir and >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>d
-trying to open file: /yaffs2/test_dir/>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>d
-opened file
-joining paths:/yaffs2/test_dir and {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{\ 4
-trying to open file: /yaffs2/test_dir/{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
-opened file
-joining paths:/yaffs2/test_dir and 99999999999999999999999999999999999999999{
-trying to open file: /yaffs2/test_dir/99999999999999999999999999999999999999999{
-opened file
-joining paths:/yaffs2/test_dir and KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK9
-trying to open file: /yaffs2/test_dir/KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK9
-opened file
-joining paths:/yaffs2/test_dir and NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN9
-trying to open file: /yaffs2/test_dir/NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN9
-opened file
-joining paths:/yaffs2/test_dir and NNNNNNNNNNNNNNNNNNNNNNNN
-trying to open file: /yaffs2/test_dir/NNNNNNNNNNNNNNNNNNNNNNNN
-opened file
-joining paths:/yaffs2/test_dir and \ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-trying to open file: /yaffs2/test_dir/\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1\ 1
-opened file
-joining paths:/yaffs2/test_dir and mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\ 1
-trying to open file: /yaffs2/test_dir/mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\ 1
-opened file
-joining paths:/yaffs2/test_dir and $$$$$$$$$$$$$$m
-trying to open file: /yaffs2/test_dir/$$$$$$$$$$$$$$m
-opened file
-joining paths:/yaffs2/test_dir and 99999999999999999999999999999999999999999999999999
-trying to open file: /yaffs2/test_dir/9999999999999999999999999999999999999999999
-opened file
-joining paths:/yaffs2/test_dir and nnnnnnnn9
-trying to open file: /yaffs2/test_dir/nnnnnnnn9
-opened file
-joining paths:/yaffs2/test_dir and LLLLLLLLLLLLLLLLLLLLLLLLLLLLL9
-trying to open file: /yaffs2/test_dir/LLLLLLLLLLLLLLLLLLLLLLLLLLLLL9
-opened file
-joining paths:/yaffs2/test_dir and ==========================L
-trying to open file: /yaffs2/test_dir/==========================L
-opened file
-joining paths:/yaffs2/test_dir and YYYYYYYYYYYYYYYYYYYYYYYYYYYYY9
-trying to open file: /yaffs2/test_dir/YYYYYYYYYYYYYYYYYYYYYYYYYYYYY9
-
-error##########
-failed to open file
-error_code:
-Unknown error code
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * error_handler.c contains code for checking yaffs function calls for errors.
- */
-#include "error_handler.h"
-
-
-typedef struct error_codes_template {
- int code;
- char * text;
-}error_entry;
-
-const error_entry error_list[] = {
- { ENOMEM , "ENOMEM" },
- { EBUSY , "EBUSY"},
- { ENODEV , "ENODEV"},
- { EINVAL , "EINVAL"},
- { EBADF , "EBADF"},
- { EACCES , "EACCES"},
- { EXDEV , "EXDEV" },
- { ENOENT , "ENOENT"},
- { ENOSPC , "ENOSPC"},
- { ERANGE , "ERANGE"},
- { ENODATA, "ENODATA"},
- { ENOTEMPTY, "ENOTEMPTY"},
- { ENAMETOOLONG,"ENAMETOOLONG"},
- { ENOMEM , "ENOMEM"},
- { EEXIST , "EEXIST"},
- { ENOTDIR , "ENOTDIR"},
- { EISDIR , "EISDIR"},
- { 0, NULL }
-};
-
-const char * error_to_str(int err)
-{
- error_entry *e = error_list;
- if (err < 0)
- err = -err;
- while(e->code && e->text){
- if(err == e->code)
- return e->text;
- e++;
- }
- return "Unknown error code";
-}
-
-void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[]){
- char dummy[10];
- unsigned int x=0;
- int yaffs_error=-1;
- char error_found=0;
- if (output==-1)
- {
- add_to_buffer(message_buffer, "\nerror##########",MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR,PRINT);
- add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,PRINT);
- yaffs_error=yaffs_get_error();
- if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL) printf("%d\n",yaffs_error); /*cannot yet add int types to buffer. this is a quick fix*/
- add_to_buffer(message_buffer, error_to_str(yaffs_error),MESSAGE_LEVEL_ERROR,NPRINT);
- append_to_buffer(message_buffer, "\n\n",MESSAGE_LEVEL_ERROR,PRINT);
-
- scanf("%c",dummy); /*this line causes a segmentation fault. Need a better way of waiting for a key press*/
- //print_buffer(message_buffer,PRINT_ALL);
-
- }
- else{
- add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- }
-}
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __error_handler_h__
-#define __error_handler_h__
-#include <stdio.h>
-#include "message_buffer.h"
-#include "yaffsfs.h"
-#define DEBUG_LEVEL 5 /*set the debug level. this is used to display the relevent debug messages*/
-void yaffs_check_for_errors(char output, buffer *message_buffer, char error_message[], char success_message[]);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * message_buffer.c contains code for a message buffer .
- */
-
-#include "message_buffer.h"
-
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print){
- /*wrapper function for add_to_buffer_root_function*/
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,DO_NOT_APPEND_MESSAGE,print);
-}
-
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print){
- char message[20];
- sprintf(message, "%d",num);
- add_to_buffer_root_function(p_Buffer,message, message_level,APPEND_MESSAGE,print);
-}
-
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print){
- FILE *log_handle;
-
- if (append==APPEND_MESSAGE){ /* append current message*/
- strncat(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH);
- }
- else {
-
- /*move the head up one. the head always points at the last written data*/
- p_Buffer->head++;
-
- /*printf("p_Buffer->tail=%d\n",p_Buffer->tail);*/
- /*printf("p_Buffer->head=%d\n",p_Buffer->head);*/
- if (p_Buffer->head >=BUFFER_SIZE-1) {
- /*printf("buffer overflow\n");*/
- p_Buffer->head -= (BUFFER_SIZE-1); /*wrap the head around the buffer*/
- /*printf("new p_Buffer->head=%d\n",p_Buffer->head);*/
- }
- /*if the buffer is full then delete last entry by moving the tail*/
- if (p_Buffer->head==p_Buffer->tail){
- /*printf("moving buffer tail from %d to ",p_Buffer->tail);*/
- p_Buffer->tail++;
- if (p_Buffer->tail >=BUFFER_SIZE) p_Buffer->tail -= BUFFER_SIZE;/*wrap the tail around the buffer*/
- /*printf("%d\n",p_Buffer->tail);*/
-
- }
-
- p_Buffer->message_level[p_Buffer->head]=message_level; /*copy the message level*/
- strncpy(p_Buffer->message[p_Buffer->head],message,BUFFER_MESSAGE_LENGTH); /*copy the message*/
- /*printf("copied %s into p_Buffer->message[p_Buffer->head]: %s\n",message,p_Buffer->message[p_Buffer->head]);
- printf("extra %s\n",p_Buffer->message[p_Buffer->head]);*/
- }
- if ((p_Buffer->message_level[p_Buffer->head]<=DEBUG_LEVEL)&& (print==PRINT)){
- /*printf("printing buffer 1\n");
- // the print buffer function is not working this is just a quick fix
- print_buffer(p_Buffer,1); //if the debug level is higher enough then print the new message
- */
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- log_handle=fopen(LOG_FILE,"a");
- if (log_handle!=NULL){
- fputs(p_Buffer->message[p_Buffer->head],log_handle);
- fputs("\n",log_handle);
- fclose(log_handle);
- }
- }
-}
-
-
-
-void print_buffer(buffer *p_Buffer, int number_of_messages_to_print){
- int x=0;
- int i=0;
- printf("print buffer\n");
- printf("buffer head:%d\n",p_Buffer->head);
- printf("buffer tail:%d\n",p_Buffer->tail);
-
- if (number_of_messages_to_print==PRINT_ALL) number_of_messages_to_print=BUFFER_SIZE;
-// printf("number_of_messages_to_print=%d\n",number_of_messages_to_print);
- for (i=0,x=0; (x>=p_Buffer->tail) && (i<number_of_messages_to_print); i++, x--){
-// printf("printing buffer\n");
-// printf("x:%d\n",x);
- if (x<0) x = BUFFER_SIZE-1; /*wrap x around buffer*/
- printf("%s\n",p_Buffer->message[p_Buffer->head]);
- printf("printed buffer\n");
- }
-
-}
-
-
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __message_buffer__
-#define __message_buffer__
-
-#include <stdio.h>
-#include <string.h>
-#define PRINT 1
-#define NPRINT 0
-#define APPEND_MESSAGE 1
-#define DO_NOT_APPEND_MESSAGE 0
-#define PRINT_ALL -1 /*this is used to print all of the messages in a buffer*/
-#define BUFFER_MESSAGE_LENGTH 60 /*number of char in message*/
-#define BUFFER_SIZE 50 /*number of messages in buffer*/
-#define MESSAGE_LEVEL_ERROR 0
-#define MESSAGE_LEVEL_BASIC_TASKS 1
-
-#define LOG_FILE "log.txt"
-typedef struct buffer_template{
- char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
- int head;
- int tail;
- char message_level[BUFFER_SIZE];
-}buffer;
-#include "error_handler.h" /*include this for the debug level*/
-
-
-void print_buffer(buffer *p_Buffer,int number_of_messages_to_print); /*print messages in the buffer*/
-/*wrapper functions for add_to_buffer_root_function*/
-void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
-void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
-
-void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
-#endif
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * yaffs_tester.c designed to stress test yaffs2 direct.
- */
-
-
-#include "yaffs_tester.h"
-
-
-
-int random_seed;
-int simulate_power_failure = 0;
-
-
-buffer message_buffer; /*create message_buffer */
-
-
-
-int main(int argc, char *argv[]){
- char yaffs_test_dir[] ="/yaffs2/test_dir"; /*the path to the directory where all of the testing will take place*/
- char yaffs_mount_dir[]="/yaffs2/"; /*the path to the mount point which yaffs will mount*/
-
- init(yaffs_test_dir,yaffs_mount_dir,argc,argv);
- test(yaffs_test_dir);
- yaffs_unmount(yaffs_mount_dir);
- return 0;
-}
-
-
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]){
- char output=0;
- int x=0;
- int seed=-1;
- FILE *log_handle;
- /*these variables are already set to zero, but it is better not to take chances*/
- message_buffer.head=0;
- message_buffer.tail=0;
-
-
- log_handle=fopen(LOG_FILE,"w");
- if (log_handle!=NULL){
- fputs("log file for yaffs tester\n",log_handle);
- fclose(log_handle);
- }
- add_to_buffer(&message_buffer,"welcome to the yaffs tester",MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
- yaffs_start_up();
- yaffs_mount(yaffs_mount_dir);
- for (x=0;x<argc;x++){
-// add_to_buffer(&message_buffer,"argv ",MESSAGE_LEVEL_BASIC_TASKS,PRINT);
-// add_to_buffer(&message_buffer,argv[x],MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if (strcmp("-seed",argv[x])==0){ /*warning only compares the length of the strings, quick fix*/
- seed= atoi(argv[x+1]);
- /*add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,"\n",MESSAGE_LEVEL_BASIC_TASKS,PRINT);*/
- }
- }
- if (seed==-1){
- seed=time(NULL);
- srand(seed);
- }
- else {
- srand(seed);
- }
- add_to_buffer(&message_buffer,"setting seed to ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_int_to_buffer(&message_buffer,seed,MESSAGE_LEVEL_BASIC_TASKS,PRINT);/* print boot up message*/
-
- if (yaffs_access(yaffs_test_dir,0)) /* if the test folder does not exist then create it */
- {
- add_to_buffer(&message_buffer,"creating dir: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,yaffs_test_dir,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_mkdir(yaffs_test_dir,S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"could not create dir","created dir\n\n");
- }
-
-}
-void join_paths(char *path1,char *path2,char *new_path ){
-
-/* printf("strlen path1:%d\n",strlen(path1));
- printf("strlen path2:%d\n",strlen(path2));
- printf("path1; %s\n",path1);
-*/
- add_to_buffer(&message_buffer, "joining paths:",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path1,MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, " and ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer, path2,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') {
- /*paths are compatiable. concatanate them. note -2 is because of \0*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') {
- /*paths are compatiable. concatanate them*/
- strcat(new_path,path1);
- strcat(new_path,path2);
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
- //strcpy(new_path,strcat(path1,path2));
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') {
- /*need to add a "/". */
- strcat(new_path,path1);
- strcat(new_path,"/");
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strcat("/\0",path2)));
-
-#if 0
- copy_array(path1,new_path,0,0);
- copy_array('\0',new_path,0,(sizeof(path1)/sizeof(char)));
- copy_array(path2,new_path,0,(sizeof(path1)/sizeof(char))+1);
- old method now trying to use copy_array
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))+1];
- for (x=0;x<=(sizeof(path1)/sizeof(char))-1;x++){
- new_path[x]=path1[x];
- }
- new_path[x+1]='/';
- for (x=(sizeof(path1)/sizeof(char)) ,i=0 ;i<=(sizeof(path2)/sizeof(char));x++,i++){
- new_path[x]=path2[i];
- }
-#endif
-
- //return new_path;
- }
- else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') {
- /*need to remove a "/". */
- /*yaffs does not mind the extra slash. */
- //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))-1];
-
- strcat(new_path,path1);
- strcat(new_path,path2);
- //strcpy(new_path,strcat(path1,strncat("",path2,(sizeof(path1)/sizeof(char))-1)));
- //return new_path;
- }
- else{
- //error
- //return -1;
- }
-}
-
-
-
-void test(char*yaffs_test_dir){
- char output=0;
- char name[MAX_FILE_NAME_SIZE+3 ]="apple\0";
- char path[MAX_FILE_NAME_SIZE];
- join_paths(yaffs_test_dir,name,path);
- while(1)
- {
- path[0]='\0';// this should clear the path
- generate_random_string(name);
- join_paths(yaffs_test_dir,name,path);
- add_to_buffer(&message_buffer,"trying to open file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
- append_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
- output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE);
- yaffs_check_for_errors(output, &message_buffer,"failed to open file","opened file");
- }
-}
-void generate_random_string(char *ptr){
- unsigned int x;
- unsigned int length=((rand() %MAX_FILE_NAME_SIZE)+1); /*creates a int with the number of charecters been between 1 and 51*/
- char letter='\0';
- //printf("generating string\n");
- //printf("string length is %d\n",length);
- for (x=0; x <= (length-2) &&length>2 ; x++)
- {
- //printf("x=%d\n",x);
- /* keep generating a charecter until the charecter is legal*/
- while((letter=='\0' )||(letter=='/')||(letter=='\\')){
- letter=(rand() % 126-32)+32; /*generate a number between 32 and 126 and uses it as a charecter (letter) */
- }
- ptr[x]=letter;
- //printf("charecter generated is %c\n",ptr[x]);
- }
- ptr[x+1]='\0'; /*adds NULL charecter to turn it into a string*/
-
-}
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2010 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __YAFFS_TESTER_H__
- #define __YAFFS_TESTER_H__
-
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-
-#include "yaffsfs.h" /* it is in "yaffs2/direct/" link it in the Makefile */
-#include "message_buffer.h"
-#include "error_handler.h"
-
-
-#define MAX_FILE_NAME_SIZE 51
-
-void init(char *yaffs_test_dir,char *yaffs_mount_dir,int argc, char *argv[]); /*sets up yaffs and mounts yaffs */
-void test(char *yaffs_test_dir); /*contains the test code*/
-void generate_random_string(char *ptr); /*generates a random string of letters to be used for a name*/
-void join_paths(char *path1,char *path2,char *newpath );
-void copy_array(char *from,char *to, unsigned int from_offset,unsigned int to_offset);
-#endif