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