Lines Matching refs:oi
80 struct ocfs2_inode_info *oi = OCFS2_I(inode); in ocfs2_metadata_cache_init() local
81 struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; in ocfs2_metadata_cache_init()
83 oi->ip_flags |= OCFS2_INODE_CACHE_INLINE; in ocfs2_metadata_cache_init()
117 struct ocfs2_inode_info *oi = OCFS2_I(inode); in ocfs2_metadata_cache_purge() local
119 struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; in ocfs2_metadata_cache_purge()
122 spin_lock(&oi->ip_lock); in ocfs2_metadata_cache_purge()
123 tree = !(oi->ip_flags & OCFS2_INODE_CACHE_INLINE); in ocfs2_metadata_cache_purge()
127 tree ? "array" : "tree", (unsigned long long)oi->ip_blkno); in ocfs2_metadata_cache_purge()
136 spin_unlock(&oi->ip_lock); in ocfs2_metadata_cache_purge()
144 (unsigned long long)oi->ip_blkno, to_purge, purged); in ocfs2_metadata_cache_purge()
185 static int ocfs2_buffer_cached(struct ocfs2_inode_info *oi, in ocfs2_buffer_cached() argument
191 spin_lock(&oi->ip_lock); in ocfs2_buffer_cached()
194 (unsigned long long)oi->ip_blkno, in ocfs2_buffer_cached()
196 !!(oi->ip_flags & OCFS2_INODE_CACHE_INLINE)); in ocfs2_buffer_cached()
198 if (oi->ip_flags & OCFS2_INODE_CACHE_INLINE) in ocfs2_buffer_cached()
199 index = ocfs2_search_cache_array(&oi->ip_metadata_cache, in ocfs2_buffer_cached()
202 item = ocfs2_search_cache_tree(&oi->ip_metadata_cache, in ocfs2_buffer_cached()
205 spin_unlock(&oi->ip_lock); in ocfs2_buffer_cached()
295 static inline int ocfs2_insert_can_use_array(struct ocfs2_inode_info *oi, in ocfs2_insert_can_use_array() argument
298 assert_spin_locked(&oi->ip_lock); in ocfs2_insert_can_use_array()
300 return (oi->ip_flags & OCFS2_INODE_CACHE_INLINE) && in ocfs2_insert_can_use_array()
307 static void ocfs2_expand_cache(struct ocfs2_inode_info *oi, in ocfs2_expand_cache() argument
311 struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; in ocfs2_expand_cache()
315 (unsigned long long)oi->ip_blkno, ci->ci_num_cached, in ocfs2_expand_cache()
317 mlog_bug_on_msg(!(oi->ip_flags & OCFS2_INODE_CACHE_INLINE), in ocfs2_expand_cache()
319 (unsigned long long)oi->ip_blkno); in ocfs2_expand_cache()
320 assert_spin_locked(&oi->ip_lock); in ocfs2_expand_cache()
327 oi->ip_flags &= ~OCFS2_INODE_CACHE_INLINE; in ocfs2_expand_cache()
338 (unsigned long long)oi->ip_blkno, oi->ip_flags, ci->ci_num_cached); in ocfs2_expand_cache()
343 static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi, in __ocfs2_set_buffer_uptodate() argument
348 struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; in __ocfs2_set_buffer_uptodate()
354 (unsigned long long)oi->ip_blkno, in __ocfs2_set_buffer_uptodate()
379 spin_lock(&oi->ip_lock); in __ocfs2_set_buffer_uptodate()
380 if (ocfs2_insert_can_use_array(oi, ci)) { in __ocfs2_set_buffer_uptodate()
385 spin_unlock(&oi->ip_lock); in __ocfs2_set_buffer_uptodate()
390 ocfs2_expand_cache(oi, tree); in __ocfs2_set_buffer_uptodate()
393 spin_unlock(&oi->ip_lock); in __ocfs2_set_buffer_uptodate()
432 struct ocfs2_inode_info *oi = OCFS2_I(inode); in ocfs2_set_buffer_uptodate() local
433 struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; in ocfs2_set_buffer_uptodate()
437 if (ocfs2_buffer_cached(oi, bh)) in ocfs2_set_buffer_uptodate()
441 (unsigned long long)oi->ip_blkno, in ocfs2_set_buffer_uptodate()
446 spin_lock(&oi->ip_lock); in ocfs2_set_buffer_uptodate()
447 if (ocfs2_insert_can_use_array(oi, ci)) { in ocfs2_set_buffer_uptodate()
451 spin_unlock(&oi->ip_lock); in ocfs2_set_buffer_uptodate()
456 if (oi->ip_flags & OCFS2_INODE_CACHE_INLINE) { in ocfs2_set_buffer_uptodate()
460 spin_unlock(&oi->ip_lock); in ocfs2_set_buffer_uptodate()
462 __ocfs2_set_buffer_uptodate(oi, bh->b_blocknr, expand); in ocfs2_set_buffer_uptodate()
471 struct ocfs2_inode_info *oi = OCFS2_I(inode); in ocfs2_set_new_buffer_uptodate() local
474 BUG_ON(ocfs2_buffer_cached(oi, bh)); in ocfs2_set_new_buffer_uptodate()
478 mutex_lock(&oi->ip_io_mutex); in ocfs2_set_new_buffer_uptodate()
480 mutex_unlock(&oi->ip_io_mutex); in ocfs2_set_new_buffer_uptodate()
523 struct ocfs2_inode_info *oi = OCFS2_I(inode); in ocfs2_remove_block_from_cache() local
524 struct ocfs2_caching_info *ci = &oi->ip_metadata_cache; in ocfs2_remove_block_from_cache()
526 spin_lock(&oi->ip_lock); in ocfs2_remove_block_from_cache()
528 (unsigned long long)oi->ip_blkno, in ocfs2_remove_block_from_cache()
530 oi->ip_flags & OCFS2_INODE_CACHE_INLINE); in ocfs2_remove_block_from_cache()
532 if (oi->ip_flags & OCFS2_INODE_CACHE_INLINE) { in ocfs2_remove_block_from_cache()
541 spin_unlock(&oi->ip_lock); in ocfs2_remove_block_from_cache()