Changeset 238 for trunk/kernel/vfs/vfs.h


Ignore:
Timestamp:
Jul 19, 2017, 3:31:39 PM (7 years ago)
Author:
alain
Message:

Fixing bugs in vfs_lookup()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/vfs/vfs.h

    r204 r238  
    399399void vfs_inode_destroy( vfs_inode_t *  inode ); 
    400400
     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 *****************************************************************************************/
     414error_t vfs_inode_load( vfs_inode_t * parent,
     415                        char        * name,
     416                        xptr_t        child_xp );
     417
    401418/******************************************************************************************
    402419 * This function atomically increment/decrement the inode refcount.
     
    617634 * @ pathname    : path in kernel space (can be relative or absolute).
    618635 * @ 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.
    620637 * @ return 0 if success / ENOENT if inode not found , EACCES if permissopn denied,
    621638 *                        EAGAIN if a new complete lookup must be made
     
    635652 * 2) The inode and its associated mapper are created in cluster identified by <child_cxy>.
    636653 *    The new inode and the parent inode can have different FS types.
    637  * 3) The "child_xp" field in created dentry (pointing on thecreated inode) is updated.
     654 * 3) The "child_xp" field in created dentry (pointing on the created inode) is updated.
    638655 ******************************************************************************************
    639656 * @ child_cxy  : target cluster for child inode.
     
    666683 * This recursive function diplays a complete inode/dentry sub-tree.
    667684 * Any inode can be selected as the sub-tree root.
    668  * TODO this function is not ptotected against a concurrent node removal...
     685 * TODO this function is not protected against a concurrent inode/dentry removal...
    669686 ******************************************************************************************
    670687 * @ inode_xp   : extended pointer on sub-tree root inode.
     
    857874
    858875/******************************************************************************************
    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.
    861879 * Depending on the file system type, it calls the proper, FS specific function.
    862880 * It must be executed by a thread running in the cluster containing the mapper.
     
    864882 * It takes the mapper lock before launching the IO operation.
    865883 ******************************************************************************************
    866  * @ page   : local pointer on the page descriptor.
     884 * @ page      : local pointer on the page descriptor.
     885 * @ to_mapper : transfer direction.
    867886 * @ returns 0 if success / return EINVAL if it cannot access the external device.
    868887 *****************************************************************************************/
    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.
     888error_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.
    874895 * Depending on the file system type, it calls the proper, FS specific function.
    875896 * 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.
    877898 * 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 *****************************************************************************************/
     903error_t vfs_mapper_load_all( vfs_inode_t * inode );
    912904
    913905
Note: See TracChangeset for help on using the changeset viewer.