 file

     VFS   .
 file    ,   .
     VFS     , 
    ,     .  
  ,    ,    . 
,  ,     file,  -
 ( ,      ),   
     ,   read ()  write ().

      ,    -
 .  (   )      
open ()       close ().  , -
  ,     ,    
  .         -
     ,       
 file.         
.         (-
,   ,    ),  
.   mode  dentry, ,  .

      struct file, 
   <linux/fs .h>.      -
,     .

struct file (

struct list head     f list;    /*   file*/
struct dentry        *f_dentry; /*   dentry */
struct vfsmount      *f vfsmnt; /*  

  */
struct file operations *f op;     /*    */
atomic t              f count;   /*      */
unsigned int          f_flags;   /*,     open*/
mode t                f_mode;    /*     */
loff_t                f_pos;     /*   (file pointer, offset)*/
struct fown struct   f owner;   /*     

 */
unsigned int          f_uid;     /   , UID*/
unsigned int          f_gid;     ^  , GID */
int                   f error;   /*   */
struct file ra state f_ra;      /*  */
unsigned long        f version; /*   */
void                 *f_security; /*   */
void                 *private_data; /*    */
struct list_head     f_ep_links;/*  eventpoll ( ) */
spinlock t           f ep_lock; /*  eventpoll */
struct address_space *f_mapping;/*     */
;

                                                    283