]> err.no Git - linux-2.6/blobdiff - fs/afs/mntpt.c
[MIPS] Early check for SMTC kernel on non-MT processor
[linux-2.6] / fs / afs / mntpt.c
index 08c11a0b66bdc9e20aafa88bf1db118c59af29ec..a3684dcc76e7985a4a2b53ea32c81cd12f61cd86 100644 (file)
@@ -36,7 +36,7 @@ const struct inode_operations afs_mntpt_inode_operations = {
        .lookup         = afs_mntpt_lookup,
        .follow_link    = afs_mntpt_follow_link,
        .readlink       = page_readlink,
-       .getattr        = afs_inode_getattr,
+       .getattr        = afs_getattr,
 };
 
 static LIST_HEAD(afs_vfsmounts);
@@ -48,30 +48,32 @@ unsigned long afs_mntpt_expiry_timeout = 10 * 60;
  * check a symbolic link to see whether it actually encodes a mountpoint
  * - sets the AFS_VNODE_MOUNTPOINT flag on the vnode appropriately
  */
-int afs_mntpt_check_symlink(struct afs_vnode *vnode)
+int afs_mntpt_check_symlink(struct afs_vnode *vnode, struct key *key)
 {
+       struct file file = {
+               .private_data = key,
+       };
        struct page *page;
        size_t size;
        char *buf;
        int ret;
 
-       _enter("{%u,%u}", vnode->fid.vnode, vnode->fid.unique);
+       _enter("{%x:%u,%u}",
+              vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique);
 
        /* read the contents of the symlink into the pagecache */
-       page = read_mapping_page(AFS_VNODE_TO_I(vnode)->i_mapping, 0, NULL);
+       page = read_mapping_page(AFS_VNODE_TO_I(vnode)->i_mapping, 0, &file);
        if (IS_ERR(page)) {
                ret = PTR_ERR(page);
                goto out;
        }
 
        ret = -EIO;
-       wait_on_page_locked(page);
-       buf = kmap(page);
-       if (!PageUptodate(page))
-               goto out_free;
        if (PageError(page))
                goto out_free;
 
+       buf = kmap(page);
+
        /* examine the symlink's contents */
        size = vnode->status.size;
        _debug("symlink to %*.*s", (int) size, (int) size, buf);
@@ -88,8 +90,8 @@ int afs_mntpt_check_symlink(struct afs_vnode *vnode)
 
        ret = 0;
 
-out_free:
        kunmap(page);
+out_free:
        page_cache_release(page);
 out:
        _leave(" = %d", ret);
@@ -168,8 +170,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
        }
 
        ret = -EIO;
-       wait_on_page_locked(page);
-       if (!PageUptodate(page) || PageError(page))
+       if (PageError(page))
                goto error;
 
        buf = kmap(page);
@@ -214,7 +215,7 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
        struct vfsmount *newmnt;
        int err;
 
-       _enter("%p{%s},{%s:%p{%s}}",
+       _enter("%p{%s},{%s:%p{%s},}",
               dentry,
               dentry->d_name.name,
               nd->mnt->mnt_devname,
@@ -234,7 +235,8 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
        err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts);
        switch (err) {
        case 0:
-               path_release(nd);
+               mntput(nd->mnt);
+               dput(nd->dentry);
                nd->mnt = newmnt;
                nd->dentry = dget(newmnt->mnt_root);
                schedule_delayed_work(&afs_mntpt_expiry_timer,