Commit b20611b2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4c142f02
...@@ -52,12 +52,23 @@ struct bigfile_ops { ...@@ -52,12 +52,23 @@ struct bigfile_ops {
/* loadblk is called to load file block into memory. /* loadblk is called to load file block into memory.
* *
* NOTE loadblk is called from SIGSEGV signal handler context. * NOTE loadblk is called from SIGSEGV signal handler context.
* XXX loadblk -> !mmap_read ?
* *
* len(buf) must be = file->blksize. * len(buf) must be = file->blksize.
* @return 0 - ok !0 - fail * @return 0 - ok !0 - fail
*/ */
int (*loadblk) (BigFile *file, blk_t blk, void *buf); int (*loadblk) (BigFile *file, blk_t blk, void *buf);
/* mmap_read is called to mmap read-only file[offset +len) into @addr.
*
* XXX mmap_read -> !loadblk ?
* NOTE offset and len are in bytes, not pages.
*
* @addr NULL - mmap at anywhere, !NULL - mmap exactly at addr.
* @return !NULL - mapped there, NULL - error.
*/
void*(*mmap_read)(BigFile *file, void *addr, off_t pgoffset, size_t len);
/* storeblk is called to store file block from memory. /* storeblk is called to store file block from memory.
* *
* NOTE contrary to loadblk, storeblk is called from regular context. * NOTE contrary to loadblk, storeblk is called from regular context.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment