Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377727
b: refs/heads/master
c: 610be24
h: refs/heads/master
i:
  377725: 9492e60
  377723: a9fe1e3
  377719: b7b6710
  377711: e97b1c9
  377695: 03b5664
  377663: 8398b23
  377599: 6bf9df4
v: v3
  • Loading branch information
David Howells committed Jun 19, 2013
1 parent c5fafc4 commit 226e28e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c59a95d90081e5d840649d4f872027123e3420c
refs/heads/master: 610be24ee434aa89197f06f30fef02be83c006a5
40 changes: 38 additions & 2 deletions trunk/fs/fscache/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static void fscache_object_state_machine(struct fscache_object *object)
/*
* execute an object
*/
void fscache_object_work_func(struct work_struct *work)
static void fscache_object_work_func(struct work_struct *work)
{
struct fscache_object *object =
container_of(work, struct fscache_object, work);
Expand All @@ -379,7 +379,43 @@ void fscache_object_work_func(struct work_struct *work)
clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
fscache_put_object(object);
}
EXPORT_SYMBOL(fscache_object_work_func);

/**
* fscache_object_init - Initialise a cache object description
* @object: Object description
* @cookie: Cookie object will be attached to
* @cache: Cache in which backing object will be found
*
* Initialise a cache object description to its basic values.
*
* See Documentation/filesystems/caching/backend-api.txt for a complete
* description.
*/
void fscache_object_init(struct fscache_object *object,
struct fscache_cookie *cookie,
struct fscache_cache *cache)
{
atomic_inc(&cache->object_count);

object->state = FSCACHE_OBJECT_INIT;
spin_lock_init(&object->lock);
INIT_LIST_HEAD(&object->cache_link);
INIT_HLIST_NODE(&object->cookie_link);
INIT_WORK(&object->work, fscache_object_work_func);
INIT_LIST_HEAD(&object->dependents);
INIT_LIST_HEAD(&object->dep_link);
INIT_LIST_HEAD(&object->pending_ops);
object->n_children = 0;
object->n_ops = object->n_in_progress = object->n_exclusive = 0;
object->events = object->event_mask = 0;
object->flags = 0;
object->store_limit = 0;
object->store_limit_l = 0;
object->cache = cache;
object->cookie = cookie;
object->parent = NULL;
}
EXPORT_SYMBOL(fscache_object_init);

/*
* initialise an object
Expand Down
38 changes: 2 additions & 36 deletions trunk/include/linux/fscache-cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,42 +426,8 @@ extern const char *fscache_object_states[];
(test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \
(obj)->state >= FSCACHE_OBJECT_DYING)

extern void fscache_object_work_func(struct work_struct *work);

/**
* fscache_object_init - Initialise a cache object description
* @object: Object description
*
* Initialise a cache object description to its basic values.
*
* See Documentation/filesystems/caching/backend-api.txt for a complete
* description.
*/
static inline
void fscache_object_init(struct fscache_object *object,
struct fscache_cookie *cookie,
struct fscache_cache *cache)
{
atomic_inc(&cache->object_count);

object->state = FSCACHE_OBJECT_INIT;
spin_lock_init(&object->lock);
INIT_LIST_HEAD(&object->cache_link);
INIT_HLIST_NODE(&object->cookie_link);
INIT_WORK(&object->work, fscache_object_work_func);
INIT_LIST_HEAD(&object->dependents);
INIT_LIST_HEAD(&object->dep_link);
INIT_LIST_HEAD(&object->pending_ops);
object->n_children = 0;
object->n_ops = object->n_in_progress = object->n_exclusive = 0;
object->events = object->event_mask = 0;
object->flags = 0;
object->store_limit = 0;
object->store_limit_l = 0;
object->cache = cache;
object->cookie = cookie;
object->parent = NULL;
}
extern void fscache_object_init(struct fscache_object *, struct fscache_cookie *,
struct fscache_cache *);

extern void fscache_object_lookup_negative(struct fscache_object *object);
extern void fscache_obtained_object(struct fscache_object *object);
Expand Down

0 comments on commit 226e28e

Please sign in to comment.