]> bbs.cooldavid.org Git - net-next-2.6.git/blob - fs/nfs/fscache-index.c
NFS: Register NFS for caching and retrieve the top-level index
[net-next-2.6.git] / fs / nfs / fscache-index.c
1 /* NFS FS-Cache index structure definition
2  *
3  * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells (dhowells@redhat.com)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public Licence
8  * as published by the Free Software Foundation; either version
9  * 2 of the Licence, or (at your option) any later version.
10  */
11
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
15 #include <linux/mm.h>
16 #include <linux/nfs_fs.h>
17 #include <linux/nfs_fs_sb.h>
18 #include <linux/in6.h>
19
20 #include "internal.h"
21 #include "fscache.h"
22
23 #define NFSDBG_FACILITY         NFSDBG_FSCACHE
24
25 /*
26  * Define the NFS filesystem for FS-Cache.  Upon registration FS-Cache sticks
27  * the cookie for the top-level index object for NFS into here.  The top-level
28  * index can than have other cache objects inserted into it.
29  */
30 struct fscache_netfs nfs_fscache_netfs = {
31         .name           = "nfs",
32         .version        = 0,
33 };
34
35 /*
36  * Register NFS for caching
37  */
38 int nfs_fscache_register(void)
39 {
40         return fscache_register_netfs(&nfs_fscache_netfs);
41 }
42
43 /*
44  * Unregister NFS for caching
45  */
46 void nfs_fscache_unregister(void)
47 {
48         fscache_unregister_netfs(&nfs_fscache_netfs);
49 }