Changeset 238 for trunk/kernel/vfs/vfs.h
- Timestamp:
- Jul 19, 2017, 3:31:39 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/vfs/vfs.h
r204 r238 399 399 void vfs_inode_destroy( vfs_inode_t * inode ); 400 400 401 /****************************************************************************************** 402 * This function scan an existing parent inode directory, identified by the <parent> 403 * argument to find a directory entry identified by the <name> argument, and update 404 * the remote child inode, identified by the <child_xp> argument. 405 * Depending on the file system type, it calls the relevant, FS specific function, 406 * to scan the directory, and set the "type", "size", and "extend" fields. 407 * It must be called by a thread running in the cluster containing the parent inode. 408 ****************************************************************************************** 409 * @ parent : local pointer on parent inode (directory). 410 * @ name : child name. 411 * @ child_xp : extended pointer on remote child inode (file or directory) 412 * @ return 0 if success / return ENOENT if not found. 413 *****************************************************************************************/ 414 error_t vfs_inode_load( vfs_inode_t * parent, 415 char * name, 416 xptr_t child_xp ); 417 401 418 /****************************************************************************************** 402 419 * This function atomically increment/decrement the inode refcount. … … 617 634 * @ pathname : path in kernel space (can be relative or absolute). 618 635 * @ lookup_mode : flags defining the working mode (defined above in this file). 619 * @ inode_xp : [out] buffer for extended pointer on inode.636 * @ inode_xp : [out] buffer for extended pointer on searched inode. 620 637 * @ return 0 if success / ENOENT if inode not found , EACCES if permissopn denied, 621 638 * EAGAIN if a new complete lookup must be made … … 635 652 * 2) The inode and its associated mapper are created in cluster identified by <child_cxy>. 636 653 * The new inode and the parent inode can have different FS types. 637 * 3) The "child_xp" field in created dentry (pointing on the created inode) is updated.654 * 3) The "child_xp" field in created dentry (pointing on the created inode) is updated. 638 655 ****************************************************************************************** 639 656 * @ child_cxy : target cluster for child inode. … … 666 683 * This recursive function diplays a complete inode/dentry sub-tree. 667 684 * Any inode can be selected as the sub-tree root. 668 * TODO this function is not p totected against a concurrent noderemoval...685 * TODO this function is not protected against a concurrent inode/dentry removal... 669 686 ****************************************************************************************** 670 687 * @ inode_xp : extended pointer on sub-tree root inode. … … 857 874 858 875 /****************************************************************************************** 859 * This function makes an I/O operation to move one page from VFS to a given mapper, 860 * in case of MISS on the mapper cache. 876 * This function makes an I/O operation to move one page to/from device from/to the mapper. 877 * It is used in case of MISS on the mapper, or when a dirty page in the mapper must 878 * be updated in the File System. 861 879 * Depending on the file system type, it calls the proper, FS specific function. 862 880 * It must be executed by a thread running in the cluster containing the mapper. … … 864 882 * It takes the mapper lock before launching the IO operation. 865 883 ****************************************************************************************** 866 * @ page : local pointer on the page descriptor. 884 * @ page : local pointer on the page descriptor. 885 * @ to_mapper : transfer direction. 867 886 * @ returns 0 if success / return EINVAL if it cannot access the external device. 868 887 *****************************************************************************************/ 869 error_t vfs_move_page_to_mapper( struct page_s * page ); 870 871 /****************************************************************************************** 872 * This function makes an I/0 operation to move one page from a given mapper to VFS, 873 * when a dirty page in the mapper cache must be updated in the File System. 888 error_t vfs_mapper_move_page( struct page_s * page, 889 bool_t to_mapper ); 890 891 /****************************************************************************************** 892 * This function makes an I/O operation to move, from device to mapper, all pages covering 893 * a given inode, identified by the <inode> argument. It can be a directory or a file, 894 * but is mainly used to load (prefetch) a complete directory in the inode mapper. 874 895 * Depending on the file system type, it calls the proper, FS specific function. 875 896 * It must be executed by a thread running in the cluster containing the mapper. 876 * The mapper pointer is obtained from the page descriptor.897 * The mapper pointer is obtained from the inode descriptor. 877 898 * It takes the mapper lock before launching the IO operation. 878 * It does nothing if the page is not dirty. If the page is dirty, it clear the page 879 * dirty bit, and remove the page from the PPM dirty list. 880 ****************************************************************************************** 881 * @ page : local pointer on the page descriptor. 882 * @ returns 0 if success / return EINVAL if it cannot access the external device. 883 *****************************************************************************************/ 884 error_t vfs_move_page_from_mapper( struct page_s * page ); 885 886 887 888 889 890 891 /////////////////////////////////////////////////////////////////////////////////////////// 892 // These typedef define the FS specific operations that must be implemented by any 893 // specific file system to be supported by the ALMOS_MKH VFS. 894 // These typedef are not actually used, and are only defined for documentation 895 /////////////////////////////////////////////////////////////////////////////////////////// 896 897 typedef error_t (fs_init_t) ( xptr_t vfs_root_xp ); 898 899 typedef error_t (fs_inode_extend_t) ( struct vfs_inode_s * inode, 900 void * extend ); 901 902 typedef void (fs_inode_release_t) ( struct vfs_inode_s * inode ); 903 904 typedef error_t (fs_write_page_t) ( struct page_s * page ); 905 906 typedef error_t (fs_read_page_t) ( struct page_s * page ); 907 908 909 910 911 899 ****************************************************************************************** 900 * @ inode : local pointer on inode. 901 * @ return 0 if success / return EIO if device access failure. 902 *****************************************************************************************/ 903 error_t vfs_mapper_load_all( vfs_inode_t * inode ); 912 904 913 905
Note: See TracChangeset
for help on using the changeset viewer.