Lines Matching refs:inode

8  *	of inode number.
32 static inline int fat_max_cache(struct inode *inode)
62 static inline struct fat_cache *fat_cache_alloc(struct inode *inode)
73 static inline void fat_cache_update_lru(struct inode *inode,
76 if (MSDOS_I(inode)->cache_lru.next != &cache->cache_list)
77 list_move(&cache->cache_list, &MSDOS_I(inode)->cache_lru);
80 static int fat_cache_lookup(struct inode *inode, int fclus,
89 spin_lock(&MSDOS_I(inode)->cache_lru_lock);
90 list_for_each_entry(p, &MSDOS_I(inode)->cache_lru, cache_list) {
103 fat_cache_update_lru(inode, hit);
105 cid->id = MSDOS_I(inode)->cache_valid_id;
112 spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
117 static struct fat_cache *fat_cache_merge(struct inode *inode,
122 list_for_each_entry(p, &MSDOS_I(inode)->cache_lru, cache_list) {
134 static void fat_cache_add(struct inode *inode, struct fat_cache_id *new)
141 spin_lock(&MSDOS_I(inode)->cache_lru_lock);
143 new->id != MSDOS_I(inode)->cache_valid_id)
146 cache = fat_cache_merge(inode, new);
148 if (MSDOS_I(inode)->nr_caches < fat_max_cache(inode)) {
149 MSDOS_I(inode)->nr_caches++;
150 spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
152 tmp = fat_cache_alloc(inode);
154 spin_lock(&MSDOS_I(inode)->cache_lru_lock);
155 MSDOS_I(inode)->nr_caches--;
156 spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
160 spin_lock(&MSDOS_I(inode)->cache_lru_lock);
161 cache = fat_cache_merge(inode, new);
163 MSDOS_I(inode)->nr_caches--;
169 struct list_head *p = MSDOS_I(inode)->cache_lru.prev;
177 fat_cache_update_lru(inode, cache);
179 spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
186 static void __fat_cache_inval_inode(struct inode *inode)
188 struct msdos_inode_info *i = MSDOS_I(inode);
204 void fat_cache_inval_inode(struct inode *inode)
206 spin_lock(&MSDOS_I(inode)->cache_lru_lock);
207 __fat_cache_inval_inode(inode);
208 spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
225 int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus)
227 struct super_block *sb = inode->i_sb;
234 BUG_ON(MSDOS_I(inode)->i_start == 0);
237 *dclus = MSDOS_I(inode)->i_start;
241 __func__, MSDOS_I(inode)->i_pos, *dclus);
247 if (fat_cache_lookup(inode, cluster, &cid, fclus, dclus) < 0) {
261 __func__, MSDOS_I(inode)->i_pos);
266 nr = fat_ent_read(inode, &fatent, *dclus);
272 __func__, MSDOS_I(inode)->i_pos);
276 fat_cache_add(inode, &cid);
285 fat_cache_add(inode, &cid);
291 static int fat_bmap_cluster(struct inode *inode, int cluster)
293 struct super_block *sb = inode->i_sb;
296 if (MSDOS_I(inode)->i_start == 0)
299 ret = fat_get_cluster(inode, cluster, &fclus, &dclus);
304 __func__, MSDOS_I(inode)->i_pos);
310 int fat_get_mapped_cluster(struct inode *inode, sector_t sector,
314 struct super_block *sb = inode->i_sb;
320 cluster = fat_bmap_cluster(inode, cluster);
333 static int is_exceed_eof(struct inode *inode, sector_t sector,
336 struct super_block *sb = inode->i_sb;
340 *last_block = (i_size_read(inode) + (blocksize - 1)) >> blocksize_bits;
349 *last_block = (MSDOS_I(inode)->mmu_private + (blocksize - 1))
358 int fat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
361 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
366 if (!is_fat32(sbi) && (inode->i_ino == MSDOS_ROOT_INO)) {
375 if (is_exceed_eof(inode, sector, &last_block, create))
378 last_block = inode->i_blocks >>
379 (inode->i_sb->s_blocksize_bits - 9);
384 return fat_get_mapped_cluster(inode, sector, last_block, mapped_blocks,