{
sprintf(str,"%s/%s",dname,de->d_name);
- yaffs_stat(str,&s);
+ yaffs_lstat(str,&s);
printf("%s ino %d length %d mode %X ",de->d_name,(int)s.st_ino,(int)s.st_size,s.st_mode);
switch(s.st_mode & S_IFMT)
dumpDir("/boot");
// Check stat
- r = yaffs_stat("/boot/file with a long name",&ystat);
+ r = yaffs_lstat("/boot/file with a long name",&ystat);
// Check rename
// Check chmod
- yaffs_stat("/boot/yyfile",&ystat);
+ yaffs_lstat("/boot/yyfile",&ystat);
temp_mode = ystat.st_mode;
yaffs_chmod("/boot/yyfile",0x55555);
yaffs_mount(path);
- yaffs_stat(path,&s);
+ yaffs_lstat(path,&s);
printf("root perms after mount %x\n",s.st_mode);
yaffs_chmod(path, 0777);
- yaffs_stat(path,&s);
+ yaffs_lstat(path,&s);
printf("root perms after setting to 0777 is %x\n",s.st_mode);
yaffs_unmount(path);
n = yaffs_getxattr(path,name,buffer,sizeof(buffer));
if(n >= 0){
- __u8 *b = (__u8 *)buffer;
+ u8 *b = (u8 *)buffer;
printf("%d bytes:",n);
if(n > 10)
}
-void dump_dev_stats(yaffs_dev_t *dev, const char * str)
+void dump_dev_stats(struct yaffs_dev *dev, const char * str)
{
printf("%s\n",str);
printf( "space free %d erased %d "
char name0[100];
char name1[100];
int i;
- yaffs_dev_t *dev;
+ struct yaffs_dev *dev;
yaffs_trace_mask = 0;
}
+void link_follow_test(const char *mountpt)
+{
+ char fn[100];
+ char sn[100];
+ char hn[100];
+ int result;
+ int h;
+
+ yaffs_trace_mask = 0;
+
+ yaffs_start_up();
+
+ yaffs_mount(mountpt);
+
+ sprintf(fn,"%s/file",mountpt);
+ sprintf(sn,"%s/sym",mountpt);
+ sprintf(hn,"%s/hl-sym",mountpt);
+
+ h = yaffs_open(fn,O_CREAT| O_RDWR, S_IREAD | S_IWRITE);
+ result = yaffs_close(h);
+
+ result = yaffs_symlink(fn,sn);
+ result = yaffs_link(sn,hn);
+
+ h =yaffs_open(hn,O_RDWR,0);
+
+}
+
int random_seed;
int simulate_power_failure;
//null_name_test("yaffs2");
test_flash_traffic("yaffs2");
+ link_follow_test("/yaffs2");
return 0;