User Tools

Site Tools


developersguide:vmcalls

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
developersguide:vmcalls [2014/11/18 17:50]
dcvmoole [C Interface] update for interface change in git-e321f65
developersguide:vmcalls [2015/09/19 16:44]
dcvmoole [C Interface] the spanish inquisition of VM calls
Line 28: Line 28:
 ==== C Interface ==== ==== C Interface ====
  
-There are three calls, ''​vm_set_cacheblock'',​ ''​vm_map_cacheblock'',​ and ''​vm_clear_cache''​.+There are four calls, ''​vm_set_cacheblock'',​ ''​vm_map_cacheblock'',​ ''​vm_forget_cacheblock'',​ and ''​vm_clear_cache''​.
  
 <​code>​ <​code>​
-int vm_set_cacheblock(void *block, ​u32_t dev, u64_t dev_offset,​ +int vm_set_cacheblock(void *block, ​dev_t dev, off_t dev_offset,​ 
-u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize, int setflags);+ino_t ino, off_t ino_offset, u32_t *flags, int blocksize, int setflags);
 </​code>​ </​code>​
  
Line 49: Line 49:
  
 <​code>​ <​code>​
-void *vm_map_cacheblock(u32_t dev, u64_t dev_offset,​ +void *vm_map_cacheblock(dev_t dev, off_t dev_offset,​ 
-        ​u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize);+        ​ino_t ino, off_t ino_offset, u32_t *flags, int blocksize);
 </​code>​ </​code>​
  
Line 59: Line 59:
  
 <​code>​ <​code>​
-int vm_clear_cache(u32_t dev);+int vm_forget_cacheblock(dev_t dev, off_t dev_offset, int blocksize);​ 
 +</​code>​ 
 + 
 +This call requests that the block identified by the device number and offset be thrown out of the VM cache. Any previous inode association for this block is therefore broken as well. The call returns OK on success, even if no matching block was found. An error code is returned if the given parameter are invalid. 
 + 
 +<​code>​ 
 +int vm_clear_cache(dev_t dev);
 </​code>​ </​code>​
  
 This call requests that VM forget all blocks associated with the given device. This call should be used (directly or indirectly) by file systems when 1) they get a <fs small>​REQ_FLUSH</​fs>​ request from VFS, and 2) when they successfully unmount. This ensures that no stale blocks remain in VM, which could cause corruption upon recall later. This call requests that VM forget all blocks associated with the given device. This call should be used (directly or indirectly) by file systems when 1) they get a <fs small>​REQ_FLUSH</​fs>​ request from VFS, and 2) when they successfully unmount. This ensures that no stale blocks remain in VM, which could cause corruption upon recall later.
  
developersguide/vmcalls.txt · Last modified: 2015/09/19 16:46 by dcvmoole