1 /* AFS client file system
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/module.h>
13 #include <linux/moduleparam.h>
14 #include <linux/init.h>
15 #include <linux/completion.h>
18 MODULE_DESCRIPTION("AFS Client File System");
19 MODULE_AUTHOR("Red Hat, Inc.");
20 MODULE_LICENSE("GPL");
23 module_param_named(debug
, afs_debug
, uint
, S_IWUSR
| S_IRUGO
);
24 MODULE_PARM_DESC(afs_debug
, "AFS debugging mask");
26 static char *rootcell
;
28 module_param(rootcell
, charp
, 0);
29 MODULE_PARM_DESC(rootcell
, "root AFS cell name and VL server IP addr list");
31 #ifdef AFS_CACHING_SUPPORT
32 static struct cachefs_netfs_operations afs_cache_ops
= {
33 .get_page_cookie
= afs_cache_get_page_cookie
,
36 struct cachefs_netfs afs_cache_netfs
= {
39 .ops
= &afs_cache_ops
,
44 * initialise the AFS client FS module
46 static int __init
afs_init(void)
50 printk(KERN_INFO
"kAFS: Red Hat AFS client v0.1 registering.\n");
52 /* register the /proc stuff */
53 ret
= afs_proc_init();
57 #ifdef AFS_CACHING_SUPPORT
58 /* we want to be able to cache */
59 ret
= cachefs_register_netfs(&afs_cache_netfs
,
60 &afs_cache_cell_index_def
);
65 /* initialise the cell DB */
66 ret
= afs_cell_init(rootcell
);
70 /* initialise the VL update process */
71 ret
= afs_vlocation_update_init();
73 goto error_vl_update_init
;
75 /* initialise the callback update process */
76 ret
= afs_callback_update_init();
78 /* create the RxRPC transport */
79 ret
= afs_open_socket();
81 goto error_open_socket
;
83 /* register the filesystems */
95 #ifdef AFS_CACHING_SUPPORT
96 cachefs_unregister_netfs(&afs_cache_netfs
);
99 afs_callback_update_kill();
100 afs_vlocation_purge();
103 printk(KERN_ERR
"kAFS: failed to register: %d\n", ret
);
107 /* XXX late_initcall is kludgy, but the only alternative seems to create
108 * a transport upon the first mount, which is worse. Or is it?
110 late_initcall(afs_init
); /* must be called after net/ to create socket */
113 * clean up on module removal
115 static void __exit
afs_exit(void)
117 printk(KERN_INFO
"kAFS: Red Hat AFS client v0.1 unregistering.\n");
122 afs_callback_update_kill();
123 afs_vlocation_purge();
124 flush_scheduled_work();
126 #ifdef AFS_CACHING_SUPPORT
127 cachefs_unregister_netfs(&afs_cache_netfs
);
132 module_exit(afs_exit
);