Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  coda_fs_i.h
0004  *
0005  *  Copyright (C) 1998 Carnegie Mellon University
0006  *
0007  */
0008 
0009 #ifndef _LINUX_CODA_FS_I
0010 #define _LINUX_CODA_FS_I
0011 
0012 #include <linux/types.h>
0013 #include <linux/list.h>
0014 #include <linux/spinlock.h>
0015 #include <linux/coda.h>
0016 
0017 /*
0018  * coda fs inode data
0019  * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and
0020  * c_cached_perm.
0021  * vfs_inode is set only when the inode is created and never changes.
0022  * c_fid is set when the inode is created and should be considered immutable.
0023  */
0024 struct coda_inode_info {
0025     struct CodaFid     c_fid;   /* Coda identifier */
0026     u_short            c_flags;     /* flags (see below) */
0027     unsigned int       c_mapcount;  /* nr of times this inode is mapped */
0028     unsigned int       c_cached_epoch; /* epoch for cached permissions */
0029     kuid_t         c_uid;   /* fsuid for cached permissions */
0030     unsigned int       c_cached_perm; /* cached access permissions */
0031     spinlock_t     c_lock;
0032     struct inode       vfs_inode;
0033 };
0034 
0035 /*
0036  * coda fs file private data
0037  */
0038 #define CODA_MAGIC 0xC0DAC0DA
0039 struct coda_file_info {
0040     int        cfi_magic;     /* magic number */
0041     struct file   *cfi_container; /* container file for this cnode */
0042     unsigned int       cfi_mapcount;  /* nr of times this file is mapped */
0043     bool           cfi_access_intent; /* is access intent supported */
0044 };
0045 
0046 /* flags */
0047 #define C_VATTR       0x1   /* Validity of vattr in inode */
0048 #define C_FLUSH       0x2   /* used after a flush */
0049 #define C_DYING       0x4   /* from venus (which died) */
0050 #define C_PURGE       0x8
0051 
0052 struct inode *coda_cnode_make(struct CodaFid *, struct super_block *);
0053 struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr);
0054 struct inode *coda_cnode_makectl(struct super_block *sb);
0055 struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb);
0056 struct coda_file_info *coda_ftoc(struct file *file);
0057 void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *);
0058 
0059 #endif