Skip to content

Commit aec605f

Browse files
author
Al Viro
committed
ceph_aio_write(): switch to generic_perform_write()
Signed-off-by: Al Viro <[email protected]>
1 parent 0a64bc2 commit aec605f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/ceph/file.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,15 +970,18 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
970970
goto retry_snap;
971971
}
972972
} else {
973+
struct iov_iter from;
973974
/*
974975
* No need to acquire the i_truncate_mutex. Because
975976
* the MDS revokes Fwb caps before sending truncate
976977
* message to us. We can't get Fwb cap while there
977978
* are pending vmtruncate. So write and vmtruncate
978979
* can not run at the same time
979980
*/
980-
written = generic_file_buffered_write(iocb, iov, nr_segs,
981-
pos, count, 0);
981+
iov_iter_init(&from, iov, nr_segs, count, 0);
982+
written = generic_perform_write(file, &from, pos);
983+
if (likely(written >= 0))
984+
iocb->ki_pos = pos + written;
982985
mutex_unlock(&inode->i_mutex);
983986
}
984987

0 commit comments

Comments
 (0)