]> err.no Git - linux-2.6/blobdiff - fs/nfs/dir.c
proc: fix /proc/*/pagemap some more
[linux-2.6] / fs / nfs / dir.c
index 60da7550133c58a491baa83ad0aba7c8247dd523..28a238dab23a2a16919ef58706a431447bcc8f5b 100644 (file)
@@ -534,8 +534,6 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                        (long long)filp->f_pos);
        nfs_inc_stats(inode, NFSIOS_VFSGETDENTS);
 
-       lock_kernel();
-
        /*
         * filp->f_pos points to the dirent entry number.
         * *desc->dir_cookie has the cookie for the next entry. We have
@@ -593,7 +591,6 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
        }
 out:
        nfs_unblock_sillyrename(dentry);
-       unlock_kernel();
        if (res > 0)
                res = 0;
        dfprintk(FILE, "NFS: readdir(%s/%s) returns %ld\n",
@@ -884,10 +881,8 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
                NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA;
 
        if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
-               lock_kernel();
                drop_nlink(inode);
                nfs_complete_unlink(dentry, inode);
-               unlock_kernel();
        }
        iput(inode);
 }
@@ -1297,14 +1292,12 @@ static int nfs_rmdir(struct inode *dir, struct dentry *dentry)
        dfprintk(VFS, "NFS: rmdir(%s/%ld), %s\n",
                        dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
 
-       lock_kernel();
        error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name);
        /* Ensure the VFS deletes this inode */
        if (error == 0 && dentry->d_inode != NULL)
                clear_nlink(dentry->d_inode);
        else if (error == -ENOENT)
                nfs_dentry_handle_enoent(dentry);
-       unlock_kernel();
 
        return error;
 }
@@ -1429,7 +1422,6 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry)
        dfprintk(VFS, "NFS: unlink(%s/%ld, %s)\n", dir->i_sb->s_id,
                dir->i_ino, dentry->d_name.name);
 
-       lock_kernel();
        spin_lock(&dcache_lock);
        spin_lock(&dentry->d_lock);
        if (atomic_read(&dentry->d_count) > 1) {
@@ -1438,7 +1430,6 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry)
                /* Start asynchronous writeout of the inode */
                write_inode_now(dentry->d_inode, 0);
                error = nfs_sillyrename(dir, dentry);
-               unlock_kernel();
                return error;
        }
        if (!d_unhashed(dentry)) {
@@ -1452,7 +1443,6 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry)
                nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
        } else if (need_rehash)
                d_rehash(dentry);
-       unlock_kernel();
        return error;
 }
 
@@ -1489,13 +1479,9 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
        attr.ia_mode = S_IFLNK | S_IRWXUGO;
        attr.ia_valid = ATTR_MODE;
 
-       lock_kernel();
-
        page = alloc_page(GFP_HIGHUSER);
-       if (!page) {
-               unlock_kernel();
+       if (!page)
                return -ENOMEM;
-       }
 
        kaddr = kmap_atomic(page, KM_USER0);
        memcpy(kaddr, symname, pathlen);
@@ -1510,7 +1496,6 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
                        dentry->d_name.name, symname, error);
                d_drop(dentry);
                __free_page(page);
-               unlock_kernel();
                return error;
        }
 
@@ -1528,7 +1513,6 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
        } else
                __free_page(page);
 
-       unlock_kernel();
        return 0;
 }
 
@@ -1587,7 +1571,6 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
         * To prevent any new references to the target during the rename,
         * we unhash the dentry and free the inode in advance.
         */
-       lock_kernel();
        if (!d_unhashed(new_dentry)) {
                d_drop(new_dentry);
                rehash = new_dentry;
@@ -1665,7 +1648,6 @@ out:
        /* new dentry created? */
        if (dentry)
                dput(dentry);
-       unlock_kernel();
        return error;
 }