Changeset 623 for trunk/kernel/fs/vfs.h
- Timestamp:
- Mar 6, 2019, 4:37:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.h
r614 r623 108 108 /****************************************************************************************** 109 109 * This structure define a VFS inode. 110 * An inode hasseveral children dentries (if it is a directory), an can have several110 * An inode can have several children dentries (if it is a directory), an can have several 111 111 * parents dentries (if it hass several aliases links): 112 112 * - The "parents" field is the root of the xlist of parents dentries, and the "links" … … 166 166 remote_rwlock_t size_lock; /*! protect read/write to size */ 167 167 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 */170 168 struct mapper_s * mapper; /*! associated file cache */ 171 169 void * extend; /*! fs_type_specific inode extension */ … … 195 193 196 194 /****************************************************************************************** 197 * This structure defines a directory entry.195 Rpt* This structure defines a directory entry. 198 196 * A dentry contains the name of a remote file/dir, an extended pointer on the 199 197 * inode representing this file/dir, a local pointer on the inode representing … … 321 319 *****************************************************************************************/ 322 320 error_t vfs_inode_create( vfs_fs_type_t fs_type, 323 vfs_inode_type_t inode_type,324 321 uint32_t attr, 325 322 uint32_t rights, … … 349 346 350 347 /****************************************************************************************** 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. 353 351 ***************************************************************************************** 354 352 * @ 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 *****************************************************************************************/ 355 void vfs_inode_update_size( xptr_t inode_xp, 356 uint32_t size ); 359 357 360 358 /****************************************************************************************** … … 451 449 * This function releases memory allocated to a local file descriptor. 452 450 * 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. 456 452 ****************************************************************************************** 457 453 * @ file : local pointer on file descriptor. … … 465 461 void vfs_file_count_up ( xptr_t file_xp ); 466 462 void 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 *****************************************************************************************/ 472 void vfs_file_get_name( xptr_t inode_xp, 473 char * name ); 467 474 468 475 … … 537 544 * Only the distributed Inode Tree is modified: it does NOT modify the parent mapper, 538 545 * and does NOT update the FS on IOC device. 546 * It set the inode type to the default INODE_TYPE_FILE value 539 547 * It can be executed by any thread running in any cluster (can be different from both 540 548 * the child cluster and the parent cluster). … … 552 560 ****************************************************************************************** 553 561 * @ child_inode_cxy : [in] target cluster for child inode. 554 * @ child_inode_type : [in] child inode type555 562 * @ fs_type : [in] child inode FS type. 556 563 * @ parent_inode_xp : [in] extended pointer on parent inode. … … 561 568 *****************************************************************************************/ 562 569 error_t vfs_add_child_in_parent( cxy_t child_inode_cxy, 563 vfs_inode_type_t child_inode_type,564 570 vfs_fs_type_t fs_type, 565 571 xptr_t parent_inode_xp, … … 729 735 /****************************************************************************************** 730 736 * 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, 733 744 * using remote accesses. 734 * 2) The memory allocated to file descriptor in cluster containing the inode is released.735 * It requires aRPC 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[]. 739 750 * @ returns 0 if success / -1 if error. 740 751 *****************************************************************************************/ … … 877 888 /****************************************************************************************** 878 889 * 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>. 880 891 * Depending on the file system type, it calls the proper, FS specific function. 881 892 * It is used in case of MISS on the mapper, or when a dirty page in the mapper must … … 918 929 * Finally, it synchronously updates the parent directory on IOC device. 919 930 * 931 * Depending on the file system type, it calls the relevant, FS specific function. 920 932 * 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. 922 934 ****************************************************************************************** 923 935 * @ parent : local pointer on parent (directory) inode. … … 933 945 * and updates both the child inode descriptor, identified by the <child_xp> argument, 934 946 * 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. 936 948 * - It set the "extend" field in dentry descriptor. 937 949 * It is called by the vfs_lookup() function in case of miss. … … 939 951 * Depending on the file system type, it calls the relevant, FS specific function. 940 952 * 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. 942 954 ****************************************************************************************** 943 955 * @ parent : local pointer on parent inode (directory). 944 956 * @ name : child name. 945 957 * @ child_xp : extended pointer on remote child inode (file or directory) 946 * @ return 0 if success / return ENOENT ifnot 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 *****************************************************************************************/ 960 error_t vfs_fs_new_dentry( vfs_inode_t * parent, 949 961 char * name, 950 962 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 *****************************************************************************************/ 980 error_t vfs_fs_update_dentry( vfs_inode_t * inode, 981 vfs_dentry_t * dentry, 982 uint32_t size ); 951 983 952 984 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.