17 #include <linux/kernel.h>
18 #include <linux/module.h>
21 #include <linux/slab.h>
26 #include <linux/sched.h>
29 #define AFS_FS_MAGIC 0x6B414653
31 static void afs_i_init_once(
void *
foo);
33 int flags,
const char *dev_name,
void *
data);
36 static void afs_destroy_inode(
struct inode *
inode);
43 .kill_sb = afs_kill_super,
49 .alloc_inode = afs_alloc_inode,
51 .destroy_inode = afs_destroy_inode,
57 static atomic_t afs_count_active_inodes;
93 if (!afs_inode_cachep) {
121 printk(
"kAFS: %d active inode objects still present\n",
141 char *
options,
const char **devname)
152 while ((p =
strsep(&options,
","))) {
160 args[0].to - args[0].from,
163 return PTR_ERR(cell);
173 *devname = args[0].
from;
182 " Unknown or invalid mount option: '%s'\n", p);
207 const char *cellname, *suffix;
217 if ((name[0] !=
'%' && name[0] !=
'#') || !name[1]) {
224 params->
force =
false;
225 if (params->
rwpath || name[0] ==
'%') {
227 params->
force =
true;
246 if (
strcmp(suffix,
".readonly") == 0) {
248 params->
force =
true;
249 }
else if (
strcmp(suffix,
".backup") == 0) {
251 params->
force =
true;
252 }
else if (suffix[1] == 0) {
262 cellnamesz, cellnamesz, cellname ?:
"", params->
cell);
265 if (cellname || !params->
cell) {
269 cellnamesz, cellnamesz, cellname ?:
"");
270 return PTR_ERR(cell);
276 _debug(
"CELL:%s [%p] VOLUME:%*.*s SUFFIX:%s TYPE:%d%s",
279 suffix ?:
"-", params->
type, params->
force ?
" FORCE" :
"");
318 sb->
s_op = &afs_super_ops;
328 return PTR_ERR(inode);
352 int flags,
const char *dev_name,
void *options)
362 _enter(
",,%s,%p", dev_name, options);
364 memset(¶ms, 0,
sizeof(params));
368 ret = afs_parse_options(¶ms, options, &dev_name);
373 ret = afs_parse_device_name(¶ms, dev_name);
380 _leave(
" = %ld [key]", PTR_ERR(key));
403 sb =
sget(fs_type, afs_test_super, afs_set_super, flags, as);
414 ret = afs_fill_super(sb, ¶ms);
452 static void afs_i_init_once(
void *_vnode)
456 memset(vnode, 0,
sizeof(*vnode));
473 static struct inode *afs_alloc_inode(
struct super_block *sb)
498 struct afs_vnode *vnode = AFS_FS_I(inode);
505 static void afs_destroy_inode(
struct inode *inode)
507 struct afs_vnode *vnode = AFS_FS_I(inode);
509 _enter(
"%p{%x:%u}", inode, vnode->
fid.vid, vnode->
fid.vnode);
511 _debug(
"DESTROY INODE %p", inode);
544 if (vs.max_quota == 0)