Lines Matching refs:object
24 * dump debugging info about an object
27 void __cachefiles_printk_object(struct cachefiles_object *object,
34 pr_err("%sobject: OBJ%x\n", prefix, object->fscache.debug_id);
36 prefix, object->fscache.state->name,
37 object->fscache.flags, work_busy(&object->fscache.work),
38 object->fscache.events, object->fscache.event_mask);
40 prefix, object->fscache.n_ops, object->fscache.n_in_progress,
41 object->fscache.n_exclusive);
43 prefix, object->fscache.parent);
45 spin_lock(&object->fscache.lock);
46 cookie = object->fscache.cookie;
50 object->fscache.cookie,
51 object->fscache.cookie->parent,
52 object->fscache.cookie->netfs_data,
53 object->fscache.cookie->flags);
63 spin_unlock(&object->fscache.lock);
69 static noinline void cachefiles_printk_object(struct cachefiles_object *object,
72 if (object)
73 __cachefiles_printk_object(object, "");
88 struct cachefiles_object *object;
97 object = rb_entry(p, struct cachefiles_object, active_node);
98 if (object->dentry > dentry)
100 else if (object->dentry < dentry)
114 object->fscache.debug_id,
115 object->fscache.state->name,
118 trace_cachefiles_mark_buried(object, dentry, why);
120 if (fscache_object_is_live(&object->fscache)) {
122 pr_err("Error: Can't preemptively bury live object\n");
123 cachefiles_printk_object(object, NULL);
126 fscache_object_mark_killed(&object->fscache, why);
134 * record the fact that an object is now active
137 struct cachefiles_object *object)
143 _enter(",%p", object);
148 dentry = object->dentry;
149 trace_cachefiles_mark_active(object, dentry);
151 if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) {
153 cachefiles_printk_object(object, NULL);
163 ASSERT(xobject != object);
173 rb_link_node(&object->active_node, _parent, _p);
174 rb_insert_color(&object->active_node, &cache->active_nodes);
180 /* an old object from a previous incarnation is hogging the slot - we
183 trace_cachefiles_wait_active(object, dentry, xobject);
184 clear_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags);
188 pr_err("Error: Unexpected object collision\n");
189 cachefiles_printk_object(object, xobject);
201 /* if the object we're waiting for is queued for processing,
205 object->fscache.debug_id,
210 /* otherwise we sleep until either the object we're waiting for
227 object->fscache.debug_id,
234 pr_err("Error: Overlong wait for old active object to go away\n");
235 cachefiles_printk_object(object, xobject);
254 * Mark an object as being inactive.
257 struct cachefiles_object *object,
260 struct dentry *dentry = object->dentry;
263 trace_cachefiles_mark_inactive(object, dentry, inode);
266 rb_erase(&object->active_node, &cache->active_nodes);
267 clear_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags);
270 wake_up_bit(&object->flags, CACHEFILES_OBJECT_ACTIVE);
272 /* This object can now be culled, so we need to let the daemon know
281 * delete an object representation from the cache
288 struct cachefiles_object *object,
305 _debug("unlink stale object");
313 trace_cachefiles_unlink(object, rep, why);
330 _debug("move stale object to graveyard");
415 trace_cachefiles_rename(object, rep, grave, why);
433 * delete an object representation from the cache
436 struct cachefiles_object *object)
441 _enter(",OBJ%x{%p}", object->fscache.debug_id, object->dentry);
443 ASSERT(object->dentry);
444 ASSERT(d_backing_inode(object->dentry));
445 ASSERT(object->dentry->d_parent);
447 dir = dget_parent(object->dentry);
451 if (test_bit(FSCACHE_OBJECT_KILLED_BY_CACHE, &object->fscache.flags)) {
452 /* object allocation for the same key preemptively deleted this
453 * object's file so that it could create its own file */
454 _debug("object preemptively buried");
460 if (dir == object->dentry->d_parent) {
461 ret = cachefiles_bury_object(cache, object, dir,
462 object->dentry, false,
479 * walk from the parent object to the child object through the backing
483 struct cachefiles_object *object,
497 object->fscache.debug_id, key);
534 trace_cachefiles_lookup(object, next, NULL);
539 trace_cachefiles_lookup(object, next, inode);
543 object->new = !inode;
549 fscache_object_lookup_negative(&object->fscache);
551 /* we need to create the object if it's negative */
552 if (key || object->type == FSCACHE_COOKIE_TYPE_INDEX) {
567 trace_cachefiles_mkdir(object, next, ret);
602 trace_cachefiles_create(object, next, ret);
631 /* we've found the object we were looking for */
632 object->dentry = next;
634 /* if we've found that the terminal object exists, then we need to
636 if (!object->new) {
639 ret = cachefiles_check_object_xattr(object, auxdata);
641 /* delete the object (the deleter drops the directory
643 object->dentry = NULL;
645 ret = cachefiles_bury_object(cache, object, dir, next,
655 fscache_object_retrying_stale(&object->fscache);
660 /* note that we're now using this object */
661 ret = cachefiles_mark_object_active(cache, object);
672 if (object->new) {
673 /* attach data to a newly constructed terminal object */
674 ret = cachefiles_set_object_xattr(object, auxdata);
678 /* always update the atime on an object we've just looked up
687 if (object->type != FSCACHE_COOKIE_TYPE_INDEX) {
688 if (d_is_reg(object->dentry)) {
692 aops = d_backing_inode(object->dentry)->i_mapping->a_ops;
695 if (object->dentry->d_sb->s_blocksize > PAGE_SIZE)
698 object->backer = object->dentry;
704 object->new = 0;
705 fscache_obtained_object(&object->fscache);
707 _leave(" = 0 [%lu]", d_backing_inode(object->dentry)->i_ino);
711 fscache_object_mark_killed(&object->fscache, FSCACHE_OBJECT_NO_SPACE);
725 cache, object, d_backing_inode(object->dentry)->i_blocks);
727 dput(object->dentry);
728 object->dentry = NULL;
858 * find out if an object is in use or not
859 * - if finds object and it's not in use:
860 * - returns a pointer to the object and a reference on it
867 struct cachefiles_object *object;
888 /* if the object is no longer there then we probably retired the object
898 /* check to see if we're using this object */
904 object = rb_entry(_n, struct cachefiles_object, active_node);
906 if (object->dentry > victim)
908 else if (object->dentry < victim)
947 * cull an object if it's not in use
1006 * find out if an object is in use or not
1008 * - returns -EBUSY or 0 to indicate whether an object is in use or not