From cac74242728ad97e3ce9cef0a949d58c237250f6 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 10 Jul 2011 13:46:11 +0100 Subject: [PATCH] Clean up assertion The AFS code has multiple different assertion implementations in userspace. This patchset is the start of bringing some sanity to them. In rx, we have osi_Assert, a user/kernel assertion macro. This is only available to libraries which have RX dependencies In util, we redefine the standard 'assert()' macro to provide a cross-platform assertion solution. Because util has an RX dependency, neither of these provide an assertion solution for libraries which should be independent of rx. So, pull the assertion code out of util, and put it into opr, as a new opr_Assert() macro. Implement the userspace osi_Assert in terms of this macro, leaving the kernel variant untouched. Update callers to the new macro and header file names. Change-Id: I780b30ec1ea1207daa17127df4d5fbf9a94481b6 Reviewed-on: http://gerrit.openafs.org/5394 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/WINNT/afsd/fs.c | 3 ++- src/WINNT/afsd/fs_acl.c | 3 ++- src/WINNT/afsd/fs_utils.c | 2 ++ src/afs/UKERNEL/sysincludes.h | 4 ---- src/afsd/afsd.c | 3 ++- src/bu_utils/Makefile.in | 3 ++- src/butc/Makefile.in | 3 ++- src/butc/tcmain.c | 1 - src/butc/tcprocs.c | 3 +-- src/butc/tcudbprocs.c | 3 +-- src/dviced/Makefile.in | 5 +---- src/dvolser/Makefile.in | 6 ++---- src/gtx/Makefile.in | 1 + src/kauth/admin_tools.c | 1 + src/libadmin/client/NTMakefile | 1 + src/libafsrpc/Makefile.in | 5 ++--- src/libuafs/Makefile.common.in | 8 ++++---- src/lwp/lock.c | 7 ++----- src/lwp/lock.h | 1 - src/opr/Makefile.in | 4 ++++ src/opr/NTMakefile | 3 ++- src/opr/assert.c | 27 ++++++++++++++++++++++++++ src/opr/opr.h | 6 ++++++ src/opr/opr_assert.h | 6 ++++++ src/shlibafsrpc/Makefile.in | 4 ++-- src/shlibafsrpc/libafsrpc.map | 2 +- src/tbudb/Makefile.in | 6 ++---- src/tptserver/Makefile.in | 3 ++- src/tsalvaged/Makefile.in | 5 +---- src/tsalvaged/salvsync-debug.c | 2 +- src/tubik/Makefile.in | 9 ++++----- src/tviced/Makefile.in | 3 ++- src/tviced/serialize_state.c | 1 - src/tviced/state_analyzer.c | 2 +- src/tvlserver/Makefile.in | 8 +++----- src/tvolser/Makefile.in | 8 +++----- src/ubik/remote.c | 3 ++- src/ubik/ubik.p.h | 1 - src/ubik/ubikclient.c | 1 - src/usd/usd_file.c | 5 ++--- src/util/Makefile.in | 12 +----------- src/util/NTMakefile | 3 --- src/util/afs_assert.h | 15 --------------- src/util/afsutil_prototypes.h | 5 ----- src/util/assert.c | 35 ---------------------------------- src/util/dirpath.c | 3 ++- src/util/ktime.c | 1 + src/util/netutils.c | 1 - src/util/pthread_glock.h | 6 +++--- src/util/pthread_nosigs.h | 4 ++-- src/util/serverLog.c | 1 - src/util/softsig.c | 4 ++-- src/venus/fs.c | 2 +- src/viced/afsfileprocs.c | 1 - src/viced/callback.c | 2 -- src/viced/host.c | 1 - src/viced/host.h | 1 - src/viced/physio.c | 1 - src/viced/viced.c | 1 - src/viced/viced.h | 1 - src/vol/clone.c | 1 - src/vol/daemon_com.c | 1 - src/vol/fssync-client.c | 1 - src/vol/fssync-debug.c | 1 - src/vol/ihandle.c | 1 - src/vol/namei_ops.c | 1 - src/vol/ntops.c | 1 - src/vol/nuke.c | 1 - src/vol/partition.c | 1 - src/vol/purge.c | 1 - src/vol/salvaged.c | 1 - src/vol/salvager.c | 1 - src/vol/salvsync-server.c | 1 - src/vol/vg_cache.c | 2 -- src/vol/vg_scan.c | 1 - src/vol/vnode.c | 2 -- src/vol/vol-salvage.c | 1 - src/vol/volume.c | 2 +- src/vol/volume_inline.h | 3 +++ src/vol/vutil.c | 2 -- src/volser/dumpstuff.c | 1 - src/volser/physio.c | 1 - src/volser/vol_split.c | 1 - src/volser/volmain.c | 1 - src/volser/volprocs.c | 1 - src/volser/volser.p.h | 1 - src/volser/voltrans.c | 1 - 87 files changed, 115 insertions(+), 190 deletions(-) create mode 100644 src/opr/opr_assert.h delete mode 100644 src/util/afs_assert.h delete mode 100644 src/util/assert.c diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index 3a993435d..8ea0ac737 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -25,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/WINNT/afsd/fs_acl.c b/src/WINNT/afsd/fs_acl.c index e29705be0..8012891cd 100644 --- a/src/WINNT/afsd/fs_acl.c +++ b/src/WINNT/afsd/fs_acl.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -25,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/WINNT/afsd/fs_utils.c b/src/WINNT/afsd/fs_utils.c index 1e44de9ec..8ef360aaa 100644 --- a/src/WINNT/afsd/fs_utils.c +++ b/src/WINNT/afsd/fs_utils.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index 6375c0284..d2ed9f8f9 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -17,11 +17,7 @@ #include #include #include -#ifdef AFS_PTHREAD_ENV #include -#else -#include -#endif #include #if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) && !defined(AFS_USR_DFBSD_ENV) /* must be included after KERNEL undef'd */ diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index e2c1e7414..0b89142a7 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -64,12 +64,13 @@ #define VFS 1 #include +#include +#include #include #include "afsd.h" -#include #include #include #include diff --git a/src/bu_utils/Makefile.in b/src/bu_utils/Makefile.in index e1e0b9c88..c4d9d7df0 100644 --- a/src/bu_utils/Makefile.in +++ b/src/bu_utils/Makefile.in @@ -15,7 +15,8 @@ all: fms FMSLIBS=${TOP_LIBDIR}/libcmd.a \ ${TOP_LIBDIR}/libusd.a \ ${XLIBS} \ - ${TOP_LIBDIR}/util.a + ${TOP_LIBDIR}/util.a \ + $(TOP_LIBDIR)/libopr.a fms: fms.o $(AFS_LDRULE) fms.o ${FMSLIBS} $(LIB_roken) diff --git a/src/butc/Makefile.in b/src/butc/Makefile.in index e6c006e33..855542844 100644 --- a/src/butc/Makefile.in +++ b/src/butc/Makefile.in @@ -83,7 +83,8 @@ read_tape: read_tape.c $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) $(AFS_LDFLAGS) \ -o read_tape ${srcdir}/read_tape.c \ ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libusd.a \ - ${TOP_LIBDIR}/util.a $(LIB_roken) + ${TOP_LIBDIR}/util.a $(TOP_LIBDIR)/libopr.a \ + $(LIB_roken) # Errors CFLAGS_tcudbprocs.o=@CFLAGS_NOERROR@ diff --git a/src/butc/tcmain.c b/src/butc/tcmain.c index de2e02021..d58bf302f 100644 --- a/src/butc/tcmain.c +++ b/src/butc/tcmain.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/src/butc/tcprocs.c b/src/butc/tcprocs.c index 596ed5599..f5299f9e3 100644 --- a/src/butc/tcprocs.c +++ b/src/butc/tcprocs.c @@ -15,10 +15,9 @@ #include #include -#include +#include #include #include -#include #include #include #include diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 3fe76f550..3f51bab36 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -17,10 +17,9 @@ # pragma GCC diagnostic warning "-Wimplicit-function-declaration" #endif -#include +#include #include #include -#include #include #include #include diff --git a/src/dviced/Makefile.in b/src/dviced/Makefile.in index 07ef9ada4..d2edc388b 100644 --- a/src/dviced/Makefile.in +++ b/src/dviced/Makefile.in @@ -35,7 +35,7 @@ LWPOBJS=lock.o threadname.o LIBACLOBJS=aclprocs.o netprocs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o DIROBJS=buffer.o dir.o salvage.o @@ -86,9 +86,6 @@ fsstats.o: ${VICED}/fsstats.c serialize_state.o: ${TVICED}/serialize_state.c $(AFS_CCRULE) $(TVICED)/serialize_state.c -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/dvolser/Makefile.in b/src/dvolser/Makefile.in index 2c08eb9c9..0ebd20759 100644 --- a/src/dvolser/Makefile.in +++ b/src/dvolser/Makefile.in @@ -30,7 +30,7 @@ LWPOBJS=lock.o threadname.o LIBACLOBJS=aclprocs.o netprocs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o DIROBJS=buffer.o dir.o salvage.o @@ -47,6 +47,7 @@ LIBS= ${TOP_LIBDIR}/libcmd.a \ ${TOP_LIBDIR}/libafsauthent.a \ ${TOP_LIBDIR}/libafsrpc.a \ ${TOP_LIBDIR}/libafsutil.a \ + ${TOP_LIBDIR}/libopr.a \ ${TOP_LIBDIR}/libusd.a all: davolserver @@ -94,9 +95,6 @@ vsutils.o: ${VOLSER}/vsutils.c lockprocs.o: ${VOLSER}/lockprocs.c $(AFS_CCRULE) $(VOLSER)/lockprocs.c -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/gtx/Makefile.in b/src/gtx/Makefile.in index 9020c7074..b0433d05e 100644 --- a/src/gtx/Makefile.in +++ b/src/gtx/Makefile.in @@ -37,6 +37,7 @@ LIBS=\ ${TOP_LIBDIR}/libauth.a \ ${TOP_LIBDIR}/librxkad.a \ ${TOP_LIBDIR}/libafscom_err.a \ + ${TOP_LIBDIR}/libopr.a \ ${TOP_LIBDIR}/util.a EXTRA_LIBS=${LIB_curses} ${XLIBS} diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index f65c9aedf..794d85a01 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -18,6 +18,7 @@ #include #include +#include #include diff --git a/src/libadmin/client/NTMakefile b/src/libadmin/client/NTMakefile index 5fa1efa95..2391de361 100644 --- a/src/libadmin/client/NTMakefile +++ b/src/libadmin/client/NTMakefile @@ -28,6 +28,7 @@ DLLLIBS =\ $(DESTDIR)\lib\afsrpc.lib \ $(DESTDIR)\lib\afspthread.lib \ $(DESTDIR)\lib\afs\afsutil.lib \ + $(DESTDIR)\lib\opr.lib \ $(DESTDIR)\lib\afsroken.lib $(DLLFILE): $(DLLOBJS) $(DLLLIBS) diff --git a/src/libafsrpc/Makefile.in b/src/libafsrpc/Makefile.in index 1082f429c..39c5ee6d6 100644 --- a/src/libafsrpc/Makefile.in +++ b/src/libafsrpc/Makefile.in @@ -259,12 +259,11 @@ et_name.o: ${COMERR}/et_name.c com_err.o: ${COMERR}/com_err.c $(AFS_CCRULE) $(COMERR)/com_err.c - casestrcpy.o: ${OPR}/casestrcpy.c $(AFS_CCRULE) $(OPR)/casestrcpy.c -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c +assert.o: ${OPR}/assert.c + $(AFS_CCRULE) $(OPR)/assert.c base64.o: ${UTIL}/base64.c $(AFS_CCRULE) $(UTIL)/base64.c diff --git a/src/libuafs/Makefile.common.in b/src/libuafs/Makefile.common.in index 72e2aef77..e264e9d80 100644 --- a/src/libuafs/Makefile.common.in +++ b/src/libuafs/Makefile.common.in @@ -988,7 +988,7 @@ $(UOBJ)/afsd_uafs.o: $(TOP_SRC_AFS)/UKERNEL/afsd_uafs.c $(CRULE1) $(UOBJ)/afs_uuid.o: $(TOP_SRCDIR)/util/uuid.c $(CRULE1) -o afs_uuid.o -$(UOBJ)/assert.o: $(TOP_SRCDIR)/util/assert.c +$(UOBJ)/assert.o: $(TOP_SRCDIR)/opr/assert.c $(CRULE1) $(UOBJ)/xdr_afsuuid.o: $(TOP_SRCDIR)/rx/xdr_afsuuid.c $(CRULE1) @@ -1285,7 +1285,7 @@ $(PICOBJ)/afsd_uafs.o: $(TOP_SRC_AFS)/UKERNEL/afsd_uafs.c $(CRULEPIC) $(PICOBJ)/afs_uuid.o: $(TOP_SRCDIR)/util/uuid.c $(CRULEPIC) -o afs_uuid.o -$(PICOBJ)/assert.o: $(TOP_SRCDIR)/util/assert.c +$(PICOBJ)/assert.o: $(TOP_SRCDIR)/opr/assert.c $(CRULEPIC) $(PICOBJ)/xdr_afsuuid.o: $(TOP_SRCDIR)/rx/xdr_afsuuid.c $(CRULEPIC) @@ -1580,7 +1580,7 @@ $(WEBOBJ)/afsd_uafs.o: $(TOP_SRC_AFS)/UKERNEL/afsd_uafs.c $(CRULE2) $(WEBOBJ)/afs_uuid.o: $(TOP_SRCDIR)/util/uuid.c $(CRULE2) -o afs_uuid.o -$(WEBOBJ)/assert.o: $(TOP_SRCDIR)/util/assert.c +$(WEBOBJ)/assert.o: $(TOP_SRCDIR)/opr/assert.c $(CRULE1) $(WEBOBJ)/xdr_afsuuid.o: $(TOP_SRCDIR)/rx/xdr_afsuuid.c $(CRULE2) @@ -1885,7 +1885,7 @@ $(JUAFS)/afsd_uafs.o: $(TOP_SRC_AFS)/UKERNEL/afsd_uafs.c $(CRULE1) $(JUAFS)/afs_uuid.o: $(TOP_SRCDIR)/util/uuid.c $(CRULE1) -o afs_uuid.o -$(JUAFS)/assert.o: $(TOP_SRCDIR)/util/assert.c +$(JUAFS)/assert.o: $(TOP_SRCDIR)/opr/assert.c $(CRULE1) $(JUAFS)/xdr_afsuuid.o: $(TOP_SRCDIR)/rx/xdr_afsuuid.c $(CRULE1) diff --git a/src/lwp/lock.c b/src/lwp/lock.c index d34bfb438..5f31d333f 100644 --- a/src/lwp/lock.c +++ b/src/lwp/lock.c @@ -28,14 +28,11 @@ #include #ifdef AFS_PTHREAD_ENV -#include -/* can't include this in lwp, rx hasn't built yet */ - #include -#else -#include #endif +#include + #include "lwp.h" #include "lock.h" diff --git a/src/lwp/lock.h b/src/lwp/lock.h index 7bda37588..aa104488f 100644 --- a/src/lwp/lock.h +++ b/src/lwp/lock.h @@ -44,7 +44,6 @@ #ifdef AFS_PTHREAD_ENV #include -#include /* can't include in non-lwp case; rx builds later */ #include #define LOCK_LOCK(A) MUTEX_ENTER(&(A)->mutex); diff --git a/src/opr/Makefile.in b/src/opr/Makefile.in index 566cdbe82..e43460226 100644 --- a/src/opr/Makefile.in +++ b/src/opr/Makefile.in @@ -5,6 +5,7 @@ include @TOP_OBJDIR@/src/config/Makefile.pthread objects = assert.o casestrcpy.o all: $(TOP_INCDIR)/afs/opr.h \ + $(TOP_INCDIR)/afs/opr_assert.h \ $(TOP_LIBDIR)/libopr.a libopr.a: $(objects) @@ -18,6 +19,9 @@ $(TOP_LIBDIR)/libopr.a: libopr.a $(TOP_INCDIR)/afs/opr.h: opr.h $(INSTALL_DATA) opr.h $@ +$(TOP_INCDIR)/afs/opr_assert.h: opr_assert.h + $(INSTALL_DATA) opr_assert.h $@ + install: libopr.a $(INSTALL_DATA) libopr.a $(DESTDIR)$(libdir)/libopr.a diff --git a/src/opr/NTMakefile b/src/opr/NTMakefile index a10ee520d..7957992de 100644 --- a/src/opr/NTMakefile +++ b/src/opr/NTMakefile @@ -11,7 +11,8 @@ RELDIR=opr INCFILEDIR = $(DESTDIR)\include\afs INCFILES = \ - $(INCFILEDIR)\opr.h + $(INCFILEDIR)\opr.h \ + $(INCFILEDIR)\opr_assert.h LIBFILE = $(DESTDIR)\lib\opr.lib diff --git a/src/opr/assert.c b/src/opr/assert.c index 268ed938d..7c8998f15 100644 --- a/src/opr/assert.c +++ b/src/opr/assert.c @@ -12,4 +12,31 @@ opr_NTAbort(void) } #endif +#define TIMESTAMP_BUFFER_SIZE 26 /* including the null */ +void +opr_AssertionFailed(char *file, int line) +{ + char tdate[TIMESTAMP_BUFFER_SIZE]; + time_t when; + struct tm tm; + + when = time(NULL); + strftime(tdate, sizeof(tdate), "%a %b %d %H:%M:%S %Y", + localtime_r(&when, &tm)); + fprintf(stderr, "%s Assertion failed! file %s, line %d.\n", tdate, file, + line); + fflush(stderr); + opr_abort(); +} + +void +opr_AssertFailU(const char *expr, const char *file, int line) +{ + fprintf(stderr, "Fatal Rx error: assertion failed: %s, " + "file: %s, line: %d\n", + expr, file, line); + fflush(stderr); + fflush(stdout); + opr_abort(); +} diff --git a/src/opr/opr.h b/src/opr/opr.h index 20a4e82f4..b53211c2a 100644 --- a/src/opr/opr.h +++ b/src/opr/opr.h @@ -9,7 +9,13 @@ extern void opr_NTAbort(void); # define opr_abort() abort() #endif +extern void opr_AssertionFailed(char *, int); +extern void opr_AssertFailU(const char *, const char *, int); +#define opr_Assert(ex) \ + do {if (!(ex)) opr_AssertionFailed(__FILE__, __LINE__);} while(0) + +/* casestrcpy.c */ #define lcstring opr_lcstring #define ucstring opr_ucstring #define stolower opr_stolower diff --git a/src/opr/opr_assert.h b/src/opr/opr_assert.h new file mode 100644 index 000000000..32666e888 --- /dev/null +++ b/src/opr/opr_assert.h @@ -0,0 +1,6 @@ +/* Include this header if you want the standard 'assert()' macro to have the + * same behaviour as the new opr_Assert macro + */ +#include + +#define assert(ex) opr_Assert(ex) diff --git a/src/shlibafsrpc/Makefile.in b/src/shlibafsrpc/Makefile.in index 0d5327d28..e55b679d6 100644 --- a/src/shlibafsrpc/Makefile.in +++ b/src/shlibafsrpc/Makefile.in @@ -274,8 +274,8 @@ com_err.o: ${COMERR}/com_err.c casestrcpy.o: ${OPR}/casestrcpy.c $(AFS_CCRULE) $(OPR)/casestrcpy.c -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c +assert.o: ${OPR}/assert.c + $(AFS_CCRULE) $(OPR)/assert.c base64.o: ${UTIL}/base64.c $(AFS_CCRULE) $(UTIL)/base64.c diff --git a/src/shlibafsrpc/libafsrpc.map b/src/shlibafsrpc/libafsrpc.map index 41670549a..34549830d 100755 --- a/src/shlibafsrpc/libafsrpc.map +++ b/src/shlibafsrpc/libafsrpc.map @@ -113,7 +113,7 @@ opr_stolower; opr_ucstring; opr_lcstring; - AssertionFailed; + opr_AssertionFailed; rx_GetLocalPeers; rx_GetMaxReceiveWindow; rx_GetMaxSendWindow; diff --git a/src/tbudb/Makefile.in b/src/tbudb/Makefile.in index 0878675c8..ba24342ef 100644 --- a/src/tbudb/Makefile.in +++ b/src/tbudb/Makefile.in @@ -18,7 +18,7 @@ BUDB=$(srcdir)/../budb RXOBJS= rx_pthread.o rxkad_errs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o @@ -44,6 +44,7 @@ LIBS=${RXOBJS} ${UTILOBJS} \ ${TOP_LIBDIR}/libafsauthent.a \ ${TOP_LIBDIR}/libafsrpc.a \ ${TOP_LIBDIR}/libcmd.a \ + $(TOP_LIBDIR)/libopr.a \ ${TOP_LIBDIR}/libafsutil.a COMMON_OBJS = database.o db_alloc.o db_dump.o db_hash.o struct_ops.o ol_verify.o @@ -74,9 +75,6 @@ rxkad_errs.o: ../rxkad/rxkad_errs.c # pthreaded version of this library, as we are doing with ubik itself, but... # -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/tptserver/Makefile.in b/src/tptserver/Makefile.in index 8fe341f94..96c1fda4d 100644 --- a/src/tptserver/Makefile.in +++ b/src/tptserver/Makefile.in @@ -18,7 +18,7 @@ PTSERVER=$(srcdir)/../ptserver RXOBJS= rx_pthread.o rxkad_errs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o \ pthread_threadname.o @@ -37,6 +37,7 @@ LIBS=${RXOBJS} ${UTILOBJS}\ ${TOP_LIBDIR}/libafsauthent.a \ ${TOP_LIBDIR}/libafsrpc.a \ ${TOP_LIBDIR}/libcmd.a \ + ${TOP_LIBDIR}/libopr.a \ ${TOP_LIBDIR}/libafsutil.a PTOBJS=ptuser.o pterror.o ptint.cs.o ptint.xdr.o diff --git a/src/tsalvaged/Makefile.in b/src/tsalvaged/Makefile.in index b4346df0d..e4df38ff0 100644 --- a/src/tsalvaged/Makefile.in +++ b/src/tsalvaged/Makefile.in @@ -34,7 +34,7 @@ DIROBJS=buffer.o dir.o salvage.o LWPOBJS=lock.o threadname.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o fstab.o +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o fstab.o VLIBOBJS=volume.o vnode.o vutil.o partition.o fssync-client.o \ clone.o nuke.o devname.o listinodes.o ihandle.o \ @@ -114,9 +114,6 @@ physio.o: ${VOL}/physio.c fssync-debug.o: ${VOL}/fssync-debug.c $(AFS_CCRULE) $(VOL)/fssync-debug.c -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/tsalvaged/salvsync-debug.c b/src/tsalvaged/salvsync-debug.c index 58a1796a6..7e82a4bb2 100644 --- a/src/tsalvaged/salvsync-debug.c +++ b/src/tsalvaged/salvsync-debug.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #ifndef AFS_NT40_ENV diff --git a/src/tubik/Makefile.in b/src/tubik/Makefile.in index 91ed1506e..ba7b202d3 100644 --- a/src/tubik/Makefile.in +++ b/src/tubik/Makefile.in @@ -26,13 +26,15 @@ INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \ RXOBJS = rx_pthread.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o \ pthread_threadname.o LIBS=${RXOBJS} ${UTILOBJS} ${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a \ ${TOP_LIBDIR}/libafscom_err.a ${TOP_LIBDIR}/libcmd.a \ - ${TOP_LIBDIR}/libsys.a ${XLIBS} ${MT_LIBS} + ${TOP_LIBDIR}/libsys.a \ + $(TOP_LIBDIR)/libopr.a \ + ${XLIBS} ${MT_LIBS} all: depinstall ${TOP_LIBDIR}/libubik_pthread.a udebug utst_server utst_client @@ -55,9 +57,6 @@ rx_pthread.o: ${RX}/rx_pthread.c # pthreaded version of this library, as we are doing with ubik itself, but... # -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/tviced/Makefile.in b/src/tviced/Makefile.in index 337f07bae..f35b2f987 100644 --- a/src/tviced/Makefile.in +++ b/src/tviced/Makefile.in @@ -33,7 +33,7 @@ LWPOBJS=lock.o threadname.o LIBACLOBJS=aclprocs.o netprocs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o pthread_threadname.o +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o pthread_threadname.o DIROBJS=buffer.o dir.o salvage.o @@ -51,6 +51,7 @@ objects= ${VICEDOBJS} ${VLSERVEROBJS} ${LWPOBJS} ${LIBACLOBJS} \ LIBS=${TOP_LIBDIR}/libafsauthent.a \ ${TOP_LIBDIR}/libafsrpc.a \ $(TOP_LIBDIR)/libcmd.a \ + $(TOP_LIBDIR)/libopr.a \ ${TOP_LIBDIR}/util.a all: fileserver diff --git a/src/tviced/serialize_state.c b/src/tviced/serialize_state.c index 83a0cee57..6b2d88149 100644 --- a/src/tviced/serialize_state.c +++ b/src/tviced/serialize_state.c @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/src/tviced/state_analyzer.c b/src/tviced/state_analyzer.c index 219ea27ed..0db628fe2 100644 --- a/src/tviced/state_analyzer.c +++ b/src/tviced/state_analyzer.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/tvlserver/Makefile.in b/src/tvlserver/Makefile.in index 9975d39d8..b05436b6e 100644 --- a/src/tvlserver/Makefile.in +++ b/src/tvlserver/Makefile.in @@ -18,7 +18,7 @@ VLSERVER=$(srcdir)/../vlserver RXOBJS= rx_pthread.o rxkad_errs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o \ volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o \ pthread_threadname.o get_krbrlm.o @@ -35,7 +35,8 @@ LIBS= ${TOP_LIBDIR}/libubik_pthread.a \ ${TOP_LIBDIR}/libafsauthent.a \ ${TOP_LIBDIR}/libcmd.a \ ${TOP_LIBDIR}/libafsrpc.a \ - ${TOP_LIBDIR}/libafsutil.a + ${TOP_LIBDIR}/libafsutil.a \ + ${TOP_LIBDIR}/libopr.a OBJS=vldbint.xdr.o vldbint.cs.o vl_errors.o ${RXOBJS} ${UTILOBJS} @@ -58,9 +59,6 @@ rxkad_errs.o: ../rxkad/rxkad_errs.c # pthreaded version of this library, as we are doing with ubik itself, but... # -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/tvolser/Makefile.in b/src/tvolser/Makefile.in index 5bdfee6d6..2c9098ecd 100644 --- a/src/tvolser/Makefile.in +++ b/src/tvolser/Makefile.in @@ -33,7 +33,7 @@ LWPOBJS=lock.o threadname.o LIBACLOBJS=aclprocs.o netprocs.o -UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o pthread_threadname.o +UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o volparse.o flipbase64.o softsig.o pthread_threadname.o DIROBJS=buffer.o dir.o salvage.o @@ -53,7 +53,8 @@ LIBS= ${TOP_LIBDIR}/libcmd.a \ ${TOP_LIBDIR}/libafsauthent.a \ ${TOP_LIBDIR}/libafsutil.a \ ${TOP_LIBDIR}/libusd.a \ - ${TOP_LIBDIR}/libafsrpc.a + ${TOP_LIBDIR}/libafsrpc.a \ + $(TOP_LIBDIR)/libopr.a all: volserver vos @@ -100,9 +101,6 @@ vsutils.o: ${VOLSER}/vsutils.c lockprocs.o: ${VOLSER}/lockprocs.c $(AFS_CCRULE) $(VOLSER)/lockprocs.c -assert.o: ${UTIL}/assert.c - $(AFS_CCRULE) $(UTIL)/assert.c - uuid.o: ${UTIL}/uuid.c $(AFS_CCRULE) $(UTIL)/uuid.c diff --git a/src/ubik/remote.c b/src/ubik/remote.c index 205097af9..f3c0b9610 100644 --- a/src/ubik/remote.c +++ b/src/ubik/remote.c @@ -11,11 +11,12 @@ #include #include - +#include #include #include #include #include +#include #include #define UBIK_INTERNALS diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index 109c766a4..c1ac7721b 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -49,7 +49,6 @@ #define CFLastFailed 1 /*!< last call failed to this guy (to detect down hosts) */ /*\}*/ -#include #ifdef AFS_PTHREAD_ENV #include #else diff --git a/src/ubik/ubikclient.c b/src/ubik/ubikclient.c index 40fc4e87a..3e59c4ae5 100644 --- a/src/ubik/ubikclient.c +++ b/src/ubik/ubikclient.c @@ -83,7 +83,6 @@ ubik_ParseClientList(int argc, char **argv, afs_uint32 * aothers) return 0; } -#include #ifdef AFS_PTHREAD_ENV #include diff --git a/src/usd/usd_file.c b/src/usd/usd_file.c index cc00dc31d..f11267aac 100644 --- a/src/usd/usd_file.c +++ b/src/usd/usd_file.c @@ -11,6 +11,7 @@ #include #include +#include #if defined(AFS_AIX_ENV) #include @@ -27,8 +28,6 @@ #endif #endif /* AFS_AIX_ENV */ -#include - #include "usd.h" #ifdef O_LARGEFILE @@ -350,7 +349,7 @@ usd_FileOpen(const char *path, int flags, int mode, usd_handle_t * usdP) #endif /* O_LARGEFILE */ /* make sure both lock bits aren't set */ - assert(~flags & (USD_OPEN_RLOCK | USD_OPEN_WLOCK)); + opr_Assert(~flags & (USD_OPEN_RLOCK | USD_OPEN_WLOCK)); fl.l_type = ((flags & USD_OPEN_RLOCK) ? F_RDLCK : F_WRLCK); fl.l_whence = SEEK_SET; diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 9c1b17c67..37210efd2 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -12,7 +12,7 @@ include @TOP_OBJDIR@/src/config/Makefile.lwp HELPER_SPLINT=@HELPER_SPLINT@ -objects =assert.o base64.o config_file.o ktime.o volparse.o \ +objects =base64.o config_file.o ktime.o volparse.o \ hostparse.o exec.o \ hputil.o kreltime.o get_krbrlm.o uuid.o serverLog.o \ dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \ @@ -20,7 +20,6 @@ objects =assert.o base64.o config_file.o ktime.o volparse.o \ pthread_threadname.o ${REGEX_OBJ} objects_pic = \ - assert_pic.o \ base64_pic.o \ config_file_pic.o \ ktime_pic.o \ @@ -47,7 +46,6 @@ objects_pic = \ includes = \ ${TOP_INCDIR}/afs/dirpath.h \ ${TOP_INCDIR}/afs/pthread_nosigs.h \ - ${TOP_INCDIR}/afs/afs_assert.h \ ${TOP_INCDIR}/afs/errors.h \ ${TOP_INCDIR}/afs/vice.h \ ${TOP_INCDIR}/afs/ktime.h \ @@ -83,9 +81,6 @@ ${TOP_INCDIR}/afs/dirpath.h: dirpath.h ${TOP_INCDIR}/afs/pthread_nosigs.h: ${srcdir}/pthread_nosigs.h ${INSTALL_DATA} $? $@ -${TOP_INCDIR}/afs/afs_assert.h: ${srcdir}/afs_assert.h - ${INSTALL_DATA} $? $@ - ${TOP_INCDIR}/afs/errors.h: ${srcdir}/errors.h ${INSTALL_DATA} $? $@ @@ -196,9 +191,6 @@ sys: sys.o $(AFS_LDRULE) sys.o # PIC objects build rules -assert_pic.o: ${srcdir}/assert.c ${includes} - $(SHD_CCRULE) ${srcdir}/assert.c - base64_pic.o: ${srcdir}/base64.c ${includes} $(SHD_CCRULE) ${srcdir}/base64.c @@ -277,7 +269,6 @@ install: dirpath.h util.a util_pic.a sys ${INSTALL} -d ${DESTDIR}${bindir} ${INSTALL_DATA} dirpath.h ${DESTDIR}${includedir}/afs/dirpath.h ${INSTALL_DATA} ${srcdir}/pthread_nosigs.h ${DESTDIR}${includedir}/afs/pthread_nosigs.h - ${INSTALL_DATA} ${srcdir}/afs_assert.h ${DESTDIR}${includedir}/afs/afs_assert.h ${INSTALL_DATA} ${srcdir}/errors.h ${DESTDIR}${includedir}/afs/errors.h ${INSTALL_DATA} ${srcdir}/vice.h ${DESTDIR}${includedir}/afs/vice.h ${INSTALL_DATA} ${srcdir}/ktime.h ${DESTDIR}${includedir}/afs/ktime.h @@ -305,7 +296,6 @@ dest: dirpath.h util.a util_pic.a sys ${INSTALL} -d ${DEST}/bin ${INSTALL_DATA} dirpath.h ${DEST}/include/afs/dirpath.h ${INSTALL_DATA} ${srcdir}/pthread_nosigs.h ${DEST}/include/afs/pthread_nosigs.h - ${INSTALL_DATA} ${srcdir}/afs_assert.h ${DEST}/include/afs/afs_assert.h ${INSTALL_DATA} ${srcdir}/errors.h ${DEST}/include/afs/errors.h ${INSTALL_DATA} ${srcdir}/vice.h ${DEST}/include/afs/vice.h ${INSTALL_DATA} ${srcdir}/ktime.h ${DEST}/include/afs/ktime.h diff --git a/src/util/NTMakefile b/src/util/NTMakefile index 9285da87b..b828a0ca2 100644 --- a/src/util/NTMakefile +++ b/src/util/NTMakefile @@ -17,7 +17,6 @@ INCFILES =\ $(DESTDIR)\include\dirent.h \ $(DESTDIR)\include\opr\queue.h \ $(INCFILEDIR)\afsutil.h \ - $(INCFILEDIR)\afs_assert.h \ $(INCFILEDIR)\errors.h \ $(INCFILEDIR)\vice.h \ $(INCFILEDIR)\netutils.h \ @@ -43,7 +42,6 @@ LIBFILE = $(DESTDIR)\lib\afs\afsutil.lib MT_LIBFILE = $(DESTDIR)\lib\afs\mtafsutil.lib LIBOBJS = \ - $(OUT)\assert.obj \ $(OUT)\base32.obj \ $(OUT)\get_krbrlm.obj \ $(OUT)\hostparse.obj \ @@ -63,7 +61,6 @@ LIBOBJS = \ $(OUT)\secutil_nt.obj MT_LIBOBJS = \ - $(OUT)\assert.obj \ $(OUT)\base32.obj \ $(OUT)\get_krbrlm.obj \ $(OUT)\hostparse.obj \ diff --git a/src/util/afs_assert.h b/src/util/afs_assert.h deleted file mode 100644 index 51f01c63d..000000000 --- a/src/util/afs_assert.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -/* @(#)assert.h 1.1 83/08/01 SMI; from UCB 4.1 83/05/03 */ -/* Modified to dump core, rather than exit. May/85 RNS */ - -void AssertionFailed(char *file, int line) AFS_NORETURN; - -#define assert(ex) do{if (!(ex)) AssertionFailed(__FILE__, __LINE__);}while(0) diff --git a/src/util/afsutil_prototypes.h b/src/util/afsutil_prototypes.h index 25f92cb78..ff0f30c12 100644 --- a/src/util/afsutil_prototypes.h +++ b/src/util/afsutil_prototypes.h @@ -19,11 +19,6 @@ /* afs_lhash.c */ - -/* assert.c */ -extern void AssertionFailed(char *file, int line); - - /* base32.c */ extern char *int_to_base32(b32_string_t s, int a); extern int base32_to_int(char *s); diff --git a/src/util/assert.c b/src/util/assert.c deleted file mode 100644 index 0b51f11f8..000000000 --- a/src/util/assert.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -/* ReallyAbort: called from assert. May/85 */ -#include -#include - -#include -#include - -#include "afsutil.h" - -#define TIMESTAMP_BUFFER_SIZE 26 /* including the null */ - -void -AssertionFailed(char *file, int line) -{ - char tdate[TIMESTAMP_BUFFER_SIZE]; - time_t when; - struct tm tm; - - when = time(NULL); - strftime(tdate, sizeof(tdate), "%a %b %d %H:%M:%S %Y", - localtime_r(&when, &tm)); - fprintf(stderr, "%s Assertion failed! file %s, line %d.\n", tdate, file, - line); - fflush(stderr); - opr_abort(); -} diff --git a/src/util/dirpath.c b/src/util/dirpath.c index dd894b015..9c8efbcbc 100644 --- a/src/util/dirpath.c +++ b/src/util/dirpath.c @@ -17,10 +17,11 @@ #include #include -#include "afs_assert.h" #include "afsutil.h" #include "fileutil.h" +#include + #ifdef AFS_PTHREAD_ENV #include static pthread_once_t dirInit_once = PTHREAD_ONCE_INIT; diff --git a/src/util/ktime.c b/src/util/ktime.c index f15ee289d..9cb6f7242 100644 --- a/src/util/ktime.c +++ b/src/util/ktime.c @@ -15,6 +15,7 @@ #include +#include #include "afsutil.h" #include "ktime.h" diff --git a/src/util/netutils.c b/src/util/netutils.c index c12aeb413..013cc82a4 100644 --- a/src/util/netutils.c +++ b/src/util/netutils.c @@ -21,7 +21,6 @@ #include #include -#include "afs_assert.h" #include "afsutil.h" #define AFS_IPINVALID 0xffffffff /* invalid IP address */ diff --git a/src/util/pthread_glock.h b/src/util/pthread_glock.h index c6414c96c..1fe464b10 100644 --- a/src/util/pthread_glock.h +++ b/src/util/pthread_glock.h @@ -12,7 +12,7 @@ #ifdef AFS_PTHREAD_ENV #include -#include +#include typedef struct { pthread_mutex_t mut; @@ -35,10 +35,10 @@ extern int pthread_recursive_mutex_lock(pthread_recursive_mutex_p); extern int pthread_recursive_mutex_unlock(pthread_recursive_mutex_p); #define LOCK_GLOBAL_MUTEX \ - osi_Assert(pthread_recursive_mutex_lock(&grmutex)==0) + opr_Assert(pthread_recursive_mutex_lock(&grmutex)==0) #define UNLOCK_GLOBAL_MUTEX \ - osi_Assert(pthread_recursive_mutex_unlock(&grmutex)==0) + opr_Assert(pthread_recursive_mutex_unlock(&grmutex)==0) #else diff --git a/src/util/pthread_nosigs.h b/src/util/pthread_nosigs.h index 1d638967e..bc780418f 100644 --- a/src/util/pthread_nosigs.h +++ b/src/util/pthread_nosigs.h @@ -68,13 +68,13 @@ do { \ _SETABRT \ _SETFPE \ b = (AFS_SET_SIGMASK(SIG_BLOCK, &i_tset, &i_oset) == 0); \ - assert(b); \ + opr_Assert(b); \ } while (0) #define AFS_SIGSET_RESTORE() \ do { \ int b = (AFS_SET_SIGMASK(SIG_SETMASK, &i_oset, NULL) == 0); \ - assert(b); \ + opr_Assert(b); \ } while (0) #endif /* AFS_NT40_ENV */ diff --git a/src/util/serverLog.c b/src/util/serverLog.c index 7c5eae167..f32a5069f 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -29,7 +29,6 @@ #include #if defined(AFS_PTHREAD_ENV) -#include /* can't include rx when we are libutil; it's too early */ #include #include diff --git a/src/util/softsig.c b/src/util/softsig.c index e0e6480b4..79eb6dd50 100644 --- a/src/util/softsig.c +++ b/src/util/softsig.c @@ -14,8 +14,8 @@ #include /* Must be before roken.h */ #include +#include -#include #include #include "pthread_nosigs.h" @@ -117,7 +117,7 @@ softsig_init(void) AFS_SIGSET_DECL; AFS_SIGSET_CLEAR(); rc = pthread_create(&softsig_tid, NULL, &softsig_thread, NULL); - assert(0 == rc); + opr_Assert(0 == rc); AFS_SIGSET_RESTORE(); signal (SIGUSR1, softsig_usr1); } diff --git a/src/venus/fs.c b/src/venus/fs.c index 31d20d4a6..7e2775119 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -12,8 +12,8 @@ #include #include - #include +#include #include #include diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 7e422c0e8..fa949f416 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -69,7 +69,6 @@ #include #include -#include #include #include #include diff --git a/src/viced/callback.c b/src/viced/callback.c index 7cdb18ef0..d9b9b1866 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -91,8 +91,6 @@ #include #endif -#include - #include /* yuck. This is an abomination. */ #include #include diff --git a/src/viced/host.c b/src/viced/host.c index fab7fcb95..3d864a303 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -21,7 +21,6 @@ #endif #include -#include #include #include #include diff --git a/src/viced/host.h b/src/viced/host.h index 58b2b9342..ac4eb4dc0 100644 --- a/src/viced/host.h +++ b/src/viced/host.h @@ -23,7 +23,6 @@ * precedence is host_listlock_mutex, host->mutex, host_glock_mutex. */ #include -#include #include extern pthread_mutex_t host_glock_mutex; #define H_LOCK MUTEX_ENTER(&host_glock_mutex); diff --git a/src/viced/physio.c b/src/viced/physio.c index 1131c30de..eb236ec79 100644 --- a/src/viced/physio.c +++ b/src/viced/physio.c @@ -23,7 +23,6 @@ #endif #include -#include #include #include #include diff --git a/src/viced/viced.c b/src/viced/viced.c index 8bca99354..4c4f34c4c 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -42,7 +42,6 @@ #include #include -#include #include #include #include diff --git a/src/viced/viced.h b/src/viced/viced.h index 09e2bf395..3db60784a 100644 --- a/src/viced/viced.h +++ b/src/viced/viced.h @@ -195,7 +195,6 @@ extern int saneacls; * HostCheck, Signal, min 2 for RXSTATS */ #ifdef AFS_PTHREAD_ENV #include -#include extern pthread_mutex_t fileproc_glock_mutex; #define FS_LOCK MUTEX_ENTER(&fileproc_glock_mutex); #define FS_UNLOCK MUTEX_EXIT(&fileproc_glock_mutex); diff --git a/src/vol/clone.c b/src/vol/clone.c index b9aff7797..5217a2cd3 100644 --- a/src/vol/clone.c +++ b/src/vol/clone.c @@ -25,7 +25,6 @@ #include #endif -#include #include #include #include diff --git a/src/vol/daemon_com.c b/src/vol/daemon_com.c index 07094a52a..be35ca792 100644 --- a/src/vol/daemon_com.c +++ b/src/vol/daemon_com.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/src/vol/fssync-client.c b/src/vol/fssync-client.c index 0d884bc59..048cf5945 100644 --- a/src/vol/fssync-client.c +++ b/src/vol/fssync-client.c @@ -37,7 +37,6 @@ #include -#include #include #include #include diff --git a/src/vol/fssync-debug.c b/src/vol/fssync-debug.c index 3634f2f2b..ac3d122db 100644 --- a/src/vol/fssync-debug.c +++ b/src/vol/fssync-debug.c @@ -26,7 +26,6 @@ #include #include -#include #ifndef AFS_NT40_ENV #include diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index f2e928dec..789ec3940 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -30,7 +30,6 @@ #include "nfs.h" #include "ihandle.h" #include "viceinode.h" -#include "afs/afs_assert.h" #ifdef AFS_PTHREAD_ENV pthread_once_t ih_glock_once = PTHREAD_ONCE_INIT; diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 62191d9cc..811beaee0 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -29,7 +29,6 @@ #include #endif -#include #include #include #include diff --git a/src/vol/ntops.c b/src/vol/ntops.c index 5be28ef10..f012ca08d 100644 --- a/src/vol/ntops.c +++ b/src/vol/ntops.c @@ -28,7 +28,6 @@ #include "volume.h" #include "viceinode.h" #include -#include #include #define BASEFILEATTRIBUTE FILE_ATTRIBUTE_NORMAL diff --git a/src/vol/nuke.c b/src/vol/nuke.c index 9d882e71f..b0b426265 100644 --- a/src/vol/nuke.c +++ b/src/vol/nuke.c @@ -14,7 +14,6 @@ #include #include -#include #include diff --git a/src/vol/partition.c b/src/vol/partition.c index 0cbc46266..235ee6c95 100644 --- a/src/vol/partition.c +++ b/src/vol/partition.c @@ -117,7 +117,6 @@ #include "vnode.h" #include "volume.h" #include "partition.h" -#include #if defined(AFS_HPUX_ENV) #include diff --git a/src/vol/purge.c b/src/vol/purge.c index fb5ac8708..b23401ea3 100644 --- a/src/vol/purge.c +++ b/src/vol/purge.c @@ -22,7 +22,6 @@ #include #endif -#include #include #include diff --git a/src/vol/salvaged.c b/src/vol/salvaged.c index 684527e85..31d5bc892 100644 --- a/src/vol/salvaged.c +++ b/src/vol/salvaged.c @@ -34,7 +34,6 @@ #include #include -#include #if !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) #if defined(AFS_VFSINCL_ENV) diff --git a/src/vol/salvager.c b/src/vol/salvager.c index b647b14d2..61fb3a09c 100644 --- a/src/vol/salvager.c +++ b/src/vol/salvager.c @@ -37,7 +37,6 @@ #include #include -#include #if !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) #if defined(AFS_VFSINCL_ENV) #include diff --git a/src/vol/salvsync-server.c b/src/vol/salvsync-server.c index c9dea4aa8..b0458c899 100644 --- a/src/vol/salvsync-server.c +++ b/src/vol/salvsync-server.c @@ -35,7 +35,6 @@ #include #endif -#include #include #include #include "nfs.h" diff --git a/src/vol/vg_cache.c b/src/vol/vg_cache.c index fac9441b3..109b8e5a0 100644 --- a/src/vol/vg_cache.c +++ b/src/vol/vg_cache.c @@ -23,8 +23,6 @@ #ifdef AFS_DEMAND_ATTACH_FS -#include - #include #include #include diff --git a/src/vol/vg_scan.c b/src/vol/vg_scan.c index 7fc212ecd..44b727829 100644 --- a/src/vol/vg_scan.c +++ b/src/vol/vg_scan.c @@ -24,7 +24,6 @@ #ifdef AFS_DEMAND_ATTACH_FS -#include #include #include #include diff --git a/src/vol/vnode.c b/src/vol/vnode.c index 531c48a7d..424f0a707 100644 --- a/src/vol/vnode.c +++ b/src/vol/vnode.c @@ -26,8 +26,6 @@ #include #endif -#include - #include #include "rx/rx_queue.h" #include diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index ccc94376a..c770ce1bc 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -101,7 +101,6 @@ Vnodes with 0 inode pointers in RW volumes are now deleted. #endif #include #include -#include #if !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) #if defined(AFS_VFSINCL_ENV) #include diff --git a/src/vol/volume.c b/src/vol/volume.c index afd2bf4db..bca4bd3ed 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -101,7 +102,6 @@ #include "partition.h" #include "volume_inline.h" #include "common.h" -#include "afs/afs_assert.h" #include "vutils.h" #include diff --git a/src/vol/volume_inline.h b/src/vol/volume_inline.h index 3f1f0afd7..48905820c 100644 --- a/src/vol/volume_inline.h +++ b/src/vol/volume_inline.h @@ -18,6 +18,9 @@ #endif #ifdef AFS_PTHREAD_ENV + +#include + /** * @param[in] cv cond var * @param[in] ts deadline, or NULL to wait forever diff --git a/src/vol/vutil.c b/src/vol/vutil.c index 1e0edc641..74eaaed83 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -27,8 +27,6 @@ #include #endif -#include - #include #include #include "nfs.h" diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 16f5e7921..55fab5719 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -14,7 +14,6 @@ #include -#include #include #include #include diff --git a/src/volser/physio.c b/src/volser/physio.c index 00451004c..ccb474c09 100644 --- a/src/volser/physio.c +++ b/src/volser/physio.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include diff --git a/src/volser/vol_split.c b/src/volser/vol_split.c index e8377cb8a..5ee2bfbab 100644 --- a/src/volser/vol_split.c +++ b/src/volser/vol_split.c @@ -15,7 +15,6 @@ #endif #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV) -#include #include #include #include diff --git a/src/volser/volmain.c b/src/volser/volmain.c index 722285306..a8fab24ce 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 5630f4343..e7f68eb83 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/src/volser/volser.p.h b/src/volser/volser.p.h index 75ffce41a..ab68f73af 100644 --- a/src/volser/volser.p.h +++ b/src/volser/volser.p.h @@ -10,7 +10,6 @@ #ifndef _VOLSER_ #define _VOLSER_ 1 -#include #ifdef AFS_PTHREAD_ENV #include #endif diff --git a/src/volser/voltrans.c b/src/volser/voltrans.c index 599d4c994..2e91f8cf0 100644 --- a/src/volser/voltrans.c +++ b/src/volser/voltrans.c @@ -24,7 +24,6 @@ #endif #include -#include #include #include #include -- 2.39.5