ceph_aio_write(): switch to generic_perform_write()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 12 Feb 2014 03:28:43 +0000 (22:28 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 2 Apr 2014 03:19:37 +0000 (23:19 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ceph/file.c

index a798db5e5e39f65cc88a31f0dc51afdb6b5f70b0..2d9088b1bcd90924125176ea8d1d890ce4858248 100644 (file)
@@ -970,6 +970,7 @@ retry_snap:
                        goto retry_snap;
                }
        } else {
+               struct iov_iter from;
                /*
                 * No need to acquire the i_truncate_mutex. Because
                 * the MDS revokes Fwb caps before sending truncate
@@ -977,8 +978,10 @@ retry_snap:
                 * are pending vmtruncate. So write and vmtruncate
                 * can not run at the same time
                 */
-               written = generic_file_buffered_write(iocb, iov, nr_segs,
-                                                     pos, count, 0);
+               iov_iter_init(&from, iov, nr_segs, count, 0);
+               written = generic_perform_write(file, &from, pos);
+               if (likely(written >= 0))
+                       iocb->ki_pos = pos + written;
                mutex_unlock(&inode->i_mutex);
        }