summaryrefslogtreecommitdiff
path: root/fs/fscache/main.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-03 19:42:37 +0400
committerDavid Howells <dhowells@redhat.com>2009-04-03 19:42:37 +0400
commit4c515dd47ab41be3f89e757d441661795470b376 (patch)
tree22b1959663cf77ecd60125ef112b87f1ee4fa6ef /fs/fscache/main.c
parent0e04d4cefcf4d8fbbdb2c50e93ad541582933fd2 (diff)
downloadlinux-4c515dd47ab41be3f89e757d441661795470b376.tar.xz
FS-Cache: Add cache management
Implement the entry points by which a cache backend may initialise, add, declare an error upon and withdraw a cache. Further, an object is created in sysfs under which each cache added will get an object created: /sys/fs/fscache/<cachetag>/ All of this is described in Documentation/filesystems/caching/backend-api.txt added by a previous patch. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'fs/fscache/main.c')
-rw-r--r--fs/fscache/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index 7c734b7fb18e..c2f3e637725d 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -56,9 +56,15 @@ static int __init fscache_init(void)
if (ret < 0)
goto error_proc;
+ fscache_root = kobject_create_and_add("fscache", kernel_kobj);
+ if (!fscache_root)
+ goto error_kobj;
+
printk(KERN_NOTICE "FS-Cache: Loaded\n");
return 0;
+error_kobj:
+ fscache_proc_cleanup();
error_proc:
slow_work_unregister_user();
error_slow_work:
@@ -74,6 +80,7 @@ static void __exit fscache_exit(void)
{
_enter("");
+ kobject_put(fscache_root);
fscache_proc_cleanup();
slow_work_unregister_user();
printk(KERN_NOTICE "FS-Cache: Unloaded\n");