NFS: Remove BKL from the symlink code
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>
This commit is contained in:
Родитель
52e2e8d37e
Коммит
76566991f9
|
@ -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_mode = S_IFLNK | S_IRWXUGO;
|
||||||
attr.ia_valid = ATTR_MODE;
|
attr.ia_valid = ATTR_MODE;
|
||||||
|
|
||||||
lock_kernel();
|
|
||||||
|
|
||||||
page = alloc_page(GFP_HIGHUSER);
|
page = alloc_page(GFP_HIGHUSER);
|
||||||
if (!page) {
|
if (!page)
|
||||||
unlock_kernel();
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
kaddr = kmap_atomic(page, KM_USER0);
|
kaddr = kmap_atomic(page, KM_USER0);
|
||||||
memcpy(kaddr, symname, pathlen);
|
memcpy(kaddr, symname, pathlen);
|
||||||
|
@ -1503,7 +1499,6 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
|
||||||
dentry->d_name.name, symname, error);
|
dentry->d_name.name, symname, error);
|
||||||
d_drop(dentry);
|
d_drop(dentry);
|
||||||
__free_page(page);
|
__free_page(page);
|
||||||
unlock_kernel();
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1521,7 +1516,6 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
|
||||||
} else
|
} else
|
||||||
__free_page(page);
|
__free_page(page);
|
||||||
|
|
||||||
unlock_kernel();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче