Changeset 610 for trunk/kernel/fs/vfs.h
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.h
r602 r610 69 69 *****************************************************************************************/ 70 70 71 #define VFS_LOOKUP_DIR 0x01 /* the searched inode is a directory*/71 #define VFS_LOOKUP_DIR 0x01 /* the searched inode must be a directory */ 72 72 #define VFS_LOOKUP_OPEN 0x02 /* the search is for an open/opendir */ 73 73 #define VFS_LOOKUP_PARENT 0x04 /* return the parent inode (not the inode itself) */ 74 74 #define VFS_LOOKUP_CREATE 0x10 /* file must be created if missing */ 75 #define VFS_LOOKUP_EXCL 0x20 /* file cannot previously exist */ 75 #define VFS_LOOKUP_EXCL 0x20 /* file cannot previously exist */ 76 76 77 77 /****************************************************************************************** … … 117 117 /****************************************************************************************** 118 118 * This structure define a VFS inode. 119 * It contains an extended pointer on the parent dentry, and (for directory only) 120 * an hash table (xhtab) registering all children dentries. 121 * The <parent> inode is unique for a directory (no hard links for directories). 122 * For a file, the parent field points to the first dentry who created this inode. 119 * An inode has several children dentries (if it is a directory), an can have several 120 * parents dentries (if it hass several aliases links): 121 * - The "parents" field is the root of the xlist of parents dentries, and the "links" 122 * fiels define the number of aliases parent dentries. only a FILE inode can have 123 * several parents (no hard links for directories). 124 * - The "children" field is an embedded xhtab containing pointers on all local children 125 * dentries. This set of children is empty for a FILE inode. 123 126 * Synchronisation: 124 * - the main_lock (remote_ busylock) is used during the inode tree traversal,125 * or for inode modification (add/remove children ).126 * - the data_lock (remote_rwlock) is used during read/write accesses to the data127 * stored in the mapper.128 * - the mapper lock (remote rwlock) is only used during the radix tree traversal129 * to return the relevant page for read/write.127 * - the main_lock (remote_rwlock) is used during the inode tree traversal, 128 * or for inode modification (add/remove children in xhtab). 129 * - the size_lock (remote_rwlock) is used during read/write accesses to the size 130 * field in the mapper. 131 * - access to the data stored in the associated mapper use the mapper remote_rwlock 132 * protecting radix tree traversal and modifications. 130 133 *****************************************************************************************/ 131 134 … … 158 161 { 159 162 struct vfs_ctx_s * ctx; /*! local pointer on FS context */ 160 uint32_t gc; /*! generation counter */161 163 uint32_t inum; /*! inode identifier (unique in file system) */ 162 164 uint32_t attr; /*! inode attributes (see above) */ 163 165 vfs_inode_type_t type; /*! inode type (see above) */ 164 166 uint32_t size; /*! number of bytes */ 165 uint32_t links; /*! number of alias dentry */166 167 uint32_t uid; /*! user owner identifier */ 167 168 uint32_t gid; /*! group owner identifier */ 168 169 uint32_t rights; /*! access rights */ 169 uint32_t refcount; /*! reference counter (all pointers)*/170 xptr_t parent_xp; /*! extended pointer on parent dentry*/170 xlist_entry_t parents; /*! root of list of parents dentries */ 171 uint32_t links; /*! number of parent dentries (hard links) */ 171 172 xhtab_t children; /*! embedded xhtab of children dentries */ 172 remote_rwlock_t data_lock; /*! protect read/write to data and to size*/173 remote_ busylock_tmain_lock; /*! protect inode tree traversal and modifs */174 175 xlist_entry_twait_root; /*! root of threads waiting on this inode */173 remote_rwlock_t size_lock; /*! protect read/write to size */ 174 remote_rwlock_t main_lock; /*! protect inode tree traversal and modifs */ 175 // list_entry_t list; /*! member of set of inodes in same cluster */ 176 // list_entry_t wait_root; /*! root of threads waiting on this inode */ 176 177 struct mapper_s * mapper; /*! associated file cache */ 177 178 void * extend; /*! fs_type_specific inode extension */ … … 183 184 #define VFS_ISUID 0x0004000 184 185 #define VFS_ISGID 0x0002000 185 #define VFS_ISVTX 0x0001000186 define VFS_ISVTX 0x0001000 186 187 187 188 #define VFS_IRWXU 0x0000700 … … 203 204 * This structure defines a directory entry. 204 205 * A dentry contains the name of a remote file/dir, an extended pointer on the 205 * inode representing this file/dir, a nd alocal pointer on the inode representing206 * inode representing this file/dir, a local pointer on the inode representing 206 207 * the parent directory. 208 * A dentry can be member of the set of children of a given directory inode (xhtab). 209 * A dentry can be member of the set of parents of a given inode (xlist). 207 210 *****************************************************************************************/ 208 211 … … 212 215 char name[CONFIG_VFS_MAX_NAME_LENGTH]; 213 216 uint32_t length; /*! name length (bytes) */ 214 uint32_t refcount; /*! reference counter (all pointers) */215 217 struct vfs_inode_s * parent; /*! local pointer on parent inode */ 216 218 xptr_t child_xp; /*! extended pointer on child inode */ 217 xlist_entry_t list; /*! member of list of dentries with same key */ 219 xlist_entry_t children; /*! member of set of children dentries */ 220 xlist_entry_t parents; /*! member of set of parent dentries */ 218 221 void * extend; /*! FS specific extension */ 219 222 } … … 301 304 302 305 303 304 306 /****************************************************************************************** 305 307 * These low-level functions access / modify a VFS inode descriptor … … 314 316 * This function allocates memory from local cluster for an inode descriptor and the 315 317 * associated mapper. It initialise these descriptors from arguments values. 316 * The parent dentry must have been previously created.317 318 * If the client thread is not running in the cluster containing this inode, 318 319 * it must use the rpc_vfs_inode_create_client() function. 319 320 ****************************************************************************************** 320 * @ dentry_xp : extended pointer on associated dentry (in parent inode cluster).321 321 * @ fs_type : file system type. 322 322 * @ inode_type : inode type. … … 328 328 * @ return 0 if success / return ENOMEM or EINVAL if error. 329 329 *****************************************************************************************/ 330 error_t vfs_inode_create( xptr_t dentry_xp, 331 vfs_fs_type_t fs_type, 330 error_t vfs_inode_create( vfs_fs_type_t fs_type, 332 331 vfs_inode_type_t inode_type, 333 332 uint32_t attr, … … 340 339 * This function releases memory allocated to an inode descriptor, including 341 340 * all memory allocated to the mapper (both mapper descriptor and radix tree). 342 * The mapper should not contain any dirty page (shold be synchronized before deletion), 343 * and the inode refcount must be zero. 341 * The mapper should not contain any dirty page (should be synchronized before deletion). 344 342 * It must be executed by a thread running in the cluster containing the inode. 345 343 * Use the rpc_vfs_inode_destroy_client() function if required. … … 348 346 *****************************************************************************************/ 349 347 void vfs_inode_destroy( vfs_inode_t * inode ); 350 351 /******************************************************************************************352 * This function atomically increment/decrement the inode refcount.353 * It can be called by any thread running in any cluster.354 *****************************************************************************************/355 void vfs_inode_remote_up( xptr_t inode_xp );356 void vfs_inode_remote_down( xptr_t inode_xp );357 348 358 349 /****************************************************************************************** … … 423 414 * This function allocates memory from local cluster for a dentry descriptor, 424 415 * initialises it from arguments values, and returns the extended pointer on dentry. 425 * The inode field is not initialized, because the inode does not exist yet.426 416 * If the client thread is not running in the target cluster for this inode, 427 417 * it must use the rpc_dentry_create_client() function. … … 429 419 * @ fs_type : file system type. 430 420 * @ name : directory entry file/dir name. 431 * @ parent : local pointer on parent inode.432 421 * @ dentry_xp : [out] buffer for extended pointer on created dentry. 433 422 * @ return 0 if success / return ENOMEM or EINVAL if error. … … 435 424 error_t vfs_dentry_create( vfs_fs_type_t fs_type, 436 425 char * name, 437 vfs_inode_t * parent,438 426 xptr_t * dentry_xp ); 439 427 440 428 /****************************************************************************************** 441 * This function re leases memory allocated to a dentry descriptor.442 * The dentry refcount must be zero.429 * This function removes the dentry from the parent inode xhtab, and releases the memory 430 * allocated to the dentry descriptor. 443 431 * It must be executed by a thread running in the cluster containing the dentry. 444 432 * Use the rpc_vfs_dentry_destroy_client() function if required. … … 447 435 *****************************************************************************************/ 448 436 void vfs_dentry_destroy( vfs_dentry_t * dentry ); 449 450 /******************************************************************************************451 * These functions atomically increment/decrement the dentry refcount.452 * It can be called by any thread running in any cluster.453 *****************************************************************************************/454 void vfs_dentry_remote_up( xptr_t dentry_xp );455 void vfs_dentry_remote_down( xptr_t dentry_xp );456 437 457 438 … … 496 477 497 478 /****************************************************************************************** 498 * These functions access / modify the distributed VFS Inode Tree e499 *****************************************************************************************/ 500 501 /****************************************************************************************** 502 * This function returns in a kernel bufferallocated by the caller function,503 * the pathname of a file/dir identified by an extended pointer on the inode.479 * These functions access / modify the distributed VFS Inode Tree 480 *****************************************************************************************/ 481 482 /****************************************************************************************** 483 * This function returns in a kernel <buffer> allocated by the caller function, 484 * the pathname of a file/dir identified by the <inode_xp> argument. 504 485 * It traverse the Inode Tree from the target node to the root. 505 486 * It can be called by any thread running in any cluster. 506 ****************************************************************************************** 507 * @ inode_xp : pointer on inode descriptor. 508 * @ buffer : kernel buffer for pathname (must be allocated by caller). 509 * @ size : max number of characters in buffer. 487 * As this buffer if filled in "reverse order" (i.e. from the target inode to the root), 488 * the pathname is stored in the higher part of the buffer. 489 * A pointer on the first character of the pathname is returned in <first> buffer. 490 * 491 * WARNING : This function takes & releases the remote_rwlock protecting the Inode Tree. 492 ****************************************************************************************** 493 * @ inode_xp : [in] extended pointer on target inode descriptor. 494 * @ buffer : [in] kernel buffer for pathname (allocated by caller). 495 * @ first : [out] pointer on first character in buffer. 496 * @ max_size : [in] max number of characters in buffer. 510 497 * @ return 0 if success / return EINVAL if buffer too small. 511 498 *****************************************************************************************/ 512 499 error_t vfs_get_path( xptr_t inode_xp, 513 500 char * buffer, 501 char ** first, 514 502 uint32_t max_size ); 515 503 516 504 /****************************************************************************************** 517 * This function takes a pathname (absolute or relative to cwd) and returns an extended 518 * pointer on the associated inode. 505 * This function traverses the the Inode Tree, from inode identified by the <root_xp> 506 * argument, and returns in <inode_xp> the inode identified by the < pathname> argument. 507 * It can be called by a thread running in any cluster. 508 * It supports the following flags that define the lookup modes : 509 * - VFS_LOOKUP_DIR : the searched inode must be a directory 510 * - VFS_LOOKUP_OPEN : the search is for an open/opendir 511 * - VFS_LOOKUP_PARENT : return the parent inode (not the inode itself) 512 * - VFS_LOOKUP_CREATE : file/directory must be created if missing on IOC 513 * - VFS_LOOKUP_EXCL : file cannot previously exist 514 * As the inode Tree is a cache, the search policy is the following : 519 515 * - If a given directory name in the path is not found in the inode tree, it try to load 520 516 * the missing dentry/inode couple, from informations found in the parent directory. 521 * - If this directory entry does not exist on device, it returns an error.522 * - If the the file identified by the pathname does not exist on devicebut the523 * flag CREATE is set, the inode is created. 524 * - If the the file identified by the pathname exist on device but both flags EXCL517 * - If this directory entry does not exist on IOC, it returns an error. 518 * - If the the file identified by the pathname does not exist on IOC but the 519 * flag CREATE is set, the inode is created. It returns an error otherwise. 520 * - If the the file identified by the pathname exist on device, but both flags EXCL 525 521 * and CREATE are set, an error is returned. 526 ****************************************************************************************** 527 * @ cwd_xp : extended pointer on current directory (for relative path). 528 * @ pathname : path in kernel space (can be relative or absolute). 529 * @ lookup_mode : flags defining the working mode (defined above in this file). 522 * - If the PARENT flag is set, it returns in <inode_xp> an extended pointer on the parent 523 * inode, and copies in <last_name> buffer a string containing the last name in path. 524 * 525 * WARNING : The remote_rwlock protecting the Inode Tree must be taken by the caller. 526 * 527 * TODO the access rights are not checked yet. 528 ****************************************************************************************** 529 * @ root_xp : [in] extended pointer on root inode (can be root of a subtree). 530 * @ pathname : [in] path (can be relative or absolute). 531 * @ lookup_mode : [in] flags defining the searching mode. 530 532 * @ inode_xp : [out] buffer for extended pointer on searched inode. 533 * @ last_name : [out] pointer on buffer for last name in path. 531 534 * @ return 0 if success / ENOENT if inode not found , EACCES if permisson denied, 532 * EAGAIN if a new complete lookup must be made 533 *****************************************************************************************/ 534 error_t vfs_lookup( xptr_t cwd_xp, 535 *****************************************************************************************/ 536 error_t vfs_lookup( xptr_t root_xp, 535 537 char * pathname, 536 538 uint32_t lookup_mode, 537 xptr_t * inode_xp ); 539 xptr_t * inode_xp, 540 char * last_name ); 538 541 539 542 /****************************************************************************************** 540 543 * This function creates a new couple dentry/inode, and insert it in the Inode-Tree. 544 * Only the distributed Inode Tree is modified: it does NOT modify the parent mapper, 545 * and does NOT update the FS on IOC device. 541 546 * It can be executed by any thread running in any cluster (can be different from both 542 * the child cluster and the parent cluster), as it uses RPCs if required. 543 * Only the distributed Inode Tree is modified: Even for a new file, this function 544 * does NOT modify the parent mapper, and does NOT update the FS on IOC device. 547 * the child cluster and the parent cluster). 545 548 * 546 549 * [Implementation] … … 563 566 * @ return 0 if success / -1 if dentry or inode cannot be created. 564 567 *****************************************************************************************/ 565 error_t vfs_add_child_in_parent( cxy_t child_inode cxy,566 vfs_inode_type_t chil g_inode_type,568 error_t vfs_add_child_in_parent( cxy_t child_inode_cxy, 569 vfs_inode_type_t child_inode_type, 567 570 vfs_fs_type_t fs_type, 568 571 xptr_t parent_inode_xp, … … 572 575 573 576 /****************************************************************************************** 574 * This function removes a couple dentry/inode from the Inode-Tree. 575 * Both the inode and dentry references counters must be 1. 577 * This function removes a remote dentry from the Inode-Tree. 578 * - It removes the dentry from the parent inode xhtab ("children" field), and from the 579 * child inode xlist ("parents" field). 580 * - It releases the memory allocated to the dentry descriptor. 581 * - If the number of parents of the child inode is one, it also releases the memory 582 * allocated to the child inode. 583 * Only the Inode Tree is modified: it does NOT modify the parent mapper, 584 * and does NOT update the FS on IOC device. 576 585 * It can be executed by any thread running in any cluster (can be different from both 577 * the inode cluster and the dentry cluster) , as it uses RPCs if required.578 ****************************************************************************************** 579 * @ child_xp : extended pointer on removed inode.580 *****************************************************************************************/ 581 void vfs_remove_child_from_parent( xptr_t inode_xp );586 * the inode cluster and the dentry cluster). 587 ****************************************************************************************** 588 * @ dentry_xp : extended pointer on removed dentry. 589 *****************************************************************************************/ 590 void vfs_remove_child_from_parent( xptr_t dentry_xp ); 582 591 583 592 /****************************************************************************************** … … 599 608 *****************************************************************************************/ 600 609 error_t vfs_new_child_init( xptr_t parent_xp, 601 xptr_t dentry_xp,602 xptr_t child_xp );610 xptr_t dentry_xp, 611 xptr_t child_xp ); 603 612 604 613 /****************************************************************************************** … … 661 670 /****************************************************************************************** 662 671 * This function allocates a vfs_file_t structure in the cluster containing the inode 663 * associated to the file identified by the <cwd_xp> & <path> arguments.672 * identified by the <root_xp> & <path> arguments. 664 673 * It initializes it, register it in the reference process fd_array identified by the 665 * <process > argument, and returns both the extended pointer on the file descriptor,666 * and the allocated index in the fd_array.674 * <process_xp> argument, and returns both the extended pointer on the file descriptor, 675 * and the allocated index in the <file_xp> and <file_id> buffers. 667 676 * The pathname can be relative to current directory or absolute. 668 * If the inode does not exist in the inode cache, it try to find the file on the mounted677 * If the inode does not exist in the inode cache, it try to find the file on the IOC 669 678 * device, and creates an inode on a pseudo randomly selected cluster if found. 670 679 * It the requested file does not exist on device, it creates a new inode if the 671 680 * O_CREAT flag is set, and return an error otherwise. 681 * 682 * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree. 672 683 ****************************************************************************************** 673 * @ process : local pointer on local process descriptor copy.684 * @ root_xp : extended pointer on path root inode. 674 685 * @ path : file pathname (absolute or relative to current directory). 686 * @ process_xp : extended pointer on client reference process. 675 687 * @ flags : defined in vfs_file_t structure. 676 688 * @ mode : access rights (as defined by chmod). … … 679 691 * @ return 0 if success / return non-zero if error. 680 692 *****************************************************************************************/ 681 error_t vfs_open( struct process_s * process,693 error_t vfs_open( xptr_t root_xp, 682 694 char * path, 695 xptr_t process_xp, 683 696 uint32_t flags, 684 697 uint32_t mode, … … 721 734 /****************************************************************************************** 722 735 * This function is called by the kernel to create in the file system a new directory 723 * entry identified by the <cwd_xp> & <path_1>, linked to the node identified by the 724 * <cwd_xp> & <path_2> arguments. It can be any type of node. 725 * If the link is successful, the link count of the target node is incremented. 726 * <path_1> and <path_2> share equal access rights to the underlying object. 736 * identified by the <root_xp> & <path> arguments, with the access permission defined 737 * by the <rights> argument. All nodes in the path - but the last - must exist. 738 * 739 * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree. 740 ****************************************************************************************** 741 * @ root_xp : extended pointer on path root inode (any inode in Inode Tree). 742 * @ path : pathname (absolute or relative to current directory). 743 * @ rights : access rights. 744 * @ returns 0 if success / -1 if error. 745 *****************************************************************************************/ 746 error_t vfs_mkdir( xptr_t root_xp, 747 char * path, 748 uint32_t rights ); 749 750 /****************************************************************************************** 751 * This function is called by the kernel to create in the file system a new directory 752 * entry identified by the <new_root_xp> & <new_path> arguments, to be linked to an 753 * existing inode, identified by the <old_root_xp> & <old_path> arguments. 754 * If the link is successful, the link count of the target inode is incremented. 755 * The <new_path> and <old_path> share equal access rights to the underlying inode. 727 756 * Both the IOC device and the Inode Tree are modified. 728 ****************************************************************************************** 729 * @ cwd_xp : extended pointer on current working directory file descriptor. 730 * @ path_1 : new pathname (absolute or relative to current directory). 731 * @ path_1 : existing pathname (absolute or relative to current directory). 757 $ 758 * TODO This function should handle any type of node, but the current implementation 759 * handles only the FILE and DIR types. 760 * 761 * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree. 762 ****************************************************************************************** 763 * @ old_root_xp : extended pointer on old path root inode (any inode in Inode Tree). 764 * @ old_path : old pathname (absolute or relative to current directory). 765 * @ nld_root_xp : extended pointer on new path root inode (any inode in Inode Tree). 766 * @ new_path : new pathname (absolute or relative to current directory). 732 767 * @ returns 0 if success / -1 if error. 733 768 *****************************************************************************************/ 734 error_t vfs_link( xptr_t cwd_xp, 735 char * path_1, 736 char * path_2 ); 769 error_t vfs_link( xptr_t old_root_xp, 770 char * old_path, 771 xptr_t new_root_xp, 772 char * new_path ); 737 773 738 774 /****************************************************************************************** 739 775 * This function is called by the kernel to remove from the file system a directory entry 740 * identified by the < cwd_xp> & <path> arguments. The target node can be any type of node.741 * The link count of the target node is decremented. If the removed link is the last,742 * the targetnode is deleted.776 * identified by the <root_xp> & <path> arguments. 777 * The link count of the target node is decremented. 778 * If the removed link is the last, the target inode is deleted. 743 779 * Both the IOC device and the Inode Tree are modified. 744 ****************************************************************************************** 745 * @ cwd_xp : extended pointer on the current working directory file descriptor. 780 * 781 * TODO This function should handle any type of node, but the current implementation 782 * handles only only the FILE and DIR types. 783 * 784 * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree. 785 ****************************************************************************************** 786 * @ root_xp : extended pointer on root inode (can be any inode in Inode Tree). 746 787 * @ path : pathname (absolute or relative to current directory). 747 788 * @ returns 0 if success / -1 if error. 748 789 *****************************************************************************************/ 749 error_t vfs_unlink( xptr_t cwd_xp,790 error_t vfs_unlink( xptr_t root_xp, 750 791 char * path ); 751 792 752 793 /****************************************************************************************** 753 * This function returns, in the structure pointed by the <st> pointer, 754 * various informations on the inode identified by the <inode_xp> argument. 755 * TODO : only partially implemented yet... 756 ****************************************************************************************** 757 * @ inode_xp : extended pointer on the remote inode. 794 * This function returns, in the structure pointed by the <st> pointer, various 795 * informations on the inode identified by the <root_inode_xp> and <patname> arguments. 796 * 797 * TODO : only partially implemented yet (only size and inum fields). 798 * 799 * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree. 800 ****************************************************************************************** 801 * @ root_xp : extended pointer on path root inode (any inode in Inode Tree) 802 * @ pathname : pathname to target inode. 758 803 * @ st : local pointer on the stat structure in kernel space. 759 804 * @ returns 0 if success / -1 if error. 760 805 *****************************************************************************************/ 761 error_t vfs_stat( xptr_t inode_xp, 806 error_t vfs_stat( xptr_t root_xp, 807 char * pathname, 762 808 struct stat * st ); 763 809 … … 775 821 776 822 /****************************************************************************************** 777 * This function creates a new inode and associated dentry for the directory defined 778 * by the <cwd_xp> & <path> arguments. 823 * This function creates a new directory as defined by the <root_xp> & <path> arguments. 779 824 * TODO not implemented yet... 780 825 ****************************************************************************************** 781 * @ cwd_xp : extended pointer on the current working directory file descriptor.782 * @ path : pathname (absolute or relative to current directory).826 * @ root_xp : extended pointer on the path root directory. 827 * @ path : pathname (absolute or relative to CWD). 783 828 * @ mode : access rights (as defined by chmod) 784 829 * @ returns 0 if success / -1 if error. 785 830 *****************************************************************************************/ 786 error_t vfs_mkdir( xptr_t cwd_xp,831 error_t vfs_mkdir( xptr_t root_xp, 787 832 char * path, 788 833 uint32_t mode ); 789 834 790 835 /****************************************************************************************** 791 * This function makes the directory identified by <cwd_xp / path> arguments to become792 * t he working directory for the calling process.836 * This function makes the directory identified by the <root_xp and <path> arguments 837 * to become the working directory for the calling process. 793 838 ****************************************************************************************** 794 * @ cwd_xp : extended pointer on current directory file descriptor (relative path).795 * @ path : file pathname (absolute or relative to current directory).839 * @ root_xp : extended pointer on the path root directory. 840 * @ path : pathname (absolute or relative to CWD). 796 841 * return 0 if success / -1 if error. 797 842 *****************************************************************************************/ 798 error_t vfs_chdir( xptr_t cwd_xp,843 error_t vfs_chdir( xptr_t root_xp, 799 844 char * path ); 800 845 801 846 /****************************************************************************************** 802 * This function change the access rigths for the file identified by the <cwd_xp / path>803 * arguments. The new access rights aredefined by the <mode> argument value.847 * This function change the access rigths for the file/directory identified by the 848 * <root_xp> and <path> arguments as defined by the <mode> argument value. 804 849 ****************************************************************************************** 805 * @ cwd_xp : extended pointer on current directory file descriptor (relative path).806 * @ path : file pathname (absolute or relative to current directory).807 * @ mode : access rights new value.850 * @ root_xp : extended pointer on the path root directory. 851 * @ path : pathname (absolute or relative to CWD). 852 * @ mode : access rights 808 853 * return 0 if success / -1 if error. 809 854 *****************************************************************************************/ 810 error_t vfs_chmod( xptr_t cwd_xp,855 error_t vfs_chmod( xptr_t root_xp, 811 856 char * path, 812 857 uint32_t mode ); … … 816 861 * TODO not implemented yet 817 862 ****************************************************************************************** 818 * @ path : FIFO pathname (absolute or relative to current directory).819 * @ cwd_xp : extended pointer on the current working directory file descriptor.820 * @ mode 821 *****************************************************************************************/ 822 error_t vfs_mkfifo( xptr_t cwd_xp,863 * @ root_xp : extended pointer on the path root directory. 864 * @ path : pathname (absolute or relative to CWD). 865 * @ mode : access rights new value. 866 *****************************************************************************************/ 867 error_t vfs_mkfifo( xptr_t root_xp, 823 868 char * path, 824 869 uint32_t mode ); … … 905 950 906 951 /***************************************************************************************** 907 * This function updates the FS on the IOC device for the FAT itself.908 * It scan all clusters registered in the FAT mapper, and copies to device909 * each page marked as dirty.952 * This function updates the FS defined by the <fs_type> argument on the IOC device 953 * for the FAT itself. It scan all clusters registered in the FAT mapper, and copies 954 * to device each page marked as dirty. 910 955 * 911 956 * Depending on the file system type, it calls the relevant, FS specific function. 912 957 * It can be called by a thread running in any cluster. 913 958 ***************************************************************************************** 959 * @ fs_type : specific file system type. 914 960 * @ return 0 if success / return EIO if failure during device access. 915 961 ****************************************************************************************/ 916 error_t vfs_fs_sync_fat( v oid);962 error_t vfs_fs_sync_fat( vfs_fs_type_t fs_type ); 917 963 918 964 /***************************************************************************************** 919 * This function updates the free clusters info on the IOC device. 965 * This function updates the free clusters info on the IOC device for the FS defined 966 * by the <fs_type> argument. 920 967 * 921 968 * Depending on the file system type, it calls the relevant, FS specific function. 922 969 * It can be called by a thread running in any cluster. 923 970 ***************************************************************************************** 971 * @ fs_type : specific file system type. 924 972 * @ return 0 if success / return EIO if failure during device access. 925 973 ****************************************************************************************/ 926 error_t vfs_fs_sync_free_info( v oid);974 error_t vfs_fs_sync_free_info( vfs_fs_type_t fs_type ); 927 975 928 976 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.