@@ -215,7 +215,7 @@ struct fscache_cookie *fscache_hash_cookie(struct fscache_cookie *candidate)
}
__set_bit(FSCACHE_COOKIE_ACQUIRED, &candidate->flags);
- fscache_cookie_get(candidate->parent, fscache_cookie_get_acquire_parent);
+ fscache_get_cookie(candidate->parent, fscache_cookie_get_acquire_parent);
atomic_inc(&candidate->parent->n_children);
hlist_bl_add_head(&candidate->hash_link, h);
hlist_bl_unlock(h);
@@ -232,7 +232,7 @@ struct fscache_cookie *fscache_hash_cookie(struct fscache_cookie *candidate)
return NULL;
}
- fscache_cookie_get(cursor, fscache_cookie_get_reacquire);
+ fscache_get_cookie(cursor, fscache_cookie_get_reacquire);
hlist_bl_unlock(h);
return cursor;
}
@@ -330,7 +330,7 @@ struct fscache_cookie *__fscache_acquire_cookie(
set_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags);
} else {
atomic_dec(&parent->n_children);
- fscache_cookie_put(cookie,
+ fscache_put_cookie(cookie,
fscache_cookie_put_acquire_nobufs);
fscache_stat(&fscache_n_acquires_nobufs);
_leave(" = NULL");
@@ -793,7 +793,7 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie,
}
/* Dispose of the netfs's link to the cookie */
- fscache_cookie_put(cookie, fscache_cookie_put_relinquish);
+ fscache_put_cookie(cookie, fscache_cookie_put_relinquish);
_leave("");
}
@@ -818,7 +818,7 @@ static void fscache_unhash_cookie(struct fscache_cookie *cookie)
/*
* Drop a reference to a cookie.
*/
-void fscache_cookie_put(struct fscache_cookie *cookie,
+void fscache_put_cookie(struct fscache_cookie *cookie,
enum fscache_cookie_trace where)
{
struct fscache_cookie *parent;
@@ -844,11 +844,12 @@ void fscache_cookie_put(struct fscache_cookie *cookie,
_leave("");
}
+EXPORT_SYMBOL(fscache_put_cookie);
/*
* Get a reference to a cookie.
*/
-struct fscache_cookie *fscache_cookie_get(struct fscache_cookie *cookie,
+struct fscache_cookie *fscache_get_cookie(struct fscache_cookie *cookie,
enum fscache_cookie_trace where)
{
int ref;
@@ -857,6 +858,7 @@ struct fscache_cookie *fscache_cookie_get(struct fscache_cookie *cookie,
trace_fscache_cookie(cookie->debug_id, ref + 1, where);
return cookie;
}
+EXPORT_SYMBOL(fscache_get_cookie);
/*
* Generate a list of extant cookies in /proc/fs/fscache/cookies
@@ -72,12 +72,8 @@ extern struct fscache_cookie *fscache_alloc_cookie(struct fscache_cookie *,
const void *, size_t,
loff_t);
extern struct fscache_cookie *fscache_hash_cookie(struct fscache_cookie *);
-extern struct fscache_cookie *fscache_cookie_get(struct fscache_cookie *,
- enum fscache_cookie_trace);
-extern void fscache_cookie_put(struct fscache_cookie *,
- enum fscache_cookie_trace);
-static inline void fscache_cookie_see(struct fscache_cookie *cookie,
+static inline void fscache_see_cookie(struct fscache_cookie *cookie,
enum fscache_cookie_trace where)
{
trace_fscache_cookie(cookie->debug_id, refcount_read(&cookie->ref),
@@ -43,7 +43,7 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
fscache_free_cookie(candidate);
}
- fscache_cookie_get(cookie->parent, fscache_cookie_get_register_netfs);
+ fscache_get_cookie(cookie->parent, fscache_cookie_get_register_netfs);
atomic_inc(&cookie->parent->n_children);
netfs->primary_index = cookie;
@@ -54,7 +54,7 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
return 0;
already_registered:
- fscache_cookie_put(candidate, fscache_cookie_put_dup_netfs);
+ fscache_put_cookie(candidate, fscache_cookie_put_dup_netfs);
_leave(" = -EEXIST");
return -EEXIST;
}
@@ -316,7 +316,7 @@ void fscache_object_init(struct fscache_object *object,
object->events = 0;
object->cache = cache;
object->cookie = cookie;
- fscache_cookie_get(cookie, fscache_cookie_get_attach_object);
+ fscache_get_cookie(cookie, fscache_cookie_get_attach_object);
object->parent = NULL;
#ifdef CONFIG_FSCACHE_OBJECT_LIST
RB_CLEAR_NODE(&object->objlist_link);
@@ -769,7 +769,7 @@ static void fscache_put_object(struct fscache_object *object,
void fscache_object_destroy(struct fscache_object *object)
{
/* We can get rid of the cookie now */
- fscache_cookie_put(object->cookie, fscache_cookie_put_object);
+ fscache_put_cookie(object->cookie, fscache_cookie_put_object);
object->cookie = NULL;
}
EXPORT_SYMBOL(fscache_object_destroy);
@@ -23,6 +23,7 @@
struct fscache_cache;
struct fscache_cache_ops;
struct fscache_object;
+enum fscache_cookie_trace;
enum fscache_obj_ref_trace {
fscache_obj_get_add_to_deps,
@@ -325,6 +326,11 @@ enum fscache_why_object_killed {
extern void fscache_object_mark_killed(struct fscache_object *object,
enum fscache_why_object_killed why);
+extern struct fscache_cookie *fscache_get_cookie(struct fscache_cookie *cookie,
+ enum fscache_cookie_trace where);
+extern void fscache_put_cookie(struct fscache_cookie *cookie,
+ enum fscache_cookie_trace where);
+
/*
* Find the key on a cookie.
*/
Rename fscache_cookie_{get,put,see}() to fscache_{get,put,see}_cookie() and make them available to cache backend modules. Signed-off-by: David Howells <dhowells@redhat.com> --- fs/fscache/cookie.c | 14 ++++++++------ fs/fscache/internal.h | 6 +----- fs/fscache/netfs.c | 4 ++-- fs/fscache/object.c | 4 ++-- include/linux/fscache-cache.h | 6 ++++++ 5 files changed, 19 insertions(+), 15 deletions(-)