int jffs2_do_reserve_space (struct jffs2_sb_info * c, uint32_t minsize, uint32_t * ofs, uint32_t * len);
Requests a block of physical space on the flash. Returns zero for success and puts 'ofs' and 'len' into the appriopriate place, or returns -ENOSPC or other error if appropriate.
If it returns zero, jffs2_reserve_space also downs the per-filesystem allocation semaphore, to prevent more than one allocation from being active at any time. The semaphore is later released by jffs2_commit_allocation
jffs2_reserve_space may trigger garbage collection in order to make room for the requested allocation.