^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * coda_fs_i.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 1998 Carnegie Mellon University
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifndef _LINUX_CODA_FS_I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define _LINUX_CODA_FS_I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/coda.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * coda fs inode data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * c_cached_perm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * vfs_inode is set only when the inode is created and never changes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * c_fid is set when the inode is created and should be considered immutable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct coda_inode_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct CodaFid c_fid; /* Coda identifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) u_short c_flags; /* flags (see below) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) unsigned int c_mapcount; /* nr of times this inode is mapped */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) unsigned int c_cached_epoch; /* epoch for cached permissions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) kuid_t c_uid; /* fsuid for cached permissions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned int c_cached_perm; /* cached access permissions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) spinlock_t c_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct inode vfs_inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * coda fs file private data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define CODA_MAGIC 0xC0DAC0DA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct coda_file_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) int cfi_magic; /* magic number */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct file *cfi_container; /* container file for this cnode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned int cfi_mapcount; /* nr of times this file is mapped */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) bool cfi_access_intent; /* is access intent supported */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) /* flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define C_VATTR 0x1 /* Validity of vattr in inode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define C_FLUSH 0x2 /* used after a flush */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define C_DYING 0x4 /* from venus (which died) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define C_PURGE 0x8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) struct inode *coda_cnode_make(struct CodaFid *, struct super_block *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) struct inode *coda_cnode_makectl(struct super_block *sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) struct coda_file_info *coda_ftoc(struct file *file);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #endif