Add compiler flag to disable explicit msync() calls
This commit is contained in:
7
Makefile
7
Makefile
@@ -4,7 +4,7 @@ VPATH=src:tests/unit
|
||||
DESTDIR?=/
|
||||
PREFIX?=/usr/local/bin
|
||||
INSTALLDIR=$(DESTDIR)/$(PREFIX)
|
||||
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS_EXTRA=-g -DDEBUG
|
||||
LDFLAGS_EXTRA=-g
|
||||
@@ -12,6 +12,11 @@ else
|
||||
CFLAGS_EXTRA=-O2
|
||||
endif
|
||||
|
||||
NO_MSYNC=1
|
||||
ifdef NO_MSYNC
|
||||
CFLAGS_EXTRA += -DNO_MSYNC
|
||||
endif
|
||||
|
||||
CFLAGS_EXTRA += -fPIC --std=gnu99
|
||||
LDFLAGS_EXTRA += -Wl,--relax,--gc-sections -L$(LIB) -Wl,-rpath-link,$(LIB)
|
||||
|
||||
|
@@ -472,7 +472,7 @@ void client_reply_to_write( struct client* client, struct nbd_request request )
|
||||
bitset_set_range(client->serve->allocation_map, request.from, request.len);
|
||||
}
|
||||
|
||||
if (1) /* not sure whether this is necessary... */
|
||||
#ifndef NO_MSYNC
|
||||
{
|
||||
/* multiple of 4K page size */
|
||||
uint64_t from_rounded = request.from & (!0xfff);
|
||||
@@ -485,6 +485,7 @@ void client_reply_to_write( struct client* client, struct nbd_request request )
|
||||
"msync failed %ld %ld", request.from, request.len
|
||||
);
|
||||
}
|
||||
#endif
|
||||
client_write_reply( client, &request, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user