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


Ignore:
Timestamp:
Nov 10, 2018, 3:06:00 PM (5 years ago)
Author:
alain
Message:

1) Modify the devfs_user_move() function to support large user buffer transfer to/from TXT device.
2) Cosmetic: Improve debug.

File:
1 edited

Legend:

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

    r568 r598  
    7676
    7777/******************************************************************************************
    78  * This define the masks for the POSIX access rights to inodes
    79  *****************************************************************************************/
    80 
    81 #define VFS_ISUID                0x0004000
    82 #define VFS_ISGID                0x0002000
    83 #define VFS_ISVTX                0x0001000
    84 
    85 #define VFS_IRWXU            0x0000700
    86 #define VFS_IRUSR            0x0000400
    87 #define VFS_IWUSR            0x0000200
    88 #define VFS_IXUSR            0x0000100
    89 
    90 #define VFS_IRWXG            0x0000070
    91 #define VFS_IRGRP            0x0000040
    92 #define VFS_IWGRP            0x0000020
    93 #define VFS_IXGRP            0x0000010
    94 
    95 #define VFS_IRWXO            0x0000007
    96 #define VFS_IROTH            0x0000004
    97 #define VFS_IWOTH            0x0000002
    98 #define VFS_IXOTH            0x0000001
    99 
    100 #define VFS_IREAD            VFS_IRUSR
    101 #define VFS_IWRITE           VFS_IWUSR
    102 #define VFS_IEXEC            VFS_IXUSR
    103 
    104 
    105 /******************************************************************************************
    10678 * This structure defines a VFS context, that contains informations common to all inodes
    10779 * and dentries for a given file system. As it is declared as a global variable in the
     
    155127
    156128/* this enum define the VFS inode types values */
     129/* WARNING : this enum must be kept consistent with macros in <shared_stat.h> file */
    157130
    158131typedef enum   
    159132{
    160     INODE_TYPE_FILE  =     0,           /*! file                                         */
     133    INODE_TYPE_FILE  =     0,           /*! regular file                                 */
    161134    INODE_TYPE_DIR   =     1,           /*! directory                                    */
    162135    INODE_TYPE_FIFO  =     2,           /*! POSIX named pipe                             */
    163136    INODE_TYPE_PIPE  =     3,           /*! POSIX anonymous pipe                         */
    164137    INODE_TYPE_SOCK  =     4,           /*! POSIX socket                                 */
    165     INODE_TYPE_DEV   =     5,           /*! device channel                               */
     138    INODE_TYPE_DEV   =     5,           /*! character device                             */
    166139    INODE_TYPE_SYML  =     6,           /*! symbolic link                                */
    167140}
     
    187160        uint32_t           size;             /*! number of bytes                             */
    188161        uint32_t           links;            /*! number of alias dentry                      */
    189         uid_t              uid;              /*! user owner identifier                       */
    190         gid_t              gid;              /*! group owner identifier                      */
     162        uint32_t           uid;              /*! user owner identifier                       */
     163        uint32_t           gid;              /*! group owner identifier                      */
    191164    uint32_t           rights;           /*! access rights                               */
    192165        uint32_t               refcount;         /*! reference counter (all pointers)            */
     
    201174}
    202175vfs_inode_t;
     176
     177/* This define the masks for the inode <rights> field  */
     178
     179#define VFS_ISUID          0x0004000
     180#define VFS_ISGID          0x0002000
     181#define VFS_ISVTX          0x0001000
     182
     183#define VFS_IRWXU      0x0000700
     184#define VFS_IRUSR      0x0000400
     185#define VFS_IWUSR      0x0000200
     186#define VFS_IXUSR      0x0000100
     187
     188#define VFS_IRWXG      0x0000070
     189#define VFS_IRGRP      0x0000040
     190#define VFS_IWGRP      0x0000020
     191#define VFS_IXGRP      0x0000010
     192
     193#define VFS_IRWXO      0x0000007
     194#define VFS_IROTH      0x0000004
     195#define VFS_IWOTH      0x0000002
     196#define VFS_IXOTH      0x0000001
    203197
    204198/******************************************************************************************
     
    514508/******************* Inode-Tree related functions ****************************************/
    515509/*****************************************************************************************/
     510
     511/******************************************************************************************
     512 * This function returns a printable string for the inode type.
     513 *****************************************************************************************/
     514const char * vfs_inode_type_str( vfs_inode_type_t type );
    516515
    517516/******************************************************************************************
     
    712711
    713712/******************************************************************************************
    714  * This function returns, in the structure pointed by the <k_stat> kernel pointer,
    715  * various informations on the file descriptor identified by the <file_xp> argument.
    716  * TODO not implemented yet...
    717  ******************************************************************************************
    718  * @ file_xp    : extended pointer on the file descriptor of the searched directory .
    719  * @ k_stat     : local pointer on the stat structure in kernel space.
     713 * This function returns, in the structure pointed by the <st> pointer,
     714 * various informations on the inode identified by the <inode_xp> argument.
     715 * TODO : only partially implemented yet...
     716 ******************************************************************************************
     717 * @ inode_xp   : extended pointer on the remote inode.
     718 * @ st         : local pointer on the stat structure in kernel space.
    720719 * @ returns 0 if success / -1 if error.
    721720 *****************************************************************************************/
    722 error_t vfs_stat( xptr_t        file_xp,
    723                   struct stat * k_stat );
     721error_t vfs_stat( xptr_t        inode_xp,
     722                  struct stat * st );
    724723
    725724/******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.