mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
07ade5e488
The problem we have is this: - we want the client smbd processes to be able to 'shortcut' access to the ltdb, by directly accessing the ltdb, and if the header of the record shows we are the dmaster then process immediately, with no overhead of talking across the unix domain socket - a client doing a shortcut will use tdb_chainlock() to lock the record while processing - we want the main ctdb daemon to be able to set locks on the record, and when those locks collide with a 'shortcut' fcntl lock, we want the ctdb daemon to keep processing other operations - we don't want to have to send a message from a smbd client to the ctdbd each time it releases a lock The solution is shown in this example. Note that the expensive fork() and blocking lock is only paid in case of contention, so in the median case I think this is zero cost. (This used to be ctdb commit a3248c3e2b740cd2403acffd3c1f6a33dca0ea03)
100 lines
2.9 KiB
Makefile
100 lines
2.9 KiB
Makefile
#!gmake
|
|
#
|
|
CC = @CC@
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
datarootdir = @datarootdir@
|
|
includedir = @includedir@
|
|
libdir = @libdir@
|
|
bindir = @bindir@
|
|
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@
|
|
srcdir = @srcdir@
|
|
builddir = @builddir@
|
|
EXTRA_OBJ=@EXTRA_OBJ@
|
|
|
|
CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib/util -I$(srcdir) \
|
|
-I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
|
|
-DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"@SHLIBEXT@\" -DUSE_MMAP=1 @CFLAGS@
|
|
|
|
LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ -lpopt @INFINIBAND_LIBS@
|
|
|
|
EVENTS_OBJ = lib/events/events.o lib/events/events_standard.o
|
|
|
|
CTDB_COMMON_OBJ = common/ctdb.o common/ctdb_daemon.o common/ctdb_client.o common/ctdb_io.o common/util.o common/ctdb_util.o \
|
|
common/ctdb_call.o common/ctdb_ltdb.o common/ctdb_message.o \
|
|
lib/util/idtree.o lib/util/db_wrap.o
|
|
|
|
CTDB_TCP_OBJ = tcp/tcp_connect.o tcp/tcp_io.o tcp/tcp_init.o
|
|
|
|
CTDB_OBJ = $(CTDB_COMMON_OBJ) $(CTDB_TCP_OBJ)
|
|
|
|
OBJS = @TDBOBJ@ @TALLOCOBJ@ @LIBREPLACEOBJ@ @INFINIBAND_WRAPPER_OBJ@ $(EXTRA_OBJ) $(EVENTS_OBJ) $(CTDB_OBJ)
|
|
|
|
BINS = bin/ctdbd bin/ctdbd_test bin/ctdb_test bin/ctdb_bench bin/ctdb_messaging bin/ctdb_fetch bin/ctdb_fetch1 bin/lockwait @INFINIBAND_BINS@
|
|
|
|
DIRS = lib bin
|
|
|
|
all: showflags dirs $(OBJS) $(BINS)
|
|
|
|
showflags:
|
|
@echo 'ctdb will be compiled with flags:'
|
|
@echo ' CFLAGS = $(CFLAGS)'
|
|
@echo ' LIBS = $(LIBS)'
|
|
|
|
.c.o:
|
|
@echo Compiling $*.c
|
|
@mkdir -p `dirname $@`
|
|
@$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
dirs:
|
|
@mkdir -p $(DIRS)
|
|
|
|
bin/ctdb_test: $(OBJS) tests/ctdb_test.o tests/cmdline.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ tests/ctdb_test.o tests/cmdline.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/ctdbd: $(OBJS) direct/ctdbd.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ direct/ctdbd.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/ctdbd_test: $(OBJS) direct/ctdbd_test.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ direct/ctdbd_test.o
|
|
|
|
bin/ctdb_bench: $(OBJS) tests/ctdb_bench.o tests/cmdline.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ tests/ctdb_bench.o tests/cmdline.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/ctdb_fetch: $(OBJS) tests/ctdb_fetch.o tests/cmdline.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ tests/ctdb_fetch.o tests/cmdline.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/ctdb_fetch1: $(OBJS) tests/ctdb_fetch1.o tests/cmdline.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ tests/ctdb_fetch1.o tests/cmdline.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/ctdb_messaging: $(OBJS) tests/ctdb_messaging.o tests/cmdline.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ tests/ctdb_messaging.o tests/cmdline.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/ibwrapper_test: $(OBJS) ib/ibwrapper_test.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ ib/ibwrapper_test.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
bin/lockwait: $(OBJS) tests/lockwait.o tests/cmdline.o
|
|
@echo Linking $@
|
|
@$(CC) $(CFLAGS) -o $@ tests/lockwait.o tests/cmdline.o $(OBJS) $(LIB_FLAGS)
|
|
|
|
clean:
|
|
rm -f *.o */*.o */*/*.o
|
|
rm -f $(BINS)
|
|
|
|
distclean: clean
|
|
rm -f *~ */*~
|
|
rm -rf bin
|
|
rm -f config.log config.status config.cache config.h
|
|
rm -f Makefile
|
|
|
|
realdistclean: distclean
|
|
rm -f configure config.h.in
|