Changeset 611 for trunk/kernel/fs/vfs.h
- Timestamp:
- Jan 9, 2019, 3:02:51 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.h
r610 r611 45 45 46 46 struct vfs_inode_s; 47 struct vfs_dentry_t; 48 struct vfs_ctx_t; 49 struct vfs_file_ref_s; 47 struct vfs_dentry_s; 48 struct vfs_ctx_s; 50 49 struct vfs_file_s; 51 52 struct vfs_inode_op_s;53 struct vfs_dentry_op_s;54 struct vfs_file_op_s;55 struct vfs_ctx_op_s;56 57 struct vfs_lookup_cmd_s;58 struct vfs_lookup_rsp_s;59 50 60 51 struct mapper_s; … … 63 54 struct vseg_s; 64 55 struct page_s; 65 66 56 67 57 /****************************************************************************************** … … 133 123 *****************************************************************************************/ 134 124 135 /* this enum define the VFS inode types values */ 136 /* WARNING : this enum must be kept consistent with macros in <shared_stat.h> file */ 125 /* this enum define the VFS inode types values */ 126 /* WARNING : this enum must be kept consistent with macros in <shared_stat.h> file */ 127 /* and with types in <shared_dirent.h> file. */ 137 128 138 129 typedef enum … … 144 135 INODE_TYPE_SOCK = 4, /*! POSIX socket */ 145 136 INODE_TYPE_DEV = 5, /*! character device */ 146 INODE_TYPE_SYML = 6, /*! symbolic link */ 137 INODE_TYPE_BLK = 6, /*! block device */ 138 INODE_TYPE_SYML = 7, /*! symbolic link */ 147 139 } 148 140 vfs_inode_type_t; … … 184 176 #define VFS_ISUID 0x0004000 185 177 #define VFS_ISGID 0x0002000 186 define VFS_ISVTX 0x0001000178 #define VFS_ISVTX 0x0001000 187 179 188 180 #define VFS_IRWXU 0x0000700 … … 316 308 * This function allocates memory from local cluster for an inode descriptor and the 317 309 * associated mapper. It initialise these descriptors from arguments values. 318 * If the client thread is not running in the cluster containing this inode, 319 * it must use the rpc_vfs_inode_create_client() function. 310 * It must called by a local thread. Use the RPC_INODE_CREATE if client thread is remote. 320 311 ****************************************************************************************** 321 312 * @ fs_type : file system type. … … 407 398 408 399 400 409 401 /****************************************************************************************** 410 402 * These low-level functions access / modify a VFS dentry descriptor … … 414 406 * This function allocates memory from local cluster for a dentry descriptor, 415 407 * initialises it from arguments values, and returns the extended pointer on dentry. 416 * If the client thread is not running in the target cluster for this inode, 417 * it must use the rpc_dentry_create_client() function. 408 * It must called by a local thread. Use the RPC_DENTRY_CREATE if client thread is remote. 418 409 ****************************************************************************************** 419 410 * @ fs_type : file system type. … … 548 539 * 549 540 * [Implementation] 550 * As there are cross-references between the inode and the associated dentry, this551 * function implementa three steps scenario :541 * As there are cross-references between inode and dentry, this function implements 542 * a three steps scenario : 552 543 * 1) The dentry descriptor is created in the cluster containing the existing <parent_xp> 553 * inode, and is only partially initialized : "fs_type", "name", "parent_xp" fields.544 * inode, and partially initialized, using the RPC_VFS_CREATE DENTRY if required. 554 545 * 2) The inode and its associated mapper are created in cluster identified by <child_cxy>, 555 * and initialised. The new inode and the parent inode can have different FS types. 556 * 3) The "child_xp" field in dentry (pointing on the created inode) is updated, 557 * and the refcount is incremented for both the inode and the dentry. 546 * and partially initialised, using the RPC_VFS_CREATE_INODE if required. 547 * The new inode and the parent inode can have different FS types. 548 * 3) The pointers between the parent inode, the new dentry, and the child inode 549 * are updated, using remote accesses. 558 550 ****************************************************************************************** 559 551 * @ child_inode_cxy : [in] target cluster for child inode. … … 612 604 613 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. 611 ****************************************************************************************** 612 * @ child_xp : extended pointer on new directory inode. 613 * @ parent_xp : extended pointer on parent directory inode. 614 * @ return 0 if success / -1 if failure. 615 *****************************************************************************************/ 616 error_t vfs_add_special_dentries( xptr_t child_xp, 617 xptr_t parent_xp ); 618 619 /****************************************************************************************** 614 620 * This recursive function diplays a complete inode/dentry sub-tree. 615 621 * Any inode can be selected as the sub-tree root. 616 * TODOthis function is not protected against a concurrent inode/dentry removal...622 * WARNING : this function is not protected against a concurrent inode/dentry removal... 617 623 ****************************************************************************************** 618 624 * @ inode_xp : extended pointer on sub-tree root inode. … … 809 815 810 816 /****************************************************************************************** 811 * This function returns, in the structure pointed by the <k_dirent> kernel pointer,812 * various infos on the directory entry currently pointed by the <file_xp> file descriptor.813 * TODO not implemented yet...814 ******************************************************************************************815 * @ file_xp : extended pointer on the file descriptor of the searched directory .816 * @ k_dirent : local pointer on the dirent structure in kernel space.817 * @ returns 0 if success / -1 if error.818 *****************************************************************************************/819 error_t vfs_readdir( xptr_t file_xp,820 struct dirent * k_dirent );821 822 /******************************************************************************************823 817 * This function creates a new directory as defined by the <root_xp> & <path> arguments. 824 818 * TODO not implemented yet... … … 880 874 * The directory inode descriptor and the dentry descriptor are in the same cluster. 881 875 * Depending on the file system type, it calls the proper, FS specific function. 882 * It ulsopdates the dentry descriptor and/or the inode descriptor extensions876 * It also updates the dentry descriptor and/or the inode descriptor extensions 883 877 * as required by the specific file system type. 884 878 * Finally, it synchronously updates the parent directory on IOC device. 885 879 * 886 880 * It must be executed by a thread running in the cluster containing the parent directory. 887 * It can be the RPC_VFS_ VS_ADD_DENTRY. This function does NOT take any lock.881 * It can be the RPC_VFS_FS_ADD_DENTRY. This function does NOT take any lock. 888 882 ****************************************************************************************** 889 883 * @ parent : local pointer on parent (directory) inode.
Note: See TracChangeset
for help on using the changeset viewer.