Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+40 -38
+38 -2
fs/fscache/object.c
··· 363 363 /* 364 364 * execute an object 365 365 */ 366 - void fscache_object_work_func(struct work_struct *work) 366 + static void fscache_object_work_func(struct work_struct *work) 367 367 { 368 368 struct fscache_object *object = 369 369 container_of(work, struct fscache_object, work); ··· 379 379 clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); 380 380 fscache_put_object(object); 381 381 } 382 - EXPORT_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 + */ 394 + void 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 + } 418 + EXPORT_SYMBOL(fscache_object_init); 383 419 384 420 /* 385 421 * initialise an object
+2 -36
include/linux/fscache-cache.h
··· 426 426 (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ 427 427 (obj)->state >= FSCACHE_OBJECT_DYING) 428 428 429 - extern void fscache_object_work_func(struct work_struct *work); 430 - 431 - /** 432 - * fscache_object_init - Initialise a cache object description 433 - * @object: Object description 434 - * 435 - * Initialise a cache object description to its basic values. 436 - * 437 - * See Documentation/filesystems/caching/backend-api.txt for a complete 438 - * description. 439 - */ 440 - static inline 441 - void fscache_object_init(struct fscache_object *object, 442 - struct fscache_cookie *cookie, 443 - struct fscache_cache *cache) 444 - { 445 - atomic_inc(&cache->object_count); 446 - 447 - object->state = FSCACHE_OBJECT_INIT; 448 - spin_lock_init(&object->lock); 449 - INIT_LIST_HEAD(&object->cache_link); 450 - INIT_HLIST_NODE(&object->cookie_link); 451 - INIT_WORK(&object->work, fscache_object_work_func); 452 - INIT_LIST_HEAD(&object->dependents); 453 - INIT_LIST_HEAD(&object->dep_link); 454 - INIT_LIST_HEAD(&object->pending_ops); 455 - object->n_children = 0; 456 - object->n_ops = object->n_in_progress = object->n_exclusive = 0; 457 - object->events = object->event_mask = 0; 458 - object->flags = 0; 459 - object->store_limit = 0; 460 - object->store_limit_l = 0; 461 - object->cache = cache; 462 - object->cookie = cookie; 463 - object->parent = NULL; 464 - } 429 + extern void fscache_object_init(struct fscache_object *, struct fscache_cookie *, 430 + struct fscache_cache *); 465 431 466 432 extern void fscache_object_lookup_negative(struct fscache_object *object); 467 433 extern void fscache_obtained_object(struct fscache_object *object);