Changeset 459 for trunk/kernel/fs/vfs.h
- Timestamp:
- Aug 13, 2018, 1:43:20 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.h
r457 r459 227 227 * It is not replicated, and is dynamically allocated in the cluster that contains 228 228 * 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. 230 230 * As the fd_array (containing extended pointers on the open file descriptors) 231 231 * is replicated in all process descriptors, we need a references counter. … … 338 338 * @ gid : group owner ID. 339 339 * @ 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. 341 341 *****************************************************************************************/ 342 342 error_t vfs_inode_create( xptr_t dentry_xp, … … 353 353 * This function releases memory allocated to an inode descriptor. 354 354 * 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. 358 357 ****************************************************************************************** 359 358 * @ 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 *****************************************************************************************/ 361 error_t vfs_inode_destroy( vfs_inode_t * inode ); 362 362 363 363 /****************************************************************************************** … … 432 432 433 433 434 435 436 437 438 /******************************************************************************************439 * This function TODO440 *****************************************************************************************/441 error_t vfs_inode_trunc( vfs_inode_t * inode );442 443 /******************************************************************************************444 * This function TODO445 *****************************************************************************************/446 error_t vfs_inode_link( vfs_inode_t * inode,447 uint32_t igc );448 449 /******************************************************************************************450 * This function TODO451 *****************************************************************************************/452 error_t vfs_inode_unlink( vfs_inode_t * inode );453 454 455 434 /*****************************************************************************************/ 456 435 /***************** Dentry related functions **********************************************/ … … 478 457 * This function releases memory allocated to a dentry descriptor. 479 458 * 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. 483 461 ****************************************************************************************** 484 462 * @ 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 *****************************************************************************************/ 465 error_t vfs_dentry_destroy( vfs_dentry_t * dentry ); 487 466 488 467 /****************************************************************************************** … … 562 541 * This function takes a pathname (absolute or relative to cwd) and returns an extended 563 542 * 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 missing565 * 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. 566 545 * - If this directory entry does not exist on device, it returns an error. 567 546 * - If the the file identified by the pathname does not exist on device but the … … 613 592 * This function removes a couple dentry/inode from the Inode-Tree, and remove it from 614 593 * the external device. 615 * TODO616 594 ****************************************************************************************** 617 595 * @ child_xp : extended pointer on removed inode. 618 596 *****************************************************************************************/ 619 error_t vfs_remove_child_from_parent( xptr_t child_xp );597 error_t vfs_remove_child_from_parent( xptr_t inode_xp ); 620 598 621 599 /****************************************************************************************** … … 716 694 717 695 /****************************************************************************************** 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, 720 699 * using remote accesses. 721 700 * 2) The memory allocated to file descriptor in cluster containing the inode is released. 722 701 * It requires a RPC if cluster containing the file descriptor is remote. 723 702 ****************************************************************************************** 724 * @ file_xp : extended pointer on the file descriptor .703 * @ file_xp : extended pointer on the file descriptor in owner cluster. 725 704 * @ file_id : file descriptor index in fd_array. 726 705 * @ returns 0 if success / -1 if error. … … 848 827 849 828 /****************************************************************************************** 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. 853 833 * Depending on the file system type, it calls the proper, FS specific function. 854 834 * It must be executed by a thread running in the cluster containing the mapper. … … 862 842 863 843 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_s885 {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 file895 }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 documentation902 ******************************************************************************************903 904 905 typedef error_t (vfs_compare_dentry_t) ( char * first , char * second );906 907 typedef struct vfs_dentry_op_s908 {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 descriptors916 * 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 documentation918 ******************************************************************************************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_s947 {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 962 844 #endif /* _VFS_H_ */
Note: See TracChangeset
for help on using the changeset viewer.