diff options
author | majianpeng <majianpeng@gmail.com> | 2013-08-08 03:32:19 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-09 20:55:43 -0400 |
commit | 0e5dd45ce4c41d3e3857116a77f34f04c99e78ad (patch) | |
tree | 5c55028ec8312394bcffddc19652eae3cd16ba77 /fs/ceph | |
parent | a158073c43b3aa26407b4c7987c909d21a12b5e5 (diff) |
ceph: Move the place for EOLDSNAPC handle in ceph_aio_write to easily understand
Only for ceph_sync_write, the osd can return EOLDSNAPC.so move the
related codes after the call ceph_sync_write.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 63ec830b9306..7478d5dbd1aa 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -766,6 +766,15 @@ retry_snap: | |||
766 | mutex_unlock(&inode->i_mutex); | 766 | mutex_unlock(&inode->i_mutex); |
767 | written = ceph_sync_write(file, iov->iov_base, count, | 767 | written = ceph_sync_write(file, iov->iov_base, count, |
768 | pos, &iocb->ki_pos); | 768 | pos, &iocb->ki_pos); |
769 | if (written == -EOLDSNAPC) { | ||
770 | dout("aio_write %p %llx.%llx %llu~%u" | ||
771 | "got EOLDSNAPC, retrying\n", | ||
772 | inode, ceph_vinop(inode), | ||
773 | pos, (unsigned)iov->iov_len); | ||
774 | mutex_lock(&inode->i_mutex); | ||
775 | hold_mutex = true; | ||
776 | goto retry_snap; | ||
777 | } | ||
769 | } else { | 778 | } else { |
770 | written = generic_file_buffered_write(iocb, iov, nr_segs, | 779 | written = generic_file_buffered_write(iocb, iov, nr_segs, |
771 | pos, &iocb->ki_pos, | 780 | pos, &iocb->ki_pos, |
@@ -796,13 +805,6 @@ retry_snap: | |||
796 | written = err; | 805 | written = err; |
797 | } | 806 | } |
798 | 807 | ||
799 | if (written == -EOLDSNAPC) { | ||
800 | dout("aio_write %p %llx.%llx %llu~%u got EOLDSNAPC, retrying\n", | ||
801 | inode, ceph_vinop(inode), pos, (unsigned)iov->iov_len); | ||
802 | mutex_lock(&inode->i_mutex); | ||
803 | hold_mutex = true; | ||
804 | goto retry_snap; | ||
805 | } | ||
806 | out: | 808 | out: |
807 | if (hold_mutex) | 809 | if (hold_mutex) |
808 | mutex_unlock(&inode->i_mutex); | 810 | mutex_unlock(&inode->i_mutex); |