@@ -42,7 +42,6 @@ mongoc_write_concern_new (void)
42
42
43
43
write_concern = BSON_ALIGNED_ALLOC0 (mongoc_write_concern_t );
44
44
write_concern -> w = MONGOC_WRITE_CONCERN_W_DEFAULT ;
45
- write_concern -> fsync_ = MONGOC_WRITE_CONCERN_FSYNC_DEFAULT ;
46
45
write_concern -> journal = MONGOC_WRITE_CONCERN_JOURNAL_DEFAULT ;
47
46
write_concern -> is_default = true;
48
47
@@ -59,7 +58,6 @@ mongoc_write_concern_copy (const mongoc_write_concern_t *write_concern)
59
58
60
59
if (write_concern ) {
61
60
ret = mongoc_write_concern_new ();
62
- ret -> fsync_ = write_concern -> fsync_ ;
63
61
ret -> journal = write_concern -> journal ;
64
62
ret -> w = write_concern -> w ;
65
63
ret -> wtimeout = write_concern -> wtimeout ;
@@ -89,33 +87,6 @@ mongoc_write_concern_destroy (mongoc_write_concern_t *write_concern)
89
87
}
90
88
91
89
92
- bool
93
- mongoc_write_concern_get_fsync (const mongoc_write_concern_t * write_concern )
94
- {
95
- BSON_ASSERT (write_concern );
96
- return (write_concern -> fsync_ == true);
97
- }
98
-
99
-
100
- /**
101
- * mongoc_write_concern_set_fsync:
102
- * @write_concern: A mongoc_write_concern_t.
103
- * @fsync_: If the write concern requires fsync() by the server.
104
- *
105
- * Set if fsync() should be called on the server before acknowledging a
106
- * write request.
107
- */
108
- void
109
- mongoc_write_concern_set_fsync (mongoc_write_concern_t * write_concern , bool fsync_ )
110
- {
111
- BSON_ASSERT (write_concern );
112
-
113
- write_concern -> fsync_ = !!fsync_ ;
114
- write_concern -> is_default = false;
115
- write_concern -> frozen = false;
116
- }
117
-
118
-
119
90
bool
120
91
mongoc_write_concern_get_journal (const mongoc_write_concern_t * write_concern )
121
92
{
@@ -347,10 +318,6 @@ _mongoc_write_concern_freeze (mongoc_write_concern_t *write_concern)
347
318
BSON_APPEND_INT32 (compiled , "w" , write_concern -> w );
348
319
}
349
320
350
- if (write_concern -> fsync_ != MONGOC_WRITE_CONCERN_FSYNC_DEFAULT ) {
351
- bson_append_bool (compiled , "fsync" , 5 , !!write_concern -> fsync_ );
352
- }
353
-
354
321
if (write_concern -> journal != MONGOC_WRITE_CONCERN_JOURNAL_DEFAULT ) {
355
322
bson_append_bool (compiled , "j" , 1 , !!write_concern -> journal );
356
323
}
374
341
mongoc_write_concern_is_acknowledged (const mongoc_write_concern_t * write_concern )
375
342
{
376
343
if (write_concern ) {
377
- return (((write_concern -> w != MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED )) || write_concern -> fsync_ == true ||
344
+ return (((write_concern -> w != MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED )) ||
378
345
mongoc_write_concern_get_journal (write_concern ));
379
346
}
380
347
return true;
@@ -397,8 +364,8 @@ mongoc_write_concern_is_valid (const mongoc_write_concern_t *write_concern)
397
364
return false;
398
365
}
399
366
400
- /* Journal or fsync should require acknowledgement. */
401
- if ((write_concern -> fsync_ == true || mongoc_write_concern_get_journal (write_concern )) &&
367
+ /* Journal should require acknowledgement. */
368
+ if ((mongoc_write_concern_get_journal (write_concern )) &&
402
369
(write_concern -> w == MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED )) {
403
370
return false;
404
371
}
@@ -527,12 +494,8 @@ _mongoc_write_concern_new_from_iter (const bson_iter_t *iter, bson_error_t *erro
527
494
goto fail ;
528
495
}
529
496
} else if (BSON_ITER_IS_KEY (& inner , "fsync" )) {
530
- if (!BSON_ITER_HOLDS_BOOL (& inner )) {
531
- goto fail ;
532
- }
533
- BEGIN_IGNORE_DEPRECATIONS
534
- mongoc_write_concern_set_fsync (write_concern , bson_iter_bool (& inner ));
535
- END_IGNORE_DEPRECATIONS
497
+ // fsync removed in C driver 2.0.
498
+ goto fail ;
536
499
} else if (BSON_ITER_IS_KEY (& inner , "j" )) {
537
500
if (!BSON_ITER_HOLDS_BOOL (& inner )) {
538
501
goto fail ;
0 commit comments