diff options
| author | Yan, Zheng <zyan@redhat.com> | 2014-11-13 01:40:37 -0500 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@redhat.com> | 2014-12-17 12:09:52 -0500 |
| commit | 715e4cd405cfd67bd058e410b3e599bab2072645 (patch) | |
| tree | 20b4b1bf1fe86e7719f82c4804228e887592d832 /fs/ceph/file.c | |
| parent | 864e9197f10c77053bbaf12932f5b200bb4ed3c5 (diff) | |
libceph: specify position of extent operation
allow specifying position of extent operation in multi-operations
osd request. This is required for cephfs to convert inline data to
normal data (compare xattr, then write object).
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Diffstat (limited to 'fs/ceph/file.c')
| -rw-r--r-- | fs/ceph/file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index d7e0da8366e6..c03ac4c4bcd1 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
| @@ -598,7 +598,7 @@ ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos) | |||
| 598 | snapc = ci->i_snap_realm->cached_context; | 598 | snapc = ci->i_snap_realm->cached_context; |
| 599 | vino = ceph_vino(inode); | 599 | vino = ceph_vino(inode); |
| 600 | req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, | 600 | req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, |
| 601 | vino, pos, &len, | 601 | vino, pos, &len, 0, |
| 602 | 2,/*include a 'startsync' command*/ | 602 | 2,/*include a 'startsync' command*/ |
| 603 | CEPH_OSD_OP_WRITE, flags, snapc, | 603 | CEPH_OSD_OP_WRITE, flags, snapc, |
| 604 | ci->i_truncate_seq, | 604 | ci->i_truncate_seq, |
| @@ -609,6 +609,8 @@ ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos) | |||
| 609 | break; | 609 | break; |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC); | ||
| 613 | |||
| 612 | n = iov_iter_get_pages_alloc(from, &pages, len, &start); | 614 | n = iov_iter_get_pages_alloc(from, &pages, len, &start); |
| 613 | if (unlikely(n < 0)) { | 615 | if (unlikely(n < 0)) { |
| 614 | ret = n; | 616 | ret = n; |
| @@ -713,7 +715,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos) | |||
| 713 | snapc = ci->i_snap_realm->cached_context; | 715 | snapc = ci->i_snap_realm->cached_context; |
| 714 | vino = ceph_vino(inode); | 716 | vino = ceph_vino(inode); |
| 715 | req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, | 717 | req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, |
| 716 | vino, pos, &len, 1, | 718 | vino, pos, &len, 0, 1, |
| 717 | CEPH_OSD_OP_WRITE, flags, snapc, | 719 | CEPH_OSD_OP_WRITE, flags, snapc, |
| 718 | ci->i_truncate_seq, | 720 | ci->i_truncate_seq, |
| 719 | ci->i_truncate_size, | 721 | ci->i_truncate_size, |
| @@ -1111,7 +1113,7 @@ static int ceph_zero_partial_object(struct inode *inode, | |||
| 1111 | req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, | 1113 | req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, |
| 1112 | ceph_vino(inode), | 1114 | ceph_vino(inode), |
| 1113 | offset, length, | 1115 | offset, length, |
| 1114 | 1, op, | 1116 | 0, 1, op, |
| 1115 | CEPH_OSD_FLAG_WRITE | | 1117 | CEPH_OSD_FLAG_WRITE | |
| 1116 | CEPH_OSD_FLAG_ONDISK, | 1118 | CEPH_OSD_FLAG_ONDISK, |
| 1117 | NULL, 0, 0, false); | 1119 | NULL, 0, 0, false); |
