linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / afs / mntpt.c
index 2a53d51..31ee065 100644 (file)
@@ -32,7 +32,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
 static int afs_mntpt_open(struct inode *inode, struct file *file);
 static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd);
 
-const struct file_operations afs_mntpt_file_operations = {
+struct file_operations afs_mntpt_file_operations = {
        .open           = afs_mntpt_open,
 };
 
@@ -63,6 +63,7 @@ unsigned long afs_mntpt_expiry_timeout = 20;
 int afs_mntpt_check_symlink(struct afs_vnode *vnode)
 {
        struct page *page;
+       filler_t *filler;
        size_t size;
        char *buf;
        int ret;
@@ -70,7 +71,10 @@ int afs_mntpt_check_symlink(struct afs_vnode *vnode)
        _enter("{%u,%u}", 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);
+       filler = (filler_t *) AFS_VNODE_TO_I(vnode)->i_mapping->a_ops->readpage;
+
+       page = read_cache_page(AFS_VNODE_TO_I(vnode)->i_mapping, 0,
+                              filler, NULL);
        if (IS_ERR(page)) {
                ret = PTR_ERR(page);
                goto out;
@@ -78,7 +82,7 @@ int afs_mntpt_check_symlink(struct afs_vnode *vnode)
 
        ret = -EIO;
        wait_on_page_locked(page);
-       buf = kmap_atomic(page, KM_USER0);
+       buf = kmap(page);
        if (!PageUptodate(page))
                goto out_free;
        if (PageError(page))
@@ -101,7 +105,7 @@ int afs_mntpt_check_symlink(struct afs_vnode *vnode)
        ret = 0;
 
  out_free:
-       kunmap_atomic(buf, KM_USER0);
+       kunmap(page);
        page_cache_release(page);
  out:
        _leave(" = %d", ret);
@@ -156,6 +160,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
        struct page *page = NULL;
        size_t size;
        char *buf, *devname = NULL, *options = NULL;
+       filler_t *filler;
        int ret;
 
        kenter("{%s}", mntpt->d_name.name);
@@ -177,7 +182,9 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
                goto error;
 
        /* read the contents of the AFS special symlink */
-       page = read_mapping_page(mntpt->d_inode->i_mapping, 0, NULL);
+       filler = (filler_t *)mntpt->d_inode->i_mapping->a_ops->readpage;
+
+       page = read_cache_page(mntpt->d_inode->i_mapping, 0, filler, NULL);
        if (IS_ERR(page)) {
                ret = PTR_ERR(page);
                goto error;
@@ -188,9 +195,9 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
        if (!PageUptodate(page) || PageError(page))
                goto error;
 
-       buf = kmap_atomic(page, KM_USER0);
+       buf = kmap(page);
        memcpy(devname, buf, size);
-       kunmap_atomic(buf, KM_USER0);
+       kunmap(page);
        page_cache_release(page);
        page = NULL;
 
@@ -203,7 +210,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
 
        /* try and do the mount */
        kdebug("--- attempting mount %s -o %s ---", devname, options);
-       mnt = vfs_kern_mount(&afs_fs_type, 0, devname, options);
+       mnt = do_kern_mount("afs", 0, devname, options);
        kdebug("--- mount result %p ---", mnt);
 
        free_page((unsigned long) devname);
@@ -269,12 +276,12 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
  */
 static void afs_mntpt_expiry_timed_out(struct afs_timer *timer)
 {
-//     kenter("");
+       kenter("");
 
        mark_mounts_for_expiry(&afs_vfsmounts);
 
        afs_kafstimod_add_timer(&afs_mntpt_expiry_timer,
                                afs_mntpt_expiry_timeout * HZ);
 
-//     kleave("");
+       kleave("");
 } /* end afs_mntpt_expiry_timed_out() */