]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nfs/dir.c
mm: remove lru parameter from __pagevec_lru_add and remove parts of pagevec API
[karo-tx-linux.git] / fs / nfs / dir.c
index 743d3b524fc5b7c255f706911da7a557b0997184..3cfd20852d844d7bae7aa9d6c150c3185566e05b 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/pagevec.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
+#include <linux/swap.h>
 #include <linux/sched.h>
 #include <linux/kmemleak.h>
 #include <linux/xattr.h>
@@ -1385,18 +1386,6 @@ static int nfs_finish_open(struct nfs_open_context *ctx,
 {
        int err;
 
-       if (ctx->dentry != dentry) {
-               dput(ctx->dentry);
-               ctx->dentry = dget(dentry);
-       }
-
-       /* If the open_intent is for execute, we have an extra check to make */
-       if (ctx->mode & FMODE_EXEC) {
-               err = nfs_may_open(dentry->d_inode, ctx->cred, open_flags);
-               if (err < 0)
-                       goto out;
-       }
-
        err = finish_open(file, dentry, do_open, opened);
        if (err)
                goto out;
@@ -1455,13 +1444,13 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
 
        nfs_block_sillyrename(dentry->d_parent);
        inode = NFS_PROTO(dir)->open_context(dir, ctx, open_flags, &attr);
-       d_drop(dentry);
+       nfs_unblock_sillyrename(dentry->d_parent);
        if (IS_ERR(inode)) {
-               nfs_unblock_sillyrename(dentry->d_parent);
                put_nfs_open_context(ctx);
                err = PTR_ERR(inode);
                switch (err) {
                case -ENOENT:
+                       d_drop(dentry);
                        d_add(dentry, NULL);
                        break;
                case -EISDIR:
@@ -1477,16 +1466,8 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
                }
                goto out;
        }
-       res = d_add_unique(dentry, inode);
-       if (res != NULL)
-               dentry = res;
-
-       nfs_unblock_sillyrename(dentry->d_parent);
-       nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
-
-       err = nfs_finish_open(ctx, dentry, file, open_flags, opened);
 
-       dput(res);
+       err = nfs_finish_open(ctx, ctx->dentry, file, open_flags, opened);
 out:
        return err;
 
@@ -1788,7 +1769,6 @@ EXPORT_SYMBOL_GPL(nfs_unlink);
  */
 int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
 {
-       struct pagevec lru_pvec;
        struct page *page;
        char *kaddr;
        struct iattr attr;
@@ -1828,11 +1808,8 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
         * No big deal if we can't add this page to the page cache here.
         * READLINK will get the missing page from the server if needed.
         */
-       pagevec_init(&lru_pvec, 0);
-       if (!add_to_page_cache(page, dentry->d_inode->i_mapping, 0,
+       if (!add_to_page_cache_lru(page, dentry->d_inode->i_mapping, 0,
                                                        GFP_KERNEL)) {
-               pagevec_add(&lru_pvec, page);
-               pagevec_lru_add_file(&lru_pvec);
                SetPageUptodate(page);
                unlock_page(page);
        } else