aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-05-10 14:50:25 -0400
committerDavid Howells <dhowells@redhat.com>2013-06-19 09:16:47 -0400
commit610be24ee434aa89197f06f30fef02be83c006a5 (patch)
treed9bf801f4e81c4cee1dc20fa444e0a3d17c6372a /fs/fscache
parent0c59a95d90081e5d840649d4f872027123e3420c (diff)
FS-Cache: Uninline fscache_object_init()
Uninline fscache_object_init() so as not to expose some of the FS-Cache internals to the cache backend. Signed-off-by: David Howells <dhowells@redhat.com> Tested-By: Milosz Tanski <milosz@adfin.com> Acked-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/object.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/fs/fscache/object.c b/fs/fscache/object.c
index 50d41c180211..0133699f74ee 100644
--- a/fs/fscache/object.c
+++ b/fs/fscache/object.c
@@ -363,7 +363,7 @@ unsupported_event:
363/* 363/*
364 * execute an object 364 * execute an object
365 */ 365 */
366void fscache_object_work_func(struct work_struct *work) 366static void fscache_object_work_func(struct work_struct *work)
367{ 367{
368 struct fscache_object *object = 368 struct fscache_object *object =
369 container_of(work, struct fscache_object, work); 369 container_of(work, struct fscache_object, work);
@@ -379,7 +379,43 @@ void fscache_object_work_func(struct work_struct *work)
379 clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); 379 clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
380 fscache_put_object(object); 380 fscache_put_object(object);
381} 381}
382EXPORT_SYMBOL(fscache_object_work_func); 382
383/**
384 * fscache_object_init - Initialise a cache object description
385 * @object: Object description
386 * @cookie: Cookie object will be attached to
387 * @cache: Cache in which backing object will be found
388 *
389 * Initialise a cache object description to its basic values.
390 *
391 * See Documentation/filesystems/caching/backend-api.txt for a complete
392 * description.
393 */
394void fscache_object_init(struct fscache_object *object,
395 struct fscache_cookie *cookie,
396 struct fscache_cache *cache)
397{
398 atomic_inc(&cache->object_count);
399
400 object->state = FSCACHE_OBJECT_INIT;
401 spin_lock_init(&object->lock);
402 INIT_LIST_HEAD(&object->cache_link);
403 INIT_HLIST_NODE(&object->cookie_link);
404 INIT_WORK(&object->work, fscache_object_work_func);
405 INIT_LIST_HEAD(&object->dependents);
406 INIT_LIST_HEAD(&object->dep_link);
407 INIT_LIST_HEAD(&object->pending_ops);
408 object->n_children = 0;
409 object->n_ops = object->n_in_progress = object->n_exclusive = 0;
410 object->events = object->event_mask = 0;
411 object->flags = 0;
412 object->store_limit = 0;
413 object->store_limit_l = 0;
414 object->cache = cache;
415 object->cookie = cookie;
416 object->parent = NULL;
417}
418EXPORT_SYMBOL(fscache_object_init);
383 419
384/* 420/*
385 * initialise an object 421 * initialise an object