diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/coda_fs_i.h | 13 | ||||
| -rw-r--r-- | include/linux/coda_linux.h | 6 |
2 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h index b3ef0c461578..e35071b1de0e 100644 --- a/include/linux/coda_fs_i.h +++ b/include/linux/coda_fs_i.h | |||
| @@ -10,19 +10,24 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
| 13 | #include <linux/spinlock.h> | ||
| 13 | #include <linux/coda.h> | 14 | #include <linux/coda.h> |
| 14 | 15 | ||
| 15 | /* | 16 | /* |
| 16 | * coda fs inode data | 17 | * coda fs inode data |
| 18 | * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and | ||
| 19 | * c_cached_perm. | ||
| 20 | * vfs_inode is set only when the inode is created and never changes. | ||
| 21 | * c_fid is set when the inode is created and should be considered immutable. | ||
| 17 | */ | 22 | */ |
| 18 | struct coda_inode_info { | 23 | struct coda_inode_info { |
| 19 | struct CodaFid c_fid; /* Coda identifier */ | 24 | struct CodaFid c_fid; /* Coda identifier */ |
| 20 | u_short c_flags; /* flags (see below) */ | 25 | u_short c_flags; /* flags (see below) */ |
| 21 | struct list_head c_cilist; /* list of all coda inodes */ | ||
| 22 | unsigned int c_mapcount; /* nr of times this inode is mapped */ | 26 | unsigned int c_mapcount; /* nr of times this inode is mapped */ |
| 23 | unsigned int c_cached_epoch; /* epoch for cached permissions */ | 27 | unsigned int c_cached_epoch; /* epoch for cached permissions */ |
| 24 | vuid_t c_uid; /* fsuid for cached permissions */ | 28 | vuid_t c_uid; /* fsuid for cached permissions */ |
| 25 | unsigned int c_cached_perm; /* cached access permissions */ | 29 | unsigned int c_cached_perm; /* cached access permissions */ |
| 30 | spinlock_t c_lock; | ||
| 26 | struct inode vfs_inode; | 31 | struct inode vfs_inode; |
| 27 | }; | 32 | }; |
| 28 | 33 | ||
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index dcc228aa335a..2e914d0771b9 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
| @@ -89,7 +89,11 @@ static __inline__ char *coda_i2s(struct inode *inode) | |||
| 89 | /* this will not zap the inode away */ | 89 | /* this will not zap the inode away */ |
| 90 | static __inline__ void coda_flag_inode(struct inode *inode, int flag) | 90 | static __inline__ void coda_flag_inode(struct inode *inode, int flag) |
| 91 | { | 91 | { |
| 92 | ITOC(inode)->c_flags |= flag; | 92 | struct coda_inode_info *cii = ITOC(inode); |
| 93 | |||
| 94 | spin_lock(&cii->c_lock); | ||
| 95 | cii->c_flags |= flag; | ||
| 96 | spin_unlock(&cii->c_lock); | ||
| 93 | } | 97 | } |
| 94 | 98 | ||
| 95 | #endif | 99 | #endif |
