2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2011 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Timothy Manning <timothy@yaffs.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
22 struct bovver_context *bc = (struct bovver_context *)x;
29 struct yaffs_stat stat_buffer;
36 i = rand() % BOVVER_HANDLES;
37 op = rand() % bc->opMax;
38 pos = rand() & 20000000;
44 sprintf(name, "%s/xx%d",bc->baseDir,n);
45 sprintf(name1,"%s/xx%d",bc->baseDir,n1);
53 yaffs_close(bc->h[i]);
62 bc->h[i] = yaffs_open(name,O_CREAT| O_RDWR, 0666);
68 yaffs_lseek(bc->h[i],pos,SEEK_SET);
69 yaffs_write(bc->h[i],name,n);
80 yaffs_rename(name,name1);
85 yaffs_mkdir(name,0666);
101 yaffs_fsync(bc->h[i]);
108 yaffs_fdatasync(bc->h[i]);
115 yaffs_flush(bc->h[i]);
122 if((bc->h[i]>= 0) && (bc->h[i+1] < 0)){
123 bc->h[i+1]=yaffs_dup(bc->h[i]);
130 yaffs_ftruncate(bc->h[i],n);
138 yaffs_fstat(bc->h[i],&stat_buffer);
139 yaffs_fchmod(bc->h[i], n);
140 yaffs_fchmod(bc->h[i], ((S_IREAD|S_IWRITE)&(stat_buffer.st_mode)));
146 yaffs_stat(name,&stat_buffer);
147 yaffs_chmod(name, n);
148 yaffs_chmod(name, ((S_IREAD|S_IWRITE)&(stat_buffer.st_mode)));
154 yaffs_lstat(name,&stat_buffer);
160 yaffs_read(bc->h[i],name,n);
167 yaffs_pread(bc->h[i],name,n,n1);
174 yaffs_write(bc->h[i],name,n);
181 yaffs_pwrite(bc->h[i],name,n,n1);
188 yaffs_truncate(name,n);
195 yaffs_access(name,n);
202 yaffs_symlink(name,name1);
209 yaffs_link(name,name1);