EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Unable to write file using callbacks

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#17097
Posted: 07/21/2011 06:23:20
by Ash Williams (Basic support level)
Joined: 07/21/2011
Posts: 2

I am evaluating the SolFS callback system for a new project. We have taken the Eldos SolFS Win32 Samples "Callback" example and created a C++ application which uses the C style Storage calls and callbacks. I have successfully created a SolFS storage area of 7798784 pages with 512 byte page size using StorageCreateCB() and I can open it using StorageOpenCB().

When I try to add a file to the open SolFS storage, I am performing the following:

1. StorageCreateFile()
2. StorageWriteFile()
3. StorageCloseFile()

However, StorageCreateFile() never completes (at least within the 15 minutes I left it running). What appears to be happening is SolFS reads the first few pages (the SolFS "catalogue"?) then starts seeking/reading through the available 7798784 pages, I assume for a location where the SolFSCreateFile() will store the data when StorageWriteFile() is called? Is this correct?

Code
SolFSSeekFile called: Offset 0, Origin 0
SolFSWriteFile called: Count 512
W [0, 1] '      '
SolFSSeekFile called: Offset 262144, Origin 0
SolFSReadFile called: Count 512
R [512, 1] ''
SolFSSeekFile called: Offset 393216, Origin 0
SolFSReadFile called: Count 512
R [768, 1] ''
SolFSSeekFile called: Offset 524288, Origin 0
SolFSReadFile called: Count 512
R [1024, 1] ''
SolFSSeekFile called: Offset 655360, Origin 0
SolFSReadFile called: Count 512
R [1280, 1] ''
SolFSSeekFile called: Offset 786432, Origin 0
SolFSReadFile called: Count 512
R [1536, 1] ''
SolFSSeekFile called: Offset 917504, Origin 0
SolFSReadFile called: Count 512
R [1792, 1] ''
SolFSSeekFile called: Offset 1048576, Origin 0
SolFSReadFile called: Count 512
R [2048, 1] ''
SolFSSeekFile called: Offset 1179648, Origin 0
SolFSReadFile called: Count 512
R [2304, 1] ''
SolFSSeekFile called: Offset 1310720, Origin 0
SolFSReadFile called: Count 512
R [2560, 1] ''
SolFSSeekFile called: Offset 1441792, Origin 0
SolFSReadFile called: Count 512
R [2816, 1] ''
repeats with incremented difference Offset
etc


Other than changing the page size, is there a way to get SolFS to use the next available area of free space in the page list, because at present it doesn't seem to be doing that?

Thanks.
#17099
Posted: 07/21/2011 08:18:25
by Ash Williams (Basic support level)
Joined: 07/21/2011
Posts: 2

I forgot to ask, is there anything else I should be calling after StorageCreateCB() to finish initialising the storage area? I already call:

- StorageSetMaxPageCount()
- StorageSetAutoCompact()
#17101
Posted: 07/21/2011 09:49:32
by Eugene Mayevski (EldoS Corp.)

Thank you for contacting us.

SetMaxPageCount is not mandatory (if you don't set it, the storage will grow indefinitely).

What you observe is normal behavior: SolFS format is built the way that SolFS scans the whole storage to read what is analog to FAT or MFT (in SolFS this structure is spread across the whole storage, this is needed to have resizable storages). Every 16th page is read, if memory serves (the developer will be able to tell exactly). With tiny page sizes this does take lots of time. If you make a small storage or increase page size to 64Kb (for example), you will see that operations are done much faster.

In SolFS 5, which is still in progress, but whose beta version is expected during summer, speed of storage scanning will be significantly increased (8x or 16x, again I don't remember exactly).

So I suggest that you do take small storage and make your callbacks work right with it. Then you can play with page sizes.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 2333 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!