Commit 3fb99d48 authored by Yanhu Cao's avatar Yanhu Cao Committed by Ilya Dryomov

ceph: nuke startsync op

startsync is a no-op, has been for years.  Remove it.

Link: http://tracker.ceph.com/issues/20604Signed-off-by: default avatarYanhu Cao <gmayyyha@gmail.com>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 37f13252
...@@ -752,21 +752,11 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -752,21 +752,11 @@ static int ceph_writepages_start(struct address_space *mapping,
int rc = 0; int rc = 0;
unsigned int wsize = i_blocksize(inode); unsigned int wsize = i_blocksize(inode);
struct ceph_osd_request *req = NULL; struct ceph_osd_request *req = NULL;
int do_sync = 0;
loff_t snap_size, i_size; loff_t snap_size, i_size;
u64 truncate_size; u64 truncate_size;
u32 truncate_seq; u32 truncate_seq;
/* dout("writepages_start %p (mode=%s)\n", inode,
* Include a 'sync' in the OSD request if this is a data
* integrity write (e.g., O_SYNC write or fsync()), or if our
* cap is being revoked.
*/
if ((wbc->sync_mode == WB_SYNC_ALL) ||
ceph_caps_revoking(ci, CEPH_CAP_FILE_BUFFER))
do_sync = 1;
dout("writepages_start %p dosync=%d (mode=%s)\n",
inode, do_sync,
wbc->sync_mode == WB_SYNC_NONE ? "NONE" : wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
(wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD")); (wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD"));
...@@ -936,7 +926,7 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -936,7 +926,7 @@ static int ceph_writepages_start(struct address_space *mapping,
break; break;
} }
num_ops = 1 + do_sync; num_ops = 1;
strip_unit_end = page->index + strip_unit_end = page->index +
((len - 1) >> PAGE_SHIFT); ((len - 1) >> PAGE_SHIFT);
...@@ -1042,7 +1032,7 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -1042,7 +1032,7 @@ static int ceph_writepages_start(struct address_space *mapping,
for (i = 0; i < locked_pages; i++) { for (i = 0; i < locked_pages; i++) {
u64 cur_offset = page_offset(pages[i]); u64 cur_offset = page_offset(pages[i]);
if (offset + len != cur_offset) { if (offset + len != cur_offset) {
if (op_idx + do_sync + 1 == req->r_num_ops) if (op_idx + 1 == req->r_num_ops)
break; break;
osd_req_op_extent_dup_last(req, op_idx, osd_req_op_extent_dup_last(req, op_idx,
cur_offset - offset); cur_offset - offset);
...@@ -1079,17 +1069,12 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -1079,17 +1069,12 @@ static int ceph_writepages_start(struct address_space *mapping,
0, !!pool, false); 0, !!pool, false);
osd_req_op_extent_update(req, op_idx, len); osd_req_op_extent_update(req, op_idx, len);
if (do_sync) {
op_idx++;
osd_req_op_init(req, op_idx, CEPH_OSD_OP_STARTSYNC, 0);
}
BUG_ON(op_idx + 1 != req->r_num_ops); BUG_ON(op_idx + 1 != req->r_num_ops);
pool = NULL; pool = NULL;
if (i < locked_pages) { if (i < locked_pages) {
BUG_ON(num_ops <= req->r_num_ops); BUG_ON(num_ops <= req->r_num_ops);
num_ops -= req->r_num_ops; num_ops -= req->r_num_ops;
num_ops += do_sync;
locked_pages -= i; locked_pages -= i;
/* allocate new pages array for next request */ /* allocate new pages array for next request */
......
...@@ -800,7 +800,6 @@ static void ceph_aio_retry_work(struct work_struct *work) ...@@ -800,7 +800,6 @@ static void ceph_aio_retry_work(struct work_struct *work)
} }
req->r_ops[0] = orig_req->r_ops[0]; req->r_ops[0] = orig_req->r_ops[0];
osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC, 0);
req->r_mtime = aio_req->mtime; req->r_mtime = aio_req->mtime;
req->r_data_offset = req->r_ops[0].extent.offset; req->r_data_offset = req->r_ops[0].extent.offset;
...@@ -874,8 +873,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, ...@@ -874,8 +873,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
vino = ceph_vino(inode); vino = ceph_vino(inode);
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
vino, pos, &size, 0, vino, pos, &size, 0,
/*include a 'startsync' command*/ 1,
write ? 2 : 1,
write ? CEPH_OSD_OP_WRITE : write ? CEPH_OSD_OP_WRITE :
CEPH_OSD_OP_READ, CEPH_OSD_OP_READ,
flags, snapc, flags, snapc,
...@@ -927,7 +925,6 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, ...@@ -927,7 +925,6 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
truncate_inode_pages_range(inode->i_mapping, pos, truncate_inode_pages_range(inode->i_mapping, pos,
(pos+len) | (PAGE_SIZE - 1)); (pos+len) | (PAGE_SIZE - 1));
osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC, 0);
req->r_mtime = mtime; req->r_mtime = mtime;
} }
......
...@@ -230,7 +230,6 @@ extern const char *ceph_osd_state_name(int s); ...@@ -230,7 +230,6 @@ extern const char *ceph_osd_state_name(int s);
\ \
/* fancy write */ \ /* fancy write */ \
f(APPEND, __CEPH_OSD_OP(WR, DATA, 6), "append") \ f(APPEND, __CEPH_OSD_OP(WR, DATA, 6), "append") \
f(STARTSYNC, __CEPH_OSD_OP(WR, DATA, 7), "startsync") \
f(SETTRUNC, __CEPH_OSD_OP(WR, DATA, 8), "settrunc") \ f(SETTRUNC, __CEPH_OSD_OP(WR, DATA, 8), "settrunc") \
f(TRIMTRUNC, __CEPH_OSD_OP(WR, DATA, 9), "trimtrunc") \ f(TRIMTRUNC, __CEPH_OSD_OP(WR, DATA, 9), "trimtrunc") \
\ \
......
...@@ -863,8 +863,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst, ...@@ -863,8 +863,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst,
dst->cls.method_len = src->cls.method_len; dst->cls.method_len = src->cls.method_len;
dst->cls.indata_len = cpu_to_le32(src->cls.indata_len); dst->cls.indata_len = cpu_to_le32(src->cls.indata_len);
break; break;
case CEPH_OSD_OP_STARTSYNC:
break;
case CEPH_OSD_OP_WATCH: case CEPH_OSD_OP_WATCH:
dst->watch.cookie = cpu_to_le64(src->watch.cookie); dst->watch.cookie = cpu_to_le64(src->watch.cookie);
dst->watch.ver = cpu_to_le64(0); dst->watch.ver = cpu_to_le64(0);
...@@ -916,9 +914,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst, ...@@ -916,9 +914,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst,
* if the file was recently truncated, we include information about its * if the file was recently truncated, we include information about its
* old and new size so that the object can be updated appropriately. (we * old and new size so that the object can be updated appropriately. (we
* avoid synchronously deleting truncated objects because it's slow.) * avoid synchronously deleting truncated objects because it's slow.)
*
* if @do_sync, include a 'startsync' command so that the osd will flush
* data quickly.
*/ */
struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
struct ceph_file_layout *layout, struct ceph_file_layout *layout,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment