12 #include <linux/kernel.h>
13 #include <linux/module.h>
23 static struct dentry *afs_mntpt_lookup(
struct inode *dir,
30 .open = afs_mntpt_open,
35 .lookup = afs_mntpt_lookup,
47 static unsigned long afs_mntpt_expiry_timeout = 10 * 60;
61 vnode->
fid.vid, vnode->
fid.vnode, vnode->
fid.unique);
79 _debug(
"symlink to %*.*s", (
int) size, (
int) size, buf);
82 (buf[0] ==
'%' || buf[0] ==
'#') &&
85 _debug(
"symlink is a mountpoint");
86 spin_lock(&vnode->
lock);
89 spin_unlock(&vnode->
lock);
105 static struct dentry *afs_mntpt_lookup(
struct inode *dir,
109 _enter(
"%p,%p{%p{%s},%s}",
114 dentry->
d_parent->d_name.name : (
const unsigned char *)
"",
125 _enter(
"%p,%p{%p{%s},%s}",
127 file->
f_path.dentry->d_parent,
128 file->
f_path.dentry->d_parent ?
129 file->
f_path.dentry->d_parent->d_name.name :
130 (
const unsigned char *)
"",
131 file->
f_path.dentry->d_name.name);
139 static struct vfsmount *afs_mntpt_do_automount(
struct dentry *mntpt)
156 goto error_no_devname;
160 goto error_no_options;
162 vnode = AFS_FS_I(mntpt->
d_inode);
165 static const char afs_root_cell[] =
":root.cell.";
172 if (mntpt->
d_name.name[0] ==
'.') {
175 memcpy(devname + size, afs_root_cell,
176 sizeof(afs_root_cell));
181 memcpy(devname + size + 1, afs_root_cell,
182 sizeof(afs_root_cell));
186 loff_t size = i_size_read(mntpt->
d_inode);
193 page = read_mapping_page(mntpt->
d_inode->i_mapping, 0,
NULL);
204 memcpy(devname, buf, size);
211 super = AFS_FS_S(mntpt->
d_sb);
212 memcpy(options,
"cell=", 5);
215 strcat(options,
",rwpath");
218 _debug(
"--- attempting mount %s -o %s ---", devname, options);
220 _debug(
"--- mount result %p ---", mnt);
247 newmnt = afs_mntpt_do_automount(path->
dentry);
254 afs_mntpt_expiry_timeout *
HZ);
266 if (!list_empty(&afs_vfsmounts)) {
269 afs_mntpt_expiry_timeout *
HZ);
282 ASSERT(list_empty(&afs_vfsmounts));