This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: blib node allocation problem with FAT FS



I found the problem. The reference count was decrementing below 0. Here
is a fix for fatfs_node_unref() in fatfs_ncache.c.

 if (node->refcnt)
       node->refcnt--;

It could be that you have fixed the symptom and not the cause. Why is it being unreferenced more times than it is referenced? Maybe there is a missing ref() so you could get file corrupt?

Before i commit this i want a clear explanation why your change is
correct.

I also found that if you change the 512 to 32768 (sector size) in fatfs.c
call to cyg_blib_io_create() you get a 50% - 60% increase in disk
throughput, especially with large files. (driver reads writes clusters
not sectors)

Which driver? I quickly looked at the IDE and the MMC driver and both appear to read/write blocks.

There is a FIXME where the cyg_blib_io_create() is, saying to get the
block size from the device. Maybe you want to implement this?

I think the block change will work with any IDE driver. The IDE Block size is 512 but by changing the size to 32768 you read write multiple blocks at one time. This makes the throughput much faster especially with DMA mode.


As for the fix to fatfs_node_unref() in fatfs_ncache.c, I will check into it further.

Steve


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]