Home
last modified time | relevance | path

Searched refs:cache (Results 1 – 25 of 94) sorted by relevance

1234

/fs/cachefiles/
Dbind.c27 int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args) in cachefiles_daemon_bind() argument
30 cache->frun_percent, in cachefiles_daemon_bind()
31 cache->fcull_percent, in cachefiles_daemon_bind()
32 cache->fstop_percent, in cachefiles_daemon_bind()
33 cache->brun_percent, in cachefiles_daemon_bind()
34 cache->bcull_percent, in cachefiles_daemon_bind()
35 cache->bstop_percent, in cachefiles_daemon_bind()
39 ASSERT(cache->fstop_percent >= 0 && in cachefiles_daemon_bind()
40 cache->fstop_percent < cache->fcull_percent && in cachefiles_daemon_bind()
41 cache->fcull_percent < cache->frun_percent && in cachefiles_daemon_bind()
[all …]
Ddaemon.c59 int (*handler)(struct cachefiles_cache *cache, char *args);
85 struct cachefiles_cache *cache; in cachefiles_daemon_open() local
98 cache = kzalloc(sizeof(struct cachefiles_cache), GFP_KERNEL); in cachefiles_daemon_open()
99 if (!cache) { in cachefiles_daemon_open()
104 mutex_init(&cache->daemon_mutex); in cachefiles_daemon_open()
105 cache->active_nodes = RB_ROOT; in cachefiles_daemon_open()
106 rwlock_init(&cache->active_lock); in cachefiles_daemon_open()
107 init_waitqueue_head(&cache->daemon_pollwq); in cachefiles_daemon_open()
114 cache->frun_percent = 7; in cachefiles_daemon_open()
115 cache->fcull_percent = 5; in cachefiles_daemon_open()
[all …]
Dinterface.c28 struct cachefiles_cache *cache; in cachefiles_alloc_object() local
34 cache = container_of(_cache, struct cachefiles_cache, cache); in cachefiles_alloc_object()
36 _enter("{%s},%p,", cache->cache.identifier, cookie); in cachefiles_alloc_object()
52 fscache_object_init(&object->fscache, cookie, &cache->cache); in cachefiles_alloc_object()
107 fscache_object_destroyed(&cache->cache); in cachefiles_alloc_object()
123 struct cachefiles_cache *cache; in cachefiles_lookup_object() local
129 cache = container_of(_object->cache, struct cachefiles_cache, cache); in cachefiles_lookup_object()
138 cachefiles_begin_secure(cache, &saved_cred); in cachefiles_lookup_object()
142 cachefiles_end_secure(cache, saved_cred); in cachefiles_lookup_object()
208 struct cachefiles_cache *cache; in cachefiles_update_object() local
[all …]
Dnamei.c84 static void cachefiles_mark_object_buried(struct cachefiles_cache *cache, in cachefiles_mark_object_buried() argument
93 write_lock(&cache->active_lock); in cachefiles_mark_object_buried()
95 p = cache->active_nodes.rb_node; in cachefiles_mark_object_buried()
106 write_unlock(&cache->active_lock); in cachefiles_mark_object_buried()
129 write_unlock(&cache->active_lock); in cachefiles_mark_object_buried()
136 static int cachefiles_mark_object_active(struct cachefiles_cache *cache, in cachefiles_mark_object_active() argument
146 write_lock(&cache->active_lock); in cachefiles_mark_object_active()
157 _p = &cache->active_nodes.rb_node; in cachefiles_mark_object_active()
174 rb_insert_color(&object->active_node, &cache->active_nodes); in cachefiles_mark_object_active()
176 write_unlock(&cache->active_lock); in cachefiles_mark_object_active()
[all …]
Dsecurity.c16 int cachefiles_get_security_ID(struct cachefiles_cache *cache) in cachefiles_get_security_ID() argument
21 _enter("{%s}", cache->secctx); in cachefiles_get_security_ID()
29 if (cache->secctx) { in cachefiles_get_security_ID()
30 ret = set_security_override_from_ctx(new, cache->secctx); in cachefiles_get_security_ID()
39 cache->cache_cred = new; in cachefiles_get_security_ID()
49 static int cachefiles_check_cache_dir(struct cachefiles_cache *cache, in cachefiles_check_cache_dir() argument
75 int cachefiles_determine_cache_security(struct cachefiles_cache *cache, in cachefiles_determine_cache_security() argument
90 cachefiles_end_secure(cache, *_saved_cred); in cachefiles_determine_cache_security()
97 cachefiles_begin_secure(cache, _saved_cred); in cachefiles_determine_cache_security()
102 put_cred(cache->cache_cred); in cachefiles_determine_cache_security()
[all …]
Dinternal.h56 struct fscache_cache cache; /* FS-Cache record */ member
128 static inline void cachefiles_state_changed(struct cachefiles_cache *cache) in cachefiles_state_changed() argument
130 set_bit(CACHEFILES_STATE_CHANGED, &cache->flags); in cachefiles_state_changed()
131 wake_up_all(&cache->daemon_pollwq); in cachefiles_state_changed()
137 extern int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args);
138 extern void cachefiles_daemon_unbind(struct cachefiles_cache *cache);
145 extern int cachefiles_has_space(struct cachefiles_cache *cache,
161 extern void cachefiles_mark_object_inactive(struct cachefiles_cache *cache,
164 extern int cachefiles_delete_object(struct cachefiles_cache *cache,
170 extern struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
[all …]
Drdwr.c397 struct cachefiles_cache *cache; in cachefiles_read_or_alloc_page() local
405 cache = container_of(object->fscache.cache, in cachefiles_read_or_alloc_page()
406 struct cachefiles_cache, cache); in cachefiles_read_or_alloc_page()
443 } else if (cachefiles_has_space(cache, 0, 1) == 0) { in cachefiles_read_or_alloc_page()
688 struct cachefiles_cache *cache; in cachefiles_read_or_alloc_pages() local
698 cache = container_of(object->fscache.cache, in cachefiles_read_or_alloc_pages()
699 struct cachefiles_cache, cache); in cachefiles_read_or_alloc_pages()
709 if (cachefiles_has_space(cache, 0, *nr_pages) < 0) in cachefiles_read_or_alloc_pages()
802 struct cachefiles_cache *cache; in cachefiles_allocate_page() local
807 cache = container_of(object->fscache.cache, in cachefiles_allocate_page()
[all …]
/fs/btrfs/tests/
Dfree-space-tests.c20 static int test_extents(struct btrfs_block_group_cache *cache) in test_extents() argument
27 ret = btrfs_add_free_space(cache, 0, SZ_4M); in test_extents()
33 ret = btrfs_remove_free_space(cache, 0, SZ_4M); in test_extents()
39 if (test_check_exists(cache, 0, SZ_4M)) { in test_extents()
45 ret = btrfs_add_free_space(cache, 0, SZ_4M); in test_extents()
51 ret = btrfs_remove_free_space(cache, 3 * SZ_1M, SZ_1M); in test_extents()
57 ret = btrfs_remove_free_space(cache, 0, SZ_1M); in test_extents()
63 ret = btrfs_remove_free_space(cache, SZ_2M, 4096); in test_extents()
69 if (test_check_exists(cache, 0, SZ_1M)) { in test_extents()
74 if (test_check_exists(cache, SZ_2M, 4096)) { in test_extents()
[all …]
Dfree-space-tree-tests.c21 struct btrfs_block_group_cache *cache, in __check_free_space_extents() argument
34 info = search_free_space_info(trans, cache, path, 0); in __check_free_space_extents()
51 end = cache->key.objectid + cache->key.offset; in __check_free_space_extents()
59 bit = free_space_test_bit(cache, path, offset); in __check_free_space_extents()
110 struct btrfs_block_group_cache *cache, in check_free_space_extents() argument
119 info = search_free_space_info(trans, cache, path, 0); in check_free_space_extents()
128 ret = __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents()
135 ret = convert_free_space_to_extents(trans, cache, path); in check_free_space_extents()
141 ret = convert_free_space_to_bitmaps(trans, cache, path); in check_free_space_extents()
147 return __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents()
[all …]
Dbtrfs-tests.c209 struct btrfs_block_group_cache *cache; in btrfs_alloc_dummy_block_group() local
211 cache = kzalloc(sizeof(*cache), GFP_KERNEL); in btrfs_alloc_dummy_block_group()
212 if (!cache) in btrfs_alloc_dummy_block_group()
214 cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), in btrfs_alloc_dummy_block_group()
216 if (!cache->free_space_ctl) { in btrfs_alloc_dummy_block_group()
217 kfree(cache); in btrfs_alloc_dummy_block_group()
221 cache->key.objectid = 0; in btrfs_alloc_dummy_block_group()
222 cache->key.offset = length; in btrfs_alloc_dummy_block_group()
223 cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY; in btrfs_alloc_dummy_block_group()
224 cache->full_stripe_len = fs_info->sectorsize; in btrfs_alloc_dummy_block_group()
[all …]
/fs/fscache/
Dcache.c95 struct fscache_cache *cache; in fscache_select_cache_for_object() local
113 cache = object->cache; in fscache_select_cache_for_object()
115 test_bit(FSCACHE_IOERROR, &cache->flags)) in fscache_select_cache_for_object()
116 cache = NULL; in fscache_select_cache_for_object()
119 _leave(" = %p [parent]", cache); in fscache_select_cache_for_object()
120 return cache; in fscache_select_cache_for_object()
147 if (!tag->cache) { in fscache_select_cache_for_object()
152 if (test_bit(FSCACHE_IOERROR, &tag->cache->flags)) in fscache_select_cache_for_object()
155 _leave(" = %p [specific]", tag->cache); in fscache_select_cache_for_object()
156 return tag->cache; in fscache_select_cache_for_object()
[all …]
Dcookie.c25 static int fscache_alloc_object(struct fscache_cache *cache,
397 struct fscache_cache *cache; in fscache_acquire_non_index_cookie() local
415 cache = fscache_select_cache_for_object(cookie->parent); in fscache_acquire_non_index_cookie()
416 if (!cache) { in fscache_acquire_non_index_cookie()
423 _debug("cache %s", cache->tag->name); in fscache_acquire_non_index_cookie()
429 ret = fscache_alloc_object(cache, cookie); in fscache_acquire_non_index_cookie()
477 static int fscache_alloc_object(struct fscache_cache *cache, in fscache_alloc_object() argument
483 _enter("%p,%p{%s}", cache, cookie, cookie->def->name); in fscache_alloc_object()
488 if (object->cache == cache) in fscache_alloc_object()
496 object = cache->ops->alloc_object(cache, cookie); in fscache_alloc_object()
[all …]
Doperation.c496 struct fscache_cache *cache; in fscache_put_operation() local
536 cache = object->cache; in fscache_put_operation()
537 spin_lock(&cache->op_gc_list_lock); in fscache_put_operation()
538 list_add_tail(&op->pend_link, &cache->op_gc_list); in fscache_put_operation()
539 spin_unlock(&cache->op_gc_list_lock); in fscache_put_operation()
540 schedule_work(&cache->op_gc); in fscache_put_operation()
565 struct fscache_cache *cache = in fscache_operation_gc() local
572 spin_lock(&cache->op_gc_list_lock); in fscache_operation_gc()
573 if (list_empty(&cache->op_gc_list)) { in fscache_operation_gc()
574 spin_unlock(&cache->op_gc_list_lock); in fscache_operation_gc()
[all …]
Dobject.c303 struct fscache_cache *cache) in fscache_object_init() argument
307 atomic_inc(&cache->object_count); in fscache_object_init()
324 object->cache = cache; in fscache_object_init()
406 object->cache->ops->grab_object(object, fscache_obj_get_add_to_deps)) { in fscache_initialise_object()
470 test_bit(FSCACHE_IOERROR, &object->cache->flags) || in fscache_look_up_object()
477 cookie->def->name, object->cache->tag->name); in fscache_look_up_object()
481 ret = object->cache->ops->lookup_object(object); in fscache_look_up_object()
596 object->cache->ops->lookup_complete(object); in fscache_object_available()
632 object->cache->ops->lookup_complete(object); in fscache_lookup_failure()
704 struct fscache_cache *cache = object->cache; in fscache_drop_object() local
[all …]
/fs/
Dmbcache.c47 static unsigned long mb_cache_shrink(struct mb_cache *cache,
50 static inline struct hlist_bl_head *mb_cache_entry_head(struct mb_cache *cache, in mb_cache_entry_head() argument
53 return &cache->c_hash[hash_32(key, cache->c_bucket_bits)]; in mb_cache_entry_head()
74 int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key, in mb_cache_entry_create() argument
82 if (cache->c_entry_count >= cache->c_max_entries) in mb_cache_entry_create()
83 schedule_work(&cache->c_shrink_work); in mb_cache_entry_create()
85 if (cache->c_entry_count >= 2*cache->c_max_entries) in mb_cache_entry_create()
86 mb_cache_shrink(cache, SYNC_SHRINK_BATCH); in mb_cache_entry_create()
99 head = mb_cache_entry_head(cache, key); in mb_cache_entry_create()
111 spin_lock(&cache->c_list_lock); in mb_cache_entry_create()
[all …]
/fs/squashfs/
Dcache.c53 struct squashfs_cache *cache, u64 block, int length) in squashfs_cache_get() argument
58 spin_lock(&cache->lock); in squashfs_cache_get()
61 for (i = cache->curr_blk, n = 0; n < cache->entries; n++) { in squashfs_cache_get()
62 if (cache->entry[i].block == block) { in squashfs_cache_get()
63 cache->curr_blk = i; in squashfs_cache_get()
66 i = (i + 1) % cache->entries; in squashfs_cache_get()
69 if (n == cache->entries) { in squashfs_cache_get()
74 if (cache->unused == 0) { in squashfs_cache_get()
75 cache->num_waiters++; in squashfs_cache_get()
76 spin_unlock(&cache->lock); in squashfs_cache_get()
[all …]
/fs/btrfs/
Dblock-group.c123 void btrfs_get_block_group(struct btrfs_block_group_cache *cache) in btrfs_get_block_group() argument
125 atomic_inc(&cache->count); in btrfs_get_block_group()
128 void btrfs_put_block_group(struct btrfs_block_group_cache *cache) in btrfs_put_block_group() argument
130 if (atomic_dec_and_test(&cache->count)) { in btrfs_put_block_group()
131 WARN_ON(cache->pinned > 0); in btrfs_put_block_group()
132 WARN_ON(cache->reserved > 0); in btrfs_put_block_group()
142 WARN_ON(!RB_EMPTY_ROOT(&cache->full_stripe_locks_root.root)); in btrfs_put_block_group()
143 kfree(cache->free_space_ctl); in btrfs_put_block_group()
144 kfree(cache); in btrfs_put_block_group()
156 struct btrfs_block_group_cache *cache; in btrfs_add_block_group_cache() local
[all …]
Dblock-group.h178 struct btrfs_block_group_cache *cache);
179 void btrfs_get_block_group(struct btrfs_block_group_cache *cache);
180 void btrfs_put_block_group(struct btrfs_block_group_cache *cache);
187 void btrfs_wait_block_group_cache_progress(struct btrfs_block_group_cache *cache,
189 int btrfs_wait_block_group_cache_done(struct btrfs_block_group_cache *cache);
190 int btrfs_cache_block_group(struct btrfs_block_group_cache *cache,
194 struct btrfs_block_group_cache *cache);
208 int btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache);
209 void btrfs_dec_block_group_ro(struct btrfs_block_group_cache *cache);
215 int btrfs_add_reserved_bytes(struct btrfs_block_group_cache *cache,
[all …]
Dextent-tree.c57 static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits) in block_group_bits() argument
59 return (cache->flags & bits) == bits; in block_group_bits()
73 void btrfs_free_excluded_extents(struct btrfs_block_group_cache *cache) in btrfs_free_excluded_extents() argument
75 struct btrfs_fs_info *fs_info = cache->fs_info; in btrfs_free_excluded_extents()
78 start = cache->key.objectid; in btrfs_free_excluded_extents()
79 end = start + cache->key.offset - 1; in btrfs_free_excluded_extents()
2549 struct btrfs_block_group_cache *cache; in first_logical_byte() local
2559 cache = btrfs_lookup_first_block_group(fs_info, search_start); in first_logical_byte()
2560 if (!cache) in first_logical_byte()
2563 bytenr = cache->key.objectid; in first_logical_byte()
[all …]
Drelocation.c189 static void remove_backref_node(struct backref_cache *cache,
200 static void backref_cache_init(struct backref_cache *cache) in backref_cache_init() argument
203 cache->rb_root = RB_ROOT; in backref_cache_init()
205 INIT_LIST_HEAD(&cache->pending[i]); in backref_cache_init()
206 INIT_LIST_HEAD(&cache->changed); in backref_cache_init()
207 INIT_LIST_HEAD(&cache->detached); in backref_cache_init()
208 INIT_LIST_HEAD(&cache->leaves); in backref_cache_init()
211 static void backref_cache_cleanup(struct backref_cache *cache) in backref_cache_cleanup() argument
216 while (!list_empty(&cache->detached)) { in backref_cache_cleanup()
217 node = list_entry(cache->detached.next, in backref_cache_cleanup()
[all …]
/fs/overlayfs/
Dreaddir.c55 struct ovl_dir_cache *cache; member
230 struct ovl_dir_cache *cache = ovl_dir_cache(inode); in ovl_dir_cache_free() local
232 if (cache) { in ovl_dir_cache_free()
233 ovl_cache_free(&cache->entries); in ovl_dir_cache_free()
234 kfree(cache); in ovl_dir_cache_free()
240 struct ovl_dir_cache *cache = od->cache; in ovl_cache_put() local
242 WARN_ON(cache->refcount <= 0); in ovl_cache_put()
243 cache->refcount--; in ovl_cache_put()
244 if (!cache->refcount) { in ovl_cache_put()
245 if (ovl_dir_cache(d_inode(dentry)) == cache) in ovl_cache_put()
[all …]
/fs/fat/
Dcache.c41 struct fat_cache *cache = (struct fat_cache *)foo; in init_once() local
43 INIT_LIST_HEAD(&cache->cache_list); in init_once()
67 static inline void fat_cache_free(struct fat_cache *cache) in fat_cache_free() argument
69 BUG_ON(!list_empty(&cache->cache_list)); in fat_cache_free()
70 kmem_cache_free(fat_cache_cachep, cache); in fat_cache_free()
74 struct fat_cache *cache) in fat_cache_update_lru() argument
76 if (MSDOS_I(inode)->cache_lru.next != &cache->cache_list) in fat_cache_update_lru()
77 list_move(&cache->cache_list, &MSDOS_I(inode)->cache_lru); in fat_cache_update_lru()
136 struct fat_cache *cache, *tmp; in fat_cache_add() local
146 cache = fat_cache_merge(inode, new); in fat_cache_add()
[all …]
/fs/nilfs2/
Dalloc.c263 struct nilfs_palloc_cache *cache = NILFS_MDT(inode)->mi_palloc_cache; in nilfs_palloc_get_desc_block() local
268 bhp, &cache->prev_desc, &cache->lock); in nilfs_palloc_get_desc_block()
282 struct nilfs_palloc_cache *cache = NILFS_MDT(inode)->mi_palloc_cache; in nilfs_palloc_get_bitmap_block() local
287 &cache->prev_bitmap, &cache->lock); in nilfs_palloc_get_bitmap_block()
298 struct nilfs_palloc_cache *cache = NILFS_MDT(inode)->mi_palloc_cache; in nilfs_palloc_delete_bitmap_block() local
303 &cache->prev_bitmap, &cache->lock); in nilfs_palloc_delete_bitmap_block()
316 struct nilfs_palloc_cache *cache = NILFS_MDT(inode)->mi_palloc_cache; in nilfs_palloc_get_entry_block() local
321 &cache->prev_entry, &cache->lock); in nilfs_palloc_get_entry_block()
331 struct nilfs_palloc_cache *cache = NILFS_MDT(inode)->mi_palloc_cache; in nilfs_palloc_delete_entry_block() local
335 &cache->prev_entry, &cache->lock); in nilfs_palloc_delete_entry_block()
[all …]
/fs/ecryptfs/
Dmain.c646 struct kmem_cache **cache; member
653 .cache = &ecryptfs_auth_tok_list_item_cache,
658 .cache = &ecryptfs_file_info_cache,
663 .cache = &ecryptfs_dentry_info_cache,
668 .cache = &ecryptfs_inode_info_cache,
675 .cache = &ecryptfs_sb_info_cache,
680 .cache = &ecryptfs_header_cache,
685 .cache = &ecryptfs_xattr_cache,
690 .cache = &ecryptfs_key_record_cache,
695 .cache = &ecryptfs_key_sig_cache,
[all …]
/fs/afs/
Dfile.c290 ret = fscache_read_or_alloc_page(vnode->cache, in afs_page_filler()
345 fscache_uncache_page(vnode->cache, page); in afs_page_filler()
362 fscache_write_page(vnode->cache, page, vnode->status.size, in afs_page_filler()
364 fscache_uncache_page(vnode->cache, page); in afs_page_filler()
427 fscache_write_page(vnode->cache, page, vnode->status.size, in afs_readpages_page_done()
429 fscache_uncache_page(vnode->cache, page); in afs_readpages_page_done()
492 fscache_uncache_page(vnode->cache, page); in afs_readpages_one()
527 fscache_uncache_page(vnode->cache, page); in afs_readpages_one()
561 ret = fscache_read_or_alloc_pages(vnode->cache, in afs_readpages()
621 fscache_wait_on_page_write(vnode->cache, page); in afs_invalidatepage()
[all …]

1234