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


Ignore:
Timestamp:
Aug 13, 2018, 1:43:20 PM (3 years ago)
Author:
alain
Message:

Introduce the math library, to support the floating point
data used by the multi-thread fft application.
Fix several bugs regarding the FPU context save/restore.
Introduce support for the %f format in printf.

File:
1 edited

Legend:

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

    r457 r459  
    227227 * It is not replicated, and is dynamically allocated in the cluster that contains
    228228 * the inode, when a thread makes an open() or opendir() system call.
    229  * It cannot exist a file structure without an inode structure.
     229 * It cannot exist a file structure without an inode structure in same cluster.
    230230 * As the fd_array (containing extended pointers on the open file descriptors)
    231231 * is replicated in all process descriptors, we need a references counter.
     
    338338 * @ gid        : group owner ID.
    339339 * @ inode_xp   : [out] buffer for extended pointer on created inode.
    340  * # return 0 if success / return ENOMEM or EINVAL if error.
     340 * @ return 0 if success / return ENOMEM or EINVAL if error.
    341341 *****************************************************************************************/
    342342error_t vfs_inode_create( xptr_t            dentry_xp,
     
    353353 * This function releases memory allocated to an inode descriptor.
    354354 * It must be executed by a thread running in the cluster containing the inode,
    355  * and the inode refcount must be zero.
    356  * If the client thread is not running in the owner cluster, it must use the
    357  * rpc_vfs_inode_destroy_client() function.
     355 * and the inode refcount must be zero. If the client thread is not running in the owner
     356 * cluster, you must use the rpc_vfs_inode_destroy_client() function.
    358357 ******************************************************************************************
    359358 * @ inode  : local pointer on inode descriptor.
    360  *****************************************************************************************/
    361 void vfs_inode_destroy( vfs_inode_t *  inode ); 
     359 * @ return 0 if success / return EINVAL if error.
     360 *****************************************************************************************/
     361error_t vfs_inode_destroy( vfs_inode_t *  inode ); 
    362362
    363363/******************************************************************************************
     
    432432
    433433
    434 
    435 
    436 
    437 
    438 /******************************************************************************************
    439  * This function TODO                                                         
    440  *****************************************************************************************/
    441 error_t vfs_inode_trunc( vfs_inode_t * inode );
    442 
    443 /******************************************************************************************
    444  * This function TODO                                                         
    445  *****************************************************************************************/
    446 error_t vfs_inode_link( vfs_inode_t * inode,
    447                         uint32_t      igc );
    448 
    449 /******************************************************************************************
    450  * This function TODO                                                         
    451  *****************************************************************************************/
    452 error_t vfs_inode_unlink( vfs_inode_t * inode );
    453 
    454 
    455434/*****************************************************************************************/
    456435/***************** Dentry related functions **********************************************/
     
    478457 * This function releases memory allocated to a dentry descriptor.
    479458 * It must be executed by a thread running in the cluster containing the dentry,
    480  * and the dentry refcount must be zero.
    481  * If the client thread is not running in the owner cluster, it must use the
    482  * rpc_dentry_destroy_client() function.
     459 * and the dentry refcount must be zero. If the client thread is not running in the owner
     460 * cluster, you must use the rpc_dentry_destroy_client() function.
    483461 ******************************************************************************************
    484462 * @ dentry  : local pointer on dentry descriptor.
    485  *****************************************************************************************/
    486 void vfs_dentry_destroy( vfs_dentry_t *  dentry ); 
     463 * @ return 0 if success / return EINVAL if error.
     464 *****************************************************************************************/
     465error_t vfs_dentry_destroy( vfs_dentry_t *  dentry ); 
    487466
    488467/******************************************************************************************
     
    562541 * This function takes a pathname (absolute or relative to cwd) and returns an extended
    563542 * pointer on the associated inode.
    564  * - If a given name in the path is not found in the inode tree, it try to load the missing
    565  *   dentry/inode couple, from informations found in the parent directory.
     543 * - If a given directory name in the path is not found in the inode tree, it try to load
     544 *   the missing dentry/inode couple, from informations found in the parent directory.
    566545 * - If this directory entry does not exist on device, it returns an error.
    567546 * - If the the file identified by the pathname does not exist on device but the
     
    613592 * This function removes a couple dentry/inode from the Inode-Tree, and remove it from
    614593 * the external device.
    615  * TODO                   
    616594 ******************************************************************************************
    617595 * @ child_xp   : extended pointer on removed inode.
    618596 *****************************************************************************************/
    619 error_t vfs_remove_child_from_parent( xptr_t child_xp );
     597error_t vfs_remove_child_from_parent( xptr_t inode_xp );
    620598
    621599/******************************************************************************************
     
    716694
    717695/******************************************************************************************
    718  * This function close an open file descriptor:
    719  * 1) All entries in fd_array copies are directly cancelled by the calling thread,
     696 * This function close the -non-replicated- file descriptor identified by the <file_xp>
     697 * and <file_id> arguments.
     698 * 1) All entries in the fd_array copies are directly reset by the calling thread,
    720699 *    using remote accesses.
    721700 * 2) The memory allocated to file descriptor in cluster containing the inode is released.
    722701 *    It requires a RPC if cluster containing the file descriptor is remote.
    723702 ******************************************************************************************
    724  * @ file_xp     : extended pointer on the file descriptor.
     703 * @ file_xp     : extended pointer on the file descriptor in owner cluster.
    725704 * @ file_id     : file descriptor index in fd_array.
    726705 * @ returns 0 if success / -1 if error.
     
    848827
    849828/******************************************************************************************
    850  * This function makes I/O operations to move, from device to mapper, all pages covering
    851  * a given inode, identified by the <inode> argument. Inode be a directory or a file,
    852  * but this function is mainly used to load (prefetch) a complete directory to the mapper.
     829 * This function makes the I/O operations required to move, from device to mapper,
     830 * all pages covering a given inode, identified by the <inode> argument. The target
     831 * inode can be a directory or a file, but this function is mainly used to load (prefetch)
     832 * a complete directory to the mapper.
    853833 * Depending on the file system type, it calls the proper, FS specific function.
    854834 * It must be executed by a thread running in the cluster containing the mapper.
     
    862842
    863843
    864 
    865 /* deprecated [AG]
    866 
    867 typedef error_t (lookup_inode_t)  ( vfs_inode_t  * parent ,
    868                                     vfs_dentry_t * dentry );
    869 
    870 typedef error_t (write_inode_t)   ( vfs_inode_t  * inode );
    871 
    872 typedef error_t (release_inode_t) ( vfs_inode_t  * inode );
    873 
    874 typedef error_t (unlink_inode_t)  ( vfs_inode_t  * parent,
    875                                     vfs_dentry_t * dentry,
    876                                     uint32_t       flags );
    877 
    878 typedef error_t (stat_inode_t)    ( vfs_inode_t  * inode );
    879 
    880 typedef error_t (trunc_inode_t)   ( vfs_inode_t  * inode );
    881 
    882 typedef error_t (delete_inode_t)  ( vfs_inode_t  * inode );
    883 
    884 typedef struct vfs_inode_op_s
    885 {
    886         init_inode_t    * init;   
    887         create_inode_t  * create; 
    888         lookup_inode_t  * lookup; 
    889         write_inode_t   * write;
    890         release_inode_t * release;
    891         unlink_inode_t  * unlink;
    892         delete_inode_t  * delete;
    893         stat_inode_t    * stat;
    894         trunc_inode_t   * trunc;    // change the size of a file
    895 }
    896 vfs_inode_op_t;
    897 
    898  ******************************************************************************************
    899  * These typedef define the set of FS specific operations on a VFS DENTRY descriptor.
    900  * They must be implemented by any specific file system to be supported by ALMOS_MKH.
    901  * This code is not actually used, and is only defined for documentation
    902  ******************************************************************************************
    903 
    904 
    905 typedef error_t (vfs_compare_dentry_t) ( char * first , char * second );
    906 
    907 typedef struct vfs_dentry_op_s
    908 {
    909         vfs_compare_dentry_t * compare;
    910 }
    911 vfs_dentry_op_t;
    912 
    913 
    914  ******************************************************************************************
    915  * These typedef define the set of FS specific operations on FILE descriptors
    916  * They must be implemented by any specific file system to be supported by ALMOS_MKH.
    917  * This code is not actually used, and is only defined for documentation
    918  ******************************************************************************************
    919 
    920 
    921 typedef error_t (open_file_t   ) ( vfs_file_t * file,
    922                                    void       * extend );
    923 
    924 typedef error_t (read_file_t   ) ( vfs_file_t * file,
    925                                    char       * buffer,
    926                                    uint32_t     count );
    927 
    928 typedef error_t (write_file_t  ) ( vfs_file_t * file,
    929                                    char       * buffer,
    930                                    uint32_t     count );
    931 
    932 typedef error_t (lseek_file_t  ) ( vfs_file_t * file );
    933 
    934 typedef error_t (close_file_t  ) ( vfs_file_t * file );
    935 
    936 typedef error_t (release_file_t) ( vfs_file_t * file );
    937 
    938 typedef error_t (read_dir_t    ) ( vfs_file_t * file );
    939 
    940 typedef error_t (mmap_file_t   ) ( vfs_file_t    * file ,
    941                                    struct vseg_s * vseg );
    942 
    943 typedef error_t (munmap_file_t ) ( vfs_file_t    * file,
    944                                    struct vseg_s * vseg );
    945 
    946 typedef struct vfs_file_op_s
    947 {
    948         open_file_t    * open;
    949         read_file_t    * read;
    950         write_file_t   * write;
    951         lseek_file_t   * lseek;
    952         read_dir_t     * readdir;
    953         close_file_t   * close;
    954         release_file_t * release;
    955         mmap_file_t    * mmap;
    956         munmap_file_t  * munmap;
    957 }
    958 vfs_file_op_t;
    959 
    960 */
    961 
    962844#endif  /* _VFS_H_ */
Note: See TracChangeset for help on using the changeset viewer.