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


Ignore:
Timestamp:
Mar 6, 2019, 4:37:15 PM (3 years ago)
Author:
alain
Message:

Introduce three new types of vsegs (KCODE,KDATA,KDEV)
to map the kernel vsegs in the process VSL and GPT.
This now used by both the TSAR and the I86 architectures.

File:
1 edited

Legend:

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

    r614 r623  
    108108/******************************************************************************************
    109109 * This structure define a VFS inode.
    110  * An inode has several children dentries (if it is a directory), an can have several
     110 * An inode can have several children dentries (if it is a directory), an can have several
    111111 * parents dentries (if it hass several aliases links):
    112112 * - The "parents" field is the root of the xlist of parents dentries, and the "links"
     
    166166        remote_rwlock_t    size_lock;        /*! protect read/write to size                  */
    167167        remote_rwlock_t    main_lock;        /*! protect inode tree traversal and modifs     */
    168 //  list_entry_t       list;             /*! member of set of inodes in same cluster     */
    169 //  list_entry_t       wait_root;        /*! root of threads waiting on this inode       */
    170168        struct mapper_s  * mapper;           /*! associated file cache                       */
    171169        void             * extend;           /*! fs_type_specific inode extension            */
     
    195193
    196194/******************************************************************************************
    197  * This structure defines a directory entry.
     195 Rpt* This structure defines a directory entry.
    198196 * A dentry contains the name of a remote file/dir, an extended pointer on the
    199197 * inode representing this file/dir, a local pointer on the inode representing
     
    321319 *****************************************************************************************/
    322320error_t vfs_inode_create( vfs_fs_type_t     fs_type,
    323                           vfs_inode_type_t  inode_type,
    324321                          uint32_t          attr,
    325322                          uint32_t          rights,
     
    349346
    350347/******************************************************************************************
    351  * This function set the <size> of a file/dir to a remote inode,
    352  * taking the remote_rwlock protecting <size> in WRITE_MODE.
     348 * This function updates the "size" field of a remote inode identified by <inode_xp>.
     349 * It takes the rwlock protecting the file size in WRITE_MODE, and set the "size" field
     350 * when the current size is smaller than the requested <size> argument.
    353351 *****************************************************************************************
    354352 * @ inode_xp  : extended pointer on the remote inode.
    355  * @ size      : value to be written.
    356  *****************************************************************************************/
    357 void vfs_inode_set_size( xptr_t   inode_xp,
    358                          uint32_t size );
     353 * @ size      : requested size value.
     354 *****************************************************************************************/
     355void vfs_inode_update_size( xptr_t   inode_xp,
     356                            uint32_t size );
    359357
    360358/******************************************************************************************
     
    451449 * This function releases memory allocated to a local file descriptor.
    452450 * It must be executed by a thread running in the cluster containing the inode,
    453  * and the file refcount must be zero.
    454  * If the client thread is not running in the owner cluster, it must use the
    455  * rpc_vfs_file_destroy_client() function.
     451 * and the file refcount must be zero. Use the RPC_VFS_FILE_DESTROY if required.
    456452 ******************************************************************************************
    457453 * @ file  : local pointer on file descriptor.
     
    465461void vfs_file_count_up  ( xptr_t   file_xp );
    466462void vfs_file_count_down( xptr_t   file_xp );
     463
     464/******************************************************************************************
     465 * This debug function copies the name of a the file identified by <file_xp>
     466 * argument to a local buffer identified by the <name> argument.
     467 * The local buffer size must be at least CONFIG_VFS_MAX_NAME_LENGTH.
     468 *****************************************************************************************
     469 * @ file_xp  : extended pointer on the remote inode.
     470 * @ name     : local buffer pointer.
     471 *****************************************************************************************/
     472void vfs_file_get_name( xptr_t inode_xp,
     473                        char * name );
    467474
    468475
     
    537544 * Only the distributed Inode Tree is modified: it does NOT modify the parent mapper,
    538545 * and does NOT update the FS on IOC device.
     546 * It set the inode type to the default INODE_TYPE_FILE value
    539547 * It can be executed by any thread running in any cluster (can be different from both
    540548 * the child cluster and the parent cluster).
     
    552560 ******************************************************************************************
    553561 * @ child_inode_cxy  : [in]  target cluster for child inode.
    554  * @ child_inode_type : [in]  child inode type
    555562 * @ fs_type          : [in]  child inode FS type.
    556563 * @ parent_inode_xp  : [in]  extended pointer on parent inode.
     
    561568 *****************************************************************************************/
    562569error_t vfs_add_child_in_parent( cxy_t              child_inode_cxy,
    563                                  vfs_inode_type_t   child_inode_type,
    564570                                 vfs_fs_type_t      fs_type,
    565571                                 xptr_t             parent_inode_xp,
     
    729735/******************************************************************************************
    730736 * This function close the - non-replicated - file descriptor identified by the <file_xp>
    731  * and <file_id> arguments.
    732  * 1) All entries in the fd_array copies are directly reset by the calling thread,
     737 * and <file_id> arguments. The <file_id> is required to reset the fd_array[] slot.
     738 * It can be called by a thread running in any cluster, and executes the following actions:
     739 * 1) It access the block device to updates all dirty pages from the mapper associated
     740 *    to the file, and removes these pages from the dirty list, using an RPC if required.
     741 * 2) It updates the file size in all parent directory mapper(s), and update the modified
     742 *    pages on the block device, using RPCs if required.
     743 * 3) All entries in the fd_array copies are directly reset by the calling thread,
    733744 *    using remote accesses.
    734  * 2) The memory allocated to file descriptor in cluster containing the inode is released.
    735  *    It requires a RPC if cluster containing the file descriptor is remote.
    736  ******************************************************************************************
    737  * @ file_xp     : extended pointer on the file descriptor in owner cluster.
    738  * @ file_id     : file descriptor index in fd_array.
     745 * 4) The memory allocated to file descriptor in cluster containing the inode is released,
     746 *    using an RPC if cluster containing the file descriptor is remote.
     747 ******************************************************************************************
     748 * @ file_xp     : extended pointer on the file descriptor.
     749 * @ file_id     : file descriptor index in fd_array[].
    739750 * @ returns 0 if success / -1 if error.
    740751 *****************************************************************************************/
     
    877888/******************************************************************************************
    878889 * This function makes the I/O operation to move one page identified by the <page_xp>
    879  * argument to/from the IOC device from/to the mapper, as defined by <cmd_type>.
     890 * argument to/from the IOC device from/to the mapper, as defined by the <cmd_type>.
    880891 * Depending on the file system type, it calls the proper, FS specific function.
    881892 * It is used in case of MISS on the mapper, or when a dirty page in the mapper must
     
    918929 * Finally, it synchronously updates the parent directory on IOC device.
    919930 *
     931 * Depending on the file system type, it calls the relevant, FS specific function.
    920932 * It must be executed by a thread running in the cluster containing the parent directory.
    921  * It can be the RPC_VFS_VS_REMOVE_DENTRY. This function does NOT take any lock.
     933 * It can be the RPC_VFS_FS_REMOVE_DENTRY. This function does NOT take any lock.
    922934 ******************************************************************************************
    923935 * @ parent  : local pointer on parent (directory) inode.
     
    933945 * and updates both the child inode descriptor, identified by the <child_xp> argument,
    934946 * and the associated dentry descriptor :
    935  * - It set the "size", and "extend" fields in inode descriptor.
     947 * - It set the "size", "type", and "extend" fields in inode descriptor.
    936948 * - It set the "extend" field in dentry descriptor.
    937949 * It is called by the vfs_lookup() function in case of miss.
     
    939951 * Depending on the file system type, it calls the relevant, FS specific function.
    940952 * It must be called by a thread running in the cluster containing the parent inode.
    941  * This function does NOT take any lock.
     953 * It can be the RPC_VFS_FS_NEW_DENTRY. This function does NOT take any lock.
    942954 ******************************************************************************************
    943955 * @ parent    : local pointer on parent inode (directory).
    944956 * @ name      : child name.
    945957 * @ child_xp  : extended pointer on remote child inode (file or directory)
    946  * @ return 0 if success / return ENOENT if not found.
    947  *****************************************************************************************/
    948 error_t vfs_fs_get_dentry( vfs_inode_t * parent,
     958 * @ return 0 if success / return -1 if dentry not found.
     959 *****************************************************************************************/
     960error_t vfs_fs_new_dentry( vfs_inode_t * parent,
    949961                           char        * name,
    950962                           xptr_t        child_xp );
     963
     964/******************************************************************************************
     965 * This function scan the mapper of an an existing inode directory, identified by
     966 * the <inode> argument, to find a directory entry identified by the <dentry> argument,
     967 * and update the size for this directory entry in mapper, as defined by <size>.
     968 * The searched "name" is defined in the <dentry> argument, that must be in the same
     969 * cluster as the parent inode. It is called by the vfs_close() function.
     970 *
     971 * Depending on the file system type, it calls the relevant, FS specific function.
     972 * It must be called by a thread running in the cluster containing the parent inode.
     973 * It can be the RPC_VFS_FS_UPDATE_DENTRY. This function does NOT take any lock.
     974 ******************************************************************************************
     975 * @ parent    : local pointer on parent inode (directory).
     976 * @ dentry    : local pointer on dentry.
     977 * @ size      : new size value (bytes).
     978 * @ return 0 if success / return ENOENT if not found.
     979 *****************************************************************************************/
     980error_t vfs_fs_update_dentry( vfs_inode_t  * inode,
     981                              vfs_dentry_t * dentry,
     982                              uint32_t       size );
    951983
    952984/******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.