Lines Matching refs:object

31 	struct cachefiles_object *object;  in cachefiles_alloc_object()  local
47 object = kmem_cache_alloc(cachefiles_object_jar, cachefiles_gfp); in cachefiles_alloc_object()
48 if (!object) in cachefiles_alloc_object()
51 ASSERTCMP(object->backer, ==, NULL); in cachefiles_alloc_object()
53 BUG_ON(test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)); in cachefiles_alloc_object()
54 atomic_set(&object->usage, 1); in cachefiles_alloc_object()
56 fscache_object_init(&object->fscache, cookie, &cache->cache); in cachefiles_alloc_object()
58 object->type = cookie->def->type; in cachefiles_alloc_object()
77 key = cachefiles_cook_key(buffer, keylen + 2, object->type); in cachefiles_alloc_object()
95 object->lookup_data = lookup_data; in cachefiles_alloc_object()
97 _leave(" = %p [%p]", &object->fscache, lookup_data); in cachefiles_alloc_object()
98 return &object->fscache; in cachefiles_alloc_object()
103 BUG_ON(test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)); in cachefiles_alloc_object()
104 kmem_cache_free(cachefiles_object_jar, object); in cachefiles_alloc_object()
120 struct cachefiles_object *parent, *object; in cachefiles_lookup_object() local
130 object = container_of(_object, struct cachefiles_object, fscache); in cachefiles_lookup_object()
131 lookup_data = object->lookup_data; in cachefiles_lookup_object()
137 ret = cachefiles_walk_to_object(parent, object, in cachefiles_lookup_object()
144 object->fscache.cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX) in cachefiles_lookup_object()
145 cachefiles_attr_changed(&object->fscache); in cachefiles_lookup_object()
150 fscache_object_lookup_error(&object->fscache); in cachefiles_lookup_object()
162 struct cachefiles_object *object; in cachefiles_lookup_complete() local
164 object = container_of(_object, struct cachefiles_object, fscache); in cachefiles_lookup_complete()
166 _enter("{OBJ%x,%p}", object->fscache.debug_id, object->lookup_data); in cachefiles_lookup_complete()
168 if (object->lookup_data) { in cachefiles_lookup_complete()
169 kfree(object->lookup_data->key); in cachefiles_lookup_complete()
170 kfree(object->lookup_data->auxdata); in cachefiles_lookup_complete()
171 kfree(object->lookup_data); in cachefiles_lookup_complete()
172 object->lookup_data = NULL; in cachefiles_lookup_complete()
182 struct cachefiles_object *object = in cachefiles_grab_object() local
185 _enter("{OBJ%x,%d}", _object->debug_id, atomic_read(&object->usage)); in cachefiles_grab_object()
188 ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000); in cachefiles_grab_object()
191 atomic_inc(&object->usage); in cachefiles_grab_object()
192 return &object->fscache; in cachefiles_grab_object()
200 struct cachefiles_object *object; in cachefiles_update_object() local
209 object = container_of(_object, struct cachefiles_object, fscache); in cachefiles_update_object()
210 cache = container_of(object->fscache.cache, struct cachefiles_cache, in cachefiles_update_object()
218 cookie = object->fscache.cookie; in cachefiles_update_object()
241 cachefiles_update_object_xattr(object, auxdata); in cachefiles_update_object()
253 struct cachefiles_object *object; in cachefiles_drop_object() local
259 object = container_of(_object, struct cachefiles_object, fscache); in cachefiles_drop_object()
262 object->fscache.debug_id, atomic_read(&object->usage)); in cachefiles_drop_object()
264 cache = container_of(object->fscache.cache, in cachefiles_drop_object()
268 ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000); in cachefiles_drop_object()
276 if (object->dentry) { in cachefiles_drop_object()
278 if (test_bit(FSCACHE_OBJECT_RETIRED, &object->fscache.flags) && in cachefiles_drop_object()
281 _debug("- retire object OBJ%x", object->fscache.debug_id); in cachefiles_drop_object()
283 cachefiles_delete_object(cache, object); in cachefiles_drop_object()
288 if (object->backer != object->dentry) in cachefiles_drop_object()
289 dput(object->backer); in cachefiles_drop_object()
290 object->backer = NULL; in cachefiles_drop_object()
294 if (test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) { in cachefiles_drop_object()
297 &object->flags)) in cachefiles_drop_object()
299 rb_erase(&object->active_node, &cache->active_nodes); in cachefiles_drop_object()
300 wake_up_bit(&object->flags, CACHEFILES_OBJECT_ACTIVE); in cachefiles_drop_object()
304 dput(object->dentry); in cachefiles_drop_object()
305 object->dentry = NULL; in cachefiles_drop_object()
315 struct cachefiles_object *object; in cachefiles_put_object() local
320 object = container_of(_object, struct cachefiles_object, fscache); in cachefiles_put_object()
323 object->fscache.debug_id, atomic_read(&object->usage)); in cachefiles_put_object()
326 ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000); in cachefiles_put_object()
329 ASSERTIFCMP(object->fscache.parent, in cachefiles_put_object()
330 object->fscache.parent->n_children, >, 0); in cachefiles_put_object()
332 if (atomic_dec_and_test(&object->usage)) { in cachefiles_put_object()
333 _debug("- kill object OBJ%x", object->fscache.debug_id); in cachefiles_put_object()
335 ASSERT(!test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)); in cachefiles_put_object()
336 ASSERTCMP(object->fscache.parent, ==, NULL); in cachefiles_put_object()
337 ASSERTCMP(object->backer, ==, NULL); in cachefiles_put_object()
338 ASSERTCMP(object->dentry, ==, NULL); in cachefiles_put_object()
339 ASSERTCMP(object->fscache.n_ops, ==, 0); in cachefiles_put_object()
340 ASSERTCMP(object->fscache.n_children, ==, 0); in cachefiles_put_object()
342 if (object->lookup_data) { in cachefiles_put_object()
343 kfree(object->lookup_data->key); in cachefiles_put_object()
344 kfree(object->lookup_data->auxdata); in cachefiles_put_object()
345 kfree(object->lookup_data); in cachefiles_put_object()
346 object->lookup_data = NULL; in cachefiles_put_object()
349 cache = object->fscache.cache; in cachefiles_put_object()
350 fscache_object_destroy(&object->fscache); in cachefiles_put_object()
351 kmem_cache_free(cachefiles_object_jar, object); in cachefiles_put_object()
392 struct cachefiles_object *object; in cachefiles_check_consistency() local
397 _enter("{OBJ%x}", op->object->debug_id); in cachefiles_check_consistency()
399 object = container_of(op->object, struct cachefiles_object, fscache); in cachefiles_check_consistency()
400 cache = container_of(object->fscache.cache, in cachefiles_check_consistency()
404 ret = cachefiles_check_auxdata(object); in cachefiles_check_consistency()
417 struct cachefiles_object *object; in cachefiles_attr_changed() local
430 object = container_of(_object, struct cachefiles_object, fscache); in cachefiles_attr_changed()
431 cache = container_of(object->fscache.cache, in cachefiles_attr_changed()
434 if (ni_size == object->i_size) in cachefiles_attr_changed()
437 if (!object->backer) in cachefiles_attr_changed()
440 ASSERT(d_is_reg(object->backer)); in cachefiles_attr_changed()
442 fscache_set_store_limit(&object->fscache, ni_size); in cachefiles_attr_changed()
444 oi_size = i_size_read(d_backing_inode(object->backer)); in cachefiles_attr_changed()
449 mutex_lock(&d_inode(object->backer)->i_mutex); in cachefiles_attr_changed()
458 ret = notify_change(object->backer, &newattrs, NULL); in cachefiles_attr_changed()
465 ret = notify_change(object->backer, &newattrs, NULL); in cachefiles_attr_changed()
468 mutex_unlock(&d_inode(object->backer)->i_mutex); in cachefiles_attr_changed()
472 fscache_set_store_limit(&object->fscache, 0); in cachefiles_attr_changed()
473 cachefiles_io_error_obj(object, "Size set failed"); in cachefiles_attr_changed()
486 struct cachefiles_object *object; in cachefiles_invalidate_object() local
493 object = container_of(op->object, struct cachefiles_object, fscache); in cachefiles_invalidate_object()
494 cache = container_of(object->fscache.cache, in cachefiles_invalidate_object()
497 op->object->cookie->def->get_attr(op->object->cookie->netfs_data, in cachefiles_invalidate_object()
501 op->object->debug_id, (unsigned long long)ni_size); in cachefiles_invalidate_object()
503 if (object->backer) { in cachefiles_invalidate_object()
504 ASSERT(d_is_reg(object->backer)); in cachefiles_invalidate_object()
506 fscache_set_store_limit(&object->fscache, ni_size); in cachefiles_invalidate_object()
508 path.dentry = object->backer; in cachefiles_invalidate_object()
518 fscache_set_store_limit(&object->fscache, 0); in cachefiles_invalidate_object()
520 cachefiles_io_error_obj(object, in cachefiles_invalidate_object()