mmap on jffs2

leeyang leeyang at ycig.com
Sun Apr 20 10:00:51 EDT 2003


I am using jffs2 on a ppc860 system(amd29lv160).
Things seems ok,but when I am trying mmap.

I want to mmap a file in flash,so i can treat
the file like some records.

I mean operation like
 fd = open("/usr/dat/sot.dat",O_RDWR,FILEMODE);
 
 ptr1=mmap(NULL,filesize,PROT_READ|PROT_WRITE,
   MAP_SHARED,fd,0);

fd returns 3 and it is ok,however ptr1 returns -1.
I checked the errno it said invalid argument.

I have to say arguments "filesize" above is not
aligment to any requirements,just the real file
size?Does it matter?

The same procedure can done on common ext2
so i wonder jffs2 implement all the features like
ext2?

leeyang







More information about the linux-mtd mailing list