Lines Matching refs:object

20  * allocate an object record for a cookie lookup and prepare the lookup data
27 struct cachefiles_object *object;
42 /* create a new object record and a temporary leaf image */
43 object = kmem_cache_alloc(cachefiles_object_jar, cachefiles_gfp);
44 if (!object)
47 ASSERTCMP(object->backer, ==, NULL);
49 BUG_ON(test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags));
50 atomic_set(&object->usage, 1);
52 fscache_object_init(&object->fscache, cookie, &cache->cache);
54 object->type = cookie->def->type;
77 key = cachefiles_cook_key(buffer, keylen + 2, object->type);
81 /* get hold of the auxiliary data and prepend the object type */
97 object->lookup_data = lookup_data;
99 _leave(" = %p [%p]", &object->fscache, lookup_data);
100 return &object->fscache;
105 BUG_ON(test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags));
106 kmem_cache_free(cachefiles_object_jar, object);
122 struct cachefiles_object *parent, *object;
132 object = container_of(_object, struct cachefiles_object, fscache);
133 lookup_data = object->lookup_data;
139 ret = cachefiles_walk_to_object(parent, object,
146 object->fscache.cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX)
147 cachefiles_attr_changed(&object->fscache);
152 fscache_object_lookup_error(&object->fscache);
164 struct cachefiles_object *object;
166 object = container_of(_object, struct cachefiles_object, fscache);
168 _enter("{OBJ%x,%p}", object->fscache.debug_id, object->lookup_data);
170 if (object->lookup_data) {
171 kfree(object->lookup_data->key);
172 kfree(object->lookup_data->auxdata);
173 kfree(object->lookup_data);
174 object->lookup_data = NULL;
179 * increment the usage count on an inode object (may fail if unmounting)
185 struct cachefiles_object *object =
189 _enter("{OBJ%x,%d}", _object->debug_id, atomic_read(&object->usage));
192 ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000);
195 u = atomic_inc_return(&object->usage);
196 trace_cachefiles_ref(object, _object->cookie,
198 return &object->fscache;
202 * update the auxiliary data for an object object on disk
206 struct cachefiles_object *object;
216 object = container_of(_object, struct cachefiles_object, fscache);
217 cache = container_of(object->fscache.cache, struct cachefiles_cache,
225 cookie = object->fscache.cookie;
251 cachefiles_update_object_xattr(object, auxdata);
258 * discard the resources pinned by an object and effect retirement if
263 struct cachefiles_object *object;
271 object = container_of(_object, struct cachefiles_object, fscache);
274 object->fscache.debug_id, atomic_read(&object->usage));
276 cache = container_of(object->fscache.cache,
280 ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000);
283 /* We need to tidy the object up if we did in fact manage to open it.
284 * It's possible for us to get here before the object is fully
285 * initialised if the parent goes away or the object gets retired
288 if (object->dentry) {
290 if (test_bit(FSCACHE_OBJECT_RETIRED, &object->fscache.flags) &&
293 _debug("- retire object OBJ%x", object->fscache.debug_id);
294 inode = d_backing_inode(object->dentry);
299 cachefiles_delete_object(cache, object);
303 /* close the filesystem stuff attached to the object */
304 if (object->backer != object->dentry)
305 dput(object->backer);
306 object->backer = NULL;
309 /* note that the object is now inactive */
310 if (test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags))
311 cachefiles_mark_object_inactive(cache, object, i_blocks);
313 dput(object->dentry);
314 object->dentry = NULL;
320 * dispose of a reference to an object
325 struct cachefiles_object *object;
331 object = container_of(_object, struct cachefiles_object, fscache);
334 object->fscache.debug_id, atomic_read(&object->usage));
337 ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000);
340 ASSERTIFCMP(object->fscache.parent,
341 object->fscache.parent->n_children, >, 0);
343 u = atomic_dec_return(&object->usage);
344 trace_cachefiles_ref(object, _object->cookie,
348 _debug("- kill object OBJ%x", object->fscache.debug_id);
350 ASSERT(!test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags));
351 ASSERTCMP(object->fscache.parent, ==, NULL);
352 ASSERTCMP(object->backer, ==, NULL);
353 ASSERTCMP(object->dentry, ==, NULL);
354 ASSERTCMP(object->fscache.n_ops, ==, 0);
355 ASSERTCMP(object->fscache.n_children, ==, 0);
357 if (object->lookup_data) {
358 kfree(object->lookup_data->key);
359 kfree(object->lookup_data->auxdata);
360 kfree(object->lookup_data);
361 object->lookup_data = NULL;
364 cache = object->fscache.cache;
365 fscache_object_destroy(&object->fscache);
366 kmem_cache_free(cachefiles_object_jar, object);
407 struct cachefiles_object *object;
412 _enter("{OBJ%x}", op->object->debug_id);
414 object = container_of(op->object, struct cachefiles_object, fscache);
415 cache = container_of(object->fscache.cache,
419 ret = cachefiles_check_auxdata(object);
427 * notification the attributes on an object have changed
432 struct cachefiles_object *object;
445 object = container_of(_object, struct cachefiles_object, fscache);
446 cache = container_of(object->fscache.cache,
449 if (ni_size == object->i_size)
452 if (!object->backer)
455 ASSERT(d_is_reg(object->backer));
457 fscache_set_store_limit(&object->fscache, ni_size);
459 oi_size = i_size_read(d_backing_inode(object->backer));
464 inode_lock(d_inode(object->backer));
473 ret = notify_change(object->backer, &newattrs, NULL);
480 ret = notify_change(object->backer, &newattrs, NULL);
483 inode_unlock(d_inode(object->backer));
487 fscache_set_store_limit(&object->fscache, 0);
488 cachefiles_io_error_obj(object, "Size set failed");
497 * Invalidate an object
501 struct cachefiles_object *object;
508 object = container_of(op->object, struct cachefiles_object, fscache);
509 cache = container_of(object->fscache.cache,
512 ni_size = op->object->store_limit_l;
515 op->object->debug_id, (unsigned long long)ni_size);
517 if (object->backer) {
518 ASSERT(d_is_reg(object->backer));
520 fscache_set_store_limit(&object->fscache, ni_size);
522 path.dentry = object->backer;
532 fscache_set_store_limit(&object->fscache, 0);
534 cachefiles_io_error_obj(object,