Skip to content

Commit 3fb99d4

Browse files
gmayyyhaidryomov
authored andcommitted
ceph: nuke startsync op
startsync is a no-op, has been for years. Remove it. Link: http://tracker.ceph.com/issues/20604 Signed-off-by: Yanhu Cao <[email protected]> Reviewed-by: "Yan, Zheng" <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 37f1325 commit 3fb99d4

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

fs/ceph/addr.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -752,21 +752,11 @@ static int ceph_writepages_start(struct address_space *mapping,
752752
int rc = 0;
753753
unsigned int wsize = i_blocksize(inode);
754754
struct ceph_osd_request *req = NULL;
755-
int do_sync = 0;
756755
loff_t snap_size, i_size;
757756
u64 truncate_size;
758757
u32 truncate_seq;
759758

760-
/*
761-
* Include a 'sync' in the OSD request if this is a data
762-
* integrity write (e.g., O_SYNC write or fsync()), or if our
763-
* cap is being revoked.
764-
*/
765-
if ((wbc->sync_mode == WB_SYNC_ALL) ||
766-
ceph_caps_revoking(ci, CEPH_CAP_FILE_BUFFER))
767-
do_sync = 1;
768-
dout("writepages_start %p dosync=%d (mode=%s)\n",
769-
inode, do_sync,
759+
dout("writepages_start %p (mode=%s)\n", inode,
770760
wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
771761
(wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD"));
772762

@@ -936,7 +926,7 @@ static int ceph_writepages_start(struct address_space *mapping,
936926
break;
937927
}
938928

939-
num_ops = 1 + do_sync;
929+
num_ops = 1;
940930
strip_unit_end = page->index +
941931
((len - 1) >> PAGE_SHIFT);
942932

@@ -1042,7 +1032,7 @@ static int ceph_writepages_start(struct address_space *mapping,
10421032
for (i = 0; i < locked_pages; i++) {
10431033
u64 cur_offset = page_offset(pages[i]);
10441034
if (offset + len != cur_offset) {
1045-
if (op_idx + do_sync + 1 == req->r_num_ops)
1035+
if (op_idx + 1 == req->r_num_ops)
10461036
break;
10471037
osd_req_op_extent_dup_last(req, op_idx,
10481038
cur_offset - offset);
@@ -1079,17 +1069,12 @@ static int ceph_writepages_start(struct address_space *mapping,
10791069
0, !!pool, false);
10801070
osd_req_op_extent_update(req, op_idx, len);
10811071

1082-
if (do_sync) {
1083-
op_idx++;
1084-
osd_req_op_init(req, op_idx, CEPH_OSD_OP_STARTSYNC, 0);
1085-
}
10861072
BUG_ON(op_idx + 1 != req->r_num_ops);
10871073

10881074
pool = NULL;
10891075
if (i < locked_pages) {
10901076
BUG_ON(num_ops <= req->r_num_ops);
10911077
num_ops -= req->r_num_ops;
1092-
num_ops += do_sync;
10931078
locked_pages -= i;
10941079

10951080
/* allocate new pages array for next request */

fs/ceph/file.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ static void ceph_aio_retry_work(struct work_struct *work)
800800
}
801801

802802
req->r_ops[0] = orig_req->r_ops[0];
803-
osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC, 0);
804803

805804
req->r_mtime = aio_req->mtime;
806805
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,
874873
vino = ceph_vino(inode);
875874
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
876875
vino, pos, &size, 0,
877-
/*include a 'startsync' command*/
878-
write ? 2 : 1,
876+
1,
879877
write ? CEPH_OSD_OP_WRITE :
880878
CEPH_OSD_OP_READ,
881879
flags, snapc,
@@ -927,7 +925,6 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
927925
truncate_inode_pages_range(inode->i_mapping, pos,
928926
(pos+len) | (PAGE_SIZE - 1));
929927

930-
osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC, 0);
931928
req->r_mtime = mtime;
932929
}
933930

include/linux/ceph/rados.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ extern const char *ceph_osd_state_name(int s);
230230
\
231231
/* fancy write */ \
232232
f(APPEND, __CEPH_OSD_OP(WR, DATA, 6), "append") \
233-
f(STARTSYNC, __CEPH_OSD_OP(WR, DATA, 7), "startsync") \
234233
f(SETTRUNC, __CEPH_OSD_OP(WR, DATA, 8), "settrunc") \
235234
f(TRIMTRUNC, __CEPH_OSD_OP(WR, DATA, 9), "trimtrunc") \
236235
\

net/ceph/osd_client.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst,
863863
dst->cls.method_len = src->cls.method_len;
864864
dst->cls.indata_len = cpu_to_le32(src->cls.indata_len);
865865
break;
866-
case CEPH_OSD_OP_STARTSYNC:
867-
break;
868866
case CEPH_OSD_OP_WATCH:
869867
dst->watch.cookie = cpu_to_le64(src->watch.cookie);
870868
dst->watch.ver = cpu_to_le64(0);
@@ -916,9 +914,6 @@ static u32 osd_req_encode_op(struct ceph_osd_op *dst,
916914
* if the file was recently truncated, we include information about its
917915
* old and new size so that the object can be updated appropriately. (we
918916
* avoid synchronously deleting truncated objects because it's slow.)
919-
*
920-
* if @do_sync, include a 'startsync' command so that the osd will flush
921-
* data quickly.
922917
*/
923918
struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
924919
struct ceph_file_layout *layout,

0 commit comments

Comments
 (0)