diff options
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index b497c71384e8..079228817603 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -678,15 +678,9 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t | |||
678 | if (!count) | 678 | if (!count) |
679 | goto out; | 679 | goto out; |
680 | 680 | ||
681 | if (mapping->nrpages) { | 681 | retval = nfs_sync_mapping(mapping); |
682 | retval = filemap_fdatawrite(mapping); | 682 | if (retval) |
683 | if (retval == 0) | 683 | goto out; |
684 | retval = nfs_wb_all(inode); | ||
685 | if (retval == 0) | ||
686 | retval = filemap_fdatawait(mapping); | ||
687 | if (retval) | ||
688 | goto out; | ||
689 | } | ||
690 | 684 | ||
691 | retval = nfs_direct_read(inode, ctx, &iov, pos, 1); | 685 | retval = nfs_direct_read(inode, ctx, &iov, pos, 1); |
692 | if (retval > 0) | 686 | if (retval > 0) |
@@ -764,15 +758,9 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, | |||
764 | if (!count) | 758 | if (!count) |
765 | goto out; | 759 | goto out; |
766 | 760 | ||
767 | if (mapping->nrpages) { | 761 | retval = nfs_sync_mapping(mapping); |
768 | retval = filemap_fdatawrite(mapping); | 762 | if (retval) |
769 | if (retval == 0) | 763 | goto out; |
770 | retval = nfs_wb_all(inode); | ||
771 | if (retval == 0) | ||
772 | retval = filemap_fdatawait(mapping); | ||
773 | if (retval) | ||
774 | goto out; | ||
775 | } | ||
776 | 764 | ||
777 | retval = nfs_direct_write(inode, ctx, &iov, pos, 1); | 765 | retval = nfs_direct_write(inode, ctx, &iov, pos, 1); |
778 | if (mapping->nrpages) | 766 | if (mapping->nrpages) |