Skip to content

Commit

Permalink
NFS: Remove BKL from the symlink code
Browse files Browse the repository at this point in the history
Page cache accesses are serialised using page locks, whereas attribute
updates are serialised using inode->i_lock.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jul 15, 2008
1 parent 52e2e8d commit 7656699
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,13 +1482,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);
Expand All @@ -1503,7 +1499,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;
}

Expand All @@ -1521,7 +1516,6 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
} else
__free_page(page);

unlock_kernel();
return 0;
}

Expand Down

0 comments on commit 7656699

Please sign in to comment.