diff --git a/acinclude.m4 b/acinclude.m4 index 0a90e162e7..cacec2e1be 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -111,6 +111,11 @@ AC_ARG_ENABLE([pthreaded-ubik], enabled)])], [], [enable_pthreaded_ubik="yes"]) +AC_ARG_ENABLE([ubik-read-while-write], + [AS_HELP_STRING([--enable-ubik-read-while-write], + [enable vlserver read from db cache during write locks (EXPERIMENTAL)])], + [], + [enable_ubik_read_while_write="no"]) dnl Kernel module build options. AC_ARG_WITH([linux-kernel-headers], @@ -1409,6 +1414,10 @@ else fi AC_SUBST(USE_UNIX_SOCKETS) +if test "$enable_ubik_read_while_write" = "yes"; then + AC_DEFINE(UBIK_READ_WHILE_WRITE, 1, [define if you want to enable ubik read while write]) +fi + if test "$enable_namei_fileserver" = "yes"; then AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver]) VFSCK="" diff --git a/src/cf/summary.m4 b/src/cf/summary.m4 index 111b22ceae..0ac9fc0287 100644 --- a/src/cf/summary.m4 +++ b/src/cf/summary.m4 @@ -69,6 +69,7 @@ options: ptserver supergroups : ${enable_supergroups} pthreaded ubik : ${enable_pthreaded_ubik} install kauth : ${INSTALL_KAUTH} + ubik read while write : ${enable_ubik_read_while_write} build: scout/afsmonitor : ${summary_build_scout} pam : ${HAVE_PAM} diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index 78f9ba6b1b..016ff513f7 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -206,8 +206,11 @@ Init_VLdbase(struct vl_ctx *ctx, code = ubik_BeginTrans(VL_dbase, UBIK_WRITETRANS, &ctx->trans); wl = 1; } else if (locktype == LOCKREAD) { - code = - ubik_BeginTransReadAnyWrite(VL_dbase, UBIK_READTRANS, &ctx->trans); +#ifdef UBIK_READ_WHILE_WRITE + code = ubik_BeginTransReadAnyWrite(VL_dbase, UBIK_READTRANS, &ctx->trans); +#else + code = ubik_BeginTransReadAny(VL_dbase, UBIK_READTRANS, &ctx->trans); +#endif wl = 0; } else { code = ubik_BeginTrans(VL_dbase, UBIK_WRITETRANS, &ctx->trans);