Changeset 612 for trunk/kernel/fs/vfs.h


Ignore:
Timestamp:
Jan 11, 2019, 6:35:07 PM (5 years ago)
Author:
alain
Message:

Fix several bugs in vfs.c, fatfs.c, and devfs.c to support
the <.> and <..> directory entries.

File:
1 edited

Legend:

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

    r611 r612  
    467467
    468468
     469
    469470/******************************************************************************************
    470471 *        These functions access / modify the distributed VFS Inode Tree
     
    599600 * @ return 0 if success / -1 if failure.
    600601 *****************************************************************************************/
    601 error_t vfs_new_child_init( xptr_t   parent_xp,
    602                             xptr_t   dentry_xp,
    603                             xptr_t   child_xp );
    604 
    605 /******************************************************************************************
    606  * This function is called by the vfs_mkdir() function to create the two special dentries
    607  * <.> and <..> in a new directory identified by the <child_xp> argument. The parent
    608  * directory inode is defined by the <parent_xp> argument.
    609  * The two dentries are introduced in the Inode Tree. They are also introduced in the
    610  * in the child directory mapper, and the IOC device is updated.
     602error_t vfs_new_dentry_init( xptr_t   parent_xp,
     603                             xptr_t   dentry_xp,
     604                             xptr_t   child_xp );
     605
     606/******************************************************************************************
     607 * This function creates in the directory identified by the <child_xp> argument,
     608 * the two special dentries <.> and <..>. The parent directory inode is defined
     609 * by the <parent_xp> argument. The two dentries are introduced in the Inode Tree.
     610 * They are also introduced in the child directory mapper, and the IOC device is updated.
     611 * This function is called by all functions creating a brand new directory : vfs_mkdir(),
     612 * devfs_global_init(), and devfs_local_init().
    611613 ******************************************************************************************
    612614 * @ child_xp    : extended pointer on new directory inode.
     
    633635                                       uint32_t           fs_type,
    634636                                       struct process_s * process );
     637
    635638
    636639
     
    865868
    866869
    867 /******************************************************************************************
    868  *        These functions define the VFS "FS" API (to a specific File System)
     870
     871
     872/******************************************************************************************
     873 *        These functions define the VFS "FS" API to a specific File System
    869874 *****************************************************************************************/
    870875
     
    923928 * @ return 0 if success / return ENOENT if not found.
    924929 *****************************************************************************************/
    925 error_t vfs_fs_child_init( vfs_inode_t * parent,
     930error_t vfs_fs_get_dentry( vfs_inode_t * parent,
    926931                           char        * name,
    927932                           xptr_t        child_xp );
    928933
     934/******************************************************************************************
     935 * This function scan the mapper of an an existing parent inode directory, identified by
     936 * the <inode> argument and copy up to <max_dirent> valid dentries to a
     937 * local dirent array, defined by the <array> argument. The <min_dentry> argument defines
     938 * the index of the first dentry to copied to the target dirent array.
     939 * This function returns in the <entries> buffer the number of dentries actually written,
     940 * and signals in the <done> buffer when the last valid entry has been found.
     941 * If the <detailed> argument is true, a dentry/inode couple that does not exist in
     942 * the Inode Tree is dynamically created, and all dirent fiels are documented in the
     943 * dirent array. Otherwise, only the dentry name is documented.
     944 *
     945 * Depending on the file system type, it calls the relevant, FS specific function.
     946 * It must be called by a thread running in the cluster containing the parent inode.
     947 * This function does NOT take any lock.
     948 ******************************************************************************************
     949 * @ inode      : [in]  local pointer on directory inode.
     950 * @ array      : [in]  local pointer on array of dirents.
     951 * @ max_dirent : [in]  max number of slots in dirent array.
     952 * @ min_dentry : [in]  index of first dentry to be copied into array.
     953 * @ detailed   : [in]  dynamic inode creation if true.
     954 * @ entries    : [out] number of dentries actually copied into array.
     955 * @ done       : [out] Boolean true when last entry found.
     956 * @ return 0 if success / return -1 if failure.
     957 *****************************************************************************************/
     958error_t vfs_fs_get_user_dir( vfs_inode_t   * inode,
     959                             struct dirent * array,
     960                             uint32_t        max_dirent,
     961                             uint32_t        min_dentry,
     962                             bool_t          detailed,
     963                             uint32_t      * entries,
     964                             bool_t        * done );
     965 
    929966/*****************************************************************************************
    930967 * This function  updates the FS on the IOC device for a given inode identified by
Note: See TracChangeset for help on using the changeset viewer.