When using WNBD, the IO size must be a multiple of the sector size
(WNBD only supports 512 at the moment).
We're currently checking the "wnbd_operations" variable, however
it's only defined on Windows, leading to a compilation failure
on other platforms.
We'll switch back to a separate boolean variable called "wnbd_disk".
Fixes: https://tracker.ceph.com/issues/62475
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
int badoff = -1;
int closeopen = 0;
+bool wnbd_disk = false;
+
void
vwarnc(int code, const char *fmt, va_list ap) {
fprintf(stderr, "fsx: ");
int ret;
offset -= offset % readbdy;
- if (o_direct || ops == &wnbd_operations)
+ if (o_direct || wnbd_disk)
size -= size % readbdy;
if (size == 0) {
if (!quiet && testcalls > simulatedopcount && !o_direct)
off_t newsize;
offset -= offset % writebdy;
- if (o_direct || ops == &wnbd_operations)
+ if (o_direct || wnbd_disk)
size -= size % writebdy;
if (size == 0) {
if (!quiet && testcalls > simulatedopcount && !o_direct)
case 'M':
prt("rbd-wnbd mode enabled\n");
ops = &wnbd_operations;
+ wnbd_disk = true;
break;
#endif
case 'L':