mirror of https://gitee.com/openkylin/linux.git
NFS: Remove redundant waits for O_DIRECT in fsync() and write_begin()
We're now waiting immediately after taking the locks, so waiting in fsync() and write_begin() is either redundant or potentially subject to livelock (if not holding the lock). Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
f7b5c340ac
commit
f508d46ae4
|
@ -276,7 +276,6 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
||||||
|
|
||||||
trace_nfs_fsync_enter(inode);
|
trace_nfs_fsync_enter(inode);
|
||||||
|
|
||||||
inode_dio_wait(inode);
|
|
||||||
do {
|
do {
|
||||||
ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
|
ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
@ -361,11 +360,6 @@ static int nfs_write_begin(struct file *file, struct address_space *mapping,
|
||||||
file, mapping->host->i_ino, len, (long long) pos);
|
file, mapping->host->i_ino, len, (long long) pos);
|
||||||
|
|
||||||
start:
|
start:
|
||||||
/*
|
|
||||||
* Wait for O_DIRECT to complete
|
|
||||||
*/
|
|
||||||
inode_dio_wait(mapping->host);
|
|
||||||
|
|
||||||
page = grab_cache_page_write_begin(mapping, index, flags);
|
page = grab_cache_page_write_begin(mapping, index, flags);
|
||||||
if (!page)
|
if (!page)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in New Issue