linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / afs / main.c
index 5840bb2..913c689 100644 (file)
@@ -1,6 +1,6 @@
 /* main.c: AFS client file system
  *
- * Copyright (C) 2002,5 Red Hat, Inc. All Rights Reserved.
+ * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
  *
  * This program is free software; you can redistribute it and/or
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/completion.h>
-#include <linux/fscache.h>
 #include <rxrpc/rxrpc.h>
 #include <rxrpc/transport.h>
 #include <rxrpc/call.h>
 #include <rxrpc/peer.h>
+#include "cache.h"
 #include "cell.h"
 #include "server.h"
 #include "fsclient.h"
@@ -51,11 +51,12 @@ static struct rxrpc_peer_ops afs_peer_ops = {
 struct list_head afs_cb_hash_tbl[AFS_CB_HASH_COUNT];
 DEFINE_SPINLOCK(afs_cb_hash_lock);
 
-#ifdef CONFIG_AFS_FSCACHE
-static struct fscache_netfs_operations afs_cache_ops = {
+#ifdef AFS_CACHING_SUPPORT
+static struct cachefs_netfs_operations afs_cache_ops = {
+       .get_page_cookie        = afs_cache_get_page_cookie,
 };
 
-struct fscache_netfs afs_cache_netfs = {
+struct cachefs_netfs afs_cache_netfs = {
        .name                   = "afs",
        .version                = 0,
        .ops                    = &afs_cache_ops,
@@ -82,9 +83,10 @@ static int __init afs_init(void)
        if (ret < 0)
                return ret;
 
-#ifdef CONFIG_AFS_FSCACHE
+#ifdef AFS_CACHING_SUPPORT
        /* we want to be able to cache */
-       ret = fscache_register_netfs(&afs_cache_netfs);
+       ret = cachefs_register_netfs(&afs_cache_netfs,
+                                    &afs_cache_cell_index_def);
        if (ret < 0)
                goto error;
 #endif
@@ -135,8 +137,8 @@ static int __init afs_init(void)
        afs_key_unregister();
  error_cache:
 #endif
-#ifdef CONFIG_AFS_FSCACHE
-       fscache_unregister_netfs(&afs_cache_netfs);
+#ifdef AFS_CACHING_SUPPORT
+       cachefs_unregister_netfs(&afs_cache_netfs);
  error:
 #endif
        afs_cell_purge();
@@ -165,8 +167,8 @@ static void __exit afs_exit(void)
 #ifdef CONFIG_KEYS_TURNED_OFF
        afs_key_unregister();
 #endif
-#ifdef CONFIG_AFS_FSCACHE
-       fscache_unregister_netfs(&afs_cache_netfs);
+#ifdef AFS_CACHING_SUPPORT
+       cachefs_unregister_netfs(&afs_cache_netfs);
 #endif
        afs_proc_cleanup();