xfsdump: (style) remove spaces from parentheses

Transform "( x, y )" to "(x, y)", and the same for [].

Created by this script:
*****
#!/usr/bin/env bash
# transform 'foo( x, y )' -> 'foo(x, y)'
set -euo pipefail

# regexps in order:
# - remove spaces after opening parentheses (
# - remove spaces after opening brackets [
# - remove spaces before closing parentheses )
# - remove spaces before closing brackets ]
#
# Run multiple iterations to get all overlapping matches.

for i in {1..8}; do
    echo "iteration $i"
    find . -name '*.[ch]' ! -type d -exec gawk -i inplace '{
        $0 = gensub(/^([^"]*)\(\s+/, "\\1(", "g")
        $0 = gensub(/^([^"]*)\[\s+/, "\\1[", "g")
        $0 = gensub(/(\S)\s+\)([^"]*)$/, "\\1)\\2", "g")
        $0 = gensub(/(\S)\s+\]([^"]*)$/, "\\1]\\2", "g")
    }; {print }' {} \;
done


# Revert changes in defines that would cause redefinition error
sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

Signed-off-by: Jan Tulak <jtulak@redhat.com>
[sandeen: combine 13 patches into 1 commit]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index 4043a9d..99b1d00 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -464,7 +464,7 @@
 	     ptr1->dh_gen,
 	     ptr1->dh_checksum,
 	     ptr1->dh_sz,
-	     ptr1->dh_name );
+	     ptr1->dh_name);
 
 	mlog(MLOG_NITTY, "xlate_direnthdr: post-xlate\n"
 	     "\tdh_ino %llu\n"
@@ -476,7 +476,7 @@
 	     ptr2->dh_gen,
 	     ptr2->dh_checksum,
 	     ptr2->dh_sz,
-	     ptr2->dh_name );
+	     ptr2->dh_name);
 }
 
 /*
@@ -510,7 +510,7 @@
 	     ptr1->dh_gen,
 	     ptr1->dh_sz,
 	     ptr1->dh_checksum,
-	     ptr1->dh_name );
+	     ptr1->dh_name);
 
 	mlog(MLOG_NITTY, "xlate_direnthdr_v1: post-xlate\n"
 	     "\tdh_ino %llu\n"
@@ -522,7 +522,7 @@
 	     ptr2->dh_gen,
 	     ptr2->dh_sz,
 	     ptr2->dh_checksum,
-	     ptr2->dh_name );
+	     ptr2->dh_name);
 }
 
 /*
diff --git a/common/cldmgr.c b/common/cldmgr.c
index 2890092..ecd31f8 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -38,7 +38,7 @@
 
 extern size_t pgsz;
 
-#define CLD_MAX	( STREAM_SIMMAX * 2 )
+#define CLD_MAX	(STREAM_SIMMAX * 2)
 
 typedef enum { C_AVAIL, C_ALIVE, C_EXITED } state_t;
 
@@ -47,50 +47,50 @@
 	int c_exit_code;
 	pthread_t c_tid;
 	ix_t c_streamix;
-	int ( * c_entry )( void *arg1 );
+	int (* c_entry)(void *arg1);
 	void * c_arg1;
 };
 
 typedef struct cld cld_t;
 
-static cld_t cld[ CLD_MAX ];
+static cld_t cld[CLD_MAX];
 static bool_t cldmgr_stopflag;
 
-static cld_t *cldmgr_getcld( void );
-static void *cldmgr_entry( void * );
-static void cldmgr_cleanup( void * );
+static cld_t *cldmgr_getcld(void);
+static void *cldmgr_entry(void *);
+static void cldmgr_cleanup(void *);
 /* REFERENCED */
 static pthread_t cldmgr_parenttid;
 
 bool_t
-cldmgr_init( void )
+cldmgr_init(void)
 {
-	( void )memset( ( void * )cld, 0, sizeof( cld ));
+	(void)memset((void *)cld, 0, sizeof(cld));
 	cldmgr_stopflag = BOOL_FALSE;
-	cldmgr_parenttid = pthread_self( );
+	cldmgr_parenttid = pthread_self();
 
 	return BOOL_TRUE;
 }
 
 bool_t
-cldmgr_create( int ( * entry )( void *arg1 ),
+cldmgr_create(int (* entry)(void *arg1),
 	       ix_t streamix,
 	       char *descstr,
-	       void *arg1 )
+	       void *arg1)
 {
 	cld_t *cldp;
 	int rval;
 
-	assert( pthread_equal( pthread_self( ), cldmgr_parenttid ) );
+	assert(pthread_equal(pthread_self(), cldmgr_parenttid));
 
-	cldp = cldmgr_getcld( );
-	if ( ! cldp ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_PROC, _(
+	cldp = cldmgr_getcld();
+	if (! cldp) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_PROC, _(
 		      "cannot create %s thread for stream %u: "
 		      "too many child threads (max allowed is %d)\n"),
 		      descstr,
 		      streamix,
-		      CLD_MAX );
+		      CLD_MAX);
 		return BOOL_FALSE;
 	}
 
@@ -98,26 +98,26 @@
 	cldp->c_streamix = streamix;
 	cldp->c_entry = entry;
 	cldp->c_arg1 = arg1;
-	rval = pthread_create( &cldp->c_tid, NULL, cldmgr_entry, cldp );
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_PROC, _(
+	rval = pthread_create(&cldp->c_tid, NULL, cldmgr_entry, cldp);
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_PROC, _(
 		      "failed creating %s thread for stream %u: %s\n"),
 		      descstr,
 		      streamix,
-		      strerror( rval ));
+		      strerror(rval));
 	} else {
-		mlog( MLOG_NITTY | MLOG_PROC,
+		mlog(MLOG_NITTY | MLOG_PROC,
 		      "%s thread created for stream %u: tid %lu\n",
 		      descstr,
 		      streamix,
-		      cldp->c_tid );
+		      cldp->c_tid);
 	}
 
 	return rval ? BOOL_FALSE : BOOL_TRUE;
 }
 
 void
-cldmgr_stop( void )
+cldmgr_stop(void)
 {
 	/* must NOT mlog here!
 	 * locked up by main loop dialog
@@ -126,31 +126,31 @@
 }
 
 int
-cldmgr_join( void )
+cldmgr_join(void)
 {
 	cld_t *p = cld;
-	cld_t *ep = cld + sizeof( cld ) / sizeof( cld[ 0 ] );
+	cld_t *ep = cld + sizeof(cld) / sizeof(cld[0]);
 	int xc = EXIT_NORMAL;
 
 	lock();
-	for ( ; p < ep ; p++ ) {
-		if ( p->c_state == C_EXITED ) {
-			if ( ( int )( p->c_streamix ) >= 0 ) {
-				stream_dead( p->c_tid );
+	for (; p < ep ; p++) {
+		if (p->c_state == C_EXITED) {
+			if ((int)(p->c_streamix) >= 0) {
+				stream_dead(p->c_tid);
 			}
-			pthread_join( p->c_tid, NULL );
-			if ( p->c_exit_code != EXIT_NORMAL && xc != EXIT_FAULT )
+			pthread_join(p->c_tid, NULL);
+			if (p->c_exit_code != EXIT_NORMAL && xc != EXIT_FAULT)
 				xc = p->c_exit_code;
-			if ( p->c_exit_code != EXIT_NORMAL ) {
-				mlog( MLOG_DEBUG | MLOG_PROC | MLOG_NOLOCK,
+			if (p->c_exit_code != EXIT_NORMAL) {
+				mlog(MLOG_DEBUG | MLOG_PROC | MLOG_NOLOCK,
 					"child (thread %lu) requested stop: "
 					"exit code %d (%s)\n",
 					p->c_tid, p->c_exit_code,
-					exit_codestring( p->c_exit_code ));
+					exit_codestring(p->c_exit_code));
 			}
 
 			// reinit this child for reuse
-			memset( ( void * )p, 0, sizeof( cld_t ));
+			memset((void *)p, 0, sizeof(cld_t));
 		}
 	}
 	unlock();
@@ -159,96 +159,96 @@
 }
 
 bool_t
-cldmgr_stop_requested( void )
+cldmgr_stop_requested(void)
 {
 	return cldmgr_stopflag;
 }
 
 size_t
-cldmgr_remainingcnt( void )
+cldmgr_remainingcnt(void)
 {
 	cld_t *p = cld;
-	cld_t *ep = cld + sizeof( cld ) / sizeof( cld[ 0 ] );
+	cld_t *ep = cld + sizeof(cld) / sizeof(cld[0]);
 	size_t cnt;
 
 	cnt = 0;
-	lock( );
-	for ( ; p < ep ; p++ ) {
-		if ( p->c_state == C_ALIVE ) {
+	lock();
+	for (; p < ep ; p++) {
+		if (p->c_state == C_ALIVE) {
 			cnt++;
 		}
 	}
-	unlock( );
+	unlock();
 
 	return cnt;
 }
 
 bool_t
-cldmgr_otherstreamsremain( ix_t streamix )
+cldmgr_otherstreamsremain(ix_t streamix)
 {
 	cld_t *p = cld;
-	cld_t *ep = cld + sizeof( cld ) / sizeof( cld[ 0 ] );
+	cld_t *ep = cld + sizeof(cld) / sizeof(cld[0]);
 
-	lock( );
-	for ( ; p < ep ; p++ ) {
-		if ( p->c_state == C_ALIVE && p->c_streamix != streamix ) {
-			unlock( );
+	lock();
+	for (; p < ep ; p++) {
+		if (p->c_state == C_ALIVE && p->c_streamix != streamix) {
+			unlock();
 			return BOOL_TRUE;
 		}
 	}
-	unlock( );
+	unlock();
 
 	return BOOL_FALSE;
 }
 
 static cld_t *
-cldmgr_getcld( void )
+cldmgr_getcld(void)
 {
 	cld_t *p = cld;
-	cld_t *ep = cld + sizeof( cld ) / sizeof( cld[ 0 ] );
+	cld_t *ep = cld + sizeof(cld) / sizeof(cld[0]);
 
 	lock();
-	for ( ; p < ep ; p++ ) {
-		if ( p->c_state == C_AVAIL ) {
+	for (; p < ep ; p++) {
+		if (p->c_state == C_AVAIL) {
 			p->c_state = C_ALIVE;
 			break;
 		}
 	}
 	unlock();
 
-	return ( p < ep ) ? p : 0;
+	return (p < ep) ? p : 0;
 }
 
 static void *
-cldmgr_entry( void *arg1 )
+cldmgr_entry(void *arg1)
 {
-	cld_t *cldp = ( cld_t * )arg1;
-	pthread_t tid = pthread_self( );
+	cld_t *cldp = (cld_t *)arg1;
+	pthread_t tid = pthread_self();
 
-	pthread_cleanup_push( cldmgr_cleanup, arg1 );
+	pthread_cleanup_push(cldmgr_cleanup, arg1);
 
-	if ( ( int )( cldp->c_streamix ) >= 0 ) {
-		stream_register( tid, ( int )cldp->c_streamix );
+	if ((int)(cldp->c_streamix) >= 0) {
+		stream_register(tid, (int)cldp->c_streamix);
 	}
-	mlog( MLOG_DEBUG | MLOG_PROC,
+	mlog(MLOG_DEBUG | MLOG_PROC,
 	      "thread %lu created for stream %d\n",
 	      tid,
-	      cldp->c_streamix );
-	cldp->c_exit_code = ( * cldp->c_entry )( cldp->c_arg1 );
+	      cldp->c_streamix);
+	cldp->c_exit_code = (* cldp->c_entry)(cldp->c_arg1);
 
-	pthread_cleanup_pop( 1 );
+	pthread_cleanup_pop(1);
 
 	return NULL;
 }
 
 static void
-cldmgr_cleanup( void *arg1 )
+cldmgr_cleanup(void *arg1)
 {
-	cld_t *cldp = ( cld_t * )arg1;
+	cld_t *cldp = (cld_t *)arg1;
 
 	lock();
 	cldp->c_state = C_EXITED;
 	// signal the main thread to look for exited threads
-	kill( getpid( ), SIGUSR1 );
+	kill(getpid(), SIGUSR1);
 	unlock();
 }
diff --git a/common/cldmgr.h b/common/cldmgr.h
index c3384fa..ce3a382 100644
--- a/common/cldmgr.h
+++ b/common/cldmgr.h
@@ -24,39 +24,39 @@
 /* cldmgr_init - initializes child management
  * returns FALSE if trouble encountered.
  */
-extern bool_t cldmgr_init( void );
+extern bool_t cldmgr_init(void);
 
 /* cldmgr_create - creates a child thread. returns FALSE if trouble
  * encountered
  */
-extern bool_t cldmgr_create( int ( * entry )( void *arg1 ),
+extern bool_t cldmgr_create(int (* entry)(void *arg1),
 			     ix_t streamix,
 			     char *descstr,
-			     void *arg1 );
+			     void *arg1);
 
 /* cldmgr_stop - asks all children to gracefully terminate, at the next
  * convenient point in their normal processing loop.
  */
-extern void cldmgr_stop( void );
+extern void cldmgr_stop(void);
 
 /* cldmgr_join - join child threads that have exited.
  * returns EXIT_NORMAL if all exited normally (or no threads have exited),
  * EXIT_FAULT if any threads requested a core dump, or another EXIT_*
  * value if any threads exited abnormally.
  */
-extern int cldmgr_join( void );
+extern int cldmgr_join(void);
 
 /* cldmgr_stop_requested - returns TRUE if the child should gracefully
  * terminate.
  */
-extern bool_t cldmgr_stop_requested( void );
+extern bool_t cldmgr_stop_requested(void);
 
 /* cldmgr_remainingcnt - returns number of children remaining
  */
-extern size_t cldmgr_remainingcnt( void );
+extern size_t cldmgr_remainingcnt(void);
 
 /* checks if any children serving any other streams are still alive
  */
-extern bool_t cldmgr_otherstreamsremain( ix_t streamix );
+extern bool_t cldmgr_otherstreamsremain(ix_t streamix);
 
 #endif /* CLDMGR_H */
diff --git a/common/cleanup.c b/common/cleanup.c
index 45339c6..5248f3c 100644
--- a/common/cleanup.c
+++ b/common/cleanup.c
@@ -22,7 +22,7 @@
 #include "cleanup.h"
 
 struct cu {
-	void ( * cu_funcp )( void *arg1, void *arg2 );
+	void (* cu_funcp)(void *arg1, void *arg2);
 	void *cu_arg1;
 	void *cu_arg2;
 	int  cu_flags;
@@ -39,20 +39,20 @@
 static cu_t *cu_rootp;
 
 void
-cleanup_init( void )
+cleanup_init(void)
 {
 	cu_rootp = 0;
 }
 
 static cleanup_t *
-cleanup_register_base( void ( * funcp )( void *arg1, void *arg2 ),
+cleanup_register_base(void (* funcp)(void *arg1, void *arg2),
 		  void *arg1,
-		  void *arg2 )
+		  void *arg2)
 {
 	cu_t *p;
 
-	p = ( cu_t * )calloc( 1, sizeof( cu_t ));
-	assert( p );
+	p = (cu_t *)calloc(1, sizeof(cu_t));
+	assert(p);
 	p->cu_funcp = funcp;
 	p->cu_arg1 = arg1;
 	p->cu_arg2 = arg2;
@@ -60,85 +60,85 @@
 	p->cu_nextp = cu_rootp;
 	cu_rootp = p;
 
-	return ( cleanup_t *)p;
+	return (cleanup_t *)p;
 }
 
 cleanup_t *
-cleanup_register( void ( * funcp )( void *arg1, void *arg2 ),
+cleanup_register(void (* funcp)(void *arg1, void *arg2),
 		  void *arg1,
-		  void *arg2 )
+		  void *arg2)
 {
 	cu_t *p;
 
-	p = cleanup_register_base( funcp, arg1, arg2 );
+	p = cleanup_register_base(funcp, arg1, arg2);
 
-	return ( cleanup_t *)p;
+	return (cleanup_t *)p;
 }
 
 cleanup_t *
-cleanup_register_early( void ( * funcp )( void *arg1, void *arg2 ),
+cleanup_register_early(void (* funcp)(void *arg1, void *arg2),
 		  void *arg1,
-		  void *arg2 )
+		  void *arg2)
 {
 	cu_t *p;
 
-	p = cleanup_register_base( funcp, arg1, arg2 );
+	p = cleanup_register_base(funcp, arg1, arg2);
 	p->cu_flags = CU_EARLY;
 
-	return ( cleanup_t *)p;
+	return (cleanup_t *)p;
 }
 
 void
-cleanup_cancel( cleanup_t *cleanupp )
+cleanup_cancel(cleanup_t *cleanupp)
 {
-	cu_t *p = ( cu_t *)cleanupp;
+	cu_t *p = (cu_t *)cleanupp;
 	cu_t *nextp;
 	cu_t *prevp;
 
-	assert( cu_rootp );
+	assert(cu_rootp);
 
-	for ( prevp = 0, nextp = cu_rootp
+	for (prevp = 0, nextp = cu_rootp
 	      ;
 	      nextp && nextp != p
 	      ;
-	      prevp = nextp, nextp = nextp->cu_nextp )
+	      prevp = nextp, nextp = nextp->cu_nextp)
 	;
 
-	assert( nextp );
-	if ( prevp ) {
+	assert(nextp);
+	if (prevp) {
 		prevp->cu_nextp = p->cu_nextp;
 	} else {
 		cu_rootp = p->cu_nextp;
 	}
-	free( ( void * )p );
+	free((void *)p);
 }
 
 void
-cleanup( void )
+cleanup(void)
 {
-	while ( cu_rootp ) {
+	while (cu_rootp) {
 		cu_t *p = cu_rootp;
-		( * p->cu_funcp )( p->cu_arg1, p->cu_arg2 );
+		(* p->cu_funcp)(p->cu_arg1, p->cu_arg2);
 		cu_rootp = p->cu_nextp;
-		free( ( void * )p );
+		free((void *)p);
 	}
 }
 
 void
-cleanup_early( void )
+cleanup_early(void)
 {
 	cu_t *cuptr, *cuprevp;
 
 	cuptr = cu_rootp;
 	cuprevp = NULL;
 
-	while ( cuptr ) {
+	while (cuptr) {
 		cu_t *cunextp = cuptr->cu_nextp;
 
-		if ( cuptr->cu_flags & CU_EARLY) {
-			( * cuptr->cu_funcp )( cuptr->cu_arg1, cuptr->cu_arg2 );
-			free( ( void * )cuptr );
-			if ( cuprevp )  {
+		if (cuptr->cu_flags & CU_EARLY) {
+			(* cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2);
+			free((void *)cuptr);
+			if (cuprevp)  {
 				cuprevp->cu_nextp = cunextp;
 			} else {
 				cu_rootp = cunextp;
diff --git a/common/cleanup.h b/common/cleanup.h
index a54f9db..1cf55d9 100644
--- a/common/cleanup.h
+++ b/common/cleanup.h
@@ -24,20 +24,20 @@
 
 typedef void cleanup_t;
 
-extern void cleanup_init( void );
+extern void cleanup_init(void);
 
-extern cleanup_t *cleanup_register( void ( *funcp )( void *arg1, void *arg2 ),
+extern cleanup_t *cleanup_register(void (*funcp)(void *arg1, void *arg2),
 				    void *arg1,
-				    void *arg2 );
+				    void *arg2);
 
 extern cleanup_t *cleanup_register_early(
-				    void ( *funcp )( void *arg1, void *arg2 ),
+				    void (*funcp)(void *arg1, void *arg2),
 				    void *arg1,
-				    void *arg2 );
+				    void *arg2);
 
-extern void cleanup_cancel( cleanup_t *cleanupp );
+extern void cleanup_cancel(cleanup_t *cleanupp);
 
-extern void cleanup( void );
-extern void cleanup_early( void );
+extern void cleanup(void);
+extern void cleanup_early(void);
 
 #endif /* CLEANUP_H */
diff --git a/common/content.h b/common/content.h
index c947474..dd858e0 100644
--- a/common/content.h
+++ b/common/content.h
@@ -32,30 +32,30 @@
  * argument of the co_begin_write() operator will be stuffed into the
  * upper layer info, and extracted for the upper layer by co_begin_read().
  */
-#define CONTENT_HDR_SZ		sizeofmember( media_hdr_t, mh_upper )
+#define CONTENT_HDR_SZ		sizeofmember(media_hdr_t, mh_upper)
 #define CONTENT_HDR_FSTYPE_SZ	16
 #define CONTENT_STATSZ		160 /* must match dlog.h DLOG_MULTI_STATSZ */
 
 struct content_hdr {
-	char ch_mntpnt[ GLOBAL_HDR_STRING_SZ ];		/* 100  100 */
+	char ch_mntpnt[GLOBAL_HDR_STRING_SZ];		/* 100  100 */
 		/* full pathname of fs mount point */
-	char ch_fsdevice[ GLOBAL_HDR_STRING_SZ ];	/* 100  200 */
+	char ch_fsdevice[GLOBAL_HDR_STRING_SZ];	/* 100  200 */
 		/* full pathname of char device containing fs */
 	char  ch_pad1[GLOBAL_HDR_STRING_SZ];		/* 100  300 */
 		/* in case another label is needed */
-	char ch_fstype[ CONTENT_HDR_FSTYPE_SZ ];	/*  10  310 */
+	char ch_fstype[CONTENT_HDR_FSTYPE_SZ];	/*  10  310 */
 		/* from fsid.h */
 	uuid_t ch_fsid;					/*  10  320 */
 		/* file system uuid */
-	char  ch_pad2[ GLOBAL_HDR_UUID_SZ ];		/*  10  330 */
+	char  ch_pad2[GLOBAL_HDR_UUID_SZ];		/*  10  330 */
 		/* in case another id is needed */
-	char ch_pad3[ 8 ];				/*   8  338 */
+	char ch_pad3[8];				/*   8  338 */
 		/* padding */
 	int32_t ch_strategyid;				/*   4  33c */
 		/* ID of the content strategy used to produce this dump */
-	char ch_pad4[ 4 ];				/*   4  340 */
+	char ch_pad4[4];				/*   4  340 */
 		/* alignment */
-	char ch_specific[ 0xc0 ];			/*  c0  400 */
+	char ch_specific[0xc0];			/*  c0  400 */
 		/* content strategy-specific info */
 };
 
@@ -84,13 +84,13 @@
 #endif /* DUMP */
 
 #ifdef DUMP
-extern bool_t content_init( int argc,
-			    char *argv[ ],
-			    global_hdr_t *gwhdrtemplatep );
+extern bool_t content_init(int argc,
+			    char *argv[],
+			    global_hdr_t *gwhdrtemplatep);
 	/* prepares for multi-stream dump
 	 */
 
-extern int content_stream_dump( ix_t strmix );
+extern int content_stream_dump(ix_t strmix);
 	/* does stream dump
 	 */
 
@@ -98,37 +98,37 @@
 #ifdef RESTORE
 extern size_t perssz;
 
-extern bool_t content_init( int argc, char *argv[ ], size64_t vmsz );
+extern bool_t content_init(int argc, char *argv[], size64_t vmsz);
 	/* prepares for multi-thread restore
 	 */
 
-extern int content_stream_restore( ix_t thrdix );
+extern int content_stream_restore(ix_t thrdix);
 	/* does thread restore
 	 */
 
-extern bool_t content_overwrite_ok( char *path,
+extern bool_t content_overwrite_ok(char *path,
 				    int32_t ctime,
 				    int32_t mtime,
 				    char **reasonstrp,
-				    bool_t *exists );
+				    bool_t *exists);
 	/* called by tree to ask if ok to overwrite file
 	 */
 
-extern void content_showinv( void );
+extern void content_showinv(void);
 	/* displays inventory of dump session being restored,
 	 * in the context of a second-level dialog
 	 */
 
-extern void content_showremainingobjects( void );
+extern void content_showremainingobjects(void);
 	/* displays info on media objects remaining to be restored.
 	 */
 #endif /* RESTORE */
 
-extern bool_t content_complete( void );
+extern bool_t content_complete(void);
 	/* cleanup: called from main thread. returns TRUE if complete
 	 */
 
-extern size_t content_statline( char **lines[ ] );
+extern size_t content_statline(char **lines[]);
 	/* supplies status line for main keyboard intr dialog
 	 * returns by ref an array of character strings, and the length
 	 * of the array is returned by value.
@@ -138,7 +138,7 @@
 	/* queried by main thread to decide if interupt dialog needed
 	 * for media change confirmation.
 	 */
-extern char *content_mediachange_query( void );
+extern char *content_mediachange_query(void);
 	/* invoked by main thread sigint dialog to allow operator to
 	 * confirm media changes and ask what media objects remain
 	 */
diff --git a/common/content_common.c b/common/content_common.c
index 8f84e56..78d14ed 100644
--- a/common/content_common.c
+++ b/common/content_common.c
@@ -44,19 +44,19 @@
 #define DLOG_TIMEOUT	3600
 
 bool_t
-Media_prompt_change( drive_t *drivep )
+Media_prompt_change(drive_t *drivep)
 {
 	fold_t fold;
-	char question[ 100 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char question[100];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -65,31 +65,31 @@
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, _("change media dialog"), '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, _("change media dialog"), '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* query: ask if media changed or declined
 	 */
-	sprintf( question, _(
+	sprintf(question, _(
 		 "please change media in "
 		 "drive %u\n"),
-		 (unsigned int)drivep->d_index );
+		 (unsigned int)drivep->d_index);
 	querycnt = 0;
-	querystr[ querycnt++ ] = question;
-	assert( querycnt <= QUERYMAX );
+	querystr[querycnt++] = question;
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = _("media change declined");
+	choicestr[choicecnt++ ] = _("media change declined");
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = _("media changed");
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++ ] = _("media changed");
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -101,43 +101,43 @@
 				       dontix,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = _("examining new media\n");
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = _("media change aborted\n");
+	if (responseix == doix) {
+		ackstr[ackcnt++ ] = _("examining new media\n");
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++ ] = _("media change aborted\n");
 	} else {
-		assert( responseix == sigintix );
-		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
+		assert(responseix == sigintix);
+		ackstr[ackcnt++ ] = _("keyboard interrupt\n");
 	}
 
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, _("end dialog"), '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, _("end dialog"), '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	if (responseix == sigintix) {
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying media change dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media change dialog\n");
 		goto retry;
 	}
 
diff --git a/common/content_common.h b/common/content_common.h
index 368ac0f..3e5d98b 100644
--- a/common/content_common.h
+++ b/common/content_common.h
@@ -18,6 +18,6 @@
 #ifndef CONTENT_COMMON_H
 #define CONTENT_COMMON_H
 
-extern bool_t Media_prompt_change( drive_t *drivep );
+extern bool_t Media_prompt_change(drive_t *drivep);
 
 #endif /* CONTENT_COMMON_H */
diff --git a/common/content_inode.h b/common/content_inode.h
index 38ba2a3..e1885fd 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -34,7 +34,7 @@
 
 typedef struct startpt startpt_t;
 
-#define STARTPT_FLAGS_END		( 1 << 0 )
+#define STARTPT_FLAGS_END		(1 << 0)
 		/* this startpt indicates that all extents of all files in
 		 * the stream were completely dumped. the other fields
 		 * are meaningless. this will appear only once per dump
@@ -43,7 +43,7 @@
 		 * also used in the strategy-specific portion of the
 		 * content header to qualify the ending point.
 		 */
-#define STARTPT_FLAGS_NULL		( 1 << 1 )
+#define STARTPT_FLAGS_NULL		(1 << 1)
 		/* used to detect if the null file header makes it onto
 		 * media. only necessary after the last file in the stream,
 		 * to allow the end-of-stream flag in the null header to
@@ -63,7 +63,7 @@
 
 /* inode-style specific media file header section
  */
-#define CONTENT_INODE_HDR_SZ  sizeofmember( content_hdr_t, ch_specific )
+#define CONTENT_INODE_HDR_SZ  sizeofmember(content_hdr_t, ch_specific)
 
 struct content_inode_hdr {
 	int32_t cih_mediafiletype;			/*   4   4 */
@@ -72,7 +72,7 @@
 		/* dump attributes: see #defines below */
 	int32_t cih_level;				/*   4   c */
 		/* dump level */
-	char pad1[ 4 ];					/*   4  10 */
+	char pad1[4];					/*   4  10 */
 		/* alignment */
 	time32_t cih_last_time;				/*   4  14 */
 		/* if an incremental,time of previous dump at a lesser level */
@@ -102,7 +102,7 @@
 
 	uint64_t cih_inomap_datasz;			/*   8  a8 */
 		/* bytes of non-metadata dumped */
-	char cih_pad2[ CONTENT_INODE_HDR_SZ - 0xa8 ];	/*  18  c0 */
+	char cih_pad2[CONTENT_INODE_HDR_SZ - 0xa8];	/*  18  c0 */
 		/* padding */
 };
 
@@ -116,21 +116,21 @@
 
 /* dump attributes
  */
-#define	CIH_DUMPATTR_SUBTREE			( 1 <<  0 )
-#define	CIH_DUMPATTR_INDEX			( 1 <<  1 )
-#define CIH_DUMPATTR_INVENTORY			( 1 <<  2 )
-#define CIH_DUMPATTR_INCREMENTAL		( 1 <<  3 )
-#define CIH_DUMPATTR_RETRY			( 1 <<  4 )
-#define CIH_DUMPATTR_RESUME			( 1 <<  5 )
-#define CIH_DUMPATTR_INOMAP			( 1 <<  6 )
-#define CIH_DUMPATTR_DIRDUMP			( 1 <<  7 )
-#define CIH_DUMPATTR_FILEHDR_CHECKSUM		( 1 <<  8 )
-#define CIH_DUMPATTR_EXTENTHDR_CHECKSUM		( 1 <<  9 )
-#define CIH_DUMPATTR_DIRENTHDR_CHECKSUM		( 1 << 10 )
-#define CIH_DUMPATTR_DIRENTHDR_GEN		( 1 << 11 )
-#define CIH_DUMPATTR_EXTATTR			( 1 << 12 )
-#define CIH_DUMPATTR_EXTATTRHDR_CHECKSUM	( 1 << 13 )
-#define CIH_DUMPATTR_NOTSELFCONTAINED		( 1 << 14 )
+#define	CIH_DUMPATTR_SUBTREE			(1 <<  0)
+#define	CIH_DUMPATTR_INDEX			(1 <<  1)
+#define CIH_DUMPATTR_INVENTORY			(1 <<  2)
+#define CIH_DUMPATTR_INCREMENTAL		(1 <<  3)
+#define CIH_DUMPATTR_RETRY			(1 <<  4)
+#define CIH_DUMPATTR_RESUME			(1 <<  5)
+#define CIH_DUMPATTR_INOMAP			(1 <<  6)
+#define CIH_DUMPATTR_DIRDUMP			(1 <<  7)
+#define CIH_DUMPATTR_FILEHDR_CHECKSUM		(1 <<  8)
+#define CIH_DUMPATTR_EXTENTHDR_CHECKSUM		(1 <<  9)
+#define CIH_DUMPATTR_DIRENTHDR_CHECKSUM		(1 << 10)
+#define CIH_DUMPATTR_DIRENTHDR_GEN		(1 << 11)
+#define CIH_DUMPATTR_EXTATTR			(1 << 12)
+#define CIH_DUMPATTR_EXTATTRHDR_CHECKSUM	(1 << 13)
+#define CIH_DUMPATTR_NOTSELFCONTAINED		(1 << 14)
 
 
 /* timestruct_t - time structure
@@ -176,10 +176,10 @@
 	uint16_t	bs_projid_lo;	/* low 16 of project id	 2    5a */
 	uint16_t	bs_forkoff;	/* inode fork offset	 2    5c */
 	uint16_t	bs_projid_hi;	/* hi 16 of project id	 2    5e */
-	char		bs_pad[ 10 ];	/* for expansion	 e    68 */
+	char		bs_pad[10];	/* for expansion	 e    68 */
 	uint32_t	bs_dmevmask;	/* DMI event mask        4    6c */
 	uint16_t	bs_dmstate;	/* DMI state info        2    6e */
-	char		bs_pad1[ 18 ];	/* for expansion        12    80 */
+	char		bs_pad1[18];	/* for expansion        12    80 */
 					/* NOTE: old dumps didn't always
 					 * zero first 2 bytes of bs_pad1 */
 };
@@ -201,9 +201,9 @@
 /* extended inode flags that can only be set after all data
  * has been restored to a file.
  */
-#define	POST_DATA_XFLAGS	( XFS_XFLAG_IMMUTABLE |		\
+#define	POST_DATA_XFLAGS	(XFS_XFLAG_IMMUTABLE |		\
 				  XFS_XFLAG_APPEND |		\
-				  XFS_XFLAG_SYNC )
+				  XFS_XFLAG_SYNC)
 
 /* filehdr_t - header placed at the beginning of every dumped file.
  *
@@ -218,28 +218,28 @@
 	int32_t fh_flags;
 	uint32_t fh_checksum;
 	bstat_t fh_stat;
-	char fh_pad2[ FILEHDR_SZ
-		      - sizeof( int64_t )
-		      - sizeof( int32_t )
-		      - sizeof( uint32_t )
-		      - sizeof( bstat_t ) ];
+	char fh_pad2[FILEHDR_SZ
+		      - sizeof(int64_t)
+		      - sizeof(int32_t)
+		      - sizeof(uint32_t)
+		      - sizeof(bstat_t)];
 };
 
 typedef struct filehdr filehdr_t;
 
-#define FILEHDR_FLAGS_NULL	( 1 << 0 )
+#define FILEHDR_FLAGS_NULL	(1 << 0)
 		/* identifies a dummy file header. every media file
 		 * is terminated with a dummy file header, unless
 		 * terminated by end of media.
 		 */
-#define FILEHDR_FLAGS_CHECKSUM	( 1 << 1 )
+#define FILEHDR_FLAGS_CHECKSUM	(1 << 1)
 		/* indicates the header checksum is valid
 		 */
-#define FILEHDR_FLAGS_END	( 1 << 2 )
+#define FILEHDR_FLAGS_END	(1 << 2)
 		/* the last media file in the stream is always terminated by
 		 * a dummy file header, with this flag set.
 		 */
-#define FILEHDR_FLAGS_EXTATTR	( 1 << 3 )
+#define FILEHDR_FLAGS_EXTATTR	(1 << 3)
 		/* special file header followed by one file's (dir or nondir)
 		 * extended attributes.
 		 */
@@ -261,7 +261,7 @@
 	int32_t eh_type;
 	int32_t eh_flags;
 	uint32_t eh_checksum;
-	char eh_pad[ 4 ];
+	char eh_pad[4];
 };
 
 typedef struct extenthdr extenthdr_t;
@@ -285,7 +285,7 @@
 		 * hole extent length.
 		 */
 
-#define EXTENTHDR_FLAGS_CHECKSUM	( 1 << 0 )
+#define EXTENTHDR_FLAGS_CHECKSUM	(1 << 0)
 
 
 /* direnthdr_t - placed at the beginning of every dumped directory entry.
@@ -309,7 +309,7 @@
 	gen_t dh_gen;
 	uint32_t dh_checksum;
 	uint16_t dh_sz; /* overall size of record */
-	char dh_name[ 6 ];
+	char dh_name[6];
 };
 
 typedef struct direnthdr direnthdr_t;
@@ -323,7 +323,7 @@
 	uint16_t dh_gen; /* generation count & DENTGENMASK of ref'ed inode */
 	uint16_t dh_sz; /* overall size of record */
 	uint32_t dh_checksum;
-	char dh_name[ 8 ];
+	char dh_name[8];
 };
 
 typedef struct direnthdr_v1 direnthdr_v1_t;
@@ -331,8 +331,8 @@
 /* truncated generation count
  */
 #define DENTGENSZ		12	/* leave 4 bits for future flags */
-#define DENTGENMASK		(( 1 << DENTGENSZ ) - 1 )
-#define BIGGEN2GEN( bg )	( ( gen_t )( bg & DENTGENMASK ))
+#define DENTGENMASK		((1 << DENTGENSZ) - 1)
+#define BIGGEN2GEN(bg)	((gen_t)(bg & DENTGENMASK))
 
 
 
@@ -362,21 +362,21 @@
 
 typedef struct extattrhdr extattrhdr_t;
 
-#define EXTATTRHDR_FLAGS_ROOT		( 1 << 0 )
+#define EXTATTRHDR_FLAGS_ROOT		(1 << 0)
 	/* a "root" mode attribute
 	 */
-#define EXTATTRHDR_FLAGS_NULL		( 1 << 1 )
+#define EXTATTRHDR_FLAGS_NULL		(1 << 1)
 	/* marks the end of the attributes associated with the leading filehdr_t
 	 */
-#define EXTATTRHDR_FLAGS_OLD_CHECKSUM	( 1 << 2 )
+#define EXTATTRHDR_FLAGS_OLD_CHECKSUM	(1 << 2)
 	/* old xfsdumps used this flag to indicate a checksum is present,
 	 * but the checksum was not calculated properly. the presence of
 	 * this flag now indicates a checksum that cannot be verified.
 	 */
-#define EXTATTRHDR_FLAGS_SECURE		( 1 << 3 )
+#define EXTATTRHDR_FLAGS_SECURE		(1 << 3)
 	/* a linux "secure" mode attribute
 	 */
-#define EXTATTRHDR_FLAGS_CHECKSUM	( 1 << 4 )
+#define EXTATTRHDR_FLAGS_CHECKSUM	(1 << 4)
 	/* checksum is present.
 	 */
 
diff --git a/common/dlog.c b/common/dlog.c
index 77364a3..3626568 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -42,7 +42,7 @@
 
 static sigset_t dlog_registered_sigs;
 
-static bool_t promptinput( char *buf,
+static bool_t promptinput(char *buf,
 			   size_t bufsz,
 			   ix_t *exceptionixp,
 			   time32_t timeout,
@@ -50,17 +50,17 @@
 			   ix_t sigintix,
 			   ix_t sighupix,
 			   ix_t sigquitix,
-			   char *fmt, ... );
-static void dlog_string_query_print( void *ctxp, char *fmt, ... );
+			   char *fmt, ...);
+static void dlog_string_query_print(void *ctxp, char *fmt, ...);
 
 bool_t
-dlog_init( int argc, char *argv[ ] )
+dlog_init(int argc, char *argv[])
 {
 	int c;
 
 	/* can only call once
 	 */
-	assert( dlog_ttyfd == -1 );
+	assert(dlog_ttyfd == -1);
 
 	/* initially allow dialog, use stdin fd
 	 */
@@ -68,15 +68,15 @@
 	dlog_allowed_flag = BOOL_TRUE;
 	dlog_timeouts_flag = BOOL_TRUE;
 
-	sigemptyset( &dlog_registered_sigs );
+	sigemptyset(&dlog_registered_sigs);
 
 	/* look for command line option claiming the operator knows
 	 * what's up.
 	 */
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_FORCE:
 			dlog_ttyfd = -1;
 			dlog_allowed_flag = BOOL_FALSE;
@@ -90,9 +90,9 @@
 	/* look to see if restore source coming in on
 	 * stdin. If so , try to open /dev/tty for dialogs.
 	 */
-	if ( optind < argc && ! strcmp( argv[ optind ], "-" )) {
-		dlog_ttyfd = open( "/dev/tty", O_RDWR );
-		if ( dlog_ttyfd < 0 ) {
+	if (optind < argc && ! strcmp(argv[optind ], "-")) {
+		dlog_ttyfd = open("/dev/tty", O_RDWR);
+		if (dlog_ttyfd < 0) {
 			perror("/dev/tty");
 			dlog_ttyfd = -1;
 			dlog_allowed_flag = BOOL_FALSE;
@@ -103,22 +103,22 @@
 #ifdef CHKSTDIN
 	/* if stdin is not a tty, don't allow dialogs
 	 */
-	if ( dlog_allowed_flag ) {
+	if (dlog_allowed_flag) {
 		struct stat statbuf;
 		int rval;
 
-		assert( dlog_ttyfd >= 0 );
-		rval = fstat( dlog_ttyfd, &statbuf );
-		if ( rval ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING,
+		assert(dlog_ttyfd >= 0);
+		rval = fstat(dlog_ttyfd, &statbuf);
+		if (rval) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING,
 			      _("could not fstat stdin (fd %d): %s (%d)\n"),
 			      dlog_ttyfd,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 		} else {
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "stdin mode 0x%x\n",
-			      statbuf.st_mode );
+			      statbuf.st_mode);
 		}
 	}
 #endif /* CHKSTDIN */
@@ -127,51 +127,51 @@
 }
 
 bool_t
-dlog_allowed( void )
+dlog_allowed(void)
 {
 	return dlog_allowed_flag;
 }
 
 void
-dlog_desist( void )
+dlog_desist(void)
 {
 	dlog_allowed_flag = BOOL_FALSE;
 }
 
 int
-dlog_fd( void )
+dlog_fd(void)
 {
 	return dlog_ttyfd;
 }
 
 void
-dlog_begin( char *preamblestr[ ], size_t preamblecnt )
+dlog_begin(char *preamblestr[], size_t preamblecnt)
 {
 	size_t ix;
 
-	mlog_lock( );
-	for ( ix = 0 ; ix < preamblecnt ; ix++ ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-		      preamblestr[ ix ] );
+	mlog_lock();
+	for (ix = 0 ; ix < preamblecnt ; ix++) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      preamblestr[ix]);
 	}
 }
 
 void
-dlog_end( char *postamblestr[ ], size_t postamblecnt )
+dlog_end(char *postamblestr[], size_t postamblecnt)
 {
 	size_t ix;
 
-	for ( ix = 0 ; ix < postamblecnt ; ix++ ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-		      postamblestr[ ix ] );
+	for (ix = 0 ; ix < postamblecnt ; ix++) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      postamblestr[ix]);
 	}
-	mlog_unlock( );
+	mlog_unlock();
 }
 
 ix_t
-dlog_multi_query( char *querystr[ ],
+dlog_multi_query(char *querystr[],
 		  size_t querycnt,
-		  char *choicestr[ ],
+		  char *choicestr[],
 		  size_t choicecnt,
 		  char *hilitestr,
 		  size_t hiliteix,
@@ -181,64 +181,64 @@
 		  ix_t timeoutix,
 		  ix_t sigintix,
 		  ix_t sighupix,
-		  ix_t sigquitix )
+		  ix_t sigquitix)
 {
 	size_t ix;
-	char buf[ 100 ];
+	char buf[100];
 	char *prepromptstr;
 
 	/* sanity
 	 */
-	assert( dlog_allowed_flag );
+	assert(dlog_allowed_flag);
 
 	/* display query description strings
 	 */
-	for ( ix = 0 ; ix < querycnt ; ix++ ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-		      querystr[ ix ] );
+	for (ix = 0 ; ix < querycnt ; ix++) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      querystr[ix]);
 	}
 
 	/* display the choices: NOTE: display is 1-based, code intfs 0-based!
 	 */
-	for ( ix = 0 ; ix < choicecnt ; ix++ ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+	for (ix = 0 ; ix < choicecnt ; ix++) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      "%u: %s",
 		      ix + 1,
-		      choicestr[ ix ] );
-		if ( ix == hiliteix ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      choicestr[ix]);
+		if (ix == hiliteix) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 			      "%s",
-			      hilitestr ?  hilitestr : " *" );
+			      hilitestr ?  hilitestr : " *");
 		}
-		if ( ix == defaultix ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		if (ix == defaultix) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 			      "%s",
-			      defaultstr ?  defaultstr : _(" (default)") );
+			      defaultstr ?  defaultstr : _(" (default)"));
 		}
-		if ( dlog_timeouts_flag
+		if (dlog_timeouts_flag
 		     &&
 		     timeoutix != IXMAX
 		     &&
-		     ix == timeoutix ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		     ix == timeoutix) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 			      _(" (timeout in %u sec)"),
-			      timeout );
+			      timeout);
 		}
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-		      "\n" );
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      "\n");
 	}
 
 	/* read the tty until we get a proper answer or are interrupted
 	 */
 	prepromptstr = "";
-	for ( ; ; ) {
+	for (; ;) {
 		ix_t exceptionix;
 		bool_t ok;
 
 		/* prompt and accept input
 		 */
-		ok = promptinput( buf,
-				  sizeof( buf ),
+		ok = promptinput(buf,
+				  sizeof(buf),
 				  &exceptionix,
 				  timeout,
 				  timeoutix,
@@ -246,17 +246,17 @@
 				  sighupix,
 				  sigquitix,
 				  prepromptstr,
-				  choicecnt );
-		if ( ok ) {
+				  choicecnt);
+		if (ok) {
 			long int val;
 			char *end = buf;
 
-			if ( ! strlen( buf )) {
+			if (! strlen(buf)) {
 				return defaultix;
 			}
 
-			val = strtol( buf, &end, 10 );
-			if ( *end != '\0' || val < 1 || val > choicecnt ) {
+			val = strtol(buf, &end, 10);
+			if (*end != '\0' || val < 1 || val > choicecnt) {
 				prepromptstr = _(
 				      "please enter a value "
 				      "between 1 and %d inclusive ");
@@ -271,18 +271,18 @@
 }
 
 void
-dlog_multi_ack( char *ackstr[ ], size_t ackcnt )
+dlog_multi_ack(char *ackstr[], size_t ackcnt)
 {
 	size_t ix;
 
-	for ( ix = 0 ; ix < ackcnt ; ix++ ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-		      ackstr[ ix ] );
+	for (ix = 0 ; ix < ackcnt ; ix++) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      ackstr[ix]);
 	}
 }
 
 ix_t
-dlog_string_query( dlog_ucbp_t ucb, /* user's print func */
+dlog_string_query(dlog_ucbp_t ucb, /* user's print func */
 		   void *uctxp,	  /* user's context for above */
 		   char *bufp,	  /* typed string returned in */
 		   size_t bufsz,	  /* buffer size */
@@ -291,35 +291,35 @@
 		   ix_t sigintix,
 		   ix_t sighupix,
 		   ix_t sigquitix,
-		   ix_t okix )
+		   ix_t okix)
 {
 	ix_t exceptionix;
 	bool_t ok;
 
 	/* sanity
 	 */
-	assert( dlog_allowed_flag );
+	assert(dlog_allowed_flag);
 
 	/* call the caller's callback with his context, print context, and
 	 * print operator
 	 */
-	( * ucb )( uctxp, dlog_string_query_print, 0 );
+	(* ucb)(uctxp, dlog_string_query_print, 0);
 
 	/* if called for, print the timeout and a newline.
 	 * if not, print just a newline
 	 */
-	if ( dlog_timeouts_flag && timeoutix != IXMAX ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+	if (dlog_timeouts_flag && timeoutix != IXMAX) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      _(" (timeout in %u sec)\n"),
-		      timeout );
+		      timeout);
 	} else {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-		      "\n" );
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+		      "\n");
 	}
 
 	/* prompt and accept input
 	 */
-	ok = promptinput( bufp,
+	ok = promptinput(bufp,
 			  bufsz,
 			  &exceptionix,
 			  timeout,
@@ -327,8 +327,8 @@
 			  sigintix,
 			  sighupix,
 			  sigquitix,
-			  "" );
-	if ( ok ) {
+			  "");
+	if (ok) {
 		return okix;
 	} else {
 		return exceptionix;
@@ -336,9 +336,9 @@
 }
 
 void
-dlog_string_ack( char *ackstr[ ], size_t ackcnt )
+dlog_string_ack(char *ackstr[], size_t ackcnt)
 {
-	dlog_multi_ack( ackstr, ackcnt );
+	dlog_multi_ack(ackstr, ackcnt);
 }
 
 /* ok that this is a static, since used under mutual exclusion lock
@@ -346,31 +346,31 @@
 static volatile int dlog_signo_received;
 
 bool_t
-dlog_sighandler( int signo )
+dlog_sighandler(int signo)
 {
-	if ( sigismember( &dlog_registered_sigs, signo ) < 1 )
+	if (sigismember(&dlog_registered_sigs, signo) < 1)
 		return BOOL_FALSE;
 	// only process the first signal
-	sigemptyset( &dlog_registered_sigs );
+	sigemptyset(&dlog_registered_sigs);
 	dlog_signo_received = signo;
 	return BOOL_TRUE;
 }
 
 /* ARGSUSED */
 static void
-dlog_string_query_print( void *ctxp, char *fmt, ... )
+dlog_string_query_print(void *ctxp, char *fmt, ...)
 {
 	va_list args;
 
-	assert( ! ctxp );
+	assert(! ctxp);
 
-	va_start( args, fmt );
-	mlog_va( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, fmt, args );
-	va_end( args );
+	va_start(args, fmt);
+	mlog_va(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, fmt, args);
+	va_end(args);
 }
 
 static bool_t
-promptinput( char *buf,
+promptinput(char *buf,
 	     size_t bufsz,
 	     ix_t *exceptionixp,
 	     time32_t timeout,
@@ -379,34 +379,34 @@
 	     ix_t sighupix,
 	     ix_t sigquitix,
 	     char *fmt,
-	     ... )
+	     ...)
 {
 	va_list args;
-	time32_t now = time( NULL );
+	time32_t now = time(NULL);
 	int nread = -1;
 	sigset_t orig_set;
 	char *bufp = buf;
 
 	/* display the pre-prompt
 	 */
-	va_start( args, fmt );
-	mlog_va( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, fmt, args );
-	va_end( args );
+	va_start(args, fmt);
+	mlog_va(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, fmt, args);
+	va_end(args);
 
 	/* display standard prompt
 	 */
 #ifdef NOTYET
-	if ( dlog_timeouts_flag && timeoutix != IXMAX ) {
-		mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+	if (dlog_timeouts_flag && timeoutix != IXMAX) {
+		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      _("(timeout in %d sec)"),
-		      timeout );
+		      timeout);
 	}
 #endif /* NOTYET */
-	mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, promptstr );
+	mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, promptstr);
 
 	/* set up timeout
 	 */
-	if ( dlog_timeouts_flag && timeoutix != IXMAX ) {
+	if (dlog_timeouts_flag && timeoutix != IXMAX) {
 		timeout += now;
 	} else {
 		timeout = TIMEMAX;
@@ -421,19 +421,19 @@
 	 * signals.
 	 */
 	dlog_signo_received = -1;
-	sigemptyset( &dlog_registered_sigs );
-	if ( sigintix != IXMAX ) {
-		sigaddset( &dlog_registered_sigs, SIGINT );
+	sigemptyset(&dlog_registered_sigs);
+	if (sigintix != IXMAX) {
+		sigaddset(&dlog_registered_sigs, SIGINT);
 	}
-	if ( sighupix != IXMAX ) {
-		sigaddset( &dlog_registered_sigs, SIGHUP );
-		sigaddset( &dlog_registered_sigs, SIGTERM );
+	if (sighupix != IXMAX) {
+		sigaddset(&dlog_registered_sigs, SIGHUP);
+		sigaddset(&dlog_registered_sigs, SIGTERM);
 	}
-	if ( sigquitix != IXMAX ) {
-		sigaddset( &dlog_registered_sigs, SIGQUIT );
+	if (sigquitix != IXMAX) {
+		sigaddset(&dlog_registered_sigs, SIGQUIT);
 	}
 
-	pthread_sigmask( SIG_UNBLOCK, &dlog_registered_sigs, &orig_set );
+	pthread_sigmask(SIG_UNBLOCK, &dlog_registered_sigs, &orig_set);
 
 	/* wait for input, timeout, or interrupt.
 	 * note we come out of the select() frequently in order to
@@ -441,28 +441,28 @@
 	 * the main thread, so we can't rely on the signal waking us
 	 * up from the select().
 	 */
-	while ( now < timeout && dlog_signo_received == -1 && dlog_allowed_flag ) {
+	while (now < timeout && dlog_signo_received == -1 && dlog_allowed_flag) {
 		int rc;
 		fd_set rfds;
 		struct timeval tv = { 0, 100000 }; // 100 ms
 
-		FD_ZERO( &rfds );
-		FD_SET( dlog_ttyfd, &rfds );
+		FD_ZERO(&rfds);
+		FD_SET(dlog_ttyfd, &rfds);
 
-		rc = select( dlog_ttyfd + 1, &rfds, NULL, NULL, &tv );
-		if ( rc > 0 && FD_ISSET( dlog_ttyfd, &rfds ) ) {
-			nread = read( dlog_ttyfd, bufp, bufsz );
-			if ( nread < 0 ) {
+		rc = select(dlog_ttyfd + 1, &rfds, NULL, NULL, &tv);
+		if (rc > 0 && FD_ISSET(dlog_ttyfd, &rfds)) {
+			nread = read(dlog_ttyfd, bufp, bufsz);
+			if (nread < 0) {
 				break; // error handled below
-			} else if ( nread == 0 && buf == bufp ) {
-				mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, "\n" );
+			} else if (nread == 0 && buf == bufp) {
+				mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, "\n");
 				*bufp = 0;
 				break; // no input, return an empty string
-			} else if ( nread > 0 && bufp[nread-1] == '\n' ) {
+			} else if (nread > 0 && bufp[nread-1] == '\n') {
 				// received a full line, chomp the newline
 				bufp[nread-1] = 0;
 				break;
-			} else if ( nread == bufsz ) {
+			} else if (nread == bufsz) {
 				// no more room, truncate and return
 				bufp[nread-1] = 0;
 				break;
@@ -473,47 +473,47 @@
 			bufsz -= nread;
 			nread = -1;
 		}
-		now = time( NULL );
+		now = time(NULL);
 	}
 
 	/* restore signal handling
 	 */
-	pthread_sigmask( SIG_SETMASK, &orig_set, NULL );
-	sigemptyset( &dlog_registered_sigs );
+	pthread_sigmask(SIG_SETMASK, &orig_set, NULL);
+	sigemptyset(&dlog_registered_sigs);
 
 	/* check for timeout or interrupt
 	 */
-	if ( nread < 0 ) {
-		if ( now >= timeout ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-			      _("timeout\n") );
+	if (nread < 0) {
+		if (now >= timeout) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+			      _("timeout\n"));
 			*exceptionixp = timeoutix;
-		} else if ( dlog_signo_received == SIGINT ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-			      _("keyboard interrupt\n") );
+		} else if (dlog_signo_received == SIGINT) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+			      _("keyboard interrupt\n"));
 			mlog_exit_hint(RV_KBD_INTR);
 			*exceptionixp = sigintix;
-		} else if ( dlog_signo_received == SIGHUP ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-			      _("hangup\n") );
+		} else if (dlog_signo_received == SIGHUP) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+			      _("hangup\n"));
 			*exceptionixp = sighupix;
-		} else if ( dlog_signo_received == SIGTERM ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-			      _("terminate\n") );
+		} else if (dlog_signo_received == SIGTERM) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+			      _("terminate\n"));
 			*exceptionixp = sighupix;
-		} else if ( dlog_signo_received == SIGQUIT ) {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
-			      _("keyboard quit\n") );
+		} else if (dlog_signo_received == SIGQUIT) {
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+			      _("keyboard quit\n"));
 			mlog_exit_hint(RV_KBD_INTR);
 			*exceptionixp = sigquitix;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
+			mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 			      _("abnormal dialog termination\n"));
 			*exceptionixp = sigquitix;
 		}
 		return BOOL_FALSE;
 	} else {
-		assert( dlog_signo_received == -1 );
+		assert(dlog_signo_received == -1);
 		*exceptionixp = 0;
 		return BOOL_TRUE;
 	}
diff --git a/common/dlog.h b/common/dlog.h
index 31ed9c2..7f0e41d 100644
--- a/common/dlog.h
+++ b/common/dlog.h
@@ -23,41 +23,41 @@
  * abstracts dialogs with the operator
  */
 
-extern bool_t dlog_init( int argc, char *argv[ ] );
+extern bool_t dlog_init(int argc, char *argv[]);
 
 
 /* tells if dialogs are allowed;
  * will be false if invoked to right of unnamed pipe,
  * or if pipe to left breaks.
  */
-extern bool_t dlog_allowed( void );
+extern bool_t dlog_allowed(void);
 
 
 /* allows signal handler to notify dlog of broken write pipe
  */
-extern void dlog_desist( void );
+extern void dlog_desist(void);
 
 /* returns the dialog tty file descriptor. returns -1 if none
  */
-extern int dlog_fd( void );
+extern int dlog_fd(void);
 
 /* returns BOOL_TRUE if a dialog consumed the given signal
  */
-extern bool_t dlog_sighandler( int signo );
+extern bool_t dlog_sighandler(int signo);
 
 /* bracket a dialog session
  */
-extern void dlog_begin( char *preamblestr[ ], size_t preamblecnt );
-extern void dlog_end( char *postamblestr[ ], size_t postamblecnt );
+extern void dlog_begin(char *preamblestr[], size_t preamblecnt);
+extern void dlog_end(char *postamblestr[], size_t postamblecnt);
 
 
 /* multiple choice question abstraction. if any exception event index
  * set to IXMAX, that event will be ignored. returns index of selected
  * choice, or exception index if exception occured.
  */
-extern ix_t dlog_multi_query( char *querystr[ ],	/* pre-choices output */
+extern ix_t dlog_multi_query(char *querystr[],	/* pre-choices output */
 			      size_t querycnt,		/* length of above */
-			      char *choicestr[ ],	/* choices */
+			      char *choicestr[],	/* choices */
 			      size_t choicecnt,		/* length of above */
 			      char *hilitestr,		/* to distinguish */
 			      ix_t hiliteix,		/* highlighted choice */
@@ -67,8 +67,8 @@
 			      ix_t timeoutix,		/* return if timeout */
 			      ix_t sigintix,		/* return if SIGINT */
 			      ix_t sighupix,		/* return if SIGHUP */
-			      ix_t sigquitix );		/* return if SIGQUIT */
-extern void dlog_multi_ack( char *ackstr[ ], size_t ackcnt );
+			      ix_t sigquitix);		/* return if SIGQUIT */
+extern void dlog_multi_ack(char *ackstr[], size_t ackcnt);
 
 /* call the caller's callback to display whatever, using provided print
  * function, then prompt for and return an arbitrary string. two types
@@ -78,9 +78,9 @@
  * received, sigquitix if SIGQUIT received. if any of the exception indices
  * are set to IXMAX by the caller, those events will be ignored.
  */
-typedef void ( * dlog_pcbp_t )( void *pctxp, char *s, ... );
-typedef void ( * dlog_ucbp_t )( void *uctxp, dlog_pcbp_t pcb, void *pctxp );
-extern ix_t dlog_string_query( dlog_ucbp_t ucb, /* user's print func */
+typedef void (* dlog_pcbp_t)(void *pctxp, char *s, ...);
+typedef void (* dlog_ucbp_t)(void *uctxp, dlog_pcbp_t pcb, void *pctxp);
+extern ix_t dlog_string_query(dlog_ucbp_t ucb, /* user's print func */
 			       void *uctxp,	/* user's context for above */
 			       char *bufp,	/* typed string returned in */
 			       size_t bufsz,	/* buffer size */
@@ -89,7 +89,7 @@
 			       ix_t sigintix,	/* return if SIGINT */
 			       ix_t sighupix,	/* return if SIGHUP */
 			       ix_t sigquitix,  /* return if SIGQUIT */
-			       ix_t okix );     /* return if successful */
-extern void dlog_string_ack( char *ackstr[ ], size_t ackcnt );
+			       ix_t okix);     /* return if successful */
+extern void dlog_string_ack(char *ackstr[], size_t ackcnt);
 
 #endif /* DLOG_H */
diff --git a/common/drive.c b/common/drive.c
index edb63c0..b01b916 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -44,7 +44,7 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
+extern void usage(void);
 extern char *homedir;
 
 /* declare all drive strategies here
@@ -56,10 +56,10 @@
 
 /* forward declarations of locally defined static functions ******************/
 
-static drive_t *drive_alloc( char *, size_t );
-static void drive_allochdrs( drive_t *drivep,
+static drive_t *drive_alloc(char *, size_t);
+static void drive_allochdrs(drive_t *drivep,
 			     global_hdr_t *gwhdrtemplatep,
-			     ix_t driveix );
+			     ix_t driveix);
 
 
 /* definition of locally defined global variables ****************************/
@@ -85,22 +85,22 @@
  * specified on the command line.
  */
 bool_t
-drive_init1( int argc, char *argv[ ] )
+drive_init1(int argc, char *argv[])
 {
 	int c;
 	ix_t driveix;
 
 	/* sanity check asserts
 	 */
-	assert( sizeof( drive_hdr_t ) == DRIVE_HDR_SZ );
+	assert(sizeof(drive_hdr_t) == DRIVE_HDR_SZ);
 
 	/* count drive arguments
 	 */
 	optind = 1;
 	opterr = 0;
 	drivecnt = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_DUMPDEST:
 			drivecnt++;
 			break;
@@ -110,8 +110,8 @@
 	/* allocate an array to hold ptrs to drive descriptors
 	 */
 	if (drivecnt > 0) {
-		drivepp = ( drive_t ** )calloc( drivecnt, sizeof( drive_t * ));
-		assert( drivepp );
+		drivepp = (drive_t **)calloc(drivecnt, sizeof(drive_t *));
+		assert(drivepp);
 	}
 
 	/* initialize the partialmax value.  Each drive can be completing a file
@@ -128,33 +128,33 @@
 	optind = 1;
 	opterr = 0;
 	driveix = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_DUMPDEST:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL,
 				      _("-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 
 			/* allocate a drive descriptor
 			 */
-			drivepp[ driveix ] = drive_alloc( optarg, driveix );
+			drivepp[driveix] = drive_alloc(optarg, driveix);
 			driveix++;
 			break;
 		}
 	}
-	assert( driveix == drivecnt );
+	assert(driveix == drivecnt);
 
 	/* the user may specify stdin as the source, by
 	 * a single dash ('-') with no option letter. This must appear
 	 * between all lettered arguments and the file system pathname.
 	 */
-	if ( optind < argc && ! strcmp( argv[ optind ], "-" )) {
-		if ( driveix > 0 ) {
-			mlog( MLOG_NORMAL,
+	if (optind < argc && ! strcmp(argv[optind ], "-")) {
+		if (driveix > 0) {
+			mlog(MLOG_NORMAL,
 #ifdef DUMP
 			_("cannot specify source files and stdout together\n")
 #endif /* DUMP */
@@ -162,7 +162,7 @@
 			_("cannot specify source files and stdin together\n")
 #endif /* RESTORE */
 			      );
-			usage( );
+			usage();
 			return BOOL_FALSE;
 		}
 
@@ -172,20 +172,20 @@
 		 * Bug #393618 - prasadb 04/16/97
 		 * allocate an array to hold ptrs to drive descriptors
 		 */
-		drivepp = ( drive_t ** )calloc( drivecnt, sizeof( drive_t * ));
-		assert( drivepp );
+		drivepp = (drive_t **)calloc(drivecnt, sizeof(drive_t *));
+		assert(drivepp);
 
-		drivepp[ 0 ] = drive_alloc( "stdio", 0 );
+		drivepp[0 ] = drive_alloc("stdio", 0);
 
 #ifdef DUMP   /* ifdef added around dlog_desist() by prasadb to fix 435626 */
-		dlog_desist( );
+		dlog_desist();
 #endif
 	}
 
 	/* verify that some dump destination(s) / restore source(s) specified
 	 */
-	if ( drivecnt == 0 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
+	if (drivecnt == 0) {
+		mlog(MLOG_NORMAL | MLOG_ERROR,
 #ifdef DUMP
 			_("no destination file(s) specified\n")
 #endif /* DUMP */
@@ -193,43 +193,43 @@
 			_("no source file(s) specified\n")
 #endif /* RESTORE */
 			);
-		usage( );
+		usage();
 		return BOOL_FALSE;
 	}
 
 	/* run each drive past each strategy, pick the best match
 	 * and instantiate a drive manager.
 	 */
-	for ( driveix = 0 ; driveix < drivecnt ; driveix++ ) {
-		drive_t *drivep = drivepp[ driveix ];
+	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+		drive_t *drivep = drivepp[driveix];
 		int bestscore = 0 - INTGENMAX;
 		ix_t six;
-		ix_t scnt = sizeof( strategypp ) / sizeof( strategypp[ 0 ] );
+		ix_t scnt = sizeof(strategypp) / sizeof(strategypp[0]);
 		drive_strategy_t *bestsp = 0;
 		bool_t ok;
 
-		for ( six = 0 ; six < scnt ; six++ ) {
-			drive_strategy_t *sp = strategypp[ six ];
+		for (six = 0 ; six < scnt ; six++) {
+			drive_strategy_t *sp = strategypp[six];
 			int score;
-			score = ( * sp->ds_match )( argc,
+			score = (* sp->ds_match)(argc,
 						    argv,
-						    drivep );
-			if ( ! bestsp || score > bestscore ) {
+						    drivep);
+			if (! bestsp || score > bestscore) {
 				bestsp = sp;
 				bestscore = score;
 			}
 		}
-		assert( bestsp );
+		assert(bestsp);
 		drivep->d_strategyp = bestsp;
 		drivep->d_recmarksep = bestsp->ds_recmarksep;
 		drivep->d_recmfilesz = bestsp->ds_recmfilesz;
-		mlog( MLOG_VERBOSE,
+		mlog(MLOG_VERBOSE,
 		      _("using %s strategy\n"),
-		      bestsp->ds_description );
-		ok = ( * bestsp->ds_instantiate )( argc,
+		      bestsp->ds_description);
+		ok = (* bestsp->ds_instantiate)(argc,
 						   argv,
-						   drivep );
-		if ( ! ok ) {
+						   drivep);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
@@ -245,19 +245,19 @@
  */
 /* ARGSUSED */
 bool_t
-drive_init2( int argc,
-	     char *argv[ ],
-	     global_hdr_t *gwhdrtemplatep )
+drive_init2(int argc,
+	     char *argv[],
+	     global_hdr_t *gwhdrtemplatep)
 {
 	ix_t driveix;
 
-	for ( driveix = 0 ; driveix < drivecnt ; driveix++ ) {
-		drive_t *drivep = drivepp[ driveix ];
+	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+		drive_t *drivep = drivepp[driveix];
 		bool_t ok;
 
-		drive_allochdrs( drivep, gwhdrtemplatep, driveix );
-		ok = ( * drivep->d_opsp->do_init )( drivep );
-		if ( ! ok ) {
+		drive_allochdrs(drivep, gwhdrtemplatep, driveix);
+		ok = (* drivep->d_opsp->do_init)(drivep);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
@@ -270,16 +270,16 @@
  * synchronizes with async operations begun by drive_init2.
  */
 bool_t
-drive_init3( void )
+drive_init3(void)
 {
 	ix_t driveix;
 
-	for ( driveix = 0 ; driveix < drivecnt ; driveix++ ) {
-		drive_t *drivep = drivepp[ driveix ];
+	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+		drive_t *drivep = drivepp[driveix];
 		bool_t ok;
 
-		ok = ( * drivep->d_opsp->do_sync )( drivep );
-		if ( ! ok ) {
+		ok = (* drivep->d_opsp->do_sync)(drivep);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
@@ -294,17 +294,17 @@
  * utility function for use by drive-specific strategies.
  */
 void
-drive_mark_commit( drive_t *drivep, off64_t ncommitted )
+drive_mark_commit(drive_t *drivep, off64_t ncommitted)
 {
 	drive_markrec_t *dmp;
 
-	for ( dmp = drivep->d_markrecheadp
+	for (dmp = drivep->d_markrecheadp
 	;
-	dmp && dmp->dm_log <= ( drive_mark_t )ncommitted
+	dmp && dmp->dm_log <= (drive_mark_t)ncommitted
 	;
 	) {
 		drivep->d_markrecheadp = dmp->dm_nextp;
-		( * dmp->dm_cbfuncp )( dmp->dm_cbcontextp, dmp, BOOL_TRUE );
+		(* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_TRUE);
 		dmp = drivep->d_markrecheadp;
 	}
 }
@@ -314,17 +314,17 @@
  * utility function for use by drive-specific strategies.
  */
 void
-drive_mark_discard( drive_t *drivep )
+drive_mark_discard(drive_t *drivep)
 {
 	drive_markrec_t *dmp;
 
-	for ( dmp = drivep->d_markrecheadp
+	for (dmp = drivep->d_markrecheadp
 	;
 	dmp
 	;
-	drivep->d_markrecheadp = dmp->dm_nextp, dmp = dmp->dm_nextp ) {
+	drivep->d_markrecheadp = dmp->dm_nextp, dmp = dmp->dm_nextp) {
 
-		( * dmp->dm_cbfuncp )( dmp->dm_cbcontextp, dmp, BOOL_FALSE );
+		(* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_FALSE);
 	}
 }
 
@@ -332,15 +332,15 @@
  * to print drive throughput and streaming metrics.
  */
 void
-drive_display_metrics( void )
+drive_display_metrics(void)
 {
 	ix_t driveix;
 
-	for ( driveix = 0 ; driveix < drivecnt ; driveix++ ) {
-		drive_t *drivep = drivepp[ driveix ];
+	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+		drive_t *drivep = drivepp[driveix];
 		drive_ops_t *dop = drivep->d_opsp;
-		if ( dop->do_display_metrics ) {
-			( * dop->do_display_metrics )( drivep );
+		if (dop->do_display_metrics) {
+			(* dop->do_display_metrics)(drivep);
 		}
 	}
 }
@@ -352,30 +352,30 @@
  * descriptor. do NOT allocate hdr buffers.
  */
 static drive_t *
-drive_alloc( char *pathname, ix_t driveix )
+drive_alloc(char *pathname, ix_t driveix)
 {
 	drive_t *drivep;
 	struct stat64 statbuf;
 
 	/* allocate the descriptor
 	 */
-	drivep = ( drive_t * )calloc( 1, sizeof( drive_t ));
-	assert( drivep );
+	drivep = (drive_t *)calloc(1, sizeof(drive_t));
+	assert(drivep);
 
 	/* convert the pathname to an absolute pathname
 	 * NOTE: string "stdio" is reserved to mean send to standard out
 	 */
-	if ( strcmp( pathname, "stdio" )) {
-		pathname = path_reltoabs( pathname, homedir );
+	if (strcmp(pathname, "stdio")) {
+		pathname = path_reltoabs(pathname, homedir);
 	}
 
 	/* set pipe flags
 	 */
-	if ( ! strcmp( pathname, "stdio" )) {
+	if (! strcmp(pathname, "stdio")) {
 		drivep->d_isunnamedpipepr = BOOL_TRUE;
-	} else if ( ! stat64( pathname, &statbuf )
+	} else if (! stat64(pathname, &statbuf)
 		    &&
-		    ( statbuf.st_mode & S_IFMT ) == S_IFIFO ) {
+		    (statbuf.st_mode & S_IFMT) == S_IFIFO) {
 		drivep->d_isnamedpipepr = BOOL_TRUE;
 	}
 
@@ -391,7 +391,7 @@
  * hdrs, and ptrs into the hdrs.
  */
 static void
-drive_allochdrs( drive_t *drivep, global_hdr_t *gwhdrtemplatep, ix_t driveix )
+drive_allochdrs(drive_t *drivep, global_hdr_t *gwhdrtemplatep, ix_t driveix)
 {
 	global_hdr_t *grhdrp;
 	drive_hdr_t *drhdrp;
@@ -400,22 +400,22 @@
 
 	/* allocate the read header
 	 */
-	grhdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
-	assert( grhdrp );
+	grhdrp = (global_hdr_t *)calloc(1, sizeof(global_hdr_t));
+	assert(grhdrp);
 	gwhdrp = NULL;
 	dwhdrp = NULL;
 
 	/* calculate pointer to the drive portion of the read header
 	 */
-	drhdrp = ( drive_hdr_t * )grhdrp->gh_upper;
+	drhdrp = (drive_hdr_t *)grhdrp->gh_upper;
 
 	/* global write hdr used only for dumps. will be NULL for restore
 	 */
-	if ( gwhdrtemplatep ) {
+	if (gwhdrtemplatep) {
 		/* allocate the write header
 		 */
-		gwhdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
-		assert( gwhdrp );
+		gwhdrp = (global_hdr_t *)calloc(1, sizeof(global_hdr_t));
+		assert(gwhdrp);
 
 		/* copy the template
 		 */
@@ -423,7 +423,7 @@
 
 		/* calculate pointer to the drive portion of the read header
 		 */
-		dwhdrp = ( drive_hdr_t * )gwhdrp->gh_upper;
+		dwhdrp = (drive_hdr_t *)gwhdrp->gh_upper;
 
 		/* fill in generic drive fields of write hdr
 		 */
diff --git a/common/drive.h b/common/drive.h
index 37258e0..4b4fcf8 100644
--- a/common/drive.h
+++ b/common/drive.h
@@ -99,7 +99,7 @@
  * CAUTION! the various components of the media file header are carefully
  * crafted to fit in DRIVE_HDR_SZ bytes.
  */
-#define DRIVE_HDR_SZ		sizeofmember( global_hdr_t, gh_upper )
+#define DRIVE_HDR_SZ		sizeofmember(global_hdr_t, gh_upper)
 
 struct drive_hdr {
 	uint32_t dh_drivecnt;				/*   4    4 */
@@ -108,11 +108,11 @@
 		/* 0-based index of the drive used to dump this stream */
 	int32_t dh_strategyid;				/*   4    c */
 		/* ID of the drive strategy used to produce this dump */
-	char dh_pad1[ 0x1f4 ];				/* 1f4  200 */
+	char dh_pad1[0x1f4];				/* 1f4  200 */
 		/* padding */
-	char dh_specific[ 0x200 ];			/* 200  400 */
+	char dh_specific[0x200];			/* 200  400 */
 		/* drive strategy-specific info */
-	char dh_upper[ DRIVE_HDR_SZ - 0x400 ];		/* 800  c00 */
+	char dh_upper[DRIVE_HDR_SZ - 0x400];		/* 800  c00 */
 		/* header info private to upper software layers */
 };
 
@@ -138,15 +138,15 @@
 	char *ds_description;
 		    /* a short char string describing strategy
 		     */
-	int ( * ds_match )( int argc,
-				 char *argv[ ],
-				 struct drive *drivep );
+	int (* ds_match)(int argc,
+				 char *argv[],
+				 struct drive *drivep);
 		    /* returns degree of match. drivep has been pre-allocated
 		     * and initialized with generic info.
 		     */
-	bool_t ( * ds_instantiate )( int argc,
-				     char *argv[ ],
-				     struct drive *drivep );
+	bool_t (* ds_instantiate)(int argc,
+				     char *argv[],
+				     struct drive *drivep);
 		    /* creates a drive manager instance, by filling in the
 		     * blanks of the pre-allocated drive descriptor
 		     * returns FALSE on failure.
@@ -186,9 +186,9 @@
  * was NOT committed.
  */
 struct drive_markrec; /* forward decl */
-typedef void ( * drive_mcbfp_t )( void *context_t,
+typedef void (* drive_mcbfp_t)(void *context_t,
 				  struct drive_markrec *markrecp,
-				  bool_t committed );
+				  bool_t committed);
 
 /* drive_markrec_t - context for set mark callback function
  *
@@ -257,17 +257,17 @@
 typedef struct drive drive_t;
 
 struct drive_ops {
-	bool_t ( * do_init )( drive_t *drivep );
+	bool_t (* do_init)(drive_t *drivep);
 				/* initializes drive, and begins async
 				 * determination of media object presence
 				 * returns FALSE if session should be aborted.
 				 */
-	bool_t ( * do_sync )( drive_t *drivep );
+	bool_t (* do_sync)(drive_t *drivep);
 				/* synchronizes with the activity kicked off
 				 * by do_init. returns FALSE if session should
 				 * be aborted.
 				 */
-	int ( * do_begin_read )( drive_t *drivep );
+	int (* do_begin_read)(drive_t *drivep);
 				/* prepares the drive manager for reading.
 				 * if the media is positioned at BOM or just
 				 * after a file mark, current media file is
@@ -306,10 +306,10 @@
 				 * begin_read. if successful, caller MUST call
 				 * end_read prior to next begin_read.
 				 */
-	char * ( * do_read )( drive_t *drivep,
+	char * (* do_read)(drive_t *drivep,
 			      size_t wanted_bufsz,
 			      size_t *actual_bufszp,
-			      int *statp );
+			      int *statp);
 				/* asks the drive manager for a buffered filled
 				 * with the next read stream data.
 				 * the actual buffer size supplied may
@@ -341,23 +341,23 @@
 				 * valid data (although the buffer size may
 				 * be zero!).
 				 */
-	void ( * do_return_read_buf )( drive_t *drivep,
+	void (* do_return_read_buf)(drive_t *drivep,
 				       char *bufp,
-				       size_t bufsz );
+				       size_t bufsz);
 				/* returns the buffer obtained
 				 * from the previous do_read() call.
 				 * the entire buffer must be returned
 				 * in one shot.
 				 */
-	void ( * do_get_mark )( drive_t *drivep,
-				drive_mark_t *drivemarkp );
+	void (* do_get_mark)(drive_t *drivep,
+				drive_mark_t *drivemarkp);
 				/* returns (by reference) a mark corresponding
 				 * to the next byte which will be read by a
 				 * call to do_read(). will be used in a later
 				 * session to seek to that position.
 				 */
-	int ( * do_seek_mark )( drive_t *drivep,
-				     drive_mark_t *drivemarkp );
+	int (* do_seek_mark)(drive_t *drivep,
+				     drive_mark_t *drivemarkp);
 				/* searches for the specified mark within the
 				 * current file. returns zero if the mark
 				 * was found, or an error explaining why not:
@@ -367,7 +367,7 @@
 				 *	CORRUPTION - encountered corrupt data;
 				 *	DEVICE - device error;
 				 */
-	int ( * do_next_mark )( drive_t *drivep );
+	int (* do_next_mark)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_NEXTMARK set,
 				 * drive has the capability to
 				 * seek forward to the next mark. returns
@@ -378,14 +378,14 @@
 				 *	DEVICE - device error;
 				 * if currently at a mark, will go to the next.
 				 */
-	void ( *do_end_read )( drive_t *drivep );
+	void (*do_end_read)(drive_t *drivep);
 				/* ends the file read. must be called prior
 				 * to beginning another read or write session.
 				 * ensures that the next call to begin_read
 				 * will position the media at the next media
 				 * file.
 				 */
-	int ( * do_begin_write )( drive_t *drivep );
+	int (* do_begin_write)(drive_t *drivep);
 				/* begins a write media file for writing.
 				 * asserts the media is positioned at BOM or
 				 * just after a file mark. write header will
@@ -396,10 +396,10 @@
 				 *	DEVICE - device error;
 				 *	CORE  - driver error
 				 */
-	void ( * do_set_mark )( drive_t *drivep,
+	void (* do_set_mark)(drive_t *drivep,
 				drive_mcbfp_t cbfuncp,
 				void *cbcontextp,
-				drive_markrec_t *markrecp );
+				drive_markrec_t *markrecp);
 				/* marks the position in the write stream
 				 * where the next write will occur.
 				 * At the time the data written
@@ -426,9 +426,9 @@
 				 * last committed marked point in the write
 				 * stream.
 				 */
-	char * ( * do_get_write_buf )( drive_t *drivep,
+	char * (* do_get_write_buf)(drive_t *drivep,
 				       size_t wanted_bufsz,
-				       size_t *actual_bufszp );
+				       size_t *actual_bufszp);
 				/* asks the drive manager for a buffer.
 				 * returns a pointer to a buffer, and its
 				 * size. must call do_write() before
@@ -443,9 +443,9 @@
 				 * be larger or smaller than the wanted bufsz,
 				 * but will be at least 1 byte in length.
 				 */
-	int ( * do_write )( drive_t *drivep,
+	int (* do_write)(drive_t *drivep,
 				 char *bufp,
-				 size_t bufsz );
+				 size_t bufsz);
 				/* asks the drive manager to write bufsz
 				 * bytes from the buffer, which was acquired
 				 * from a previous call to do_get_write_buf().
@@ -473,7 +473,7 @@
 				 * instead, the caller must get another buffer
 				 * using do_get_write_buf().
 				 */
-	size_t ( * do_get_align_cnt )( drive_t *drivep );
+	size_t (* do_get_align_cnt)(drive_t *drivep);
 				/* used during writing. returns the number
 				 * of bytes which should be written to
 				 * page-align the next do_get_write_buf()
@@ -481,7 +481,7 @@
 				 * alignment will be maintained after the
 				 * initial alignment done using this info.
 				 */
-	int ( * do_end_write )( drive_t *drivep, off64_t *ncommittedp );
+	int (* do_end_write)(drive_t *drivep, off64_t *ncommittedp);
 				/* terminates a media file write sequence.
 				 * flushes any buffered data not yet committed
 				 * to media, and calls callbacks for all marks
@@ -502,9 +502,9 @@
 				 * an error, do_end_write will not do any
 				 * I/O, and will return 0.
 				 */
-	int ( * do_fsf )( drive_t *drivep,
+	int (* do_fsf)(drive_t *drivep,
 			      int count,
-			      int *statp );
+			      int *statp);
 				/* if d_capabilities has DRIVE_CAP_FSF set,
 				 * drive has the capability to
 				 * forward space count files. returns the
@@ -528,9 +528,9 @@
 				 * behaves as if position is at most recent
 				 * file mark or BOT.
 				 */
-	int ( * do_bsf )( drive_t *drivep,
+	int (* do_bsf)(drive_t *drivep,
 			       int count,
-			       int *statp );
+			       int *statp);
 				/* if d_capabilities has DRIVE_CAP_BSF set,
 				 * drive has the capability to backward space
 				 * count files. returns the number of actual
@@ -554,35 +554,35 @@
 				 *	BOM - hit beginning of recorded data;
 				 *	DEVICE - device error;
 				 */
-	int ( * do_rewind )( drive_t *drivep );
+	int (* do_rewind)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_REWIND set,
 				 * drive has the capability to
 				 * position at beginning of recorded data
 				 *	DEVICE - device error;
 				 */
-	int ( * do_erase )( drive_t *drivep );
+	int (* do_erase)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_ERASE set,
 				 * drive has the capability to
 				 * erase: all content of media object is
 				 * eradicated.
 				 *	DEVICE - device error;
 				 */
-	int ( * do_eject_media )( drive_t *drivep );
+	int (* do_eject_media)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_EJECT set,
 				 * drive has capability
 				 * to eject media, and will do so when called.
 				 *	DEVICE - device error;
 				 */
-	int ( * do_get_device_class )( drive_t *drivep );
+	int (* do_get_device_class)(drive_t *drivep);
 				/* returns the media class of the device
 				 * (see below).
 				 */
-	void ( * do_display_metrics )( drive_t *drivep );
+	void (* do_display_metrics)(drive_t *drivep);
 				/* use BARE mlog to print useful throughput
 				 * and performance info. set to NULL if
 				 * nothing to say.
 				 */
-	void ( * do_quit )( drive_t * drivep );
+	void (* do_quit)(drive_t * drivep);
 				/* tells the drive manager to de-allocate
 				 * resources, INCLUDING the slave process.
 				 */
@@ -600,18 +600,18 @@
 /* drive capabilities - bit positions in the capabilities mask
  * DO NOT CHANGE: used in dh_capabilities field of scsi drive hdr.
  */
-#define DRIVE_CAP_BSF		( 1 << 0 ) /* can backspace files */
-#define DRIVE_CAP_FSF		( 1 << 1 ) /* can forwardspace files */
-#define DRIVE_CAP_REWIND	( 1 << 2 ) /* can rewind */
-#define DRIVE_CAP_FILES		( 1 << 4 ) /* supports multiple files */
-#define DRIVE_CAP_APPEND	( 1 << 5 ) /* can append to end of rec. data */
-#define DRIVE_CAP_OVERWRITE	( 1 << 6 ) /* can overwrite recorded data */
-#define DRIVE_CAP_ERASE		( 1 << 6 ) /* can erase media */
-#define DRIVE_CAP_NEXTMARK	( 1 << 8 ) /* can seek to a next good mark */
-#define DRIVE_CAP_EJECT		( 1 << 12 ) /* can eject media */
-#define DRIVE_CAP_AUTOREWIND	( 1 << 13 ) /* rewinds on media insertion */
-#define DRIVE_CAP_READ		( 1 << 14 ) /* can read media */
-#define DRIVE_CAP_REMOVABLE	( 1 << 15 ) /* can change media */
+#define DRIVE_CAP_BSF		(1 << 0) /* can backspace files */
+#define DRIVE_CAP_FSF		(1 << 1) /* can forwardspace files */
+#define DRIVE_CAP_REWIND	(1 << 2) /* can rewind */
+#define DRIVE_CAP_FILES		(1 << 4) /* supports multiple files */
+#define DRIVE_CAP_APPEND	(1 << 5) /* can append to end of rec. data */
+#define DRIVE_CAP_OVERWRITE	(1 << 6) /* can overwrite recorded data */
+#define DRIVE_CAP_ERASE		(1 << 6) /* can erase media */
+#define DRIVE_CAP_NEXTMARK	(1 << 8) /* can seek to a next good mark */
+#define DRIVE_CAP_EJECT		(1 << 12) /* can eject media */
+#define DRIVE_CAP_AUTOREWIND	(1 << 13) /* rewinds on media insertion */
+#define DRIVE_CAP_READ		(1 << 14) /* can read media */
+#define DRIVE_CAP_REMOVABLE	(1 << 15) /* can change media */
 
 /* drive manager error codes - interpretation specific to and described
  * in context of use.
@@ -646,7 +646,7 @@
  *
  * Returns FALSE if utility should be aborted.
  */
-extern bool_t drive_init1( int argc, char *argv[] );
+extern bool_t drive_init1(int argc, char *argv[]);
 
 
 /* drive_init2 - allocate and initialize read and write hdr buffers,
@@ -655,35 +655,35 @@
  *
  * Returns FALSE if the session should be aborted.
  */
-extern bool_t drive_init2( int argc,
+extern bool_t drive_init2(int argc,
 			   char *argv[],
-			   global_hdr_t *gwhdrtemplatep );
+			   global_hdr_t *gwhdrtemplatep);
 
 
 /* drive_init3 - synchronize with async activity kicked off by drive_init3.
  *
  * Returns FALSE if the session should be aborted.
  */
-extern bool_t drive_init3( void );
+extern bool_t drive_init3(void);
 
 /* drive_mark_commit - invokes callback for all drive marks committed
  * to media. ncommitted is the number of bytes actually committed to
  * media so far. mark records with a mark offset less than or equal to
  * ncommitted will have their callbacks invoked.
  */
-extern void drive_mark_commit( drive_t *drivep, off64_t ncommitted );
+extern void drive_mark_commit(drive_t *drivep, off64_t ncommitted);
 
 
 /* drive_mark_discard - invokes callback of all uncommitted marks,
  * indicating the commit did not occur.
  */
-extern void drive_mark_discard( drive_t *drivep );
+extern void drive_mark_discard(drive_t *drivep);
 
 
 /* drive_display_metrics - display drive throughput and streaming metrics
  * for all drives
  */
-extern void drive_display_metrics( void );
+extern void drive_display_metrics(void);
 
 
 /* device classes
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 04fed3e..e9be114 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -237,118 +237,118 @@
 /* macros for shortcut references to context. assumes a local variable named
  * 'contextp'.
  */
-#define	tape_recsz	( contextp->dc_recsz )
-#define	tape_blksz	( contextp->dc_blksz )
+#define	tape_recsz	(contextp->dc_recsz)
+#define	tape_blksz	(contextp->dc_blksz)
 
 /* declarations of externally defined global variables ***********************/
 
-extern void usage( void );
+extern void usage(void);
 #ifdef DUMP
 extern uint64_t hdr_mfilesz;
 #endif /* DUMP */
 
 /* remote tape protocol declarations (should be a system header file)
  */
-extern int rmtopen( char *, int, ... );
-extern int rmtclose( int );
-extern int rmtfstat( int, struct stat * );
-extern int rmtioctl( int, int, ... );
-extern int rmtread( int, void*, uint);
-extern int rmtwrite( int, const void *, uint);
+extern int rmtopen(char *, int, ...);
+extern int rmtclose(int);
+extern int rmtfstat(int, struct stat *);
+extern int rmtioctl(int, int, ...);
+extern int rmtread(int, void*, uint);
+extern int rmtwrite(int, const void *, uint);
 
 
 /* forward declarations of locally defined static functions ******************/
 
 /* strategy functions
  */
-static int ds_match( int, char *[], drive_t * );
-static int ds_instantiate( int, char *[], drive_t * );
+static int ds_match(int, char *[], drive_t *);
+static int ds_instantiate(int, char *[], drive_t *);
 
 /* manager operations
  */
-static bool_t do_init( drive_t * );
-static bool_t do_sync( drive_t * );
-static int do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, int * );
-static void do_return_read_buf( drive_t *, char *, size_t );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static int do_seek_mark( drive_t *, drive_mark_t * );
-static int do_next_mark( drive_t * );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static void do_end_read( drive_t * );
-static int do_begin_write( drive_t * );
-static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
-static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static int do_write( drive_t *, char *, size_t );
-static size_t do_get_align_cnt( drive_t * );
-static int do_end_write( drive_t *, off64_t * );
-static int do_fsf( drive_t *, int , int *);
-static int do_bsf( drive_t *, int , int *);
-static int do_rewind( drive_t * );
-static int do_erase( drive_t * );
-static int do_eject_media( drive_t * );
-static int do_get_device_class( drive_t * );
-static void do_display_metrics( drive_t *drivep );
-static void do_quit( drive_t * );
+static bool_t do_init(drive_t *);
+static bool_t do_sync(drive_t *);
+static int do_begin_read(drive_t *);
+static char *do_read(drive_t *, size_t , size_t *, int *);
+static void do_return_read_buf(drive_t *, char *, size_t);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static int do_seek_mark(drive_t *, drive_mark_t *);
+static int do_next_mark(drive_t *);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static void do_end_read(drive_t *);
+static int do_begin_write(drive_t *);
+static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
+static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static int do_write(drive_t *, char *, size_t);
+static size_t do_get_align_cnt(drive_t *);
+static int do_end_write(drive_t *, off64_t *);
+static int do_fsf(drive_t *, int , int *);
+static int do_bsf(drive_t *, int , int *);
+static int do_rewind(drive_t *);
+static int do_erase(drive_t *);
+static int do_eject_media(drive_t *);
+static int do_get_device_class(drive_t *);
+static void do_display_metrics(drive_t *drivep);
+static void do_quit(drive_t *);
 
 /* misc. local utility funcs
  */
-static int	mt_op(int , int , int );
-static int determine_write_error( int, int );
-static int read_label( drive_t *);
-static bool_t tape_rec_checksum_check( drive_context_t *, char * );
-static void set_recommended_sizes( drive_t * );
-static void display_access_failed_message( drive_t *);
-static bool_t get_tpcaps( drive_t * );
-static int prepare_drive( drive_t *drivep );
-static bool_t Open( drive_t *drivep );
-static void Close( drive_t *drivep );
-static int Read( drive_t *drivep,
+static int	mt_op(int , int , int);
+static int determine_write_error(int, int);
+static int read_label(drive_t *);
+static bool_t tape_rec_checksum_check(drive_context_t *, char *);
+static void set_recommended_sizes(drive_t *);
+static void display_access_failed_message(drive_t *);
+static bool_t get_tpcaps(drive_t *);
+static int prepare_drive(drive_t *drivep);
+static bool_t Open(drive_t *drivep);
+static void Close(drive_t *drivep);
+static int Read(drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
-		      int *errnop );
-static int Write( drive_t *drivep,
+		      int *errnop);
+static int Write(drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
-		       int *saved_errnop );
-static int record_hdr_validate( drive_t *drivep,
+		       int *saved_errnop);
+static int record_hdr_validate(drive_t *drivep,
 				     char *bufp,
-				     bool_t chkoffpr );
-static int ring_read( void *clientctxp, char *bufp );
-static int ring_write( void *clientctxp, char *bufp );
-static double percent64( off64_t num, off64_t denom );
-static int getrec( drive_t *drivep );
-static int write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
-                              bool_t xlatepr );
-static ring_msg_t * Ring_get( ring_t *ringp );
-static void Ring_reset(  ring_t *ringp, ring_msg_t *msgp );
-static void Ring_put(  ring_t *ringp, ring_msg_t *msgp );
-static int validate_media_file_hdr( drive_t *drivep );
-static void calc_max_lost( drive_t *drivep );
-static void display_ring_metrics( drive_t *drivep, int mlog_flags );
+				     bool_t chkoffpr);
+static int ring_read(void *clientctxp, char *bufp);
+static int ring_write(void *clientctxp, char *bufp);
+static double percent64(off64_t num, off64_t denom);
+static int getrec(drive_t *drivep);
+static int write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
+                              bool_t xlatepr);
+static ring_msg_t * Ring_get(ring_t *ringp);
+static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
+static void Ring_put(ring_t *ringp, ring_msg_t *msgp);
+static int validate_media_file_hdr(drive_t *drivep);
+static void calc_max_lost(drive_t *drivep);
+static void display_ring_metrics(drive_t *drivep, int mlog_flags);
 #ifdef CLRMTAUD
-static uint32_t rewind_and_verify( drive_t *drivep );
-static uint32_t erase_and_verify( drive_t *drivep );
-static uint32_t bsf_and_verify( drive_t *drivep );
-static uint32_t fsf_and_verify( drive_t *drivep );
+static uint32_t rewind_and_verify(drive_t *drivep);
+static uint32_t erase_and_verify(drive_t *drivep);
+static uint32_t bsf_and_verify(drive_t *drivep);
+static uint32_t fsf_and_verify(drive_t *drivep);
 #else /* CLRMTAUD */
-static short rewind_and_verify( drive_t *drivep );
-static short erase_and_verify( drive_t *drivep );
-static short bsf_and_verify( drive_t *drivep );
-static short fsf_and_verify( drive_t *drivep );
+static short rewind_and_verify(drive_t *drivep);
+static short erase_and_verify(drive_t *drivep);
+static short bsf_and_verify(drive_t *drivep);
+static short fsf_and_verify(drive_t *drivep);
 #endif /* CLRMTAUD */
-static bool_t set_best_blk_and_rec_sz( drive_t *drivep );
-static bool_t isefsdump( drive_t *drivep );
-static bool_t isxfsdumperasetape( drive_t *drivep );
+static bool_t set_best_blk_and_rec_sz(drive_t *drivep);
+static bool_t isefsdump(drive_t *drivep);
+static bool_t isxfsdumperasetape(drive_t *drivep);
 
 /* RMT trace stubs
  */
 #ifdef RMTDBG
-static int dbgrmtopen( char *, int );
-static int dbgrmtclose( int );
-static int dbgrmtioctl( int, int, void * );
-static int dbgrmtread( int, void *, uint);
-static int dbgrmtwrite( int, void *, uint);
+static int dbgrmtopen(char *, int);
+static int dbgrmtclose(int);
+static int dbgrmtioctl(int, int, void *);
+static int dbgrmtread(int, void *, uint);
+static int dbgrmtwrite(int, void *, uint);
 #endif /* RMTDBG */
 
 #define ERASE_MAGIC "$^*@++! This tape was quick erased by SGI xfsdump $^*@++!"
@@ -408,7 +408,7 @@
  */
 /* ARGSUSED */
 static int
-ds_match( int argc, char *argv[], drive_t *drivep )
+ds_match(int argc, char *argv[], drive_t *drivep)
 {
 	int fd;
 	int c;
@@ -417,7 +417,7 @@
 	/* heuristics to determine if this is a drive.
 	 */
 
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 		return -10;
 	}
 
@@ -429,21 +429,21 @@
 	{
 		optind = 1;
 		opterr = 0;
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 		   switch (c) {
 		      case GETOPT_BLOCKSIZE:
-			    if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			    if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					_("-%c argument missing\n"),
-					c );
+					c);
 				return -10;
 		    	    }
-			    cmdlineblksize = ( uint32_t )atoi( optarg );
+			    cmdlineblksize = (uint32_t)atoi(optarg);
 		            errno = 0;
-		            fd = open( drivep->d_pathname, O_RDONLY );
-		            if ( fd < 0 )
+		            fd = open(drivep->d_pathname, O_RDONLY);
+		            if (fd < 0)
 			            return -10;
-		            close( fd );
+		            close(fd);
 			    break;
 			case GETOPT_MINRMT:
 			    minrmt = BOOL_TRUE;
@@ -455,9 +455,9 @@
 			if (cmdlineblksize != 0)
 				return 20;
 		 	else
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					_("Minimal rmt cannot be used without specifying blocksize. Use -%c\n"),
-					GETOPT_BLOCKSIZE );
+					GETOPT_BLOCKSIZE);
 		}
 	}
 	/* catch all */
@@ -468,18 +468,18 @@
  */
 /*ARGSUSED*/
 static bool_t
-ds_instantiate( int argc, char *argv[], drive_t *drivep )
+ds_instantiate(int argc, char *argv[], drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int c;
 
 	/* opportunity for sanity checking
 	 */
-	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
-	assert( sizeof( rec_hdr_t )
+	assert(sizeof(global_hdr_t) <= STAPE_HDR_SZ);
+	assert(sizeof(rec_hdr_t)
 		==
-		sizeofmember( drive_hdr_t, dh_specific ));
-	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
+		sizeofmember(drive_hdr_t, dh_specific));
+	assert(! (STAPE_MAX_RECSZ % PGSZ));
 
 	/* hook up the drive ops
 	 */
@@ -487,9 +487,9 @@
 
 	/* allocate context for the drive manager
 	 */
-	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
-	assert( contextp );
-	memset( ( void * )contextp, 0, sizeof( *contextp ));
+	contextp = (drive_context_t *)calloc(1, sizeof(drive_context_t));
+	assert(contextp);
+	memset((void *)contextp, 0, sizeof(*contextp));
 
 	/* do not enable a separate I/O thread,
 	 * more testing to be done first...
@@ -507,26 +507,26 @@
 	contextp->dc_isQICpr = BOOL_FALSE;
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_RINGLEN:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
-			contextp->dc_ringlen = ( size_t )atoi( optarg );
-			if ( contextp->dc_ringlen < RINGLEN_MIN
+			contextp->dc_ringlen = (size_t)atoi(optarg);
+			if (contextp->dc_ringlen < RINGLEN_MIN
 			     ||
-			     contextp->dc_ringlen > RINGLEN_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+			     contextp->dc_ringlen > RINGLEN_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("-%c argument must be "
 				      "between %u and %u: ignoring %u\n"),
 				      c,
 				      RINGLEN_MIN,
 				      RINGLEN_MAX,
-				      contextp->dc_ringlen );
+				      contextp->dc_ringlen);
 				return BOOL_FALSE;
 			}
 			break;
@@ -545,23 +545,23 @@
 #ifdef DUMP
 		case GETOPT_OVERWRITE:
 			contextp->dc_overwritepr = BOOL_TRUE;
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      			_("Overwrite command line option\n") );
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      			_("Overwrite command line option\n"));
 			break;
 		case GETOPT_FILESZ:
-			if ( ! optarg || optarg [ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg [0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
-			contextp->dc_filesz = (off64_t)atoi( optarg ) * 1024 * 1024;
+			contextp->dc_filesz = (off64_t)atoi(optarg) * 1024 * 1024;
 			if (contextp->dc_filesz <= 0) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument must be a "
 				      "positive number (MB): ignoring %u\n"),
 				      c,
-				      contextp->dc_filesz );
+				      contextp->dc_filesz);
 				return BOOL_FALSE;
 			}
 			break;
@@ -585,37 +585,37 @@
 	/* if threads not allowed, allocate a record buffer. otherwise
 	 * create a ring, from which buffers will be taken.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
-		assert( contextp->dc_bufp );
+	if (contextp->dc_singlethreadedpr) {
+		contextp->dc_bufp = (char *)memalign(PGSZ, STAPE_MAX_RECSZ);
+		assert(contextp->dc_bufp);
 	} else {
 		int rval;
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
 		      "ring op: create: ringlen == %u\n",
-		      contextp->dc_ringlen );
-		contextp->dc_ringp = ring_create( contextp->dc_ringlen,
+		      contextp->dc_ringlen);
+		contextp->dc_ringp = ring_create(contextp->dc_ringlen,
 						  STAPE_MAX_RECSZ,
 						  contextp->dc_ringpinnedpr,
 						  drivep->d_index,
 						  ring_read,
 						  ring_write,
-						  ( void * )drivep,
-						  &rval );
-		if ( ! contextp->dc_ringp ) {
-			if ( rval == ENOMEM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+						  (void *)drivep,
+						  &rval);
+		if (! contextp->dc_ringp) {
+			if (rval == ENOMEM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("unable to allocate memory "
-				      "for I/O buffer ring\n") );
-			} else if ( rval == E2BIG ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "for I/O buffer ring\n"));
+			} else if (rval == E2BIG) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not enough physical memory "
-				      "to pin down I/O buffer ring\n") );
-			} else if ( rval == EPERM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "to pin down I/O buffer ring\n"));
+			} else if (rval == EPERM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not allowed "
-				      "to pin down I/O buffer ring\n") );
+				      "to pin down I/O buffer ring\n"));
 			} else {
-				assert( 0 );
+				assert(0);
 			}
 			return BOOL_FALSE;
 		}
@@ -668,15 +668,15 @@
  */
 /* ARGSUSED */
 static bool_t
-do_init( drive_t *drivep )
+do_init(drive_t *drivep)
 {
 #ifdef DUMP
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 #endif /* DUMP */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: init\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: init\n");
 
 #ifdef DUMP
 	/* fill in media strategy id: artifact of first version of xfsdump
@@ -693,10 +693,10 @@
  */
 /* ARGSUSED */
 static bool_t
-do_sync( drive_t *drivep )
+do_sync(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: sync\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: sync\n");
 
 	return BOOL_TRUE;
 }
@@ -711,32 +711,32 @@
  *
  */
 static int
-do_begin_read( drive_t *drivep )
+do_begin_read(drive_t *drivep)
 {
         drive_context_t *contextp;
         int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: begin read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: begin read\n");
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_READ );
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! contextp->dc_recp );
+	assert(drivep->d_capabilities & DRIVE_CAP_READ);
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! contextp->dc_recp);
 
 	/* get a record buffer to use during initialization.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -745,38 +745,38 @@
 	 * size previously determined.
 	 */
 	contextp->dc_iocnt = 0;
-	if ( contextp->dc_fd < 0 ) {
-		assert( contextp->dc_fd == -1 );
-		rval = prepare_drive( drivep );
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_fd < 0) {
+		assert(contextp->dc_fd == -1);
+		rval = prepare_drive(drivep);
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	} else {
-		rval = read_label( drivep ) ;
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+		rval = read_label(drivep) ;
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	}
-	assert( contextp->dc_iocnt == 1 );
+	assert(contextp->dc_iocnt == 1);
 					/* set by prepare_drive or read_label */
 
 	/* all is well. adjust context. don't kick off read-aheads just yet;
 	 * the client may not want this media file.
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
+	if (! contextp->dc_singlethreadedpr) {
 		contextp->dc_msgp->rm_op = RING_OP_NOP;
 		contextp->dc_msgp->rm_user = 0; /* do diff. use in do_seek */
-		Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -807,31 +807,31 @@
  *
  */
 static char *
-do_read( drive_t *drivep,
+do_read(drive_t *drivep,
 	 size_t wantedcnt,
 	 size_t *actualcntp,
-	 int *rvalp )
+	 int *rvalp)
 {
 	drive_context_t *contextp;
 	size_t availcnt;
 	size_t actualcnt;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: read: wanted %u (0x%x)\n",
 	      wantedcnt,
-	      wantedcnt );
+	      wantedcnt);
 
 	/* get context ptrs
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( wantedcnt > 0 );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(wantedcnt > 0);
 
 	/* clear the return status field
 	 */
@@ -839,30 +839,30 @@
 
 	/* read a new record if necessary
 	 */
-	rval = getrec( drivep );
-	if ( rval ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+	rval = getrec(drivep);
+	if (rval) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "rmt drive op read returning error rval=%d\n",
-		      rval );
+		      rval);
 		*rvalp = rval;
 		return 0;
 	}
 
 	/* figure how much data is available, and how much should be supplied
 	 */
-	availcnt = ( size_t )( contextp->dc_dataendp - contextp->dc_nextp );
-	actualcnt = min( wantedcnt, availcnt );
+	availcnt = (size_t)(contextp->dc_dataendp - contextp->dc_nextp);
+	actualcnt = min(wantedcnt, availcnt);
 
 	/* adjust the context
 	 */
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "rmt drive op read actual == %d (0x%x)\n",
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	*actualcntp = actualcnt;
 	return contextp->dc_ownedp;
@@ -877,29 +877,29 @@
  */
 /* ARGSUSED */
 static void
-do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
+do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	/* REFERENCED */
 	size_t ownedcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: return read buf: sz %d (0x%x)\n",
 	      retcnt,
-	      retcnt );
+	      retcnt);
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( bufp == contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(bufp == contextp->dc_ownedp);
 
 	/* calculate how much the caller owns
 	 */
-	assert( contextp->dc_nextp >= contextp->dc_ownedp );
-	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	assert( ownedcnt == retcnt );
+	assert(contextp->dc_nextp >= contextp->dc_ownedp);
+	ownedcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
+	assert(ownedcnt == retcnt);
 
 	/* take possession of buffer portion
 	 */
@@ -908,11 +908,11 @@
 	/* if caller is done with this record, take the buffer back
 	 * and (if ring in use) give buffer to ring for read-ahead.
 	 */
-	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
-		assert( contextp->dc_nextp == contextp->dc_dataendp );
-		if ( ! contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_nextp >= contextp->dc_dataendp) {
+		assert(contextp->dc_nextp == contextp->dc_dataendp);
+		if (! contextp->dc_singlethreadedpr) {
 			contextp->dc_msgp->rm_op = RING_OP_READ;
-			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -930,29 +930,29 @@
  *	void
  */
 static void
-do_get_mark( drive_t *drivep, drive_mark_t *markp )
+do_get_mark(drive_t *drivep, drive_mark_t *markp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t offset;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: get mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: get mark\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 	/* the mark is simply the offset into the media file of the
 	 * next byte to be read.
 	 */
-	offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
-		offset += ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
+	offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
+		offset += (off64_t)(contextp->dc_nextp - contextp->dc_recp);
 	}
 
-	*markp = ( drive_mark_t )offset;
+	*markp = (drive_mark_t)offset;
 
 	return;
 }
@@ -969,7 +969,7 @@
  *
  */
 static int
-do_seek_mark( drive_t *drivep, drive_mark_t *markp )
+do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 {
 	drive_context_t	*contextp;
 	off64_t wantedoffset;
@@ -981,55 +981,55 @@
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 
 	/* the desired mark is passed by reference, and is really just an
 	 * offset into the raw (incl rec hdrs) read stream
 	 */
-	wantedoffset = *( off64_t * )markp;
+	wantedoffset = *(off64_t *)markp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: seek mark: %lld (0x%llx)\n",
 	      wantedoffset,
-	      wantedoffset );
+	      wantedoffset);
 
 	/* determine the current offset. assert that the wanted offset is
 	 * not less than the current offset.
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset >= currentoffset );
+	assert(wantedoffset >= currentoffset);
 
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
 	 */
-	if ( contextp->dc_recp ) {
+	if (contextp->dc_recp) {
 		off64_t nextrecoffset;
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		nextrecoffset = contextp->dc_reccnt  * ( off64_t )tape_recsz
+		nextrecoffset = contextp->dc_reccnt  * (off64_t)tape_recsz
 				+
-				( off64_t )rechdrp->rec_used;
-		if ( wantedoffset >= nextrecoffset ) {
+				(off64_t)rechdrp->rec_used;
+		if (wantedoffset >= nextrecoffset) {
 			uint32_t recoff;
 			size_t wantedcnt;
 			char *dummybufp;
@@ -1039,39 +1039,39 @@
 			/* if this is the last record, the wanted offset
 			 * must be just after it.
 			 */
-			if ( rechdrp->rec_used < tape_recsz ) {
-				assert( wantedoffset == nextrecoffset );
+			if (rechdrp->rec_used < tape_recsz) {
+				assert(wantedoffset == nextrecoffset);
 			}
 
 			/* figure how much to ask for
 			 */
-			assert( contextp->dc_nextp >= contextp->dc_recp );
-			recoff = ( uint32_t )( contextp->dc_nextp
+			assert(contextp->dc_nextp >= contextp->dc_recp);
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			wantedcnt = ( size_t )( rechdrp->rec_used
+						contextp->dc_recp);
+			wantedcnt = (size_t)(rechdrp->rec_used
 						-
-						recoff );
+						recoff);
 
 			/* eat that much tape
 			 */
 			rval = 0;
-			dummybufp = do_read( drivep,
+			dummybufp = do_read(drivep,
 					     wantedcnt,
 					     &actualcnt,
-					     &rval );
-			if ( rval ) {
+					     &rval);
+			if (rval) {
 				return rval;
 			}
-			assert( actualcnt == wantedcnt );
-			do_return_read_buf( drivep, dummybufp, actualcnt );
-			currentoffset += ( off64_t )actualcnt;
-			assert( currentoffset == nextrecoffset );
-			assert( wantedoffset >= currentoffset );
-			assert( ! contextp->dc_recp );
-			assert( currentoffset
+			assert(actualcnt == wantedcnt);
+			do_return_read_buf(drivep, dummybufp, actualcnt);
+			currentoffset += (off64_t)actualcnt;
+			assert(currentoffset == nextrecoffset);
+			assert(wantedoffset >= currentoffset);
+			assert(! contextp->dc_recp);
+			assert(currentoffset
 				==
-				contextp->dc_reccnt * ( off64_t )tape_recsz );
+				contextp->dc_reccnt * (off64_t)tape_recsz);
 		}
 	}
 
@@ -1082,208 +1082,208 @@
 	 * made it there, suspend read-ahead, eat those readahead records,
 	 * FSR the remaining, and resume readahead.
 	 */
-	if ( contextp->dc_canfsrpr
+	if (contextp->dc_canfsrpr
 	     &&
-	     wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	     wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
 
-		assert( ! contextp->dc_recp );
-		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
-		if ( contextp->dc_singlethreadedpr ) {
+		assert(! contextp->dc_recp);
+		wantedreccnt = wantedoffset / (off64_t)tape_recsz;
+		if (contextp->dc_singlethreadedpr) {
 			seekmode = SEEKMODE_RAW;
 		} else {
 			seekmode = SEEKMODE_BUF;
 		}
-		assert( wantedreccnt != 0 ); /* so NOP below can be
+		assert(wantedreccnt != 0); /* so NOP below can be
 					      * distinguished from use
 					      * in do_begin_read
 					      */
-		while ( contextp->dc_reccnt < wantedreccnt ) {
+		while (contextp->dc_reccnt < wantedreccnt) {
 			off64_t recskipcnt64;
 			off64_t recskipcnt64remaining;
 
-			if ( seekmode == SEEKMODE_BUF ) {
+			if (seekmode == SEEKMODE_BUF) {
 				ring_stat_t rs;
-				assert( ! contextp->dc_msgp );
+				assert(! contextp->dc_msgp);
 				contextp->dc_msgp =
-						Ring_get( contextp->dc_ringp );
+						Ring_get(contextp->dc_ringp);
 				rs = contextp->dc_msgp->rm_stat;
-				if ( rs == RING_STAT_ERROR ) {
+				if (rs == RING_STAT_ERROR) {
 					contextp->dc_errorpr = BOOL_TRUE;
 					return contextp->dc_msgp->rm_rval;
 				}
-				if ( rs != RING_STAT_OK
+				if (rs != RING_STAT_OK
 				     &&
 				     rs != RING_STAT_INIT
 				     &&
-				     rs != RING_STAT_NOPACK ) {
-					assert( 0 );
+				     rs != RING_STAT_NOPACK) {
+					assert(0);
 					contextp->dc_errorpr = BOOL_TRUE;
 					return DRIVE_ERROR_CORE;
 				}
-				if ( rs == RING_STAT_OK ) {
+				if (rs == RING_STAT_OK) {
 					contextp->dc_reccnt++;
 				}
-				if ( rs == RING_STAT_NOPACK
+				if (rs == RING_STAT_NOPACK
 				     &&
 				     contextp->dc_msgp->rm_user
 				     ==
-				     wantedreccnt ) {
+				     wantedreccnt) {
 					seekmode = SEEKMODE_RAW;
 				}
 				contextp->dc_msgp->rm_op = RING_OP_NOP;
 				contextp->dc_msgp->rm_user = wantedreccnt;
-				Ring_put( contextp->dc_ringp,
-					  contextp->dc_msgp );
+				Ring_put(contextp->dc_ringp,
+					  contextp->dc_msgp);
 				contextp->dc_msgp = 0;
 				continue;
 			}
 
-			assert( contextp->dc_reccnt == contextp->dc_iocnt );
-			assert( wantedreccnt > contextp->dc_reccnt );
+			assert(contextp->dc_reccnt == contextp->dc_iocnt);
+			assert(wantedreccnt > contextp->dc_reccnt);
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
-			while ( recskipcnt64remaining ) {
+			while (recskipcnt64remaining) {
 				int recskipcnt;
 				int saved_errno;
 				int rval;
 
-				assert( recskipcnt64remaining > 0 );
-				if ( recskipcnt64remaining > INTGENMAX ) {
+				assert(recskipcnt64remaining > 0);
+				if (recskipcnt64remaining > INTGENMAX) {
 					recskipcnt = INTGENMAX;
 				} else {
-					recskipcnt = ( int )
+					recskipcnt = (int)
 						     recskipcnt64remaining;
 				}
-				assert( recskipcnt > 0 );
-				rval = mt_op( contextp->dc_fd,
+				assert(recskipcnt > 0);
+				rval = mt_op(contextp->dc_fd,
 					      MTFSR,
-					      recskipcnt );
+					      recskipcnt);
 				saved_errno = errno;
-				if ( rval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				if (rval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					      _("could not forward space %d "
 					      "tape blocks: "
 					      "rval == %d, errno == %d (%s)\n"),
 					      rval,
 					      saved_errno,
-					      strerror( saved_errno ));
+					      strerror(saved_errno));
 					return DRIVE_ERROR_MEDIA;
 				}
-				recskipcnt64remaining -= ( off64_t )recskipcnt;
+				recskipcnt64remaining -= (off64_t)recskipcnt;
 			}
 			contextp->dc_reccnt += recskipcnt64;
 			contextp->dc_iocnt += recskipcnt64;
 			currentoffset = contextp->dc_reccnt
 					*
-					( off64_t )tape_recsz;
-			assert( wantedoffset >= currentoffset );
-			assert( wantedoffset - currentoffset
+					(off64_t)tape_recsz;
+			assert(wantedoffset >= currentoffset);
+			assert(wantedoffset - currentoffset
 				<
-				( off64_t )tape_recsz );
+				(off64_t)tape_recsz);
 		}
 	}
 
 	/* remove excess records by eating them. won't be any if
 	 * FSR supported
 	 */
-	while ( wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	while (wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 		int rval;
 
-		assert( ! contextp->dc_recp );
+		assert(! contextp->dc_recp);
 
 		/* figure how much to ask for. to eat an entire record,
 		 * ask for a record sans the header. do_read will eat
 		 * the header, we eat the rest.
 		 */
-		wantedcnt = ( size_t )( tape_recsz - STAPE_HDR_SZ );
+		wantedcnt = (size_t)(tape_recsz - STAPE_HDR_SZ);
 
 		/* eat that much tape
 		 */
 		rval = 0;
-		dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		if ( rval ) {
+		dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		if (rval) {
 			return rval;
 		}
-		assert( actualcnt == wantedcnt );
-		do_return_read_buf( drivep, dummybufp, actualcnt );
-		assert( ! contextp->dc_recp );
-		currentoffset += ( off64_t )tape_recsz;
-		assert( currentoffset
+		assert(actualcnt == wantedcnt);
+		do_return_read_buf(drivep, dummybufp, actualcnt);
+		assert(! contextp->dc_recp);
+		currentoffset += (off64_t)tape_recsz;
+		assert(currentoffset
 			==
-			contextp->dc_reccnt * ( off64_t )tape_recsz );
+			contextp->dc_reccnt * (off64_t)tape_recsz);
 	}
 
 	/* eat that portion of the next record leading up to the
 	 * desired offset.
 	 */
-	if ( wantedoffset != currentoffset ) {
+	if (wantedoffset != currentoffset) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 
-		assert( wantedoffset > currentoffset );
-		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
-		wantedcnt = ( size_t )( wantedoffset - currentoffset );
-		if ( contextp->dc_recp ) {
+		assert(wantedoffset > currentoffset);
+		assert(wantedoffset - currentoffset < (off64_t)tape_recsz);
+		wantedcnt = (size_t)(wantedoffset - currentoffset);
+		if (contextp->dc_recp) {
 			uint32_t recoff;
 #ifdef DEBUG
-			rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+			rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
-			recoff = ( uint32_t )( contextp->dc_nextp
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			assert( recoff <= tape_recsz );
-			assert( rechdrp->rec_used <= tape_recsz );
-			assert( recoff >= STAPE_HDR_SZ );
-			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-			assert( recoff <= rechdrp->rec_used );
-			assert( recoff + wantedcnt <= rechdrp->rec_used );
+						contextp->dc_recp);
+			assert(recoff <= tape_recsz);
+			assert(rechdrp->rec_used <= tape_recsz);
+			assert(recoff >= STAPE_HDR_SZ);
+			assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+			assert(recoff <= rechdrp->rec_used);
+			assert(recoff + wantedcnt <= rechdrp->rec_used);
 		} else {
-			assert( wantedcnt >= STAPE_HDR_SZ );
+			assert(wantedcnt >= STAPE_HDR_SZ);
 			wantedcnt -= STAPE_HDR_SZ;
 		}
 
 		/* eat that much tape
 		 */
-		if ( wantedcnt > 0 ) {
+		if (wantedcnt > 0) {
 		    int rval;
 		    rval = 0;
-		    dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		    if ( rval ) {
+		    dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		    if (rval) {
 			    return rval;
 		    }
-		    assert( actualcnt == wantedcnt );
-		    do_return_read_buf( drivep, dummybufp, actualcnt );
+		    assert(actualcnt == wantedcnt);
+		    do_return_read_buf(drivep, dummybufp, actualcnt);
 		}
 	}
 
 	/* as a sanity check, refigure the current offset and make sure
 	 * it is equal to the wanted offset
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset == currentoffset );
+	assert(wantedoffset == currentoffset);
 
 	return 0;
 }
@@ -1299,7 +1299,7 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_next_mark( drive_t *drivep )
+do_next_mark(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	rec_hdr_t *rechdrp;
@@ -1314,69 +1314,69 @@
 
 	/* assert protocol being followed.
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: next mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: next mark\n");
 
 	trycnt = 0;
 
-	if ( contextp->dc_errorpr ) {
+	if (contextp->dc_errorpr) {
 		goto resetring;
 	} else {
 		goto noerrorsearch;
 	}
 
 noerrorsearch:
-	for ( ; ; ) {
-		rval = getrec( drivep );
-		if ( rval == DRIVE_ERROR_CORRUPTION ) {
+	for (; ;) {
+		rval = getrec(drivep);
+		if (rval == DRIVE_ERROR_CORRUPTION) {
 			goto resetring;
-		} else if ( rval ) {
+		} else if (rval) {
 			return rval;
 		}
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		assert( rechdrp->first_mark_offset != 0 );
-		if ( rechdrp->first_mark_offset > 0 ) {
+		assert(rechdrp->first_mark_offset != 0);
+		if (rechdrp->first_mark_offset > 0) {
 			 off64_t markoff = rechdrp->first_mark_offset
 					   -
 					   rechdrp->file_offset;
-			 off64_t curoff = ( off64_t )( contextp->dc_nextp
+			 off64_t curoff = (off64_t)(contextp->dc_nextp
 						       -
-						       contextp->dc_recp );
-			 assert( markoff > 0 );
-			 assert( curoff > 0 );
-			 if ( markoff >= curoff ) {
+						       contextp->dc_recp);
+			 assert(markoff > 0);
+			 assert(curoff > 0);
+			 if (markoff >= curoff) {
 				break;
 			}
 		}
 
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
 		contextp->dc_reccnt++;
 	}
 
-	assert( rechdrp->first_mark_offset - rechdrp->file_offset
+	assert(rechdrp->first_mark_offset - rechdrp->file_offset
 		<=
-		( off64_t )tape_recsz );
+		(off64_t)tape_recsz);
 	contextp->dc_nextp = contextp->dc_recp
 			     +
-			     ( size_t )( rechdrp->first_mark_offset
+			     (size_t)(rechdrp->first_mark_offset
 					 -
-					 rechdrp->file_offset );
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+					 rechdrp->file_offset);
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	if (contextp->dc_nextp == contextp->dc_dataendp) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1386,124 +1386,124 @@
 	return 0;
 
 resetring:
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
 
 	/* get a record buffer and cast a record header pointer
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	goto readrecord;
 
 readrecord:
 	trycnt++;
-	if ( trycnt > maxtrycnt ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("unable to locate next mark in media file\n") );
+	if (trycnt > maxtrycnt) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("unable to locate next mark in media file\n"));
 		return DRIVE_ERROR_MEDIA;
 	}
 
-	nread = Read( drivep, contextp->dc_recp, tape_recsz, &saved_errno );
+	nread = Read(drivep, contextp->dc_recp, tape_recsz, &saved_errno);
 	goto validateread;
 
 validateread:
-	if ( nread == ( int )tape_recsz ) {
+	if (nread == (int)tape_recsz) {
 		goto validatehdr;
 	}
 
-	if ( nread >= 0 ) {
-		assert( ( size_t )nread <= tape_recsz );
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (nread >= 0) {
+		assert((size_t)nread <= tape_recsz);
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "short read (nread == %d, record size == %d)\n",
 		      nread,
-		      tape_recsz );
+		      tape_recsz);
 		goto getbeyonderror;
 	}
 
 	/* some other error
 	 */
-	mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 	      _("unexpected error attempting to read record: "
 	      "read returns %d, errno %s (%s)\n"),
 	      nread,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 
 	goto getbeyonderror;
 
 validatehdr:
-	rval = record_hdr_validate( drivep, contextp->dc_recp, BOOL_FALSE );
+	rval = record_hdr_validate(drivep, contextp->dc_recp, BOOL_FALSE);
 
-	if ( rval
+	if (rval
 	     &&
-	     ( contextp->dc_isQICpr == BOOL_TRUE
+	     (contextp->dc_isQICpr == BOOL_TRUE
 	       ||
-	       contextp->dc_isQICpr == BOOL_UNKNOWN )) {
+	       contextp->dc_isQICpr == BOOL_UNKNOWN)) {
 		goto huntQIC;
 	}
 
-	if ( rval ) {
+	if (rval) {
 		goto readrecord;
 	}
 
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
-	if ( rechdrp->first_mark_offset < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+	if (rechdrp->first_mark_offset < 0) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 		      _("valid record %lld but no mark\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		goto readrecord;
 	}
 
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
 	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
-	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
-	assert( markoff < ( off64_t )tape_recsz );
-	assert( rechdrp->rec_used > STAPE_HDR_SZ );
-	assert( rechdrp->rec_used < tape_recsz );
+	assert(markoff >= (off64_t)STAPE_HDR_SZ);
+	assert(markoff < (off64_t)tape_recsz);
+	assert(rechdrp->rec_used > STAPE_HDR_SZ);
+	assert(rechdrp->rec_used < tape_recsz);
 
 	goto alliswell;
 
 alliswell:
-	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_nextp = contextp->dc_recp + (size_t)markoff;
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
-	assert( contextp->dc_dataendp <= contextp->dc_recendp );
-	assert( contextp->dc_nextp < contextp->dc_dataendp );
+	assert(contextp->dc_dataendp <= contextp->dc_recendp);
+	assert(contextp->dc_nextp < contextp->dc_dataendp);
 	contextp->dc_errorpr = BOOL_FALSE;
 
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("resynchronized at record %lld "
 	      "offset %u\n"),
 	      contextp->dc_iocnt - 1,
 	      contextp->dc_nextp
 	      -
-	      contextp->dc_recp );
+	      contextp->dc_recp);
 	return 0;
 
 getbeyonderror:
-	rval = mt_op( contextp->dc_fd, MTFSR, 1 );
+	rval = mt_op(contextp->dc_fd, MTFSR, 1);
 	saved_errno = errno;
 
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not forward space one tape block beyond "
 		      "read error: rval == %d, errno == %d (%s)\n"),
 		      rval,
 		      saved_errno,
-		      strerror( saved_errno ));
+		      strerror(saved_errno));
 		return DRIVE_ERROR_MEDIA;
 	}
 
@@ -1515,12 +1515,12 @@
 	 * the following blocks to the head of the record buffer, and try
 	 * to read the remaining blocks in the record.
 	 */
-	for ( p = contextp->dc_recp + QIC_BLKSZ
+	for (p = contextp->dc_recp + QIC_BLKSZ
 	      ;
 	      p < contextp->dc_recendp
 	      ;
-	      p += QIC_BLKSZ ) {
-		if ( *( uint64_t * )p == STAPE_MAGIC ) {
+	      p += QIC_BLKSZ) {
+		if (*(uint64_t *)p == STAPE_MAGIC) {
 			goto adjustQIC;
 		}
 	}
@@ -1528,14 +1528,14 @@
 	goto readrecord;
 
 adjustQIC:
-	tailsz = ( size_t )( contextp->dc_recendp - p );
-	memcpy( ( void * )contextp->dc_recp,
-		( void * )p,
-		tailsz );
-	nread = Read( drivep,
+	tailsz = (size_t)(contextp->dc_recendp - p);
+	memcpy((void *)contextp->dc_recp,
+		(void *)p,
+		tailsz);
+	nread = Read(drivep,
 		      contextp->dc_recp + tailsz,
 		      tape_recsz - tailsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	goto validateread;
 }
@@ -1548,27 +1548,27 @@
  *	void
  */
 static void
-do_end_read( drive_t *drivep )
+do_end_read(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: end read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: end read\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
 	/* In the scsi version, read_label() does a status command to the
 	 * drive to then decide if doing a 'fsf' is appropriate.  For minrmt,
 	 * we don't have the status command so we need to space forward at
 	 * the moment we know we need to go forward... which is here.
 	 */
-	( void )fsf_and_verify( drivep );
+	(void)fsf_and_verify(drivep);
 
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 
@@ -1584,7 +1584,7 @@
  * 	DRIVE_ERROR_... on failure
  */
 static int
-do_begin_write( drive_t *drivep )
+do_begin_write(drive_t *drivep)
 {
 	drive_context_t		*contextp;
 	drive_hdr_t		*dwhdrp;
@@ -1605,34 +1605,34 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: begin write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: begin write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! drivep->d_markrecheadp );
-	assert( ! contextp->dc_recp );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! drivep->d_markrecheadp);
+	assert(! contextp->dc_recp);
 
 	/* get pointers into global write header
 	 */
 	gwhdrp = drivep->d_gwritehdrp;
 	dwhdrp = drivep->d_writehdrp;
-	tpwhdrp = ( rec_hdr_t * )dwhdrp->dh_specific;
+	tpwhdrp = (rec_hdr_t *)dwhdrp->dh_specific;
 
 	/* must already be open. The only way to open is to do a begin_read.
 	 * so all interaction with tape requires reading first.
 	 */
-	assert( contextp->dc_fd != -1 );
+	assert(contextp->dc_fd != -1);
 
 	/* fill in write header's drive specific info
 	 */
 	tpwhdrp->magic = STAPE_MAGIC;
 	tpwhdrp->version = STAPE_VERSION;
-	tpwhdrp->blksize = ( int32_t )tape_blksz;
-	tpwhdrp->recsize = ( int32_t )tape_recsz;
+	tpwhdrp->blksize = (int32_t)tape_blksz;
+	tpwhdrp->recsize = (int32_t)tape_recsz;
 	tpwhdrp->rec_used = 0;
 	tpwhdrp->file_offset = 0;
 	tpwhdrp->first_mark_offset= 0;
@@ -1641,15 +1641,15 @@
 	/* get a record buffer. will be used for the media file header,
 	 * and is needed to "prime the pump" for first call to do_write.
 	 */
-	assert( ! contextp->dc_recp );
-	if ( contextp->dc_singlethreadedpr ) {
-		assert( contextp->dc_bufp );
+	assert(! contextp->dc_recp);
+	if (contextp->dc_singlethreadedpr) {
+		assert(contextp->dc_bufp);
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		assert( ! contextp->dc_msgp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		assert(! contextp->dc_msgp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -1657,7 +1657,7 @@
 	 * being produced!
 	 */
 	contextp->dc_iocnt = 0;
-	memset( ( void * )contextp->dc_recp, 0, tape_recsz );
+	memset((void *)contextp->dc_recp, 0, tape_recsz);
 
 	tmpgh  = (global_hdr_t *)contextp->dc_recp;
 	tmpdh  = (drive_hdr_t *)tmpgh->gh_upper;
@@ -1679,12 +1679,12 @@
 
 	/* checksum the global header
 	 */
-	global_hdr_checksum_set( tmpgh );
+	global_hdr_checksum_set(tmpgh);
 
-	rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE );
-	if ( rval ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE);
+	if (rval) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1694,7 +1694,7 @@
 	/* prepare the drive context. must have a record buffer ready to
 	 * go, header initialized.
 	 */
-	assert( ! contextp->dc_ownedp );
+	assert(! contextp->dc_ownedp);
 	contextp->dc_reccnt = 1; /* count the header record */
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
@@ -1704,12 +1704,12 @@
 	rechdrp = (rec_hdr_t*)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	/* set mode now so operators will work
 	 */
@@ -1724,10 +1724,10 @@
  * in record.
  */
 static void
-do_set_mark( drive_t *drivep,
+do_set_mark(drive_t *drivep,
 	     drive_mcbfp_t cbfuncp,
 	     void *cbcontextp,
-	     drive_markrec_t *markrecp )
+	     drive_markrec_t *markrecp)
 {
 	drive_context_t *contextp;
 	off64_t nextoff;
@@ -1735,34 +1735,34 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
 
 	/* calculate and fill in the mark record offset
 	 */
-	assert( contextp->dc_recp );
-	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
+	assert(contextp->dc_recp);
+	nextoff = contextp->dc_reccnt * (off64_t)tape_recsz
 		  +
-		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
-	markrecp->dm_log = ( drive_mark_t )nextoff;
+		  (off64_t)(contextp->dc_nextp - contextp->dc_recp);
+	markrecp->dm_log = (drive_mark_t)nextoff;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: set mark: %lld (0x%llx)\n",
 	      nextoff,
-	      nextoff );
+	      nextoff);
 
 	/* note the location of the first mark in this tape record.
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-	if ( rechdrp->first_mark_offset == -1LL ) {
-		assert( nextoff != -1LL );
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
+	if (rechdrp->first_mark_offset == -1LL) {
+		assert(nextoff != -1LL);
 		rechdrp->first_mark_offset = nextoff;
 	}
 
@@ -1771,11 +1771,11 @@
 	markrecp->dm_cbfuncp = cbfuncp;
 	markrecp->dm_cbcontextp = cbcontextp;
 	markrecp->dm_nextp = 0;
-	if ( drivep->d_markrecheadp == 0 ) {
+	if (drivep->d_markrecheadp == 0) {
 		drivep->d_markrecheadp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	} else {
-		assert( drivep->d_markrectailp );
+		assert(drivep->d_markrectailp);
 		drivep->d_markrectailp->dm_nextp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	}
@@ -1790,7 +1790,7 @@
  *	"actual_bufszp" points to the size of the buffer
  */
 static char *
-do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
+do_get_write_buf(drive_t *drivep, size_t wantedcnt, size_t *actualcntp)
 {
 	drive_context_t *contextp;
 	size_t remainingcnt;
@@ -1798,32 +1798,32 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* figure how much is available; supply the min of what is
 	 * available and what is wanted.
 	 */
-	remainingcnt = ( size_t )( contextp->dc_recendp - contextp->dc_nextp );
-	actualcnt = min( remainingcnt, wantedcnt );
+	remainingcnt = (size_t)(contextp->dc_recendp - contextp->dc_nextp);
+	actualcnt = min(remainingcnt, wantedcnt);
 	*actualcntp = actualcnt;
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: get write buf: wanted %u (0x%x) actual %u (0x%x)\n",
 	      wantedcnt,
 	      wantedcnt,
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	return contextp->dc_ownedp;
 }
@@ -1841,7 +1841,7 @@
  */
 /* ARGSUSED */
 static int
-do_write( drive_t *drivep, char *bufp, size_t retcnt )
+do_write(drive_t *drivep, char *bufp, size_t retcnt)
 {
 	drive_context_t *contextp;
 	rec_hdr_t *rechdrp;
@@ -1852,33 +1852,33 @@
 
 	/* get drive context and pointer to global write hdr
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 	gwhdrp = drivep->d_gwritehdrp;
 
 	/* calculate how many bytes we believe caller is holding
 	 */
-	heldcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
+	heldcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: write: retcnt %u (0x%x) heldcnt %u (0x%x)\n",
 	      retcnt,
 	      retcnt,
 	      heldcnt,
-	      heldcnt );
+	      heldcnt);
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp <= contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp <= contextp->dc_recendp);
 
 	/* verify the caller is returning exactly what is held
 	 */
-	assert( bufp == contextp->dc_ownedp );
-	assert( retcnt == heldcnt );
+	assert(bufp == contextp->dc_ownedp);
+	assert(retcnt == heldcnt);
 
 	/* take it back
 	 */
@@ -1887,30 +1887,30 @@
 	/* if some portion of the record buffer has not yet been
 	 * held by the client, just return.
 	 */
-	if ( contextp->dc_nextp < contextp->dc_recendp ) {
+	if (contextp->dc_nextp < contextp->dc_recendp) {
 		return 0;
 	}
 
 	/* record in record header that entire record is used
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->rec_used = tape_recsz;
 
 	/* write out the record buffer and get a new one.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE );
+	if (contextp->dc_singlethreadedpr) {
+		rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE);
 		last_rec_wrtn_wo_err = contextp->dc_reccnt; /* conv cnt to ix */
 	} else {
 		contextp->dc_msgp->rm_op = RING_OP_WRITE;
 		contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-		Ring_put( contextp->dc_ringp,
-			  contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp,
+			  contextp->dc_msgp);
 		contextp->dc_msgp = 0;
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 		last_rec_wrtn_wo_err = contextp->dc_msgp->rm_user;
-		switch( contextp->dc_msgp->rm_stat ) {
+		switch(contextp->dc_msgp->rm_stat) {
 		case RING_STAT_OK:
 		case RING_STAT_INIT:
 			rval = 0;
@@ -1919,7 +1919,7 @@
 			rval = contextp->dc_msgp->rm_rval;
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 			return DRIVE_ERROR_CORE;
 		}
 	}
@@ -1927,7 +1927,7 @@
 	/* check for errors. if none, commit all marks before a safety margin
 	 * before the no error offset.
 	 */
-	if ( rval ) {
+	if (rval) {
 		contextp->dc_errorpr = BOOL_TRUE;
 	} else {
 		off64_t recs_wrtn_wo_err;
@@ -1935,8 +1935,8 @@
 		off64_t bytes_committed;
 		recs_wrtn_wo_err = last_rec_wrtn_wo_err + 1;
 		recs_committed = recs_wrtn_wo_err - contextp->dc_lostrecmax;
-		bytes_committed = recs_committed * ( off64_t )tape_recsz;
-		drive_mark_commit( drivep, bytes_committed );
+		bytes_committed = recs_committed * (off64_t)tape_recsz;
+		drive_mark_commit(drivep, bytes_committed);
 	}
 
 	/* adjust context
@@ -1949,15 +1949,15 @@
 
 	/* intialize header in new record
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	return rval;
 }
@@ -1970,40 +1970,40 @@
  *	the number of bytes to next alignment
  */
 static size_t
-do_get_align_cnt( drive_t * drivep )
+do_get_align_cnt(drive_t * drivep)
 {
 	char *next_alignment_point;
 	intptr_t next_alignment_off;
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: get align cnt\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: get align cnt\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because all buffers are page-aligned
 	 * and a multiple of PGSZ.
 	 */
-	next_alignment_off = ( intptr_t )contextp->dc_nextp;
+	next_alignment_off = (intptr_t)contextp->dc_nextp;
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
-	next_alignment_point = ( char * )next_alignment_off;
-	assert( next_alignment_point <= contextp->dc_recendp );
+	next_alignment_point = (char *)next_alignment_off;
+	assert(next_alignment_point <= contextp->dc_recendp);
 
 	/* return the number of bytes to the next alignment offset
 	 */
-	assert( next_alignment_point >= contextp->dc_nextp );
-	return ( size_t )( next_alignment_point - contextp->dc_nextp );
+	assert(next_alignment_point >= contextp->dc_nextp);
+	return (size_t)(next_alignment_point - contextp->dc_nextp);
 }
 
 /* do_end_write - pad and write pending record if any client data in it.
@@ -2014,9 +2014,9 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_end_write( drive_t *drivep, off64_t *ncommittedp )
+do_end_write(drive_t *drivep, off64_t *ncommittedp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t first_rec_w_err; /* zero-based index */
 	off64_t recs_wtn_wo_err;
 	off64_t recs_guaranteed;
@@ -2024,17 +2024,17 @@
 
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: end write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: end write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* pre-initialize return of count of bytes committed to media
 	 */
@@ -2044,46 +2044,46 @@
 	 * to do anymore writes, just cleanup and return 0. don't need to
 	 * do commits, already done when error occured.
 	 */
-	if ( contextp->dc_errorpr ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_errorpr) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_mode = OM_NONE;
-		drive_mark_discard( drivep );
-		*ncommittedp = ( contextp->dc_iocnt - contextp->dc_lostrecmax )
+		drive_mark_discard(drivep);
+		*ncommittedp = (contextp->dc_iocnt - contextp->dc_lostrecmax)
 			       *
-			       ( off64_t )tape_recsz;
+			       (off64_t)tape_recsz;
 		contextp->dc_recp = 0;
 		return 0;
 	}
 
 	/* if any user data in current record buffer, send it out.
 	 */
-	if ( contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ ) {
+	if (contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ) {
 		rec_hdr_t *rechdrp;
 		size_t bufusedcnt;
 
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-		bufusedcnt = ( size_t )( contextp->dc_nextp
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
+		bufusedcnt = (size_t)(contextp->dc_nextp
 					 -
-					 contextp->dc_recp );
+					 contextp->dc_recp);
 		rechdrp->rec_used = bufusedcnt;
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "writing padded last record\n" );
-		if ( contextp->dc_singlethreadedpr ) {
-			rval = write_record( drivep,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "writing padded last record\n");
+		if (contextp->dc_singlethreadedpr) {
+			rval = write_record(drivep,
 					     contextp->dc_recp,
-					     BOOL_TRUE, BOOL_TRUE );
+					     BOOL_TRUE, BOOL_TRUE);
 		} else {
-			assert( contextp->dc_msgp );
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_WRITE;
 			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			switch( contextp->dc_msgp->rm_stat ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				rval = 0;
@@ -2092,7 +2092,7 @@
 				rval = contextp->dc_msgp->rm_rval;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2109,7 +2109,7 @@
 	 * media, and that will be used to select which marks
 	 * to commit and which to discard.
 	 */
-	if ( rval ) {
+	if (rval) {
 		first_rec_w_err = contextp->dc_iocnt;
 			/* because dc_iocnt bumped by write_record
 			 * only if no error
@@ -2117,28 +2117,28 @@
 	} else {
 		first_rec_w_err = -1L;
 	}
-	if ( ! contextp->dc_singlethreadedpr ) {
-		while ( ! rval ) {
-			assert( contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		while (! rval) {
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_TRACE;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			if ( contextp->dc_msgp->rm_op == RING_OP_TRACE ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			if (contextp->dc_msgp->rm_op == RING_OP_TRACE) {
 				break;
 			}
-			switch( contextp->dc_msgp->rm_stat ) {
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
-				assert( rval == 0 );
+				assert(rval == 0);
 				break;
 			case RING_STAT_ERROR:
 				rval = contextp->dc_msgp->rm_rval;
 				first_rec_w_err = contextp->dc_msgp->rm_user;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2147,8 +2147,8 @@
 
 	/* the ring is now flushed. reset
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -2157,16 +2157,16 @@
 	 * side-effect of flushing the driver/drive of pending writes,
 	 * exposing any write errors.
 	 */
-	if ( ! rval ) {
+	if (! rval) {
 		int weofrval;
 
-		weofrval = mt_op( contextp->dc_fd, MTWEOF, 1 );
-		if ( weofrval ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		weofrval = mt_op(contextp->dc_fd, MTWEOF, 1);
+		if (weofrval) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "MTWEOF returned %d: errno == %d (%s)\n",
 			      weofrval,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 			rval = DRIVE_ERROR_EOM;
 		}
 	}
@@ -2185,18 +2185,18 @@
 	 * and return rval. return by reference the number of bytes committed
 	 * to tape.
 	 */
-	if ( rval ) {
-		assert( first_rec_w_err >= 0 );
+	if (rval) {
+		assert(first_rec_w_err >= 0);
 		recs_wtn_wo_err = first_rec_w_err;
 		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
 	} else {
-		assert( first_rec_w_err == -1 );
+		assert(first_rec_w_err == -1);
 		recs_wtn_wo_err = contextp->dc_iocnt;
 		recs_guaranteed = recs_wtn_wo_err;
 	}
-	bytes_committed = recs_guaranteed * ( off64_t )tape_recsz;
-	drive_mark_commit( drivep, bytes_committed );
-	drive_mark_discard( drivep );
+	bytes_committed = recs_guaranteed * (off64_t)tape_recsz;
+	drive_mark_commit(drivep, bytes_committed);
+	drive_mark_discard(drivep);
 	contextp->dc_mode = OM_NONE;
 	*ncommittedp = bytes_committed;
 	return rval;
@@ -2210,45 +2210,45 @@
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_fsf( drive_t *drivep, int count, int *statp )
+do_fsf(drive_t *drivep, int count, int *statp)
 {
 	int 		i, done, op_failed, opcount;
 	drive_context_t *contextp;
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: fsf: count %d\n",
-	      count );
+	      count);
 
-	assert( count );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(count);
+	assert(contextp->dc_mode == OM_NONE);
 
-	for ( i = 0 ; i < count; i++ ) {
+	for (i = 0 ; i < count; i++) {
 		done = 0;
 		opcount = 2;
 
 		/* the tape may encounter errors will trying to
 		 * reach the next file.
 		 */
-		while ( !done ) {
+		while (!done) {
 
 			/* advance the tape to the next file mark
 			 * NOTE:
 			 * 	ignore return code
 			 */
-			mlog( MLOG_VERBOSE | MLOG_DRIVE,
-			      _("advancing tape to next media file\n") );
+			mlog(MLOG_VERBOSE | MLOG_DRIVE,
+			      _("advancing tape to next media file\n"));
 
 			op_failed = 0;
-			assert( contextp->dc_fd >= 0 );
-			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
+			assert(contextp->dc_fd >= 0);
+			if (mt_op(contextp->dc_fd, MTFSF, 1)) {
 				op_failed = 1;
 			}
 
@@ -2264,9 +2264,9 @@
 			 * times, and a file mark has not been reached,
 			 * return an error.
 			 */
-			if ( --opcount < 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_DRIVE,
-					_("FSF tape command failed\n") );
+			if (--opcount < 0) {
+				mlog(MLOG_VERBOSE | MLOG_DRIVE,
+					_("FSF tape command failed\n"));
 
 				*statp = DRIVE_ERROR_DEVICE;
 				return i;
@@ -2286,37 +2286,37 @@
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_bsf( drive_t *drivep, int count, int *statp )
+do_bsf(drive_t *drivep, int count, int *statp)
 {
 #ifdef DEBUG
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	int skipped;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: bsf: count %d\n",
-	      count );
+	      count);
 
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
 	*statp = 0;
 
 	/* back space - places us to left of previous file mark
 	 * if we hit BOT, return
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
-	rval = bsf_and_verify( drivep );
+	assert(drivep->d_capabilities & DRIVE_CAP_BSF);
+	rval = bsf_and_verify(drivep);
 	if (rval) {
 		if (errno == ENOSPC/*IRIX*/ || errno == EIO/*Linux*/) {
-			if ( count ) {
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
+			if (count) {
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
 				      "rmt drive op: bsf reached BOT "
 					    "unexpectedly (%d files to go)\n",
 				       count);
 				/* set statp - BOT is unexpected */
 			} else {
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
 				      "rmt drive op: bsf reached BOT\n");
 				/* don't set statp, BOT is fine */
 				return 0;
@@ -2328,16 +2328,16 @@
 
 	/* now loop, skipping media files
 	 */
-	for ( skipped = 0 ; skipped < count ; skipped++ ) {
+	for (skipped = 0 ; skipped < count ; skipped++) {
 
 		/* move to the left of the next file mark on the left.
 		 * check for BOT.
 		 */
-		rval = bsf_and_verify( drivep );
+		rval = bsf_and_verify(drivep);
 		if (rval) {
 			if (errno == ENOSPC/*IRIX*/ || errno == EIO/*Linux*/) {
-				if ( count - skipped - 1 ) {
-					mlog( MLOG_DEBUG | MLOG_DRIVE,
+				if (count - skipped - 1) {
+					mlog(MLOG_DEBUG | MLOG_DRIVE,
 					      "rmt drive op: bsf reached BOT "
 					      "unexpectedly (%d files to go)\n",
 					      count - skipped - 1);
@@ -2345,7 +2345,7 @@
 					*statp = DRIVE_ERROR_DEVICE;
 					return skipped + 1;
 				} else {
-					mlog( MLOG_DEBUG | MLOG_DRIVE,
+					mlog(MLOG_DEBUG | MLOG_DRIVE,
 					      "rmt drive op: bsf reached BOT\n");
 					/* don't set statp - BOT is fine */
 					return skipped + 1;
@@ -2359,7 +2359,7 @@
 	/* we're not at BOT, so we need to move to the right side of
 	 * the file mark
 	 */
-	( void )fsf_and_verify( drivep );
+	(void)fsf_and_verify(drivep);
 
 	/* indicate the number of media files skipped
 	 */
@@ -2374,21 +2374,21 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_rewind( drive_t *drivep )
+do_rewind(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: rewind\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: rewind\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	( void )rewind_and_verify( drivep );
+	(void)rewind_and_verify(drivep);
 	return 0;
 }
 
@@ -2400,33 +2400,33 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_erase( drive_t *drivep )
+do_erase(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: erase\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: erase\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	(void )rewind_and_verify( drivep );
+	(void)rewind_and_verify(drivep);
 
 	/* use validating tape erase util func
 	 */
-	( void )erase_and_verify( drivep );
+	(void)erase_and_verify(drivep);
 
 	/* rewind again
 	 */
-	( void )rewind_and_verify( drivep );
+	(void)rewind_and_verify(drivep);
 
 	/* close the drive so we start from scratch
 	 */
-	Close( drivep );
+	Close(drivep);
 	return 0;
 }
 
@@ -2438,27 +2438,27 @@
  *	DRIVE_ERROR_DEVICE on failure
  */
 static int
-do_eject_media( drive_t *drivep )
+do_eject_media(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: eject media\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: eject media\n");
 
 	/* drive must be open
 	 */
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* issue tape unload
 	 */
-	if ( contextp->dc_unloadokpr ) {
-		( void )mt_op( contextp->dc_fd, MTUNLOAD, 0 );
+	if (contextp->dc_unloadokpr) {
+		(void)mt_op(contextp->dc_fd, MTUNLOAD, 0);
 	}
 
 	/* close the device driver
 	 */
-	Close( drivep );
+	Close(drivep);
 
 	return 0;
 }
@@ -2471,10 +2471,10 @@
  */
 /* ARGSUSED */
 static int
-do_get_device_class( drive_t *drivep)
+do_get_device_class(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: get device class\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: get device class\n");
 
 	return DEVICE_TAPE_REMOVABLE;
 }
@@ -2482,55 +2482,55 @@
 /* do_display_metrics - print ring stats if using I/O ring
  */
 static void
-do_display_metrics( drive_t *drivep )
+do_display_metrics(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	if ( ringp ) {
-		if ( drivecnt > 1 ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
+	if (ringp) {
+		if (drivecnt > 1) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
 			      _("drive %u "),
-			      drivep->d_index );
+			      drivep->d_index);
 		}
-		display_ring_metrics( drivep,
-				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK );
+		display_ring_metrics(drivep,
+				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK);
 	}
 }
 
 /* do_quit
  */
 static void
-do_quit( drive_t *drivep )
+do_quit(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: quit\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: quit\n");
 
 	/* print the ring metrics and kill the ring
 	 */
-	if ( ringp ) {
-		display_ring_metrics( drivep, MLOG_VERBOSE );
+	if (ringp) {
+		display_ring_metrics(drivep, MLOG_VERBOSE);
 
 		/* tell slave to die
 		 */
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-		      "ring op: destroy\n" );
-		ring_destroy( ringp );
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+		      "ring op: destroy\n");
+		ring_destroy(ringp);
 	}
 
 	Close(drivep);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op quit complete\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op quit complete\n");
 }
 
 static double
-percent64( off64_t num, off64_t denom )
+percent64(off64_t num, off64_t denom)
 {
-	return ( double )( num * 100 ) / ( double )denom;
+	return (double)(num * 100) / (double)denom;
 }
 
 
@@ -2546,7 +2546,7 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-read_label( drive_t *drivep )
+read_label(drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int nread;
@@ -2555,45 +2555,45 @@
 
 	/* initialize context ptr
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* read the first record of the media file directly
 	 */
-	nread = Read( drivep,
+	nread = Read(drivep,
 		      contextp->dc_recp,
 		      tape_recsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	/* if a read error, get status
 	 */
-	if ( nread != ( int )tape_recsz ) {
-		assert( nread < ( int )tape_recsz );
+	if (nread != (int)tape_recsz) {
+		assert(nread < (int)tape_recsz);
 	}
 
 	/* check for an unexpected errno
 	 */
-	if ( nread < 0 && saved_errno != ENOSPC ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (nread < 0 && saved_errno != ENOSPC) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not read from drive: %s (%d)\n"),
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* check for a blank tape/EOD.
 	 */
-	if (( nread == 0 )  /* takes care of sun */
+	if ((nread == 0)  /* takes care of sun */
 	      ||            /* now handle SGI */
-	      (nread < 0 && saved_errno == ENOSPC )) {
+	      (nread < 0 && saved_errno == ENOSPC)) {
 #ifdef DUMP
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("encountered EOD : assuming blank media\n") );
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("encountered EOD : assuming blank media\n"));
 #endif
 #ifdef RESTORE
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("encountered EOD : end of data\n") );
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("encountered EOD : end of data\n"));
 #endif
-		( void )rewind_and_verify( drivep );
+		(void)rewind_and_verify(drivep);
 #ifdef DUMP
 		return DRIVE_ERROR_BLANK;
 #endif
@@ -2607,13 +2607,13 @@
 	 */
 	contextp->dc_iocnt = 1;
 
-	rval = validate_media_file_hdr( drivep );
+	rval = validate_media_file_hdr(drivep);
 
 	return rval;
 }
 
 static int
-validate_media_file_hdr( drive_t *drivep )
+validate_media_file_hdr(drive_t *drivep)
 {
 	global_hdr_t		*grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t		*drhdrp = drivep->d_readhdrp;
@@ -2621,7 +2621,7 @@
 	media_hdr_t		*mrhdrp = (media_hdr_t *)drhdrp->dh_upper;
 	content_hdr_t		*ch = (content_hdr_t *)mrhdrp->mh_upper;
 	content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	char tmpbuf[GLOBAL_HDR_SZ];
 	global_hdr_t		*tmpgh = (global_hdr_t *)&tmpbuf[0];
 	drive_hdr_t		*tmpdh = (drive_hdr_t *)tmpgh->gh_upper;
@@ -2630,22 +2630,22 @@
 	content_hdr_t		*tmpch = (content_hdr_t *)tmpmh->mh_upper;
 	content_inode_hdr_t	*tmpcih = (content_inode_hdr_t *)tmpch->ch_specific;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "validating media file header\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "validating media file header\n");
 
-	memcpy( tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ );
+	memcpy(tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ);
 
 	/* check the checksum
 	 */
-	if ( ! global_hdr_checksum_check( tmpgh )) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! global_hdr_checksum_check(tmpgh)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "bad media file header checksum\n");
 	        return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( ! tape_rec_checksum_check( contextp, contextp->dc_recp )) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("tape record checksum error\n") );
+	if (! tape_rec_checksum_check(contextp, contextp->dc_recp)) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("tape record checksum error\n"));
 		return DRIVE_ERROR_CORRUPTION;
 
 	}
@@ -2657,54 +2657,54 @@
 	xlate_content_inode_hdr(tmpcih, cih, 1);
 	xlate_rec_hdr(tmprh, tprhdrp, 1);
 
-	memcpy( contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ );
+	memcpy(contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ);
 
 	/* check the magic number
 	 */
-	if ( strncmp( grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "missing magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the version
 	 */
-	if ( global_version_check( grhdrp->gh_version ) != BOOL_TRUE ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (global_version_check(grhdrp->gh_version) != BOOL_TRUE) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid version number (%d) in tape label\n",
-		      grhdrp->gh_version );
+		      grhdrp->gh_version);
 	        return DRIVE_ERROR_VERSION;
 	}
 
 	/* check the strategy id
 	 */
-	if ( drhdrp->dh_strategyid != drivep->d_strategyp->ds_id ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (drhdrp->dh_strategyid != drivep->d_strategyp->ds_id) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	               "unrecognized drive strategy ID (%d)\n",
-	               drivep->d_readhdrp->dh_strategyid );
+	               drivep->d_readhdrp->dh_strategyid);
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the record magic number
 	 */
-	if ( tprhdrp->magic != STAPE_MAGIC ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (tprhdrp->magic != STAPE_MAGIC) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid record magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the record version number
 	 */
-	if ( tprhdrp->version != STAPE_VERSION ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (tprhdrp->version != STAPE_VERSION) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid record version number in tape label\n");
 	        return DRIVE_ERROR_VERSION;
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "media file header valid: "
 	      "media file ix %d\n",
-	      mrhdrp->mh_mediafileix );
+	      mrhdrp->mh_mediafileix);
 
 	return 0;
 }
@@ -2720,12 +2720,12 @@
  *	FALSE on error
  */
 static bool_t
-get_tpcaps( drive_t *drivep )
+get_tpcaps(drive_t *drivep)
 {
 #ifdef DEBUG
-	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 #endif
 
 	/* can't ask about blksz, can't set blksz, can't ask about
@@ -2736,7 +2736,7 @@
 	drivep->d_capabilities |= DRIVE_CAP_OVERWRITE;
 	drivep->d_capabilities |= DRIVE_CAP_BSF;
 
-	set_recommended_sizes( drivep );
+	set_recommended_sizes(drivep);
 
 	return BOOL_TRUE;
 }
@@ -2749,32 +2749,32 @@
  *	void
  */
 static void
-set_recommended_sizes( drive_t *drivep )
+set_recommended_sizes(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t	fsize = drive_strategy_rmt.ds_recmfilesz;
 	off64_t	marksep = drive_strategy_rmt.ds_recmarksep;
 
 	if (contextp->dc_filesz > 0) {
 		fsize = contextp->dc_filesz;
 #ifdef DUMP
-		if ( hdr_mfilesz > fsize ) {
-			mlog( MLOG_WARNING, _(
+		if (hdr_mfilesz > fsize) {
+			mlog(MLOG_WARNING, _(
 			      "recommended media file size of %llu Mb less than "
 			      "estimated file header size %llu Mb for %s\n"),
-			      fsize / ( 1024 * 1024 ),
-			      hdr_mfilesz / ( 1024 * 1024 ),
-			      drivep->d_pathname );
+			      fsize / (1024 * 1024),
+			      hdr_mfilesz / (1024 * 1024),
+			      drivep->d_pathname);
 		}
 #endif /* DUMP */
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "recommended tape media file size set to 0x%llx bytes\n",
-	      fsize );
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	      fsize);
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "recommended tape media mark separation set to 0x%llx bytes\n",
-	      marksep );
+	      marksep);
 
 	drivep->d_recmfilesz = fsize;
 	drivep->d_recmarksep = marksep;
@@ -2792,18 +2792,18 @@
  *	-1 on failure
  */
 static int
-mt_op(int fd, int sub_op, int param )
+mt_op(int fd, int sub_op, int param)
 {
 	struct mtop 	mop;
 	char *printstr;
 	int rval;
 
-	mop.mt_op   	= (short )sub_op;
+	mop.mt_op   	= (short)sub_op;
 	mop.mt_count	= param;
 
-	assert( fd >= 0 );
+	assert(fd >= 0);
 
-	switch ( sub_op ) {
+	switch (sub_op) {
 	case MTSEEK:
 		printstr = "seek";
 		break;
@@ -2842,22 +2842,22 @@
 		printstr = "???";
 		break;
 	}
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: %s %d\n",
 	      printstr,
-	      param );
+	      param);
 
-	rval = ioctl( fd, MTIOCTOP, &mop );
-	if ( rval < 0 ) {
+	rval = ioctl(fd, MTIOCTOP, &mop);
+	if (rval < 0) {
 		/* failure
 	 	 */
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "tape op %s %d returns %d: errno == %d (%s)\n",
 		      printstr,
 		      param,
 		      rval,
 		      errno,
-		      strerror( errno ));
+		      strerror(errno));
 		return -1;
 	}
 
@@ -2874,82 +2874,82 @@
  *      DRIVE_ERROR_*
  */
 static int
-determine_write_error( int nwritten, int saved_errno )
+determine_write_error(int nwritten, int saved_errno)
 {
 	int        ret = 0;
 
-	if ( saved_errno == EACCES ) {
+	if (saved_errno == EACCES) {
 		mlog(MLOG_NORMAL,
-			_("tape is write protected\n") );
+			_("tape is write protected\n"));
 
 		ret = DRIVE_ERROR_DEVICE;
 	} else if (
-			( saved_errno == ENOSPC )
+			(saved_errno == ENOSPC)
 				||
-			( saved_errno == EIO )
+			(saved_errno == EIO)
 				||
-			(( saved_errno == 0 ) && ( nwritten >= 0 ))  /* short
+			((saved_errno == 0) && (nwritten >= 0))  /* short
 							write indicates EOM */
 		) {
 		mlog(MLOG_NORMAL,
-			_("tape media error on write operation\n") );
+			_("tape media error on write operation\n"));
 
 		mlog(MLOG_NORMAL,
-			_("no more data can be written to this tape\n") );
+			_("no more data can be written to this tape\n"));
 
 		ret = DRIVE_ERROR_EOM;
-	} else if ( saved_errno != 0 ) {
+	} else if (saved_errno != 0) {
 		ret = DRIVE_ERROR_CORE;
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 			"tape unknown error on write operation: "
 			"%d, %d\n",
 			nwritten, saved_errno);
 	}
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 		"tape write operation nwritten %d, errno %d\n",
 		nwritten,
 		saved_errno);
 
-	return ( ret );
+	return (ret);
 
 }
 
 static void
-tape_rec_checksum_set( drive_context_t *contextp, char *bufp )
+tape_rec_checksum_set(drive_context_t *contextp, char *bufp)
 {
-	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	uint32_t *beginp = ( uint32_t * )bufp;
-	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	rec_hdr_t *rechdrp = (rec_hdr_t *)bufp;
+	uint32_t *beginp = (uint32_t *)bufp;
+	uint32_t *endp = (uint32_t *)(bufp + tape_recsz);
 	uint32_t *p;
 	uint32_t accum;
 
-	if ( ! contextp->dc_recchksumpr ) {
+	if (! contextp->dc_recchksumpr) {
 		return;
 	}
 
 	INT_SET(rechdrp->ischecksum, ARCH_CONVERT, 1);
 	rechdrp->checksum = 0;
 	accum = 0;
-	for ( p = beginp ; p < endp ; p++ ) {
+	for (p = beginp ; p < endp ; p++) {
 	        accum += INT_GET(*p, ARCH_CONVERT);
 	}
-	INT_SET(rechdrp->checksum, ARCH_CONVERT, ( int32_t )( ~accum + 1 ));
+	INT_SET(rechdrp->checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
 }
 
 static bool_t
-tape_rec_checksum_check( drive_context_t *contextp, char *bufp )
+tape_rec_checksum_check(drive_context_t *contextp, char *bufp)
 {
-	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	uint32_t *beginp = ( uint32_t * )bufp;
-	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	rec_hdr_t *rechdrp = (rec_hdr_t *)bufp;
+	uint32_t *beginp = (uint32_t *)bufp;
+	uint32_t *endp = (uint32_t *)(bufp + tape_recsz);
 	uint32_t *p;
 	uint32_t accum;
 
-	if ( contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT) ) {
+	if (contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
 		accum = 0;
-		for ( p = beginp ; p < endp ; p++ ) {
+		for (p = beginp ; p < endp ; p++) {
 	       		accum += INT_GET(*p, ARCH_CONVERT);
 		}
 		return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
@@ -2962,75 +2962,75 @@
  */
 #ifdef RMTDBG
 static int
-dbgrmtopen( char *path, int flags )
+dbgrmtopen(char *path, int flags)
 {
 	int rval;
-	rval = rmtopen( path, flags );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtopen(path, flags);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTOPEN( %s, %d ) returns %d: errno=%d (%s)\n"),
 	      path,
 	      flags,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtclose( int fd )
+dbgrmtclose(int fd)
 {
 	int rval;
-	rval = rmtclose( fd );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtclose(fd);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTCLOSE( %d ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtioctl( int fd, int op, void *arg )
+dbgrmtioctl(int fd, int op, void *arg)
 {
 	int rval;
-	rval = rmtioctl( fd, op, arg );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtioctl(fd, op, arg);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTIOCTL( %d, %d, 0x%x ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      op,
 	      arg,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtread( int fd, void *p, uint sz )
+dbgrmtread(int fd, void *p, uint sz)
 {
 	int rval;
-	rval = rmtread( fd, p, sz );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtread(fd, p, sz);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTREAD( %d, 0x%x, %u ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      p,
 	      sz,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtwrite( int fd, void *p, uint sz )
+dbgrmtwrite(int fd, void *p, uint sz)
 {
 	int rval;
-	rval = rmtwrite( fd, p, sz );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtwrite(fd, p, sz);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTWRITE( %d, 0x%x, %u ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      p,
 	      sz,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 #endif /* RMTDBG */
@@ -3042,14 +3042,14 @@
  *	void
  */
 static void
-display_access_failed_message( drive_t *drivep )
+display_access_failed_message(drive_t *drivep)
 {
-	mlog( MLOG_NORMAL | MLOG_DRIVE, _(
+	mlog(MLOG_NORMAL | MLOG_DRIVE, _(
 		"attempt to access/open remote "
 		"tape drive %s failed: %d (%s)\n"),
 		drivep->d_pathname,
 		errno,
-		strerror( errno ));
+		strerror(errno));
 	return;
 }
 
@@ -3059,7 +3059,7 @@
  * xfsdumps on media.
  */
 static int
-prepare_drive( drive_t *drivep )
+prepare_drive(drive_t *drivep)
 {
 	drive_context_t	*contextp;
 	bool_t ok;
@@ -3070,46 +3070,46 @@
 
 	/* get pointer to drive context
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 /* retry: */
-	if ( cldmgr_stop_requested( )) {
+	if (cldmgr_stop_requested()) {
 		return DRIVE_ERROR_STOP;
 	}
 
 	/* shouldn't be here if drive is open
 	 */
-	assert( contextp->dc_fd == -1 );
+	assert(contextp->dc_fd == -1);
 
-	mlog( MLOG_VERBOSE | MLOG_DRIVE,
-	      _("preparing drive\n") );
+	mlog(MLOG_VERBOSE | MLOG_DRIVE,
+	      _("preparing drive\n"));
 
 	/* determine if tape is present or write protected. try several times.
 	 * if not present or write-protected during dump, return.
 	 */
 	maxtries = 15;
-	for ( try = 1 ; ; sleep( 10 ), try++ ) {
-		if ( cldmgr_stop_requested( )) {
+	for (try = 1 ; ; sleep(10), try++) {
+		if (cldmgr_stop_requested()) {
 			return DRIVE_ERROR_STOP;
 		}
 
 		/* open the drive
 	 	 */
-		ok = Open( drivep );
-		if ( ! ok ) {
-			if ( errno != EBUSY ) {
-				display_access_failed_message( drivep );
+		ok = Open(drivep);
+		if (! ok) {
+			if (errno != EBUSY) {
+				display_access_failed_message(drivep);
 				return DRIVE_ERROR_DEVICE;
 			} else {
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
-				      "open drive returns EBUSY\n" );
-				if ( try >= maxtries ) {
-					mlog( MLOG_TRACE | MLOG_DRIVE,
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
+				      "open drive returns EBUSY\n");
+				if (try >= maxtries) {
+					mlog(MLOG_TRACE | MLOG_DRIVE,
 					      "giving up waiting for drive "
-					      "to indicate online\n" );
+					      "to indicate online\n");
 					return DRIVE_ERROR_MEDIA;
 				}
-				Close( drivep );
+				Close(drivep);
 				continue;
 			}
 		} else
@@ -3120,8 +3120,8 @@
 	 * and contextp->dc_{...}blksz and dc_isQICpr, as well as recommended
 	 * mark separation and media file size.
 	 */
-	ok = get_tpcaps( drivep );
-	if ( ! ok ) {
+	ok = get_tpcaps(drivep);
+	if (! ok) {
 		return DRIVE_ERROR_DEVICE;
 	}
 
@@ -3131,19 +3131,19 @@
 	 * guess.
 	 */
 	tape_blksz = cmdlineblksize;
-	if ( tape_blksz > STAPE_MAX_RECSZ ) {
+	if (tape_blksz > STAPE_MAX_RECSZ) {
 		tape_blksz = STAPE_MAX_RECSZ;
 	}
-	if ( contextp->dc_isQICpr == BOOL_TRUE )
+	if (contextp->dc_isQICpr == BOOL_TRUE)
 		tape_recsz = STAPE_MIN_MAX_BLKSZ;
 	else
 		tape_recsz = tape_blksz;
 
 	/* if the overwrite option was specified , return.
 	 */
-	if ( contextp->dc_overwritepr ) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-			"Overwrite option specified.\n" );
+	if (contextp->dc_overwritepr) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+			"Overwrite option specified.\n");
 		return DRIVE_ERROR_OVERWRITE;
 	}
 
@@ -3157,74 +3157,74 @@
 	maxtries = 5;
 	changedblkszpr = BOOL_FALSE;
 
-	for ( try = 1 ; ; try++ ) {
+	for (try = 1 ; ; try++) {
 		int nread;
 		int saved_errno;
 
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return DRIVE_ERROR_STOP;
 		}
 
 		/* bail out if we've tried too many times
 		 */
-		if ( try > maxtries ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		if (try > maxtries) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("giving up attempt to determining "
-			      "tape record size\n") );
+			      "tape record size\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "determining tape record size: trying %d (0x%x) bytes\n",
 		      tape_recsz,
-		      tape_recsz );
+		      tape_recsz);
 
 		/* read a record. use the first ring buffer
 		 */
 		saved_errno = 0;
-		nread = Read( drivep,
+		nread = Read(drivep,
 			      contextp->dc_recp,
 			      tape_recsz,
-			      &saved_errno );
-		assert( saved_errno == 0 || nread < 0 );
+			      &saved_errno);
+		assert(saved_errno == 0 || nread < 0);
 
 		/* RMT can require a retry
 		 */
-		if ( saved_errno == EAGAIN ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-			      "read returned EAGAIN: retrying\n" );
+		if (saved_errno == EAGAIN) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+			      "read returned EAGAIN: retrying\n");
 			continue;
 		}
 
 		/* block size is bigger than buffer; should never happen
 		 */
-		if ( saved_errno == EINVAL ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == EINVAL) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned EINVAL: "
-			      "trying new record size\n" );
+			      "trying new record size\n");
 			goto largersize;
 		}
 
 		/* block size is bigger than buffer; should never happen
 		 */
-		if ( saved_errno == ENOMEM ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == ENOMEM) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned ENOMEM: "
-			      "trying new record size\n" );
+			      "trying new record size\n");
 			goto largersize;
 		}
 
 
 		/* I/O error
 		 */
-		if ( saved_errno == EIO ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == EIO) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned EIO: will reopen, "
-			      "and try again\n" );
-			Close( drivep );
-			ok = Open( drivep );
-			if ( ! ok ) {
-				display_access_failed_message( drivep );
+			      "and try again\n");
+			Close(drivep);
+			ok = Open(drivep);
+			if (! ok) {
+				display_access_failed_message(drivep);
 				return DRIVE_ERROR_DEVICE;
 			}
 #ifdef RESTORE
@@ -3240,14 +3240,14 @@
 
 		/* ENOSPC
 		 */
-		if ( saved_errno == ENOSPC ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == ENOSPC) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned ENOSPC: will reopen, "
-			      "and try again\n" );
-			Close( drivep );
-			ok = Open( drivep );
-			if ( ! ok ) {
-				display_access_failed_message( drivep );
+			      "and try again\n");
+			Close(drivep);
+			ok = Open(drivep);
+			if (! ok) {
+				display_access_failed_message(drivep);
 				return DRIVE_ERROR_DEVICE;
 			}
 #ifdef RESTORE
@@ -3263,19 +3263,19 @@
 #endif
 		}
 
-		if ( nread == ( int )tape_recsz ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (nread == (int)tape_recsz) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == selected blocksize "
-			  "indicates correct blocksize found\n" );
+			  "indicates correct blocksize found\n");
 			goto checkhdr;
 		}
 
 		/* short read */
-		if (( saved_errno == 0 ) && ( nread < (int)tape_recsz)) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if ((saved_errno == 0) && (nread < (int)tape_recsz)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread < selected blocksize "
 			  "indicates incorrect blocksize found "
-			  "or foreign media\n" );
+			  "or foreign media\n");
 			return DRIVE_ERROR_FOREIGN;
 		}
 
@@ -3283,7 +3283,7 @@
 		/* if we fell through the seive, code is wrong.
 		 * display useful info and abort
 		 */
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
 		      "unexpected tape error: "
 		      "errno %d "
 		      "nread %d "
@@ -3294,7 +3294,7 @@
 		      nread,
 		      tape_blksz,
 		      tape_recsz,
-		      0 );
+		      0);
 
 
 
@@ -3302,18 +3302,18 @@
 		return DRIVE_ERROR_MEDIA;
 
 checkhdr:
-		rval = validate_media_file_hdr( drivep );
-		if ( rval ) {
-			if ( rval == DRIVE_ERROR_VERSION ) {
+		rval = validate_media_file_hdr(drivep);
+		if (rval) {
+			if (rval == DRIVE_ERROR_VERSION) {
 				global_hdr_t *grhdrp = drivep->d_greadhdrp;
-				mlog( MLOG_NORMAL | MLOG_DRIVE, _(
+				mlog(MLOG_NORMAL | MLOG_DRIVE, _(
 				      "media file header version (%d) "
 				      "invalid: advancing\n"),
-				      grhdrp->gh_version );
+				      grhdrp->gh_version);
 				continue;
 			} else {
-				if ( isefsdump( drivep )) {
-					mlog( MLOG_NORMAL
+				if (isefsdump(drivep)) {
+					mlog(MLOG_NORMAL
 					      |
 					      MLOG_WARNING
 					      |
@@ -3321,21 +3321,21 @@
 					      _("may be an EFS dump at BOT\n"));
 				} else
 				/* Check if the tape was erased by us */
-				if  ( isxfsdumperasetape( drivep )) {
-					mlog( MLOG_NORMAL | MLOG_DRIVE,
+				if  (isxfsdumperasetape(drivep)) {
+					mlog(MLOG_NORMAL | MLOG_DRIVE,
 					      _("This tape was erased earlier "
-					      "by xfsdump.\n") );
-					( void )rewind_and_verify( drivep );
+					      "by xfsdump.\n"));
+					(void)rewind_and_verify(drivep);
 					return DRIVE_ERROR_BLANK;
 				} else {
-					mlog( MLOG_NORMAL | MLOG_DRIVE,
+					mlog(MLOG_NORMAL | MLOG_DRIVE,
 					      _("bad media file header at BOT "
 					      "indicates foreign or "
-					      "corrupted tape\n") );
+					      "corrupted tape\n"));
 				}
-				( void )rewind_and_verify( drivep );
-				ok = set_best_blk_and_rec_sz( drivep );
-				if ( ! ok ) {
+				(void)rewind_and_verify(drivep);
+				ok = set_best_blk_and_rec_sz(drivep);
+				if (! ok) {
 					return DRIVE_ERROR_DEVICE;
 				}
 				return DRIVE_ERROR_FOREIGN;
@@ -3344,9 +3344,9 @@
 			drive_hdr_t *drhdrp;
 			rec_hdr_t *tprhdrp;
 			drhdrp = drivep->d_readhdrp;
-			tprhdrp = ( rec_hdr_t * )drhdrp->dh_specific;
-			assert( tprhdrp->recsize >= 0 );
-			tape_recsz = ( size_t )tprhdrp->recsize;
+			tprhdrp = (rec_hdr_t *)drhdrp->dh_specific;
+			assert(tprhdrp->recsize >= 0);
+			tape_recsz = (size_t)tprhdrp->recsize;
 			break;
 		}
 
@@ -3354,44 +3354,44 @@
 		/* we end up here if we want to try a new larger record size
 		 * because the last one was not big enough for the tape block
 		 */
-		if ( changedblkszpr ) {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
+		if (changedblkszpr) {
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
 			      _("cannot determine tape block size "
-			      "after two tries\n") );
-				mlog( MLOG_NORMAL | MLOG_DRIVE,
+			      "after two tries\n"));
+				mlog(MLOG_NORMAL | MLOG_DRIVE,
 				      _("assuming media is corrupt "
-				      "or contains non-xfsdump data\n") );
-				ok = set_best_blk_and_rec_sz( drivep );
-				if ( ! ok ) {
+				      "or contains non-xfsdump data\n"));
+				ok = set_best_blk_and_rec_sz(drivep);
+				if (! ok) {
 					return DRIVE_ERROR_DEVICE;
 				}
 				return DRIVE_ERROR_FOREIGN;
 		}
                 /* Make it as large as we can go
                  */
-		if ( tape_recsz != STAPE_MAX_RECSZ ) {
+		if (tape_recsz != STAPE_MAX_RECSZ) {
 			tape_recsz = STAPE_MAX_RECSZ;
-			if ( ! contextp->dc_isQICpr ) {
+			if (! contextp->dc_isQICpr) {
 				tape_blksz = tape_recsz;;
 			}
 			changedblkszpr = BOOL_TRUE;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
-			      _("cannot determine tape block size\n") );
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
+			      _("cannot determine tape block size\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 		continue;
 
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "read first record of first media file encountered on media: "
 	      "recsz == %u\n",
-	      tape_recsz );
+	      tape_recsz);
 
 	/* calculate maximum bytes lost without error at end of tape
 	 */
-	calc_max_lost( drivep );
+	calc_max_lost(drivep);
 
 	contextp->dc_iocnt = 1;
 	return 0;
@@ -3400,9 +3400,9 @@
 /* if BOOL_FALSE returned, errno is valid
  */
 static bool_t
-Open( drive_t *drivep )
+Open(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int oflags;
 
 #ifdef DUMP
@@ -3412,15 +3412,15 @@
 	oflags = O_RDONLY;
 #endif /* RESTORE */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: opening drive\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: opening drive\n");
 
-	assert( contextp->dc_fd == -1 );
+	assert(contextp->dc_fd == -1);
 
 	errno = 0;
-	contextp->dc_fd = open( drivep->d_pathname, oflags );
+	contextp->dc_fd = open(drivep->d_pathname, oflags);
 
-	if ( contextp->dc_fd <= 0 ) {
+	if (contextp->dc_fd <= 0) {
 		return BOOL_FALSE;
 	}
 
@@ -3428,87 +3428,87 @@
 }
 
 static void
-Close( drive_t *drivep )
+Close(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: closing drive\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: closing drive\n");
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 
-	( void )close( contextp->dc_fd );
+	(void)close(contextp->dc_fd);
 
 	contextp->dc_fd = -1;
 }
 
 static int
-Read( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
+Read(drive_t *drivep, char *bufp, size_t cnt, int *errnop)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nread;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: reading %u bytes\n",
-	      cnt );
+	      cnt);
 
-	assert( contextp->dc_fd >= 0 );
-	assert( bufp );
+	assert(contextp->dc_fd >= 0);
+	assert(bufp);
 	*errnop = 0;
 	errno = 0;
-	nread = read( contextp->dc_fd, ( void * )bufp, cnt );
-	if ( nread < 0 ) {
+	nread = read(contextp->dc_fd, (void *)bufp, cnt);
+	if (nread < 0) {
 		*errnop = errno;
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes failed: errno == %d (%s)\n",
 		      cnt,
 		      errno,
-		      strerror( errno ));
-	} else if ( nread != ( int )cnt ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		      strerror(errno));
+	} else if (nread != (int)cnt) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes short: nread == %d\n",
 		      cnt,
-		      nread );
+		      nread);
 	} else {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes successful\n",
-		      cnt );
+		      cnt);
 	}
 
 	return nread;
 }
 
 static int
-Write( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
+Write(drive_t *drivep, char *bufp, size_t cnt, int *errnop)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nwritten;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: writing %u bytes\n",
-	      cnt );
+	      cnt);
 
-	assert( contextp->dc_fd >= 0 );
-	assert( bufp );
+	assert(contextp->dc_fd >= 0);
+	assert(bufp);
 	*errnop = 0;
 	errno = 0;
-	nwritten = write( contextp->dc_fd, ( void * )bufp, cnt );
-	if ( nwritten < 0 ) {
+	nwritten = write(contextp->dc_fd, (void *)bufp, cnt);
+	if (nwritten < 0) {
 		*errnop = errno;
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes failed: errno == %d (%s)\n",
 		      cnt,
 		      errno,
-		      strerror( errno ));
-	} else if ( nwritten != ( int )cnt ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		      strerror(errno));
+	} else if (nwritten != (int)cnt) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes short: nwritten == %d\n",
 		      cnt,
-		      nwritten );
+		      nwritten);
 	} else {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes successful\n",
-		      cnt );
+		      cnt);
 	}
 
 	return nwritten;
@@ -3518,44 +3518,44 @@
  * indication.
  */
 static int
-record_hdr_validate( drive_t *drivep, char *bufp, bool_t chkoffpr )
+record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	rec_hdr_t rechdr;
 	rec_hdr_t *rechdrp = &rechdr;
-	rec_hdr_t *tmprh = ( rec_hdr_t * )bufp;
+	rec_hdr_t *tmprh = (rec_hdr_t *)bufp;
 
-	if ( ! tape_rec_checksum_check( contextp, bufp )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (! tape_rec_checksum_check(contextp, bufp)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: bad record checksum\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 
 	}
 
 	xlate_rec_hdr(tmprh, rechdrp, 1);
 
-	if ( rechdrp->magic != STAPE_MAGIC )  {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rechdrp->magic != STAPE_MAGIC)  {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: bad magic number\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( uuid_is_null( rechdrp->dump_uuid )) {
+	if (uuid_is_null(rechdrp->dump_uuid)) {
 
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: null dump id\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if (  uuid_compare( grhdrp->gh_dumpid,
-			   rechdrp->dump_uuid ) != 0) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (uuid_compare(grhdrp->gh_dumpid,
+			   rechdrp->dump_uuid) != 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: dump id mismatch\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
@@ -3563,48 +3563,48 @@
 	 * 5.3 version of xfsdump did not set it properly.
 	 */
 #ifdef RECSZCHK
-	if ( ( size_t )rechdrp->recsize != tape_recsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE, _(
+	if ((size_t)rechdrp->recsize != tape_recsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE, _(
 		      "record %lld corrupt: incorrect record size in header\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 #else /* RECSZCHK */
-	mlog( (MLOG_NITTY + 1) | MLOG_NOTE | MLOG_DRIVE,
+	mlog((MLOG_NITTY + 1) | MLOG_NOTE | MLOG_DRIVE,
 	      "record %lld header record size %d (0x%x)\n",
 	      contextp->dc_iocnt - 1,
 	      rechdrp->recsize,
-	      rechdrp->recsize );
+	      rechdrp->recsize);
 #endif /* RECSZCHK */
 
-	if ( rechdrp->file_offset % ( off64_t )tape_recsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rechdrp->file_offset % (off64_t)tape_recsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: record offset in header "
 		      "not a multiple of record size\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( chkoffpr
+	if (chkoffpr
 	     &&
 	     rechdrp->file_offset
 	     !=
-	     ( contextp->dc_iocnt - 1 ) * ( off64_t )tape_recsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	     (contextp->dc_iocnt - 1) * (off64_t)tape_recsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: "
 		      "incorrect record offset in header (0x%llx)\n"),
 		      contextp->dc_iocnt - 1,
-		      rechdrp->file_offset );
+		      rechdrp->file_offset);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( rechdrp->rec_used > tape_recsz
+	if (rechdrp->rec_used > tape_recsz
 	     ||
-	     rechdrp->rec_used < STAPE_HDR_SZ ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	     rechdrp->rec_used < STAPE_HDR_SZ) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: "
 		      "incorrect record padding offset in header\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
@@ -3617,27 +3617,27 @@
  * return 0 on success.
  */
 static int
-read_record(  drive_t *drivep, char *bufp )
+read_record(drive_t *drivep, char *bufp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nread;
 	int saved_errno;
 	int rval;
 
-	nread = Read( drivep, bufp, tape_recsz, &saved_errno );
+	nread = Read(drivep, bufp, tape_recsz, &saved_errno);
 
-	if ( nread == ( int )tape_recsz ) {
+	if (nread == (int)tape_recsz) {
 		contextp->dc_iocnt++;
-		rval = record_hdr_validate( drivep, bufp, BOOL_TRUE );
+		rval = record_hdr_validate(drivep, bufp, BOOL_TRUE);
 		return rval;
 	}
 
 	/* check for a blank tape/EOD.
 	 */
-	if (( nread == 0 )  /* takes care of sun */
+	if ((nread == 0)  /* takes care of sun */
 		||            /* now handle SGI */
-	    (nread < 0 && saved_errno == ENOSPC )) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+	    (nread < 0 && saved_errno == ENOSPC)) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 #ifdef DUMP
 		_("read_record encountered EOD : assuming blank media\n")
 #endif
@@ -3655,9 +3655,9 @@
 
 	/* some other error
 	 */
-	if ( saved_errno == EIO ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
-		      _("unexpected EIO error attempting to read record\n") );
+	if (saved_errno == EIO) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		      _("unexpected EIO error attempting to read record\n"));
 #ifdef RESTORE
 		return DRIVE_ERROR_EOM;
 #endif
@@ -3668,54 +3668,54 @@
 
 	/* short read
 	 */
-	if ( nread >= 0 ) {
-		assert( nread <= ( int )tape_recsz );
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (nread >= 0) {
+		assert(nread <= (int)tape_recsz);
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "short read record %lld (nread == %d)\n",
 		      contextp->dc_iocnt,
-		      nread );
+		      nread);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
 	/* some other error
 	 */
-	mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 	      _("unexpected error attempting to read record %lld: "
 	      "read returns %d, errno %d (%s)\n"),
 	      contextp->dc_iocnt,
 	      nread,
 	      saved_errno,
-	      strerror( saved_errno ));
+	      strerror(saved_errno));
 	return DRIVE_ERROR_CORRUPTION;
 }
 
 static int
-ring_read( void *clientctxp, char *bufp )
+ring_read(void *clientctxp, char *bufp)
 {
-	return read_record( ( drive_t * )clientctxp, bufp );
+	return read_record((drive_t *)clientctxp, bufp);
 }
 
 /* gets another record IF dc_recp is NULL
  */
 static int
-getrec( drive_t *drivep )
+getrec(drive_t *drivep)
 {
 	drive_context_t *contextp;
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	while ( ! contextp->dc_recp ) {
+	while (! contextp->dc_recp) {
 		rec_hdr_t *rechdrp;
-		if ( contextp->dc_singlethreadedpr ) {
+		if (contextp->dc_singlethreadedpr) {
 			int rval;
 			contextp->dc_recp = contextp->dc_bufp;
-			rval = read_record( drivep, contextp->dc_recp );
-			if ( rval ) {
+			rval = read_record(drivep, contextp->dc_recp);
+			if (rval) {
 				contextp->dc_errorpr = BOOL_TRUE;
 				return rval;
 			}
 		} else {
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			switch( contextp->dc_msgp->rm_stat ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 				contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 				break;
@@ -3723,20 +3723,20 @@
 			case RING_STAT_NOPACK:
 			case RING_STAT_IGNORE:
 				contextp->dc_msgp->rm_op = RING_OP_READ;
-				Ring_put( contextp->dc_ringp,
-					  contextp->dc_msgp );
+				Ring_put(contextp->dc_ringp,
+					  contextp->dc_msgp);
 				contextp->dc_msgp = 0;
 				continue;
 			case RING_STAT_ERROR:
 				contextp->dc_errorpr = BOOL_TRUE;
 				return contextp->dc_msgp->rm_rval;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_errorpr = BOOL_TRUE;
 				return DRIVE_ERROR_CORE;
 			}
 		}
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
 		contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 		contextp->dc_dataendp = contextp->dc_recp
 				        +
@@ -3744,7 +3744,7 @@
 		contextp->dc_nextp = contextp->dc_recp
 				     +
 				     STAPE_HDR_SZ;
-		assert( contextp->dc_nextp <= contextp->dc_dataendp );
+		assert(contextp->dc_nextp <= contextp->dc_dataendp);
 	}
 
 	return 0;
@@ -3755,73 +3755,73 @@
  */
 /*ARGSUSED*/
 static int
-write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
+write_record(drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nwritten;
 	int saved_errno;
 	int rval;
 
-        if ( xlatepr ) {
+        if (xlatepr) {
 		rec_hdr_t rechdr;
-		memcpy( &rechdr, bufp, sizeof(rechdr) );
-		xlate_rec_hdr( &rechdr, ( rec_hdr_t * )bufp, 1 );
+		memcpy(&rechdr, bufp, sizeof(rechdr));
+		xlate_rec_hdr(&rechdr, (rec_hdr_t *)bufp, 1);
 	}
 
-	if ( chksumpr ) {
-		tape_rec_checksum_set( contextp, bufp );
+	if (chksumpr) {
+		tape_rec_checksum_set(contextp, bufp);
 	}
 
-	nwritten = Write( drivep, bufp, tape_recsz, &saved_errno );
+	nwritten = Write(drivep, bufp, tape_recsz, &saved_errno);
 
-	if ( nwritten == ( int )tape_recsz ) {
+	if (nwritten == (int)tape_recsz) {
 		contextp->dc_iocnt++;
 		return 0;
 	}
 
-	rval = determine_write_error( nwritten, saved_errno );
+	rval = determine_write_error(nwritten, saved_errno);
 	assert(rval);
 
 	return rval;
 }
 
 static int
-ring_write( void *clientctxp, char *bufp )
+ring_write(void *clientctxp, char *bufp)
 {
-	return write_record( ( drive_t * )clientctxp, bufp, BOOL_TRUE, BOOL_TRUE );
+	return write_record((drive_t *)clientctxp, bufp, BOOL_TRUE, BOOL_TRUE);
 }
 
 static ring_msg_t *
-Ring_get( ring_t *ringp )
+Ring_get(ring_t *ringp)
 {
 	ring_msg_t *msgp;
 
-	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-	      "ring op: get\n" );
+	mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+	      "ring op: get\n");
 
-	msgp = ring_get( ringp );
+	msgp = ring_get(ringp);
 	return msgp;
 }
 
 static void
-Ring_put(  ring_t *ringp, ring_msg_t *msgp )
+Ring_put(ring_t *ringp, ring_msg_t *msgp)
 {
-	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
+	mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: put %d\n",
-	      msgp->rm_op );
+	      msgp->rm_op);
 
-	ring_put( ringp, msgp );
+	ring_put(ringp, msgp);
 }
 
 static void
-Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
+Ring_reset(ring_t *ringp, ring_msg_t *msgp)
 {
-	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-	      "ring op: reset\n" );
+	mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+	      "ring op: reset\n");
 
-	assert( ringp );
+	assert(ringp);
 
-	ring_reset( ringp, msgp );
+	ring_reset(ringp, msgp);
 }
 
 /* a simple heuristic to calculate the maximum uncertainty
@@ -3829,11 +3829,11 @@
  * end of media.
  */
 static void
-calc_max_lost( drive_t *drivep )
+calc_max_lost(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	if ( contextp->dc_isQICpr ) {
+	if (contextp->dc_isQICpr) {
 		contextp->dc_lostrecmax = 1;
 	} else {
 		contextp->dc_lostrecmax = 2;
@@ -3842,29 +3842,29 @@
 }
 
 static void
-display_ring_metrics( drive_t *drivep, int mlog_flags )
+display_ring_metrics(drive_t *drivep, int mlog_flags)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
-	char bufszbuf[ 16 ];
+	char bufszbuf[16];
 	char *bufszsfxp;
 
-	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
-		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
-		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
-		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
+	if (tape_recsz == STAPE_MIN_MAX_BLKSZ) {
+		assert(! (STAPE_MIN_MAX_BLKSZ % 0x400));
+		sprintf(bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400);
+		assert(strlen(bufszbuf) < sizeof(bufszbuf));
 		bufszsfxp = _("KB");
-	} else if ( tape_recsz == STAPE_MAX_RECSZ ) {
-		assert( ! ( STAPE_MAX_RECSZ % 0x100000 ));
-		sprintf( bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000 );
-		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
+	} else if (tape_recsz == STAPE_MAX_RECSZ) {
+		assert(! (STAPE_MAX_RECSZ % 0x100000));
+		sprintf(bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000);
+		assert(strlen(bufszbuf) < sizeof(bufszbuf));
 		bufszsfxp = _("MB");
 	} else {
-		sprintf( bufszbuf, "%u", (unsigned int)(tape_recsz / 0x400) );
+		sprintf(bufszbuf, "%u", (unsigned int)(tape_recsz / 0x400));
 		bufszsfxp = _("KB");
 	}
 
-	mlog( mlog_flags, _(
+	mlog(mlog_flags, _(
 	      "I/O metrics: "
 	      "%u by %s%s %sring; "
 	      "%lld/%lld (%.0lf%%) records streamed; "
@@ -3875,13 +3875,13 @@
 	      contextp->dc_ringpinnedpr ? _("pinned ") : "",
 	      ringp->r_slave_msgcnt - ringp->r_slave_blkcnt,
 	      ringp->r_slave_msgcnt,
-	      percent64( ringp->r_slave_msgcnt - ringp->r_slave_blkcnt,
-			 ringp->r_slave_msgcnt ),
-	      ( double )( ringp->r_all_io_cnt )
+	      percent64(ringp->r_slave_msgcnt - ringp->r_slave_blkcnt,
+			 ringp->r_slave_msgcnt),
+	      (double)(ringp->r_all_io_cnt)
 	      *
-	      ( double )tape_recsz
+	      (double)tape_recsz
 	      /
-	      ( double )( time( 0 ) - ringp->r_first_io_time ));
+	      (double)(time(0) - ringp->r_first_io_time));
 }
 
 #ifdef CLRMTAUD
@@ -3889,24 +3889,24 @@
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
-rewind_and_verify( drive_t *drivep )
+rewind_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	ix_t try;
 	int rval;
 
-	rval = mt_op( contextp->dc_fd, MTREW, 0 );
-	for ( try = 1 ; ; try++ ) {
-		if ( rval ) {
-			sleep( 1 );
-			rval = mt_op( contextp->dc_fd, MTREW, 0 );
+	rval = mt_op(contextp->dc_fd, MTREW, 0);
+	for (try = 1 ; ; try++) {
+		if (rval) {
+			sleep(1);
+			rval = mt_op(contextp->dc_fd, MTREW, 0);
 		} else
 			return 0;
 
-		if ( try >= MTOP_TRIES_MAX ) {
+		if (try >= MTOP_TRIES_MAX) {
 			return 0;
 		}
-		sleep( 1 );
+		sleep(1);
 	}
 	/* NOTREACHED */
 }
@@ -3916,28 +3916,28 @@
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
-erase_and_verify( drive_t *drivep )
+erase_and_verify(drive_t *drivep)
 {
 	char *tempbufp;
 	int saved_errno;
 
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt : erase_and_verify\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt : erase_and_verify\n");
 
 	/* Erase is not standard rmt. So we cannot use the line below.
 
-	( void )mt_op( contextp->dc_fd, MTERASE, 0 );
+	(void)mt_op(contextp->dc_fd, MTERASE, 0);
 
 	 * So write a record of zeros to fake erase . Poor man's erase!
 	 * We put the ERASE_MAGIC string at the beginning so we can
 	 * detect if we have erased the tape.
 	 */
 
-	tempbufp = (char *) calloc( 1 , ( size_t )tape_recsz );
-	strcpy( tempbufp, ERASE_MAGIC );
-	Write( drivep, tempbufp, tape_recsz, &saved_errno );
+	tempbufp = (char *) calloc(1 , (size_t)tape_recsz);
+	strcpy(tempbufp, ERASE_MAGIC);
+	Write(drivep, tempbufp, tape_recsz, &saved_errno);
 	free(tempbufp);
 
 	return 0;
@@ -3948,11 +3948,11 @@
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
-bsf_and_verify( drive_t *drivep )
+bsf_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	return mt_op( contextp->dc_fd, MTBSF, 1 );
+	return mt_op(contextp->dc_fd, MTBSF, 1);
 }
 
 #ifdef CLRMTAUD
@@ -3960,21 +3960,21 @@
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
-fsf_and_verify( drive_t *drivep )
+fsf_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	( void )mt_op( contextp->dc_fd, MTFSF, 1 );
+	(void)mt_op(contextp->dc_fd, MTFSF, 1);
 
 	return 0;
 }
 
 static bool_t
-set_best_blk_and_rec_sz( drive_t *drivep )
+set_best_blk_and_rec_sz(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	if ( contextp->dc_isQICpr == BOOL_TRUE )
+	if (contextp->dc_isQICpr == BOOL_TRUE)
 		tape_recsz = STAPE_MIN_MAX_BLKSZ;
 	else
 		tape_recsz = cmdlineblksize;
@@ -3983,13 +3983,13 @@
 }
 
 static bool_t
-isefsdump( drive_t *drivep )
+isefsdump(drive_t *drivep)
 {
-	int32_t *efshdrp = ( int32_t * )drivep->d_greadhdrp;
-	int32_t efsmagic = efshdrp[ 6 ];
-	if ( efsmagic == 60011
+	int32_t *efshdrp = (int32_t *)drivep->d_greadhdrp;
+	int32_t efsmagic = efshdrp[6];
+	if (efsmagic == 60011
 	     ||
-	     efsmagic == 60012 ) {
+	     efsmagic == 60012) {
 		return BOOL_TRUE;
 	} else {
 		return BOOL_FALSE;
@@ -3997,9 +3997,9 @@
 }
 
 static bool_t
-isxfsdumperasetape( drive_t *drivep )
+isxfsdumperasetape(drive_t *drivep)
 {
-	if ( !strcmp( ( char * )drivep->d_greadhdrp, ERASE_MAGIC ) )
+	if (!strcmp((char *)drivep->d_greadhdrp, ERASE_MAGIC))
 		return BOOL_TRUE;
 	else
 		return BOOL_FALSE;
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index c360f9c..5c9ee89 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -257,11 +257,11 @@
 /* macros for shortcut references to context. assumes a local variable named
  * 'contextp'.
  */
-#define	tape_recsz	( contextp->dc_recsz )
-#define	tape_blksz	( contextp->dc_blksz )
+#define	tape_recsz	(contextp->dc_recsz)
+#define	tape_blksz	(contextp->dc_blksz)
 
 /* macros to interpret tape status information returned by reference from
- * mt_get_status( ).
+ * mt_get_status().
  */
 	/* tape is positioned at end-of-tape   			*/
 #define IS_EOT(mtstat)		GMT_EOT(mtstat)
@@ -284,116 +284,116 @@
 
 /* declarations of externally defined global variables ***********************/
 
-extern void usage( void );
+extern void usage(void);
 #ifdef DUMP
 extern uint64_t hdr_mfilesz;
 #endif /* DUMP */
 
 /* remote tape protocol declarations (should be a system header file)
  */
-extern int rmtopen( char *, int, ... );
-extern int rmtclose( int );
-extern int rmtfstat( int, struct stat * );
-extern int rmtioctl( int, int, ... );
-extern int rmtread( int, void*, uint);
-extern int rmtwrite( int, const void *, uint);
+extern int rmtopen(char *, int, ...);
+extern int rmtclose(int);
+extern int rmtfstat(int, struct stat *);
+extern int rmtioctl(int, int, ...);
+extern int rmtread(int, void*, uint);
+extern int rmtwrite(int, const void *, uint);
 
 
 /* forward declarations of locally defined static functions ******************/
 
 /* strategy functions
  */
-static int ds_match( int, char *[], drive_t * );
-static int ds_instantiate( int, char *[], drive_t * );
+static int ds_match(int, char *[], drive_t *);
+static int ds_instantiate(int, char *[], drive_t *);
 
 /* manager operations
  */
-static bool_t do_init( drive_t * );
-static bool_t do_sync( drive_t * );
-static int do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, int * );
-static void do_return_read_buf( drive_t *, char *, size_t );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static int do_seek_mark( drive_t *, drive_mark_t * );
-static int do_next_mark( drive_t * );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static void do_end_read( drive_t * );
-static int do_begin_write( drive_t * );
-static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
-static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static int do_write( drive_t *, char *, size_t );
-static size_t do_get_align_cnt( drive_t * );
-static int do_end_write( drive_t *, off64_t * );
-static int do_fsf( drive_t *, int , int *);
-static int do_bsf( drive_t *, int , int *);
-static int do_rewind( drive_t * );
-static int do_erase( drive_t * );
-static int do_eject_media( drive_t * );
-static int do_get_device_class( drive_t * );
-static void do_display_metrics( drive_t *drivep );
-static void do_quit( drive_t * );
+static bool_t do_init(drive_t *);
+static bool_t do_sync(drive_t *);
+static int do_begin_read(drive_t *);
+static char *do_read(drive_t *, size_t , size_t *, int *);
+static void do_return_read_buf(drive_t *, char *, size_t);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static int do_seek_mark(drive_t *, drive_mark_t *);
+static int do_next_mark(drive_t *);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static void do_end_read(drive_t *);
+static int do_begin_write(drive_t *);
+static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
+static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static int do_write(drive_t *, char *, size_t);
+static size_t do_get_align_cnt(drive_t *);
+static int do_end_write(drive_t *, off64_t *);
+static int do_fsf(drive_t *, int , int *);
+static int do_bsf(drive_t *, int , int *);
+static int do_rewind(drive_t *);
+static int do_erase(drive_t *);
+static int do_eject_media(drive_t *);
+static int do_get_device_class(drive_t *);
+static void do_display_metrics(drive_t *drivep);
+static void do_quit(drive_t *);
 
 /* misc. local utility funcs
  */
-static int	mt_op(int , int , int );
-static int mt_blkinfo(int , struct mtblkinfo * );
-static bool_t mt_get_fileno( drive_t *, long *);
-static bool_t mt_get_status( drive_t *, mtstat_t *);
-static int determine_write_error( drive_t *, int, int );
-static int read_label( drive_t *);
-static bool_t tape_rec_checksum_check( drive_context_t *, char * );
-static void set_recommended_sizes( drive_t * );
-static void display_access_failed_message( drive_t *);
-static void status_failed_message( drive_t *);
-static bool_t get_tpcaps( drive_t * );
-static bool_t set_fixed_blksz( drive_t *, size_t );
-static int prepare_drive( drive_t *drivep );
-static bool_t Open( drive_t *drivep );
-static void Close( drive_t *drivep );
-static int Read( drive_t *drivep,
+static int	mt_op(int , int , int);
+static int mt_blkinfo(int , struct mtblkinfo *);
+static bool_t mt_get_fileno(drive_t *, long *);
+static bool_t mt_get_status(drive_t *, mtstat_t *);
+static int determine_write_error(drive_t *, int, int);
+static int read_label(drive_t *);
+static bool_t tape_rec_checksum_check(drive_context_t *, char *);
+static void set_recommended_sizes(drive_t *);
+static void display_access_failed_message(drive_t *);
+static void status_failed_message(drive_t *);
+static bool_t get_tpcaps(drive_t *);
+static bool_t set_fixed_blksz(drive_t *, size_t);
+static int prepare_drive(drive_t *drivep);
+static bool_t Open(drive_t *drivep);
+static void Close(drive_t *drivep);
+static int Read(drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
-		      int *errnop );
-static int Write( drive_t *drivep,
+		      int *errnop);
+static int Write(drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
-		       int *saved_errnop );
-static int quick_backup( drive_t *drivep,
+		       int *saved_errnop);
+static int quick_backup(drive_t *drivep,
 			      drive_context_t *contextp,
-			      ix_t skipcnt );
-static int record_hdr_validate( drive_t *drivep,
+			      ix_t skipcnt);
+static int record_hdr_validate(drive_t *drivep,
 				     char *bufp,
-				     bool_t chkoffpr );
-static int ring_read( void *clientctxp, char *bufp );
-static int ring_write( void *clientctxp, char *bufp );
-static double percent64( off64_t num, off64_t denom );
-static int getrec( drive_t *drivep );
-static int write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
-                              bool_t xlatepr );
-static ring_msg_t * Ring_get( ring_t *ringp );
-static void Ring_reset(  ring_t *ringp, ring_msg_t *msgp );
-static void Ring_put(  ring_t *ringp, ring_msg_t *msgp );
-static int validate_media_file_hdr( drive_t *drivep );
-static void calc_max_lost( drive_t *drivep );
-static void display_ring_metrics( drive_t *drivep, int mlog_flags );
-static mtstat_t rewind_and_verify( drive_t *drivep );
-static mtstat_t erase_and_verify( drive_t *drivep );
-static mtstat_t bsf_and_verify( drive_t *drivep );
-static mtstat_t fsf_and_verify( drive_t *drivep );
-static void calc_best_blk_and_rec_sz( drive_t *drivep );
-static bool_t set_best_blk_and_rec_sz( drive_t *drivep );
-static bool_t isefsdump( drive_t *drivep );
-static int get_driver_character_major( const char * );
-static void map_ts_status( struct mtget *, struct mtget_sgi );
+				     bool_t chkoffpr);
+static int ring_read(void *clientctxp, char *bufp);
+static int ring_write(void *clientctxp, char *bufp);
+static double percent64(off64_t num, off64_t denom);
+static int getrec(drive_t *drivep);
+static int write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
+                              bool_t xlatepr);
+static ring_msg_t * Ring_get(ring_t *ringp);
+static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
+static void Ring_put(ring_t *ringp, ring_msg_t *msgp);
+static int validate_media_file_hdr(drive_t *drivep);
+static void calc_max_lost(drive_t *drivep);
+static void display_ring_metrics(drive_t *drivep, int mlog_flags);
+static mtstat_t rewind_and_verify(drive_t *drivep);
+static mtstat_t erase_and_verify(drive_t *drivep);
+static mtstat_t bsf_and_verify(drive_t *drivep);
+static mtstat_t fsf_and_verify(drive_t *drivep);
+static void calc_best_blk_and_rec_sz(drive_t *drivep);
+static bool_t set_best_blk_and_rec_sz(drive_t *drivep);
+static bool_t isefsdump(drive_t *drivep);
+static int get_driver_character_major(const char *);
+static void map_ts_status(struct mtget *, struct mtget_sgi);
 
 /* RMT trace stubs
  */
 #ifdef RMTDBG
-static int dbgrmtopen( char *, int );
-static int dbgrmtclose( int );
-static int dbgrmtioctl( int, int, void *);
-static int dbgrmtread( int, void*, uint);
-static int dbgrmtwrite( int, void *, uint);
+static int dbgrmtopen(char *, int);
+static int dbgrmtclose(int);
+static int dbgrmtioctl(int, int, void *);
+static int dbgrmtread(int, void*, uint);
+static int dbgrmtwrite(int, void *, uint);
 #endif /* RMTDBG */
 
 /* definition of locally defined global variables ****************************/
@@ -462,11 +462,11 @@
 		return BOOL_FALSE;
 	}
 
-	if ( stat64( pathname, &statbuf ) == -1) {
+	if (stat64(pathname, &statbuf) == -1) {
 		return BOOL_FALSE;
 	}
 
-	if ( !S_ISCHR( statbuf.st_mode )) {
+	if (!S_ISCHR(statbuf.st_mode)) {
 		return BOOL_FALSE;
 	}
 
@@ -510,7 +510,7 @@
  */
 /* ARGSUSED */
 static int
-ds_match( int argc, char *argv[], drive_t *drivep )
+ds_match(int argc, char *argv[], drive_t *drivep)
 {
 	struct mtget mt_stat;
 	int fd;
@@ -518,21 +518,21 @@
 	/* heuristics to determine if this is a drive.
 	 */
 
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 		return -10;
 	}
 
-	if ( strchr( drivep->d_pathname, ':')) {
+	if (strchr(drivep->d_pathname, ':')) {
 		errno = 0;
-		fd = open( drivep->d_pathname, O_RDONLY );
-		if ( fd < 0 ) {
+		fd = open(drivep->d_pathname, O_RDONLY);
+		if (fd < 0) {
 			return -10;
 		}
-		if ( ioctl( fd, MTIOCGET, &mt_stat ) < 0 ) {
-			close( fd );
+		if (ioctl(fd, MTIOCGET, &mt_stat) < 0) {
+			close(fd);
 			return -10;
 		}
-		close( fd );
+		close(fd);
 		return 10;
 	} else {
                 if (is_scsi_driver(drivep->d_pathname)) {
@@ -548,18 +548,18 @@
  */
 /*ARGSUSED*/
 static bool_t
-ds_instantiate( int argc, char *argv[], drive_t *drivep )
+ds_instantiate(int argc, char *argv[], drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int c;
 
 	/* opportunity for sanity checking
 	 */
-	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
-	assert( sizeof( rec_hdr_t )
+	assert(sizeof(global_hdr_t) <= STAPE_HDR_SZ);
+	assert(sizeof(rec_hdr_t)
 		==
-		sizeofmember( drive_hdr_t, dh_specific ));
-	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
+		sizeofmember(drive_hdr_t, dh_specific));
+	assert(! (STAPE_MAX_RECSZ % PGSZ));
 
 	/* hook up the drive ops
 	 */
@@ -567,9 +567,9 @@
 
 	/* allocate context for the drive manager
 	 */
-	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
-	assert( contextp );
-	memset( ( void * )contextp, 0, sizeof( *contextp ));
+	contextp = (drive_context_t *)calloc(1, sizeof(drive_context_t));
+	assert(contextp);
+	memset((void *)contextp, 0, sizeof(*contextp));
 
 	/* do not enable a separate I/O thread,
 	 * more testing to be done first...
@@ -589,26 +589,26 @@
 #endif
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_RINGLEN:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
-			contextp->dc_ringlen = ( size_t )atoi( optarg );
-			if ( contextp->dc_ringlen < RINGLEN_MIN
+			contextp->dc_ringlen = (size_t)atoi(optarg);
+			if (contextp->dc_ringlen < RINGLEN_MIN
 			     ||
-			     contextp->dc_ringlen > RINGLEN_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+			     contextp->dc_ringlen > RINGLEN_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("-%c argument must be "
 				      "between %u and %u: ignoring %u\n"),
 				      c,
 				      RINGLEN_MIN,
 				      RINGLEN_MAX,
-				      contextp->dc_ringlen );
+				      contextp->dc_ringlen);
 				return BOOL_FALSE;
 			}
 			break;
@@ -625,33 +625,33 @@
 			contextp->dc_isQICpr = BOOL_TRUE;
 			break;
 		case GETOPT_BLOCKSIZE:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-			    mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+			    mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				    _("-%c argument missing\n"),
-				    c );
+				    c);
 			    return -10;
 			}
-			cmdlineblksize = ( uint32_t )atoi( optarg );
+			cmdlineblksize = (uint32_t)atoi(optarg);
 			break;
 #ifdef DUMP
 		case GETOPT_OVERWRITE:
 			contextp->dc_overwritepr = BOOL_TRUE;
 			break;
 		case GETOPT_FILESZ:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
                         /* given in Mb */
-			contextp->dc_filesz = (off64_t)atoi( optarg ) * 1024 * 1024;
+			contextp->dc_filesz = (off64_t)atoi(optarg) * 1024 * 1024;
                         if (contextp->dc_filesz <= 0) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("-%c argument must be a "
 				      "positive number (Mb): ignoring %u\n"),
 				      c,
-				      contextp->dc_filesz );
+				      contextp->dc_filesz);
 				return BOOL_FALSE;
                         }
 			break;
@@ -675,37 +675,37 @@
 	/* if threads not allowed, allocate a record buffer. otherwise
 	 * create a ring, from which buffers will be taken.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
-		assert( contextp->dc_bufp );
+	if (contextp->dc_singlethreadedpr) {
+		contextp->dc_bufp = (char *)memalign(PGSZ, STAPE_MAX_RECSZ);
+		assert(contextp->dc_bufp);
 	} else {
 		int rval;
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
 		      "ring op: create: ringlen == %u\n",
-		      contextp->dc_ringlen );
-		contextp->dc_ringp = ring_create( contextp->dc_ringlen,
+		      contextp->dc_ringlen);
+		contextp->dc_ringp = ring_create(contextp->dc_ringlen,
 						  STAPE_MAX_RECSZ,
 						  contextp->dc_ringpinnedpr,
 						  drivep->d_index,
 						  ring_read,
 						  ring_write,
-						  ( void * )drivep,
-						  &rval );
-		if ( ! contextp->dc_ringp ) {
-			if ( rval == ENOMEM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+						  (void *)drivep,
+						  &rval);
+		if (! contextp->dc_ringp) {
+			if (rval == ENOMEM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("unable to allocate memory "
-				      "for I/O buffer ring\n") );
-			} else if ( rval == E2BIG ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "for I/O buffer ring\n"));
+			} else if (rval == E2BIG) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not enough physical memory "
-				      "to pin down I/O buffer ring\n") );
-			} else if ( rval == EPERM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "to pin down I/O buffer ring\n"));
+			} else if (rval == EPERM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not allowed "
-				      "to pin down I/O buffer ring\n") );
+				      "to pin down I/O buffer ring\n"));
 			} else {
-				assert( 0 );
+				assert(0);
 			}
 			return BOOL_FALSE;
 		}
@@ -713,7 +713,7 @@
 
 	/* scan drive device pathname to see if remote tape
 	 */
-	if ( strchr( drivep->d_pathname, ':') ) {
+	if (strchr(drivep->d_pathname, ':')) {
 		contextp->dc_isrmtpr = BOOL_TRUE;
 	} else {
 		contextp->dc_isrmtpr = BOOL_FALSE;
@@ -723,7 +723,7 @@
 	 * mark them as unknown for now. however, if this is an RMT
 	 * access, we know immediately some capabilities are missing.
 	 */
-	if ( contextp->dc_isrmtpr ) {
+	if (contextp->dc_isrmtpr) {
 		contextp->dc_cangetblkszpr = BOOL_FALSE;
 		contextp->dc_cansetblkszpr = BOOL_FALSE;
 		contextp->dc_isvarpr = BOOL_TRUE;
@@ -781,15 +781,15 @@
  */
 /* ARGSUSED */
 static bool_t
-do_init( drive_t *drivep )
+do_init(drive_t *drivep)
 {
 #ifdef DUMP
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 #endif /* DUMP */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: init\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: init\n");
 
 #ifdef DUMP
 	/* fill in media strategy id: artifact of first version of xfsdump
@@ -806,10 +806,10 @@
  */
 /* ARGSUSED */
 static bool_t
-do_sync( drive_t *drivep )
+do_sync(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: sync\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: sync\n");
 
 	return BOOL_TRUE;
 }
@@ -824,32 +824,32 @@
  *
  */
 static int
-do_begin_read( drive_t *drivep )
+do_begin_read(drive_t *drivep)
 {
         drive_context_t *contextp;
         int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: begin read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: begin read\n");
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_READ );
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! contextp->dc_recp );
+	assert(drivep->d_capabilities & DRIVE_CAP_READ);
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! contextp->dc_recp);
 
 	/* get a record buffer to use during initialization.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -858,38 +858,38 @@
 	 * size previously determined.
 	 */
 	contextp->dc_iocnt = 0;
-	if ( contextp->dc_fd < 0 ) {
-		assert( contextp->dc_fd == -1 );
-		rval = prepare_drive( drivep );
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_fd < 0) {
+		assert(contextp->dc_fd == -1);
+		rval = prepare_drive(drivep);
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	} else {
-		rval = read_label( drivep );
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+		rval = read_label(drivep);
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	}
-	assert( contextp->dc_iocnt == 1 );
+	assert(contextp->dc_iocnt == 1);
 					/* set by prepare_drive or read_label */
 
 	/* all is well. adjust context. don't kick off read-aheads just yet;
 	 * the client may not want this media file.
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
+	if (! contextp->dc_singlethreadedpr) {
 		contextp->dc_msgp->rm_op = RING_OP_NOP;
 		contextp->dc_msgp->rm_user = 0; /* do diff. use in do_seek */
-		Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -920,31 +920,31 @@
  *
  */
 static char *
-do_read( drive_t *drivep,
+do_read(drive_t *drivep,
 	 size_t wantedcnt,
 	 size_t *actualcntp,
-	 int *rvalp )
+	 int *rvalp)
 {
 	drive_context_t *contextp;
 	size_t availcnt;
 	size_t actualcnt;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: read: wanted %u (0x%x)\n",
 	      wantedcnt,
-	      wantedcnt );
+	      wantedcnt);
 
 	/* get context ptrs
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( wantedcnt > 0 );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(wantedcnt > 0);
 
 	/* clear the return status field
 	 */
@@ -952,30 +952,30 @@
 
 	/* read a new record if necessary
 	 */
-	rval = getrec( drivep );
-	if ( rval ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+	rval = getrec(drivep);
+	if (rval) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "drive op read returning error rval=%d\n",
-		      rval );
+		      rval);
 		*rvalp = rval;
 		return 0;
 	}
 
 	/* figure how much data is available, and how much should be supplied
 	 */
-	availcnt = ( size_t )( contextp->dc_dataendp - contextp->dc_nextp );
-	actualcnt = min( wantedcnt, availcnt );
+	availcnt = (size_t)(contextp->dc_dataendp - contextp->dc_nextp);
+	actualcnt = min(wantedcnt, availcnt);
 
 	/* adjust the context
 	 */
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive op read actual == %d (0x%x)\n",
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	*actualcntp = actualcnt;
 	return contextp->dc_ownedp;
@@ -990,29 +990,29 @@
  */
 /* ARGSUSED */
 static void
-do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
+do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	/* REFERENCED */
 	size_t ownedcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: return read buf: sz %d (0x%x)\n",
 	      retcnt,
-	      retcnt );
+	      retcnt);
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( bufp == contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(bufp == contextp->dc_ownedp);
 
 	/* calculate how much the caller owns
 	 */
-	assert( contextp->dc_nextp >= contextp->dc_ownedp );
-	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	assert( ownedcnt == retcnt );
+	assert(contextp->dc_nextp >= contextp->dc_ownedp);
+	ownedcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
+	assert(ownedcnt == retcnt);
 
 	/* take possession of buffer portion
 	 */
@@ -1021,11 +1021,11 @@
 	/* if caller is done with this record, take the buffer back
 	 * and (if ring in use) give buffer to ring for read-ahead.
 	 */
-	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
-		assert( contextp->dc_nextp == contextp->dc_dataendp );
-		if ( ! contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_nextp >= contextp->dc_dataendp) {
+		assert(contextp->dc_nextp == contextp->dc_dataendp);
+		if (! contextp->dc_singlethreadedpr) {
 			contextp->dc_msgp->rm_op = RING_OP_READ;
-			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1043,29 +1043,29 @@
  *	void
  */
 static void
-do_get_mark( drive_t *drivep, drive_mark_t *markp )
+do_get_mark(drive_t *drivep, drive_mark_t *markp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t offset;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: get mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: get mark\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 	/* the mark is simply the offset into the media file of the
 	 * next byte to be read.
 	 */
-	offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
-		offset += ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
+	offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
+		offset += (off64_t)(contextp->dc_nextp - contextp->dc_recp);
 	}
 
-	*markp = ( drive_mark_t )offset;
+	*markp = (drive_mark_t)offset;
 
 	return;
 }
@@ -1082,7 +1082,7 @@
  *
  */
 static int
-do_seek_mark( drive_t *drivep, drive_mark_t *markp )
+do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 {
 	drive_context_t	*contextp;
 	off64_t wantedoffset;
@@ -1094,55 +1094,55 @@
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 
 	/* the desired mark is passed by reference, and is really just an
 	 * offset into the raw (incl rec hdrs) read stream
 	 */
-	wantedoffset = *( off64_t * )markp;
+	wantedoffset = *(off64_t *)markp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: seek mark: %lld (0x%llx)\n",
 	      wantedoffset,
-	      wantedoffset );
+	      wantedoffset);
 
 	/* determine the current offset. assert that the wanted offset is
 	 * not less than the current offset.
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset >= currentoffset );
+	assert(wantedoffset >= currentoffset);
 
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
 	 */
-	if ( contextp->dc_recp ) {
+	if (contextp->dc_recp) {
 		off64_t nextrecoffset;
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		nextrecoffset = contextp->dc_reccnt  * ( off64_t )tape_recsz
+		nextrecoffset = contextp->dc_reccnt  * (off64_t)tape_recsz
 				+
-				( off64_t )rechdrp->rec_used;
-		if ( wantedoffset >= nextrecoffset ) {
+				(off64_t)rechdrp->rec_used;
+		if (wantedoffset >= nextrecoffset) {
 			uint32_t recoff;
 			size_t wantedcnt;
 			char *dummybufp;
@@ -1152,39 +1152,39 @@
 			/* if this is the last record, the wanted offset
 			 * must be just after it.
 			 */
-			if ( rechdrp->rec_used < tape_recsz ) {
-				assert( wantedoffset == nextrecoffset );
+			if (rechdrp->rec_used < tape_recsz) {
+				assert(wantedoffset == nextrecoffset);
 			}
 
 			/* figure how much to ask for
 			 */
-			assert( contextp->dc_nextp >= contextp->dc_recp );
-			recoff = ( uint32_t )( contextp->dc_nextp
+			assert(contextp->dc_nextp >= contextp->dc_recp);
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			wantedcnt = ( size_t )( rechdrp->rec_used
+						contextp->dc_recp);
+			wantedcnt = (size_t)(rechdrp->rec_used
 						-
-						recoff );
+						recoff);
 
 			/* eat that much tape
 			 */
 			rval = 0;
-			dummybufp = do_read( drivep,
+			dummybufp = do_read(drivep,
 					     wantedcnt,
 					     &actualcnt,
-					     &rval );
-			if ( rval ) {
+					     &rval);
+			if (rval) {
 				return rval;
 			}
-			assert( actualcnt == wantedcnt );
-			do_return_read_buf( drivep, dummybufp, actualcnt );
-			currentoffset += ( off64_t )actualcnt;
-			assert( currentoffset == nextrecoffset );
-			assert( wantedoffset >= currentoffset );
-			assert( ! contextp->dc_recp );
-			assert( currentoffset
+			assert(actualcnt == wantedcnt);
+			do_return_read_buf(drivep, dummybufp, actualcnt);
+			currentoffset += (off64_t)actualcnt;
+			assert(currentoffset == nextrecoffset);
+			assert(wantedoffset >= currentoffset);
+			assert(! contextp->dc_recp);
+			assert(currentoffset
 				==
-				contextp->dc_reccnt * ( off64_t )tape_recsz );
+				contextp->dc_reccnt * (off64_t)tape_recsz);
 		}
 	}
 
@@ -1195,208 +1195,208 @@
 	 * made it there, suspend read-ahead, eat those readahead records,
 	 * FSR the remaining, and resume readahead.
 	 */
-	if ( contextp->dc_canfsrpr
+	if (contextp->dc_canfsrpr
 	     &&
-	     wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	     wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
 
-		assert( ! contextp->dc_recp );
-		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
-		if ( contextp->dc_singlethreadedpr ) {
+		assert(! contextp->dc_recp);
+		wantedreccnt = wantedoffset / (off64_t)tape_recsz;
+		if (contextp->dc_singlethreadedpr) {
 			seekmode = SEEKMODE_RAW;
 		} else {
 			seekmode = SEEKMODE_BUF;
 		}
-		assert( wantedreccnt != 0 ); /* so NOP below can be
+		assert(wantedreccnt != 0); /* so NOP below can be
 					      * distinguished from use
 					      * in do_begin_read
 					      */
-		while ( contextp->dc_reccnt < wantedreccnt ) {
+		while (contextp->dc_reccnt < wantedreccnt) {
 			off64_t recskipcnt64;
 			off64_t recskipcnt64remaining;
 
-			if ( seekmode == SEEKMODE_BUF ) {
+			if (seekmode == SEEKMODE_BUF) {
 				ring_stat_t rs;
-				assert( ! contextp->dc_msgp );
+				assert(! contextp->dc_msgp);
 				contextp->dc_msgp =
-						Ring_get( contextp->dc_ringp );
+						Ring_get(contextp->dc_ringp);
 				rs = contextp->dc_msgp->rm_stat;
-				if ( rs == RING_STAT_ERROR ) {
+				if (rs == RING_STAT_ERROR) {
 					contextp->dc_errorpr = BOOL_TRUE;
 					return contextp->dc_msgp->rm_rval;
 				}
-				if ( rs != RING_STAT_OK
+				if (rs != RING_STAT_OK
 				     &&
 				     rs != RING_STAT_INIT
 				     &&
-				     rs != RING_STAT_NOPACK ) {
-					assert( 0 );
+				     rs != RING_STAT_NOPACK) {
+					assert(0);
 					contextp->dc_errorpr = BOOL_TRUE;
 					return DRIVE_ERROR_CORE;
 				}
-				if ( rs == RING_STAT_OK ) {
+				if (rs == RING_STAT_OK) {
 					contextp->dc_reccnt++;
 				}
-				if ( rs == RING_STAT_NOPACK
+				if (rs == RING_STAT_NOPACK
 				     &&
 				     contextp->dc_msgp->rm_user
 				     ==
-				     wantedreccnt ) {
+				     wantedreccnt) {
 					seekmode = SEEKMODE_RAW;
 				}
 				contextp->dc_msgp->rm_op = RING_OP_NOP;
 				contextp->dc_msgp->rm_user = wantedreccnt;
-				Ring_put( contextp->dc_ringp,
-					  contextp->dc_msgp );
+				Ring_put(contextp->dc_ringp,
+					  contextp->dc_msgp);
 				contextp->dc_msgp = 0;
 				continue;
 			}
 
-			assert( contextp->dc_reccnt == contextp->dc_iocnt );
-			assert( wantedreccnt > contextp->dc_reccnt );
+			assert(contextp->dc_reccnt == contextp->dc_iocnt);
+			assert(wantedreccnt > contextp->dc_reccnt);
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
-			while ( recskipcnt64remaining ) {
+			while (recskipcnt64remaining) {
 				int recskipcnt;
 				int saved_errno;
 				int rval;
 
-				assert( recskipcnt64remaining > 0 );
-				if ( recskipcnt64remaining > INTGENMAX ) {
+				assert(recskipcnt64remaining > 0);
+				if (recskipcnt64remaining > INTGENMAX) {
 					recskipcnt = INTGENMAX;
 				} else {
-					recskipcnt = ( int )
+					recskipcnt = (int)
 						     recskipcnt64remaining;
 				}
-				assert( recskipcnt > 0 );
-				rval = mt_op( contextp->dc_fd,
+				assert(recskipcnt > 0);
+				rval = mt_op(contextp->dc_fd,
 					      MTFSR,
-					      recskipcnt );
+					      recskipcnt);
 				saved_errno = errno;
-				if ( rval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				if (rval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					      _("could not forward space %d "
 					      "tape blocks: "
 					      "rval == %d, errno == %d (%s)\n"),
 					      rval,
 					      saved_errno,
-					      strerror( saved_errno ));
+					      strerror(saved_errno));
 					return DRIVE_ERROR_MEDIA;
 				}
-				recskipcnt64remaining -= ( off64_t )recskipcnt;
+				recskipcnt64remaining -= (off64_t)recskipcnt;
 			}
 			contextp->dc_reccnt += recskipcnt64;
 			contextp->dc_iocnt += recskipcnt64;
 			currentoffset = contextp->dc_reccnt
 					*
-					( off64_t )tape_recsz;
-			assert( wantedoffset >= currentoffset );
-			assert( wantedoffset - currentoffset
+					(off64_t)tape_recsz;
+			assert(wantedoffset >= currentoffset);
+			assert(wantedoffset - currentoffset
 				<
-				( off64_t )tape_recsz );
+				(off64_t)tape_recsz);
 		}
 	}
 
 	/* remove excess records by eating them. won't be any if
 	 * FSR supported
 	 */
-	while ( wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	while (wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 		int rval;
 
-		assert( ! contextp->dc_recp );
+		assert(! contextp->dc_recp);
 
 		/* figure how much to ask for. to eat an entire record,
 		 * ask for a record sans the header. do_read will eat
 		 * the header, we eat the rest.
 		 */
-		wantedcnt = ( size_t )( tape_recsz - STAPE_HDR_SZ );
+		wantedcnt = (size_t)(tape_recsz - STAPE_HDR_SZ);
 
 		/* eat that much tape
 		 */
 		rval = 0;
-		dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		if ( rval ) {
+		dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		if (rval) {
 			return rval;
 		}
-		assert( actualcnt == wantedcnt );
-		do_return_read_buf( drivep, dummybufp, actualcnt );
-		assert( ! contextp->dc_recp );
-		currentoffset += ( off64_t )tape_recsz;
-		assert( currentoffset
+		assert(actualcnt == wantedcnt);
+		do_return_read_buf(drivep, dummybufp, actualcnt);
+		assert(! contextp->dc_recp);
+		currentoffset += (off64_t)tape_recsz;
+		assert(currentoffset
 			==
-			contextp->dc_reccnt * ( off64_t )tape_recsz );
+			contextp->dc_reccnt * (off64_t)tape_recsz);
 	}
 
 	/* eat that portion of the next record leading up to the
 	 * desired offset.
 	 */
-	if ( wantedoffset != currentoffset ) {
+	if (wantedoffset != currentoffset) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 
-		assert( wantedoffset > currentoffset );
-		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
-		wantedcnt = ( size_t )( wantedoffset - currentoffset );
-		if ( contextp->dc_recp ) {
+		assert(wantedoffset > currentoffset);
+		assert(wantedoffset - currentoffset < (off64_t)tape_recsz);
+		wantedcnt = (size_t)(wantedoffset - currentoffset);
+		if (contextp->dc_recp) {
 			uint32_t recoff;
 #ifdef DEBUG
-			rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+			rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
-			recoff = ( uint32_t )( contextp->dc_nextp
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			assert( recoff <= tape_recsz );
-			assert( rechdrp->rec_used <= tape_recsz );
-			assert( recoff >= STAPE_HDR_SZ );
-			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-			assert( recoff <= rechdrp->rec_used );
-			assert( recoff + wantedcnt <= rechdrp->rec_used );
+						contextp->dc_recp);
+			assert(recoff <= tape_recsz);
+			assert(rechdrp->rec_used <= tape_recsz);
+			assert(recoff >= STAPE_HDR_SZ);
+			assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+			assert(recoff <= rechdrp->rec_used);
+			assert(recoff + wantedcnt <= rechdrp->rec_used);
 		} else {
-			assert( wantedcnt >= STAPE_HDR_SZ );
+			assert(wantedcnt >= STAPE_HDR_SZ);
 			wantedcnt -= STAPE_HDR_SZ;
 		}
 
 		/* eat that much tape
 		 */
-		if ( wantedcnt > 0 ) {
+		if (wantedcnt > 0) {
 		    int rval;
 		    rval = 0;
-		    dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		    if ( rval ) {
+		    dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		    if (rval) {
 			    return rval;
 		    }
-		    assert( actualcnt == wantedcnt );
-		    do_return_read_buf( drivep, dummybufp, actualcnt );
+		    assert(actualcnt == wantedcnt);
+		    do_return_read_buf(drivep, dummybufp, actualcnt);
 		}
 	}
 
 	/* as a sanity check, refigure the current offset and make sure
 	 * it is equal to the wanted offset
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset == currentoffset );
+	assert(wantedoffset == currentoffset);
 
 	return 0;
 }
@@ -1412,7 +1412,7 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_next_mark( drive_t *drivep )
+do_next_mark(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	rec_hdr_t *rechdrp;
@@ -1429,69 +1429,69 @@
 
 	/* assert protocol being followed.
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: next mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: next mark\n");
 
 	trycnt = 0;
 
-	if ( contextp->dc_errorpr ) {
+	if (contextp->dc_errorpr) {
 		goto resetring;
 	} else {
 		goto noerrorsearch;
 	}
 
 noerrorsearch:
-	for ( ; ; ) {
-		rval = getrec( drivep );
-		if ( rval == DRIVE_ERROR_CORRUPTION ) {
+	for (; ;) {
+		rval = getrec(drivep);
+		if (rval == DRIVE_ERROR_CORRUPTION) {
 			goto resetring;
-		} else if ( rval ) {
+		} else if (rval) {
 			return rval;
 		}
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		assert( rechdrp->first_mark_offset != 0 );
-		if ( rechdrp->first_mark_offset > 0 ) {
+		assert(rechdrp->first_mark_offset != 0);
+		if (rechdrp->first_mark_offset > 0) {
 			 off64_t markoff = rechdrp->first_mark_offset
 					   -
 					   rechdrp->file_offset;
-			 off64_t curoff = ( off64_t )( contextp->dc_nextp
+			 off64_t curoff = (off64_t)(contextp->dc_nextp
 						       -
-						       contextp->dc_recp );
-			 assert( markoff > 0 );
-			 assert( curoff > 0 );
-			 if ( markoff >= curoff ) {
+						       contextp->dc_recp);
+			 assert(markoff > 0);
+			 assert(curoff > 0);
+			 if (markoff >= curoff) {
 				break;
 			}
 		}
 
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
 		contextp->dc_reccnt++;
 	}
 
-	assert( rechdrp->first_mark_offset - rechdrp->file_offset
+	assert(rechdrp->first_mark_offset - rechdrp->file_offset
 		<=
-		( off64_t )tape_recsz );
+		(off64_t)tape_recsz);
 	contextp->dc_nextp = contextp->dc_recp
 			     +
-			     ( size_t )( rechdrp->first_mark_offset
+			     (size_t)(rechdrp->first_mark_offset
 					 -
-					 rechdrp->file_offset );
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+					 rechdrp->file_offset);
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	if (contextp->dc_nextp == contextp->dc_dataendp) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1501,152 +1501,152 @@
 	return 0;
 
 resetring:
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
 
 	/* get a record buffer and cast a record header pointer
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	goto readrecord;
 
 readrecord:
 	trycnt++;
-	if ( trycnt > maxtrycnt ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("unable to locate next mark in media file\n") );
+	if (trycnt > maxtrycnt) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("unable to locate next mark in media file\n"));
 		return DRIVE_ERROR_MEDIA;
 	}
 
-	nread = Read( drivep, contextp->dc_recp, tape_recsz, &saved_errno );
+	nread = Read(drivep, contextp->dc_recp, tape_recsz, &saved_errno);
 	goto validateread;
 
 validateread:
-	if ( nread == ( int )tape_recsz ) {
+	if (nread == (int)tape_recsz) {
 		goto validatehdr;
 	}
-	ok = mt_get_status( drivep, &mtstat );
-	if ( ! ok ) {
-		status_failed_message( drivep );
+	ok = mt_get_status(drivep, &mtstat);
+	if (! ok) {
+		status_failed_message(drivep);
 		return DRIVE_ERROR_DEVICE;
 	}
 
-	if ( IS_FMK( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EOF attempting to read record\n" );
+	if (IS_FMK(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EOF attempting to read record\n");
 		return DRIVE_ERROR_EOF;
 	}
 
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EOD attempting to read record\n" );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EOD attempting to read record\n");
 		return DRIVE_ERROR_EOD;
 	}
 
-	if ( IS_EOT( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EOM attempting to read record\n" );
+	if (IS_EOT(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EOM attempting to read record\n");
 		return DRIVE_ERROR_EOM;
 	}
 
-	if ( IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EW attempting to read record\n" );
+	if (IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EW attempting to read record\n");
 		return DRIVE_ERROR_EOM;
 	}
 
-	if ( nread >= 0 ) {
-		assert( ( size_t )nread <= tape_recsz );
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (nread >= 0) {
+		assert((size_t)nread <= tape_recsz);
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "short read (nread == %d, record size == %d)\n",
 		      nread,
-		      tape_recsz );
+		      tape_recsz);
 		goto getbeyonderror;
 	}
 
 	/* some other error
 	 */
-	mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
+	mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
 	      "unexpected error attempting to read record: "
 	      "read returns %d, errno %d (%s)\n"),
 	      nread,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 
 	goto getbeyonderror;
 
 validatehdr:
-	rval = record_hdr_validate( drivep, contextp->dc_recp, BOOL_FALSE );
+	rval = record_hdr_validate(drivep, contextp->dc_recp, BOOL_FALSE);
 
-	if ( rval
+	if (rval
 	     &&
-	     ( contextp->dc_isQICpr == BOOL_TRUE
+	     (contextp->dc_isQICpr == BOOL_TRUE
 	       ||
-	       contextp->dc_isQICpr == BOOL_UNKNOWN )) {
+	       contextp->dc_isQICpr == BOOL_UNKNOWN)) {
 		goto huntQIC;
 	}
 
-	if ( rval ) {
+	if (rval) {
 		goto readrecord;
 	}
 
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
-	if ( rechdrp->first_mark_offset < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+	if (rechdrp->first_mark_offset < 0) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 		      _("valid record %lld but no mark\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		goto readrecord;
 	}
 
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
 	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
-	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
-	assert( markoff < ( off64_t )tape_recsz );
-	assert( rechdrp->rec_used > STAPE_HDR_SZ );
-	assert( rechdrp->rec_used < tape_recsz );
+	assert(markoff >= (off64_t)STAPE_HDR_SZ);
+	assert(markoff < (off64_t)tape_recsz);
+	assert(rechdrp->rec_used > STAPE_HDR_SZ);
+	assert(rechdrp->rec_used < tape_recsz);
 
 	goto alliswell;
 
 alliswell:
-	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_nextp = contextp->dc_recp + (size_t)markoff;
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
-	assert( contextp->dc_dataendp <= contextp->dc_recendp );
-	assert( contextp->dc_nextp < contextp->dc_dataendp );
+	assert(contextp->dc_dataendp <= contextp->dc_recendp);
+	assert(contextp->dc_nextp < contextp->dc_dataendp);
 	contextp->dc_errorpr = BOOL_FALSE;
 
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("resynchronized at record %lld offset %u\n"),
 	      contextp->dc_iocnt - 1,
 	      contextp->dc_nextp
 	      -
-	      contextp->dc_recp );
+	      contextp->dc_recp);
 	return 0;
 
 getbeyonderror:
-	rval = mt_op( contextp->dc_fd, MTFSR, 1 );
+	rval = mt_op(contextp->dc_fd, MTFSR, 1);
 	saved_errno = errno;
 
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not forward space one tape block beyond "
 		      "read error: rval == %d, errno == %d (%s)\n"),
 		      rval,
 		      saved_errno,
-		      strerror( saved_errno ));
+		      strerror(saved_errno));
 		return DRIVE_ERROR_MEDIA;
 	}
 
@@ -1658,12 +1658,12 @@
 	 * the following blocks to the head of the record buffer, and try
 	 * to read the remaining blocks in the record.
 	 */
-	for ( p = contextp->dc_recp + QIC_BLKSZ
+	for (p = contextp->dc_recp + QIC_BLKSZ
 	      ;
 	      p < contextp->dc_recendp
 	      ;
-	      p += QIC_BLKSZ ) {
-		if ( *( uint64_t * )p == STAPE_MAGIC ) {
+	      p += QIC_BLKSZ) {
+		if (*(uint64_t *)p == STAPE_MAGIC) {
 			goto adjustQIC;
 		}
 	}
@@ -1671,14 +1671,14 @@
 	goto readrecord;
 
 adjustQIC:
-	tailsz = ( size_t )( contextp->dc_recendp - p );
-	memcpy( ( void * )contextp->dc_recp,
-		( void * )p,
-		tailsz );
-	nread = Read( drivep,
+	tailsz = (size_t)(contextp->dc_recendp - p);
+	memcpy((void *)contextp->dc_recp,
+		(void *)p,
+		tailsz);
+	nread = Read(drivep,
 		      contextp->dc_recp + tailsz,
 		      tape_recsz - tailsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	goto validateread;
 }
@@ -1691,20 +1691,20 @@
  *	void
  */
 static void
-do_end_read( drive_t *drivep )
+do_end_read(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: end read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: end read\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 
@@ -1720,7 +1720,7 @@
  * 	DRIVE_ERROR_... on failure
  */
 static int
-do_begin_write( drive_t *drivep )
+do_begin_write(drive_t *drivep)
 {
 	drive_context_t		*contextp;
 	drive_hdr_t		*dwhdrp;
@@ -1742,38 +1742,38 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: begin write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: begin write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! drivep->d_markrecheadp );
-	assert( ! contextp->dc_recp );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! drivep->d_markrecheadp);
+	assert(! contextp->dc_recp);
 
 	/* get pointers into global write header
 	 */
 	gwhdrp = drivep->d_gwritehdrp;
 	dwhdrp = drivep->d_writehdrp;
-	tpwhdrp = ( rec_hdr_t * )dwhdrp->dh_specific;
+	tpwhdrp = (rec_hdr_t *)dwhdrp->dh_specific;
 
 	/* must already be open. The only way to open is to do a begin_read.
 	 * so all interaction with scsi tape requires reading first.
 	 */
-	assert( contextp->dc_fd != -1 );
+	assert(contextp->dc_fd != -1);
 
 	/* get tape device status. verify tape is positioned
  	 */
-	if ( ! mt_get_status( drivep, &mtstat )) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
         	return DRIVE_ERROR_DEVICE;
 	}
-	if ( IS_EOT( mtstat )) {
+	if (IS_EOT(mtstat)) {
 		return DRIVE_ERROR_EOM;
 	}
-	if ( IS_EW( mtstat ) && !(IS_BOT(mtstat)) ) {
+	if (IS_EW(mtstat) && !(IS_BOT(mtstat))) {
 		return DRIVE_ERROR_EOM;
 	}
 
@@ -1781,8 +1781,8 @@
 	 */
 	tpwhdrp->magic = STAPE_MAGIC;
 	tpwhdrp->version = STAPE_VERSION;
-	tpwhdrp->blksize = ( int32_t )tape_blksz;
-	tpwhdrp->recsize = ( int32_t )tape_recsz;
+	tpwhdrp->blksize = (int32_t)tape_blksz;
+	tpwhdrp->recsize = (int32_t)tape_recsz;
 	tpwhdrp->rec_used = 0;
 	tpwhdrp->file_offset = 0;
 	tpwhdrp->first_mark_offset= 0;
@@ -1791,15 +1791,15 @@
 	/* get a record buffer. will be used for the media file header,
 	 * and is needed to "prime the pump" for first call to do_write.
 	 */
-	assert( ! contextp->dc_recp );
-	if ( contextp->dc_singlethreadedpr ) {
-		assert( contextp->dc_bufp );
+	assert(! contextp->dc_recp);
+	if (contextp->dc_singlethreadedpr) {
+		assert(contextp->dc_bufp);
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		assert( ! contextp->dc_msgp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		assert(! contextp->dc_msgp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -1807,7 +1807,7 @@
 	 * being produced!
 	 */
 	contextp->dc_iocnt = 0;
-	memset( ( void * )contextp->dc_recp, 0, tape_recsz );
+	memset((void *)contextp->dc_recp, 0, tape_recsz);
 
 	tmpgh  = (global_hdr_t *)contextp->dc_recp;
 	tmpdh  = (drive_hdr_t *)tmpgh->gh_upper;
@@ -1829,12 +1829,12 @@
 
 	/* checksum the global header
 	 */
-	global_hdr_checksum_set( tmpgh );
+	global_hdr_checksum_set(tmpgh);
 
-	rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE );
-	if ( rval ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE);
+	if (rval) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1844,7 +1844,7 @@
 	/* prepare the drive context. must have a record buffer ready to
 	 * go, header initialized.
 	 */
-	assert( ! contextp->dc_ownedp );
+	assert(! contextp->dc_ownedp);
 	contextp->dc_reccnt = 1; /* count the header record */
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
@@ -1854,12 +1854,12 @@
 	rechdrp = (rec_hdr_t*)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	/* set mode now so operators will work
 	 */
@@ -1874,10 +1874,10 @@
  * in record.
  */
 static void
-do_set_mark( drive_t *drivep,
+do_set_mark(drive_t *drivep,
 	     drive_mcbfp_t cbfuncp,
 	     void *cbcontextp,
-	     drive_markrec_t *markrecp )
+	     drive_markrec_t *markrecp)
 {
 	drive_context_t *contextp;
 	off64_t nextoff;
@@ -1885,34 +1885,34 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
 
 	/* calculate and fill in the mark record offset
 	 */
-	assert( contextp->dc_recp );
-	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
+	assert(contextp->dc_recp);
+	nextoff = contextp->dc_reccnt * (off64_t)tape_recsz
 		  +
-		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
-	markrecp->dm_log = ( drive_mark_t )nextoff;
+		  (off64_t)(contextp->dc_nextp - contextp->dc_recp);
+	markrecp->dm_log = (drive_mark_t)nextoff;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: set mark: %lld (0x%llx)\n",
 	      nextoff,
-	      nextoff );
+	      nextoff);
 
 	/* note the location of the first mark in this tape record.
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-	if ( rechdrp->first_mark_offset == -1LL ) {
-		assert( nextoff != -1LL );
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
+	if (rechdrp->first_mark_offset == -1LL) {
+		assert(nextoff != -1LL);
 		rechdrp->first_mark_offset = nextoff;
 	}
 
@@ -1921,11 +1921,11 @@
 	markrecp->dm_cbfuncp = cbfuncp;
 	markrecp->dm_cbcontextp = cbcontextp;
 	markrecp->dm_nextp = 0;
-	if ( drivep->d_markrecheadp == 0 ) {
+	if (drivep->d_markrecheadp == 0) {
 		drivep->d_markrecheadp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	} else {
-		assert( drivep->d_markrectailp );
+		assert(drivep->d_markrectailp);
 		drivep->d_markrectailp->dm_nextp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	}
@@ -1940,7 +1940,7 @@
  *	"actual_bufszp" points to the size of the buffer
  */
 static char *
-do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
+do_get_write_buf(drive_t *drivep, size_t wantedcnt, size_t *actualcntp)
 {
 	drive_context_t *contextp;
 	size_t remainingcnt;
@@ -1948,32 +1948,32 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* figure how much is available; supply the min of what is
 	 * available and what is wanted.
 	 */
-	remainingcnt = ( size_t )( contextp->dc_recendp - contextp->dc_nextp );
-	actualcnt = min( remainingcnt, wantedcnt );
+	remainingcnt = (size_t)(contextp->dc_recendp - contextp->dc_nextp);
+	actualcnt = min(remainingcnt, wantedcnt);
 	*actualcntp = actualcnt;
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: get write buf: wanted %u (0x%x) actual %u (0x%x)\n",
 	      wantedcnt,
 	      wantedcnt,
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	return contextp->dc_ownedp;
 }
@@ -1991,7 +1991,7 @@
  */
 /* ARGSUSED */
 static int
-do_write( drive_t *drivep, char *bufp, size_t retcnt )
+do_write(drive_t *drivep, char *bufp, size_t retcnt)
 {
 	drive_context_t *contextp;
 	rec_hdr_t *rechdrp;
@@ -2002,33 +2002,33 @@
 
 	/* get drive context and pointer to global write hdr
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 	gwhdrp = drivep->d_gwritehdrp;
 
 	/* calculate how many bytes we believe caller is holding
 	 */
-	heldcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
+	heldcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: write: retcnt %u (0x%x) heldcnt %u (0x%x)\n",
 	      retcnt,
 	      retcnt,
 	      heldcnt,
-	      heldcnt );
+	      heldcnt);
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp <= contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp <= contextp->dc_recendp);
 
 	/* verify the caller is returning exactly what is held
 	 */
-	assert( bufp == contextp->dc_ownedp );
-	assert( retcnt == heldcnt );
+	assert(bufp == contextp->dc_ownedp);
+	assert(retcnt == heldcnt);
 
 	/* take it back
 	 */
@@ -2037,30 +2037,30 @@
 	/* if some portion of the record buffer has not yet been
 	 * held by the client, just return.
 	 */
-	if ( contextp->dc_nextp < contextp->dc_recendp ) {
+	if (contextp->dc_nextp < contextp->dc_recendp) {
 		return 0;
 	}
 
 	/* record in record header that entire record is used
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->rec_used = tape_recsz;
 
 	/* write out the record buffer and get a new one.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE );
+	if (contextp->dc_singlethreadedpr) {
+		rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE);
 		last_rec_wrtn_wo_err = contextp->dc_reccnt; /* conv cnt to ix */
 	} else {
 		contextp->dc_msgp->rm_op = RING_OP_WRITE;
 		contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-		Ring_put( contextp->dc_ringp,
-			  contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp,
+			  contextp->dc_msgp);
 		contextp->dc_msgp = 0;
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 		last_rec_wrtn_wo_err = contextp->dc_msgp->rm_user;
-		switch( contextp->dc_msgp->rm_stat ) {
+		switch(contextp->dc_msgp->rm_stat) {
 		case RING_STAT_OK:
 		case RING_STAT_INIT:
 			rval = 0;
@@ -2069,7 +2069,7 @@
 			rval = contextp->dc_msgp->rm_rval;
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 			return DRIVE_ERROR_CORE;
 		}
 	}
@@ -2077,7 +2077,7 @@
 	/* check for errors. if none, commit all marks before a safety margin
 	 * before the no error offset.
 	 */
-	if ( rval ) {
+	if (rval) {
 		contextp->dc_errorpr = BOOL_TRUE;
 	} else {
 		off64_t recs_wrtn_wo_err;
@@ -2085,8 +2085,8 @@
 		off64_t bytes_committed;
 		recs_wrtn_wo_err = last_rec_wrtn_wo_err + 1;
 		recs_committed = recs_wrtn_wo_err - contextp->dc_lostrecmax;
-		bytes_committed = recs_committed * ( off64_t )tape_recsz;
-		drive_mark_commit( drivep, bytes_committed );
+		bytes_committed = recs_committed * (off64_t)tape_recsz;
+		drive_mark_commit(drivep, bytes_committed);
 	}
 
 	/* adjust context
@@ -2099,15 +2099,15 @@
 
 	/* intialize header in new record
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	return rval;
 }
@@ -2120,40 +2120,40 @@
  *	the number of bytes to next alignment
  */
 static size_t
-do_get_align_cnt( drive_t * drivep )
+do_get_align_cnt(drive_t * drivep)
 {
 	char *next_alignment_point;
 	intptr_t next_alignment_off;
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: get align cnt\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: get align cnt\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because all buffers are page-aligned
 	 * and a multiple of PGSZ.
 	 */
-	next_alignment_off = ( intptr_t )contextp->dc_nextp;
+	next_alignment_off = (intptr_t)contextp->dc_nextp;
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
-	next_alignment_point = ( char * )next_alignment_off;
-	assert( next_alignment_point <= contextp->dc_recendp );
+	next_alignment_point = (char *)next_alignment_off;
+	assert(next_alignment_point <= contextp->dc_recendp);
 
 	/* return the number of bytes to the next alignment offset
 	 */
-	assert( next_alignment_point >= contextp->dc_nextp );
-	return ( size_t )( next_alignment_point - contextp->dc_nextp );
+	assert(next_alignment_point >= contextp->dc_nextp);
+	return (size_t)(next_alignment_point - contextp->dc_nextp);
 }
 
 /* do_end_write - pad and write pending record if any client data in it.
@@ -2164,9 +2164,9 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_end_write( drive_t *drivep, off64_t *ncommittedp )
+do_end_write(drive_t *drivep, off64_t *ncommittedp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t first_rec_w_err; /* zero-based index */
 	off64_t recs_wtn_wo_err;
 	off64_t recs_guaranteed;
@@ -2174,17 +2174,17 @@
 
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: end write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: end write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* pre-initialize return of count of bytes committed to media
 	 */
@@ -2194,46 +2194,46 @@
 	 * to do anymore writes, just cleanup and return 0. don't need to
 	 * do commits, already done when error occured.
 	 */
-	if ( contextp->dc_errorpr ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_errorpr) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_mode = OM_NONE;
-		drive_mark_discard( drivep );
-		*ncommittedp = ( contextp->dc_iocnt - contextp->dc_lostrecmax )
+		drive_mark_discard(drivep);
+		*ncommittedp = (contextp->dc_iocnt - contextp->dc_lostrecmax)
 			       *
-			       ( off64_t )tape_recsz;
+			       (off64_t)tape_recsz;
 		contextp->dc_recp = 0;
 		return 0;
 	}
 
 	/* if any user data in current record buffer, send it out.
 	 */
-	if ( contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ ) {
+	if (contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ) {
 		rec_hdr_t *rechdrp;
 		size_t bufusedcnt;
 
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-		bufusedcnt = ( size_t )( contextp->dc_nextp
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
+		bufusedcnt = (size_t)(contextp->dc_nextp
 					 -
-					 contextp->dc_recp );
+					 contextp->dc_recp);
 		rechdrp->rec_used = bufusedcnt;
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "writing padded last record\n" );
-		if ( contextp->dc_singlethreadedpr ) {
-			rval = write_record( drivep,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "writing padded last record\n");
+		if (contextp->dc_singlethreadedpr) {
+			rval = write_record(drivep,
 					     contextp->dc_recp,
-					     BOOL_TRUE, BOOL_TRUE );
+					     BOOL_TRUE, BOOL_TRUE);
 		} else {
-			assert( contextp->dc_msgp );
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_WRITE;
 			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			switch( contextp->dc_msgp->rm_stat ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				rval = 0;
@@ -2242,7 +2242,7 @@
 				rval = contextp->dc_msgp->rm_rval;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2259,7 +2259,7 @@
 	 * media, and that will be used to select which marks
 	 * to commit and which to discard.
 	 */
-	if ( rval ) {
+	if (rval) {
 		first_rec_w_err = contextp->dc_iocnt;
 			/* because dc_iocnt bumped by write_record
 			 * only if no error
@@ -2267,28 +2267,28 @@
 	} else {
 		first_rec_w_err = -1L;
 	}
-	if ( ! contextp->dc_singlethreadedpr ) {
-		while ( ! rval ) {
-			assert( contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		while (! rval) {
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_TRACE;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			if ( contextp->dc_msgp->rm_op == RING_OP_TRACE ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			if (contextp->dc_msgp->rm_op == RING_OP_TRACE) {
 				break;
 			}
-			switch( contextp->dc_msgp->rm_stat ) {
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
-				assert( rval == 0 );
+				assert(rval == 0);
 				break;
 			case RING_STAT_ERROR:
 				rval = contextp->dc_msgp->rm_rval;
 				first_rec_w_err = contextp->dc_msgp->rm_user;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2297,8 +2297,8 @@
 
 	/* the ring is now flushed. reset
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -2307,30 +2307,30 @@
 	 * side-effect of flushing the driver/drive of pending writes,
 	 * exposing any write errors.
 	 */
-	if ( ! rval ) {
+	if (! rval) {
 		int weofrval;
 		mtstat_t mtstat;
 		bool_t ok;
 
-		weofrval = mt_op( contextp->dc_fd, MTWEOF, 1 );
-		if ( ! weofrval ) {
-			ok = mt_get_status( drivep, &mtstat );
-			if ( ! ok ) {
-				status_failed_message( drivep );
+		weofrval = mt_op(contextp->dc_fd, MTWEOF, 1);
+		if (! weofrval) {
+			ok = mt_get_status(drivep, &mtstat);
+			if (! ok) {
+				status_failed_message(drivep);
 				mtstat = 0;
 				rval = DRIVE_ERROR_DEVICE;
 			}
 		} else {
 			mtstat = 0;
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "MTWEOF returned %d: errno == %d (%s)\n",
 			      weofrval,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 		}
-		if ( weofrval || IS_EW( mtstat ) || IS_EOT( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-			     "hit EOM trying to write file mark\n" );
+		if (weofrval || IS_EW(mtstat) || IS_EOT(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+			     "hit EOM trying to write file mark\n");
 			rval = DRIVE_ERROR_EOM;
 		}
 	}
@@ -2349,18 +2349,18 @@
 	 * and return rval. return by reference the number of bytes committed
 	 * to tape.
 	 */
-	if ( rval ) {
-		assert( first_rec_w_err >= 0 );
+	if (rval) {
+		assert(first_rec_w_err >= 0);
 		recs_wtn_wo_err = first_rec_w_err;
 		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
 	} else {
-		assert( first_rec_w_err == -1 );
+		assert(first_rec_w_err == -1);
 		recs_wtn_wo_err = contextp->dc_iocnt;
 		recs_guaranteed = recs_wtn_wo_err;
 	}
-	bytes_committed = recs_guaranteed * ( off64_t )tape_recsz;
-	drive_mark_commit( drivep, bytes_committed );
-	drive_mark_discard( drivep );
+	bytes_committed = recs_guaranteed * (off64_t)tape_recsz;
+	drive_mark_commit(drivep, bytes_committed);
+	drive_mark_discard(drivep);
 	contextp->dc_mode = OM_NONE;
 	*ncommittedp = bytes_committed;
 	return rval;
@@ -2374,7 +2374,7 @@
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_fsf( drive_t *drivep, int count, int *statp )
+do_fsf(drive_t *drivep, int count, int *statp)
 {
 	int 		i, done, op_failed, opcount;
 	mtstat_t mtstat;
@@ -2382,42 +2382,42 @@
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: fsf: count %d\n",
-	      count );
+	      count);
 
-	assert( count );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(count);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* get tape status
   	 */
-	if ( ! mt_get_status( drivep, &mtstat) ) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
 		*statp = DRIVE_ERROR_DEVICE;
 		return 0;
 	}
 
-	for ( i = 0 ; i < count; i++ ) {
+	for (i = 0 ; i < count; i++) {
 		done = 0;
 		opcount = 2;
 
 		/* the tape may encounter errors will trying to
 		 * reach the next file.
 		 */
-		while ( !done ) {
+		while (!done) {
 			/* check for end-of-data and end-of-tape conditions
 			 */
-			if ( IS_EOT( mtstat ) ) {
+			if (IS_EOT(mtstat)) {
 				*statp = DRIVE_ERROR_EOM;
 				return i;
 
-			} else if ( IS_EOD( mtstat ) ) {
+			} else if (IS_EOD(mtstat)) {
 				*statp = DRIVE_ERROR_EOD;
 				return i;
 			}
@@ -2426,17 +2426,17 @@
 			 * NOTE:
 			 * 	ignore return code
 			 */
-			mlog( MLOG_VERBOSE | MLOG_DRIVE,
-			      _("advancing tape to next media file\n") );
+			mlog(MLOG_VERBOSE | MLOG_DRIVE,
+			      _("advancing tape to next media file\n"));
 
 			op_failed = 0;
-			assert( contextp->dc_fd >= 0 );
-			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
+			assert(contextp->dc_fd >= 0);
+			if (mt_op(contextp->dc_fd, MTFSF, 1)) {
 				op_failed = 1;
 			}
 
-			if ( ! mt_get_status( drivep, &mtstat) ) {
-				status_failed_message( drivep );
+			if (! mt_get_status(drivep, &mtstat)) {
+				status_failed_message(drivep);
 				*statp = DRIVE_ERROR_DEVICE;
 				return i;
 			}
@@ -2444,7 +2444,7 @@
 			/* Check for a file mark to
 			 * determine if the fsf command worked.
 			 */
-			if ( (!op_failed) && (IS_FMK(mtstat)) ) {
+			if ((!op_failed) && (IS_FMK(mtstat))) {
 				done = 1;
 			}
 
@@ -2452,9 +2452,9 @@
 			 * times, and a file mark has not been reached,
 			 * return an error.
 			 */
-			if ( --opcount < 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_DRIVE,
-					_("FSF tape command failed\n") );
+			if (--opcount < 0) {
+				mlog(MLOG_VERBOSE | MLOG_DRIVE,
+					_("FSF tape command failed\n"));
 
 				*statp = DRIVE_ERROR_DEVICE;
 				return i;
@@ -2474,19 +2474,19 @@
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_bsf( drive_t *drivep, int count, int *statp )
+do_bsf(drive_t *drivep, int count, int *statp)
 {
 #ifdef DEBUG
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	int skipped;
 	mtstat_t mtstat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: bsf: count %d\n",
-	      count );
+	      count);
 
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
 	*statp = 0;
 
@@ -2497,29 +2497,29 @@
 
 	/* get tape status
 	 */
-	if ( ! mt_get_status( drivep, &mtstat )) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
 		*statp = DRIVE_ERROR_DEVICE;
 		return 0;
 	}
 
 	/* check for beginning-of-tape condition. close/reopen hack here
 	 */
-	if ( IS_BOT( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "reopening drive while at BOT\n" );
-		Close( drivep );
-		if ( ! Open( drivep )) {
-			display_access_failed_message( drivep );
+	if (IS_BOT(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "reopening drive while at BOT\n");
+		Close(drivep);
+		if (! Open(drivep)) {
+			display_access_failed_message(drivep);
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
-		if ( ! mt_get_status( drivep, &mtstat )) {
-			status_failed_message( drivep );
+		if (! mt_get_status(drivep, &mtstat)) {
+			status_failed_message(drivep);
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
-		assert( IS_BOT(mtstat ));
+		assert(IS_BOT(mtstat));
 
 
 		*statp = DRIVE_ERROR_BOM;
@@ -2529,18 +2529,18 @@
 	/* check if already at (and to right of) file mark and
 	 * count is zero.
 	 */
-	if ( IS_FMK( mtstat ) && count == 0 ) {
+	if (IS_FMK(mtstat) && count == 0) {
 		return 0;
 	}
 
 	/* back space - places us to left of previous file mark
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
-	mtstat = bsf_and_verify( drivep );
+	assert(drivep->d_capabilities & DRIVE_CAP_BSF);
+	mtstat = bsf_and_verify(drivep);
 
 	/* check again for beginning-of-tape condition
 	 */
-	if ( IS_BOT( mtstat )) {
+	if (IS_BOT(mtstat)) {
 		*statp = DRIVE_ERROR_BOM;
 		return 0;
 	}
@@ -2550,8 +2550,8 @@
 	 * TS devices !!!  LINUX ST tape driver only reports
 	 * GMT_EOF to the right of the filemark !!
 	 */
-	if ( TS_ISDRIVER ) {
-		if ( ! IS_FMK( mtstat )) {
+	if (TS_ISDRIVER) {
+		if (! IS_FMK(mtstat)) {
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
@@ -2559,18 +2559,18 @@
 
 	/* now loop, skipping media files
 	 */
-	for ( skipped = 0 ; skipped < count ; skipped++ ) {
+	for (skipped = 0 ; skipped < count ; skipped++) {
 
 		/* move to the left of the next file mark on the left.
 		 * check for BOT.
 		 */
-		mtstat = bsf_and_verify( drivep );
-		if ( IS_BOT( mtstat )) {
+		mtstat = bsf_and_verify(drivep);
+		if (IS_BOT(mtstat)) {
 			*statp = DRIVE_ERROR_BOM;
 			return skipped + 1;
 		}
-		if ( TS_ISDRIVER ) {
-			if ( ! IS_FMK( mtstat )) {
+		if (TS_ISDRIVER) {
+			if (! IS_FMK(mtstat)) {
 				*statp = DRIVE_ERROR_DEVICE;
 				return 0;
 			}
@@ -2579,11 +2579,11 @@
 
 	/* finally, move to the right side of the file mark
 	 */
-	mtstat = fsf_and_verify( drivep );
-	if( IS_EOT( mtstat )) {
+	mtstat = fsf_and_verify(drivep);
+	if(IS_EOT(mtstat)) {
 		*statp = DRIVE_ERROR_EOM;
 	}
-	if ( ! IS_FMK( mtstat )) {
+	if (! IS_FMK(mtstat)) {
 		*statp = DRIVE_ERROR_DEVICE;
 	}
 
@@ -2600,23 +2600,23 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_rewind( drive_t *drivep )
+do_rewind(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	mtstat_t mtstat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: rewind\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: rewind\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	mtstat = rewind_and_verify( drivep );
-	if ( ! IS_BOT( mtstat )) {
+	mtstat = rewind_and_verify(drivep);
+	if (! IS_BOT(mtstat)) {
 		return DRIVE_ERROR_DEVICE;
 	} else {
 		return 0;
@@ -2631,40 +2631,40 @@
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_erase( drive_t *drivep )
+do_erase(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	mtstat_t mtstat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: erase\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: erase\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	mtstat = rewind_and_verify( drivep );
-	if ( ! IS_BOT( mtstat )) {
+	mtstat = rewind_and_verify(drivep);
+	if (! IS_BOT(mtstat)) {
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* use validating tape erase util func
 	 */
-	( void )erase_and_verify( drivep );
+	(void)erase_and_verify(drivep);
 
 	/* rewind again
 	 */
-	mtstat = rewind_and_verify( drivep );
-	if ( ! IS_BOT( mtstat )) {
+	mtstat = rewind_and_verify(drivep);
+	if (! IS_BOT(mtstat)) {
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* close the drive so we start from scratch
 	 */
-	Close( drivep );
+	Close(drivep);
 	return 0;
 }
 
@@ -2676,27 +2676,27 @@
  *	DRIVE_ERROR_DEVICE on failure
  */
 static int
-do_eject_media( drive_t *drivep )
+do_eject_media(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: eject media\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: eject media\n");
 
 	/* drive must be open
 	 */
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* issue tape unload
 	 */
-	if ( contextp->dc_unloadokpr ) {
-		( void )mt_op( contextp->dc_fd, MTUNLOAD, 0 );
+	if (contextp->dc_unloadokpr) {
+		(void)mt_op(contextp->dc_fd, MTUNLOAD, 0);
 	}
 
 	/* close the device driver
 	 */
-	Close( drivep );
+	Close(drivep);
 
 	return 0;
 }
@@ -2709,10 +2709,10 @@
  */
 /* ARGSUSED */
 static int
-do_get_device_class( drive_t *drivep)
+do_get_device_class(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: get device class\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: get device class\n");
 
 	return DEVICE_TAPE_REMOVABLE;
 }
@@ -2720,69 +2720,69 @@
 /* do_display_metrics - print ring stats if using I/O ring
  */
 static void
-do_display_metrics( drive_t *drivep )
+do_display_metrics(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	if ( ringp ) {
-		if ( drivecnt > 1 ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
+	if (ringp) {
+		if (drivecnt > 1) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
 			      _("drive %u "),
-			      drivep->d_index );
+			      drivep->d_index);
 		}
-		display_ring_metrics( drivep,
-				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK );
+		display_ring_metrics(drivep,
+				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK);
 	}
 }
 
 /* do_quit
  */
 static void
-do_quit( drive_t *drivep )
+do_quit(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: quit\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: quit\n");
 
 	/* print the ring metrics and kill the ring
 	 */
-	if ( ringp ) {
-		display_ring_metrics( drivep, MLOG_VERBOSE );
+	if (ringp) {
+		display_ring_metrics(drivep, MLOG_VERBOSE);
 
 		/* tell slave to die
 		 */
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-		      "ring op: destroy\n" );
-		ring_destroy( ringp );
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+		      "ring op: destroy\n");
+		ring_destroy(ringp);
 	}
 
-	if ( ! contextp->dc_isvarpr
+	if (! contextp->dc_isvarpr
 	     &&
 	     ! contextp->dc_isQICpr
 	     &&
 	     contextp->dc_cansetblkszpr
 	     &&
-	     ( contextp->dc_origcurblksz != 0 ) ) {
-		( void )set_fixed_blksz( drivep, contextp->dc_origcurblksz );
+	     (contextp->dc_origcurblksz != 0)) {
+		(void)set_fixed_blksz(drivep, contextp->dc_origcurblksz);
 	}
 
 	/* issue tape unload
 	 */
-	if ( contextp->dc_unloadokpr ) {
-		( void )mt_op( contextp->dc_fd, MTUNLOAD, 0 );
+	if (contextp->dc_unloadokpr) {
+		(void)mt_op(contextp->dc_fd, MTUNLOAD, 0);
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op quit complete\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op quit complete\n");
 }
 
 static double
-percent64( off64_t num, off64_t denom )
+percent64(off64_t num, off64_t denom)
 {
-	return ( double )( num * 100 ) / ( double )denom;
+	return (double)(num * 100) / (double)denom;
 }
 
 
@@ -2831,7 +2831,7 @@
 
 
 static int
-read_label( drive_t *drivep )
+read_label(drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int nread;
@@ -2843,46 +2843,46 @@
 
 	/* initialize context ptr
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* if not at BOT or a file mark, advance to right of next file mark
 	 */
-	ok = mt_get_status( drivep, &mtstat );
-	if ( ! ok ) {
-		status_failed_message( drivep );
+	ok = mt_get_status(drivep, &mtstat);
+	if (! ok) {
+		status_failed_message(drivep);
 		return DRIVE_ERROR_DEVICE;
 	}
-	if ( ! IS_BOT( mtstat ) && ! IS_FMK( mtstat )) {
-		mtstat = fsf_and_verify( drivep );
+	if (! IS_BOT(mtstat) && ! IS_FMK(mtstat)) {
+		mtstat = fsf_and_verify(drivep);
 	}
 
 	/* if we hit EOM or early warning, just return
 	 */
-	if ( IS_EOT( mtstat ) || IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "begin read hit EOM/EW\n" );
+	if (IS_EOT(mtstat) || IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "begin read hit EOM/EW\n");
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* if we hit EOD, a file mark is missing
 	 */
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-		      _("file mark missing from tape (hit EOD)\n") );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		      _("file mark missing from tape (hit EOD)\n"));
 #ifdef DUMP
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-		      _("writing file mark at EOD\n") );
-		rval = mt_op( contextp->dc_fd, MTWEOF, 1 );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING,
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		      _("writing file mark at EOD\n"));
+		rval = mt_op(contextp->dc_fd, MTWEOF, 1);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING,
 			      _("unable to write file mark at eod: %s (%d)\n"),
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			return DRIVE_ERROR_MEDIA;
 		}
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 #endif /* DUMP */
@@ -2890,9 +2890,9 @@
 
 	/* verify we are either at BOT or a file mark
 	 */
-	if ( ! IS_BOT( mtstat ) && ! IS_FMK( mtstat )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-		      _("file mark missing from tape\n") );
+	if (! IS_BOT(mtstat) && ! IS_FMK(mtstat)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		      _("file mark missing from tape\n"));
 #ifdef DUMP
 		return DRIVE_ERROR_MEDIA;
 #endif
@@ -2901,7 +2901,7 @@
 	/* remember if we were at BOT, so we know how to reposition if EOD
 	 * encountered
 	 */
-	if ( IS_BOT( mtstat )) {
+	if (IS_BOT(mtstat)) {
 		wasatbotpr = BOOL_TRUE;
 	} else {
 		wasatbotpr = BOOL_FALSE;
@@ -2909,18 +2909,18 @@
 
 	/* read the first record of the media file directly
 	 */
-	nread = Read( drivep,
+	nread = Read(drivep,
 		      contextp->dc_recp,
 		      tape_recsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	/* if a read error, get status
 	 */
-	if ( nread != ( int )tape_recsz ) {
-		assert( nread < ( int )tape_recsz );
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+	if (nread != (int)tape_recsz) {
+		assert(nread < (int)tape_recsz);
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 	} else {
@@ -2929,29 +2929,29 @@
 
 	/* check for an unexpected errno
 	 */
-	if ( nread < 0 && saved_errno != ENOSPC ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (nread < 0 && saved_errno != ENOSPC) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not read from drive: %s (%d)\n"),
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* check for a blank tape. NOTE: shouldn't get here!
 	 */
-	if ( nread == 0 && wasatbotpr ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (nread == 0 && wasatbotpr) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("unexpectedly encountered EOD at BOT: "
-		      "assuming corrupted media\n") );
-		( void )rewind_and_verify( drivep );
+		      "assuming corrupted media\n"));
+		(void)rewind_and_verify(drivep);
 		return DRIVE_ERROR_MEDIA;
 	}
 
 	/* if we hit end of tape or early warning, indicate EOM
 	 */
-	if ( IS_EOT( mtstat ) || IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOM\n" );
+	if (IS_EOT(mtstat) || IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOM\n");
 		return DRIVE_ERROR_EOM;
 	}
 
@@ -2959,29 +2959,29 @@
 #ifdef DUMP
 	/* if we hit EOD, re-position in anticipation of appending.
 	 */
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOD: repositioning for append\n" );
-		if ( drivep->d_capabilities & DRIVE_CAP_BSF ) {
-			( void )bsf_and_verify( drivep );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOD: repositioning for append\n");
+		if (drivep->d_capabilities & DRIVE_CAP_BSF) {
+			(void)bsf_and_verify(drivep);
 		}
-		( void )fsf_and_verify( drivep );
+		(void)fsf_and_verify(drivep);
 		return DRIVE_ERROR_EOD;
 	}
 #endif /* DUMP */
 #ifdef RESTORE
 
         /* Linux case */
-	if ( IS_EOD( mtstat ) && IS_FMK( mtstat ) ) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOM\n" );
+	if (IS_EOD(mtstat) && IS_FMK(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOM\n");
 		return DRIVE_ERROR_EOM;
 	}
 
 
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOD\n" );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOD\n");
 		return DRIVE_ERROR_EOD;
 	}
 #endif /* RESTORE */
@@ -2989,11 +2989,11 @@
 	/* if we hit a file mark, this is very bad.
 	 * indicates the media has been corrupted
 	 */
-	if ( IS_FMK( mtstat )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (IS_FMK(mtstat)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("unexpectedly encountered a file mark: "
-		      "assuming corrupted media\n") );
-		( void )rewind_and_verify( drivep );
+		      "assuming corrupted media\n"));
+		(void)rewind_and_verify(drivep);
 		return DRIVE_ERROR_MEDIA;
 	}
 
@@ -3001,13 +3001,13 @@
 	 */
 	contextp->dc_iocnt = 1;
 
-	rval = validate_media_file_hdr( drivep );
+	rval = validate_media_file_hdr(drivep);
 
 	return rval;
 }
 
 static int
-validate_media_file_hdr( drive_t *drivep )
+validate_media_file_hdr(drive_t *drivep)
 {
 	global_hdr_t		*grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t		*drhdrp = drivep->d_readhdrp;
@@ -3024,10 +3024,10 @@
 	content_hdr_t		*tmpch = (content_hdr_t *)tmpmh->mh_upper;
 	content_inode_hdr_t	*tmpcih = (content_inode_hdr_t *)tmpch->ch_specific;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "validating media file header\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "validating media file header\n");
 
-	memcpy( tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ );
+	memcpy(tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ);
 
 	mlog(MLOG_NITTY, "validate_media_file_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -3047,14 +3047,14 @@
 
 	/* check the checksum
 	 */
-	if ( ! global_hdr_checksum_check( tmpgh )) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! global_hdr_checksum_check(tmpgh)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "bad media file header checksum\n");
 	        return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( ! tape_rec_checksum_check( contextp, contextp->dc_recp )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! tape_rec_checksum_check(contextp, contextp->dc_recp)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "tape record checksum error\n");
 		return DRIVE_ERROR_CORRUPTION;
 
@@ -3067,54 +3067,54 @@
 	xlate_content_inode_hdr(tmpcih, cih, 1);
 	xlate_rec_hdr(tmprh, tprhdrp, 1);
 
-	memcpy( contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ );
+	memcpy(contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ);
 
 	/* check the magic number
 	 */
-	if ( strncmp( grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "missing magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the version
 	 */
-	if ( global_version_check( grhdrp->gh_version ) != BOOL_TRUE ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (global_version_check(grhdrp->gh_version) != BOOL_TRUE) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid version number (%d) in tape label\n",
-		      grhdrp->gh_version );
+		      grhdrp->gh_version);
 	        return DRIVE_ERROR_VERSION;
 	}
 
 	/* check the strategy id
 	 */
-	if ( drhdrp->dh_strategyid != drivep->d_strategyp->ds_id ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (drhdrp->dh_strategyid != drivep->d_strategyp->ds_id) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	               "unrecognized drive strategy ID (%d)\n",
-	               drivep->d_readhdrp->dh_strategyid );
+	               drivep->d_readhdrp->dh_strategyid);
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the record magic number
 	 */
-	if ( tprhdrp->magic != STAPE_MAGIC ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (tprhdrp->magic != STAPE_MAGIC) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid record magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the record version number
 	 */
-	if ( tprhdrp->version != STAPE_VERSION ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (tprhdrp->version != STAPE_VERSION) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid record version number in tape label\n");
 	        return DRIVE_ERROR_VERSION;
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "media file header valid: "
 	      "media file ix %d\n",
-	      mrhdrp->mh_mediafileix );
+	      mrhdrp->mh_mediafileix);
 
 	return 0;
 }
@@ -3132,59 +3132,59 @@
  *	FALSE on failure
  */
 static bool_t
-set_fixed_blksz( drive_t *drivep, size_t blksz )
+set_fixed_blksz(drive_t *drivep, size_t blksz)
 {
-	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ix_t try;
 
 	/* sanity checks
 	 */
-	assert( blksz );
-	assert( contextp->dc_isvarpr == BOOL_FALSE );
-	assert( contextp->dc_cansetblkszpr );
-	assert( contextp->dc_fd >= 0 );
+	assert(blksz);
+	assert(contextp->dc_isvarpr == BOOL_FALSE);
+	assert(contextp->dc_cansetblkszpr);
+	assert(contextp->dc_fd >= 0);
 
 	/* give it two tries: first without rewinding, second with rewinding
 	 */
-	for ( try = 1 ; try <= 2 ; try++ ) {
+	for (try = 1 ; try <= 2 ; try++) {
 		struct mtblkinfo mtinfo;
 
 		/* set the tape block size. requires re-open
 	 	 */
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "setting fixed block size to %d\n",
-		      blksz );
+		      blksz);
 
 		/* close and re-open
 		 */
-		Close( drivep );
-		if ( ! Open( drivep )) {
-			display_access_failed_message( drivep );
+		Close(drivep);
+		if (! Open(drivep)) {
+			display_access_failed_message(drivep);
 			return BOOL_FALSE;
 		}
 
                 /* issue call to set block size
                  */
-                if ( mt_op( contextp->dc_fd,
+                if (mt_op(contextp->dc_fd,
                             MTSETBLK,
-                            ( int )blksz ) ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+                            (int)blksz)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "MTSETBLK %u failed: %s (%d)\n",
 			      blksz,
-			      strerror( errno ),
+			      strerror(errno),
 			      errno);
 		}
 
 		/* see if we were successful (can't look if RMT, so assume
 		 * it worked)
 		 */
-		if ( ! contextp->dc_isrmtpr ) {
+		if (! contextp->dc_isrmtpr) {
                         bool_t ok;
-                        ok = mt_blkinfo( contextp->dc_fd, &mtinfo );
-                        if ( ! ok ) {
+                        ok = mt_blkinfo(contextp->dc_fd, &mtinfo);
+                        if (! ok) {
                                 return BOOL_FALSE;
                         }
-                        if ( mtinfo.curblksz == blksz ) {
+                        if (mtinfo.curblksz == blksz) {
                                 return BOOL_TRUE;
                         }
 		} else {
@@ -3193,12 +3193,12 @@
 
 		/* so rewind and try again
 		 */
-		( void )rewind_and_verify( drivep );
+		(void)rewind_and_verify(drivep);
 	}
 
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("unable to set block size to %d\n"),
-	      blksz );
+	      blksz);
 
 	return BOOL_FALSE;
 }
@@ -3213,13 +3213,13 @@
  *	FALSE on error
  */
 static bool_t
-get_tpcaps( drive_t *drivep )
+get_tpcaps(drive_t *drivep)
 {
-	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 
-	if ( contextp->dc_isrmtpr ) {
+	if (contextp->dc_isrmtpr) {
 		/* can't ask about blksz, can't set blksz, can't ask about
 		 * drive types/caps. assume a drive which can overwrite.
 		 * assume NOT QIC, since fixed blksz devices not supported
@@ -3236,8 +3236,8 @@
 		 */
 		struct mtblkinfo mtinfo;
 		bool_t ok;
-		ok = mt_blkinfo( contextp->dc_fd, &mtinfo );
-		if ( ! ok ) {
+		ok = mt_blkinfo(contextp->dc_fd, &mtinfo);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 
@@ -3254,20 +3254,20 @@
 			contextp->dc_cangetblkszpr = BOOL_TRUE;
 			contextp->dc_cansetblkszpr = BOOL_TRUE;
 			contextp->dc_maxblksz = mtinfo.maxblksz;
-			if ( contextp->dc_origcurblksz == 0 )
+			if (contextp->dc_origcurblksz == 0)
 				contextp->dc_origcurblksz = mtinfo.curblksz;
 			drivep->d_capabilities |= DRIVE_CAP_OVERWRITE;
 			drivep->d_capabilities |= DRIVE_CAP_BSF;
 #ifdef HIDDEN
 Need to find equivalent in Linux.
-			if ( mtcapablity & MTCAN_SEEK ) {
+			if (mtcapablity & MTCAN_SEEK) {
 				contextp->dc_canfsrpr = BOOL_TRUE;
 			}
 #endif
 		}
 	}
 
-	set_recommended_sizes( drivep );
+	set_recommended_sizes(drivep);
 
 	return BOOL_TRUE;
 }
@@ -3280,32 +3280,32 @@
  *	void
  */
 static void
-set_recommended_sizes( drive_t *drivep )
+set_recommended_sizes(drive_t *drivep)
 {
-	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t	fsize = drive_strategy_scsitape.ds_recmfilesz;
 	off64_t	marksep = drive_strategy_scsitape.ds_recmarksep;
 
 	if (contextp->dc_filesz > 0) {
 		fsize = contextp->dc_filesz;
 #ifdef DUMP
-		if ( hdr_mfilesz > fsize ) {
-			mlog( MLOG_WARNING, _(
+		if (hdr_mfilesz > fsize) {
+			mlog(MLOG_WARNING, _(
 			      "recommended media file size of %llu Mb less than"
 			      " estimated file header size %llu Mb for %s\n"),
-			      fsize / ( 1024 * 1024 ),
-			      hdr_mfilesz / ( 1024 * 1024 ),
-			      drivep->d_pathname );
+			      fsize / (1024 * 1024),
+			      hdr_mfilesz / (1024 * 1024),
+			      drivep->d_pathname);
 		}
 #endif /* DUMP */
         }
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "recommended tape media file size set to 0x%llx bytes\n",
-	      fsize );
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	      fsize);
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "recommended tape media mark separation set to 0x%llx bytes\n",
-	      marksep );
+	      marksep);
 
 	drivep->d_recmfilesz = fsize;
 	drivep->d_recmarksep = marksep;
@@ -3326,36 +3326,36 @@
  *	FALSE on failure
  */
 static bool_t
-mt_blkinfo( int fd, struct mtblkinfo *minfo )
+mt_blkinfo(int fd, struct mtblkinfo *minfo)
 {
 	struct mtget 	mt_stat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: get block size info\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: get block size info\n");
 
 	if (TS_ISDRIVER) { /* Use TS ioctl MTIOCGETBLKINFO so we don't
 			    * have to hard code the max block size  */
 		struct mtblkinfo ts_blkinfo;
-		if ( ioctl(fd, MTIOCGETBLKINFO, &ts_blkinfo) < 0 ) {
+		if (ioctl(fd, MTIOCGETBLKINFO, &ts_blkinfo) < 0) {
 			/* failure
 			 */
 			mlog(MLOG_DEBUG,
 				"tape command MTIOCGETBLKINFO failed : %d (%s)\n",
 				errno,
-				strerror( errno ));
+				strerror(errno));
 			return BOOL_FALSE;
 		}
 		minfo->curblksz = ts_blkinfo.curblksz;
 		minfo->maxblksz = ts_blkinfo.maxblksz;
 	}
 	else {
-		if ( ioctl(fd, MTIOCGET, &mt_stat) < 0 ) {
+		if (ioctl(fd, MTIOCGET, &mt_stat) < 0) {
 			/* failure
 			 */
 			mlog(MLOG_DEBUG,
 				"tape command MTIOCGET failed : %d (%s)\n",
 	 			errno,
- 	 			strerror( errno ));
+ 	 			strerror(errno));
 			return BOOL_FALSE;
 		}
 		minfo->curblksz = (mt_stat.mt_dsreg >> MT_ST_BLKSIZE_SHIFT) &
@@ -3363,7 +3363,7 @@
 		minfo->maxblksz = STAPE_MAX_LINUX_RECSZ;
 	}
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "max=%u cur=%u\n",
 	      minfo->maxblksz,
 	      minfo->curblksz);
@@ -3381,18 +3381,18 @@
  *	-1 on failure
  */
 static int
-mt_op(int fd, int sub_op, int param )
+mt_op(int fd, int sub_op, int param)
 {
 	struct mtop 	mop;
 	char *printstr;
 	int rval;
 
-	mop.mt_op   	= (short )sub_op;
+	mop.mt_op   	= (short)sub_op;
 	mop.mt_count	= param;
 
-	assert( fd >= 0 );
+	assert(fd >= 0);
 
-	switch ( sub_op ) {
+	switch (sub_op) {
 	case MTSEEK:
 		printstr = "seek";
 		break;
@@ -3427,22 +3427,22 @@
 		printstr = "???";
 		break;
 	}
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: %s %d\n",
 	      printstr,
-	      param );
+	      param);
 
-	rval = ioctl( fd, MTIOCTOP, &mop );
-	if ( rval < 0 ) {
+	rval = ioctl(fd, MTIOCTOP, &mop);
+	if (rval < 0) {
 		/* failure
 	 	 */
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "tape op %s %d returns %d: errno == %d (%s)\n",
 		      printstr,
 		      param,
 		      rval,
 		      errno,
-		      strerror( errno ));
+		      strerror(errno));
 		return -1;
 	}
 
@@ -3452,25 +3452,25 @@
 }
 
 static bool_t
-mt_get_fileno( drive_t *drivep, long *fileno)
+mt_get_fileno(drive_t *drivep, long *fileno)
 {
 	struct mtget 	mt_stat;
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: get fileno\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: get fileno\n");
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 
-	if ( ioctl(contextp->dc_fd, MTIOCGET, &mt_stat) < 0 ) {
+	if (ioctl(contextp->dc_fd, MTIOCGET, &mt_stat) < 0) {
 		/* failure
 		 */
 		mlog(MLOG_DEBUG,
 			"tape command MTIOCGET failed : %d (%s)\n",
 	 		errno,
- 	 		strerror( errno ));
+ 	 		strerror(errno));
 		return BOOL_FALSE;
 	}
 	*fileno = mt_stat.mt_fileno;
@@ -3485,17 +3485,17 @@
  *	FALSE if not
  */
 static bool_t
-mt_get_status( drive_t *drivep, long *status)
+mt_get_status(drive_t *drivep, long *status)
 {
 	struct mtget 	mt_stat;
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: get status\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: get status\n");
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 
 	if (TS_ISDRIVER) {
 		/*
@@ -3505,24 +3505,24 @@
 		 * See comments in map_ts_status() for more detail.
 		 */
 		struct mtget_sgi mt_stat_sgi;
-                if ( ioctl(contextp->dc_fd, MTIOCGET_SGI, &mt_stat_sgi) < 0 ) {
+                if (ioctl(contextp->dc_fd, MTIOCGET_SGI, &mt_stat_sgi) < 0) {
                         /* failure
                          */
                         mlog(MLOG_DEBUG,
                                 "tape command MTIOCGET_SGI failed : %d (%s)\n",
                                 errno,
-                                strerror( errno ));
+                                strerror(errno));
                         return BOOL_FALSE;
                 }
-		map_ts_status( &mt_stat, mt_stat_sgi );
+		map_ts_status(&mt_stat, mt_stat_sgi);
 	} else {
-		if ( ioctl(contextp->dc_fd, MTIOCGET, &mt_stat) < 0 ) {
+		if (ioctl(contextp->dc_fd, MTIOCGET, &mt_stat) < 0) {
 			/* failure
 			 */
 			mlog(MLOG_DEBUG,
 				"tape command MTIOCGET failed : %d (%s)\n",
 	 			errno,
- 	 			strerror( errno ));
+ 	 			strerror(errno));
 			return BOOL_FALSE;
 		}
 	}
@@ -3532,7 +3532,7 @@
 	*status = mt_stat.mt_gstat;
 
 	/* print out symbolic form of tape status */
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 		"tape status = %s%s%s%s%s%s%s\n",
 		IS_BOT(*status)?   "bot ":"",
 		IS_FMK(*status)?   "fmk ":"",
@@ -3553,28 +3553,28 @@
  *	DRIVE_ERROR_*
  */
 static int
-determine_write_error( drive_t *drivep, int nwritten, int saved_errno )
+determine_write_error(drive_t *drivep, int nwritten, int saved_errno)
 {
 	mtstat_t	mtstat;
 	int 	ret;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* get tape device status
 	 */
-	if ( ! mt_get_status( drivep, &mtstat) ) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
 		ret = DRIVE_ERROR_DEVICE;
-	} else if ( IS_WPROT(mtstat) && (saved_errno == EROFS)) {
+	} else if (IS_WPROT(mtstat) && (saved_errno == EROFS)) {
 
 		mlog(MLOG_NORMAL,
 		     _("tape is write protected\n"));
 
 		ret = DRIVE_ERROR_DEVICE;
-	} else if ( (!IS_BOT(mtstat)) &&
-		    (IS_EOT( mtstat ) || IS_EW( mtstat) ||
+	} else if ((!IS_BOT(mtstat)) &&
+		    (IS_EOT(mtstat) || IS_EW(mtstat) ||
 		    (saved_errno == ENOSPC))) {
  		ret = DRIVE_ERROR_EOM;
-	} else if (saved_errno == EIO ) {
+	} else if (saved_errno == EIO) {
 
 		mlog(MLOG_NORMAL,
 		     _("tape media error on write operation\n"));
@@ -3583,65 +3583,65 @@
 		     _("no more data can be written to this tape\n"));
 
 		ret = DRIVE_ERROR_EOM;
-	} else if ( (saved_errno == 0) &&
+	} else if ((saved_errno == 0) &&
 		    (nwritten > 0)     &&
-		    contextp->dc_isQICpr ) {
+		    contextp->dc_isQICpr) {
 		/* short write on one of this devices indicates
 		 * early warning for end-of-media.
 		 */
  		ret = DRIVE_ERROR_EOM;
 	} else {
 		ret = DRIVE_ERROR_CORE;
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 			"tape unknown error on write operation: "
 			"0x%x, %d, %d\n",
 			mtstat, nwritten, saved_errno);
 	}
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 		"tape write operation status 0x%x, nwritten %d, errno %d\n",
 		mtstat,
 		nwritten,
 		saved_errno);
 
-	return ( ret );
+	return (ret);
 
 }
 
 static void
-tape_rec_checksum_set( drive_context_t *contextp, char *bufp )
+tape_rec_checksum_set(drive_context_t *contextp, char *bufp)
 {
-	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	uint32_t *beginp = ( uint32_t * )bufp;
-	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	rec_hdr_t *rechdrp = (rec_hdr_t *)bufp;
+	uint32_t *beginp = (uint32_t *)bufp;
+	uint32_t *endp = (uint32_t *)(bufp + tape_recsz);
 	uint32_t *p;
 	uint32_t accum;
 
-	if ( ! contextp->dc_recchksumpr ) {
+	if (! contextp->dc_recchksumpr) {
 		return;
 	}
 
 	INT_SET(rechdrp->ischecksum, ARCH_CONVERT, 1);
 	rechdrp->checksum = 0;
 	accum = 0;
-	for ( p = beginp ; p < endp ; p++ ) {
+	for (p = beginp ; p < endp ; p++) {
 	        accum += INT_GET(*p, ARCH_CONVERT);
 	}
-	INT_SET(rechdrp->checksum, ARCH_CONVERT, ( int32_t )( ~accum + 1 ));
+	INT_SET(rechdrp->checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
 }
 
 static bool_t
-tape_rec_checksum_check( drive_context_t *contextp, char *bufp )
+tape_rec_checksum_check(drive_context_t *contextp, char *bufp)
 {
-	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	uint32_t *beginp = ( uint32_t * )bufp;
-	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	rec_hdr_t *rechdrp = (rec_hdr_t *)bufp;
+	uint32_t *beginp = (uint32_t *)bufp;
+	uint32_t *endp = (uint32_t *)(bufp + tape_recsz);
 	uint32_t *p;
 	uint32_t accum;
 
-	if ( contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
+	if (contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
 		accum = 0;
-		for ( p = beginp ; p < endp ; p++ ) {
+		for (p = beginp ; p < endp ; p++) {
 	       		accum += INT_GET(*p, ARCH_CONVERT);
 		}
 		return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
@@ -3654,75 +3654,75 @@
  */
 #ifdef RMTDBG
 static int
-dbgrmtopen( char *path, int flags )
+dbgrmtopen(char *path, int flags)
 {
 	int rval;
-	rval = rmtopen( path, flags );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtopen(path, flags);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTOPEN( %s, %d ) returns %d: errno=%d (%s)\n"),
 	      path,
 	      flags,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtclose( int fd )
+dbgrmtclose(int fd)
 {
 	int rval;
-	rval = rmtclose( fd );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtclose(fd);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTCLOSE( %d ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtioctl( int fd, int op, void *arg )
+dbgrmtioctl(int fd, int op, void *arg)
 {
 	int rval;
-	rval = rmtioctl( fd, op, arg );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtioctl(fd, op, arg);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTIOCTL( %d, %d, 0x%x ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      op,
 	      arg,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtread( int fd, void *p, uint sz )
+dbgrmtread(int fd, void *p, uint sz)
 {
 	int rval;
-	rval = rmtread( fd, p, sz );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtread(fd, p, sz);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTREAD( %d, 0x%x, %u ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      p,
 	      sz,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtwrite( int fd, void *p, uint sz )
+dbgrmtwrite(int fd, void *p, uint sz)
 {
 	int rval;
-	rval = rmtwrite( fd, p, sz );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtwrite(fd, p, sz);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTWRITE( %d, 0x%x, %u ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      p,
 	      sz,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 #endif /* RMTDBG */
@@ -3734,27 +3734,27 @@
  *	void
  */
 static void
-display_access_failed_message( drive_t *drivep )
+display_access_failed_message(drive_t *drivep)
 {
 	drive_context_t		*contextp;
 
 	/* get pointer to drive context
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	if ( contextp->dc_isrmtpr ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+	if (contextp->dc_isrmtpr) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 			_("attempt to access/open remote "
 			"tape drive %s failed: %d (%s)\n"),
 			drivep->d_pathname,
 			errno,
-			strerror( errno ));
+			strerror(errno));
 	} else {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 			_("attempt to access/open device %s failed: %d (%s)\n"),
 			drivep->d_pathname,
 			errno,
-			strerror( errno ));
+			strerror(errno));
 	}
 	return;
 }
@@ -3766,43 +3766,43 @@
  *	one
  */
 static void
-status_failed_message( drive_t *drivep )
+status_failed_message(drive_t *drivep)
 {
 	drive_context_t		*contextp;
 
 	/* get pointer to drive context
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* the get status call could have failed due to the
 	 * tape device being closed by a CTLR-\ from the operator.
 	 */
-	if ( contextp->dc_fd != -1 ) {
-		if ( contextp->dc_isrmtpr ) {
-		 	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	if (contextp->dc_fd != -1) {
+		if (contextp->dc_isrmtpr) {
+		 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	 			_("attempt to get status of remote "
 	 			"tape drive %s failed: %d (%s)\n"),
 				drivep->d_pathname,
 				errno,
-				strerror( errno ));
+				strerror(errno));
 		} else {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
 				_("attempt to get status of "
 				"tape drive %s failed: %d (%s)\n"),
 				drivep->d_pathname,
 				errno,
-				strerror( errno ));
+				strerror(errno));
 		}
 	}
 	return;
 }
 
 static bool_t
-is_variable( drive_t *drivep, bool_t *varblk )
+is_variable(drive_t *drivep, bool_t *varblk)
 {
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	if (TS_ISDRIVER) {
 		char value[MT_ATTR_MAX_VALLEN+1];
@@ -3826,7 +3826,7 @@
 		struct mtblkinfo minfo;
 
 		ok = mt_blkinfo(contextp->dc_fd, &minfo);
-		if (!ok )
+		if (!ok)
 			return BOOL_FALSE; /* failure */
 
 		/* for Linux scsi driver the blksize == 0 if variable */
@@ -3846,7 +3846,7 @@
  * xfsdumps on media.
  */
 static int
-prepare_drive( drive_t *drivep )
+prepare_drive(drive_t *drivep)
 {
 	drive_context_t	*contextp;
 	mtstat_t mtstat;
@@ -3859,44 +3859,44 @@
 
 	/* get pointer to drive context
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 retry:
-	if ( cldmgr_stop_requested( )) {
+	if (cldmgr_stop_requested()) {
 		return DRIVE_ERROR_STOP;
 	}
 
 	/* shouldn't be here if drive is open
 	 */
-	assert( contextp->dc_fd == -1 );
+	assert(contextp->dc_fd == -1);
 
-	mlog( MLOG_VERBOSE | MLOG_DRIVE,
-	      _("preparing drive\n") );
+	mlog(MLOG_VERBOSE | MLOG_DRIVE,
+	      _("preparing drive\n"));
 
 
 	/* determine if tape is present or write protected. try several times.
 	 * if not present or write-protected during dump, return.
 	 */
 	maxtries = 15;
-	for ( try = 1 ; ; sleep( 10 ), try++ ) {
-		if ( cldmgr_stop_requested( )) {
+	for (try = 1 ; ; sleep(10), try++) {
+		if (cldmgr_stop_requested()) {
 			return DRIVE_ERROR_STOP;
 		}
 
 		/* open the drive
 	 	 */
-		ok = Open( drivep );
-		if ( ! ok ) {
-			if ( errno != EBUSY ) {
-				display_access_failed_message( drivep );
+		ok = Open(drivep);
+		if (! ok) {
+			if (errno != EBUSY) {
+				display_access_failed_message(drivep);
 				return DRIVE_ERROR_DEVICE;
 			} else {
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
-				      "open drive returns EBUSY\n" );
-				if ( try >= maxtries ) {
-					mlog( MLOG_TRACE | MLOG_DRIVE,
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
+				      "open drive returns EBUSY\n");
+				if (try >= maxtries) {
+					mlog(MLOG_TRACE | MLOG_DRIVE,
 					      "giving up waiting for drive "
-					      "to indicate online\n" );
+					      "to indicate online\n");
 					return DRIVE_ERROR_MEDIA;
 				}
 				continue;
@@ -3906,9 +3906,9 @@
 		/* read device status (uses an ioctl)
 		 */
 		mtstat = 0;
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 
@@ -3916,18 +3916,18 @@
 		 * also check if write-protected (DUMP only), and give up
 		 * after a few tries.
 		 */
-		if ( IS_ONL( mtstat )) {
+		if (IS_ONL(mtstat)) {
 #ifdef DUMP
-			if ( IS_WPROT( mtstat )) {
+			if (IS_WPROT(mtstat)) {
 				mlog(MLOG_NORMAL,
-				     _("tape is write protected\n") );
+				     _("tape is write protected\n"));
 				return DRIVE_ERROR_MEDIA;
 			}
 #endif /* DUMP */
 			/* populate a struct stat. NOTE: this may do a temporary open/close
 			 * NOTE: may do this only on local drives: rmt does not support!
 			 */
-			if ( contextp->dc_isrmtpr ) {
+			if (contextp->dc_isrmtpr) {
 				contextp->dc_isvarpr = BOOL_FALSE;
 			} else {
 				/* check for special device dev_t for fixed or variable type
@@ -3939,66 +3939,66 @@
 
 				if (varblk) {
 					contextp->dc_isvarpr = BOOL_TRUE;
-					mlog( MLOG_TRACE | MLOG_DRIVE,
+					mlog(MLOG_TRACE | MLOG_DRIVE,
 					      "variable block size "
 					      "tape drive at %s\n",
-					      drivep->d_pathname );
+					      drivep->d_pathname);
 				} else {
 					contextp->dc_isvarpr = BOOL_FALSE;
-					mlog( MLOG_TRACE | MLOG_DRIVE,
+					mlog(MLOG_TRACE | MLOG_DRIVE,
 					      "fixed block size tape "
 					      "drive at %s\n",
-					      drivep->d_pathname );
+					      drivep->d_pathname);
 				}
 			}
 
 			break;
-		} else if ( try >= maxtries ) {
-			mlog( MLOG_VERBOSE | MLOG_DRIVE,
+		} else if (try >= maxtries) {
+			mlog(MLOG_VERBOSE | MLOG_DRIVE,
 			      _("giving up waiting for drive "
-			      "to indicate online\n") );
+			      "to indicate online\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 
 		/* drive is not ready. sleep for a while and try again
 		 */
-		mlog( MLOG_VERBOSE | MLOG_DRIVE,
+		mlog(MLOG_VERBOSE | MLOG_DRIVE,
 		      _("tape drive %s is not ready (0x%x): "
 		      "retrying ...\n"),
 		      drivep->d_pathname,
-		      mtstat );
+		      mtstat);
 
-		Close( drivep );
+		Close(drivep);
 	}
-	assert( IS_ONL( mtstat ));
+	assert(IS_ONL(mtstat));
 
 	/* determine tape capabilities. this will set the drivep->d_capabilities
 	 * and contextp->dc_{...}blksz and dc_isQICpr, as well as recommended
 	 * mark separation and media file size.
 	 */
-	ok = get_tpcaps( drivep );
-	if ( ! ok ) {
+	ok = get_tpcaps(drivep);
+	if (! ok) {
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* disallow access of QIC via variable
 	 */
-	if ( contextp->dc_isvarpr && contextp->dc_isQICpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
+	if (contextp->dc_isvarpr && contextp->dc_isQICpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
 		      "use of QIC drives via variable blocksize device nodes "
-		      "is not supported\n") );
+		      "is not supported\n"));
 		return DRIVE_ERROR_INVAL;
 	}
 
 	/* if the overwrite option was specified , set the best blocksize
 	 * we can and return.
 	 */
-	if ( contextp->dc_overwritepr ) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (contextp->dc_overwritepr) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 			"Overwrite option specified. "
-			"Trying best blocksize\n" );
-		ok = set_best_blk_and_rec_sz( drivep );
-		if ( ! ok ) {
+			"Trying best blocksize\n");
+		ok = set_best_blk_and_rec_sz(drivep);
+		if (! ok) {
 			return DRIVE_ERROR_DEVICE;
 		}
 		return DRIVE_ERROR_OVERWRITE;
@@ -4017,16 +4017,16 @@
 	 * we will use tape motion. back up two file marks, because
 	 * typically we will be positioned after last file mark at EOD.
 	 */
-	if ( ! IS_BOT( mtstat ) && IS_FMK( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! IS_BOT(mtstat) && IS_FMK(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "tape positioned at file mark, "
 		      "but do not know if before or after: "
-		      "forcing tape motion to disambiguate\n" );
+		      "forcing tape motion to disambiguate\n");
 #ifdef RESTORE
-		( void )fsf_and_verify( drivep );
+		(void)fsf_and_verify(drivep);
 #endif /* RESTORE */
-		rval = quick_backup( drivep, contextp, 0 );
-		if ( rval ) {
+		rval = quick_backup(drivep, contextp, 0);
+		if (rval) {
 			return rval;
 		}
 	}
@@ -4051,39 +4051,39 @@
  	 */
 	maxtries = 5;
 	changedblkszpr = BOOL_FALSE;
-	for ( try = 1 ; ; try++ ) {
+	for (try = 1 ; ; try++) {
 		bool_t wasatbotpr;
 		int nread;
 		int saved_errno;
 
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return DRIVE_ERROR_STOP;
 		}
 
 		/* bail out if we've tried too many times
 		 */
-		if ( try > maxtries ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE, _(
+		if (try > maxtries) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE, _(
 			      "giving up attempt to determining "
-			      "tape record size\n") );
+			      "tape record size\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "determining tape record size: trying %d (0x%x) bytes\n",
 		      tape_recsz,
-		      tape_recsz );
+		      tape_recsz);
 
 		/* if a fixed device, but not QIC, and possible to set the block
 		 * size, do so.
 		 */
-		if ( ! contextp->dc_isvarpr
+		if (! contextp->dc_isvarpr
 		     &&
 		     ! contextp->dc_isQICpr
 		     &&
-		     contextp->dc_cansetblkszpr ) {
-			ok = set_fixed_blksz( drivep, tape_blksz );
-			if ( ! ok ) {
+		     contextp->dc_cansetblkszpr) {
+			ok = set_fixed_blksz(drivep, tape_blksz);
+			if (! ok) {
 				return DRIVE_ERROR_DEVICE;
 			}
 		}
@@ -4091,9 +4091,9 @@
 		/* refresh the tape status
 		 */
 		mtstat = 0;
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 
@@ -4103,102 +4103,102 @@
 		 * so we must either bsf or rewind to eliminate the uncertainty.
 		 * if BSF is not supported, must rewind.
 		 */
-		if ( ! IS_BOT( mtstat ) && ! IS_FMK( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (! IS_BOT(mtstat) && ! IS_FMK(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "tape position unknown: searching backward "
-			      "for file mark or BOT\n" );
-			rval = quick_backup( drivep, contextp, 0 );
-			if ( rval ) {
+			      "for file mark or BOT\n");
+			rval = quick_backup(drivep, contextp, 0);
+			if (rval) {
 				return rval;
 			}
 			mtstat = 0;
-			ok = mt_get_status( drivep, &mtstat );
-			if ( ! ok ) {
-				status_failed_message( drivep );
+			ok = mt_get_status(drivep, &mtstat);
+			if (! ok) {
+				status_failed_message(drivep);
 				return DRIVE_ERROR_DEVICE;
 			}
 		}
 
 		/* if we can't position the tape, call it a media error
 		 */
-		if ( ! IS_BOT( mtstat ) && ! IS_FMK( mtstat )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-			      _("unable to backspace/rewind media\n") );
+		if (! IS_BOT(mtstat) && ! IS_FMK(mtstat)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			      _("unable to backspace/rewind media\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
-		if ( IS_BOT( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (IS_BOT(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "tape positioned at BOT: "
-			      "doing redundant rewind\n" );
-			mtstat = rewind_and_verify( drivep );
-			if ( ! IS_BOT( mtstat )) {
+			      "doing redundant rewind\n");
+			mtstat = rewind_and_verify(drivep);
+			if (! IS_BOT(mtstat)) {
 				return DRIVE_ERROR_DEVICE;
 			}
 		}
-		if ( IS_FMK( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-			      "tape positioned at file mark\n" );
+		if (IS_FMK(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+			      "tape positioned at file mark\n");
 		}
 
 		/* determine if we are at BOT. remember, so if read fails
 		 * we can make a better decision on what to do next.
 		 */
-		if ( IS_BOT( mtstat )) {
+		if (IS_BOT(mtstat)) {
 			wasatbotpr = BOOL_TRUE;
-		} else if ( IS_FMK( mtstat )) {
+		} else if (IS_FMK(mtstat)) {
 			wasatbotpr = BOOL_FALSE;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-			      _("unable to backspace/rewind media\n") );
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			      _("unable to backspace/rewind media\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 
 		/* read a record. use the first ring buffer
 		 */
 		saved_errno = 0;
-		nread = Read( drivep,
+		nread = Read(drivep,
 			      contextp->dc_recp,
 			      tape_recsz,
-			      &saved_errno );
-		assert( saved_errno == 0 || nread < 0 );
+			      &saved_errno);
+		assert(saved_errno == 0 || nread < 0);
 
 		/* RMT can require a retry
 		 */
-		if ( saved_errno == EAGAIN ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-			      "read returned EAGAIN: retrying\n" );
+		if (saved_errno == EAGAIN) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+			      "read returned EAGAIN: retrying\n");
 			continue;
 		}
 
 		/* block size is bigger than buffer; should never happen
 		 */
-		if ( saved_errno == EINVAL ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == EINVAL) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned EINVAL: "
-			      "trying new record size\n" );
+			      "trying new record size\n");
 			goto largersize;
 		}
 
 		/* block size is bigger than buffer; should never happen
 		 */
-		if ( saved_errno == ENOMEM ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == ENOMEM) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned ENOMEM: "
-			      "trying new record size\n" );
+			      "trying new record size\n");
 			goto largersize;
 		}
 
 		/* tried to read past EOD and was at BOT
 		 */
-		if ( saved_errno == ENOSPC
+		if (saved_errno == ENOSPC
 		     &&
-		     wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "errno ENOSPC while at BOT "
-			      "indicates blank tape: returning\n" );
-			( void )rewind_and_verify( drivep );
-			ok = set_best_blk_and_rec_sz( drivep );
-			if ( ! ok ) {
+			      "indicates blank tape: returning\n");
+			(void)rewind_and_verify(drivep);
+			ok = set_best_blk_and_rec_sz(drivep);
+			if (! ok) {
 				return DRIVE_ERROR_DEVICE;
 			}
 			return DRIVE_ERROR_BLANK;
@@ -4208,15 +4208,15 @@
 		 * On Linux, using the scsi tape driver this
 		 * seems to happen with an erased/blank tape
 		 */
-		if ( saved_errno == EIO
+		if (saved_errno == EIO
 		     &&
-		     wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "errno EIO while at BOT "
-			      "indicates blank tape: returning\n" );
-			( void )rewind_and_verify( drivep );
-			ok = set_best_blk_and_rec_sz( drivep );
-			if ( ! ok ) {
+			      "indicates blank tape: returning\n");
+			(void)rewind_and_verify(drivep);
+			ok = set_best_blk_and_rec_sz(drivep);
+			if (! ok) {
 				return DRIVE_ERROR_DEVICE;
 			}
 			return DRIVE_ERROR_BLANK;
@@ -4224,14 +4224,14 @@
 
 		/* tried to read past EOD and NOT at BOT
 		 */
-		if ( saved_errno == ENOSPC
+		if (saved_errno == ENOSPC
 		     &&
-		     ! wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "errno ENOSPC while not at BOT "
-			      "indicates EOD: retrying\n" );
-			rval = quick_backup( drivep, contextp, 1 );
-			if ( rval ) {
+			      "indicates EOD: retrying\n");
+			rval = quick_backup(drivep, contextp, 1);
+			if (rval) {
 				return rval;
 			}
 			continue;
@@ -4239,17 +4239,17 @@
 
 		/* I/O error
 		 */
-		if ( saved_errno == EIO ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		if (saved_errno == EIO) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "read returned EIO: will reopen, rewind, "
-			      "and try again\n" );
-			Close( drivep );
-			ok = Open( drivep );
-			if ( ! ok ) {
-				display_access_failed_message( drivep );
+			      "and try again\n");
+			Close(drivep);
+			ok = Open(drivep);
+			if (! ok) {
+				display_access_failed_message(drivep);
 				return DRIVE_ERROR_DEVICE;
 			}
-			( void )rewind_and_verify( drivep );
+			(void)rewind_and_verify(drivep);
 			continue;
 		}
 
@@ -4257,197 +4257,197 @@
 		 * done below.
 		 */
 		mtstat = 0;
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     ! contextp->dc_isvarpr
 		     &&
-		     IS_EOD( mtstat )
+		     IS_EOD(mtstat)
 		     &&
-		     wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == 0 and EOD while at BOT on "
 			  "fixed blocksize drive "
-			  "indicates blank tape: returning\n" );
-			( void )rewind_and_verify( drivep );
-			ok = set_best_blk_and_rec_sz( drivep );
-			if ( ! ok ) {
+			  "indicates blank tape: returning\n");
+			(void)rewind_and_verify(drivep);
+			ok = set_best_blk_and_rec_sz(drivep);
+			if (! ok) {
 				return DRIVE_ERROR_DEVICE;
 			}
 			return DRIVE_ERROR_BLANK;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     ! contextp->dc_isvarpr
 		     &&
-		     IS_EOD( mtstat )
+		     IS_EOD(mtstat)
 		     &&
-		     ! wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == 0 and EOD while not at BOT on "
 			  "fixed blocksize drive "
-			  "indicates EOD: backing up and retrying\n" );
-			rval = quick_backup( drivep, contextp, 1 );
-			if ( rval ) {
+			  "indicates EOD: backing up and retrying\n");
+			rval = quick_backup(drivep, contextp, 1);
+			if (rval) {
 				return rval;
 			}
 			continue;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     ! contextp->dc_isvarpr
 		     &&
-		     IS_EOT( mtstat )
+		     IS_EOT(mtstat)
 		     &&
-		     ! wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == 0 and EOT while not at BOT on "
 			  "fixed blocksize drive "
-			  "indicates EOD: backing up and retrying\n" );
-			rval = quick_backup( drivep, contextp, 1 );
-			if ( rval ) {
+			  "indicates EOD: backing up and retrying\n");
+			rval = quick_backup(drivep, contextp, 1);
+			if (rval) {
 				return rval;
 			}
 			continue;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     ! contextp->dc_isvarpr
 		     &&
-		     ! IS_EOD( mtstat )
+		     ! IS_EOD(mtstat)
 		     &&
-		     ! IS_FMK( mtstat )
+		     ! IS_FMK(mtstat)
 		     &&
-		     ! IS_EOT( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! IS_EOT(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == 0 and not EOD, not EOT, "
 			  "and not at a file mark on fixed blocksize drive "
-			  "indicates wrong blocksize\n" );
+			  "indicates wrong blocksize\n");
 			goto newsize;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     contextp->dc_isvarpr
 		     &&
-		     IS_EOD( mtstat )
+		     IS_EOD(mtstat)
 		     &&
-		     wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "nread == 0 and EOD indication at BOT "
 			      "on variable tape "
-			      "indicates blank tape: returning\n" );
-			( void )rewind_and_verify( drivep );
-			ok = set_best_blk_and_rec_sz( drivep );
-			if ( ! ok ) {
+			      "indicates blank tape: returning\n");
+			(void)rewind_and_verify(drivep);
+			ok = set_best_blk_and_rec_sz(drivep);
+			if (! ok) {
 				return DRIVE_ERROR_DEVICE;
 			}
 			return DRIVE_ERROR_BLANK;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     contextp->dc_isvarpr
 		     &&
-		     IS_EOD( mtstat )
+		     IS_EOD(mtstat)
 		     &&
-		     ! wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == 0 and EOD while not at BOT on "
 			  "variable blocksize drive "
-			  "indicates EOD: backing up and retrying\n" );
-			rval = quick_backup( drivep, contextp, 1 );
-			if ( rval ) {
+			  "indicates EOD: backing up and retrying\n");
+			rval = quick_backup(drivep, contextp, 1);
+			if (rval) {
 				return rval;
 			}
 			continue;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     contextp->dc_isvarpr
 		     &&
-		     IS_EOT( mtstat )
+		     IS_EOT(mtstat)
 		     &&
-		     ! wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == 0 and EOT while not at BOT on "
 			  "variable blocksize drive "
-			  "indicates EOT: backing up and retrying\n" );
-			rval = quick_backup( drivep, contextp, 1 );
-			if ( rval ) {
+			  "indicates EOT: backing up and retrying\n");
+			rval = quick_backup(drivep, contextp, 1);
+			if (rval) {
 				return rval;
 			}
 			continue;
 		}
 
-		if ( nread == 0
+		if (nread == 0
 		     &&
 		     contextp->dc_isvarpr
 		     &&
-		     IS_FMK( mtstat )
+		     IS_FMK(mtstat)
 		     &&
-		     wasatbotpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     wasatbotpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "nread == 0 at BOT and at a file mark "
 			      "on variable blocksize drive "
-			      "indicates foreign tape: returning\n" );
-			( void )rewind_and_verify( drivep );
-			ok = set_best_blk_and_rec_sz( drivep );
-			if ( ! ok ) {
+			      "indicates foreign tape: returning\n");
+			(void)rewind_and_verify(drivep);
+			ok = set_best_blk_and_rec_sz(drivep);
+			if (! ok) {
 				return DRIVE_ERROR_DEVICE;
 			}
 			return DRIVE_ERROR_FOREIGN;
 		}
 
-		if ( nread > 0
+		if (nread > 0
 		     &&
 		     contextp->dc_isvarpr
 		     &&
-		     ! IS_EOD( mtstat )
+		     ! IS_EOD(mtstat)
 		     &&
-		     ! IS_FMK( mtstat )
+		     ! IS_FMK(mtstat)
 		     &&
-		     ! IS_EOT( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! IS_EOT(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread > 0 and not EOD, not EOT, "
 			  "and not at a file mark on variable blocksize drive "
-			  "indicates correct blocksize found\n" );
+			  "indicates correct blocksize found\n");
 			goto checkhdr;
 		}
 
-		if ( nread < ( int )tape_recsz
+		if (nread < (int)tape_recsz
 		     &&
-		     ! contextp->dc_isvarpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! contextp->dc_isvarpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread less than selected record size on "
 			  "fixed blocksize drive "
-			  "indicates wrong blocksize\n" );
+			  "indicates wrong blocksize\n");
 			goto newsize;
 		}
 
-		if ( nread == ( int )tape_recsz
+		if (nread == (int)tape_recsz
 		     &&
-		     ! contextp->dc_isvarpr ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		     ! contextp->dc_isvarpr) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == selected blocksize "
 			  "on fixed blocksize drive "
-			  "indicates correct blocksize found\n" );
+			  "indicates correct blocksize found\n");
 			goto checkhdr;
 		}
 
 		/* if we fell through the seive, code is wrong.
 		 * display useful info and abort
 		 */
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
 		      "unexpected tape error: "
 		      "errno %d "
 		      "nread %d "
@@ -4468,21 +4468,21 @@
 		      tape_recsz,
 		      !! contextp->dc_isvarpr,
 		      wasatbotpr,
-		      IS_EOD( mtstat ) > 0,
-		      IS_FMK( mtstat ) > 0,
-		      IS_EOT( mtstat ) > 0,
-		      IS_ONL( mtstat ) > 0,
-		      IS_WPROT( mtstat ) > 0,
-		      IS_EW( mtstat ) > 0,
-		      0 );
+		      IS_EOD(mtstat) > 0,
+		      IS_FMK(mtstat) > 0,
+		      IS_EOT(mtstat) > 0,
+		      IS_ONL(mtstat) > 0,
+		      IS_WPROT(mtstat) > 0,
+		      IS_EW(mtstat) > 0,
+		      0);
 
 		/* Common Linux Problem */
 		if (errno == EOVERFLOW) {
-		    mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_DRIVE,
+		    mlog(MLOG_NORMAL | MLOG_NOTE | MLOG_DRIVE,
 			_("likely problem is that the block size, %d, "
 			"is too large for Linux\n"),
 			tape_blksz);
-		    mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_DRIVE,
+		    mlog(MLOG_NORMAL | MLOG_NOTE | MLOG_DRIVE,
 			_("either try using a smaller block size with "
 			"the -b option, or increase max_sg_segs for "
 			"the scsi tape driver\n"));
@@ -4493,44 +4493,44 @@
 
 
 checkhdr:
-		rval = validate_media_file_hdr( drivep );
-		if ( rval ) {
-			if ( rval == DRIVE_ERROR_VERSION ) {
+		rval = validate_media_file_hdr(drivep);
+		if (rval) {
+			if (rval == DRIVE_ERROR_VERSION) {
 				global_hdr_t *grhdrp = drivep->d_greadhdrp;
-				mlog( MLOG_NORMAL | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_DRIVE,
 				      _("media file header version (%d) "
 				      "invalid: advancing\n"),
-				      grhdrp->gh_version );
+				      grhdrp->gh_version);
 				continue;
-			} else if ( wasatbotpr ) {
-				if ( isefsdump( drivep )) {
-					mlog( MLOG_NORMAL
+			} else if (wasatbotpr) {
+				if (isefsdump(drivep)) {
+					mlog(MLOG_NORMAL
 					      |
 					      MLOG_WARNING
 					      |
 					      MLOG_DRIVE,
 					      _("may be an EFS dump at BOT\n"));
 				} else {
-					mlog( MLOG_NORMAL | MLOG_DRIVE,
+					mlog(MLOG_NORMAL | MLOG_DRIVE,
 					      _("bad media file header at BOT "
 					      "indicates foreign or "
 					      "corrupted tape\n"));
 				}
-				( void )rewind_and_verify( drivep );
-				ok = set_best_blk_and_rec_sz( drivep );
-				if ( ! ok ) {
+				(void)rewind_and_verify(drivep);
+				ok = set_best_blk_and_rec_sz(drivep);
+				if (! ok) {
 					return DRIVE_ERROR_DEVICE;
 				}
 				return DRIVE_ERROR_FOREIGN;
 			} else {
 				/* back up and try again.
 				 */
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
 				      "media file header invalid: "
 				      "backing up "
-				      "to try a previous media file\n" );
-				rval = quick_backup( drivep, contextp, 1 );
-				if ( rval ) {
+				      "to try a previous media file\n");
+				rval = quick_backup(drivep, contextp, 1);
+				if (rval) {
 					return rval;
 				}
 				continue;
@@ -4539,10 +4539,10 @@
 			drive_hdr_t *drhdrp;
 			rec_hdr_t *tprhdrp;
 			drhdrp = drivep->d_readhdrp;
-			tprhdrp = ( rec_hdr_t * )drhdrp->dh_specific;
-			assert( tprhdrp->recsize >= 0 );
-			tape_recsz = ( size_t )tprhdrp->recsize;
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+			tprhdrp = (rec_hdr_t *)drhdrp->dh_specific;
+			assert(tprhdrp->recsize >= 0);
+			tape_recsz = (size_t)tprhdrp->recsize;
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "tape record size set to header's "
 			      "record size = %d\n", tape_recsz);
 			break;
@@ -4552,37 +4552,37 @@
 		/* we end up here if we want to try a new record size.
 		 * only do this once.
 		 */
-		if ( changedblkszpr ) {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
+		if (changedblkszpr) {
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
 			      _("cannot determine tape block size "
-			      "after two tries\n") );
-			if ( ! wasatbotpr ) {
-				mlog( MLOG_NORMAL | MLOG_DRIVE,
-				      _("will rewind and try again\n") );
-				( void )rewind_and_verify( drivep );
-				Close( drivep );
+			      "after two tries\n"));
+			if (! wasatbotpr) {
+				mlog(MLOG_NORMAL | MLOG_DRIVE,
+				      _("will rewind and try again\n"));
+				(void)rewind_and_verify(drivep);
+				Close(drivep);
 				goto retry;
 			} else {
-				mlog( MLOG_NORMAL | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_DRIVE,
 				      _("assuming media is corrupt "
-				      "or contains non-xfsdump data\n") );
-				( void )rewind_and_verify( drivep );
-				ok = set_best_blk_and_rec_sz( drivep );
-				if ( ! ok ) {
+				      "or contains non-xfsdump data\n"));
+				(void)rewind_and_verify(drivep);
+				ok = set_best_blk_and_rec_sz(drivep);
+				if (! ok) {
 					return DRIVE_ERROR_DEVICE;
 				}
 				return DRIVE_ERROR_FOREIGN;
 			}
 		}
-		if ( tape_recsz > STAPE_MIN_MAX_BLKSZ ) {
+		if (tape_recsz > STAPE_MIN_MAX_BLKSZ) {
 			tape_recsz = STAPE_MIN_MAX_BLKSZ;
-			if ( ! contextp->dc_isQICpr ) {
+			if (! contextp->dc_isQICpr) {
 				tape_blksz = tape_recsz;;
 			}
 			changedblkszpr = BOOL_TRUE;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
-			      _("cannot determine tape block size\n") );
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
+			      _("cannot determine tape block size\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 		continue;
@@ -4591,23 +4591,23 @@
 		/* we end up here if we want to try a new larger record size
 		 * because the last one was not big enough for the tape block
 		 */
-		if ( changedblkszpr ) {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
+		if (changedblkszpr) {
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
 			      _("cannot determine tape block size "
-			      "after two tries\n") );
-			if ( ! wasatbotpr ) {
-				mlog( MLOG_NORMAL | MLOG_DRIVE,
-				      _("will rewind and try again\n") );
-				( void )rewind_and_verify( drivep );
-				Close( drivep );
+			      "after two tries\n"));
+			if (! wasatbotpr) {
+				mlog(MLOG_NORMAL | MLOG_DRIVE,
+				      _("will rewind and try again\n"));
+				(void)rewind_and_verify(drivep);
+				Close(drivep);
 				goto retry;
 			} else {
-				mlog( MLOG_NORMAL | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_DRIVE,
 				      _("assuming media is corrupt "
-				      "or contains non-xfsdump data\n") );
-				( void )rewind_and_verify( drivep );
-				ok = set_best_blk_and_rec_sz( drivep );
-				if ( ! ok ) {
+				      "or contains non-xfsdump data\n"));
+				(void)rewind_and_verify(drivep);
+				ok = set_best_blk_and_rec_sz(drivep);
+				if (! ok) {
 					return DRIVE_ERROR_DEVICE;
 				}
 				return DRIVE_ERROR_FOREIGN;
@@ -4615,29 +4615,29 @@
 		}
                 /* Make it as large as we can go
                  */
-		if ( tape_recsz != STAPE_MAX_RECSZ ) {
+		if (tape_recsz != STAPE_MAX_RECSZ) {
 			tape_recsz = STAPE_MAX_RECSZ;
-			if ( ! contextp->dc_isQICpr ) {
+			if (! contextp->dc_isQICpr) {
 				tape_blksz = tape_recsz;;
 			}
 			changedblkszpr = BOOL_TRUE;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_DRIVE,
-			      _("cannot determine tape block size\n") );
+			mlog(MLOG_NORMAL | MLOG_DRIVE,
+			      _("cannot determine tape block size\n"));
 			return DRIVE_ERROR_MEDIA;
 		}
 		continue;
 
 	} /* loop reading 1st record 'til get correct blksz */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "read first record of first media file encountered on media: "
 	      "recsz == %u\n",
-	      tape_recsz );
+	      tape_recsz);
 
 	/* calculate maximum bytes lost without error at end of tape
 	 */
-	calc_max_lost( drivep );
+	calc_max_lost(drivep);
 
 	contextp->dc_iocnt = 1;
 	return 0;
@@ -4646,9 +4646,9 @@
 /* if BOOL_FALSE returned, errno is valid
  */
 static bool_t
-Open( drive_t *drivep )
+Open(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int oflags;
 
 #ifdef DUMP
@@ -4658,15 +4658,15 @@
 	oflags = O_RDONLY;
 #endif /* RESTORE */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: opening drive\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: opening drive\n");
 
-	assert( contextp->dc_fd == -1 );
+	assert(contextp->dc_fd == -1);
 
 	errno = 0;
-	contextp->dc_fd = open( drivep->d_pathname, oflags );
+	contextp->dc_fd = open(drivep->d_pathname, oflags);
 
-	if ( contextp->dc_fd <= 0 ) {
+	if (contextp->dc_fd <= 0) {
 		return BOOL_FALSE;
 	}
 
@@ -4675,87 +4675,87 @@
 }
 
 static void
-Close( drive_t *drivep )
+Close(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "tape op: closing drive\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "tape op: closing drive\n");
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 
-	( void )close( contextp->dc_fd );
+	(void)close(contextp->dc_fd);
 
 	contextp->dc_fd = -1;
 }
 
 static int
-Read( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
+Read(drive_t *drivep, char *bufp, size_t cnt, int *errnop)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nread;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: reading %u bytes\n",
-	      cnt );
+	      cnt);
 
-	assert( contextp->dc_fd >= 0 );
-	assert( bufp );
+	assert(contextp->dc_fd >= 0);
+	assert(bufp);
 	*errnop = 0;
 	errno = 0;
-	nread = read( contextp->dc_fd, ( void * )bufp, cnt );
-	if ( nread < 0 ) {
+	nread = read(contextp->dc_fd, (void *)bufp, cnt);
+	if (nread < 0) {
 		*errnop = errno;
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes failed: errno == %d (%s)\n",
 		      cnt,
 		      errno,
-		      strerror( errno ));
-	} else if ( nread != ( int )cnt ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		      strerror(errno));
+	} else if (nread != (int)cnt) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes short: nread == %d\n",
 		      cnt,
-		      nread );
+		      nread);
 	} else {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes successful\n",
-		      cnt );
+		      cnt);
 	}
 
 	return nread;
 }
 
 static int
-Write( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
+Write(drive_t *drivep, char *bufp, size_t cnt, int *errnop)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nwritten;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: writing %u bytes\n",
-	      cnt );
+	      cnt);
 
-	assert( contextp->dc_fd >= 0 );
-	assert( bufp );
+	assert(contextp->dc_fd >= 0);
+	assert(bufp);
 	*errnop = 0;
 	errno = 0;
-	nwritten = write( contextp->dc_fd, ( void * )bufp, cnt );
-	if ( nwritten < 0 ) {
+	nwritten = write(contextp->dc_fd, (void *)bufp, cnt);
+	if (nwritten < 0) {
 		*errnop = errno;
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes failed: errno == %d (%s)\n",
 		      cnt,
 		      errno,
-		      strerror( errno ));
-	} else if ( nwritten != ( int )cnt ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		      strerror(errno));
+	} else if (nwritten != (int)cnt) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes short: nwritten == %d\n",
 		      cnt,
-		      nwritten );
+		      nwritten);
 	} else {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes successful\n",
-		      cnt );
+		      cnt);
 	}
 
 	return nwritten;
@@ -4767,27 +4767,27 @@
  */
 /* ARGSUSED */
 static int
-quick_backup( drive_t *drivep, drive_context_t *contextp, ix_t skipcnt )
+quick_backup(drive_t *drivep, drive_context_t *contextp, ix_t skipcnt)
 {
-	if ( drivep->d_capabilities & DRIVE_CAP_BSF ) {
+	if (drivep->d_capabilities & DRIVE_CAP_BSF) {
 		do {
 			mtstat_t mtstat;
-			mtstat = bsf_and_verify( drivep );
-			if ( IS_BOT( mtstat )) {
+			mtstat = bsf_and_verify(drivep);
+			if (IS_BOT(mtstat)) {
 				return 0;
 			}
-			if ( TS_ISDRIVER ) {
-				if ( ! IS_FMK( mtstat )) {
-					mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (TS_ISDRIVER) {
+				if (! IS_FMK(mtstat)) {
+					mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					      _("unable to backspace tape: "
-					      "assuming media error\n") );
+					      "assuming media error\n"));
 					return DRIVE_ERROR_MEDIA;
 				}
 			}
-		} while ( skipcnt-- );
-		( void )fsf_and_verify( drivep );
+		} while (skipcnt--);
+		(void)fsf_and_verify(drivep);
 	} else {
-		( void )rewind_and_verify( drivep );
+		(void)rewind_and_verify(drivep);
 	}
 
 	return 0;
@@ -4797,82 +4797,82 @@
  * indication.
  */
 static int
-record_hdr_validate( drive_t *drivep, char *bufp, bool_t chkoffpr )
+record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	rec_hdr_t rechdr;
 	rec_hdr_t *rechdrp = &rechdr;
-	rec_hdr_t *tmprh = ( rec_hdr_t * )bufp;
+	rec_hdr_t *tmprh = (rec_hdr_t *)bufp;
 
-	if ( ! tape_rec_checksum_check( contextp, bufp )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (! tape_rec_checksum_check(contextp, bufp)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: bad record checksum\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 
 	}
 
 	xlate_rec_hdr(tmprh, rechdrp, 1);
 
-	if ( rechdrp->magic != STAPE_MAGIC )  {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rechdrp->magic != STAPE_MAGIC)  {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: bad magic number\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( uuid_is_null( rechdrp->dump_uuid )) {
+	if (uuid_is_null(rechdrp->dump_uuid)) {
 
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: null dump id\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( uuid_compare( grhdrp->gh_dumpid,
-			   rechdrp->dump_uuid ) != 0) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (uuid_compare(grhdrp->gh_dumpid,
+			   rechdrp->dump_uuid) != 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: dump id mismatch\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( ( size_t )rechdrp->recsize != tape_recsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE, _(
+	if ((size_t)rechdrp->recsize != tape_recsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE, _(
 		      "record %lld corrupt: incorrect record size in header\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( rechdrp->file_offset % ( off64_t )tape_recsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rechdrp->file_offset % (off64_t)tape_recsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: record offset in header "
 		      "not a multiple of record size\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( chkoffpr
+	if (chkoffpr
 	     &&
 	     rechdrp->file_offset
 	     !=
-	     ( contextp->dc_iocnt - 1 ) * ( off64_t )tape_recsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	     (contextp->dc_iocnt - 1) * (off64_t)tape_recsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: "
 		      "incorrect record offset in header (0x%llx)\n"),
 		      contextp->dc_iocnt - 1,
-		      rechdrp->file_offset );
+		      rechdrp->file_offset);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( rechdrp->rec_used > tape_recsz
+	if (rechdrp->rec_used > tape_recsz
 	     ||
-	     rechdrp->rec_used < STAPE_HDR_SZ ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	     rechdrp->rec_used < STAPE_HDR_SZ) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("record %lld corrupt: "
 		      "incorrect record padding offset in header\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
@@ -4885,116 +4885,116 @@
  * return 0 on success.
  */
 static int
-read_record(  drive_t *drivep, char *bufp )
+read_record(drive_t *drivep, char *bufp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nread;
 	int saved_errno;
 	mtstat_t mtstat;
 	int rval;
 	bool_t ok;
 
-	nread = Read( drivep, bufp, tape_recsz, &saved_errno );
-	if ( nread == ( int )tape_recsz ) {
+	nread = Read(drivep, bufp, tape_recsz, &saved_errno);
+	if (nread == (int)tape_recsz) {
 		contextp->dc_iocnt++;
-		rval = record_hdr_validate( drivep, bufp, BOOL_TRUE );
+		rval = record_hdr_validate(drivep, bufp, BOOL_TRUE);
 		return rval;
 	}
 
 	/* get drive status
 	 */
-	ok = mt_get_status( drivep, &mtstat );
-	if ( ! ok ) {
-		status_failed_message( drivep );
+	ok = mt_get_status(drivep, &mtstat);
+	if (! ok) {
+		status_failed_message(drivep);
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* encountered a file mark
 	 */
-	if ( IS_FMK( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (IS_FMK(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "encountered EOF attempting to read record %lld\n",
-		      contextp->dc_iocnt );
+		      contextp->dc_iocnt);
 		return DRIVE_ERROR_EOF;
 	}
 
 	/* encountered a end of recorded data
 	 */
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "encountered EOD attempting to read record %lld\n",
-		      contextp->dc_iocnt );
+		      contextp->dc_iocnt);
 		return DRIVE_ERROR_EOD;
 	}
 
 	/* encountered a end of media
 	 */
-	if ( IS_EOT( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (IS_EOT(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "encountered EOM attempting to read record %lld\n",
-		      contextp->dc_iocnt );
+		      contextp->dc_iocnt);
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* encountered a end of media (early warning indicated)
 	 */
-	if ( IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "encountered EW attempting to read record %lld\n",
-		      contextp->dc_iocnt );
+		      contextp->dc_iocnt);
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* short read
 	 */
-	if ( nread >= 0 ) {
-		assert( nread <= ( int )tape_recsz );
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (nread >= 0) {
+		assert(nread <= (int)tape_recsz);
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "short read record %lld (nread == %d)\n",
 		      contextp->dc_iocnt,
-		      nread );
+		      nread);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
 	/* some other error
 	 */
-	mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
+	mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
 	      "unexpected error attempting to read record %lld: "
 	      "read returns %d, errno %d (%s)\n"),
 	      contextp->dc_iocnt,
 	      nread,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return DRIVE_ERROR_CORRUPTION;
 }
 
 static int
-ring_read( void *clientctxp, char *bufp )
+ring_read(void *clientctxp, char *bufp)
 {
-	return read_record( ( drive_t * )clientctxp, bufp );
+	return read_record((drive_t *)clientctxp, bufp);
 }
 
 /* gets another record IF dc_recp is NULL
  */
 static int
-getrec( drive_t *drivep )
+getrec(drive_t *drivep)
 {
 	drive_context_t *contextp;
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	while ( ! contextp->dc_recp ) {
+	while (! contextp->dc_recp) {
 		rec_hdr_t *rechdrp;
-		if ( contextp->dc_singlethreadedpr ) {
+		if (contextp->dc_singlethreadedpr) {
 			int rval;
 			contextp->dc_recp = contextp->dc_bufp;
-			rval = read_record( drivep, contextp->dc_recp );
-			if ( rval ) {
+			rval = read_record(drivep, contextp->dc_recp);
+			if (rval) {
 				contextp->dc_errorpr = BOOL_TRUE;
 				return rval;
 			}
 		} else {
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			switch( contextp->dc_msgp->rm_stat ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 				contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 				break;
@@ -5002,20 +5002,20 @@
 			case RING_STAT_NOPACK:
 			case RING_STAT_IGNORE:
 				contextp->dc_msgp->rm_op = RING_OP_READ;
-				Ring_put( contextp->dc_ringp,
-					  contextp->dc_msgp );
+				Ring_put(contextp->dc_ringp,
+					  contextp->dc_msgp);
 				contextp->dc_msgp = 0;
 				continue;
 			case RING_STAT_ERROR:
 				contextp->dc_errorpr = BOOL_TRUE;
 				return contextp->dc_msgp->rm_rval;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_errorpr = BOOL_TRUE;
 				return DRIVE_ERROR_CORE;
 			}
 		}
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
 		contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 		contextp->dc_dataendp = contextp->dc_recp
 				        +
@@ -5023,7 +5023,7 @@
 		contextp->dc_nextp = contextp->dc_recp
 				     +
 				     STAPE_HDR_SZ;
-		assert( contextp->dc_nextp <= contextp->dc_dataendp );
+		assert(contextp->dc_nextp <= contextp->dc_dataendp);
 	}
 
 	return 0;
@@ -5034,73 +5034,73 @@
  */
 /*ARGSUSED*/
 static int
-write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
+write_record(drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nwritten;
 	int saved_errno;
 	int rval;
 
-        if ( xlatepr ) {
+        if (xlatepr) {
 		rec_hdr_t rechdr;
-		memcpy( &rechdr, bufp, sizeof(rechdr) );
-		xlate_rec_hdr( &rechdr, ( rec_hdr_t * )bufp, 1 );
+		memcpy(&rechdr, bufp, sizeof(rechdr));
+		xlate_rec_hdr(&rechdr, (rec_hdr_t *)bufp, 1);
 	}
 
-	if ( chksumpr ) {
-		tape_rec_checksum_set( contextp, bufp );
+	if (chksumpr) {
+		tape_rec_checksum_set(contextp, bufp);
 	}
 
-	nwritten = Write( drivep, bufp, tape_recsz, &saved_errno );
+	nwritten = Write(drivep, bufp, tape_recsz, &saved_errno);
 
-	if ( nwritten == ( int )tape_recsz ) {
+	if (nwritten == (int)tape_recsz) {
 		contextp->dc_iocnt++;
 		return 0;
 	}
 
-	rval = determine_write_error( drivep, nwritten, saved_errno );
-	assert( rval );
+	rval = determine_write_error(drivep, nwritten, saved_errno);
+	assert(rval);
 
 	return rval;
 }
 
 static int
-ring_write( void *clientctxp, char *bufp )
+ring_write(void *clientctxp, char *bufp)
 {
-	return write_record( ( drive_t * )clientctxp, bufp, BOOL_TRUE, BOOL_TRUE );
+	return write_record((drive_t *)clientctxp, bufp, BOOL_TRUE, BOOL_TRUE);
 }
 
 static ring_msg_t *
-Ring_get( ring_t *ringp )
+Ring_get(ring_t *ringp)
 {
 	ring_msg_t *msgp;
 
-	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-	      "ring op: get\n" );
+	mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+	      "ring op: get\n");
 
-	msgp = ring_get( ringp );
+	msgp = ring_get(ringp);
 	return msgp;
 }
 
 static void
-Ring_put(  ring_t *ringp, ring_msg_t *msgp )
+Ring_put(ring_t *ringp, ring_msg_t *msgp)
 {
-	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
+	mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: put %d\n",
-	      msgp->rm_op );
+	      msgp->rm_op);
 
-	ring_put( ringp, msgp );
+	ring_put(ringp, msgp);
 }
 
 static void
-Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
+Ring_reset(ring_t *ringp, ring_msg_t *msgp)
 {
-	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-	      "ring op: reset\n" );
+	mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+	      "ring op: reset\n");
 
-	assert( ringp );
+	assert(ringp);
 
-	ring_reset( ringp, msgp );
+	ring_reset(ringp, msgp);
 }
 
 /* a simple heuristic to calculate the maximum uncertainty
@@ -5108,11 +5108,11 @@
  * end of media.
  */
 static void
-calc_max_lost( drive_t *drivep )
+calc_max_lost(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	if ( contextp->dc_isQICpr ) {
+	if (contextp->dc_isQICpr) {
 		contextp->dc_lostrecmax = 1;
 	} else {
 		contextp->dc_lostrecmax = 2;
@@ -5121,33 +5121,33 @@
 }
 
 static void
-display_ring_metrics( drive_t *drivep, int mlog_flags )
+display_ring_metrics(drive_t *drivep, int mlog_flags)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
-	char bufszbuf[ 16 ];
+	char bufszbuf[16];
 	char *bufszsfxp;
 
-	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
-		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
-		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
-		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
+	if (tape_recsz == STAPE_MIN_MAX_BLKSZ) {
+		assert(! (STAPE_MIN_MAX_BLKSZ % 0x400));
+		sprintf(bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400);
+		assert(strlen(bufszbuf) < sizeof(bufszbuf));
 		bufszsfxp = "KB";
-	} else if ( tape_recsz == STAPE_MAX_RECSZ ) {
-		assert( ! ( STAPE_MAX_RECSZ % 0x100000 ));
-		sprintf( bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000 );
-		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
+	} else if (tape_recsz == STAPE_MAX_RECSZ) {
+		assert(! (STAPE_MAX_RECSZ % 0x100000));
+		sprintf(bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000);
+		assert(strlen(bufszbuf) < sizeof(bufszbuf));
 		bufszsfxp = "MB";
-	} else if ( tape_recsz == STAPE_MAX_LINUX_RECSZ ) {
-		assert( ! ( STAPE_MAX_LINUX_RECSZ % 0x100000 ));
-		sprintf( bufszbuf, "%u", STAPE_MAX_LINUX_RECSZ / 0x100000 );
-		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
+	} else if (tape_recsz == STAPE_MAX_LINUX_RECSZ) {
+		assert(! (STAPE_MAX_LINUX_RECSZ % 0x100000));
+		sprintf(bufszbuf, "%u", STAPE_MAX_LINUX_RECSZ / 0x100000);
+		assert(strlen(bufszbuf) < sizeof(bufszbuf));
 		bufszsfxp = "MB";
 	} else {
 		bufszsfxp = "";
 	}
 
-	mlog( mlog_flags, _(
+	mlog(mlog_flags, _(
 	      "I/O metrics: "
 	      "%u by %s%s %sring; "
 	      "%lld/%lld (%.0lf%%) records streamed; "
@@ -5158,100 +5158,100 @@
 	      contextp->dc_ringpinnedpr ? _("pinned ") : "",
 	      ringp->r_slave_msgcnt - ringp->r_slave_blkcnt,
 	      ringp->r_slave_msgcnt,
-	      percent64( ringp->r_slave_msgcnt - ringp->r_slave_blkcnt,
-			 ringp->r_slave_msgcnt ),
-	      ( double )( ringp->r_all_io_cnt )
+	      percent64(ringp->r_slave_msgcnt - ringp->r_slave_blkcnt,
+			 ringp->r_slave_msgcnt),
+	      (double)(ringp->r_all_io_cnt)
 	      *
-	      ( double )tape_recsz
+	      (double)tape_recsz
 	      /
-	      ( double )( time( 0 ) - ringp->r_first_io_time ));
+	      (double)(time(0) - ringp->r_first_io_time));
 }
 
 static mtstat_t
-rewind_and_verify( drive_t *drivep )
+rewind_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	ix_t try;
 	int rval;
 
-	rval = mt_op( contextp->dc_fd, MTREW, 0 );
-	for ( try = 1 ; ; try++ ) {
+	rval = mt_op(contextp->dc_fd, MTREW, 0);
+	for (try = 1 ; ; try++) {
 		mtstat_t mtstat;
 		bool_t ok;
 
-		if ( rval ) {
-			sleep( 1 );
-			rval = mt_op( contextp->dc_fd, MTREW, 0 );
+		if (rval) {
+			sleep(1);
+			rval = mt_op(contextp->dc_fd, MTREW, 0);
 		}
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
 			mtstat = 0;
-			status_failed_message( drivep );
-			if ( try > 1 ) {
+			status_failed_message(drivep);
+			if (try > 1) {
 				return 0;
 			}
 		}
-		if ( IS_BOT( mtstat )) {
+		if (IS_BOT(mtstat)) {
 			return mtstat;
 		}
-		if ( try >= MTOP_TRIES_MAX ) {
+		if (try >= MTOP_TRIES_MAX) {
 			return mtstat;
 		}
-		if ( rval ) {
+		if (rval) {
 			return mtstat;
 		}
-		sleep( 1 );
+		sleep(1);
 	}
 	/* NOTREACHED */
 }
 
 static mtstat_t
-erase_and_verify( drive_t *drivep )
+erase_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	mtstat_t mtstat;
 	bool_t ok;
 
-	( void )mt_op( contextp->dc_fd, MTERASE, 0 );
-	ok = mt_get_status( drivep, &mtstat );
-	if ( ! ok ) {
+	(void)mt_op(contextp->dc_fd, MTERASE, 0);
+	ok = mt_get_status(drivep, &mtstat);
+	if (! ok) {
 		mtstat = 0;
-		status_failed_message( drivep );
+		status_failed_message(drivep);
 	}
 	return mtstat;
 }
 
 static mtstat_t
-bsf_and_verify( drive_t *drivep )
+bsf_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	ix_t try;
 	bool_t ok;
 
 	/* Can't do with LINUX ST driver, as GMT_EOF never set for left of fmk */
-	if ( TS_ISDRIVER ) {
-		( void )mt_op( contextp->dc_fd, MTBSF, 1 );
-		for ( try = 1 ; ; try++ ) {
+	if (TS_ISDRIVER) {
+		(void)mt_op(contextp->dc_fd, MTBSF, 1);
+		for (try = 1 ; ; try++) {
 			mtstat_t mtstat;
 
-			ok = mt_get_status( drivep, &mtstat );
-			if ( ! ok ) {
+			ok = mt_get_status(drivep, &mtstat);
+			if (! ok) {
 				mtstat = 0;
-				status_failed_message( drivep );
-				if ( try > 1 ) {
+				status_failed_message(drivep);
+				if (try > 1) {
 					return 0;
 				}
 			}
-			if ( IS_FMK( mtstat )) {
+			if (IS_FMK(mtstat)) {
 				return mtstat;
 			}
-			if ( IS_BOT( mtstat )) {
+			if (IS_BOT(mtstat)) {
 				return mtstat;
 			}
-			if ( try >= MTOP_TRIES_MAX ) {
+			if (try >= MTOP_TRIES_MAX) {
 				return mtstat;
 			}
-			sleep( 1 );
+			sleep(1);
 		}
 	} else {
 		long fileno;
@@ -5264,29 +5264,29 @@
 		 * Do a rewind instead because the status won't be
 		 * set correctly otherwise. [TS:Oct/2000]
 		 */
-		ok = mt_get_fileno( drivep, &fileno );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+		ok = mt_get_fileno(drivep, &fileno);
+		if (! ok) {
+			status_failed_message(drivep);
 			return 0;
 		}
 		if (fileno == 0) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "In first file, do a rewind to achieve bsf\n");
-			return rewind_and_verify( drivep );
+			return rewind_and_verify(drivep);
 		}
 
-		( void )mt_op( contextp->dc_fd, MTBSF, 1 );
+		(void)mt_op(contextp->dc_fd, MTBSF, 1);
 
 		try = 1;
-status:		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
+status:		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
 			mtstat = 0;
-			status_failed_message( drivep );
-			if ( try > 1 ) {
+			status_failed_message(drivep);
+			if (try > 1) {
 				return 0;
 			}
 			try++;
-			sleep( 1 );
+			sleep(1);
 			goto status;
 		}
 		return mtstat;
@@ -5295,56 +5295,56 @@
 }
 
 static mtstat_t
-fsf_and_verify( drive_t *drivep )
+fsf_and_verify(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	ix_t try;
 
-	( void )mt_op( contextp->dc_fd, MTFSF, 1 );
-	for ( try = 1 ; ; try++ ) {
+	(void)mt_op(contextp->dc_fd, MTFSF, 1);
+	for (try = 1 ; ; try++) {
 		mtstat_t mtstat;
 		bool_t ok;
 
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
 			mtstat = 0;
-			status_failed_message( drivep );
-			if ( try > 1 ) {
+			status_failed_message(drivep);
+			if (try > 1) {
 				return 0;
 			}
 		}
-		if ( IS_FMK( mtstat )) {
+		if (IS_FMK(mtstat)) {
 			return mtstat;
 		}
-		if ( IS_EOD( mtstat )) {
+		if (IS_EOD(mtstat)) {
 			return mtstat;
 		}
-		if ( IS_EOT( mtstat )) {
+		if (IS_EOT(mtstat)) {
 			return mtstat;
 		}
-		if ( try >= MTOP_TRIES_MAX ) {
+		if (try >= MTOP_TRIES_MAX) {
 			return mtstat;
 		}
-		sleep( 1 );
+		sleep(1);
 	}
 	/* NOTREACHED */
 }
 
 static void
-calc_best_blk_and_rec_sz( drive_t *drivep )
+calc_best_blk_and_rec_sz(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	if ( ! contextp->dc_isrmtpr ) {
-		if ( cmdlineblksize > 0 ) {
+	if (! contextp->dc_isrmtpr) {
+		if (cmdlineblksize > 0) {
 		    tape_blksz = cmdlineblksize;
                 } else {
 		    tape_blksz = contextp->dc_maxblksz;
                 }
-		if ( tape_blksz > STAPE_MAX_RECSZ ) {
+		if (tape_blksz > STAPE_MAX_RECSZ) {
 			tape_blksz = STAPE_MAX_RECSZ;
 		}
-		if ( contextp->dc_isQICpr ) {
+		if (contextp->dc_isQICpr) {
 			tape_recsz = STAPE_MAX_RECSZ;
 		} else {
 			tape_recsz = tape_blksz;
@@ -5355,20 +5355,20 @@
 }
 
 static bool_t
-set_best_blk_and_rec_sz( drive_t *drivep )
+set_best_blk_and_rec_sz(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
         calc_best_blk_and_rec_sz(drivep);
 
-	if ( ! contextp->dc_isvarpr
+	if (! contextp->dc_isvarpr
 	     &&
 	     ! contextp->dc_isQICpr
 	     &&
-	     contextp->dc_cansetblkszpr ) {
+	     contextp->dc_cansetblkszpr) {
 		bool_t ok;
-		ok = set_fixed_blksz( drivep, tape_blksz );
-		if ( ! ok ) {
+		ok = set_fixed_blksz(drivep, tape_blksz);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
@@ -5377,13 +5377,13 @@
 }
 
 static bool_t
-isefsdump( drive_t *drivep )
+isefsdump(drive_t *drivep)
 {
-	int32_t *efshdrp = ( int32_t * )drivep->d_greadhdrp;
-	int32_t efsmagic = efshdrp[ 6 ];
-	if ( efsmagic == 60011
+	int32_t *efshdrp = (int32_t *)drivep->d_greadhdrp;
+	int32_t efsmagic = efshdrp[6];
+	if (efsmagic == 60011
 	     ||
-	     efsmagic == 60012 ) {
+	     efsmagic == 60012) {
 		return BOOL_TRUE;
 	} else {
 		return BOOL_FALSE;
@@ -5397,7 +5397,7 @@
  * the get_driver_block_major() routine in the libdisk library.)
  */
 static int
-get_driver_character_major( const char *driver )
+get_driver_character_major(const char *driver)
 {
 	FILE	*f;
 	char	buf[64], puf[64];
@@ -5420,7 +5420,7 @@
 }
 
 static void
-map_ts_status( struct mtget *mtstat, struct mtget_sgi mtstat_sgi)
+map_ts_status(struct mtget *mtstat, struct mtget_sgi mtstat_sgi)
 {
 	/*
 	 * This routine has been added as a workaround for a TS/APD
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 54a3058..2d802d3 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -55,12 +55,12 @@
 #define read    rmtread
 #define write   rmtwrite
 
-extern int rmtclose( int );
+extern int rmtclose(int);
 extern int rmtcreat (char *path, int mode);
-extern int rmtioctl( int, int, ... );
-extern int rmtopen( char *, int, ... );
-extern int rmtread( int, void*, uint);
-extern int rmtwrite( int, const void *, uint);
+extern int rmtioctl(int, int, ...);
+extern int rmtopen(char *, int, ...);
+extern int rmtread(int, void*, uint);
+extern int rmtwrite(int, const void *, uint);
 
 
 /* drive_simple.c - drive strategy for standard in or a file
@@ -73,14 +73,14 @@
  * buf must be page-aligned and at least 1 page in size
  */
 #define PGPERBUF	64	/* private read buffer */
-#define BUFSZ		( PGPERBUF * PGSZ )
+#define BUFSZ		(PGPERBUF * PGSZ)
 
 /* operational mode
  */
 typedef enum { OM_NONE, OM_READ, OM_WRITE } om_t;
 
 struct drive_context {
-	char dc_buf[ BUFSZ ];	/* input/output buffer */
+	char dc_buf[BUFSZ];	/* input/output buffer */
 	om_t dc_mode;		/* current mode of operation */
 	ix_t dc_fmarkcnt;	/* how many file marks to the left */
 	char *dc_ownedp;	/* first byte owned by caller */
@@ -108,31 +108,31 @@
 
 /* strategy functions
  */
-static int ds_match( int, char *[], drive_t * );
-static int ds_instantiate( int, char *[], drive_t * );
+static int ds_match(int, char *[], drive_t *);
+static int ds_instantiate(int, char *[], drive_t *);
 
 /* declare manager operators
  */
-static bool_t do_init( drive_t * );
-static bool_t do_sync( drive_t * );
-static int do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, int * );
-static void do_return_read_buf( drive_t *, char *, size_t );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static int do_seek_mark( drive_t *, drive_mark_t * );
-static int do_next_mark( drive_t * );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static void do_end_read( drive_t * );
-static int do_begin_write( drive_t * );
-static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
-static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static int do_write( drive_t *, char *, size_t );
-static size_t do_get_align_cnt( drive_t * );
-static int do_end_write( drive_t *, off64_t * );
-static int do_rewind( drive_t * );
-static int do_erase( drive_t * );
-static int do_get_device_class( drive_t * );
-static void do_quit( drive_t * );
+static bool_t do_init(drive_t *);
+static bool_t do_sync(drive_t *);
+static int do_begin_read(drive_t *);
+static char *do_read(drive_t *, size_t , size_t *, int *);
+static void do_return_read_buf(drive_t *, char *, size_t);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static int do_seek_mark(drive_t *, drive_mark_t *);
+static int do_next_mark(drive_t *);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static void do_end_read(drive_t *);
+static int do_begin_write(drive_t *);
+static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
+static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static int do_write(drive_t *, char *, size_t);
+static size_t do_get_align_cnt(drive_t *);
+static int do_end_write(drive_t *, off64_t *);
+static int do_rewind(drive_t *);
+static int do_erase(drive_t *);
+static int do_get_device_class(drive_t *);
+static void do_quit(drive_t *);
 
 
 /* definition of locally defined global variables ****************************/
@@ -188,39 +188,39 @@
  */
 /* ARGSUSED */
 static int
-ds_match( int argc, char *argv[], drive_t *drivep )
+ds_match(int argc, char *argv[], drive_t *drivep)
 {
 	bool_t isrmtpr;
 	struct stat64 statbuf;
 
 	/* sanity checks
 	 */
-	assert( ! ( sizeofmember( drive_context_t, dc_buf ) % PGSZ ));
+	assert(! (sizeofmember(drive_context_t, dc_buf) % PGSZ));
 
 	/* determine if this is an rmt file. if so, give a weak match:
 	 * might be an ordinary file accessed via the rmt protocol.
 	 */
-	if ( strchr( drivep->d_pathname, ':') ) {
+	if (strchr(drivep->d_pathname, ':')) {
 		isrmtpr = BOOL_TRUE;
 	} else {
 		isrmtpr = BOOL_FALSE;
 	}
-	if ( isrmtpr ) {
+	if (isrmtpr) {
 		return 1;
 	}
 
 	/* willing to pick up anything not picked up by other strategies,
 	 * as long as it exists and is not a directory
 	 */
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 		return 1;
 	}
 
-	if ( stat64( drivep->d_pathname, &statbuf )) {
+	if (stat64(drivep->d_pathname, &statbuf)) {
 		return -1;
 	}
 
-	if ( S_ISDIR( statbuf.st_mode )) {
+	if (S_ISDIR(statbuf.st_mode)) {
 		return -1;
 	}
 
@@ -231,7 +231,7 @@
  */
 /*ARGSUSED*/
 static bool_t
-ds_instantiate( int argc, char *argv[], drive_t *drivep )
+ds_instantiate(int argc, char *argv[], drive_t *drivep)
 {
 	drive_context_t *contextp;
 
@@ -242,15 +242,15 @@
 	/* initialize the drive context - allocate a page-aligned
 	 * structure, so the buffer is page-aligned.
 	 */
-	contextp = ( drive_context_t * )memalign( PGSZ,
-						  sizeof( drive_context_t ));
-	assert( contextp );
-	assert( ( void * )contextp->dc_buf == ( void * )contextp );
-	memset( ( void * )contextp, 0, sizeof( *contextp ));
+	contextp = (drive_context_t *)memalign(PGSZ,
+						  sizeof(drive_context_t));
+	assert(contextp);
+	assert((void *)contextp->dc_buf == (void *)contextp);
+	memset((void *)contextp, 0, sizeof(*contextp));
 
 	/* scan drive device pathname to see if remote tape
 	 */
-	if ( strchr( drivep->d_pathname, ':') ) {
+	if (strchr(drivep->d_pathname, ':')) {
 		contextp->dc_isrmtpr = BOOL_TRUE;
 	} else {
 		contextp->dc_isrmtpr = BOOL_FALSE;
@@ -260,7 +260,7 @@
 	 */
 	drivep->d_capabilities = 0;
 	drivep->d_capabilities |= DRIVE_CAP_AUTOREWIND;
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 #ifdef DUMP
 		contextp->dc_fd = 1;
 #endif /* DUMP */
@@ -268,7 +268,7 @@
 		drivep->d_capabilities |= DRIVE_CAP_READ;
 		contextp->dc_fd = 0;
 #endif /* RESTORE */
-	} else if ( contextp->dc_isrmtpr ) {
+	} else if (contextp->dc_isrmtpr) {
 		int oflags;
 #ifdef DUMP
 		oflags = O_WRONLY | O_CREAT | O_TRUNC;
@@ -278,28 +278,28 @@
 		drivep->d_capabilities |= DRIVE_CAP_READ;
 #endif /* RESTORE */
 		contextp->dc_rampr = BOOL_FALSE;
-		contextp->dc_fd = open( drivep->d_pathname,
+		contextp->dc_fd = open(drivep->d_pathname,
 					oflags,
-				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
-		if ( contextp->dc_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		if (contextp->dc_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("unable to open %s: %s\n"),
 			      drivep->d_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 	} else {
 		int oflags = 0;
 		struct stat statbuf;
 		int rval;
-		rval = stat( drivep->d_pathname, &statbuf );
+		rval = stat(drivep->d_pathname, &statbuf);
 #ifdef DUMP
-		if ( rval ) {
-			if ( errno != ENOENT ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		if (rval) {
+			if (errno != ENOENT) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("stat of %s failed: %s\n"),
 				      drivep->d_pathname,
-				      strerror( errno ));
+				      strerror(errno));
 				return BOOL_FALSE;
 			}
 			drivep->d_capabilities |= DRIVE_CAP_REWIND;
@@ -309,7 +309,7 @@
 			oflags = O_RDWR | O_CREAT;
 
 		} else {
-			switch( statbuf.st_mode & S_IFMT ) {
+			switch(statbuf.st_mode & S_IFMT) {
 			case S_IFREG:
 				drivep->d_capabilities |= DRIVE_CAP_ERASE;
 				drivep->d_capabilities |= DRIVE_CAP_REWIND;
@@ -326,26 +326,26 @@
 				oflags = O_WRONLY;
 				break;
 			default:
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("cannot dump to %s "
 				      "file type %x\n"),
 				      drivep->d_pathname,
-				      statbuf.st_mode & S_IFMT );
+				      statbuf.st_mode & S_IFMT);
 				return BOOL_FALSE;
 			}
 		}
 #endif /* DUMP */
 #ifdef RESTORE
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("stat of %s failed: %s\n"),
 			      drivep->d_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 
 		}
 		oflags = O_RDONLY;
-		switch( statbuf.st_mode & S_IFMT ) {
+		switch(statbuf.st_mode & S_IFMT) {
 		case S_IFREG:
 		case S_IFCHR:
 		case S_IFBLK:
@@ -356,21 +356,21 @@
 			drivep->d_capabilities |= DRIVE_CAP_READ;
 			break;
 		default:
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("cannot restore from %s file type %x\n"),
 			      drivep->d_pathname,
-			      statbuf.st_mode & S_IFMT );
+			      statbuf.st_mode & S_IFMT);
 			return BOOL_FALSE;
 		}
 #endif /* RESTORE */
-		contextp->dc_fd = open( drivep->d_pathname,
+		contextp->dc_fd = open(drivep->d_pathname,
 					oflags,
-				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
-		if ( contextp->dc_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		if (contextp->dc_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("unable to open %s: %s\n"),
 			      drivep->d_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 	}
@@ -381,7 +381,7 @@
 	contextp->dc_mode = OM_NONE;
 	contextp->dc_fmarkcnt = 0;
 
-	drivep->d_contextp = ( void * )contextp;
+	drivep->d_contextp = (void *)contextp;
 
 	drivep->d_cap_est = -1;
 	drivep->d_rate_est = -1;
@@ -394,11 +394,11 @@
  */
 /* ARGSUSED */
 static bool_t
-do_init( drive_t *drivep )
+do_init(drive_t *drivep)
 {
 #ifdef DUMP
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 #endif /* DUMP */
 
 #ifdef DUMP
@@ -415,7 +415,7 @@
  */
 /* ARGSUSED */
 static bool_t
-do_sync( drive_t *drivep )
+do_sync(drive_t *drivep)
 {
 	return BOOL_TRUE;
 }
@@ -424,14 +424,14 @@
  * read the media hdr
  */
 static int
-do_begin_read( drive_t *drivep )
+do_begin_read(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t *drhdrp = drivep->d_readhdrp;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nread;
 	int rval;
 	global_hdr_t		*tmphdr = (global_hdr_t	*)malloc(GLOBAL_HDR_SZ);
@@ -444,25 +444,25 @@
 	content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 	content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple begin_read( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple begin_read( )\n");
 
 	/* verify protocol being followed
 	 */
-	assert( dcaps & DRIVE_CAP_READ );
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(dcaps & DRIVE_CAP_READ);
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* can only read one media file
 	 */
-	if ( contextp->dc_fmarkcnt > 0 ) {
+	if (contextp->dc_fmarkcnt > 0) {
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* prepare the drive context
 	 */
 	contextp->dc_ownedp = 0;
-	contextp->dc_emptyp = &contextp->dc_buf[ 0 ];
+	contextp->dc_emptyp = &contextp->dc_buf[0];
 	contextp->dc_nextp = contextp->dc_emptyp;
 	contextp->dc_bufstroff = 0;
 
@@ -471,18 +471,18 @@
 	 */
 	contextp->dc_mode = OM_READ;
 
-	nread = read_buf( ( char * )tmphdr,
+	nread = read_buf((char *)tmphdr,
 			  GLOBAL_HDR_SZ,
-			  ( void * )drivep,
-			  ( rfp_t )drivep->d_opsp->do_read,
-			  ( rrbfp_t )drivep->d_opsp->do_return_read_buf,
-			  &rval );
+			  (void *)drivep,
+			  (rfp_t)drivep->d_opsp->do_read,
+			  (rrbfp_t)drivep->d_opsp->do_return_read_buf,
+			  &rval);
 	contextp->dc_mode = OM_NONE;
 
 	/* if EOD and nread is zero, there is no data after the file mark
 	 */
-	if ( rval == DRIVE_ERROR_EOD ) {
-		if ( nread == 0 ) {
+	if (rval == DRIVE_ERROR_EOD) {
+		if (nread == 0) {
 			free(tmphdr);
 			return DRIVE_ERROR_BLANK;
 		} else {
@@ -490,11 +490,11 @@
 			return DRIVE_ERROR_FORMAT;
 		}
 	}
-	if  ( rval ) {
+	if  (rval) {
 		free(tmphdr);
 		return rval;
 	}
-	assert( ( size_t )nread == GLOBAL_HDR_SZ );
+	assert((size_t)nread == GLOBAL_HDR_SZ);
 
 	mlog(MLOG_NITTY, "do_begin_read: global_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -514,17 +514,17 @@
 
 	/* check the checksum
 	 */
-	if ( ! global_hdr_checksum_check( tmphdr )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
-		      _("media file header checksum error\n") );
+	if (! global_hdr_checksum_check(tmphdr)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		      _("media file header checksum error\n"));
 		free(tmphdr);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
 	xlate_global_hdr(tmphdr, grhdrp, 1);
 	xlate_drive_hdr(tmpdh, dh, 1);
-	*(( drive_mark_t * )dh->dh_specific) =
-		INT_GET(*(( drive_mark_t * )tmpdh->dh_specific), ARCH_CONVERT);
+	*((drive_mark_t *)dh->dh_specific) =
+		INT_GET(*((drive_mark_t *)tmpdh->dh_specific), ARCH_CONVERT);
 	xlate_media_hdr(tmpmh, mh, 1);
 	xlate_content_hdr(tmpch, ch, 1);
 	xlate_content_inode_hdr(tmpcih, cih, 1);
@@ -532,8 +532,8 @@
 
 	/* check the magic number
 	 */
-	if ( strncmp( grhdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ)) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		      _("media file header magic number mismatch: %s, %s\n"),
 		      grhdrp->gh_magic,
 		      GLOBAL_HDR_MAGIC);
@@ -542,32 +542,32 @@
 
 	/* check the version
 	 */
-	if ( global_version_check( grhdrp->gh_version ) != BOOL_TRUE ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	if (global_version_check(grhdrp->gh_version) != BOOL_TRUE) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		      _("unrecognized media file header version (%d)\n"),
-		      grhdrp->gh_version );
+		      grhdrp->gh_version);
 		return DRIVE_ERROR_VERSION;
 	}
 
 	/* check the strategy id
 	 */
-	if ( drhdrp->dh_strategyid != drive_strategy_simple.ds_id ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	if (drhdrp->dh_strategyid != drive_strategy_simple.ds_id) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		      _("unrecognized drive strategy ID "
 		      "(media says %d, expected %d)\n"),
-		      drhdrp->dh_strategyid, drive_strategy_simple.ds_id );
+		      drhdrp->dh_strategyid, drive_strategy_simple.ds_id);
 		return DRIVE_ERROR_FORMAT;
 	}
 
 	/* record the offset of the first mark
 	 */
-	contextp->dc_firstmark = *( drive_mark_t * )drhdrp->dh_specific;
+	contextp->dc_firstmark = *(drive_mark_t *)drhdrp->dh_specific;
 
 	/* adjust the drive capabilities based on presence of first mark.
 	 * this is a hack workaround for a bug in xfsdump which causes the
 	 * first mark offset to not always be placed in the hdr.
 	 */
-	if ( contextp->dc_firstmark ) {
+	if (contextp->dc_firstmark) {
 		drivep->d_capabilities |= DRIVE_CAP_NEXTMARK;
 	}
 
@@ -580,24 +580,24 @@
 /* read - supply the caller with some filled buffer
  */
 static char *
-do_read( drive_t *drivep,
+do_read(drive_t *drivep,
          size_t wantedcnt,
          size_t *actualcntp,
-         int *rvalp )
+         int *rvalp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	size_t remainingcnt;
 	size_t actualcnt;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple read( want %u )\n",
-	      wantedcnt );
+	      wantedcnt);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
-	assert( wantedcnt > 0 );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
+	assert(wantedcnt > 0);
 
 	/* pre-initialize reference return
 	 */
@@ -605,12 +605,12 @@
 
 	/* count number of unread bytes in buffer
 	 */
-	assert( contextp->dc_emptyp >= contextp->dc_nextp );
-	remainingcnt = ( size_t )( contextp->dc_emptyp - contextp->dc_nextp );
+	assert(contextp->dc_emptyp >= contextp->dc_nextp);
+	remainingcnt = (size_t)(contextp->dc_emptyp - contextp->dc_nextp);
 
 	/* if no unread bytes in buffer, refill
 	 */
-	if ( remainingcnt == 0 ) {
+	if (remainingcnt == 0) {
 		size_t bufhowfullcnt;
 		int nread;
 
@@ -619,13 +619,13 @@
 		 * beginning of the media file) of the top of the buffer
 		 * after we refill the buffer.
 		 */
-		bufhowfullcnt = ( size_t )
-				( contextp->dc_emptyp - contextp->dc_buf );
+		bufhowfullcnt = (size_t)
+				(contextp->dc_emptyp - contextp->dc_buf);
 
 		/* attempt to fill the buffer. nread may be less if at EOF
 		 */
-		nread = read( contextp->dc_fd, contextp->dc_buf, BUFSZ );
-		if ( nread < 0 ) {
+		nread = read(contextp->dc_fd, contextp->dc_buf, BUFSZ);
+		if (nread < 0) {
 			*rvalp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
@@ -633,31 +633,31 @@
 		/* adjust the recorded offset of the top of the buffer
 		 * relative to the beginning of the media file
 		 */
-		contextp->dc_bufstroff += ( off64_t )bufhowfullcnt;
+		contextp->dc_bufstroff += (off64_t)bufhowfullcnt;
 
 		/* record the ptrs to the first empty byte and the next
 		 * byte to be read
 		 */
-		assert( nread <= BUFSZ );
+		assert(nread <= BUFSZ);
 		contextp->dc_emptyp = contextp->dc_buf + nread;
 		contextp->dc_nextp = contextp->dc_buf;
 
 		/* if no bytes were read, the caller has seen all bytes.
 		 */
-		if ( nread == 0 ) {
+		if (nread == 0) {
 			*rvalp = DRIVE_ERROR_EOD;
 			return 0;
 		}
 
 		/* adjust the remaining count
 		 */
-		remainingcnt = ( size_t )nread;
+		remainingcnt = (size_t)nread;
 	}
 
 	/* the caller specified at most how many bytes he wants. if less
 	 * than that remain unread in buffer, just return that many.
 	 */
-	actualcnt = min( wantedcnt, remainingcnt );
+	actualcnt = min(wantedcnt, remainingcnt);
 
 	/* set the owned ptr to the first byte to be supplied
 	 */
@@ -666,7 +666,7 @@
 	/* advance the next ptr to the next byte to be supplied
 	 */
 	contextp->dc_nextp += actualcnt;
-	assert( contextp->dc_nextp <= contextp->dc_emptyp );
+	assert(contextp->dc_nextp <= contextp->dc_emptyp);
 
 	/* return the actual number of bytes supplied, and a ptr to the first
 	 */
@@ -679,29 +679,29 @@
  */
 /* ARGSUSED */
 static void
-do_return_read_buf( drive_t *drivep, char *retp, size_t retcnt )
+do_return_read_buf(drive_t *drivep, char *retp, size_t retcnt)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	/* REFERENCED */
 	size_t ownedcnt;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple return_read_buf( returning %u )\n",
-	      retcnt );
+	      retcnt);
 
 	/* verify protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(contextp->dc_ownedp);
 
 	/* verify returning right buffer
 	 */
-	assert( retp == contextp->dc_ownedp );
+	assert(retp == contextp->dc_ownedp);
 
 	/* verify all of buffer provided is being returned
 	 */
-	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	assert( retcnt == ownedcnt );
+	ownedcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
+	assert(retcnt == ownedcnt);
 
 	/* indicate nothing now owned by caller
 	 */
@@ -712,37 +712,37 @@
  * next byte to be read
  */
 static void
-do_get_mark( drive_t *drivep, drive_mark_t *markp )
+do_get_mark(drive_t *drivep, drive_mark_t *markp)
 {
-        drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+        drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t nextoff;
 	off64_t strmoff;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple get_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple get_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
 	/* calculate the offset of the next byte to be supplied relative to
 	 * the beginning of the buffer and relative to the beginning of
 	 * ther media file.
 	 */
-	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
+	nextoff = (off64_t)(contextp->dc_nextp - contextp->dc_buf);
 	strmoff = contextp->dc_bufstroff + nextoff;
-	*markp = ( drive_mark_t )strmoff;
+	*markp = (drive_mark_t)strmoff;
 }
 
 /* seek forward to the specified mark. the caller must not have already read
  * past that point.
  */
 static int
-do_seek_mark( drive_t *drivep, drive_mark_t *markp )
+do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	off64_t mark = *( off64_t * )markp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
+	off64_t mark = *(off64_t *)markp;
 	off64_t nextoff;
 	off64_t strmoff;
 	/* REFERENCED */
@@ -751,40 +751,40 @@
 	int nreadneeded;
 	int rval;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple seek_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple seek_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
 	/* calculate the current offset within the media file
 	 * of the next byte to be read
 	 */
-	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
+	nextoff = (off64_t)(contextp->dc_nextp - contextp->dc_buf);
 	strmoff = contextp->dc_bufstroff + nextoff;
 
 	/* if the caller attempts to seek past the current offset,
 	 * this is really bad
 	 */
-	if ( strmoff > mark ) {
+	if (strmoff > mark) {
 		return DRIVE_ERROR_CORE;
 	}
 
 	/* use read_buf util func to eat up difference
 	 */
 	nreadneeded64 = mark - strmoff;
-	while ( nreadneeded64 > 0 ) {
-		if ( nreadneeded64 > INTGENMAX )
+	while (nreadneeded64 > 0) {
+		if (nreadneeded64 > INTGENMAX)
 			nreadneeded = INTGENMAX;
 		else
-			nreadneeded = ( int )nreadneeded64;
-		nread = read_buf( 0, nreadneeded, drivep,
-				  ( rfp_t )drivep->d_opsp->do_read,
-				( rrbfp_t )drivep->d_opsp->do_return_read_buf,
-				  &rval );
-		if  ( rval ) {
+			nreadneeded = (int)nreadneeded64;
+		nread = read_buf(0, nreadneeded, drivep,
+				  (rfp_t)drivep->d_opsp->do_read,
+				(rrbfp_t)drivep->d_opsp->do_return_read_buf,
+				  &rval);
+		if  (rval) {
 			return rval;
 		}
 		nreadneeded64 -= nread;
@@ -792,9 +792,9 @@
 
 	/* verify we are on the mark
 	 */
-	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
+	nextoff = (off64_t)(contextp->dc_nextp - contextp->dc_buf);
 	strmoff = contextp->dc_bufstroff + nextoff;
-	assert( strmoff == mark );
+	assert(strmoff == mark);
 
 	return 0;
 }
@@ -804,30 +804,30 @@
  * has already read past that mark, blow up.
  */
 static int
-do_next_mark( drive_t *drivep )
+do_next_mark(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	drive_mark_t mark = contextp->dc_firstmark;
 	int rval;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple next_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple next_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( dcaps & DRIVE_CAP_NEXTMARK );
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(dcaps & DRIVE_CAP_NEXTMARK);
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
-	if ( ! mark ) {
+	if (! mark) {
 		return DRIVE_ERROR_EOF;
 	}
 
-	rval = do_seek_mark( drivep, ( drive_mark_t * )&mark );
-	if ( rval ) {
+	rval = do_seek_mark(drivep, (drive_mark_t *)&mark);
+	if (rval) {
 		return rval;
 	}
 
@@ -838,33 +838,33 @@
  * just discards any buffered data
  */
 void
-do_end_read( drive_t *drivep )
+do_end_read(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple end_read( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple end_read( )\n");
 
 	/* be sure we are following protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
+	assert(contextp->dc_mode == OM_READ);
 	contextp->dc_mode = OM_NONE;
 
 	/* bump the file mark cnt
 	 */
 	contextp->dc_fmarkcnt++;
-	assert( contextp->dc_fmarkcnt == 1 );
+	assert(contextp->dc_fmarkcnt == 1);
 }
 
 /* begin_write - prepare file for writing
  */
 static int
-do_begin_write( drive_t *drivep )
+do_begin_write(drive_t *drivep)
 {
 	int dcaps = drivep->d_capabilities;
 	global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int rval;
 	global_hdr_t		*tmphdr;
 	drive_hdr_t		*tmpdh;
@@ -876,27 +876,27 @@
 	content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 	content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple begin_write( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple begin_write( )\n");
 
 	/* sanity checks
 	 */
-	assert( dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE );
+	assert(dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* only one media file may be written
 	 */
-	if ( contextp->dc_fmarkcnt > 0 ) {
+	if (contextp->dc_fmarkcnt > 0) {
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* indicate in the header that there is no recorded mark.
 	 */
-	*( ( off64_t * )dwhdrp->dh_specific ) = 0;
+	*((off64_t *)dwhdrp->dh_specific) = 0;
 
 	/* prepare the drive context. initially the caller does not own
 	 * any of the write buffer, so the next portion of the buffer to
@@ -906,20 +906,20 @@
 	 */
 	contextp->dc_ownedp = 0;
 	contextp->dc_nextp = contextp->dc_buf;
-	contextp->dc_emptyp = contextp->dc_buf + sizeof( contextp->dc_buf );
+	contextp->dc_emptyp = contextp->dc_buf + sizeof(contextp->dc_buf);
 	contextp->dc_bufstroff = 0;
 	contextp->dc_markcnt = 0;
 
 	/* truncate the destination if it supports read.
 	 */
-	if ( dcaps & DRIVE_CAP_READ ) {
-		rval = ftruncate( contextp->dc_fd, 0 );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (dcaps & DRIVE_CAP_READ) {
+		rval = ftruncate(contextp->dc_fd, 0);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("attempt to truncate %s failed: %d (%s)\n"),
 			      drivep->d_pathname,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 	}
 
@@ -937,16 +937,16 @@
 
 	xlate_global_hdr(gwhdrp, tmphdr, 1);
 	xlate_drive_hdr(dh, tmpdh, 1);
-	INT_SET(*(( drive_mark_t * )tmpdh->dh_specific),
+	INT_SET(*((drive_mark_t *)tmpdh->dh_specific),
 		ARCH_CONVERT,
-		*(( drive_mark_t * )dh->dh_specific));
+		*((drive_mark_t *)dh->dh_specific));
 	xlate_media_hdr(mh, tmpmh, 1);
 	xlate_content_hdr(ch, tmpch, 1);
 	xlate_content_inode_hdr(cih, tmpcih, 1);
 
 	/* checksum the header
 	 */
-	global_hdr_checksum_set( tmphdr );
+	global_hdr_checksum_set(tmphdr);
 
 	mlog(MLOG_NITTY, "do_begin_write: global_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -964,28 +964,28 @@
 	     tmphdr->gh_hostname,
 	     tmphdr->gh_dumplabel);
 
-	if ( ! global_hdr_checksum_check( tmphdr )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
-		      _("media file header checksum error\n") );
+	if (! global_hdr_checksum_check(tmphdr)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		      _("media file header checksum error\n"));
 	}
 	else {
-		mlog( MLOG_NITTY, "media file header checksum OK!\n" );
+		mlog(MLOG_NITTY, "media file header checksum OK!\n");
 	}
 
 	/* write the header using the write_buf() utility function and
 	 * my own get_write_buf and write operators.
 	 */
-	rval = write_buf( ( char * )tmphdr,
+	rval = write_buf((char *)tmphdr,
 			  GLOBAL_HDR_SZ,
-			  ( void * )drivep,
-			  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-			  ( wfp_t )drivep->d_opsp->do_write );
+			  (void *)drivep,
+			  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+			  (wfp_t)drivep->d_opsp->do_write);
 
 	free(tmphdr);
 
 	/* if error while writing hdr, undo mode
 	 */
-	if ( rval ) {
+	if (rval) {
 		contextp->dc_mode = OM_NONE;
 	}
 
@@ -995,28 +995,28 @@
 /* do_set_mark - record a markrecord and callback
  */
 static void
-do_set_mark( drive_t *drivep,
+do_set_mark(drive_t *drivep,
 	     drive_mcbfp_t cbfuncp,
 	     void *cbcontextp,
-	     drive_markrec_t *markrecp )
+	     drive_markrec_t *markrecp)
 {
-	drive_context_t		*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t		*contextp = (drive_context_t *)drivep->d_contextp;
 	drive_mark_t		mark;
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple set_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple set_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
 
 	/* calculate the mark offset
 	 */
-	mark = ( drive_mark_t )( contextp->dc_bufstroff
+	mark = (drive_mark_t)(contextp->dc_bufstroff
 				 +
-				 ( off64_t )
-				 ( contextp->dc_nextp - contextp->dc_buf ));
+				 (off64_t)
+				 (contextp->dc_nextp - contextp->dc_buf));
 
 	/* fill in the mark field of the mark record
 	 */
@@ -1034,27 +1034,27 @@
 	 * buffer has not yet been flushed, we can just edit the buffer.
 	 */
 	contextp->dc_markcnt++;
-	if ( contextp->dc_markcnt == 1 ) {
-		if ( contextp->dc_bufstroff == 0 ) {
+	if (contextp->dc_markcnt == 1) {
+		if (contextp->dc_bufstroff == 0) {
 			/* cast the write buffer into a media file hdr
 			 */
 			global_hdr_t		*gwhdrp  =
-				( global_hdr_t * )contextp->dc_buf;
-			drive_hdr_t		*dwhdrp = ( drive_hdr_t * )gwhdrp->gh_upper;
+				(global_hdr_t *)contextp->dc_buf;
+			drive_hdr_t		*dwhdrp = (drive_hdr_t *)gwhdrp->gh_upper;
 
-			mlog( MLOG_NITTY | MLOG_DRIVE,
+			mlog(MLOG_NITTY | MLOG_DRIVE,
 			     "re-writing media file header with first mark "
-			     "(in buffer)\n" );
+			     "(in buffer)\n");
 
 			/* record mark in hdr
 			 */
-			INT_SET(*( ( drive_mark_t * )dwhdrp->dh_specific ), ARCH_CONVERT, mark);
+			INT_SET(*((drive_mark_t *)dwhdrp->dh_specific), ARCH_CONVERT, mark);
 
 			/* adjust header checksum
 			 */
-			global_hdr_checksum_set( gwhdrp );
+			global_hdr_checksum_set(gwhdrp);
 
-		} else if ( contextp->dc_rampr ) {
+		} else if (contextp->dc_rampr) {
 			global_hdr_t		*gwhdrp = drivep->d_gwritehdrp;
 			drive_hdr_t		*dwhdrp = drivep->d_writehdrp;
 			off64_t			newoff;
@@ -1063,24 +1063,24 @@
 
 			/* assert the header has been flushed
 			 */
-			assert( contextp->dc_bufstroff >= sizeof( *gwhdrp ));
+			assert(contextp->dc_bufstroff >= sizeof(*gwhdrp));
 
 			/* record mark in hdr
 			 */
-			INT_SET(*( ( drive_mark_t * )dwhdrp->dh_specific ), ARCH_CONVERT, mark);
+			INT_SET(*((drive_mark_t *)dwhdrp->dh_specific), ARCH_CONVERT, mark);
 
 			/* adjust header checksum
 			 */
-			global_hdr_checksum_set( gwhdrp );
+			global_hdr_checksum_set(gwhdrp);
 
 			/* seek to beginning
 			 */
-			newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
-			if ( newoff < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			newoff = lseek64(contextp->dc_fd, (off64_t)0, SEEK_SET);
+			if (newoff < 0) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("could not save first mark: %d (%s)\n"),
 				      errno,
-				      strerror( errno ));
+				      strerror(errno));
 			} else {
 				global_hdr_t		*tmphdr;
 				drive_hdr_t		*tmpdh;
@@ -1092,14 +1092,14 @@
 				content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 				content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-				assert( newoff == 0 );
+				assert(newoff == 0);
 
 				/* write and seek back to current offset
 				 */
-				mlog( MLOG_NITTY | MLOG_DRIVE,
+				mlog(MLOG_NITTY | MLOG_DRIVE,
 				     "re-writing media file header "
 				     "with first mark "
-				     "(on media)\n" );
+				     "(on media)\n");
 
 				tmphdr = (global_hdr_t *)malloc(GLOBAL_HDR_SZ);
 				assert(tmphdr);
@@ -1109,16 +1109,16 @@
 				tmpcih = (content_inode_hdr_t *)tmpch->ch_specific;
 				xlate_global_hdr(gwhdrp, tmphdr, 1);
 				xlate_drive_hdr(dh, tmpdh, 1);
-				INT_SET(*(( drive_mark_t * )tmpdh->dh_specific),
+				INT_SET(*((drive_mark_t *)tmpdh->dh_specific),
 					ARCH_CONVERT,
-					*(( drive_mark_t * )dh->dh_specific));
+					*((drive_mark_t *)dh->dh_specific));
 				xlate_media_hdr(mh, tmpmh, 1);
 				xlate_content_hdr(ch, tmpch, 1);
 				xlate_content_inode_hdr(cih, tmpcih, 1);
 
 				/* adjust header checksum
 				 */
-				global_hdr_checksum_set( tmphdr );
+				global_hdr_checksum_set(tmphdr);
 
 				mlog(MLOG_NITTY, "do_set_mark: global_hdr\n"
 				     "\tgh_magic %.100s\n"
@@ -1136,16 +1136,16 @@
 				     tmphdr->gh_hostname,
 				     tmphdr->gh_dumplabel);
 
-				nwritten = write( contextp->dc_fd,
+				nwritten = write(contextp->dc_fd,
 						  tmphdr,
-						  sizeof( *tmphdr ));
-				assert( ( size_t )nwritten == sizeof( *tmphdr ));
+						  sizeof(*tmphdr));
+				assert((size_t)nwritten == sizeof(*tmphdr));
 				free(tmphdr);
 
-				newoff = lseek64( contextp->dc_fd,
+				newoff = lseek64(contextp->dc_fd,
 						  contextp->dc_bufstroff,
-						  SEEK_SET );
-				assert( newoff == contextp->dc_bufstroff );
+						  SEEK_SET);
+				assert(newoff == contextp->dc_bufstroff);
 			}
 		}
 	}
@@ -1153,19 +1153,19 @@
 	/* if all written are committed, send the mark back immediately.
 	 * otherwise put the mark record on the tail of the queue.
 	 */
-	if ( contextp->dc_nextp == contextp->dc_buf ) {
-		assert( drivep->d_markrecheadp == 0 );
-		( * cbfuncp )( cbcontextp, markrecp, BOOL_TRUE );
+	if (contextp->dc_nextp == contextp->dc_buf) {
+		assert(drivep->d_markrecheadp == 0);
+		(* cbfuncp)(cbcontextp, markrecp, BOOL_TRUE);
 		return;
 	} else {
 		markrecp->dm_cbfuncp = cbfuncp;
 		markrecp->dm_cbcontextp = cbcontextp;
 		markrecp->dm_nextp = 0;
-		if ( drivep->d_markrecheadp == 0 ) {
+		if (drivep->d_markrecheadp == 0) {
 			drivep->d_markrecheadp = markrecp;
 			drivep->d_markrectailp = markrecp;
 		} else {
-			assert( drivep->d_markrectailp );
+			assert(drivep->d_markrectailp);
 			drivep->d_markrectailp->dm_nextp = markrecp;
 			drivep->d_markrectailp = markrecp;
 		}
@@ -1178,31 +1178,31 @@
  */
 /*ARGSUSED*/
 static char *
-do_get_write_buf( drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp )
+do_get_write_buf(drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	size_t remaining_bufsz;
 	size_t actual_bufsz;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple get_write_buf( want %u )\n",
-	      wanted_bufsz );
+	      wanted_bufsz);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_emptyp );
-	assert( contextp->dc_ownedsz == 0 );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_emptyp);
+	assert(contextp->dc_ownedsz == 0);
 
 	/* calculate how much buffer remains
 	 */
-	remaining_bufsz =( size_t )( contextp->dc_emptyp - contextp->dc_nextp );
+	remaining_bufsz =(size_t)(contextp->dc_emptyp - contextp->dc_nextp);
 
 	/*  give the caller the lesser of what he wants and what is available
 	 */
-	actual_bufsz = min( wanted_bufsz, remaining_bufsz );
+	actual_bufsz = min(wanted_bufsz, remaining_bufsz);
 
 	/* caller will own that portion of buffer
 	 */
@@ -1224,15 +1224,15 @@
  */
 /*ARGSUSED*/
 static int
-do_write( drive_t *drivep, char *bufp, size_t writesz )
+do_write(drive_t *drivep, char *bufp, size_t writesz)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t ownedstroff = contextp->dc_bufstroff
 			      +
-			      ( off64_t )
-			      ( contextp->dc_ownedp - contextp->dc_buf );
+			      (off64_t)
+			      (contextp->dc_ownedp - contextp->dc_buf);
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple write( "
 	      "offset %lld (0x%llx 0%llo) "
 	      "size %u (0x%x 0%o) "
@@ -1243,55 +1243,55 @@
 	      writesz,
 	      writesz,
 	      writesz,
-	      0 );
+	      0);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( contextp->dc_ownedp );
-	assert( bufp == contextp->dc_ownedp );
-	assert( ! contextp->dc_nextp );
-	assert( contextp->dc_ownedp < contextp->dc_emptyp );
-	assert( writesz == contextp->dc_ownedsz );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(contextp->dc_ownedp);
+	assert(bufp == contextp->dc_ownedp);
+	assert(! contextp->dc_nextp);
+	assert(contextp->dc_ownedp < contextp->dc_emptyp);
+	assert(writesz == contextp->dc_ownedsz);
 
 	/* calculate next portion of buffer available for get_write_buf,
 	 * and indicate no portion is owned.
 	 */
 	contextp->dc_nextp = contextp->dc_ownedp + writesz;
-	assert( contextp->dc_nextp <= contextp->dc_emptyp );
+	assert(contextp->dc_nextp <= contextp->dc_emptyp);
 	contextp->dc_ownedp = 0;
 	contextp->dc_ownedsz = 0;
 
-	if ( writesz == 0 ) {
+	if (writesz == 0) {
 		return 0; /* returning unused buffer */
 	}
 
 	/* if buffer is full, flush it
 	 */
-	if ( contextp->dc_nextp == contextp->dc_emptyp ) {
+	if (contextp->dc_nextp == contextp->dc_emptyp) {
 		int nwritten;
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "flushing write buf addr 0x%x size 0x%x\n",
 		      contextp->dc_buf,
-		      sizeof( contextp->dc_buf ));
+		      sizeof(contextp->dc_buf));
 
 		contextp->dc_nextp = 0;
-		nwritten = write( contextp->dc_fd,
+		nwritten = write(contextp->dc_fd,
 				  contextp->dc_buf,
-				  sizeof( contextp->dc_buf ));
-		if ( nwritten < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				  sizeof(contextp->dc_buf));
+		if (nwritten < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("write to %s failed: %d (%s)\n"),
 			      drivep->d_pathname,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 			nwritten = 0;
 		}
-		contextp->dc_bufstroff += ( off64_t )nwritten;
-		drive_mark_commit( drivep, contextp->dc_bufstroff );
+		contextp->dc_bufstroff += (off64_t)nwritten;
+		drive_mark_commit(drivep, contextp->dc_bufstroff);
 		contextp->dc_nextp = contextp->dc_buf;
-		if ( ( size_t )nwritten < sizeof( contextp->dc_buf )) {
+		if ((size_t)nwritten < sizeof(contextp->dc_buf)) {
 			return DRIVE_ERROR_EOM;
 		}
 	}
@@ -1303,91 +1303,91 @@
  * cause the next call to get_write_buf() to be page-aligned.
  */
 static size_t
-do_get_align_cnt( drive_t *drivep )
+do_get_align_cnt(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	intptr_t next_alignment_off;
 	char *next_alignment_point;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple get_align_cnt( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple get_align_cnt( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_emptyp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_emptyp);
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because dc_buf is page-aligned and
 	 * a multiple of PGSZ.
 	 */
-	next_alignment_off = ( intptr_t )contextp->dc_nextp;
+	next_alignment_off = (intptr_t)contextp->dc_nextp;
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
-	next_alignment_point = ( char * )next_alignment_off;
-	assert( next_alignment_point <= contextp->dc_emptyp );
+	next_alignment_point = (char *)next_alignment_off;
+	assert(next_alignment_point <= contextp->dc_emptyp);
 
 	/* return the number of bytes to the next alignment point
 	 */
-	return ( size_t )( next_alignment_point - contextp->dc_nextp );
+	return (size_t)(next_alignment_point - contextp->dc_nextp);
 }
 
 /* end_write - flush any buffered data, and return by reference how many
  * bytes were committed.
  */
 static int
-do_end_write( drive_t *drivep, off64_t *ncommittedp )
+do_end_write(drive_t *drivep, off64_t *ncommittedp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	size_t remaining_bufsz;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple end_write( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple end_write( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_emptyp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_emptyp);
 
 	/* calculate length of un-written portion of buffer
 	 */
-	assert( contextp->dc_nextp >= contextp->dc_buf );
-	remaining_bufsz = ( size_t )( contextp->dc_nextp - contextp->dc_buf );
+	assert(contextp->dc_nextp >= contextp->dc_buf);
+	remaining_bufsz = (size_t)(contextp->dc_nextp - contextp->dc_buf);
 
-	if ( remaining_bufsz ) {
+	if (remaining_bufsz) {
 		int nwritten;
-		if ( contextp->dc_israwdevpr ) {
-			remaining_bufsz = ( remaining_bufsz + ( BBSIZE - 1 ))
+		if (contextp->dc_israwdevpr) {
+			remaining_bufsz = (remaining_bufsz + (BBSIZE - 1))
 					  &
-					  ~( BBSIZE - 1 );
+					  ~(BBSIZE - 1);
 		}
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "flushing write buf addr 0x%x size 0x%x\n",
 		      contextp->dc_buf,
-		      remaining_bufsz );
+		      remaining_bufsz);
 
-		nwritten = write( contextp->dc_fd,
+		nwritten = write(contextp->dc_fd,
 				  contextp->dc_buf,
-				  remaining_bufsz );
-		if ( nwritten < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				  remaining_bufsz);
+		if (nwritten < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("write to %s failed: %d (%s)\n"),
 			      drivep->d_pathname,
 			      errno,
-			      strerror( errno ));
-			drive_mark_discard( drivep );
+			      strerror(errno));
+			drive_mark_discard(drivep);
 			*ncommittedp = contextp->dc_bufstroff;
 			contextp->dc_mode = OM_NONE;
 			return DRIVE_ERROR_DEVICE;
 		}
-		contextp->dc_bufstroff += ( off64_t )nwritten;
-		drive_mark_commit( drivep, contextp->dc_bufstroff );
-		if ( ( size_t )nwritten < remaining_bufsz ) {
+		contextp->dc_bufstroff += (off64_t)nwritten;
+		drive_mark_commit(drivep, contextp->dc_bufstroff);
+		if ((size_t)nwritten < remaining_bufsz) {
 			*ncommittedp = contextp->dc_bufstroff;
 			contextp->dc_mode = OM_NONE;
 			return DRIVE_ERROR_EOM;
@@ -1397,7 +1397,7 @@
 	/* bump the file mark cnt
 	 */
 	contextp->dc_fmarkcnt++;
-	assert( contextp->dc_fmarkcnt == 1 );
+	assert(contextp->dc_fmarkcnt == 1);
 
 	*ncommittedp = contextp->dc_bufstroff;
 	contextp->dc_mode = OM_NONE;
@@ -1407,32 +1407,32 @@
 /* rewind - return the current file offset to the beginning
  */
 int
-do_rewind( drive_t *drivep )
+do_rewind(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t newoff;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple rewind( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple rewind( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( dcaps & DRIVE_CAP_REWIND );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(dcaps & DRIVE_CAP_REWIND);
+	assert(contextp->dc_fd >= 0);
 
 	/* seek to beginning of file
 	 */
-	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
-	if ( newoff ) {
-		assert( newoff < 0 );
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	newoff = lseek64(contextp->dc_fd, (off64_t)0, SEEK_SET);
+	if (newoff) {
+		assert(newoff < 0);
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not rewind %s: %s\n"),
 		      drivep->d_pathname,
-		      strerror( errno ));
+		      strerror(errno));
 		return DRIVE_ERROR_DEVICE;
 	}
 
@@ -1442,45 +1442,45 @@
 /* erase - truncate to zero length
  */
 int
-do_erase( drive_t *drivep )
+do_erase(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t newoff;
 	int rval;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple erase( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple erase( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( dcaps & DRIVE_CAP_ERASE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(dcaps & DRIVE_CAP_ERASE);
+	assert(contextp->dc_fd >= 0);
 
 	/* seek to beginning of file
 	 */
-	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
-	if ( newoff ) {
-		assert( newoff < 0 );
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	newoff = lseek64(contextp->dc_fd, (off64_t)0, SEEK_SET);
+	if (newoff) {
+		assert(newoff < 0);
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not rewind %s in prep for erase: %s\n"),
 		      drivep->d_pathname,
-		      strerror( errno ));
+		      strerror(errno));
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* erase to beginning of file
 	 */
-	rval = ftruncate64( contextp->dc_fd, ( off64_t )0 );
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	rval = ftruncate64(contextp->dc_fd, (off64_t)0);
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not erase %s: %s (%d)\n"),
 		      drivep->d_pathname,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return DRIVE_ERROR_DEVICE;
 	}
 	contextp->dc_fmarkcnt = 0;
@@ -1492,36 +1492,36 @@
  */
 /* ARGSUSED */
 static int
-do_get_device_class( drive_t *drivep )
+do_get_device_class(drive_t *drivep)
 {
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple get_device_class( )\n" );
-	assert( drivep );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple get_device_class( )\n");
+	assert(drivep);
 	return DEVICE_NONREMOVABLE;
 }
 
 static void
-do_quit( drive_t *drivep )
+do_quit(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple quit( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple quit( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp);
 
 	/* close file
 	 */
-	if ( contextp->dc_fd > 1 ) {
-		close( contextp->dc_fd );
+	if (contextp->dc_fd > 1) {
+		close(contextp->dc_fd);
 	}
 	contextp->dc_fd = -1;
 
 	/* free context
 	 */
-	free( ( void * )contextp );
+	free((void *)contextp);
 	drivep->d_contextp = 0;
 }
diff --git a/common/exit.h b/common/exit.h
index 403946d..de76cd8 100644
--- a/common/exit.h
+++ b/common/exit.h
@@ -26,9 +26,9 @@
 #define EXIT_FAULT	4	/* code fault */
 
 static inline const char *
-exit_codestring( int code )
+exit_codestring(int code)
 {
-	switch ( code ) {
+	switch (code) {
 	case EXIT_NORMAL:    return "SUCCESS";
 	case EXIT_ERROR:     return "ERROR";
 	case EXIT_INTERRUPT: return "INTERRUPT";
diff --git a/common/fs.c b/common/fs.c
index 60cf0fd..4880db9 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -99,16 +99,16 @@
 
 /* forward declarations
  */
-static void fs_tab_build( void );
-static void fs_tab_free( void );
-static fs_tab_ent_t *fs_tab_ent_build( struct mntent * );
-static void fs_tab_ent_free( fs_tab_ent_t * );
-static fs_tab_ent_t *fs_tab_lookup_blk( char * );
-static fs_tab_ent_t *fs_tab_lookup_mnt( char * );
+static void fs_tab_build(void);
+static void fs_tab_free(void);
+static fs_tab_ent_t *fs_tab_ent_build(struct mntent *);
+static void fs_tab_ent_free(fs_tab_ent_t *);
+static fs_tab_ent_t *fs_tab_lookup_blk(char *);
+static fs_tab_ent_t *fs_tab_lookup_mnt(char *);
 
 /* ARGSUSED */
 bool_t
-fs_info( char *typb,		/* out */
+fs_info(char *typb,		/* out */
 	 int typbz,
 	 char *typd,
 	 char *blkb,		/* out */
@@ -116,7 +116,7 @@
 	 char *mntb,		/* out */
 	 int mntbz,
 	 uuid_t *idb,		/* out */
-	 char *usrs )		/* in */
+	 char *usrs)		/* in */
 {
 	struct stat64 statb;
 	fs_tab_ent_t *tep;
@@ -126,64 +126,64 @@
 	bool_t canstat;
 	bool_t ok = BOOL_UNKNOWN;
 
-	fs_tab_build( );
+	fs_tab_build();
 
-	canstat = ( stat64( usrs, &statb ) == 0 );
-	if ( canstat && ( statb.st_mode & S_IFMT ) == S_IFBLK ) {
-		if ( ( tep = fs_tab_lookup_blk( usrs )) != 0 ) {
+	canstat = (stat64(usrs, &statb) == 0);
+	if (canstat && (statb.st_mode & S_IFMT) == S_IFBLK) {
+		if ((tep = fs_tab_lookup_blk(usrs)) != 0) {
 			blks = tep->fte_blks;
-			assert( strlen( blks ) < ( size_t )blkbz );
-			strcpy( blkb, blks );
+			assert(strlen(blks) < (size_t)blkbz);
+			strcpy(blkb, blks);
 			mnts = tep->fte_mnts;
-			if ( mnts ) {
-				assert( strlen( mnts ) < ( size_t )mntbz );
-				strcpy( mntb, mnts );
+			if (mnts) {
+				assert(strlen(mnts) < (size_t)mntbz);
+				strcpy(mntb, mnts);
 			} else {
-				mntb[ 0 ] = 0;
+				mntb[0] = 0;
 			}
-			if ( ( typs = tep->fte_typs ) == 0 ) {
+			if ((typs = tep->fte_typs) == 0) {
 				typs = typd;
 			}
-			assert( strlen( typs ) < ( size_t )typbz );
-			strcpy( typb, typs );
+			assert(strlen(typs) < (size_t)typbz);
+			strcpy(typb, typs);
 			ok = BOOL_TRUE;
 		} else {
 			ok = BOOL_FALSE;
 		}
-	} else if ( ( tep = fs_tab_lookup_mnt( usrs )) != 0 ) {
+	} else if ((tep = fs_tab_lookup_mnt(usrs)) != 0) {
 		blks = tep->fte_blks;
-		assert( strlen( blks ) < ( size_t )blkbz );
-		strcpy( blkb, blks );
+		assert(strlen(blks) < (size_t)blkbz);
+		strcpy(blkb, blks);
 		mnts = tep->fte_mnts;
-		assert( strlen( mnts ) < ( size_t )mntbz );
-		strcpy( mntb, mnts );
+		assert(strlen(mnts) < (size_t)mntbz);
+		strcpy(mntb, mnts);
 		typs = tep->fte_typs;
-		assert( strlen( typs ) < ( size_t )typbz );
-		strcpy( typb, typs );
+		assert(strlen(typs) < (size_t)typbz);
+		strcpy(typb, typs);
 		ok = BOOL_TRUE;
 	} else {
 		ok = BOOL_FALSE;
 	}
 
-	fs_tab_free( );
-	assert( ok != BOOL_UNKNOWN );
+	fs_tab_free();
+	assert(ok != BOOL_UNKNOWN);
 
-	if ( ok == BOOL_TRUE ) {
-		int rval = fs_getid( mntb, idb );
-		if ( rval ) {
-			mlog( MLOG_NORMAL,
+	if (ok == BOOL_TRUE) {
+		int rval = fs_getid(mntb, idb);
+		if (rval) {
+			mlog(MLOG_NORMAL,
 			      _("unable to determine uuid of fs mounted at %s: "
 			      "%s\n"),
 			      mntb,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 		{
 			char string_uuid[37];
-			uuid_unparse( *idb, string_uuid );
-			mlog( MLOG_DEBUG,
+			uuid_unparse(*idb, string_uuid);
+			mlog(MLOG_DEBUG,
 			      "fs %s uuid [%s]\n",
 			      mntb,
-			      string_uuid );
+			      string_uuid);
 		}
 	}
 
@@ -196,120 +196,120 @@
  */
 /* ARGSUSED */
 bool_t
-fs_mounted( char *typs, char *chrs, char *mnts, uuid_t *idp )
+fs_mounted(char *typs, char *chrs, char *mnts, uuid_t *idp)
 {
-	return strlen( mnts ) > 0 ? BOOL_TRUE : BOOL_FALSE;
+	return strlen(mnts) > 0 ? BOOL_TRUE : BOOL_FALSE;
 }
 
 int
-fs_getid( char *mnts, uuid_t *idb )
+fs_getid(char *mnts, uuid_t *idb)
 {
 	xfs_fsop_geom_v1_t geo;
 	int fd;
 
-	fd = open( mnts, O_RDONLY );
-	if ( fd < 0 ) {
-		uuid_clear( *idb );
+	fd = open(mnts, O_RDONLY);
+	if (fd < 0) {
+		uuid_clear(*idb);
 		return -1;
 	}
-	if ( ioctl(fd, XFS_IOC_FSGEOMETRY_V1, &geo ) ) {
-		uuid_clear( *idb );
+	if (ioctl(fd, XFS_IOC_FSGEOMETRY_V1, &geo)) {
+		uuid_clear(*idb);
 		close(fd);
 		return -1;
 	}
 	close(fd);
-	uuid_copy( *idb, geo.uuid );
+	uuid_copy(*idb, geo.uuid);
 
 	return 0;
 }
 
 size_t
-fs_getinocnt( char *mnts )
+fs_getinocnt(char *mnts)
 {
 	struct statvfs vfsstat;
 	int rval;
 
-	rval = statvfs( mnts, &vfsstat );
-	if ( rval ) {
+	rval = statvfs(mnts, &vfsstat);
+	if (rval) {
 		return 0;
 	}
 
-	if ( vfsstat.f_files < vfsstat.f_ffree ) {
+	if (vfsstat.f_files < vfsstat.f_ffree) {
 		return 0;
 	}
 
-	return ( size_t )( vfsstat.f_files - vfsstat.f_ffree );
+	return (size_t)(vfsstat.f_files - vfsstat.f_ffree);
 }
 
 static void
-fs_tab_build( void )
+fs_tab_build(void)
 {
 	register struct mntent *mntentp;
 	fs_tab_ent_t *tep;
 	FILE *fp;
 
 	fs_tabp = 0;
-	fp = setmntent( MOUNTED, "r" );
-        if ( fp == NULL ) {
-		mlog( MLOG_NORMAL,
+	fp = setmntent(MOUNTED, "r");
+        if (fp == NULL) {
+		mlog(MLOG_NORMAL,
 		      _("Can't open %s for mount information\n"),
-		      MOUNTED );
+		      MOUNTED);
 		return;
 	}
-	while ( ( mntentp = getmntent( fp )) != 0 ) {
-		tep = fs_tab_ent_build( mntentp );
+	while ((mntentp = getmntent(fp)) != 0) {
+		tep = fs_tab_ent_build(mntentp);
 		tep->fte_nextp = fs_tabp;
 		fs_tabp = tep;
 	}
-	endmntent( fp );
+	endmntent(fp);
 }
 
 static void
-fs_tab_free( void )
+fs_tab_free(void)
 {
 	fs_tab_ent_t *tep;
 	fs_tab_ent_t *otep;
 
-	for ( tep = fs_tabp
+	for (tep = fs_tabp
 	      ;
 	      tep
 	      ;
-	      otep = tep, tep = tep->fte_nextp, fs_tab_ent_free( otep ) )
+	      otep = tep, tep = tep->fte_nextp, fs_tab_ent_free(otep))
 
 		;
 }
 
 static fs_tab_ent_t *
-fs_tab_ent_build( struct mntent *mntentp )
+fs_tab_ent_build(struct mntent *mntentp)
 {
 	fs_tab_ent_t *tep;
 	char *cp;
 
-	tep = ( fs_tab_ent_t * )calloc( 1, sizeof( fs_tab_ent_t ));
-	assert( tep );
+	tep = (fs_tab_ent_t *)calloc(1, sizeof(fs_tab_ent_t));
+	assert(tep);
 
-	if ( mntentp->mnt_dir ) {
-		cp = calloc( 1, strlen( mntentp->mnt_dir ) + 1 );
-		assert( cp );
-		( void )strcpy( cp, mntentp->mnt_dir );
+	if (mntentp->mnt_dir) {
+		cp = calloc(1, strlen(mntentp->mnt_dir) + 1);
+		assert(cp);
+		(void)strcpy(cp, mntentp->mnt_dir);
 		tep->fte_mnts = cp;
 	} else {
 		tep->fte_mnts = 0;
 	}
 
-	if ( mntentp->mnt_type ) {
-		cp = calloc( 1, strlen( mntentp->mnt_type ) + 1 );
-		assert( cp );
-		( void )strcpy( cp, mntentp->mnt_type );
+	if (mntentp->mnt_type) {
+		cp = calloc(1, strlen(mntentp->mnt_type) + 1);
+		assert(cp);
+		(void)strcpy(cp, mntentp->mnt_type);
 		tep->fte_typs = cp;
 	} else {
 		tep->fte_typs = 0;
 	}
 
-	if ( mntentp->mnt_fsname ) {
-		cp = calloc( 1, strlen( mntentp->mnt_fsname ) + 1 );
-		assert( cp );
-		( void )strcpy( cp, mntentp->mnt_fsname );
+	if (mntentp->mnt_fsname) {
+		cp = calloc(1, strlen(mntentp->mnt_fsname) + 1);
+		assert(cp);
+		(void)strcpy(cp, mntentp->mnt_fsname);
 		tep->fte_blks = cp;
 	} else {
 		tep->fte_blks = 0;
@@ -319,37 +319,37 @@
 }
 
 static void
-fs_tab_ent_free( fs_tab_ent_t *tep )
+fs_tab_ent_free(fs_tab_ent_t *tep)
 {
-	if ( tep->fte_blks ) free( tep->fte_blks );
-	if ( tep->fte_mnts ) free( tep->fte_mnts );
-	if ( tep->fte_typs ) free( tep->fte_typs );
-	memset( ( void * )tep, 0, sizeof( *tep )); /* bug catcher */
-	free( tep );
+	if (tep->fte_blks) free(tep->fte_blks);
+	if (tep->fte_mnts) free(tep->fte_mnts);
+	if (tep->fte_typs) free(tep->fte_typs);
+	memset((void *)tep, 0, sizeof(*tep)); /* bug catcher */
+	free(tep);
 }
 
 static fs_tab_ent_t *
-fs_tab_lookup_blk( char *blks )
+fs_tab_lookup_blk(char *blks)
 {
 	fs_tab_ent_t *tep;
 
-	for ( tep = fs_tabp ; tep ; tep = tep->fte_nextp ) {
+	for (tep = fs_tabp ; tep ; tep = tep->fte_nextp) {
 		struct stat64 stata;
 		bool_t aok;
 		struct stat64 statb;
 		bool_t bok;
 
-		if ( ! tep->fte_blks ) {
+		if (! tep->fte_blks) {
 			continue;
 		}
 
-		if ( ! strcmp( tep->fte_blks, blks )) {
+		if (! strcmp(tep->fte_blks, blks)) {
 			return tep;
 		}
 
-		aok = ! stat64( blks, &stata );
-		bok = ! stat64( tep->fte_blks, &statb );
-		if ( aok && bok && stata.st_rdev == statb.st_rdev ) {
+		aok = ! stat64(blks, &stata);
+		bok = ! stat64(tep->fte_blks, &statb);
+		if (aok && bok && stata.st_rdev == statb.st_rdev) {
 			return tep;
 		}
 	}
@@ -357,12 +357,12 @@
 }
 
 static fs_tab_ent_t *
-fs_tab_lookup_mnt( char *mnts )
+fs_tab_lookup_mnt(char *mnts)
 {
 	fs_tab_ent_t *tep;
 
-	for ( tep = fs_tabp ; tep ; tep = tep->fte_nextp ) {
-		if ( tep->fte_mnts && ! strcmp( tep->fte_mnts, mnts )) {
+	for (tep = fs_tabp ; tep ; tep = tep->fte_nextp) {
+		if (tep->fte_mnts && ! strcmp(tep->fte_mnts, mnts)) {
 			return tep;
 		}
 	}
diff --git a/common/fs.h b/common/fs.h
index 4a9d9d1..7b02d72 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -31,7 +31,7 @@
  *
  * returns BOOL_FALSE if srcname does not describe a file system.
  */
-extern bool_t fs_info( char *fstype,		/* out: fs type (fsid.h) */
+extern bool_t fs_info(char *fstype,		/* out: fs type (fsid.h) */
 		       int fstypesz,	/* in: buffer size */
 		       char *fstypedef,		/* in: default fs type */
 		       char *fsdevice,		/* out: blk spec. dev. file */
@@ -39,22 +39,22 @@
 		       char *mntpt,		/* out: where fs mounted */
 		       int mntptsz,	/* in: buffer size */
 		       uuid_t *fsid,		/* out: fs uuid */
-		       char *srcname );		/* in: how user named the fs */
+		       char *srcname);		/* in: how user named the fs */
 
 /* fs_mounted - checks if a file system is mounted at its mount point
  */
-extern bool_t fs_mounted( char *fstype,
+extern bool_t fs_mounted(char *fstype,
 		          char *fsdevice,
 		          char *mntpt,
-		          uuid_t *fsid );
+		          uuid_t *fsid);
 
 /* fs_getid - retrieves the uuid of the file system containing the named
  * file. returns -1 with errno set on error.
  */
-extern int fs_getid( char *fullpathname, uuid_t *fsidp );
+extern int fs_getid(char *fullpathname, uuid_t *fsidp);
 
 /* tells how many inos in use
  */
-extern size_t fs_getinocnt( char *mnts );
+extern size_t fs_getinocnt(char *mnts);
 
 #endif /* FS_H */
diff --git a/common/global.c b/common/global.c
index 73efd55..62a00c3 100644
--- a/common/global.c
+++ b/common/global.c
@@ -39,14 +39,14 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
+extern void usage(void);
 extern bool_t pipeline;
 
 
 /* forward declarations of locally defined static functions ******************/
 
 #ifdef DUMP
-static char * prompt_label( char *bufp, size_t bufsz );
+static char * prompt_label(char *bufp, size_t bufsz);
 #endif /* DUMP */
 
 /* definition of locally defined global variables ****************************/
@@ -58,13 +58,13 @@
 /* definition of locally defined global functions ****************************/
 
 global_hdr_t *
-global_hdr_alloc( int argc, char *argv[ ] )
+global_hdr_alloc(int argc, char *argv[])
 {
 	global_hdr_t *ghdrp;
 	int c;
 	char *dumplabel;
 #ifdef DUMP
-	char labelbuf[ GLOBAL_HDR_STRING_SZ ];
+	char labelbuf[GLOBAL_HDR_STRING_SZ];
 	struct stat64 statb;
 #endif /* DUMP */
 
@@ -72,17 +72,17 @@
 
 	/* sanity checks
 	 */
-	assert( sizeof( time32_t ) == GLOBAL_HDR_TIME_SZ );
-	assert( sizeof( uuid_t ) == GLOBAL_HDR_UUID_SZ );
+	assert(sizeof(time32_t) == GLOBAL_HDR_TIME_SZ);
+	assert(sizeof(uuid_t) == GLOBAL_HDR_UUID_SZ);
 
 	/* allocate a global hdr
 	 */
-	ghdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
-	assert( ghdrp );
+	ghdrp = (global_hdr_t *)calloc(1, sizeof(global_hdr_t));
+	assert(ghdrp);
 
 	/* fill in the magic number
 	 */
-	strncpy( ghdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ );
+	strncpy(ghdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ);
 
 	/* fill in the hdr version
 	 */
@@ -92,31 +92,31 @@
 	 * will be included in increments on this base. This may be
 	 * overridden with the GETOPT_DUMPTIME option.
 	 */
-	ghdrp->gh_timestamp = (time32_t) time( 0 );
+	ghdrp->gh_timestamp = (time32_t) time(0);
 
 	/* fill in the host id: typecast to fit into a 64 bit field
 	 */
-	ghdrp->gh_ipaddr = ( uint64_t )( unsigned long )gethostid( );
+	ghdrp->gh_ipaddr = (uint64_t)(unsigned long)gethostid();
 
 #ifdef DUMP
-	uuid_generate( ghdrp->gh_dumpid );
+	uuid_generate(ghdrp->gh_dumpid);
 #endif /* DUMP */
 #ifdef RESTORE
-	uuid_clear( ghdrp->gh_dumpid );
+	uuid_clear(ghdrp->gh_dumpid);
 #endif /* RESTORE */
 
 	/* fill in the hostname
 	 */
-	rval = gethostname( ghdrp->gh_hostname, GLOBAL_HDR_STRING_SZ );
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
+	rval = gethostname(ghdrp->gh_hostname, GLOBAL_HDR_STRING_SZ);
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_ERROR,
 		      _("unable to determine hostname: %s\n"),
-		      strerror( errno ));
+		      strerror(errno));
 		return 0;
 	}
-	if ( ! strlen( ghdrp->gh_hostname )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
-		      _("hostname length is zero\n") );
+	if (! strlen(ghdrp->gh_hostname)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR,
+		      _("hostname length is zero\n"));
 		return 0;
 	}
 
@@ -125,50 +125,50 @@
 	dumplabel = 0;
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
                 case GETOPT_DUMPLABEL:
-                        if ( dumplabel ) {
-                                mlog( MLOG_NORMAL,
+                        if (dumplabel) {
+                                mlog(MLOG_NORMAL,
                                       _("too many -%c arguments: "
                                       "\"-%c %s\" already given\n"),
                                       c,
                                       c,
-                                      dumplabel );
-                                usage( );
+                                      dumplabel);
+                                usage();
                                 return 0;
                         }
-                        if ( ! optarg || optarg[ 0 ] == '-' ) {
-                                mlog( MLOG_NORMAL | MLOG_ERROR,
+                        if (! optarg || optarg[0] == '-') {
+                                mlog(MLOG_NORMAL | MLOG_ERROR,
                                       _("-%c argument missing\n"),
-                                      c );
-                                usage( );
+                                      c);
+                                usage();
                                 return 0;
                         }
                         dumplabel = optarg;
                         break;
 #ifdef RESTORE
 		case GETOPT_SESSIONID:
-                        if ( ! uuid_is_null( ghdrp->gh_dumpid )) {
-                                mlog( MLOG_NORMAL | MLOG_ERROR,
+                        if (! uuid_is_null(ghdrp->gh_dumpid)) {
+                                mlog(MLOG_NORMAL | MLOG_ERROR,
                                       _("too many -%c arguments\n"),
-                                      c );
-                                usage( );
+                                      c);
+                                usage();
                                 return 0;
                         }
-                        if ( ! optarg || optarg[ 0 ] == '-' ) {
-                                mlog( MLOG_NORMAL | MLOG_ERROR,
+                        if (! optarg || optarg[0] == '-') {
+                                mlog(MLOG_NORMAL | MLOG_ERROR,
                                       _("-%c argument missing\n"),
-                                      c );
-                                usage( );
+                                      c);
+                                usage();
                                 return 0;
                         }
 
-			if ( ! uuid_parse( optarg, ghdrp->gh_dumpid ) ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR,
+			if (! uuid_parse(optarg, ghdrp->gh_dumpid)) {
+				mlog(MLOG_NORMAL | MLOG_ERROR,
 				      _("-%c argument not a valid uuid\n"),
-				      c );
-                                usage( );
+				      c);
+                                usage();
                                 return 0;
                         }
                         break;
@@ -178,20 +178,20 @@
 			/* Use the timestamp of the specified file for the
 			 * dump time, rather than using the current time.
 			 */
-                        if ( ! optarg || optarg[ 0 ] == '-' ) {
-                                mlog( MLOG_NORMAL | MLOG_ERROR,
+                        if (! optarg || optarg[0] == '-') {
+                                mlog(MLOG_NORMAL | MLOG_ERROR,
                                       _("-%c argument missing\n"),
-                                      c );
-                                usage( );
+                                      c);
+                                usage();
                                 return 0;
                         }
-			rval = stat64( optarg, &statb );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR,
+			rval = stat64(optarg, &statb);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_ERROR,
 				      _("unable to stat %s: %s\n"),
 				      optarg,
-				      strerror( errno ));
-				usage( );
+				      strerror(errno));
+				usage();
 				return 0;
 			}
 			ghdrp->gh_timestamp = statb.st_mtime;
@@ -208,49 +208,49 @@
 	/* if no dump label specified, no pipes in use, and dialogs
 	 * are allowed, prompt for one
 	 */
-	if ( ! dumplabel && dlog_allowed( )) {
-		dumplabel = prompt_label( labelbuf, sizeof( labelbuf ));
+	if (! dumplabel && dlog_allowed()) {
+		dumplabel = prompt_label(labelbuf, sizeof(labelbuf));
 	}
 #endif /* DUMP */
 
-	if ( ! dumplabel || ! strlen( dumplabel )) {
+	if (! dumplabel || ! strlen(dumplabel)) {
 #ifdef DUMP
-		if ( ! pipeline ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING,
-			      _("no session label specified\n") );
+		if (! pipeline) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING,
+			      _("no session label specified\n"));
 		}
 #endif /* DUMP */
 		dumplabel = "";
 	}
 
-	strncpyterm( ghdrp->gh_dumplabel,
+	strncpyterm(ghdrp->gh_dumplabel,
 		     dumplabel,
-		     sizeof( ghdrp->gh_dumplabel ));
+		     sizeof(ghdrp->gh_dumplabel));
 
 	return ghdrp;
 }
 
 
 void
-global_hdr_free( global_hdr_t *ghdrp )
+global_hdr_free(global_hdr_t *ghdrp)
 {
-    free( ( void * )ghdrp );
+    free((void *)ghdrp);
 }
 
 /* global_hdr_checksum_set - fill in the global media file header checksum.
  * utility function for use by drive-specific strategies.
  */
 void
-global_hdr_checksum_set( global_hdr_t *hdrp )
+global_hdr_checksum_set(global_hdr_t *hdrp)
 {
-	uint32_t *beginp = ( uint32_t * )&hdrp[ 0 ];
-	uint32_t *endp = ( uint32_t * )&hdrp[ 1 ];
+	uint32_t *beginp = (uint32_t *)&hdrp[0];
+	uint32_t *endp = (uint32_t *)&hdrp[1];
 	uint32_t *p;
 	uint32_t accum;
 
 	hdrp->gh_checksum = 0;
 	accum = 0;
-	for ( p = beginp ; p < endp ; p++ ) {
+	for (p = beginp ; p < endp ; p++) {
 		accum += INT_GET(*p, ARCH_CONVERT);
 	}
 	INT_SET(hdrp->gh_checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
@@ -261,15 +261,15 @@
  * returns BOOL_TRUE if ok, BOOL_FALSE if bad
  */
 bool_t
-global_hdr_checksum_check( global_hdr_t *hdrp )
+global_hdr_checksum_check(global_hdr_t *hdrp)
 {
-	uint32_t *beginp = ( uint32_t * )&hdrp[ 0 ];
-	uint32_t *endp = ( uint32_t * )&hdrp[ 1 ];
+	uint32_t *beginp = (uint32_t *)&hdrp[0];
+	uint32_t *endp = (uint32_t *)&hdrp[1];
 	uint32_t *p;
 	uint32_t accum;
 
 	accum = 0;
-	for ( p = beginp ; p < endp ; p++ ) {
+	for (p = beginp ; p < endp ; p++) {
 		accum += INT_GET(*p, ARCH_CONVERT);
 	}
 	return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
@@ -279,7 +279,7 @@
  * else return BOOL_FALSE
  */
 bool_t
-global_version_check( uint32_t version )
+global_version_check(uint32_t version)
 {
 	switch (version) {
 		case GLOBAL_HDR_VERSION_0:
@@ -304,37 +304,37 @@
 
 /* ARGSUSED */
 static void
-prompt_label_cb( void *uctxp, dlog_pcbp_t pcb, void *pctxp )
+prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
 	/* query: ask for a dump label
 	 */
-	( * pcb )( pctxp,
-		   _("please enter label for this dump session") );
+	(* pcb)(pctxp,
+		   _("please enter label for this dump session"));
 }
 
 static char *
-prompt_label( char *bufp, size_t bufsz )
+prompt_label(char *bufp, size_t bufsz)
 {
 	fold_t fold;
-	char *preamblestr[ PREAMBLEMAX ];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	const ix_t abortix = 1;
 	const ix_t okix = 2;
 	ix_t responseix;
 
 	preamblecnt = 0;
-	fold_init( fold, _("dump label dialog"), '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, _("dump label dialog"), '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
-	responseix = dlog_string_query( prompt_label_cb,
+	responseix = dlog_string_query(prompt_label_cb,
 					0,
 					bufp,
 					bufsz,
@@ -343,30 +343,30 @@
 					IXMAX, /* sigint ix */
 					IXMAX,  /* sighup ix */
 					IXMAX,  /* sigquit ix */
-					okix );   /* ok ix */
+					okix);   /* ok ix */
 	ackcnt = 0;
-	if ( responseix == okix ) {
-		ackstr[ ackcnt++ ] = _("session label entered: \"");
-		ackstr[ ackcnt++ ] = bufp;
-		ackstr[ ackcnt++ ] = "\"\n";
+	if (responseix == okix) {
+		ackstr[ackcnt++ ] = _("session label entered: \"");
+		ackstr[ackcnt++] = bufp;
+		ackstr[ackcnt++ ] = "\"\n";
 	} else {
-		ackstr[ ackcnt++ ] = _("session label left blank\n");
+		ackstr[ackcnt++ ] = _("session label left blank\n");
 	}
 
-	assert( ackcnt <= ACKMAX );
-	dlog_string_ack( ackstr,
-			 ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_string_ack(ackstr,
+			 ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, _("end dialog"), '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, _("end dialog"), '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == okix ) {
+	if (responseix == okix) {
 		return bufp;
 	} else {
 		return 0;
diff --git a/common/global.h b/common/global.h
index 53351a1..141c6db 100644
--- a/common/global.h
+++ b/common/global.h
@@ -41,7 +41,7 @@
 #define GLOBAL_HDR_UUID_SZ	0x10
 
 struct global_hdr {
-	char gh_magic[ GLOBAL_HDR_MAGIC_SZ ];		/*   8    8 */
+	char gh_magic[GLOBAL_HDR_MAGIC_SZ];		/*   8    8 */
 		/* unique signature of xfsdump */
 	uint32_t gh_version;				/*   4    c */
 		/* header version */
@@ -49,55 +49,55 @@
 		/* 32-bit unsigned additive inverse of entire header */
 	time32_t gh_timestamp;				/*   4   14 */
 		/* time32_t of dump */
-	char gh_pad1[ 4 ];				/*   4   18 */
+	char gh_pad1[4];				/*   4   18 */
 		/* alignment */
 	uint64_t gh_ipaddr;				/*   8   20 */
 		/* from gethostid(2), room for expansion */
 	uuid_t gh_dumpid;				/*  10   30 */
 		/* ID of dump session	 */
-	char gh_pad2[ 0xd0 ];				/*  d0  100 */
+	char gh_pad2[0xd0];				/*  d0  100 */
 		/* alignment */
-	char gh_hostname[ GLOBAL_HDR_STRING_SZ ];	/* 100  200 */
+	char gh_hostname[GLOBAL_HDR_STRING_SZ];	/* 100  200 */
 		/* from gethostname(2) */
-	char gh_dumplabel[ GLOBAL_HDR_STRING_SZ ];	/* 100  300 */
+	char gh_dumplabel[GLOBAL_HDR_STRING_SZ];	/* 100  300 */
 		/* label of dump session */
-	char gh_pad3[ 0x100 ];				/* 100  400 */
+	char gh_pad3[0x100];				/* 100  400 */
 		/* padding */
-	char gh_upper[ GLOBAL_HDR_SZ - 0x400 ];		/* c00 1000 */
+	char gh_upper[GLOBAL_HDR_SZ - 0x400];		/* c00 1000 */
 		/* header info private to upper software layers */
 };
 
 typedef struct global_hdr global_hdr_t;
 
 
-/* used by main( ) to allocate and populate a global header template.
+/* used by main() to allocate and populate a global header template.
  * drive managers will copy this into the write header.
  */
-extern global_hdr_t * global_hdr_alloc( int argc, char *argv[ ] );
+extern global_hdr_t * global_hdr_alloc(int argc, char *argv[]);
 
 
-/* used by main( ) to free the global header template after drive ini.
+/* used by main() to free the global header template after drive ini.
  */
-extern void global_hdr_free( global_hdr_t *ghdrp );
+extern void global_hdr_free(global_hdr_t *ghdrp);
 
 
 /* global_hdr_checksum_set - fill in the global media file header checksum.
  * utility function for use by drive-specific strategies.
  */
-extern void global_hdr_checksum_set( global_hdr_t *hdrp );
+extern void global_hdr_checksum_set(global_hdr_t *hdrp);
 
 
 /* global_hdr_checksum_check - check the global media file header checksum.
  * utility function for use by drive-specific strategies.
  * returns BOOL_TRUE if ok, BOOL_FALSE if bad
  */
-extern bool_t global_hdr_checksum_check( global_hdr_t *hdrp );
+extern bool_t global_hdr_checksum_check(global_hdr_t *hdrp);
 
 /* global_version_check - if we know this version number, return BOOL_TRUE
  * else return BOOL_FALSE
  */
 
-extern bool_t global_version_check( uint32_t version );
+extern bool_t global_version_check(uint32_t version);
 
 
 #endif /* GLOBAL_H */
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 7a3584d..24bb924 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -74,12 +74,12 @@
 	u_char	regcnt[2];	/* number of regions in MSB form */
 } XFSattrvalue1_t;
 
-#define	MIN_FORMAT1_ATTR_LEN	( sizeof(XFSattrvalue1_t) + \
-				  sizeof(XFSattrregion_t) )
+#define	MIN_FORMAT1_ATTR_LEN	(sizeof(XFSattrvalue1_t) + \
+				  sizeof(XFSattrregion_t))
 
 /* supported fsys values */
 
-/* XFS DMAPI (w/o MMR ) */
+/* XFS DMAPI (w/o MMR) */
 #define	FSYS_TYPE_XFS		1
 
 /* supported version values */
@@ -111,13 +111,13 @@
  /* Interesting bit combinations within the bs_dmevmask field of xfs_bstat_t:
  * OFL, UNM, and PAR files have exactly these bits set.
  * DUL and MIG files have all but the DM_EVENT_READ bit set */
-#define DMF_EV_BITS	( (1<<DM_EVENT_DESTROY) | \
+#define DMF_EV_BITS	((1<<DM_EVENT_DESTROY) | \
 			  (1<<DM_EVENT_READ)    | \
 			  (1<<DM_EVENT_WRITE)   | \
-			  (1<<DM_EVENT_TRUNCATE) )
+			  (1<<DM_EVENT_TRUNCATE))
 
 /* OFL file's managed region event flags */
-#define DMF_MR_FLAGS	( 0x1 | 0x2 | 0x4 )
+#define DMF_MR_FLAGS	(0x1 | 0x2 | 0x4)
 
 /* The following definitions provide the internal format of the hsm_fs_ctxt_t
    and hsm_f_ctxt_t structures, respectively.
@@ -476,7 +476,7 @@
 	if ((statp->bs_xflags & XFS_XFLAG_HASATTR) == 0) {
 		return 0;	/* no DMF attribute exists */
 	}
-	if ((statp->bs_dmevmask & DMF_EV_BITS) == 0 ) {
+	if ((statp->bs_dmevmask & DMF_EV_BITS) == 0) {
 		return 0;	/* no interesting DMAPI bits set */
 	}
 
@@ -735,8 +735,8 @@
 	if (dmfattr1p->version == DMF_ATTR_FORMAT_1 &&
 	    msb_load(dmfattr1p->sitetag, sizeof(dmfattr1p->sitetag)) != 0) {
 		XFSattrregion_t *reg;
-		reg = (XFSattrregion_t *)( dmf_f_ctxtp->attrval +
-				           sizeof(XFSattrvalue1_t) );
+		reg = (XFSattrregion_t *)(dmf_f_ctxtp->attrval +
+				           sizeof(XFSattrvalue1_t));
 		dmf_f_ctxtp->attrlen = MIN_FORMAT1_ATTR_LEN;
 
 		/* make one offline region the size of the whole file */
@@ -794,7 +794,7 @@
 	 * remove the attribute when the file is completed.
 	 */
 	*hsm_flagp = 0;
-	if ( bstatp->bs_dmevmask && bstatp->bs_xflags & XFS_XFLAG_HASATTR ) {
+	if (bstatp->bs_dmevmask && bstatp->bs_xflags & XFS_XFLAG_HASATTR) {
 		memset(&dmattr, 0, sizeof(XFSattrvalue0_t));
 		dmattr.fsys = FSYS_TYPE_XFS;
 		msb_store(dmattr.state, DMF_ST_NOMIGR, sizeof(dmattr.state));
@@ -871,7 +871,7 @@
 	 */
 	if (*hsm_flagp) {
 		int rv;
-		rv = attr_removef( fd, DMF_ATTR_NAME , ATTR_ROOT );
+		rv = attr_removef(fd, DMF_ATTR_NAME , ATTR_ROOT);
 		if (rv) {
 			mlog(MLOG_NORMAL | MLOG_WARNING,
 			     _("error removing temp DMF attr on %s: %s\n"),
diff --git a/common/inventory.c b/common/inventory.c
index 552f594..9ebe461 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -43,64 +43,64 @@
 /*----------------------------------------------------------------------*/
 
 inv_idbtoken_t
-inv_open( inv_predicate_t bywhat, void *pred )
+inv_open(inv_predicate_t bywhat, void *pred)
 {
 
 	int fd, stobjfd, num;
-	char uuname[ INV_STRLEN ];
+	char uuname[INV_STRLEN];
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
 	invt_sescounter_t *sescnt = 0;
 
 	int index = 0;
 
-	assert ( pred );
-	if ((fd = init_idb ( pred, bywhat, uuname, &tok )) < 0 )
+	assert (pred);
+	if ((fd = init_idb (pred, bywhat, uuname, &tok)) < 0)
 		return tok;
 
 	/* XXX also, see if it is too full. if so, make another and leave a
 	   reference to the new file in the old one */
 
-	stobjfd = get_storageobj( fd, &index );
-	if ( stobjfd < 0 ) {
-		close( fd );
-		close( sesslock_fd );
+	stobjfd = get_storageobj(fd, &index);
+	if (stobjfd < 0) {
+		close(fd);
+		close(sesslock_fd);
 		sesslock_fd = -1;
 		return INV_TOKEN_NULL;
 	}
 
-	assert ( index > 0 );
+	assert (index > 0);
 
 	/* Now we need to make sure that this has enough space */
-	num = GET_SESCOUNTERS( stobjfd, &sescnt );
-	if ( num < 0 ) {
-		close( fd );
-		close( stobjfd );
-		close( sesslock_fd );
+	num = GET_SESCOUNTERS(stobjfd, &sescnt);
+	if (num < 0) {
+		close(fd);
+		close(stobjfd);
+		close(sesslock_fd);
 		sesslock_fd = -1;
 		return INV_TOKEN_NULL;
 	}
-	/* create another storage object ( and, an inv_index entry for it too )
+	/* create another storage object (and, an inv_index entry for it too)
 	   if we've filled this one up */
-	if ( (uint) num >= sescnt->ic_maxnum ) {
+	if ((uint) num >= sescnt->ic_maxnum) {
 #ifdef INVT_DEBUG
-		printf("$ creating a new storage obj & index entry. \n" );
+		printf("$ creating a new storage obj & index entry. \n");
 #endif
 		close (stobjfd);
 
-		stobjfd = create_invindex_entry( &tok, fd, uuname, BOOL_FALSE );
-		free ( sescnt );
-		if ( stobjfd < 0 ) {
-			close( fd );
-			close( sesslock_fd );
+		stobjfd = create_invindex_entry(&tok, fd, uuname, BOOL_FALSE);
+		free (sescnt);
+		if (stobjfd < 0) {
+			close(fd);
+			close(sesslock_fd);
 			sesslock_fd = -1;
 			return INV_TOKEN_NULL;
 		}
 		return tok;
 	}
 
-	free ( sescnt );
-	tok = get_token( fd, stobjfd );
-	tok->d_invindex_off = INVINDEX_HDR_OFFSET( index - 1 );
+	free (sescnt);
+	tok = get_token(fd, stobjfd);
+	tok->d_invindex_off = INVINDEX_HDR_OFFSET(index - 1);
 
 	return tok;
 
@@ -117,12 +117,12 @@
 
 
 bool_t
-inv_close( inv_idbtoken_t tok )
+inv_close(inv_idbtoken_t tok)
 {
-	close ( tok->d_invindex_fd );
-	close ( tok->d_stobj_fd );
-	destroy_token( tok );
-	close( sesslock_fd );
+	close (tok->d_invindex_fd);
+	close (tok->d_stobj_fd);
+	destroy_token(tok);
+	close(sesslock_fd);
 	sesslock_fd = -1;
 
 	return BOOL_TRUE;
@@ -144,15 +144,15 @@
 inv_lasttime_level_lessthan(
 	inv_idbtoken_t  tok,
 	u_char level,
-	time32_t **tm )
+	time32_t **tm)
 {
 	int 	rval;
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
-	rval =  search_invt( tok, level, (void **) tm,
-			 (search_callback_t) tm_level_lessthan );
+	rval =  search_invt(tok, level, (void **) tm,
+			 (search_callback_t) tm_level_lessthan);
 
-	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 }
 
 
@@ -169,15 +169,15 @@
 inv_lastsession_level_lessthan(
 	inv_idbtoken_t 	tok,
 	u_char		level,
-	inv_session_t 	**ses )
+	inv_session_t 	**ses)
 {
 	int 	rval;
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
-	rval = search_invt( tok, level, (void **) ses,
-			  (search_callback_t) lastsess_level_lessthan );
+	rval = search_invt(tok, level, (void **) ses,
+			  (search_callback_t) lastsess_level_lessthan);
 
-	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -196,14 +196,14 @@
 inv_lastsession_level_equalto(
 	inv_idbtoken_t 	tok,
 	u_char		level,
-	inv_session_t	**ses )
+	inv_session_t	**ses)
 {
 	int 	rval;
-	assert ( tok != INV_TOKEN_NULL );
-	rval = search_invt( tok, level, (void **) ses,
-			  (search_callback_t) lastsess_level_equalto );
+	assert (tok != INV_TOKEN_NULL);
+	rval = search_invt(tok, level, (void **) ses,
+			  (search_callback_t) lastsess_level_equalto);
 
-	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -229,7 +229,7 @@
 	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
-	char		*devpath )
+	char		*devpath)
 {
 	invt_session_t *ses;
 	int		fd;
@@ -238,11 +238,11 @@
 	invt_seshdr_t  	hdr;
 	inv_sestoken_t	sestok;
 
-	assert ( tok != INV_TOKEN_NULL );
-	assert ( sesid && fsid && mntpt && devpath );
+	assert (tok != INV_TOKEN_NULL);
+	assert (sesid && fsid && mntpt && devpath);
 
-	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
-		if ( put_fstab_entry( fsid, mntpt, devpath ) < 0 ) {
+	if (! (tok->d_update_flag & FSTAB_UPDATED)) {
+		if (put_fstab_entry(fsid, mntpt, devpath) < 0) {
 			printf ("put_fstab_entry :(\n");
 			return INV_TOKEN_NULL;
 		}
@@ -251,14 +251,14 @@
 
 
 
-	ses = (invt_session_t *) calloc( 1, sizeof( invt_session_t ) );
+	ses = (invt_session_t *) calloc(1, sizeof(invt_session_t));
 
 	/* copy the session information to store */
-	memcpy( &ses->s_sesid, sesid, sizeof( uuid_t ) );
-	memcpy( &ses->s_fsid, fsid, sizeof( uuid_t ) );
-	strcpy( ses->s_label, label );
-	strcpy( ses->s_mountpt, mntpt );
-	strcpy( ses->s_devpath, devpath );
+	memcpy(&ses->s_sesid, sesid, sizeof(uuid_t));
+	memcpy(&ses->s_fsid, fsid, sizeof(uuid_t));
+	strcpy(ses->s_label, label);
+	strcpy(ses->s_mountpt, mntpt);
+	strcpy(ses->s_devpath, devpath);
 	ses->s_max_nstreams = nstreams;
 
 
@@ -266,48 +266,48 @@
 
 	fd = tok->d_stobj_fd;
 
-	assert ( fd > 0 );
+	assert (fd > 0);
 
 	hdr.sh_time = time;
 	hdr.sh_level = level;
 	/* sh_streams_off and sh_sess_off will be set in create_session() */
 
-	sestok = get_sesstoken( tok );
+	sestok = get_sesstoken(tok);
 
 	/* we need to put the new session in the appropriate place in
 	   storage object. So first find out howmany sessions are there */
 
-	INVLOCK( fd, LOCK_EX );
-	if ( GET_SESCOUNTERS( fd, &sescnt) < 0 ) {
-		free ( ses );
-		free ( sestok );
-		INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_EX);
+	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
+		free (ses);
+		free (sestok);
+		INVLOCK(fd, LOCK_UN);
 		return INV_TOKEN_NULL;
 	}
 
 	/* create the writesession, and get ready for the streams to come
 	   afterwards */
-	rval = create_session( sestok, fd, sescnt, ses, &hdr );
+	rval = create_session(sestok, fd, sescnt, ses, &hdr);
 	assert (rval > 0);
 
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
 	sestok->sd_sesstime = time;
 
-	if ( tok->d_update_flag & NEW_INVINDEX ) {
-		if ( put_sesstime( sestok, INVT_STARTTIME ) < 0 ) {
+	if (tok->d_update_flag & NEW_INVINDEX) {
+		if (put_sesstime(sestok, INVT_STARTTIME) < 0) {
 			printf ("put_starttime :(\n");
 			return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag &= ~(NEW_INVINDEX);
 	}
 
-	free ( ses );
-	free ( sescnt );
+	free (ses);
+	free (sescnt);
 
 
-	return ( rval < 0 )? INV_TOKEN_NULL: sestok;
+	return (rval < 0)? INV_TOKEN_NULL: sestok;
 }
 
 
@@ -322,20 +322,20 @@
 
 
 bool_t
-inv_writesession_close( inv_sestoken_t tok )
+inv_writesession_close(inv_sestoken_t tok)
 {
 	int		rval;
 
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
 	/* now update end_time in the inv index header */
-	rval = put_sesstime( tok, INVT_ENDTIME );
+	rval = put_sesstime(tok, INVT_ENDTIME);
 
-	memset( tok, 0, sizeof( invt_sesdesc_entry_t ) );
+	memset(tok, 0, sizeof(invt_sesdesc_entry_t));
 
-	free ( tok );
+	free (tok);
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -348,7 +348,7 @@
 /*----------------------------------------------------------------------*/
 inv_stmtoken_t
 inv_stream_open(
-	inv_sestoken_t tok )
+	inv_sestoken_t tok)
 {
 	inv_stmtoken_t stok;
 	invt_stream_t  stream;
@@ -356,14 +356,14 @@
 	invt_seshdr_t  seshdr;
 	int fd;
 
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_FALSE;
 
 
 	/* XXX yukk... make the token descriptors not pointers */
-	stok = ( inv_stmtoken_t ) malloc( sizeof( invt_strdesc_entry_t ) );
+	stok = (inv_stmtoken_t) malloc(sizeof(invt_strdesc_entry_t));
 
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
@@ -373,12 +373,12 @@
 
 	sess_lock();
 
-	INVLOCK( fd, LOCK_SH );
+	INVLOCK(fd, LOCK_SH);
 	/* get the session header first */
-	if ( GET_REC_NOLOCK( fd, &seshdr, sizeof( invt_seshdr_t ),
-			     tok->sd_sesshdr_off ) <= 0 ) {
-		free ( stok );
-		INVLOCK( fd, LOCK_UN );
+	if (GET_REC_NOLOCK(fd, &seshdr, sizeof(invt_seshdr_t),
+			     tok->sd_sesshdr_off) <= 0) {
+		free (stok);
+		INVLOCK(fd, LOCK_UN);
 		sess_unlock();
 		return INV_TOKEN_NULL;
 	}
@@ -386,33 +386,33 @@
 
 
 	/* XXX Have one func that gives both seshdr and session */
-	if ( GET_REC_NOLOCK( fd, &ses, sizeof( invt_session_t ),
-			     tok->sd_session_off ) <= 0 ) {
-		free ( stok );
-		INVLOCK( fd, LOCK_UN );
+	if (GET_REC_NOLOCK(fd, &ses, sizeof(invt_session_t),
+			     tok->sd_session_off) <= 0) {
+		free (stok);
+		INVLOCK(fd, LOCK_UN);
 		sess_unlock();
 		return INV_TOKEN_NULL;
 	}
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
-	if ( ses.s_cur_nstreams < ses.s_max_nstreams ) {
+	if (ses.s_cur_nstreams < ses.s_max_nstreams) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) *
-					         ses.s_cur_nstreams )
+		stok->md_stream_off = (off64_t) (sizeof(invt_stream_t) *
+					         ses.s_cur_nstreams)
 			                         + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
 
 		/* write it back. this locks and unlocks fd EXclusively */
-		if ( PUT_REC( fd, &ses, sizeof( ses ),
-			      tok->sd_session_off ) < 0 ) {
-			free ( stok );
+		if (PUT_REC(fd, &ses, sizeof(ses),
+			      tok->sd_session_off) < 0) {
+			free (stok);
 			sess_unlock();
 			return INV_TOKEN_NULL;
 		}
 	} else {
 		fprintf(stderr, "Cant create more than %d streams. Max'd out..\n",
-			ses.s_cur_nstreams );
-		free ( stok );
+			ses.s_cur_nstreams);
+		free (stok);
 		sess_unlock();
 		return INV_TOKEN_NULL;
 	}
@@ -421,9 +421,9 @@
 	stream.st_firstmfile = stream.st_lastmfile = stok->md_stream_off;
 
 	/* now put the stream header on to the disk */
-	if ( PUT_REC( fd, &stream, sizeof( invt_stream_t ),
-		      stok->md_stream_off ) < 0 ) {
-		free ( stok );
+	if (PUT_REC(fd, &stream, sizeof(invt_stream_t),
+		      stok->md_stream_off) < 0) {
+		free (stok);
 		return INV_TOKEN_NULL;
 	}
 
@@ -442,27 +442,27 @@
 bool_t
 inv_stream_close(
 		inv_stmtoken_t	tok,
-		bool_t wasinterrupted )
+		bool_t wasinterrupted)
 {
 	invt_stream_t strm;
 	int fd = tok->md_sesstok->sd_invtok->d_stobj_fd;
 	int rval;
 	bool_t dowrite = BOOL_FALSE;
 
-	INVLOCK( fd, LOCK_EX );
-	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ),
-			       tok->md_stream_off )) < 0 )
+	INVLOCK(fd, LOCK_EX);
+	if ((rval = GET_REC_NOLOCK(fd, &strm, sizeof(invt_stream_t),
+			       tok->md_stream_off)) < 0)
 		goto end;   /* eek :-)   */
 
-	if ( strm.st_interrupted != wasinterrupted ) {
+	if (strm.st_interrupted != wasinterrupted) {
 		strm.st_interrupted = wasinterrupted;
 		dowrite = BOOL_TRUE;
 	}
 
 	/* get the last media file to figure out what our last ino was.
 	   we have a pointer to that in the stream token */
-	if ( tok->md_lastmfile ){
-		if ( strm.st_endino.ino != tok->md_lastmfile->mf_endino.ino ||
+	if (tok->md_lastmfile){
+		if (strm.st_endino.ino != tok->md_lastmfile->mf_endino.ino ||
 		     strm.st_endino.offset != tok->md_lastmfile->mf_endino.offset){
 			printf("Warning: endinos dont match ! \n");
 			dowrite = BOOL_TRUE;
@@ -475,13 +475,13 @@
 				      tok->md_stream_off);
 	}
  end:
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
-	free ( tok->md_lastmfile );
-	memset( tok, 0, sizeof( invt_strdesc_entry_t ) );
-	free ( tok );
+	free (tok->md_lastmfile);
+	memset(tok, 0, sizeof(invt_strdesc_entry_t));
+	free (tok);
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 }
 
 
@@ -501,36 +501,36 @@
 	xfs_ino_t	startino,
 	off64_t		startino_offset,
 	xfs_ino_t	endino,
-	off64_t		endino_offset )
+	off64_t		endino_offset)
 {
 	invt_mediafile_t *mf;
 	int 		 rval;
 
 
-	assert ( tok != INV_TOKEN_NULL );
-	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
-	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
+	assert (tok != INV_TOKEN_NULL);
+	assert (tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
+	assert (tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
 
-	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
+	mf = (invt_mediafile_t *) calloc(1, sizeof(invt_mediafile_t));
 
 	/* copy the media file information */
-	memcpy( &mf->mf_moid, moid, sizeof( uuid_t ) );
-	strcpy( mf->mf_label, label );
+	memcpy(&mf->mf_moid, moid, sizeof(uuid_t));
+	strcpy(mf->mf_label, label);
 	mf->mf_startino.ino = startino;
 	mf->mf_startino.offset = startino_offset;
 	mf->mf_endino.ino = endino;
 	mf->mf_endino.offset = endino_offset;
 
-	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX );
-	rval = put_mediafile( tok, mf );
-	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN );
+	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX);
+	rval = put_mediafile(tok, mf);
+	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN);
 
 	/* we dont free the mfile here. we always keep the last mfile
 	   around, inside the inv_stmtoken, and when we add a new mfile,
 	   we free the previous one. The last one is freed in stream_close()
 	   */
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -543,14 +543,14 @@
 /* that the client (dump) knows that these shouldn't be dumped alongwith*/
 /* regular files.                                                       */
 /*                                                                      */
-/* foreach ( fs in fstab )                                              */
-/* 	foreach ( index in InvIndex )                                 */
+/* foreach (fs in fstab)                                              */
+/* 	foreach (index in InvIndex)                                 */
 /*          get                                                         */
 /*----------------------------------------------------------------------*/
 
 int
 inv_get_inolist(
-	inv_inolist_t 	**inolist )
+	inv_inolist_t 	**inolist)
 {
 	invt_entry_t	*iarr = NULL;
 	invt_counter_t	*icnt = NULL;
@@ -560,47 +560,47 @@
 
 #ifdef NOTDEF
 	*inolist = NULL;
-	curitem = malloc( sizeof( inv_inolist_t ) );
+	curitem = malloc(sizeof(inv_inolist_t));
 
 	/* get the array of all indices in the invindex */
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
-	free( icnt );
+	free(icnt);
 
 	/* attach all the StObjs */
 	for (i = nindices - 1; i >= 0; i--) {
-		if ( stat64( iarr[i].ie_filename, &statbuf ) < 0 ) {
-			perror( iarr[i].ie_filename );
+		if (stat64(iarr[i].ie_filename, &statbuf) < 0) {
+			perror(iarr[i].ie_filename);
 			return -1;
 		}
 
-		create_inolist_item( curitem, statbuf.st_ino );
+		create_inolist_item(curitem, statbuf.st_ino);
 	}
 	/* The inventory index */
-	if ( fstat64( invfd, &statbuf ) ){
-		perror( "InvIndex file" );
+	if (fstat64(invfd, &statbuf)){
+		perror("InvIndex file");
 		return -1;
 	}
-	create_inolist_item( curitem, statbuf.st_ino );
+	create_inolist_item(curitem, statbuf.st_ino);
 
 	/* fstab */
-	if ( stat64( INV_FSTAB, &statbuf ) < 0 ) {
-			perror( INV_FSTAB );
+	if (stat64(INV_FSTAB, &statbuf) < 0) {
+			perror(INV_FSTAB);
 			return -1;
 		}
-	create_inolist_item( curitem, statbuf.st_ino );
+	create_inolist_item(curitem, statbuf.st_ino);
 
 	/* sesslock file */
-	if ( stat64( SESSLOCK_FILE, &statbuf ) < 0 ) {
-			perror( SESSLOCK_FILE );
+	if (stat64(SESSLOCK_FILE, &statbuf) < 0) {
+			perror(SESSLOCK_FILE);
 			return -1;
 		}
-	create_inolist_item( curitem, statbuf.st_ino );
+	create_inolist_item(curitem, statbuf.st_ino);
 #endif
 
 	return 1;
@@ -627,10 +627,10 @@
 inv_get_session(
 	inv_sestoken_t		tok,
 	void		      **bufpp,	/* buf to fill */
-	size_t		       *bufszp )/* size of that buffer */
+	size_t		       *bufszp)/* size of that buffer */
 {
-	assert( tok != INV_TOKEN_NULL );
-	assert( tok->sd_invtok );
+	assert(tok != INV_TOKEN_NULL);
+	assert(tok->sd_invtok);
 
 	/* First get the session header, and the session information. Then
 	   we can figure out how much space to allocate */
@@ -646,13 +646,13 @@
 bool_t
 inv_DEBUG_printallsessions(
 	inv_idbtoken_t 	tok,
-	inv_session_t	**ses )
+	inv_session_t	**ses)
 {
 	int 	rval;
-	rval = search_invt( tok, 0, (void **) ses,
-			  (search_callback_t) DEBUG_displayallsessions );
+	rval = search_invt(tok, 0, (void **) ses,
+			  (search_callback_t) DEBUG_displayallsessions);
 
-	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
diff --git a/common/inventory.h b/common/inventory.h
index d5c182a..599fc25 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -144,12 +144,12 @@
 extern inv_idbtoken_t
 inv_open(
 	 inv_predicate_t bywhat, /* BY_UUID, BY_MOUNTPT, BY_DEVPATH */
-	 void 		 *pred );/* uuid_t *,char * mntpt, or char *dev */
+	 void 		 *pred);/* uuid_t *,char * mntpt, or char *dev */
 
 
 extern bool_t
 inv_close(
-	inv_idbtoken_t tok );
+	inv_idbtoken_t tok);
 
 
 extern inv_sestoken_t
@@ -162,20 +162,20 @@
 	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
-	char		*devpath );
+	char		*devpath);
 
 extern bool_t
 inv_writesession_close(
-	inv_sestoken_t  tok );
+	inv_sestoken_t  tok);
 
 extern inv_stmtoken_t
 inv_stream_open(
-	inv_sestoken_t 	tok );
+	inv_sestoken_t 	tok);
 
 extern bool_t
 inv_stream_close(
 	inv_stmtoken_t	tok,
-	bool_t 		wasinterrupted );
+	bool_t 		wasinterrupted);
 
 extern bool_t
 inv_put_mediafile(
@@ -185,7 +185,7 @@
 	xfs_ino_t	startino,
 	off64_t		startino_offset,
 	xfs_ino_t	endino,
-	off64_t		endino_offset );
+	off64_t		endino_offset);
 
 /* lasttime_level_lessthan - finds the time of the last dump of the
  * specified file system at a level less than the specified level.
@@ -196,58 +196,58 @@
 inv_lasttime_level_lessthan(
 	inv_idbtoken_t 		tok,
 	u_char  		level,
-	time32_t		**time );/* out */
+	time32_t		**time);/* out */
 
 extern bool_t
 inv_lastsession_level_lessthan(
 	inv_idbtoken_t 		tok,
 	u_char  		level,
-	inv_session_t		**ses );/* out */
+	inv_session_t		**ses);/* out */
 
 extern bool_t
 inv_lastsession_level_equalto(
 	inv_idbtoken_t 		tok,
 	u_char  		level,
-	inv_session_t		**ses );/* out */
+	inv_session_t		**ses);/* out */
 
 extern bool_t
 inv_get_inolist(
-	inv_inolist_t 		**inolist );
+	inv_inolist_t 		**inolist);
 
 /* For dumping the inventory once a dump is done. */
 extern bool_t
 inv_get_session(
 	inv_sestoken_t		tok,
 	void		      **bufpp,		/* out */
-	size_t		       *bufszp );	/* out */
+	size_t		       *bufszp);	/* out */
 
 /* To reconstruct a compelete inventory from dumped inventories */
 extern bool_t
 inv_put_session(
 	inv_idbtoken_t		tok,
 	void		       *bufp,
-	size_t		        bufsz );
+	size_t		        bufsz);
 
 #ifdef DEBUG
 
 bool_t
 inv_DEBUG_printallsessions(
 	inv_idbtoken_t 	tok,
-	inv_session_t	**ses );
+	inv_session_t	**ses);
 
 #endif /* ifdef DEBUG */
 
 extern int
-inv_setup_base( void );
+inv_setup_base(void);
 
 extern char *
-inv_dirpath( void );
+inv_dirpath(void);
 
 extern char *
-inv_fstab( void );
+inv_fstab(void);
 
 extern char *
-inv_lockfile( void );
+inv_lockfile(void);
 
 
 #endif /* INVENTORY_H */
diff --git a/common/lock.c b/common/lock.c
index 9826581..216d202 100644
--- a/common/lock.c
+++ b/common/lock.c
@@ -27,27 +27,27 @@
 static qlockh_t lock_qlockh = QLOCKH_NULL;
 
 bool_t
-lock_init( void )
+lock_init(void)
 {
 	/* initialization sanity checks
 	 */
-	assert( lock_qlockh == QLOCKH_NULL );
+	assert(lock_qlockh == QLOCKH_NULL);
 
 	/* allocate a qlock
 	 */
-	lock_qlockh = qlock_alloc( QLOCK_ORD_CRIT );
+	lock_qlockh = qlock_alloc(QLOCK_ORD_CRIT);
 
 	return BOOL_TRUE;
 }
 
 void
-lock( void )
+lock(void)
 {
-	qlock_lock( lock_qlockh );
+	qlock_lock(lock_qlockh);
 }
 
 void
-unlock( void )
+unlock(void)
 {
-	qlock_unlock( lock_qlockh );
+	qlock_unlock(lock_qlockh);
 }
diff --git a/common/lock.h b/common/lock.h
index 1dab2ae..97460bb 100644
--- a/common/lock.h
+++ b/common/lock.h
@@ -18,10 +18,10 @@
 #ifndef LOCK_H
 #define LOCK_H
 
-extern bool_t lock_init( void );
+extern bool_t lock_init(void);
 
-extern void lock( void );
+extern void lock(void);
 
-extern void unlock( void );
+extern void unlock(void);
 
 #endif /* LOCK_H */
diff --git a/common/main.c b/common/main.c
index 0c23eb4..1edfae4 100644
--- a/common/main.c
+++ b/common/main.c
@@ -84,27 +84,27 @@
 
 /* forward declarations of locally defined global functions ******************/
 
-void usage( void );
-bool_t preemptchk( int );
+void usage(void);
+bool_t preemptchk(int);
 
 
 /* forward declarations of locally defined static functions ******************/
 
-static bool_t loadoptfile( int *argcp, char ***argvp );
-static char * stripquotes( char *p );
-static void shiftleftby1( char *p, char *endp );
-static void sighandler( int );
-static int childmain( void * );
-static bool_t sigint_dialog( void );
-static char *sigintstr( void );
+static bool_t loadoptfile(int *argcp, char ***argvp);
+static char * stripquotes(char *p);
+static void shiftleftby1(char *p, char *endp);
+static void sighandler(int);
+static int childmain(void *);
+static bool_t sigint_dialog(void);
+static char *sigintstr(void);
 #ifdef DUMP
-static bool_t set_rlimits( void );
+static bool_t set_rlimits(void);
 #endif /* DUMP */
 #ifdef RESTORE
-static bool_t set_rlimits( size64_t * );
+static bool_t set_rlimits(size64_t *);
 #endif /* RESTORE */
-static char *sig_numstring( int num );
-static char *strpbrkquotes( char *p, const char *sep );
+static char *sig_numstring(int num);
+static char *strpbrkquotes(char *p, const char *sep);
 
 
 /* definition of locally defined global variables ****************************/
@@ -143,7 +143,7 @@
 
 
 int
-main( int argc, char *argv[] )
+main(int argc, char *argv[])
 {
 	int c;
 #ifdef DUMP
@@ -168,18 +168,18 @@
 
 	/* sanity checks
 	 */
-	assert( sizeof( char_t ) == 1 );
-	assert( sizeof( u_char_t ) == 1 );
-	assert( sizeof( int32_t ) == 4 );
-	assert( sizeof( uint32_t ) == 4 );
-	assert( sizeof( size32_t ) == 4 );
-	assert( sizeof( int64_t ) == 8 );
-	assert( sizeof( uint64_t ) == 8 );
-	assert( sizeof( size64_t ) == 8 );
+	assert(sizeof(char_t) == 1);
+	assert(sizeof(u_char_t) == 1);
+	assert(sizeof(int32_t) == 4);
+	assert(sizeof(uint32_t) == 4);
+	assert(sizeof(size32_t) == 4);
+	assert(sizeof(int64_t) == 8);
+	assert(sizeof(uint64_t) == 8);
+	assert(sizeof(size64_t) == 8);
 
 	/* record the command name used to invoke
 	 */
-	progname = argv[ 0 ];
+	progname = argv[0];
 
 	/* setup I18N support */
 	setlocale(LC_ALL, "");
@@ -193,22 +193,22 @@
 	/* Get the parent's pthread id. will be used
 	 * to differentiate parent from children.
 	 */
-	parenttid = pthread_self( );
+	parenttid = pthread_self();
 	rval = atexit(mlog_exit_flush);
 	assert(rval == 0);
 
 	/* pre-scan the command line for the option file option.
 	 * if found, create a new argv.
 	 */
-	ok = loadoptfile( &argc, &argv );
-	if ( ! ok ) {
+	ok = loadoptfile(&argc, &argv);
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_OPT);
 	}
 
 	/* initialize message logging (stage 1)
 	 */
-	ok = mlog_init1( argc, argv );
-	if ( ! ok ) {
+	ok = mlog_init1(argc, argv);
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 	/* scan the command line for the info, progress
@@ -220,48 +220,48 @@
 	progrpt_enabledpr = BOOL_FALSE;
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
                 case GETOPT_MINSTACKSZ:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return mlog_exit(EXIT_ERROR, RV_OPT);
 			}
 			errno = 0;
-			tmpstacksz = strtoull( optarg, 0, 0 );
-			if ( tmpstacksz == UINT64_MAX
+			tmpstacksz = strtoull(optarg, 0, 0);
+			if (tmpstacksz == UINT64_MAX
 			     ||
-			     errno == ERANGE ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			     errno == ERANGE) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c argument (%s) invalid\n"),
 				      c,
-				      optarg );
-				usage( );
+				      optarg);
+				usage();
 				return mlog_exit(EXIT_ERROR, RV_OPT);
 			}
 			minstacksz = tmpstacksz;
 			break;
                 case GETOPT_MAXSTACKSZ:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return mlog_exit(EXIT_ERROR, RV_OPT);
 			}
 			errno = 0;
-			tmpstacksz = strtoull( optarg, 0, 0 );
-			if ( tmpstacksz == UINT64_MAX
+			tmpstacksz = strtoull(optarg, 0, 0);
+			if (tmpstacksz == UINT64_MAX
 			     ||
-			     errno == ERANGE ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			     errno == ERANGE) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c argument (%s) invalid\n"),
 				      c,
-				      optarg );
-				usage( );
+				      optarg);
+				usage();
 				return mlog_exit(EXIT_ERROR, RV_OPT);
 			}
 			maxstacksz = tmpstacksz;
@@ -271,15 +271,15 @@
 			mlog_exit_hint(RV_USAGE);
 			break;
 		case GETOPT_PROGRESS:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return mlog_exit(EXIT_ERROR, RV_OPT);
 			}
-			progrpt_interval = ( time32_t )atoi( optarg );
-			if ( progrpt_interval > 0 ) {
+			progrpt_interval = (time32_t)atoi(optarg);
+			if (progrpt_interval > 0) {
 				progrpt_enabledpr = BOOL_TRUE;
 			} else {
 				progrpt_enabledpr = BOOL_FALSE;
@@ -290,8 +290,8 @@
 
 	/* sanity check resultant stack size limits
 	 */
-	if ( minstacksz > maxstacksz ) {
-		mlog( MLOG_NORMAL
+	if (minstacksz > maxstacksz) {
+		mlog(MLOG_NORMAL
 		      |
 		      MLOG_ERROR
 		      |
@@ -301,29 +301,29 @@
 		      _("specified minimum stack size is larger than maximum: "
 		      "min is 0x%llx,  max is 0x%llx\n"),
 		      minstacksz,
-		      maxstacksz );
+		      maxstacksz);
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
-	if ( argc == 1 ) {
+	if (argc == 1) {
 		infoonly = BOOL_TRUE;
 	}
 
 	/* set a progress report deadline to allow preemptchk() to
 	 * report
 	 */
-	if ( progrpt_enabledpr ) {
-		progrpt_deadline = time( 0 ) + progrpt_interval;
+	if (progrpt_enabledpr) {
+		progrpt_deadline = time(0) + progrpt_interval;
 	}
 
 	/* intitialize the stream manager
 	 */
-	stream_init( );
+	stream_init();
 
 #ifdef DUMP
 	/* set the memory limits to their appropriate values.
 	 */
-	ok = set_rlimits( );
+	ok = set_rlimits();
 #endif /* DUMP */
 #ifdef RESTORE
 	/* set the memory limits to their appropriate values. this is necessary
@@ -331,89 +331,89 @@
 	 * also determines maximum vm, which will be budgeted among the
 	 * various abstractions.
 	 */
-	ok = set_rlimits( &vmsz );
+	ok = set_rlimits(&vmsz);
 #endif /* RESTORE */
-	if ( ! ok ) {
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
 	/* initialize message logging (stage 2) - allocate the message lock
 	 */
-	ok = mlog_init2( );
-	if ( ! ok ) {
+	ok = mlog_init2();
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
 	/* initialize the critical region lock
 	 */
-	lock_init( );
+	lock_init();
 	rmt_turnonmsgs(1); /* turn on WARNING msgs for librmt */
 
-	mlog( MLOG_NITTY + 1, "INTGENMAX == %ld (0x%lx)\n", INTGENMAX, INTGENMAX );
-	mlog( MLOG_NITTY + 1, "UINTGENMAX == %lu (0x%lx)\n", UINTGENMAX, UINTGENMAX );
-	mlog( MLOG_NITTY + 1, "OFF64MAX == %lld (0x%llx)\n", OFF64MAX, OFF64MAX );
-	mlog( MLOG_NITTY + 1, "OFFMAX == %ld (0x%lx)\n", OFFMAX, OFFMAX );
-	mlog( MLOG_NITTY + 1, "SIZEMAX == %lu (0x%lx)\n", SIZEMAX, SIZEMAX );
-	mlog( MLOG_NITTY + 1, "INOMAX == %lu (0x%lx)\n", INOMAX, INOMAX );
-	mlog( MLOG_NITTY + 1, "TIMEMAX == %ld (0x%lx)\n", TIMEMAX, TIMEMAX );
-	mlog( MLOG_NITTY + 1, "SIZE64MAX == %llu (0x%llx)\n", SIZE64MAX, SIZE64MAX );
-	mlog( MLOG_NITTY + 1, "INO64MAX == %llu (0x%llx)\n", INO64MAX, INO64MAX );
-	mlog( MLOG_NITTY + 1, "UINT64MAX == %llu (0x%llx)\n", UINT64MAX, UINT64MAX );
-	mlog( MLOG_NITTY + 1, "INT64MAX == %lld (0x%llx)\n", INT64MAX, INT64MAX );
-	mlog( MLOG_NITTY + 1, "UINT32MAX == %u (0x%x)\n", UINT32MAX, UINT32MAX );
-	mlog( MLOG_NITTY + 1, "INT32MAX == %d (0x%x)\n", INT32MAX, INT32MAX );
-	mlog( MLOG_NITTY + 1, "INT16MAX == %d (0x%x)\n", INT16MAX, INT16MAX );
-	mlog( MLOG_NITTY + 1, "UINT16MAX == %u (0x%x)\n", UINT16MAX, UINT16MAX );
+	mlog(MLOG_NITTY + 1, "INTGENMAX == %ld (0x%lx)\n", INTGENMAX, INTGENMAX);
+	mlog(MLOG_NITTY + 1, "UINTGENMAX == %lu (0x%lx)\n", UINTGENMAX, UINTGENMAX);
+	mlog(MLOG_NITTY + 1, "OFF64MAX == %lld (0x%llx)\n", OFF64MAX, OFF64MAX);
+	mlog(MLOG_NITTY + 1, "OFFMAX == %ld (0x%lx)\n", OFFMAX, OFFMAX);
+	mlog(MLOG_NITTY + 1, "SIZEMAX == %lu (0x%lx)\n", SIZEMAX, SIZEMAX);
+	mlog(MLOG_NITTY + 1, "INOMAX == %lu (0x%lx)\n", INOMAX, INOMAX);
+	mlog(MLOG_NITTY + 1, "TIMEMAX == %ld (0x%lx)\n", TIMEMAX, TIMEMAX);
+	mlog(MLOG_NITTY + 1, "SIZE64MAX == %llu (0x%llx)\n", SIZE64MAX, SIZE64MAX);
+	mlog(MLOG_NITTY + 1, "INO64MAX == %llu (0x%llx)\n", INO64MAX, INO64MAX);
+	mlog(MLOG_NITTY + 1, "UINT64MAX == %llu (0x%llx)\n", UINT64MAX, UINT64MAX);
+	mlog(MLOG_NITTY + 1, "INT64MAX == %lld (0x%llx)\n", INT64MAX, INT64MAX);
+	mlog(MLOG_NITTY + 1, "UINT32MAX == %u (0x%x)\n", UINT32MAX, UINT32MAX);
+	mlog(MLOG_NITTY + 1, "INT32MAX == %d (0x%x)\n", INT32MAX, INT32MAX);
+	mlog(MLOG_NITTY + 1, "INT16MAX == %d (0x%x)\n", INT16MAX, INT16MAX);
+	mlog(MLOG_NITTY + 1, "UINT16MAX == %u (0x%x)\n", UINT16MAX, UINT16MAX);
 
 	/* ask the system for the true vm page size, which must be used
 	 * in all mmap calls
 	 */
-	pgsz = ( size_t )getpagesize( );
-	mlog( MLOG_DEBUG | MLOG_PROC,
+	pgsz = (size_t)getpagesize();
+	mlog(MLOG_DEBUG | MLOG_PROC,
 	      "getpagesize( ) returns %u\n",
-	      pgsz );
-	assert( ( int )pgsz > 0 );
+	      pgsz);
+	assert((int)pgsz > 0);
 	pgmask = pgsz - 1;
 
 	/* report parent tid
          */
-	mlog( MLOG_DEBUG | MLOG_PROC,
+	mlog(MLOG_DEBUG | MLOG_PROC,
 	      "parent tid is %lu\n",
-	      parenttid );
+	      parenttid);
 
 	/* get the current working directory: this is where we will dump
 	 * core, if necessary. some tmp files may be placed here as well.
 	 */
-	homedir = getcwd( 0, MAXPATHLEN );
-	if ( ! homedir ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
+	homedir = getcwd(0, MAXPATHLEN);
+	if (! homedir) {
+		mlog(MLOG_NORMAL | MLOG_ERROR,
 		      _("unable to determine current directory: %s\n"),
-		      strerror( errno ));
+		      strerror(errno));
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
 	/* sanity check the inventory database directory, setup global paths
 	 */
-	ok = inv_setup_base( );
-	if ( ! ok ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+	ok = inv_setup_base();
+	if (! ok) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 		      _("both /var/lib/xfsdump and /var/xfsdump exist - fatal\n"));
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
 	/* if just looking for info, oblige
 	 */
-	if ( infoonly ) {
-		mlog( MLOG_NORMAL,
+	if (infoonly) {
+		mlog(MLOG_NORMAL,
 		      _("version %s (dump format %d.0)\n"),
-		      VERSION, GLOBAL_HDR_VERSION );
-		usage( );
+		      VERSION, GLOBAL_HDR_VERSION);
+		usage();
 		return mlog_exit(EXIT_NORMAL, RV_OK); /* normal termination */
 	}
 
 	/* if an inventory display is requested, do it and exit
 	 */
-	if ( ! inv_DEBUG_print( argc, argv )) {
+	if (! inv_DEBUG_print(argc, argv)) {
 		return mlog_exit(EXIT_NORMAL, RV_OK); /* normal termination */
 	}
 
@@ -422,28 +422,28 @@
 	 * this must appear after inv_DEBUG_print(),
 	 * so it may be done without root privilege.
 	 */
-	euid = geteuid( );
-	mlog( MLOG_DEBUG | MLOG_PROC,
+	euid = geteuid();
+	mlog(MLOG_DEBUG | MLOG_PROC,
 	      "effective user id is %d\n",
-	      euid );
-	if ( euid != 0 ) {
-		mlog( MLOG_NORMAL,
-		      _("effective user ID must be root\n") );
+	      euid);
+	if (euid != 0) {
+		mlog(MLOG_NORMAL,
+		      _("effective user ID must be root\n"));
 		return mlog_exit(EXIT_ERROR, RV_PERM);
 	}
 #endif /* DUMP */
 
 	/* initialize operator dialog capability
 	 */
-	ok = dlog_init( argc, argv );
-	if ( ! ok ) {
+	ok = dlog_init(argc, argv);
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
 	/* initialize the child process manager
 	 */
-	ok = cldmgr_init( );
-	if ( ! ok ) {
+	ok = cldmgr_init();
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
@@ -452,8 +452,8 @@
 	 * terribly time-consuming here. A second initialization pass
 	 * will be done shortly.
 	 */
-	ok = drive_init1( argc, argv );
-	if ( ! ok ) {
+	ok = drive_init1(argc, argv);
+	if (! ok) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 
@@ -461,40 +461,40 @@
 	 * if not, check stdout anyway, in case someone is trying to pipe
 	 * the log messages into more, tee, ...
 	 */
-	if ( drivepp[ 0 ]->d_isunnamedpipepr ) {
-		mlog( MLOG_DEBUG | MLOG_NOTE,
-		      "pipeline detected\n" );
+	if (drivepp[0]->d_isunnamedpipepr) {
+		mlog(MLOG_DEBUG | MLOG_NOTE,
+		      "pipeline detected\n");
 		pipeline = BOOL_TRUE;
 	} else {
 		struct stat64 statbuf;
-		if ( fstat64( 1, &statbuf ) == 0
+		if (fstat64(1, &statbuf) == 0
 		     &&
-		     ( statbuf.st_mode & S_IFMT ) == S_IFIFO ) {
+		     (statbuf.st_mode & S_IFMT) == S_IFIFO) {
 			stdoutpiped = BOOL_TRUE;
 		}
 	}
 
 	/* announce version and instructions
 	 */
-	sistr = sigintstr( );
-	mlog( MLOG_VERBOSE,
+	sistr = sigintstr();
+	mlog(MLOG_VERBOSE,
 	      _("version %s (dump format %d.0)"),
-	      VERSION, GLOBAL_HDR_VERSION );
-	if ( ! pipeline && ! stdoutpiped && sistr && dlog_allowed( )) {
-		mlog( MLOG_VERBOSE | MLOG_BARE, _(
+	      VERSION, GLOBAL_HDR_VERSION);
+	if (! pipeline && ! stdoutpiped && sistr && dlog_allowed()) {
+		mlog(MLOG_VERBOSE | MLOG_BARE, _(
 		      " - "
 		      "type %s for status and control\n"),
-		      sistr );
+		      sistr);
 	} else {
-		mlog( MLOG_VERBOSE | MLOG_BARE,
-		      "\n" );
+		mlog(MLOG_VERBOSE | MLOG_BARE,
+		      "\n");
 	}
 
 #ifdef DUMP
 	/* build a global write header template
 	 */
-	gwhdrtemplatep = global_hdr_alloc( argc, argv );
-	if ( ! gwhdrtemplatep ) {
+	gwhdrtemplatep = global_hdr_alloc(argc, argv);
+	if (! gwhdrtemplatep) {
 		return mlog_exit(EXIT_ERROR, RV_INIT);
 	}
 #endif /* DUMP */
@@ -502,7 +502,7 @@
 	/* tell mlog how many streams there are. the format of log messages
 	 * depends on whether there are one or many.
 	 */
-	mlog_tell_streamcnt( drivecnt );
+	mlog_tell_streamcnt(drivecnt);
 
 	/* initialize the state of signal processing. if in a pipeline, just
 	 * want to exit when a signal is received. otherwise, hold signals so
@@ -524,9 +524,9 @@
 	 * of normal sys call error handling.
 	 */
 	sa.sa_handler = SIG_IGN;
-	sigaction( SIGPIPE, &sa, NULL );
+	sigaction(SIGPIPE, &sa, NULL);
 
-	if ( ! pipeline ) {
+	if (! pipeline) {
 		sigset_t blocked_set;
 
 		stop_in_progress = BOOL_FALSE;
@@ -537,80 +537,80 @@
 		sigquit_received = BOOL_FALSE;
 		sigstray_received = BOOL_FALSE;
 
-		alarm( 0 );
+		alarm(0);
 
-		sigemptyset( &blocked_set );
-		sigaddset( &blocked_set, SIGINT );
-		sigaddset( &blocked_set, SIGHUP );
-		sigaddset( &blocked_set, SIGTERM );
-		sigaddset( &blocked_set, SIGQUIT );
-		sigaddset( &blocked_set, SIGALRM );
-		sigaddset( &blocked_set, SIGUSR1 );
-		pthread_sigmask( SIG_SETMASK, &blocked_set, NULL );
+		sigemptyset(&blocked_set);
+		sigaddset(&blocked_set, SIGINT);
+		sigaddset(&blocked_set, SIGHUP);
+		sigaddset(&blocked_set, SIGTERM);
+		sigaddset(&blocked_set, SIGQUIT);
+		sigaddset(&blocked_set, SIGALRM);
+		sigaddset(&blocked_set, SIGUSR1);
+		pthread_sigmask(SIG_SETMASK, &blocked_set, NULL);
 
 		sa.sa_handler = sighandler;
-		sigaction( SIGINT, &sa, NULL );
-		sigaction( SIGHUP, &sa, NULL );
-		sigaction( SIGTERM, &sa, NULL );
-		sigaction( SIGQUIT, &sa, NULL );
-		sigaction( SIGALRM, &sa, NULL );
-		sigaction( SIGUSR1, &sa, NULL );
+		sigaction(SIGINT, &sa, NULL);
+		sigaction(SIGHUP, &sa, NULL);
+		sigaction(SIGTERM, &sa, NULL);
+		sigaction(SIGQUIT, &sa, NULL);
+		sigaction(SIGALRM, &sa, NULL);
+		sigaction(SIGUSR1, &sa, NULL);
 	}
 
 	/* do content initialization.
 	 */
 #ifdef DUMP
-	ok = content_init( argc, argv, gwhdrtemplatep );
+	ok = content_init(argc, argv, gwhdrtemplatep);
 #endif /* DUMP */
 #ifdef RESTORE
-	ok = content_init( argc, argv, vmsz / VMSZ_PER );
+	ok = content_init(argc, argv, vmsz / VMSZ_PER);
 #endif /* RESTORE */
-	if ( ! ok ) {
+	if (! ok) {
 		err = mlog_exit(EXIT_ERROR, RV_INIT);
 		goto err_free;
 	}
 
 	/* if in a pipeline, go single-threaded with just one stream.
 	 */
-	if ( pipeline ) {
+	if (pipeline) {
 		int exitcode;
 
 		sa.sa_handler = sighandler;
-		sigaction( SIGINT, &sa, NULL );
-		sigaction( SIGHUP, &sa, NULL );
-		sigaction( SIGTERM, &sa, NULL );
-		sigaction( SIGQUIT, &sa, NULL );
+		sigaction(SIGINT, &sa, NULL);
+		sigaction(SIGHUP, &sa, NULL);
+		sigaction(SIGTERM, &sa, NULL);
+		sigaction(SIGQUIT, &sa, NULL);
 
 #ifdef DUMP
-		ok = drive_init2( argc,
+		ok = drive_init2(argc,
 				  argv,
-				  gwhdrtemplatep );
+				  gwhdrtemplatep);
 #endif /* DUMP */
 #ifdef RESTORE
-		ok = drive_init2( argc,
+		ok = drive_init2(argc,
 				  argv,
-				  ( global_hdr_t * )0 );
+				  (global_hdr_t *)0);
 #endif /* RESTORE */
-		if ( ! ok ) {
+		if (! ok) {
 			err = mlog_exit(EXIT_ERROR, RV_INIT);
 			goto err_free;
 		}
-		ok = drive_init3( );
-		if ( ! ok ) {
+		ok = drive_init3();
+		if (! ok) {
 			err = mlog_exit(EXIT_ERROR, RV_INIT);
 			goto err_free;
 		}
 #ifdef DUMP
-		exitcode = content_stream_dump( 0 );
+		exitcode = content_stream_dump(0);
 #endif /* DUMP */
 #ifdef RESTORE
-		exitcode = content_stream_restore( 0 );
+		exitcode = content_stream_restore(0);
 #endif /* RESTORE */
-		if ( exitcode != EXIT_NORMAL ) {
-			( void )content_complete( );
+		if (exitcode != EXIT_NORMAL) {
+			(void)content_complete();
 						/* for cleanup side-effect */
 			err = mlog_exit(exitcode, RV_UNKNOWN);
-		} else if ( content_complete( )) {
+		} else if (content_complete()) {
 			err = mlog_exit(EXIT_NORMAL, RV_OK);
 		} else {
 			err = mlog_exit(EXIT_INTERRUPT, RV_UNKNOWN);
@@ -626,28 +626,28 @@
 	/* now do the second and third passes of drive initialization.
 	 * allocate per-stream write and read headers. if a drive
 	 * manager uses a slave process, it should be created now,
-	 * using cldmgr_create( ). each drive manager may use the slave to
+	 * using cldmgr_create(). each drive manager may use the slave to
 	 * asynchronously read the media file header, typically a very
 	 * time-consuming chore. drive_init3 will synchronize with each slave.
 	 */
-	if ( ! init_error ) {
+	if (! init_error) {
 #ifdef DUMP
-		ok = drive_init2( argc,
+		ok = drive_init2(argc,
 				  argv,
-				  gwhdrtemplatep );
+				  gwhdrtemplatep);
 #endif /* DUMP */
 #ifdef RESTORE
-		ok = drive_init2( argc,
+		ok = drive_init2(argc,
 				  argv,
-				  ( global_hdr_t * )0 );
+				  (global_hdr_t *)0);
 #endif /* RESTORE */
-		if ( ! ok ) {
+		if (! ok) {
 			init_error = BOOL_TRUE;
 		}
 	}
-	if ( ! init_error ) {
-		ok = drive_init3( );
-		if ( ! ok ) {
+	if (! init_error) {
+		ok = drive_init3();
+		if (! ok) {
 			init_error = BOOL_TRUE;
 		}
 	}
@@ -655,13 +655,13 @@
 	/* create a child thread for each stream. drivecnt global from
 	 * drive.h, initialized by drive_init[12]
 	 */
-	if ( ! init_error ) {
-		for ( stix = 0 ; stix < drivecnt ; stix++ ) {
-			ok = cldmgr_create( childmain,
+	if (! init_error) {
+		for (stix = 0 ; stix < drivecnt ; stix++) {
+			ok = cldmgr_create(childmain,
 					    stix,
 					    "child",
-					    ( void * )stix );
-			if ( ! ok ) {
+					    (void *)stix);
+			if (! ok) {
 				init_error = BOOL_TRUE;
 			}
 		}
@@ -670,10 +670,10 @@
 	/* loop here, waiting for children to die, processing operator
 	 * signals.
 	 */
-	if ( progrpt_enabledpr ) {
-		( void )alarm( ( uint )progrpt_interval );
+	if (progrpt_enabledpr) {
+		(void)alarm((uint)progrpt_interval);
 	}
-	for ( ; ; ) {
+	for (; ;) {
 		time32_t now;
 		bool_t stop_requested = BOOL_FALSE;
 		int stop_timeout = -1;
@@ -682,7 +682,7 @@
 		/* if there was an initialization error,
 		 * immediately stop all children.
 		 */
-		if ( init_error ) {
+		if (init_error) {
 			stop_timeout = STOP_TIMEOUT;
 			stop_requested = BOOL_TRUE;
 		}
@@ -691,9 +691,9 @@
 		 * stop. furthermore, note that core should be dumped if
 		 * the child explicitly exited with EXIT_FAULT.
 		 */
-		xc = cldmgr_join( );
-		if ( xc ) {
-			if ( xc == EXIT_FAULT ) {
+		xc = cldmgr_join();
+		if (xc) {
+			if (xc == EXIT_FAULT) {
 				coredump_requested = BOOL_TRUE;
 				stop_timeout = ABORT_TIMEOUT;
 			} else {
@@ -705,21 +705,21 @@
 
 		/* all children died normally. break out.
 		 */
-		if ( cldmgr_remainingcnt( ) == 0 ) {
-			mlog( MLOG_DEBUG,
-			      "all children have exited\n" );
+		if (cldmgr_remainingcnt() == 0) {
+			mlog(MLOG_DEBUG,
+			      "all children have exited\n");
 			break;
 		}
 
 		/* get the current time
 		 */
-		now = time( 0 );
+		now = time(0);
 
 		/* check for stop timeout. request a core dump and bail
 		 */
-		if ( stop_in_progress && now >= stop_deadline ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR,
-			      _("session interrupt timeout\n") );
+		if (stop_in_progress && now >= stop_deadline) {
+			mlog(MLOG_NORMAL | MLOG_ERROR,
+			      _("session interrupt timeout\n"));
 			coredump_requested = BOOL_TRUE;
 			break;
 		}
@@ -727,21 +727,21 @@
 		/* operator sent SIGINT. if dialog allowed, enter dialog.
 		 * otherwise treat as a hangup and request a stop.
 		 */
-		if ( sigint_received ) {
-			mlog( MLOG_DEBUG | MLOG_PROC,
-			      "SIGINT received\n" );
-			if ( stop_in_progress ) {
-				if ( dlog_allowed( )) {
-					( void )sigint_dialog( );
+		if (sigint_received) {
+			mlog(MLOG_DEBUG | MLOG_PROC,
+			      "SIGINT received\n");
+			if (stop_in_progress) {
+				if (dlog_allowed()) {
+					(void)sigint_dialog();
 				}
 				/*
-				mlog( MLOG_NORMAL,
+				mlog(MLOG_NORMAL,
 				      _("session interrupt in progress: "
-				      "please wait\n") );
+				      "please wait\n"));
 				 */
 			} else {
-				if ( dlog_allowed( )) {
-					stop_requested = sigint_dialog( );
+				if (dlog_allowed()) {
+					stop_requested = sigint_dialog();
 				} else {
 					stop_requested = BOOL_TRUE;
 				}
@@ -757,13 +757,13 @@
 
 		/* refresh the current time in case in dialog for a while
 		 */
-		now = time( 0 );
+		now = time(0);
 
 		/* request a stop on hangup
 		 */
-		if ( sighup_received ) {
-			mlog( MLOG_DEBUG | MLOG_PROC,
-			      "SIGHUP received\n" );
+		if (sighup_received) {
+			mlog(MLOG_DEBUG | MLOG_PROC,
+			      "SIGHUP received\n");
 			stop_requested = BOOL_TRUE;
 			stop_timeout = STOP_TIMEOUT;
 			sighup_received = BOOL_FALSE;
@@ -771,9 +771,9 @@
 
 		/* request a stop on termination request
 		 */
-		if ( sigterm_received ) {
-			mlog( MLOG_DEBUG | MLOG_PROC,
-			      "SIGTERM received\n" );
+		if (sigterm_received) {
+			mlog(MLOG_DEBUG | MLOG_PROC,
+			      "SIGTERM received\n");
 			stop_requested = BOOL_TRUE;
 			stop_timeout = STOP_TIMEOUT;
 			sigterm_received = BOOL_FALSE;
@@ -782,13 +782,13 @@
 		/* operator send SIGQUIT. treat like an interrupt,
 		 * but force a core dump
 		 */
-		if ( sigquit_received ) {
-			mlog( MLOG_NORMAL | MLOG_PROC,
-			      "SIGQUIT received\n" );
-			if ( stop_in_progress ) {
-				mlog( MLOG_NORMAL,
+		if (sigquit_received) {
+			mlog(MLOG_NORMAL | MLOG_PROC,
+			      "SIGQUIT received\n");
+			if (stop_in_progress) {
+				mlog(MLOG_NORMAL,
 				      _("session interrupt in progress: "
-				      "please wait\n") );
+				      "please wait\n"));
 				stop_deadline = now;
 			} else {
 				stop_requested = BOOL_TRUE;
@@ -800,86 +800,86 @@
 
 		/* see if need to initiate a stop
 		 */
-		if ( stop_requested && ! stop_in_progress ) {
-			mlog( MLOG_NORMAL,
+		if (stop_requested && ! stop_in_progress) {
+			mlog(MLOG_NORMAL,
 			      _("initiating session interrupt (timeout in %d sec)\n"),
 			      stop_timeout);
 			mlog_exit_hint(RV_INTR);
 			stop_in_progress = BOOL_TRUE;
-			cldmgr_stop( );
-			assert( stop_timeout >= 0 );
-			stop_deadline = now + ( time32_t )stop_timeout;
+			cldmgr_stop();
+			assert(stop_timeout >= 0);
+			stop_deadline = now + (time32_t)stop_timeout;
 		}
 
 		/* set alarm if needed (note time stands still during dialog)
 		 */
-		if ( stop_in_progress ) {
-			int timeout = ( int )( stop_deadline - now );
-			if ( timeout < 0 ) {
+		if (stop_in_progress) {
+			int timeout = (int)(stop_deadline - now);
+			if (timeout < 0) {
 				timeout = 0;
 			}
-			mlog( MLOG_DEBUG | MLOG_PROC,
+			mlog(MLOG_DEBUG | MLOG_PROC,
 			      "setting alarm for %d second%s\n",
 			      timeout,
-			      timeout == 1 ? "" : "s" );
-			( void )alarm( ( uint )timeout );
-			if ( timeout == 0 ) {
+			      timeout == 1 ? "" : "s");
+			(void)alarm((uint)timeout);
+			if (timeout == 0) {
 				continue;
 			}
 		}
 
-		if ( progrpt_enabledpr && ! stop_in_progress ) {
+		if (progrpt_enabledpr && ! stop_in_progress) {
 			bool_t need_progrptpr = BOOL_FALSE;
-			while ( now >= progrpt_deadline ) {
+			while (now >= progrpt_deadline) {
 				need_progrptpr = BOOL_TRUE;
 				progrpt_deadline += progrpt_interval;
 			}
-			if ( need_progrptpr ) {
+			if (need_progrptpr) {
 				size_t statlinecnt;
 				char **statline;
 				ix_t i;
-				statlinecnt = content_statline( &statline );
-				for ( i = 0 ; i < statlinecnt ; i++ ) {
-					mlog( MLOG_NORMAL,
-					      statline[ i ] );
+				statlinecnt = content_statline(&statline);
+				for (i = 0 ; i < statlinecnt ; i++) {
+					mlog(MLOG_NORMAL,
+					      statline[i]);
 				}
 			}
-			( void )alarm( ( uint )( progrpt_deadline
+			(void)alarm((uint)(progrpt_deadline
 						       -
-						       now ));
+						       now));
 		}
 
 		/* sleep until next signal
 		 */
-		sigemptyset( &empty_set );
-		sigsuspend( &empty_set );
-		( void )alarm( 0 );
+		sigemptyset(&empty_set);
+		sigsuspend(&empty_set);
+		(void)alarm(0);
 	}
 
 	/* check if core dump requested
 	 */
-	if ( coredump_requested ) {
-		mlog( MLOG_DEBUG | MLOG_PROC,
+	if (coredump_requested) {
+		mlog(MLOG_DEBUG | MLOG_PROC,
 		      "core dump requested, aborting (pid %d)\n",
-		      getpid() );
+		      getpid());
 		abort();
 	}
 
 	/* determine if dump or restore was interrupted
 	 * or an initialization error occurred.
 	 */
-	if ( init_error ) {
-		( void )content_complete( );
+	if (init_error) {
+		(void)content_complete();
 		exitcode = EXIT_ERROR;
 	} else {
-		if ( content_complete( ) ) {
+		if (content_complete()) {
 			if (prbcld_xc != EXIT_NORMAL)
 				exitcode = EXIT_ERROR;
 			else
 				exitcode = EXIT_NORMAL;
 		} else {
 			exitcode = EXIT_INTERRUPT;
-			if ( mlog_get_hint() == RV_NONE )
+			if (mlog_get_hint() == RV_NONE)
 				mlog_exit_hint(RV_INCOMPLETE);
 		}
 	}
@@ -888,28 +888,28 @@
 
 err_free:
 #ifdef DUMP
-	global_hdr_free( gwhdrtemplatep );
+	global_hdr_free(gwhdrtemplatep);
 #endif /* DUMP */
 	return err;
 }
 
-#define ULO( f, o )	fprintf( stderr,		\
+#define ULO(f, o)	fprintf(stderr,		\
 				 "%*s[ -%c %s ]\n",	\
 				 ps,			\
 				 ns,			\
 				 o,			\
-				 f ),			\
+				 f),			\
 			ps = pfxsz
 
-#define ULN( f )	fprintf( stderr,		\
+#define ULN(f)	fprintf(stderr,		\
 				 "%*s[ %s ]\n",		\
 				 ps,			\
 				 ns,			\
-				 f ),			\
+				 f),			\
 			ps = pfxsz
 
 void
-usage( void )
+usage(void)
 {
 	int pfxsz;
 	int ps = 0;
@@ -919,107 +919,107 @@
 				progname, basename(progname));
 
 #ifdef DUMP
-	ULO(_("(dump DMF dualstate files as offline)"),	GETOPT_DUMPASOFFLINE );
-	ULO(_("<blocksize>"),				GETOPT_BLOCKSIZE );
-	ULO(_("<media change alert program> "),		GETOPT_ALERTPROG );
-	ULO(_("<dump media file size> "),		GETOPT_FILESZ );
-	ULO(_("(allow files to be excluded)"),		GETOPT_EXCLUDEFILES );
-	ULO(_("<destination> ..."),			GETOPT_DUMPDEST );
-	ULO(_("(help)"),				GETOPT_HELP );
-	ULO(_("<level>"),				GETOPT_LEVEL );
-	ULO(_("(force usage of minimal rmt)"),		GETOPT_MINRMT );
-	ULO(_("(overwrite tape)"),			GETOPT_OVERWRITE );
-	ULO(_("<seconds between progress reports>"),	GETOPT_PROGRESS );
-	ULO(_("<use QIC tape settings>"),		GETOPT_QIC );
-	ULO(_("<subtree> ..."),				GETOPT_SUBTREE );
-	ULO(_("<file> (use file mtime for dump time"),	GETOPT_DUMPTIME );
-	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY );
-	ULO(_("<maximum file size>"),			GETOPT_MAXDUMPFILESIZE );
-	ULO(_("(don't dump extended file attributes)"),	GETOPT_NOEXTATTR );
-	ULO(_("<base dump session id>"),		GETOPT_BASED );
+	ULO(_("(dump DMF dualstate files as offline)"),	GETOPT_DUMPASOFFLINE);
+	ULO(_("<blocksize>"),				GETOPT_BLOCKSIZE);
+	ULO(_("<media change alert program> "),		GETOPT_ALERTPROG);
+	ULO(_("<dump media file size> "),		GETOPT_FILESZ);
+	ULO(_("(allow files to be excluded)"),		GETOPT_EXCLUDEFILES);
+	ULO(_("<destination> ..."),			GETOPT_DUMPDEST);
+	ULO(_("(help)"),				GETOPT_HELP);
+	ULO(_("<level>"),				GETOPT_LEVEL);
+	ULO(_("(force usage of minimal rmt)"),		GETOPT_MINRMT);
+	ULO(_("(overwrite tape)"),			GETOPT_OVERWRITE);
+	ULO(_("<seconds between progress reports>"),	GETOPT_PROGRESS);
+	ULO(_("<use QIC tape settings>"),		GETOPT_QIC);
+	ULO(_("<subtree> ..."),				GETOPT_SUBTREE);
+	ULO(_("<file> (use file mtime for dump time"),	GETOPT_DUMPTIME);
+	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY);
+	ULO(_("<maximum file size>"),			GETOPT_MAXDUMPFILESIZE);
+	ULO(_("(don't dump extended file attributes)"),	GETOPT_NOEXTATTR);
+	ULO(_("<base dump session id>"),		GETOPT_BASED);
 #ifdef REVEAL
-	ULO(_("(generate tape record checksums)"),	GETOPT_RECCHKSUM );
+	ULO(_("(generate tape record checksums)"),	GETOPT_RECCHKSUM);
 #endif /* REVEAL */
-	ULO(_("(skip unchanged directories)"),		GETOPT_NOUNCHANGEDDIRS );
-	ULO(_("(pre-erase media)"),			GETOPT_ERASE );
-	ULO(_("(don't prompt)"),			GETOPT_FORCE );
+	ULO(_("(skip unchanged directories)"),		GETOPT_NOUNCHANGEDDIRS);
+	ULO(_("(pre-erase media)"),			GETOPT_ERASE);
+	ULO(_("(don't prompt)"),			GETOPT_FORCE);
 #ifdef REVEAL
-	ULO(_("<minimum thread stack size>"),		GETOPT_MINSTACKSZ );
-	ULO(_("<maximum thread stack size>"),		GETOPT_MAXSTACKSZ );
+	ULO(_("<minimum thread stack size>"),		GETOPT_MINSTACKSZ);
+	ULO(_("<maximum thread stack size>"),		GETOPT_MAXSTACKSZ);
 #endif /* REVEAL */
-	ULO(_("(display dump inventory)"),		GETOPT_INVPRINT );
-	ULO(_("(inhibit inventory update)"),		GETOPT_NOINVUPDATE );
-	ULO(_("(generate format 2 dump)"),		GETOPT_FMT2COMPAT );
-	ULO(_("<session label>"),			GETOPT_DUMPLABEL );
-	ULO(_("<media label> ..."),			GETOPT_MEDIALABEL );
+	ULO(_("(display dump inventory)"),		GETOPT_INVPRINT);
+	ULO(_("(inhibit inventory update)"),		GETOPT_NOINVUPDATE);
+	ULO(_("(generate format 2 dump)"),		GETOPT_FMT2COMPAT);
+	ULO(_("<session label>"),			GETOPT_DUMPLABEL);
+	ULO(_("<media label> ..."),			GETOPT_MEDIALABEL);
 #ifdef REVEAL
-	ULO(_("(timestamp messages)"),			GETOPT_TIMESTAMP );
+	ULO(_("(timestamp messages)"),			GETOPT_TIMESTAMP);
 #endif /* REVEAL */
-	ULO(_("<options file>"),			GETOPT_OPTFILE );
+	ULO(_("<options file>"),			GETOPT_OPTFILE);
 #ifdef REVEAL
-	ULO(_("(pin down I/O buffers)"),		GETOPT_RINGPIN );
+	ULO(_("(pin down I/O buffers)"),		GETOPT_RINGPIN);
 #endif /* REVEAL */
-	ULO(_("(resume)"),				GETOPT_RESUME );
-	ULO(_("(don't timeout dialogs)"),		GETOPT_NOTIMEOUTS );
+	ULO(_("(resume)"),				GETOPT_RESUME);
+	ULO(_("(don't timeout dialogs)"),		GETOPT_NOTIMEOUTS);
 #ifdef REVEAL
-	ULO(_("(unload media when change needed)"),	GETOPT_UNLOAD );
-	ULO(_("(show subsystem in messages)"),		GETOPT_SHOWLOGSS );
-	ULO(_("(show verbosity in messages)"),		GETOPT_SHOWLOGLEVEL );
+	ULO(_("(unload media when change needed)"),	GETOPT_UNLOAD);
+	ULO(_("(show subsystem in messages)"),		GETOPT_SHOWLOGSS);
+	ULO(_("(show verbosity in messages)"),		GETOPT_SHOWLOGLEVEL);
 #endif /* REVEAL */
-	ULO(_("<I/O buffer ring length>"),		GETOPT_RINGLEN );
-	ULN(_("- (stdout)") );
-	ULN(_("<source (mntpnt|device)>") );
+	ULO(_("<I/O buffer ring length>"),		GETOPT_RINGLEN);
+	ULN(_("- (stdout)"));
+	ULN(_("<source (mntpnt|device)>"));
 #endif /* DUMP */
 #ifdef RESTORE
-	ULO(_("<alt. workspace dir> ..."),		GETOPT_WORKSPACE );
-	ULO(_("<blocksize>"),				GETOPT_BLOCKSIZE );
-	ULO(_("<media change alert program> "),		GETOPT_ALERTPROG );
-	ULO(_("(don't overwrite existing files)"),	GETOPT_EXISTING );
-	ULO(_("<source> ..."),				GETOPT_DUMPDEST );
-	ULO(_("(help)"),				GETOPT_HELP );
-	ULO(_("(interactive)"),				GETOPT_INTERACTIVE );
-	ULO(_("(force usage of minimal rmt)"),		GETOPT_MINRMT );
-	ULO(_("<file> (restore only if newer than)"),	GETOPT_NEWER );
-	ULO(_("(restore owner/group even if not root)"),GETOPT_OWNER );
-	ULO(_("<seconds between progress reports>"),	GETOPT_PROGRESS );
-	ULO(_("<use QIC tape settings>"),		GETOPT_QIC );
-	ULO(_("(cumulative restore)"),			GETOPT_CUMULATIVE );
-	ULO(_("<subtree> ..."),				GETOPT_SUBTREE );
-	ULO(_("(contents only)"),			GETOPT_TOC );
-	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY );
-	ULO(_("(use small tree window)"),		GETOPT_SMALLWINDOW );
-	ULO(_("(don't restore extended file attributes)"),GETOPT_NOEXTATTR );
-	ULO(_("(restore root dir owner/permissions)"),	GETOPT_ROOTPERM );
-	ULO(_("(restore DMAPI event settings)"),	GETOPT_SETDM );
+	ULO(_("<alt. workspace dir> ..."),		GETOPT_WORKSPACE);
+	ULO(_("<blocksize>"),				GETOPT_BLOCKSIZE);
+	ULO(_("<media change alert program> "),		GETOPT_ALERTPROG);
+	ULO(_("(don't overwrite existing files)"),	GETOPT_EXISTING);
+	ULO(_("<source> ..."),				GETOPT_DUMPDEST);
+	ULO(_("(help)"),				GETOPT_HELP);
+	ULO(_("(interactive)"),				GETOPT_INTERACTIVE);
+	ULO(_("(force usage of minimal rmt)"),		GETOPT_MINRMT);
+	ULO(_("<file> (restore only if newer than)"),	GETOPT_NEWER);
+	ULO(_("(restore owner/group even if not root)"),GETOPT_OWNER);
+	ULO(_("<seconds between progress reports>"),	GETOPT_PROGRESS);
+	ULO(_("<use QIC tape settings>"),		GETOPT_QIC);
+	ULO(_("(cumulative restore)"),			GETOPT_CUMULATIVE);
+	ULO(_("<subtree> ..."),				GETOPT_SUBTREE);
+	ULO(_("(contents only)"),			GETOPT_TOC);
+	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY);
+	ULO(_("(use small tree window)"),		GETOPT_SMALLWINDOW);
+	ULO(_("(don't restore extended file attributes)"),GETOPT_NOEXTATTR);
+	ULO(_("(restore root dir owner/permissions)"),	GETOPT_ROOTPERM);
+	ULO(_("(restore DMAPI event settings)"),	GETOPT_SETDM);
 #ifdef REVEAL
-	ULO(_("(check tape record checksums)"),		GETOPT_RECCHKSUM );
+	ULO(_("(check tape record checksums)"),		GETOPT_RECCHKSUM);
 #endif /* REVEAL */
-	ULO(_("(don't overwrite if changed)"),		GETOPT_CHANGED );
-	ULO(_("(don't prompt)"),			GETOPT_FORCE );
-	ULO(_("(display dump inventory)"),		GETOPT_INVPRINT );
-	ULO(_("(inhibit inventory update)"),		GETOPT_NOINVUPDATE );
-	ULO(_("(force use of format 2 generation numbers)"),GETOPT_FMT2COMPAT );
-	ULO(_("<session label>"),			GETOPT_DUMPLABEL );
+	ULO(_("(don't overwrite if changed)"),		GETOPT_CHANGED);
+	ULO(_("(don't prompt)"),			GETOPT_FORCE);
+	ULO(_("(display dump inventory)"),		GETOPT_INVPRINT);
+	ULO(_("(inhibit inventory update)"),		GETOPT_NOINVUPDATE);
+	ULO(_("(force use of format 2 generation numbers)"),GETOPT_FMT2COMPAT);
+	ULO(_("<session label>"),			GETOPT_DUMPLABEL);
 #ifdef REVEAL
-	ULO(_("(timestamp messages)"),			GETOPT_TIMESTAMP );
+	ULO(_("(timestamp messages)"),			GETOPT_TIMESTAMP);
 #endif /* REVEAL */
-	ULO(_("<options file>"),			GETOPT_OPTFILE );
+	ULO(_("<options file>"),			GETOPT_OPTFILE);
 #ifdef REVEAL
-	ULO(_("(pin down I/O buffers)"),		GETOPT_RINGPIN );
+	ULO(_("(pin down I/O buffers)"),		GETOPT_RINGPIN);
 #endif /* REVEAL */
-	ULO(_("(force interrupted session completion)"),GETOPT_SESSCPLT );
-	ULO(_("(resume)"),				GETOPT_RESUME );
-	ULO(_("<session id>"),				GETOPT_SESSIONID );
-	ULO(_("(don't timeout dialogs)"),		GETOPT_NOTIMEOUTS );
+	ULO(_("(force interrupted session completion)"),GETOPT_SESSCPLT);
+	ULO(_("(resume)"),				GETOPT_RESUME);
+	ULO(_("<session id>"),				GETOPT_SESSIONID);
+	ULO(_("(don't timeout dialogs)"),		GETOPT_NOTIMEOUTS);
 #ifdef REVEAL
-	ULO(_("(unload media when change needed)"),	GETOPT_UNLOAD );
-	ULO(_("(show subsystem in messages)"),		GETOPT_SHOWLOGSS );
-	ULO(_("(show verbosity in messages)"),		GETOPT_SHOWLOGLEVEL );
+	ULO(_("(unload media when change needed)"),	GETOPT_UNLOAD);
+	ULO(_("(show subsystem in messages)"),		GETOPT_SHOWLOGSS);
+	ULO(_("(show verbosity in messages)"),		GETOPT_SHOWLOGLEVEL);
 #endif /* REVEAL */
-	ULO(_("<excluded subtree> ..."),		GETOPT_NOSUBTREE );
-	ULO(_("<I/O buffer ring length>"),		GETOPT_RINGLEN );
-	ULN(_("- (stdin)") );
-	ULN(_("<destination>") );
+	ULO(_("<excluded subtree> ..."),		GETOPT_NOSUBTREE);
+	ULO(_("<I/O buffer ring length>"),		GETOPT_RINGLEN);
+	ULN(_("- (stdin)"));
+	ULN(_("<destination>"));
 #endif /* RESTORE */
 
 	/* anywhere usage is called we will exit shortly after...
@@ -1032,7 +1032,7 @@
 /* returns TRUE if preemption
  */
 bool_t
-preemptchk( int flg )
+preemptchk(int flg)
 {
 	bool_t preempt_requested;
 	int i;
@@ -1042,21 +1042,21 @@
 
 	/* see if a progress report needed
 	 */
-	if ( progrpt_enabledpr ) {
-		time32_t now = time( 0 );
+	if (progrpt_enabledpr) {
+		time32_t now = time(0);
 		bool_t need_progrptpr = BOOL_FALSE;
-		while ( now >= progrpt_deadline ) {
+		while (now >= progrpt_deadline) {
 			need_progrptpr = BOOL_TRUE;
 			progrpt_deadline += progrpt_interval;
 		}
-		if ( need_progrptpr ) {
+		if (need_progrptpr) {
 			size_t statlinecnt;
 			char **statline;
 			ix_t i;
-			statlinecnt = content_statline( &statline );
-			for ( i = 0 ; i < statlinecnt ; i++ ) {
-				mlog( MLOG_NORMAL,
-				      statline[ i ] );
+			statlinecnt = content_statline(&statline);
+			for (i = 0 ; i < statlinecnt ; i++) {
+				mlog(MLOG_NORMAL,
+				      statline[i]);
 			}
 		}
 	}
@@ -1068,29 +1068,29 @@
 
 	/* signals not caught if in a pipeline
 	 */
-	if ( pipeline ) {
+	if (pipeline) {
 		return BOOL_FALSE;
 	}
 
 	/* release signals momentarily to let any pending ones
 	 * invoke signal handler and set flags
 	 */
-	sigpending( &pending_set );
-	for ( i = 0; i < num_sigs; i++ ) {
-		if ( sigismember( &pending_set, sigs[i] ) == 1 ) {
-			sigfillset( &handle_set );
-			sigdelset( &handle_set, sigs[i] );
-			sigsuspend( &handle_set );
+	sigpending(&pending_set);
+	for (i = 0; i < num_sigs; i++) {
+		if (sigismember(&pending_set, sigs[i]) == 1) {
+			sigfillset(&handle_set);
+			sigdelset(&handle_set, sigs[i]);
+			sigsuspend(&handle_set);
 		}
 	}
 
 	preempt_requested = BOOL_FALSE;
 
-	if ( sigint_received ) {
-		mlog( MLOG_DEBUG | MLOG_PROC,
-		      "SIGINT received (preempt)\n" );
-		if ( dlog_allowed( )) {
-			preempt_requested = sigint_dialog( );
+	if (sigint_received) {
+		mlog(MLOG_DEBUG | MLOG_PROC,
+		      "SIGINT received (preempt)\n");
+		if (dlog_allowed()) {
+			preempt_requested = sigint_dialog();
 		} else {
 			preempt_requested = BOOL_TRUE;
 		}
@@ -1101,23 +1101,23 @@
 		sigint_received = BOOL_FALSE;
 	}
 
-	if ( sighup_received ) {
-		mlog( MLOG_DEBUG | MLOG_PROC,
-		      "SIGHUP received (prempt)\n" );
+	if (sighup_received) {
+		mlog(MLOG_DEBUG | MLOG_PROC,
+		      "SIGHUP received (prempt)\n");
 		preempt_requested = BOOL_TRUE;
 		sighup_received = BOOL_FALSE;
 	}
 
-	if ( sigterm_received ) {
-		mlog( MLOG_DEBUG | MLOG_PROC,
-		      "SIGTERM received (prempt)\n" );
+	if (sigterm_received) {
+		mlog(MLOG_DEBUG | MLOG_PROC,
+		      "SIGTERM received (prempt)\n");
 		preempt_requested = BOOL_TRUE;
 		sigterm_received = BOOL_FALSE;
 	}
 
-	if ( sigquit_received ) {
-		mlog( MLOG_DEBUG | MLOG_PROC,
-		      "SIGQUIT received (preempt)\n" );
+	if (sigquit_received) {
+		mlog(MLOG_DEBUG | MLOG_PROC,
+		      "SIGQUIT received (preempt)\n");
 		preempt_requested = BOOL_TRUE;
 		sigquit_received = BOOL_FALSE;
 	}
@@ -1128,7 +1128,7 @@
 /* definition of locally defined static functions ****************************/
 
 static bool_t
-loadoptfile( int *argcp, char ***argvp )
+loadoptfile(int *argcp, char ***argvp)
 {
 	char *optfilename;
 	ix_t optfileix = 0;
@@ -1150,66 +1150,66 @@
 	optind = 1;
 	opterr = 0;
 	optfilename =  0;
-	while ( ( c = getopt( *argcp, *argvp, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(*argcp, *argvp, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_OPTFILE:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( optfilename ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
+			if (optfilename) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_NOLOCK,
 				      _("-%c allowed only once\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			optfilename = optarg;
-			assert( optind > 2 );
-			optfileix = ( ix_t )optind - 2;
+			assert(optind > 2);
+			optfileix = (ix_t)optind - 2;
 			break;
 		}
 	}
-	if ( ! optfilename )  {
+	if (! optfilename)  {
 		return BOOL_TRUE;
 	}
 
 	/* attempt to open the option  file
 	 */
 	errno = 0;
-	fd = open( optfilename, O_RDONLY );
-	if ( fd  < 0 ) {
-		mlog( MLOG_ERROR | MLOG_NOLOCK,
+	fd = open(optfilename, O_RDONLY);
+	if (fd  < 0) {
+		mlog(MLOG_ERROR | MLOG_NOLOCK,
 		      _("cannot open option file %s: %s (%d)\n"),
 		      optfilename,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return BOOL_FALSE;
 	}
 
 	/* get file status
 	 */
-	rval = fstat64( fd, &stat );
-	if ( rval ) {
-		mlog( MLOG_ERROR | MLOG_NOLOCK,
+	rval = fstat64(fd, &stat);
+	if (rval) {
+		mlog(MLOG_ERROR | MLOG_NOLOCK,
 		      _("cannot stat option file %s: %s (%d)\n"),
 		      optfilename,
-		      strerror( errno ),
-		      errno );
-		close( fd );
+		      strerror(errno),
+		      errno);
+		close(fd);
 		return BOOL_FALSE;
 	}
 
 	/* ensure the file is ordinary
 	 */
-	if ( ( stat.st_mode & S_IFMT ) != S_IFREG ) {
-		mlog( MLOG_ERROR | MLOG_NOLOCK,
+	if ((stat.st_mode & S_IFMT) != S_IFREG) {
+		mlog(MLOG_ERROR | MLOG_NOLOCK,
 		      _("given option file %s is not ordinary file\n"),
-		      optfilename );
-		close( fd );
+		      optfilename);
+		close(fd);
 		return BOOL_FALSE;
 	}
 
@@ -1217,68 +1217,68 @@
 	 * skip the GETOPT_OPTFILE option which put us here!
 	 */
 	sz = 0;
-	for ( i =  0 ; i < *argcp ; i++ ) {
-		if ( i == ( int )optfileix ) {
+	for (i =  0 ; i < *argcp ; i++) {
+		if (i == (int)optfileix) {
 			i++; /* to skip option argument */
 			continue;
 		}
-		sz += strlen( ( * argvp )[ i ] ) + 1;
+		sz += strlen((* argvp)[i]) + 1;
 	}
 
 	/* add in the size of the option file (plus one byte in case
 	 * option file ends without newline, and one NULL for safety)
 	 */
-	sz += ( size_t )stat.st_size + 2;
+	sz += (size_t)stat.st_size + 2;
 
 	/* allocate an argument buffer
 	 */
-	argbuf = ( char * )malloc( sz );
-	assert( argbuf );
+	argbuf = (char *)malloc(sz);
+	assert(argbuf);
 
-	/* copy arg0 (the executable's name ) in first
+	/* copy arg0 (the executable's name) in first
 	 */
 	p = argbuf;
 	i = 0;
-	sprintf( p, "%s ", ( * argvp )[ i ] );
-	p += strlen( ( * argvp )[ i ] ) + 1;
+	sprintf(p, "%s ", ( * argvp)[ i]);
+	p += strlen((* argvp)[i]) + 1;
 	i++;
 
 	/* copy the options file into the buffer after the given args
 	 */
-	nread = read( fd, ( void * )p, ( size_t )stat.st_size );
-	if ( nread < 0 ) {
-		mlog( MLOG_ERROR | MLOG_NOLOCK,
+	nread = read(fd, (void *)p, (size_t)stat.st_size);
+	if (nread < 0) {
+		mlog(MLOG_ERROR | MLOG_NOLOCK,
 		      _("read of option file %s failed: %s (%d)\n"),
 		      optfilename,
-		      strerror( errno ),
-		      errno );
-		close( fd );
+		      strerror(errno),
+		      errno);
+		close(fd);
 		return BOOL_FALSE;
 	}
-	assert( ( off64_t )nread == stat.st_size );
-	p += ( size_t )stat.st_size;
+	assert((off64_t)nread == stat.st_size);
+	p += (size_t)stat.st_size;
 	*p++ = ' ';
 
 	/* copy the remaining command line args into the buffer
 	 */
-	for ( ; i < *argcp ; i++ ) {
-		if ( i == ( int )optfileix ) {
+	for (; i < *argcp ; i++) {
+		if (i == (int)optfileix) {
 			i++; /* to skip option argument */
 			continue;
 		}
-		sprintf( p, "%s ", ( * argvp )[ i ] );
-		p += strlen( ( * argvp )[ i ] ) + 1;
+		sprintf(p, "%s ", ( * argvp)[ i]);
+		p += strlen((* argvp)[i]) + 1;
 	}
 
 	/* null-terminate the entire buffer
 	 */
 	*p++ = 0;
-	assert( ( size_t )( p - argbuf ) <= sz );
+	assert((size_t)(p - argbuf) <= sz);
 
 	/* change newlines and carriage returns into spaces
 	 */
-	for ( p = argbuf ; *p ; p++ ) {
-		if ( strchr( "\n\r", ( int )( *p ))) {
+	for (p = argbuf ; *p ; p++) {
+		if (strchr("\n\r", ( int)( *p))) {
 			*p = ' ';
 		}
 	}
@@ -1287,16 +1287,16 @@
 	 */
 	tokencnt = 0;
 	p = argbuf;
-	for ( ; ; ) {
+	for (; ;) {
 		/* start at the first non-separator character
 		 */
-		while ( *p && strchr( sep, ( int )( *p ))) {
+		while (*p && strchr(sep, (int)(*p))) {
 			p++;
 		}
 
 		/* done when NULL encountered
 		 */
-		if ( ! *p ) {
+		if (! *p) {
 			break;
 		}
 
@@ -1306,71 +1306,71 @@
 
 		/* find the end of the first token
 		 */
-		p = strpbrkquotes( p, sep );
+		p = strpbrkquotes(p, sep);
 
 		/* if no more separators, all tokens seen
 		 */
-		if ( ! p ) {
+		if (! p) {
 			break;
 		}
 	}
 
 	/* if no arguments, can return now
 	 */
-	if ( ! tokencnt ) {
-		close( fd );
+	if (! tokencnt) {
+		close(fd);
 		return BOOL_TRUE;
 	}
 
 	/* allocate a new argv array to hold the tokens
 	 */
-	newargv = ( char ** )calloc( tokencnt, sizeof( char * ));
-	assert( newargv );
+	newargv = (char **)calloc(tokencnt, sizeof(char *));
+	assert(newargv);
 
 	/* null-terminate tokens and place in new argv, after
 	 * extracting quotes and escapes
 	 */
 	p = argbuf;
-	for ( i = 0 ; ; i++ ) {
+	for (i = 0 ; ; i++) {
 		char *endp = 0;
 
 		/* start at the first non-separator character
 		 */
-		while ( *p && strchr( sep, ( int )*p )) {
+		while (*p && strchr(sep, (int)*p)) {
 			p++;
 		}
 
 		/* done when NULL encountered
 		 */
-		if ( ! *p ) {
+		if (! *p) {
 			break;
 		}
 
 		/* better not disagree with counting scan!
 		 */
-		assert( i < ( int )tokencnt );
+		assert(i < (int)tokencnt);
 
 		/* find the end of the first token
 		 */
-		endp = strpbrkquotes( p, sep );
+		endp = strpbrkquotes(p, sep);
 
 		/* null-terminate if needed
 		 */
-		if ( endp ) {
+		if (endp) {
 			*endp = 0;
 		}
 
 		/* strip quotes and escapes
 		 */
-		p = stripquotes( p );
+		p = stripquotes(p);
 
 		/* stick result in new argv array
 		 */
-		newargv[ i ] = p;
+		newargv[i] = p;
 
 		/* if no more separators, all tokens seen
 		 */
-		if ( ! endp ) {
+		if (! endp) {
 			break;
 		}
 
@@ -1379,8 +1379,8 @@
 
 	/* return new argc anr argv
 	 */
-	close( fd );
-	*argcp = ( int )tokencnt;
+	close(fd);
+	*argcp = (int)tokencnt;
 	*argvp = newargv;
 	return BOOL_TRUE;
 }
@@ -1388,43 +1388,43 @@
 /* parent and children share this handler.
  */
 static void
-sighandler( int signo )
+sighandler(int signo)
 {
 	/* dialog gets first crack at the signal
 	 */
-	if ( dlog_sighandler( signo ) )
+	if (dlog_sighandler(signo))
 		return;
 
 	/* if in pipeline, don't do anything risky. just quit.
 	 */
-	if ( pipeline ) {
+	if (pipeline) {
 		int rval;
 
-		mlog( MLOG_TRACE | MLOG_NOTE | MLOG_NOLOCK | MLOG_PROC,
+		mlog(MLOG_TRACE | MLOG_NOTE | MLOG_NOLOCK | MLOG_PROC,
 		      _("received signal %d (%s): cleanup and exit\n"),
 		      signo,
-		      sig_numstring( signo ));
+		      sig_numstring(signo));
 
-		if ( content_complete( )) {
+		if (content_complete()) {
 			rval = EXIT_NORMAL;
 		} else {
 			rval = EXIT_INTERRUPT;
 		}
 		mlog_exit(rval, RV_NONE);
-		exit( rval );
+		exit(rval);
 	}
 
-	switch ( signo ) {
+	switch (signo) {
 	case SIGHUP:
 		/* immediately disable further dialogs
 		*/
-		dlog_desist( );
+		dlog_desist();
 		sighup_received = BOOL_TRUE;
 		break;
 	case SIGTERM:
 		/* immediately disable further dialogs
 		*/
-		dlog_desist( );
+		dlog_desist();
 		sigterm_received = BOOL_TRUE;
 		break;
 	case SIGINT:
@@ -1433,7 +1433,7 @@
 	case SIGQUIT:
 		/* immediately disable further dialogs
 		 */
-		dlog_desist( );
+		dlog_desist();
 		sigquit_received = BOOL_TRUE;
 		break;
 	case SIGALRM:
@@ -1446,7 +1446,7 @@
 }
 
 static int
-childmain( void *arg1 )
+childmain(void *arg1)
 {
 	ix_t stix;
 	int exitcode;
@@ -1454,21 +1454,21 @@
 
 	/* Determine which stream I am.
 	 */
-	stix = ( ix_t )arg1;
+	stix = (ix_t)arg1;
 
 	/* tell the content manager to begin.
 	 */
 #ifdef DUMP
-	exitcode = content_stream_dump( stix );
+	exitcode = content_stream_dump(stix);
 #endif /* DUMP */
 #ifdef RESTORE
-	exitcode = content_stream_restore( stix );
+	exitcode = content_stream_restore(stix);
 #endif /* RESTORE */
 
 	/* let the drive manager shut down its slave thread
 	 */
-	drivep = drivepp[ stix ];
-	( * drivep->d_opsp->do_quit )( drivep );
+	drivep = drivepp[stix];
+	(* drivep->d_opsp->do_quit)(drivep);
 
 	return exitcode;
 }
@@ -1476,17 +1476,17 @@
 
 /* ARGSUSED */
 static void
-prompt_prog_cb( void *uctxp, dlog_pcbp_t pcb, void *pctxp )
+prompt_prog_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
 	/* query: ask for a dump label
 	 */
-	( * pcb )( pctxp,
+	(* pcb)(pctxp,
 		   progrpt_enabledpr
 		   ?
 		   _("please enter seconds between progress reports, "
 		   "or 0 to disable")
 		   :
-		   _("please enter seconds between progress reports") );
+		   _("please enter seconds between progress reports"));
 }
 
 /* SIGINTR dialog
@@ -1494,28 +1494,28 @@
  * side affect is to change verbosity level.
  * return code of BOOL_TRUE indicates a stop was requested.
  */
-#define PREAMBLEMAX	( 7 + 2 * STREAM_SIMMAX )
+#define PREAMBLEMAX	(7 + 2 * STREAM_SIMMAX)
 #define QUERYMAX	3
 #define CHOICEMAX	9
 #define ACKMAX		7
 #define POSTAMBLEMAX	3
 
 static bool_t
-sigint_dialog( void )
+sigint_dialog(void)
 {
 	fold_t fold;
 	char **statline;
 	ix_t i;
 	size_t statlinecnt;
-	char *preamblestr[ PREAMBLEMAX ];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	size_t interruptix;
 	size_t verbosityix;
@@ -1540,55 +1540,55 @@
 
 	/* preamble: the content status line, indicate if interrupt happening
 	 */
-	fold_init( fold, _("status and control dialog"), '=' );
-	statlinecnt = content_statline( &statline );
+	fold_init(fold, _("status and control dialog"), '=');
+	statlinecnt = content_statline(&statline);
 	preamblecnt = 0;
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = "\n";
-	for ( i = 0 ; i < statlinecnt ; i++ ) {
-		preamblestr[ preamblecnt++ ] = statline[ i ];
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++ ] = "\n";
+	for (i = 0 ; i < statlinecnt ; i++) {
+		preamblestr[preamblecnt++] = statline[i];
 	}
-	if ( stop_in_progress ) {
-		preamblestr[ preamblecnt++ ] =
+	if (stop_in_progress) {
+		preamblestr[preamblecnt++] =
 			_("\nsession interrupt in progress\n");
 	}
-	preamblestr[ preamblecnt++ ] = "\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	preamblestr[preamblecnt++ ] = "\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* top-level query: a function of session interrupt status
 	 */
 	querycnt = 0;
-	querystr[ querycnt++ ] = _("please select one of "
+	querystr[querycnt++ ] = _("please select one of "
 				 "the following operations\n");
-	assert( querycnt <= QUERYMAX );
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
-	if ( ! stop_in_progress ) {
+	if (! stop_in_progress) {
 		interruptix = choicecnt;
-		choicestr[ choicecnt++ ] = _("interrupt this session");
+		choicestr[choicecnt++ ] = _("interrupt this session");
 	} else {
 		interruptix = SIZEMAX; /* never happen */
 	}
 
 	verbosityix = choicecnt;
-	choicestr[ choicecnt++ ] = _("change verbosity");
+	choicestr[choicecnt++ ] = _("change verbosity");
 	metricsix = choicecnt;
-	choicestr[ choicecnt++ ] = _("display metrics");
-	if ( content_media_change_needed ) {
+	choicestr[choicecnt++ ] = _("display metrics");
+	if (content_media_change_needed) {
 		mediachangeix = choicecnt;
-		choicestr[ choicecnt++ ] = _("confirm media change");
+		choicestr[choicecnt++ ] = _("confirm media change");
 	} else {
 		mediachangeix = SIZEMAX; /* never happen */
 	}
 	controlix = choicecnt;
-	choicestr[ choicecnt++ ] = _("other controls");
+	choicestr[choicecnt++ ] = _("other controls");
 	continueix = choicecnt;
-	choicestr[ choicecnt++ ] = _("continue");
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++ ] = _("continue");
+	assert(choicecnt <= CHOICEMAX);
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -1600,22 +1600,22 @@
 				       continueix,	/* timeout ix */
 				       continueix,	/* sigint ix */
 				       continueix,	/* sighup ix */
-				       continueix );	/* sigquit ix */
-	if ( responseix == interruptix ) {
+				       continueix);	/* sigquit ix */
+	if (responseix == interruptix) {
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = "\n";
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		ackstr[ackcnt++ ] = "\n";
+		dlog_multi_ack(ackstr,
+				ackcnt);
 		querycnt = 0;
-		querystr[ querycnt++ ] = _("please confirm\n");
-		assert( querycnt <= QUERYMAX );
+		querystr[querycnt++ ] = _("please confirm\n");
+		assert(querycnt <= QUERYMAX);
 		choicecnt = 0;
 		interruptix = choicecnt;
-		choicestr[ choicecnt++ ] = _("interrupt this session");
+		choicestr[choicecnt++ ] = _("interrupt this session");
 		nochangeix = choicecnt;
-		choicestr[ choicecnt++ ] = _("continue");
-		assert( choicecnt <= CHOICEMAX );
-		responseix = dlog_multi_query( querystr,
+		choicestr[choicecnt++ ] = _("continue");
+		assert(choicecnt <= CHOICEMAX);
+		responseix = dlog_multi_query(querystr,
 					       querycnt,
 					       choicestr,
 					       choicecnt,
@@ -1629,35 +1629,35 @@
 					       nochangeix, /* sighup ix */
 					       nochangeix);/* sigquit ix */
 		ackcnt = 0;
-		if ( responseix == nochangeix ) {
-			ackstr[ ackcnt++ ] = _("continuing\n");
+		if (responseix == nochangeix) {
+			ackstr[ackcnt++ ] = _("continuing\n");
 		} else {
-			ackstr[ ackcnt++ ] = _("interrupt request accepted\n");
+			ackstr[ackcnt++ ] = _("interrupt request accepted\n");
 			stop_requested = BOOL_TRUE;
 		}
-		dlog_multi_ack( ackstr,
-				ackcnt );
-	} else if ( responseix == verbosityix ) {
+		dlog_multi_ack(ackstr,
+				ackcnt);
+	} else if (responseix == verbosityix) {
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = "\n";
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		ackstr[ackcnt++ ] = "\n";
+		dlog_multi_ack(ackstr,
+				ackcnt);
 		querycnt = 0;
-		querystr[ querycnt++ ] = _("please select one of "
+		querystr[querycnt++ ] = _("please select one of "
 					 "the following subsystems\n");
-		assert( querycnt <= QUERYMAX );
+		assert(querycnt <= QUERYMAX);
 		choicecnt = 0;
 		/* number of lines must match number of subsystems
 		 */
-		for ( choicecnt = 0 ; choicecnt < MLOG_SS_CNT ; choicecnt++ ) {
-			choicestr[ choicecnt ] = mlog_ss_names[ choicecnt ];
+		for (choicecnt = 0 ; choicecnt < MLOG_SS_CNT ; choicecnt++) {
+			choicestr[choicecnt] = mlog_ss_names[choicecnt];
 		}
 		allix = choicecnt;
-		choicestr[ choicecnt++ ] = _("all of the above");
+		choicestr[choicecnt++ ] = _("all of the above");
 		nochangeix = choicecnt;
-		choicestr[ choicecnt++ ] = _("no change");
-		assert( choicecnt <= CHOICEMAX );
-		responseix = dlog_multi_query( querystr,
+		choicestr[choicecnt++ ] = _("no change");
+		assert(choicecnt <= CHOICEMAX);
+		responseix = dlog_multi_query(querystr,
 					       querycnt,
 					       choicestr,
 					       choicecnt,
@@ -1671,33 +1671,33 @@
 					       nochangeix, /* sighup ix */
 					       nochangeix);/* sigquit ix */
 		ackcnt = 0;
-		if ( responseix == nochangeix ) {
-			ackstr[ ackcnt++ ] = _("no change\n");
-		} else if ( responseix == allix ) {
+		if (responseix == nochangeix) {
+			ackstr[ackcnt++ ] = _("no change\n");
+		} else if (responseix == allix) {
 			ssselected = -1;
-			ackstr[ ackcnt++ ] = _("all subsystems selected\n\n");
+			ackstr[ackcnt++ ] = _("all subsystems selected\n\n");
 		} else {
-			ssselected = ( int )responseix;
-			ackstr[ ackcnt++ ] = "\n";
+			ssselected = (int)responseix;
+			ackstr[ackcnt++ ] = "\n";
 		}
-		dlog_multi_ack( ackstr,
-				ackcnt );
-		if ( responseix != nochangeix ) {
+		dlog_multi_ack(ackstr,
+				ackcnt);
+		if (responseix != nochangeix) {
 			querycnt = 0;
-			querystr[ querycnt++ ] = ("please select one of the "
+			querystr[querycnt++ ] = ("please select one of the "
 						  "following verbosity levels\n");
-			assert( querycnt <= QUERYMAX );
+			assert(querycnt <= QUERYMAX);
 			choicecnt = 0;
-			choicestr[ choicecnt++ ] = _("silent");
-			choicestr[ choicecnt++ ] = _("verbose");
-			choicestr[ choicecnt++ ] = _("trace");
-			choicestr[ choicecnt++ ] = _("debug");
-			choicestr[ choicecnt++ ] = _("nitty");
-			choicestr[ choicecnt++ ] = _("nitty + 1");
+			choicestr[choicecnt++ ] = _("silent");
+			choicestr[choicecnt++ ] = _("verbose");
+			choicestr[choicecnt++ ] = _("trace");
+			choicestr[choicecnt++ ] = _("debug");
+			choicestr[choicecnt++ ] = _("nitty");
+			choicestr[choicecnt++ ] = _("nitty + 1");
 			nochangeix = choicecnt;
-			choicestr[ choicecnt++ ] = _("no change");
-			assert( choicecnt <= CHOICEMAX );
-			responseix = dlog_multi_query( querystr,
+			choicestr[choicecnt++ ] = _("no change");
+			assert(choicecnt <= CHOICEMAX);
+			responseix = dlog_multi_query(querystr,
 						       querycnt,
 						       choicestr,
 						       choicecnt,
@@ -1710,7 +1710,7 @@
 						       ?
 						       IXMAX
 						       :
-			     ( ix_t )mlog_level_ss[ ssselected ], /* hiliteix */
+			     (ix_t)mlog_level_ss[ssselected], /* hiliteix */
 						       0,       /* defaultstr */
 						      nochangeix,/* defaultix */
 						    DLOG_TIMEOUT,/* timeout */
@@ -1719,57 +1719,57 @@
 						     nochangeix, /* sighup ix */
 						    nochangeix);/* sigquit ix */
 			ackcnt = 0;
-			if ( responseix == nochangeix
+			if (responseix == nochangeix
 			     ||
-			     ( ssselected >= 0
+			     (ssselected >= 0
 			       &&
 			       responseix
 			       ==
-			       ( ix_t )mlog_level_ss[ ssselected ] )) {
-				ackstr[ ackcnt++ ] = _("no change\n");
+			       (ix_t)mlog_level_ss[ssselected])) {
+				ackstr[ackcnt++ ] = _("no change\n");
 			} else {
-				if ( ssselected < 0 ) {
+				if (ssselected < 0) {
 					ix_t ssix;
-					assert( ssselected == -1 );
-					for ( ssix = 0
+					assert(ssselected == -1);
+					for (ssix = 0
 					      ;
 					      ssix < MLOG_SS_CNT
 					      ;
-					      ssix++ ) {
-						mlog_level_ss[ ssix ] =
-							( int )responseix;
+					      ssix++) {
+						mlog_level_ss[ssix] =
+							(int)responseix;
 					}
 				} else {
-					mlog_level_ss[ ssselected ] =
-							( int )responseix;
+					mlog_level_ss[ssselected] =
+							(int)responseix;
 				}
-				ackstr[ ackcnt++ ] = _("level changed\n");
+				ackstr[ackcnt++ ] = _("level changed\n");
 			}
-			dlog_multi_ack( ackstr,
-					ackcnt );
+			dlog_multi_ack(ackstr,
+					ackcnt);
 		}
-	} else if ( responseix == metricsix ) {
+	} else if (responseix == metricsix) {
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = "\n";
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		ackstr[ackcnt++ ] = "\n";
+		dlog_multi_ack(ackstr,
+				ackcnt);
 		querycnt = 0;
-		querystr[ querycnt++ ] = _("please select one of "
+		querystr[querycnt++ ] = _("please select one of "
 					  "the following metrics\n");
-		assert( querycnt <= QUERYMAX );
+		assert(querycnt <= QUERYMAX);
 		choicecnt = 0;
 		ioix = choicecnt;
-		choicestr[ choicecnt++ ] = _("I/O");
+		choicestr[choicecnt++ ] = _("I/O");
 #ifdef RESTORE
 		piix = choicecnt;
-		choicestr[ choicecnt++ ] = _("media inventory status");
+		choicestr[choicecnt++ ] = _("media inventory status");
 		roix = choicecnt;
-		choicestr[ choicecnt++ ] = _("needed media objects");
+		choicestr[choicecnt++ ] = _("needed media objects");
 #endif /* RESTORE */
 		nochangeix = choicecnt;
-		choicestr[ choicecnt++ ] = _("continue");
-		assert( choicecnt <= CHOICEMAX );
-		responseix = dlog_multi_query( querystr,
+		choicestr[choicecnt++ ] = _("continue");
+		assert(choicecnt <= CHOICEMAX);
+		responseix = dlog_multi_query(querystr,
 					       querycnt,
 					       choicestr,
 					       choicecnt,
@@ -1782,31 +1782,31 @@
 					       nochangeix, /* sigint ix */
 					       nochangeix, /* sighup ix */
 					       nochangeix);/* sigquit ix */
-		if ( responseix != nochangeix ) {
+		if (responseix != nochangeix) {
 			ackcnt = 0;
-			ackstr[ ackcnt++ ] = "\n";
-			dlog_multi_ack( ackstr,
-					ackcnt );
+			ackstr[ackcnt++ ] = "\n";
+			dlog_multi_ack(ackstr,
+					ackcnt);
 		}
-		if ( responseix == ioix ) {
-			drive_display_metrics( );
+		if (responseix == ioix) {
+			drive_display_metrics();
 #ifdef RESTORE
-		} else if ( responseix == piix ) {
-			content_showinv( );
-		} else if ( responseix == roix ) {
-			content_showremainingobjects( );
+		} else if (responseix == piix) {
+			content_showinv();
+		} else if (responseix == roix) {
+			content_showremainingobjects();
 #endif /* RESTORE */
 		}
 
-		if ( responseix != nochangeix ) {
+		if (responseix != nochangeix) {
 			querycnt = 0;
-			querystr[ querycnt++ ] = "\n";
-			assert( querycnt <= QUERYMAX );
+			querystr[querycnt++ ] = "\n";
+			assert(querycnt <= QUERYMAX);
 			choicecnt = 0;
 			nochangeix = choicecnt;
-			choicestr[ choicecnt++ ] = _("continue");
-			assert( choicecnt <= CHOICEMAX );
-			responseix = dlog_multi_query( querystr,
+			choicestr[choicecnt++ ] = _("continue");
+			assert(choicecnt <= CHOICEMAX);
+			responseix = dlog_multi_query(querystr,
 						       querycnt,
 						       choicestr,
 						       choicecnt,
@@ -1821,56 +1821,56 @@
 						       nochangeix);/*sigquitix*/
 		}
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = _("continuing\n");
-		dlog_multi_ack( ackstr,
-				ackcnt );
-	} else if ( responseix == mediachangeix ) {
+		ackstr[ackcnt++ ] = _("continuing\n");
+		dlog_multi_ack(ackstr,
+				ackcnt);
+	} else if (responseix == mediachangeix) {
 		ackcnt = 0;
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		dlog_multi_ack(ackstr,
+				ackcnt);
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = content_mediachange_query( );
-		dlog_multi_ack( ackstr,
-				ackcnt );
-	} else if ( responseix == controlix ) {
+		ackstr[ackcnt++] = content_mediachange_query();
+		dlog_multi_ack(ackstr,
+				ackcnt);
+	} else if (responseix == controlix) {
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = "\n";
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		ackstr[ackcnt++ ] = "\n";
+		dlog_multi_ack(ackstr,
+				ackcnt);
 		querycnt = 0;
-		querystr[ querycnt++ ] = _("please select one of "
+		querystr[querycnt++ ] = _("please select one of "
 					   "the following controls\n");
-		assert( querycnt <= QUERYMAX );
+		assert(querycnt <= QUERYMAX);
 		choicecnt = 0;
 		progix = choicecnt;
-		if ( progrpt_enabledpr ) {
-		    choicestr[ choicecnt++ ] = _("change interval of "
+		if (progrpt_enabledpr) {
+		    choicestr[choicecnt++ ] = _("change interval of "
 					         "or disable progress reports");
 		} else {
-		    choicestr[ choicecnt++ ] = _("enable progress reports");
+		    choicestr[choicecnt++ ] = _("enable progress reports");
 		}
 		mllevix = choicecnt;
-		if ( mlog_showlevel ) {
-			choicestr[ choicecnt++ ] = _("hide log message levels");
+		if (mlog_showlevel) {
+			choicestr[choicecnt++ ] = _("hide log message levels");
 		} else {
-			choicestr[ choicecnt++ ] = _("show log message levels");
+			choicestr[choicecnt++ ] = _("show log message levels");
 		}
 		mlssix = choicecnt;
-		if ( mlog_showss ) {
-			choicestr[ choicecnt++ ] = _("hide log message subsystems");
+		if (mlog_showss) {
+			choicestr[choicecnt++ ] = _("hide log message subsystems");
 		} else {
-			choicestr[ choicecnt++ ] = _("show log message subsystems");
+			choicestr[choicecnt++ ] = _("show log message subsystems");
 		}
 		mltsix = choicecnt;
-		if ( mlog_timestamp ) {
-			choicestr[ choicecnt++ ] = _("hide log message timestamps");
+		if (mlog_timestamp) {
+			choicestr[choicecnt++ ] = _("hide log message timestamps");
 		} else {
-			choicestr[ choicecnt++ ] = _("show log message timestamps");
+			choicestr[choicecnt++ ] = _("show log message timestamps");
 		}
 		nochangeix = choicecnt;
-		choicestr[ choicecnt++ ] = _("continue");
-		assert( choicecnt <= CHOICEMAX );
-		responseix = dlog_multi_query( querystr,
+		choicestr[choicecnt++ ] = _("continue");
+		assert(choicecnt <= CHOICEMAX);
+		responseix = dlog_multi_query(querystr,
 					       querycnt,
 					       choicestr,
 					       choicecnt,
@@ -1884,165 +1884,165 @@
 					       nochangeix, /* sighup ix */
 					       nochangeix);/* sigquit ix */
 		ackcnt = 0;
-		if ( responseix == progix ) {
-			char buf[ 10 ];
+		if (responseix == progix) {
+			char buf[10];
 			const size_t ncix = 1;
 			const size_t okix = 2;
 
-			ackstr[ ackcnt++ ] = "\n";
-			dlog_multi_ack( ackstr,
-					ackcnt );
+			ackstr[ackcnt++ ] = "\n";
+			dlog_multi_ack(ackstr,
+					ackcnt);
 			ackcnt = 0;
-			responseix = dlog_string_query( prompt_prog_cb,
+			responseix = dlog_string_query(prompt_prog_cb,
 							0,
 							buf,
-							sizeof( buf ),
+							sizeof(buf),
 							DLOG_TIMEOUT,
 							ncix,/* timeout ix */
 							ncix, /* sigint ix */
 							ncix,  /* sighup ix */
 							ncix,  /* sigquit ix */
-							okix );
-			if ( responseix == okix ) {
+							okix);
+			if (responseix == okix) {
 				int newinterval;
-				newinterval = atoi( buf );
-				if ( ! strlen( buf )) {
-					ackstr[ ackcnt++ ] = _("no change\n");
-				} else if ( newinterval > 0 ) {
+				newinterval = atoi(buf);
+				if (! strlen(buf)) {
+					ackstr[ackcnt++ ] = _("no change\n");
+				} else if (newinterval > 0) {
 					time32_t newdeadline;
-					char intervalbuf[ 64 ];
-					newdeadline = time( 0 ) + ( time32_t )newinterval;
-					if ( progrpt_enabledpr ) {
-						if ( ( time32_t )newinterval == progrpt_interval ) {
-							ackstr[ ackcnt++ ] = _("no change\n");
+					char intervalbuf[64];
+					newdeadline = time(0) + (time32_t)newinterval;
+					if (progrpt_enabledpr) {
+						if ((time32_t)newinterval == progrpt_interval) {
+							ackstr[ackcnt++ ] = _("no change\n");
 						} else {
-							ackstr[ ackcnt++ ] = _("changing progress report interval to ");
-							sprintf( intervalbuf,
+							ackstr[ackcnt++ ] = _("changing progress report interval to ");
+							sprintf(intervalbuf,
 								 _("%d seconds\n"),
-								 newinterval );
-							assert( strlen( intervalbuf )
+								 newinterval);
+							assert(strlen(intervalbuf)
 								<
-								sizeof( intervalbuf ));
-							ackstr[ ackcnt++ ] = intervalbuf;
-							if ( progrpt_deadline > newdeadline ) {
+								sizeof(intervalbuf));
+							ackstr[ackcnt++] = intervalbuf;
+							if (progrpt_deadline > newdeadline) {
 								progrpt_deadline = newdeadline;
 							}
 						}
 					} else {
-						ackstr[ ackcnt++ ] = _("enabling progress reports at ");
-						sprintf( intervalbuf,
+						ackstr[ackcnt++ ] = _("enabling progress reports at ");
+						sprintf(intervalbuf,
 							 _("%d second intervals\n"),
-							 newinterval );
-						assert( strlen( intervalbuf )
+							 newinterval);
+						assert(strlen(intervalbuf)
 							<
-							sizeof( intervalbuf ));
-						ackstr[ ackcnt++ ] = intervalbuf;
+							sizeof(intervalbuf));
+						ackstr[ackcnt++] = intervalbuf;
 						progrpt_enabledpr = BOOL_TRUE;
 						progrpt_deadline = newdeadline;
 					}
-					progrpt_interval = ( time32_t )newinterval;
+					progrpt_interval = (time32_t)newinterval;
 				} else {
-					if ( progrpt_enabledpr ) {
-						ackstr[ ackcnt++ ] = _("disabling progress reports\n");
+					if (progrpt_enabledpr) {
+						ackstr[ackcnt++ ] = _("disabling progress reports\n");
 					} else {
-						ackstr[ ackcnt++ ] = _("no change\n");
+						ackstr[ackcnt++ ] = _("no change\n");
 					}
 					progrpt_enabledpr = BOOL_FALSE;
 				}
 			} else {
-				ackstr[ ackcnt++ ] = _("no change\n");
+				ackstr[ackcnt++ ] = _("no change\n");
 			}
-		} else if ( responseix == mllevix ) {
+		} else if (responseix == mllevix) {
 			mlog_showlevel = ! mlog_showlevel;
-			if ( mlog_showlevel ) {
-				ackstr[ ackcnt++ ] = _("showing log message levels\n");
+			if (mlog_showlevel) {
+				ackstr[ackcnt++ ] = _("showing log message levels\n");
 			} else {
-				ackstr[ ackcnt++ ] = _("hiding log message levels\n");
+				ackstr[ackcnt++ ] = _("hiding log message levels\n");
 			}
-		} else if ( responseix == mlssix ) {
+		} else if (responseix == mlssix) {
 			mlog_showss = ! mlog_showss;
-			if ( mlog_showss ) {
-				ackstr[ ackcnt++ ] = _("showing log message subsystems\n");
+			if (mlog_showss) {
+				ackstr[ackcnt++ ] = _("showing log message subsystems\n");
 			} else {
-				ackstr[ ackcnt++ ] = _("hiding log message subsystems\n");
+				ackstr[ackcnt++ ] = _("hiding log message subsystems\n");
 			}
-		} else if ( responseix == mltsix ) {
+		} else if (responseix == mltsix) {
 			mlog_timestamp = ! mlog_timestamp;
-			if ( mlog_timestamp ) {
-				ackstr[ ackcnt++ ] = _("showing log message timestamps\n");
+			if (mlog_timestamp) {
+				ackstr[ackcnt++ ] = _("showing log message timestamps\n");
 			} else {
-				ackstr[ ackcnt++ ] = _("hiding log message timestamps\n");
+				ackstr[ackcnt++ ] = _("hiding log message timestamps\n");
 			}
 		}
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		dlog_multi_ack(ackstr,
+				ackcnt);
 	} else {
 		ackcnt = 0;
-		ackstr[ ackcnt++ ] = _("continuing\n");
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		ackstr[ackcnt++ ] = _("continuing\n");
+		dlog_multi_ack(ackstr,
+				ackcnt);
 	}
 
-	fold_init( fold, _("end dialog"), '-' );
+	fold_init(fold, _("end dialog"), '-');
 	postamblecnt = 0;
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
 	return stop_requested;
 }
 
 static char *
-sigintstr( void )
+sigintstr(void)
 {
 	int ttyfd;
-	static char buf[ 20 ];
+	static char buf[20];
 	struct termios termios;
 	cc_t intchr;
 	int rval;
 
-	ttyfd = dlog_fd( );
-	if ( ttyfd == -1 ) {
+	ttyfd = dlog_fd();
+	if (ttyfd == -1) {
 		return 0;
 	}
 
-	rval = tcgetattr( ttyfd, &termios );
-	if ( rval ) {
-		mlog( MLOG_NITTY | MLOG_PROC,
+	rval = tcgetattr(ttyfd, &termios);
+	if (rval) {
+		mlog(MLOG_NITTY | MLOG_PROC,
 		      "could not get controlling terminal information: %s\n",
-		      strerror( errno ));
+		      strerror(errno));
 		return 0;
 	}
 
-	intchr = termios.c_cc[ VINTR ];
-	mlog( MLOG_NITTY | MLOG_PROC,
+	intchr = termios.c_cc[VINTR];
+	mlog(MLOG_NITTY | MLOG_PROC,
 	      "tty fd: %d; terminal interrupt character: %c (0%o)\n",
 	      ttyfd,
 	      intchr,
-	      intchr );
+	      intchr);
 
-	if ( intchr < ' ' ) {
-		sprintf( buf, "^%c", intchr + '@' );
-	} else if ( intchr == 0177 ) {
-		sprintf( buf, "DEL" );
+	if (intchr < ' ') {
+		sprintf(buf, "^%c", intchr + '@');
+	} else if (intchr == 0177) {
+		sprintf(buf, "DEL");
 	} else {
-		sprintf( buf, "%c", intchr );
+		sprintf(buf, "%c", intchr);
 	}
-	assert( strlen( buf ) < sizeof( buf ));
+	assert(strlen(buf) < sizeof(buf));
 
 	return buf;
 }
 
 #ifdef DUMP
 static bool_t
-set_rlimits( void )
+set_rlimits(void)
 #endif /* DUMP */
 #ifdef RESTORE
 static bool_t
-set_rlimits( size64_t *vmszp )
+set_rlimits(size64_t *vmszp)
 #endif /* RESTORE */
 {
 	struct rlimit64 rlimit64;
@@ -2052,40 +2052,40 @@
 	/* REFERENCED */
 	int rval;
 
-	assert( minstacksz <= maxstacksz );
+	assert(minstacksz <= maxstacksz);
 
-	rval = getrlimit64( RLIMIT_AS, &rlimit64 );
+	rval = getrlimit64(RLIMIT_AS, &rlimit64);
 
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_AS org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 #ifdef RESTORE
 	if (rlimit64.rlim_cur != RLIM64_INFINITY) {
 		rlimit64.rlim_cur = rlimit64.rlim_max;
-		( void )setrlimit64( RLIMIT_AS, &rlimit64 );
-		rval = getrlimit64( RLIMIT_AS, &rlimit64 );
-		assert( ! rval );
-		mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+		(void)setrlimit64(RLIMIT_AS, &rlimit64);
+		rval = getrlimit64(RLIMIT_AS, &rlimit64);
+		assert(! rval);
+		mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 			"RLIMIT_VMEM now cur 0x%llx max 0x%llx\n",
 			rlimit64.rlim_cur,
-			rlimit64.rlim_max );
+			rlimit64.rlim_max);
 	}
 
-	vmsz = ( size64_t )rlimit64.rlim_cur;
+	vmsz = (size64_t)rlimit64.rlim_cur;
 #endif /* RESTORE */
 
-	assert( minstacksz <= maxstacksz );
-	rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	assert(minstacksz <= maxstacksz);
+	rval = getrlimit64(RLIMIT_STACK, &rlimit64);
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_STACK org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
-	if ( rlimit64.rlim_cur < minstacksz ) {
-		if ( rlimit64.rlim_max < minstacksz ) {
-			mlog( MLOG_DEBUG
+	      rlimit64.rlim_max);
+	if (rlimit64.rlim_cur < minstacksz) {
+		if (rlimit64.rlim_max < minstacksz) {
+			mlog(MLOG_DEBUG
 			      |
 			      MLOG_NOLOCK
 			      |
@@ -2093,14 +2093,14 @@
 			      "raising stack size hard limit "
 			      "from 0x%llx to 0x%llx\n",
 			      rlimit64.rlim_max,
-			      minstacksz );
+			      minstacksz);
 			rlimit64.rlim_cur = minstacksz;
 			rlimit64.rlim_max = minstacksz;
-			( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
-			rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-			assert( ! rval );
-			if ( rlimit64.rlim_cur < minstacksz ) {
-				mlog( MLOG_NORMAL
+			(void)setrlimit64(RLIMIT_STACK, &rlimit64);
+			rval = getrlimit64(RLIMIT_STACK, &rlimit64);
+			assert(! rval);
+			if (rlimit64.rlim_cur < minstacksz) {
+				mlog(MLOG_NORMAL
 				      |
 				      MLOG_WARNING
 				      |
@@ -2110,10 +2110,10 @@
 				      _("unable to raise stack size hard limit "
 				      "from 0x%llx to 0x%llx\n"),
 				      rlimit64.rlim_max,
-				      minstacksz );
+				      minstacksz);
 			}
 		} else {
-			mlog( MLOG_DEBUG
+			mlog(MLOG_DEBUG
 			      |
 			      MLOG_NOLOCK
 			      |
@@ -2121,13 +2121,13 @@
 			      "raising stack size soft limit "
 			      "from 0x%llx to 0x%llx\n",
 			      rlimit64.rlim_cur,
-			      minstacksz );
+			      minstacksz);
 			rlimit64.rlim_cur = minstacksz;
-			( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
-			rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-			assert( ! rval );
-			if ( rlimit64.rlim_cur < minstacksz ) {
-				mlog( MLOG_NORMAL
+			(void)setrlimit64(RLIMIT_STACK, &rlimit64);
+			rval = getrlimit64(RLIMIT_STACK, &rlimit64);
+			assert(! rval);
+			if (rlimit64.rlim_cur < minstacksz) {
+				mlog(MLOG_NORMAL
 				      |
 				      MLOG_WARNING
 				      |
@@ -2137,11 +2137,11 @@
 				      _("unable to raise stack size soft limit "
 				      "from 0x%llx to 0x%llx\n"),
 				      rlimit64.rlim_cur,
-				      minstacksz );
+				      minstacksz);
 			}
 		}
-	} else if ( rlimit64.rlim_cur > maxstacksz ) {
-		mlog( MLOG_DEBUG
+	} else if (rlimit64.rlim_cur > maxstacksz) {
+		mlog(MLOG_DEBUG
 		      |
 		      MLOG_NOLOCK
 		      |
@@ -2149,13 +2149,13 @@
 		      "lowering stack size soft limit "
 		      "from 0x%llx to 0x%llx\n",
 		      rlimit64.rlim_cur,
-		      maxstacksz );
+		      maxstacksz);
 		rlimit64.rlim_cur = maxstacksz;
-		( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
-		rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-		assert( ! rval );
-		if ( rlimit64.rlim_cur > maxstacksz ) {
-			mlog( MLOG_NORMAL
+		(void)setrlimit64(RLIMIT_STACK, &rlimit64);
+		rval = getrlimit64(RLIMIT_STACK, &rlimit64);
+		assert(! rval);
+		if (rlimit64.rlim_cur > maxstacksz) {
+			mlog(MLOG_NORMAL
 			      |
 			      MLOG_WARNING
 			      |
@@ -2165,52 +2165,52 @@
 			      _("unable to lower stack size soft limit "
 			      "from 0x%llx to 0x%llx\n"),
 			      rlimit64.rlim_cur,
-			      maxstacksz );
+			      maxstacksz);
 		}
 	}
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_STACK new cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 
-	rval = getrlimit64( RLIMIT_DATA, &rlimit64 );
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	rval = getrlimit64(RLIMIT_DATA, &rlimit64);
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_DATA org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 
-	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	rval = getrlimit64(RLIMIT_FSIZE, &rlimit64);
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_FSIZE org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 	rlimit64.rlim_cur = rlimit64.rlim_max;
-	( void )setrlimit64( RLIMIT_FSIZE, &rlimit64 );
+	(void)setrlimit64(RLIMIT_FSIZE, &rlimit64);
 	rlimit64.rlim_cur = RLIM64_INFINITY;
-	( void )setrlimit64( RLIMIT_FSIZE, &rlimit64 );
-	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	(void)setrlimit64(RLIMIT_FSIZE, &rlimit64);
+	rval = getrlimit64(RLIMIT_FSIZE, &rlimit64);
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_FSIZE now cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 
-	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	rval = getrlimit64(RLIMIT_CPU, &rlimit64);
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_CPU cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 	rlimit64.rlim_cur = rlimit64.rlim_max;
-	( void )setrlimit64( RLIMIT_CPU, &rlimit64 );
-	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
-	assert( ! rval );
-	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
+	(void)setrlimit64(RLIMIT_CPU, &rlimit64);
+	rval = getrlimit64(RLIMIT_CPU, &rlimit64);
+	assert(! rval);
+	mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_CPU now cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
-	      rlimit64.rlim_max );
+	      rlimit64.rlim_max);
 
 #ifdef RESTORE
 	*vmszp = vmsz;
@@ -2225,7 +2225,7 @@
 
 typedef struct sig_printmap sig_printmap_t;
 
-static sig_printmap_t sig_printmap[ ] = {
+static sig_printmap_t sig_printmap[] = {
 	{SIGHUP,	"SIGHUP"},
 	{SIGINT,	"SIGINT"},
 	{SIGQUIT,	"SIGQUIT"},
@@ -2256,16 +2256,16 @@
 };
 
 static char *
-sig_numstring( int num )
+sig_numstring(int num)
 {
 	sig_printmap_t *p = sig_printmap;
 	sig_printmap_t *endp = sig_printmap
 			       +
-			       ( sizeof( sig_printmap )
+			       (sizeof(sig_printmap)
 			         /
-			         sizeof( sig_printmap[ 0 ] ));
-	for ( ; p < endp ; p++ ) {
-		if ( p->num == num ) {
+			         sizeof(sig_printmap[0]));
+	for (; p < endp ; p++) {
+		if (p->num == num) {
 			return p->string;
 		}
 	}
@@ -2274,18 +2274,18 @@
 }
 
 static char *
-strpbrkquotes( char *p, const char *sep )
+strpbrkquotes(char *p, const char *sep)
 {
 	bool_t prevcharwasbackslash = BOOL_FALSE;
 	bool_t inquotes = BOOL_FALSE;
 
-	for ( ; ; p++ ) {
-		if ( *p == 0 ) {
+	for (; ; p++) {
+		if (*p == 0) {
 			return 0;
 		}
 
-		if ( *p == '\\' ) {
-			if ( ! prevcharwasbackslash ) {
+		if (*p == '\\') {
+			if (! prevcharwasbackslash) {
 				prevcharwasbackslash = BOOL_TRUE;
 			} else {
 				prevcharwasbackslash = BOOL_FALSE;
@@ -2293,12 +2293,12 @@
 			continue;
 		}
 
-		if ( *p == '"' ) {
-			if ( prevcharwasbackslash ) {
+		if (*p == '"') {
+			if (prevcharwasbackslash) {
 				prevcharwasbackslash = BOOL_FALSE;
 				continue;
 			}
-			if ( inquotes ) {
+			if (inquotes) {
 				inquotes = BOOL_FALSE;
 			} else {
 				inquotes = BOOL_TRUE;
@@ -2306,8 +2306,8 @@
 			continue;
 		}
 
-		if ( ! inquotes ) {
-			if ( strchr( sep, ( int )( *p ))) {
+		if (! inquotes) {
+			if (strchr(sep, (int)(*p))) {
 				return p;
 			}
 		}
@@ -2318,18 +2318,18 @@
 }
 
 static char *
-stripquotes( char *p )
+stripquotes(char *p)
 {
-	size_t len = strlen( p );
+	size_t len = strlen(p);
 	char *endp;
 	char *nextp;
 	bool_t justremovedbackslash;
 
-	if ( len > 2 && p[ 0 ] == '"' ) {
+	if (len > 2 && p[0 ] == '"') {
 		p++;
 		len--;
-		if ( len && p[ len - 1 ] == '"' ) {
-			p[ len - 1 ] = 0;
+		if (len && p[len - 1 ] == '"') {
+			p[len - 1] = 0;
 			len--;
 		}
 	}
@@ -2337,9 +2337,9 @@
 	endp = p + len;
 	justremovedbackslash = BOOL_FALSE;
 
-	for ( nextp = p ; nextp < endp ; ) {
-		if ( *nextp == '\\' && ! justremovedbackslash ) {
-			shiftleftby1( nextp, endp );
+	for (nextp = p ; nextp < endp ;) {
+		if (*nextp == '\\' && ! justremovedbackslash) {
+			shiftleftby1(nextp, endp);
 			endp--;
 			justremovedbackslash = BOOL_TRUE;
 		} else {
@@ -2352,9 +2352,9 @@
 }
 
 static void
-shiftleftby1( char *p, char *endp )
+shiftleftby1(char *p, char *endp)
 {
-	for ( ; p < endp ; p++ ) {
-		*p = p[ 1 ];
+	for (; p < endp ; p++) {
+		*p = p[1];
 	}
 }
diff --git a/common/media.c b/common/media.c
index 817e99e..15c0478 100644
--- a/common/media.c
+++ b/common/media.c
@@ -42,7 +42,7 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
+extern void usage(void);
 
 /* declare all media strategies here
  */
@@ -52,7 +52,7 @@
 
 /* forward declarations of locally defined static functions ******************/
 
-static media_t *media_alloc( drive_t *, char * );
+static media_t *media_alloc(drive_t *, char *);
 
 
 /* definition of locally defined global variables ****************************/
@@ -74,7 +74,7 @@
  * and create and initialize media managers for each stream.
  */
 media_strategy_t *
-media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
+media_create(int argc, char *argv[], drive_strategy_t *dsp)
 {
 	int c;
 	size_t mediaix;
@@ -82,42 +82,42 @@
 	media_t **mediapp;
 	char *medialabel;
 	media_strategy_t **spp = strategyp;
-	media_strategy_t **epp = strategyp + sizeof( strategyp )
+	media_strategy_t **epp = strategyp + sizeof(strategyp)
 					     /
-					     sizeof( strategyp[ 0 ] );
+					     sizeof(strategyp[0]);
 	media_strategy_t *chosen_sp;
 	int id;
 	bool_t ok;
 
 	/* sanity check asserts
 	 */
-	assert( sizeof( media_hdr_t ) == MEDIA_HDR_SZ );
-	assert( MEDIA_MARKLOG_SZ == sizeof( media_marklog_t ));
+	assert(sizeof(media_hdr_t) == MEDIA_HDR_SZ);
+	assert(MEDIA_MARKLOG_SZ == sizeof(media_marklog_t));
 
 	/* scan the command line for a media label
 	 */
 	medialabel = 0;
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 #ifdef DUMP
 		case GETOPT_MEDIALABEL:
-			if ( medialabel ) {
-				mlog( MLOG_NORMAL,
+			if (medialabel) {
+				mlog(MLOG_NORMAL,
 				      _("too many -%c arguments: "
 				      "\"-%c %s\" already given\n"),
 				      c,
 				      c,
-				      medialabel );
-				usage( );
+				      medialabel);
+				usage();
 				return 0;
 			}
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL,
 				      _("-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return 0;
 			}
 			medialabel = optarg;
@@ -128,10 +128,10 @@
 
 	/* if no media label specified, synthesize one
 	 */
-	if ( ! medialabel ) {
+	if (! medialabel) {
 		/* not useful
-		mlog( MLOG_VERBOSE,
-		      _("WARNING: no media label specified\n") );
+		mlog(MLOG_VERBOSE,
+		      _("WARNING: no media label specified\n"));
 		*/
 		medialabel = "";
 	}
@@ -142,11 +142,11 @@
 	 * match phase, and given to the winning strategy.
 	 */
 	mediacnt = dsp->ds_drivecnt;
-	mediapp = ( media_t ** )calloc( mediacnt, sizeof( media_t * ));
-	assert( mediapp );
-	for ( mediaix = 0 ; mediaix < mediacnt ; mediaix++ ) {
-		mediapp[ mediaix ] = media_alloc( dsp->ds_drivep[ mediaix ],
-					 	  medialabel );
+	mediapp = (media_t **)calloc(mediacnt, sizeof(media_t *));
+	assert(mediapp);
+	for (mediaix = 0 ; mediaix < mediacnt ; mediaix++) {
+		mediapp[mediaix] = media_alloc(dsp->ds_drivep[mediaix],
+					 	  medialabel);
 	}
 
 	/* choose the first strategy which claims appropriateness.
@@ -156,26 +156,26 @@
 	 * media_strategy_t as well as the write headers.
 	 */
 	chosen_sp = 0;
-	for ( id = 0 ; spp < epp ; spp++, id++ ) {
+	for (id = 0 ; spp < epp ; spp++, id++) {
 		(*spp)->ms_id = id;
-		if ( ! chosen_sp ) {
+		if (! chosen_sp) {
 			/* lend the media_t array to the strategy
 			 */
 			(*spp)->ms_mediap = mediapp;
 			(*spp)->ms_dsp = dsp;
 			(*spp)->ms_mediacnt = mediacnt;
-			for ( mediaix = 0 ; mediaix < mediacnt ; mediaix++ ) {
-				media_t *mediap = mediapp[ mediaix ];
+			for (mediaix = 0 ; mediaix < mediacnt ; mediaix++) {
+				media_t *mediap = mediapp[mediaix];
 				mediap->m_strategyp = *spp;
 				mediap->m_writehdrp->mh_strategyid = id;
 			}
-			if ( ( * (*spp)->ms_match )( argc, argv, dsp )) {
+			if ((* (*spp)->ms_match)(argc, argv, dsp)) {
 				chosen_sp = *spp;
 			}
 		}
 	}
-	if ( ! chosen_sp ) {
-		mlog( MLOG_NORMAL,
+	if (! chosen_sp) {
+		mlog(MLOG_NORMAL,
 #ifdef DUMP
 		      _("no media strategy available for selected "
 		      "dump destination(s)\n")
@@ -185,14 +185,14 @@
 		      "restore source(s)\n")
 #endif /* RESTORE */
 			);
-		usage( );
+		usage();
 		return 0;
 	}
 
 	/* give the media_t array to the chosen strategy
 	 */
-	for ( mediaix = 0 ; mediaix < mediacnt ; mediaix++ ) {
-		media_t *mediap = mediapp[ mediaix ];
+	for (mediaix = 0 ; mediaix < mediacnt ; mediaix++) {
+		media_t *mediap = mediapp[mediaix];
 		mediap->m_strategyp = chosen_sp;
 		mediap->m_writehdrp->mh_strategyid = chosen_sp->ms_id;
 	}
@@ -200,8 +200,8 @@
 	/* initialize the strategy. this will cause each of the managers
 	 * to be initialized as well. if error, return 0.
 	 */
-	ok = ( * chosen_sp->ms_create )( chosen_sp, argc, argv );
-	if ( ! ok ) {
+	ok = (* chosen_sp->ms_create)(chosen_sp, argc, argv);
+	if (! ok) {
 		return 0;
 	}
 
@@ -211,40 +211,40 @@
 }
 
 bool_t
-media_init( media_strategy_t *msp, int argc, char *argv[] )
+media_init(media_strategy_t *msp, int argc, char *argv[])
 {
 	bool_t ok;
 
-	ok = ( * msp->ms_init )( msp, argc, argv );
+	ok = (* msp->ms_init)(msp, argc, argv);
 
 	return ok;
 }
 
 void
-media_complete( media_strategy_t *msp )
+media_complete(media_strategy_t *msp)
 {
-	( * msp->ms_complete )( msp );
+	(* msp->ms_complete)(msp);
 }
 
 /* media_get_upper_hdrs - supply pointers to portion of media file headers
  * set aside for upper software layers, as well as to the global hdrs
  */
 void
-media_get_upper_hdrs( media_t *mediap,
+media_get_upper_hdrs(media_t *mediap,
 		      global_hdr_t **grhdrpp,
 		      char **rhdrpp,
 		      size_t *rhdrszp,
 		      global_hdr_t **gwhdrpp,
 		      char **whdrpp,
-		      size_t *whdrszp )
+		      size_t *whdrszp)
 {
 	*grhdrpp = mediap->m_greadhdrp;
 	*rhdrpp = mediap->m_readhdrp->mh_upper;
-	*rhdrszp = sizeof( mediap->m_readhdrp->mh_upper );
+	*rhdrszp = sizeof(mediap->m_readhdrp->mh_upper);
 
 	*gwhdrpp = mediap->m_gwritehdrp;
 	*whdrpp = mediap->m_writehdrp->mh_upper;
-	*whdrszp = sizeof( mediap->m_writehdrp->mh_upper );
+	*whdrszp = sizeof(mediap->m_writehdrp->mh_upper);
 }
 
 
@@ -254,8 +254,8 @@
  * descriptor and read and write media headers
  */
 static media_t *
-media_alloc( drive_t *drivep,
-	     char *medialabel )
+media_alloc(drive_t *drivep,
+	     char *medialabel)
 {
 	media_t *mediap;
 	global_hdr_t *grhdrp;
@@ -265,26 +265,26 @@
 	size_t mrhdrsz;
 	size_t mwhdrsz;
 
-	mediap = ( media_t * )calloc( 1, sizeof( media_t ));
-	assert( mediap );
+	mediap = (media_t *)calloc(1, sizeof(media_t));
+	assert(mediap);
 
 	grhdrp = 0;
 	gwhdrp = 0;
 	mrhdrp = 0;
 	mwhdrp = 0;
-	drive_get_upper_hdrs( drivep,
+	drive_get_upper_hdrs(drivep,
 			      &grhdrp,
-			      ( char ** )&mrhdrp,
+			      (char **)&mrhdrp,
 			      &mrhdrsz,
 			      &gwhdrp,
-			      ( char ** )&mwhdrp,
-			      &mwhdrsz );
-	assert( grhdrp );
-	assert( gwhdrp );
-	assert( mrhdrp );
-	assert( mwhdrp );
-	assert( mrhdrsz == MEDIA_HDR_SZ );
-	assert( mwhdrsz == MEDIA_HDR_SZ );
+			      (char **)&mwhdrp,
+			      &mwhdrsz);
+	assert(grhdrp);
+	assert(gwhdrp);
+	assert(mrhdrp);
+	assert(mwhdrp);
+	assert(mrhdrsz == MEDIA_HDR_SZ);
+	assert(mwhdrsz == MEDIA_HDR_SZ);
 
 	mediap->m_greadhdrp = grhdrp;
 	mediap->m_gwritehdrp = gwhdrp;
@@ -292,14 +292,14 @@
 	mediap->m_writehdrp = mwhdrp;
 	mediap->m_drivep = drivep;
 
-	strncpyterm( mwhdrp->mh_medialabel,
+	strncpyterm(mwhdrp->mh_medialabel,
 		     medialabel,
-		     sizeof( mwhdrp->mh_medialabel ));
+		     sizeof(mwhdrp->mh_medialabel));
 
 #ifdef DUMP
-	uuid_create( mwhdrp->mh_mediaid );
+	uuid_create(mwhdrp->mh_mediaid);
 #else /* DUMP */
-	uuid_clear( mwhdrp->mh_mediaid );
+	uuid_clear(mwhdrp->mh_mediaid);
 #endif /* DUMP */
 
 	return mediap;
diff --git a/common/media.h b/common/media.h
index 0b727e5..64e39ca 100644
--- a/common/media.h
+++ b/common/media.h
@@ -31,20 +31,20 @@
  * argument of the mo_begin_write() operator will be stuffed into the
  * upper layer info, and extracted for the upper layer by mo_begin_read().
  */
-#define MEDIA_HDR_SZ		sizeofmember( drive_hdr_t, dh_upper )
+#define MEDIA_HDR_SZ		sizeofmember(drive_hdr_t, dh_upper)
 
 struct media_hdr {
-	char mh_medialabel[ GLOBAL_HDR_STRING_SZ ];	/* 100  100 */
+	char mh_medialabel[GLOBAL_HDR_STRING_SZ];	/* 100  100 */
 		/* label of media object containing file */
-	char mh_prevmedialabel[ GLOBAL_HDR_STRING_SZ ];	/* 100  200 */
+	char mh_prevmedialabel[GLOBAL_HDR_STRING_SZ];	/* 100  200 */
 		/* label of upstream media object */
-	char mh_pad1[ GLOBAL_HDR_STRING_SZ ];		/* 100  300 */
+	char mh_pad1[GLOBAL_HDR_STRING_SZ];		/* 100  300 */
 		/* in case more labels needed */
 	uuid_t mh_mediaid;				/*  10  310 */
 		/* ID of media object 	*/
 	uuid_t mh_prevmediaid;				/*  10  320 */
 		/* ID of upstream media object */
-	char mh_pad2[ GLOBAL_HDR_UUID_SZ ];		/*  10  330 */
+	char mh_pad2[GLOBAL_HDR_UUID_SZ];		/*  10  330 */
 		/* in case more IDs needed */
 	uint32_t mh_mediaix;				/*   4  334 */
 		/* 0-based index of this media object within the dump stream */
@@ -58,11 +58,11 @@
 		/* 0-based index of this dump within the media object */
 	int32_t mh_strategyid;				/*   4  348 */
 		/* ID of the media strategy used to produce this dump */
-	char mh_pad3[ 0x38 ];				/*  38  380 */
+	char mh_pad3[0x38];				/*  38  380 */
 		/* padding */
-	char mh_specific[ 0x80 ];			/*  80  400 */
+	char mh_specific[0x80];			/*  80  400 */
 		/* media strategy-specific info */
-	char mh_upper[ MEDIA_HDR_SZ - 0x400 ];		/* 400  800 */
+	char mh_upper[MEDIA_HDR_SZ - 0x400];		/* 400  800 */
 		/* header info private to upper software layers */
 };
 
@@ -71,8 +71,8 @@
 /* macros to mark a media file as a terminator. artifact of original
  * media_rmvtape media strategy
  */
-#define MEDIA_TERMINATOR_CHK( mrhp )	( mrhp->mh_specific[ 0 ] & 1 )
-#define MEDIA_TERMINATOR_SET( mwhp )	( mwhp->mh_specific[ 0 ] |= 1 )
+#define MEDIA_TERMINATOR_CHK(mrhp)	(mrhp->mh_specific[0] & 1)
+#define MEDIA_TERMINATOR_SET(mwhp)	(mwhp->mh_specific[0] |= 1)
 
 /* media strategy IDs. artifactis of first version of xfsdump
  */
diff --git a/common/media_rmvtape.h b/common/media_rmvtape.h
index 61e80e1..4116a14 100644
--- a/common/media_rmvtape.h
+++ b/common/media_rmvtape.h
@@ -53,8 +53,8 @@
 #define TERM_IS_SET(rmv_hdrp)	(rmv_hdrp->mrmv_flags & RMVMEDIA_TERMINATOR_BLOCK)
 
 
-#define CAN_OVERWRITE( drivep )	(drivep->d_capabilities & DRIVE_CAP_OVERWRITE)
-#define CAN_APPEND( drivep )	(drivep->d_capabilities & DRIVE_CAP_APPEND)
-#define CAN_BSF( drivep )	(drivep->d_capabilities & DRIVE_CAP_BSF)
+#define CAN_OVERWRITE(drivep)	(drivep->d_capabilities & DRIVE_CAP_OVERWRITE)
+#define CAN_APPEND(drivep)	(drivep->d_capabilities & DRIVE_CAP_APPEND)
+#define CAN_BSF(drivep)	(drivep->d_capabilities & DRIVE_CAP_BSF)
 
 #endif
diff --git a/common/mlog.c b/common/mlog.c
index 0924bf2..e3cf69d 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -42,7 +42,7 @@
 #include "drive.h"
 
 extern char *progname;
-extern void usage( void );
+extern void usage(void);
 extern pthread_t parenttid;
 
 #ifdef DUMP
@@ -52,7 +52,7 @@
 static FILE *mlog_fp = NULL; /* stdout */;
 #endif /* RESTORE */
 
-int mlog_level_ss[ MLOG_SS_CNT ];
+int mlog_level_ss[MLOG_SS_CNT];
 
 int mlog_showlevel = BOOL_FALSE;
 
@@ -60,11 +60,11 @@
 
 int mlog_timestamp = BOOL_FALSE;
 
-static int mlog_sym_lookup( char * );
+static int mlog_sym_lookup(char *);
 
 static size_t mlog_streamcnt;
 
-static char mlog_levelstr[ 3 ];
+static char mlog_levelstr[3];
 
 #define MLOG_SS_NAME_MAX	15
 #ifdef DUMP
@@ -76,9 +76,9 @@
 #endif /* DUMP */
 #define N(a) (sizeof((a)) / sizeof((a)[0]))
 
-static char mlog_ssstr[ MLOG_SS_NAME_MAX + 2 ];
+static char mlog_ssstr[MLOG_SS_NAME_MAX + 2];
 
-static char mlog_tsstr[ 10 ];
+static char mlog_tsstr[10];
 
 struct mlog_sym {
 	char *sym;
@@ -87,7 +87,7 @@
 
 typedef struct mlog_sym mlog_sym_t;
 
-char *mlog_ss_names[ MLOG_SS_CNT ] = {
+char *mlog_ss_names[MLOG_SS_CNT] = {
 	"general",	/* MLOG_SS_GEN */
 	"proc",		/* MLOG_SS_PROC */
 	"drive",	/* MLOG_SS_DRIVE */
@@ -102,7 +102,7 @@
 	"excluded_files" /* MLOG_SS_EXCLFILES */
 };
 
-static mlog_sym_t mlog_sym[ ] = {
+static mlog_sym_t mlog_sym[] = {
 	{"0",		MLOG_SILENT},
 	{"1",		MLOG_VERBOSE},
 	{"2",		MLOG_TRACE},
@@ -122,7 +122,7 @@
 static rv_t mlog_main_exit_hint = RV_NONE;
 
 void
-mlog_init0( void )
+mlog_init0(void)
 {
 	int i;
 
@@ -134,17 +134,17 @@
 #endif /* RESTORE */
 
 	/* initialize stream count. will be updated later by call to
-	 * mlog_tell_streamcnt( ), after drive layer has counted drives
+	 * mlog_tell_streamcnt(), after drive layer has counted drives
 	 */
 	mlog_streamcnt = 1;
 
-	for( i = 0 ; i < MLOG_SS_CNT ; i++ ) {
-		mlog_level_ss[ i ] = MLOG_VERBOSE;
+	for(i = 0 ; i < MLOG_SS_CNT ; i++) {
+		mlog_level_ss[i] = MLOG_VERBOSE;
 	}
 }
 
 bool_t
-mlog_init1( int argc, char *argv[ ] )
+mlog_init1(int argc, char *argv[])
 {
 	char **suboptstrs;
 	ix_t ssix;
@@ -154,105 +154,105 @@
 
 	/* prepare an array of suboption token strings. this will be the
 	 * concatenation of the subsystem names with the verbosity symbols.
-	 * this array of char pts must be null terminated for getsubopt( 3 ).
+	 * this array of char pts must be null terminated for getsubopt(3).
 	 */
-	vsymcnt = sizeof( mlog_sym ) / sizeof( mlog_sym[ 0 ] );
-	suboptstrs = ( char ** )calloc( MLOG_SS_CNT + vsymcnt + 1,
-					sizeof( char * ));
-	assert( suboptstrs );
-	for ( soix = 0 ; soix < MLOG_SS_CNT ; soix++ ) {
-		assert( strlen( mlog_ss_names[ soix ] ) <= MLOG_SS_NAME_MAX );
+	vsymcnt = sizeof(mlog_sym) / sizeof(mlog_sym[0]);
+	suboptstrs = (char **)calloc(MLOG_SS_CNT + vsymcnt + 1,
+					sizeof(char *));
+	assert(suboptstrs);
+	for (soix = 0 ; soix < MLOG_SS_CNT ; soix++) {
+		assert(strlen(mlog_ss_names[soix]) <= MLOG_SS_NAME_MAX);
 			/* unrelated, but opportunity to chk */
-		suboptstrs[ soix ] = mlog_ss_names[ soix ];
+		suboptstrs[soix] = mlog_ss_names[soix];
 	}
-	for ( ; soix < MLOG_SS_CNT + vsymcnt ; soix++ ) {
-		suboptstrs[ soix ] = mlog_sym[ soix - MLOG_SS_CNT ].sym;
+	for (; soix < MLOG_SS_CNT + vsymcnt ; soix++) {
+		suboptstrs[soix] = mlog_sym[soix - MLOG_SS_CNT].sym;
 	}
-	suboptstrs[ soix ] = 0;
+	suboptstrs[soix] = 0;
 
 	/* set all of the subsystem log levels to -1, so we can see which
 	 * subsystems where explicitly called out. those which weren't will
 	 * be given the "general" level.
 	 */
-	for ( ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++ ) {
-		mlog_level_ss[ ssix ] = -1;
+	for (ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++) {
+		mlog_level_ss[ssix] = -1;
 	}
-	mlog_level_ss[ MLOG_SS_GEN ] = MLOG_VERBOSE;
+	mlog_level_ss[MLOG_SS_GEN] = MLOG_VERBOSE;
 
 	/* get command line options
 	 */
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 		char *options;
 
-		switch ( c ) {
+		switch (c) {
 		case GETOPT_VERBOSITY:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				fprintf( stderr,
+			if (! optarg || optarg[0] == '-') {
+				fprintf(stderr,
 					 _("%s: -%c argument missing\n"),
 					 progname,
-					 c );
-				usage( );
+					 c);
+				usage();
 				return BOOL_FALSE;
 			}
 			options = optarg;
-			while ( *options ) {
+			while (*options) {
 				int suboptix;
 				char *valstr;
 
-				suboptix = getsubopt( &options,
+				suboptix = getsubopt(&options,
 						      (constpp)suboptstrs,
-						      &valstr );
-				if ( suboptix < 0 ) {
-					fprintf( stderr,
+						      &valstr);
+				if (suboptix < 0) {
+					fprintf(stderr,
 						 _("%s: -%c argument invalid\n"),
 						 progname,
-						 c );
-					usage( );
+						 c);
+					usage();
 					return BOOL_FALSE;
 				}
-				assert( ( ix_t )suboptix
+				assert((ix_t)suboptix
 					<
-					MLOG_SS_CNT + vsymcnt );
-				if ( suboptix < MLOG_SS_CNT ) {
-					if ( ! valstr ) {
-						fprintf( stderr,
+					MLOG_SS_CNT + vsymcnt);
+				if (suboptix < MLOG_SS_CNT) {
+					if (! valstr) {
+						fprintf(stderr,
 							 _("%s: -%c subsystem "
 							 "subargument "
 							 "%s requires a "
 							 "verbosity value\n"),
 							 progname,
 							 c,
-						mlog_ss_names[ suboptix ] );
-						usage( );
+						mlog_ss_names[suboptix]);
+						usage();
 						return BOOL_FALSE;
 					}
-					ssix = ( ix_t )suboptix;
-					mlog_level_ss[ ssix ] =
-						    mlog_sym_lookup( valstr );
+					ssix = (ix_t)suboptix;
+					mlog_level_ss[ssix] =
+						    mlog_sym_lookup(valstr);
 				} else {
-					if ( valstr ) {
-						fprintf( stderr,
+					if (valstr) {
+						fprintf(stderr,
 							 _("%s: -%c argument "
 							 "does not require "
 							 "a value\n"),
 							 progname,
-							 c );
-						usage( );
+							 c);
+						usage();
 						return BOOL_FALSE;
 					}
 					ssix = MLOG_SS_GEN;
-					mlog_level_ss[ ssix ] =
-				    mlog_sym_lookup( suboptstrs[ suboptix ] );
+					mlog_level_ss[ssix] =
+				    mlog_sym_lookup(suboptstrs[suboptix]);
 				}
-				if ( mlog_level_ss[ ssix ] < 0 ) {
-					fprintf( stderr,
+				if (mlog_level_ss[ssix] < 0) {
+					fprintf(stderr,
 						 _("%s: -%c argument "
 						 "invalid\n"),
 						 progname,
-						 c );
-					usage( );
+						 c);
+					usage();
 					return BOOL_FALSE;
 				}
 			}
@@ -269,25 +269,25 @@
 		}
 	}
 
-	free( ( void * )suboptstrs );
+	free((void *)suboptstrs);
 
 	/* give subsystems not explicitly called out the "general" verbosity
 	 */
-	for ( ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++ ) {
-		if ( mlog_level_ss[ ssix ] < 0 ) {
-			assert( mlog_level_ss[ ssix ] == -1 );
-			assert( mlog_level_ss[ MLOG_SS_GEN ] >= 0 );
-			mlog_level_ss[ ssix ] = mlog_level_ss[ MLOG_SS_GEN ];
+	for (ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++) {
+		if (mlog_level_ss[ssix] < 0) {
+			assert(mlog_level_ss[ssix] == -1);
+			assert(mlog_level_ss[MLOG_SS_GEN] >= 0);
+			mlog_level_ss[ssix] = mlog_level_ss[MLOG_SS_GEN];
 		}
 	}
 
 	/* prepare a string for optionally displaying the log level
 	 */
-	mlog_levelstr[ 0 ] = 0;
-	mlog_levelstr[ 1 ] = 0;
-	mlog_levelstr[ 2 ] = 0;
-	if ( mlog_showlevel ) {
-		mlog_levelstr[ 0 ] = ':';
+	mlog_levelstr[0] = 0;
+	mlog_levelstr[1] = 0;
+	mlog_levelstr[2] = 0;
+	if (mlog_showlevel) {
+		mlog_levelstr[0] = ':';
 	}
 
 #ifdef DUMP
@@ -296,7 +296,7 @@
 	 * mlog_fd set to stderr, see if we can switch
 	 * to stdout.
 	 */
-	if ( optind >= argc ||  strcmp( argv[ optind ], "-" )) {
+	if (optind >= argc ||  strcmp(argv[optind ], "-")) {
 		mlog_fp = stdout;
 	}
 #endif /* DUMP */
@@ -307,31 +307,31 @@
 }
 
 bool_t
-mlog_init2( void )
+mlog_init2(void)
 {
 	/* allocate a qlock
 	 */
-	mlog_qlockh = qlock_alloc( QLOCK_ORD_MLOG );
+	mlog_qlockh = qlock_alloc(QLOCK_ORD_MLOG);
 
 	return BOOL_TRUE;
 }
 
 void
-mlog_tell_streamcnt( size_t streamcnt )
+mlog_tell_streamcnt(size_t streamcnt)
 {
 	mlog_streamcnt = streamcnt;
 }
 
 void
-mlog_lock( void )
+mlog_lock(void)
 {
-	qlock_lock( mlog_qlockh );
+	qlock_lock(mlog_qlockh);
 }
 
 void
-mlog_unlock( void )
+mlog_unlock(void)
 {
-	qlock_unlock( mlog_qlockh );
+	qlock_unlock(mlog_qlockh);
 }
 
 /*
@@ -341,122 +341,122 @@
  * too much output.
  */
 void
-mlog_override_level( int levelarg )
+mlog_override_level(int levelarg)
 {
 	int level;
 	ix_t ss; /* SubSystem */
 
 	level = levelarg & MLOG_LEVELMASK;
-	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
+	ss = (ix_t)((levelarg & MLOG_SS_MASK) >> MLOG_SS_SHIFT);
 
 	if (ss == MLOG_SS_GEN) { /* do level for all subsys */
-	    for (ss = 0 ; ss < MLOG_SS_CNT ; ss++ ) {
-		mlog_level_ss[ ss ] = level;
+	    for (ss = 0 ; ss < MLOG_SS_CNT ; ss++) {
+		mlog_level_ss[ss] = level;
 	    }
 	}
 	else { /* do a particular subsys */
-	    mlog_level_ss[ ss ] = level;
+	    mlog_level_ss[ss] = level;
 	}
 }
 
 void
-mlog( int levelarg, char *fmt, ... )
+mlog(int levelarg, char *fmt, ...)
 {
 	va_list args;
-	va_start( args, fmt );
-	mlog_va( levelarg, fmt, args );
-	va_end( args );
+	va_start(args, fmt);
+	mlog_va(levelarg, fmt, args);
+	va_end(args);
 }
 
 void
-mlog_va( int levelarg, char *fmt, va_list args )
+mlog_va(int levelarg, char *fmt, va_list args)
 {
 	int level;
 	ix_t ss;
 
 	level = levelarg & MLOG_LEVELMASK;
-	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
+	ss = (ix_t)((levelarg & MLOG_SS_MASK) >> MLOG_SS_SHIFT);
 
-	assert( ss < MLOG_SS_CNT );
-	if ( level > mlog_level_ss[ ss ] ) {
+	assert(ss < MLOG_SS_CNT);
+	if (level > mlog_level_ss[ss]) {
 		return;
 	}
 
-	if ( ! ( levelarg & MLOG_NOLOCK )) {
-		mlog_lock( );
+	if (! (levelarg & MLOG_NOLOCK)) {
+		mlog_lock();
 	}
 
-	if ( ! ( levelarg & MLOG_BARE )) {
+	if (! (levelarg & MLOG_BARE)) {
 		int streamix;
-		streamix = stream_getix( pthread_self( ) );
+		streamix = stream_getix(pthread_self());
 
-		if ( mlog_showss ) {
-			sprintf( mlog_ssstr, ":%s", mlog_ss_names[ ss ] );
+		if (mlog_showss) {
+			sprintf(mlog_ssstr, ":%s", mlog_ss_names[ ss]);
 		} else {
-			mlog_ssstr[ 0 ] = 0;
+			mlog_ssstr[0] = 0;
 		}
 
-		if ( mlog_timestamp ) {
-			time_t now = time( 0 );
-			struct tm *tmp = localtime( &now );
-			sprintf( mlog_tsstr,
+		if (mlog_timestamp) {
+			time_t now = time(0);
+			struct tm *tmp = localtime(&now);
+			sprintf(mlog_tsstr,
 				 ":%02d.%02d.%02d",
 				 tmp->tm_hour,
 				 tmp->tm_min,
-				 tmp->tm_sec );
-			assert( strlen( mlog_tsstr ) < sizeof( mlog_tsstr ));
+				 tmp->tm_sec);
+			assert(strlen(mlog_tsstr) < sizeof(mlog_tsstr));
 		} else {
-			mlog_tsstr[ 0 ] = 0;
+			mlog_tsstr[0] = 0;
 		}
 
-		if ( mlog_showlevel ) {
-			mlog_levelstr[ 0 ] = ':';
-			if ( level > 9 ) {
-				mlog_levelstr[ 1 ] = '?';
+		if (mlog_showlevel) {
+			mlog_levelstr[0] = ':';
+			if (level > 9) {
+				mlog_levelstr[1] = '?';
 			} else {
-				mlog_levelstr[ 1 ] = ( char )
-						     ( level
+				mlog_levelstr[1] = (char)
+						     (level
 						       +
-						       ( int )'0' );
+						       (int)'0');
 			}
 		} else {
-			mlog_levelstr[ 0 ] = 0;
+			mlog_levelstr[0] = 0;
 		}
-		if ( streamix != -1 && mlog_streamcnt > 1 ) {
-			fprintf( mlog_fp,
+		if (streamix != -1 && mlog_streamcnt > 1) {
+			fprintf(mlog_fp,
 				 _("%s%s%s%s: drive %d: "),
 				 progname,
 				 mlog_tsstr,
 				 mlog_ssstr,
 				 mlog_levelstr,
-				 streamix );
+				 streamix);
 		} else {
-			fprintf( mlog_fp,
+			fprintf(mlog_fp,
 				 "%s%s%s%s: ",
 				 progname,
 				 mlog_tsstr,
 				 mlog_ssstr,
-				 mlog_levelstr );
+				 mlog_levelstr);
 		}
-		if ( levelarg & MLOG_NOTE ) {
-			fprintf( mlog_fp,
-				 "NOTE: " );
+		if (levelarg & MLOG_NOTE) {
+			fprintf(mlog_fp,
+				 "NOTE: ");
 		}
-		if ( levelarg & MLOG_WARNING ) {
-			fprintf( mlog_fp,
-				 "WARNING: " );
+		if (levelarg & MLOG_WARNING) {
+			fprintf(mlog_fp,
+				 "WARNING: ");
 		}
-		if ( levelarg & MLOG_ERROR ) {
-			fprintf( mlog_fp,
-				 "ERROR: " );
+		if (levelarg & MLOG_ERROR) {
+			fprintf(mlog_fp,
+				 "ERROR: ");
 		}
 	}
 
-	vfprintf( mlog_fp, fmt, args );
-	fflush( mlog_fp );
+	vfprintf(mlog_fp, fmt, args);
+	fflush(mlog_fp);
 
-	if ( ! ( levelarg & MLOG_NOLOCK )) {
-		mlog_unlock( );
+	if (! (levelarg & MLOG_NOLOCK)) {
+		mlog_unlock();
 	}
 }
 
@@ -569,7 +569,7 @@
  */
 
 int
-_mlog_exit( const char *file, int line, int exit_code, rv_t rv )
+_mlog_exit(const char *file, int line, int exit_code, rv_t rv)
 {
 	pthread_t tid;
 	const struct rv_map *rvp;
@@ -578,7 +578,7 @@
 	rvp = rv_getdesc(rv);
 
 
-	mlog( MLOG_DEBUG | MLOG_NOLOCK,
+	mlog(MLOG_DEBUG | MLOG_NOLOCK,
 	      "%s: %d: mlog_exit called: "
 	      "exit_code: %s return: %s (%s)\n",
 	      file, line,
@@ -586,7 +586,7 @@
 	      rvp->rv_string, rvp->rv_desc);
 
 	if (rv < 0 || rv >= _RV_NUM) {
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
 		      "mlog_exit(): bad return code");
 		return exit_code;
 	}
@@ -598,7 +598,7 @@
 	 * most accurate information about the termination condition.
 	 */
 
-	if ( pthread_equal( tid, parenttid ) ) {
+	if (pthread_equal(tid, parenttid)) {
 		if (mlog_main_exit_code == -1) {
 			mlog_main_exit_code = exit_code;
 			mlog_main_exit_return = rv;
@@ -631,7 +631,7 @@
 }
 
 void
-_mlog_exit_hint( const char *file, int line, rv_t rv )
+_mlog_exit_hint(const char *file, int line, rv_t rv)
 {
 	pthread_t tid;
 	const struct rv_map *rvp;
@@ -639,14 +639,14 @@
 	tid = pthread_self();
 	rvp = rv_getdesc(rv);
 
-	mlog( MLOG_DEBUG | MLOG_NOLOCK,
+	mlog(MLOG_DEBUG | MLOG_NOLOCK,
 	      "%s: %d: mlog_exit_hint called: "
 	      "hint: %s (%s)\n",
 	      file, line,
 	      rvp->rv_string, rvp->rv_desc);
 
 	if (rv < 0 || rv >= _RV_NUM) {
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
 		      "mlog_exit_hint(): bad return code");
 		return;
 	}
@@ -658,22 +658,22 @@
 	 * information about the termination condition.
 	 */
 
-	if ( pthread_equal( tid, parenttid ) )
+	if (pthread_equal(tid, parenttid))
 		mlog_main_exit_hint = rv;
 	else
-		stream_set_hint( tid, rv );
+		stream_set_hint(tid, rv);
 
 }
 
 rv_t
-mlog_get_hint( void )
+mlog_get_hint(void)
 {
 	stream_state_t states[] = { S_RUNNING };
 	/* REFERENCED */
 	bool_t ok;
 	rv_t hint;
 
-	if ( pthread_equal( pthread_self(), parenttid ) )
+	if (pthread_equal(pthread_self(), parenttid))
 		return mlog_main_exit_hint;
 
 	ok = stream_get_exit_status(pthread_self(), states, N(states),
@@ -720,7 +720,7 @@
 	if (ntids > 0) {
 
 		/* print the state of all the streams */
-		fprintf(mlog_fp, _("%s: %s Summary:\n"), progname, PROGSTR_CAPS );
+		fprintf(mlog_fp, _("%s: %s Summary:\n"), progname, PROGSTR_CAPS);
 
 		for (i = 0; i < ntids; i++) {
 			stream_state_t state;
@@ -785,15 +785,15 @@
 }
 
 static int
-mlog_sym_lookup( char *sym )
+mlog_sym_lookup(char *sym)
 {
 	mlog_sym_t *p = mlog_sym;
 	mlog_sym_t *ep = mlog_sym
 			 +
-			 sizeof( mlog_sym ) / sizeof( mlog_sym[ 0 ] );
+			 sizeof(mlog_sym) / sizeof(mlog_sym[0]);
 
-	for ( ; p < ep ; p++ ) {
-		if ( ! strcmp( sym, p->sym )) {
+	for (; p < ep ; p++) {
+		if (! strcmp(sym, p->sym)) {
 			return p->level;
 		}
 	}
@@ -802,7 +802,7 @@
 }
 
 void
-fold_init( fold_t fold, char *infostr, char c )
+fold_init(fold_t fold, char *infostr, char c)
 {
 	size_t infolen;
 	size_t dashlen;
@@ -812,36 +812,36 @@
 	char *endp;
 	ix_t cnt;
 
-	assert( sizeof( fold_t ) == FOLD_LEN + 1 );
+	assert(sizeof(fold_t) == FOLD_LEN + 1);
 
-	infolen = strlen( infostr );
-	if ( infolen > FOLD_LEN - 4 ) {
+	infolen = strlen(infostr);
+	if (infolen > FOLD_LEN - 4) {
 		infolen = FOLD_LEN - 4;
 	}
 	dashlen = FOLD_LEN - infolen - 3;
 	predashlen = dashlen / 2;
 	postdashlen = dashlen - predashlen;
 
-	p = &fold[ 0 ];
-	endp = &fold[ sizeof( fold_t ) - 1 ];
+	p = &fold[0];
+	endp = &fold[sizeof(fold_t) - 1];
 
-	assert( p < endp );
+	assert(p < endp);
 	*p++ = ' ';
-	for ( cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++ ) {
+	for (cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++) {
 		*p = c;
 	}
-	assert( p < endp );
+	assert(p < endp);
 	*p++ = ' ';
-	assert( p < endp );
-	assert( p + infolen < endp );
-	strcpy( p, infostr );
+	assert(p < endp);
+	assert(p + infolen < endp);
+	strcpy(p, infostr);
 	p += infolen;
-	assert( p < endp );
+	assert(p < endp);
 	*p++ = ' ';
-	assert( p < endp );
-	for ( cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++ ) {
+	assert(p < endp);
+	for (cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++) {
 		*p = c;
 	}
-	assert( p <= endp );
+	assert(p <= endp);
 	*p = 0;
 }
diff --git a/common/mlog.h b/common/mlog.h
index 628dd28..f007761 100644
--- a/common/mlog.h
+++ b/common/mlog.h
@@ -60,27 +60,27 @@
 #define MLOG_SS_CNT	7		/* NOTE! bump this when adding ss */
 
 #define MLOG_SS_SHIFT	8
-#define MLOG_SS_MASK	( 0xff << MLOG_SS_SHIFT )
+#define MLOG_SS_MASK	(0xff << MLOG_SS_SHIFT)
 
-/* subsystem flags - NOTE! only one may be specified! use in mlog( first arg )
+/* subsystem flags - NOTE! only one may be specified! use in mlog(first arg)
  */
-#define MLOG_ALL	( MLOG_SS_GEN << MLOG_SS_SHIFT )
-#define MLOG_PROC	( MLOG_SS_PROC << MLOG_SS_SHIFT )
-#define MLOG_DRIVE	( MLOG_SS_DRIVE << MLOG_SS_SHIFT )
-#define MLOG_MEDIA	( MLOG_SS_MEDIA << MLOG_SS_SHIFT )
-#define MLOG_INV	( MLOG_SS_INV << MLOG_SS_SHIFT )
+#define MLOG_ALL	(MLOG_SS_GEN << MLOG_SS_SHIFT)
+#define MLOG_PROC	(MLOG_SS_PROC << MLOG_SS_SHIFT)
+#define MLOG_DRIVE	(MLOG_SS_DRIVE << MLOG_SS_SHIFT)
+#define MLOG_MEDIA	(MLOG_SS_MEDIA << MLOG_SS_SHIFT)
+#define MLOG_INV	(MLOG_SS_INV << MLOG_SS_SHIFT)
 #ifdef DUMP
-#define MLOG_INOMAP	( MLOG_SS_INOMAP << MLOG_SS_SHIFT )
+#define MLOG_INOMAP	(MLOG_SS_INOMAP << MLOG_SS_SHIFT)
 #endif /* DUMP */
 #ifdef RESTORE
-#define MLOG_TREE	( MLOG_SS_TREE << MLOG_SS_SHIFT )
+#define MLOG_TREE	(MLOG_SS_TREE << MLOG_SS_SHIFT)
 #endif /* RESTORE */
-#define MLOG_EXCLFILES	( MLOG_SS_EXCLFILES << MLOG_SS_SHIFT )
+#define MLOG_EXCLFILES	(MLOG_SS_EXCLFILES << MLOG_SS_SHIFT)
 
 /* mlog_level - set during initialization, exported to facilitate
  * message logging decisions. one per subsystem (see above)
  */
-extern int mlog_level_ss[ MLOG_SS_CNT ];
+extern int mlog_level_ss[MLOG_SS_CNT];
 
 /* made external so main.c sigint dialog can change
  */
@@ -90,43 +90,43 @@
 
 /* mlog_ss_name - so main.c sigint dialog can allow changes
  */
-extern char *mlog_ss_names[ MLOG_SS_CNT ];
+extern char *mlog_ss_names[MLOG_SS_CNT];
 
 /* initializes the mlog abstraction. split into two phases to
  * unravel some initialization sequencing problems.
  */
-extern void mlog_init0( void );
-extern bool_t mlog_init1( int argc, char *argv[ ] );
-extern bool_t mlog_init2( void );
+extern void mlog_init0(void);
+extern bool_t mlog_init1(int argc, char *argv[]);
+extern bool_t mlog_init2(void);
 
 /* post-initialization, to tell mlog how many streams
  */
-extern void mlog_tell_streamcnt( size_t streamcnt );
+extern void mlog_tell_streamcnt(size_t streamcnt);
 
 /* override the -v option
  */
-void mlog_override_level( int levelarg );
+void mlog_override_level(int levelarg);
 
 /* vprintf-based message format
  */
-extern void mlog( int level, char *fmt, ... );
-extern void mlog_va( int levelarg, char *fmt, va_list args );
-#define mlog_exit( e, r ) _mlog_exit( __FILE__, __LINE__, (e), (r) )
-extern int  _mlog_exit( const char *file, int line, int exit_code, rv_t return_code );
-#define mlog_exit_hint( r ) _mlog_exit_hint( __FILE__, __LINE__, (r) )
-extern void _mlog_exit_hint( const char *file, int line, rv_t rv );
-extern rv_t mlog_get_hint( void );
-extern void mlog_exit_flush( void );
+extern void mlog(int level, char *fmt, ...);
+extern void mlog_va(int levelarg, char *fmt, va_list args);
+#define mlog_exit(e, r) _mlog_exit(__FILE__, __LINE__, (e), (r))
+extern int  _mlog_exit(const char *file, int line, int exit_code, rv_t return_code);
+#define mlog_exit_hint(r) _mlog_exit_hint(__FILE__, __LINE__, (r))
+extern void _mlog_exit_hint(const char *file, int line, rv_t rv);
+extern rv_t mlog_get_hint(void);
+extern void mlog_exit_flush(void);
 
 /* the following calls are exported ONLY to dlog.c!
  */
-extern void mlog_lock( void );
-extern void mlog_unlock( void );
+extern void mlog_lock(void);
+extern void mlog_unlock(void);
 
 /* fold_t - a character string made to look like a "fold here"
  */
 #define FOLD_LEN	79
-typedef char fold_t[ FOLD_LEN + 1 ];
-extern void fold_init( fold_t fold, char *infostr, char c );
+typedef char fold_t[FOLD_LEN + 1];
+extern void fold_init(fold_t fold, char *infostr, char c);
 
 #endif /* MLOG_H */
diff --git a/common/openutil.c b/common/openutil.c
index fcb52fc..6b7b1b6 100644
--- a/common/openutil.c
+++ b/common/openutil.c
@@ -32,15 +32,15 @@
 #include "mlog.h"
 
 char *
-open_pathalloc( char *dirname, char *basename, pid_t pid )
+open_pathalloc(char *dirname, char *basename, pid_t pid)
 {
 	size_t dirlen;
 	size_t pidlen;
 	size_t namelen;
 	char *namebuf;
 
-	if ( strcmp( dirname, "/" )) {
-		dirlen = strlen( dirname );
+	if (strcmp(dirname, "/")) {
+		dirlen = strlen(dirname);
 	} else {
 		dirlen = 0;
 		dirname = "";
@@ -54,111 +54,111 @@
 	 * And if it ever became 64 bits,
 	 * 64 bits => trunc(log10(2^64))+1 = 20
          */
-  	if ( pid ) {
+  	if (pid) {
 		pidlen = 1 + 20;
   	} else {
   		pidlen = 0;
   	}
-	namelen = dirlen + 1 + strlen( basename ) + pidlen + 1;
-	namebuf = ( char * )calloc( 1, namelen );
-  	assert( namebuf );
+	namelen = dirlen + 1 + strlen(basename) + pidlen + 1;
+	namebuf = (char *)calloc(1, namelen);
+  	assert(namebuf);
 
-  	if ( pid ) {
-		( void )snprintf( namebuf, namelen, "%s/%s.%d", dirname, basename, pid );
+  	if (pid) {
+		(void )snprintf(namebuf, namelen, "%s/%s.%d", dirname, basename, pid);
   	} else {
-		( void )snprintf( namebuf, namelen, "%s/%s", dirname, basename );
+		(void )snprintf(namebuf, namelen, "%s/%s", dirname, basename);
   	}
 
   	return namebuf;
 }
 
 int
-open_trwp( char *pathname )
+open_trwp(char *pathname)
 {
 	int fd;
 
-	fd = open( pathname, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL,
+	fd = open(pathname, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL,
 		      _("could not create %s: %s\n"),
 		      pathname,
-		      strerror( errno ));
+		      strerror(errno));
 	}
 
 	return fd;
 }
 
 int
-open_erwp( char *pathname )
+open_erwp(char *pathname)
 {
 	int fd;
 
-	fd = open( pathname, O_EXCL | O_CREAT | O_RDWR, S_IRUSR | S_IWUSR );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL,
+	fd = open(pathname, O_EXCL | O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL,
 		      _("could not create %s: %s\n"),
 		      pathname,
-		      strerror( errno ));
+		      strerror(errno));
 	}
 
 	return fd;
 }
 
 int
-open_rwp( char *pathname )
+open_rwp(char *pathname)
 {
 	int fd;
 
-	fd = open( pathname, O_RDWR );
+	fd = open(pathname, O_RDWR);
 
 	return fd;
 }
 
 int
-mkdir_tp( char *pathname )
+mkdir_tp(char *pathname)
 {
 	int rval;
 
-	rval = mkdir( pathname, S_IRWXU );
+	rval = mkdir(pathname, S_IRWXU);
 
 	return rval;
 }
 
 int
-open_trwdb( char *dirname, char *basename, pid_t pid )
+open_trwdb(char *dirname, char *basename, pid_t pid)
 {
 	char *pathname;
 	int fd;
 
-	pathname = open_pathalloc( dirname, basename, pid );
-	fd = open_trwp( pathname );
-	free( ( void * )pathname );
+	pathname = open_pathalloc(dirname, basename, pid);
+	fd = open_trwp(pathname);
+	free((void *)pathname);
 
 	return fd;
 }
 
 int
-open_erwdb( char *dirname, char *basename, pid_t pid )
+open_erwdb(char *dirname, char *basename, pid_t pid)
 {
 	char *pathname;
 	int fd;
 
-	pathname = open_pathalloc( dirname, basename, pid );
-	fd = open_erwp( pathname );
-	free( ( void * )pathname );
+	pathname = open_pathalloc(dirname, basename, pid);
+	fd = open_erwp(pathname);
+	free((void *)pathname);
 
 	return fd;
 }
 
 int
-open_rwdb( char *dirname, char *basename, pid_t pid )
+open_rwdb(char *dirname, char *basename, pid_t pid)
 {
 	char *pathname;
 	int fd;
 
-	pathname = open_pathalloc( dirname, basename, pid );
-	fd = open_rwp( pathname );
-	free( ( void * )pathname );
+	pathname = open_pathalloc(dirname, basename, pid);
+	fd = open_rwp(pathname);
+	free((void *)pathname);
 
 	return fd;
 }
diff --git a/common/openutil.h b/common/openutil.h
index 587462c..0e418d4 100644
--- a/common/openutil.h
+++ b/common/openutil.h
@@ -28,35 +28,35 @@
  * representation of the pid will be appended to the pathname, beginning
  * with a '.'.
  */
-extern char *open_pathalloc( char *dirname, char *basename, pid_t pid );
+extern char *open_pathalloc(char *dirname, char *basename, pid_t pid);
 
 /* create the specified file, creating or truncating as necessary,
  * with read and write permissions, given a directory and base.
- * return the file descriptor, or -1 with errno set. uses mlog( MLOG_NORMAL...
+ * return the file descriptor, or -1 with errno set. uses mlog(MLOG_NORMAL...
  * if the creation fails.
  */
-extern int open_trwdb( char *dirname, char *basename, pid_t pid );
-extern int open_trwp( char *pathname );
+extern int open_trwdb(char *dirname, char *basename, pid_t pid);
+extern int open_trwp(char *pathname);
 
 
 /* open the specified file, with read and write permissions, given a
  * directory and base.* return the file descriptor, or -1 with errno set.
- * uses mlog( MLOG_NORMAL... if the open fails.
+ * uses mlog(MLOG_NORMAL... if the open fails.
  */
-extern int open_rwdb( char *dirname, char *basename, pid_t pid );
-extern int open_rwp( char *pathname );
+extern int open_rwdb(char *dirname, char *basename, pid_t pid);
+extern int open_rwp(char *pathname);
 
 
 /* create and open the specified file, failing if already exists
  */
-extern int open_erwp( char *pathname );
-extern int open_erwdb( char *dirname, char *basename, pid_t pid );
+extern int open_erwp(char *pathname);
+extern int open_erwdb(char *dirname, char *basename, pid_t pid);
 
 
 /* create the specified directory, guaranteed to be initially empty. returns
- * 0 on success, -1 if trouble. uses mlog( MLOG_NORMAL... if the creation fails.
+ * 0 on success, -1 if trouble. uses mlog(MLOG_NORMAL... if the creation fails.
  */
-extern int mkdir_tp( char *pathname );
+extern int mkdir_tp(char *pathname);
 
 
 #endif /* UTIL_H */
diff --git a/common/path.c b/common/path.c
index b234de1..fb1fcf0 100644
--- a/common/path.c
+++ b/common/path.c
@@ -33,143 +33,143 @@
 
 typedef struct pem pem_t;
 
-static pem_t * pem_alloc( char *path );
-static void pem_free( pem_t *pemp );
-static char * pem_next( pem_t *pemp );
+static pem_t * pem_alloc(char *path);
+static void pem_free(pem_t *pemp);
+static char * pem_next(pem_t *pemp);
 
 #define PAMAX	1024
 
 struct pa {
-	char *pa_array[ PAMAX ];
+	char *pa_array[PAMAX];
 	int pa_cnt;
 };
 
 typedef struct pa pa_t;
 
-static pa_t * pa_alloc( void );
-static void pa_free( pa_t *pap );
-static void pa_append( pa_t *pap, char *pep );
-static int pa_peel( pa_t *pap );
-static char * pa_gen( pa_t *pap );
+static pa_t * pa_alloc(void);
+static void pa_free(pa_t *pap);
+static void pa_append(pa_t *pap, char *pep);
+static int pa_peel(pa_t *pap);
+static char * pa_gen(pa_t *pap);
 
 char *
-path_diff( char *path, char *base )
+path_diff(char *path, char *base)
 {
 	char *diff;
 
-	assert( *base == '/' );
-	assert( *path == '/' );
+	assert(*base == '/');
+	assert(*path == '/');
 
-	if ( ! path_beginswith( path, base )) {
+	if (! path_beginswith(path, base)) {
 		return 0;
 	}
 
-	for ( ; *base && *path == *base ; path++, base++ )
+	for (; *base && *path == *base ; path++, base++)
 		;
 
-	if ( *path == 0 ) {
+	if (*path == 0) {
 		return 0;
 	}
 
-	if ( *path == '/' ) {
+	if (*path == '/') {
 		path++;
 	}
 
-	diff = ( char * )calloc( 1, strlen( path ) + 1 );
-	assert( diff );
-	strcpy( diff, path );
+	diff = (char *)calloc(1, strlen(path) + 1);
+	assert(diff);
+	strcpy(diff, path);
 
 	return diff;
 }
 
 int
-path_beginswith( char *path, char *base )
+path_beginswith(char *path, char *base)
 {
-	if ( ! base ) {
+	if (! base) {
 		return 0;
 	}
-	return ! strncmp( base, path, strlen( base ));
+	return ! strncmp(base, path, strlen(base));
 }
 
 char *
-path_reltoabs( char *dir, char *basedir )
+path_reltoabs(char *dir, char *basedir)
 {
 	char *absdir;
 
 	/* check if the path starts with a / or
-	 * is a remote path (i.e. contains  machine:/path/name ).
+	 * is a remote path (i.e. contains  machine:/path/name).
 	 */
-	if ( ( *dir != '/' ) && ( strchr(dir, ':') == 0 ) ) {
+	if ((*dir != '/') && (strchr(dir, ':') == 0)) {
 		char *absdir;
-		absdir = ( char * )malloc( strlen( basedir )
+		absdir = (char *)malloc(strlen(basedir)
 					   +
 					   1
 					   +
-					   strlen( dir )
+					   strlen(dir)
 					   +
-					   1 );
-		assert( absdir );
+					   1);
+		assert(absdir);
 
-		( void )sprintf( absdir, "%s/%s", basedir, dir );
+		(void )sprintf(absdir, "%s/%s", basedir, dir);
 
 		dir = absdir;
 	}
 
-	if ( strchr(dir, ':') == 0 ) {
-		absdir = path_normalize( dir );
+	if (strchr(dir, ':') == 0) {
+		absdir = path_normalize(dir);
 	} else {
-		absdir = ( char * )malloc( strlen( dir )  + 1);
-		( void )sprintf( absdir, "%s", dir);
+		absdir = (char *)malloc(strlen(dir)  + 1);
+		(void )sprintf(absdir, "%s", dir);
 	}
 
 	return absdir;
 }
 
 char *
-path_normalize( char *path )
+path_normalize(char *path)
 {
-	pem_t *pemp = pem_alloc( path );
-	pa_t *pap = pa_alloc( );
+	pem_t *pemp = pem_alloc(path);
+	pa_t *pap = pa_alloc();
 	char *pep;
 	char *npath;
 
-	assert( path[ 0 ] == '/' );
+	assert(path[0] == '/');
 
-	while ( ( pep = pem_next( pemp )) != 0 ) {
-		if ( ! strcmp( pep, "" )) {
-			free( ( void * )pep );
+	while ((pep = pem_next(pemp)) != 0) {
+		if (! strcmp(pep, "")) {
+			free((void *)pep);
 			continue;
 		}
-		if ( ! strcmp( pep, "." )) {
-			free( ( void * )pep );
+		if (! strcmp(pep, ".")) {
+			free((void *)pep);
 			continue;
 		}
-		if ( ! strcmp( pep, ".." )) {
+		if (! strcmp(pep, "..")) {
 			int ok;
-			free( ( void * )pep );
-			ok = pa_peel( pap );
-			if ( ! ok ) {
-				pa_free( pap );
-				pem_free( pemp );
+			free((void *)pep);
+			ok = pa_peel(pap);
+			if (! ok) {
+				pa_free(pap);
+				pem_free(pemp);
 				return 0;
 			}
 			continue;
 		}
-		pa_append( pap, pep );
+		pa_append(pap, pep);
 	}
 
-	npath = pa_gen( pap );
-	pa_free( pap );
-	pem_free( pemp );
+	npath = pa_gen(pap);
+	pa_free(pap);
+	pem_free(pemp);
 
 	return npath;
 }
 
 static pem_t *
-pem_alloc( char *path )
+pem_alloc(char *path)
 {
-	pem_t *pemp = ( pem_t * )calloc( 1, sizeof( pem_t ));
-	assert( pemp );
+	pem_t *pemp = (pem_t *)calloc(1, sizeof(pem_t));
+	assert(pemp);
 	pemp->pem_head = path;
 	pemp->pem_next = pemp->pem_head;
 
@@ -177,13 +177,13 @@
 }
 
 static void
-pem_free( pem_t *pemp )
+pem_free(pem_t *pemp)
 {
-	free( ( void * )pemp );
+	free((void *)pemp);
 }
 
 static char *
-pem_next( pem_t *pemp )
+pem_next(pem_t *pemp)
 {
 	char *nextnext;
 	size_t len;
@@ -191,37 +191,37 @@
 
 	/* no more left
 	 */
-	if ( *pemp->pem_next == 0 ) {
+	if (*pemp->pem_next == 0) {
 		return 0;
 	}
 
 	/* find the following slash
 	 */
-	nextnext = strchr( pemp->pem_next + 1, '/' );
+	nextnext = strchr(pemp->pem_next + 1, '/');
 
 	/* if end of string encountered, place next next at end of string
 	 */
-	if ( ! nextnext ) {
-		for ( nextnext = pemp->pem_next ; *nextnext ; nextnext++ )
+	if (! nextnext) {
+		for (nextnext = pemp->pem_next ; *nextnext ; nextnext++)
 			;
 	}
 
 	/* determine the length of the path element, sans the leading slash
 	 */
-	len = ( size_t )( nextnext - pemp->pem_next - 1 );
+	len = (size_t)(nextnext - pemp->pem_next - 1);
 
 	/* allocate buffer to hold the path element, incl null termination
 	 */
-	p = ( char * )malloc( len + 1 );
-	assert( p );
+	p = (char *)malloc(len + 1);
+	assert(p);
 
 	/* copy the path element into the buffer
 	 */
-	strncpy( p, pemp->pem_next + 1, len );
+	strncpy(p, pemp->pem_next + 1, len);
 
 	/* null-terminate
 	 */
-	p[ len ] = 0;
+	p[len] = 0;
 
 	/* update next
 	 */
@@ -233,54 +233,54 @@
 }
 
 static pa_t *
-pa_alloc( void )
+pa_alloc(void)
 {
-	pa_t *pap = ( pa_t * )calloc( 1, sizeof( pa_t ));
-	assert( pap );
+	pa_t *pap = (pa_t *)calloc(1, sizeof(pa_t));
+	assert(pap);
 
 	return pap;
 }
 
 static void
-pa_free( pa_t *pap )
+pa_free(pa_t *pap)
 {
 	int i;
 
-	for ( i = 0 ; i < pap->pa_cnt ; i++ ) {
-		free( ( void * )pap->pa_array[ i ] );
+	for (i = 0 ; i < pap->pa_cnt ; i++) {
+		free((void *)pap->pa_array[i]);
 	}
 
-	free( ( void * )pap );
+	free((void *)pap);
 }
 
 static void
-pa_append( pa_t *pap, char *pep )
+pa_append(pa_t *pap, char *pep)
 {
-	assert( pap->pa_cnt < PAMAX );
+	assert(pap->pa_cnt < PAMAX);
 
-	pap->pa_array[ pap->pa_cnt ] = pep;
+	pap->pa_array[pap->pa_cnt] = pep;
 
 	pap->pa_cnt++;
 }
 
 static int
-pa_peel( pa_t *pap )
+pa_peel(pa_t *pap)
 {
-	if ( pap->pa_cnt <= 0 ) {
-		assert( pap->pa_cnt == 0 );
+	if (pap->pa_cnt <= 0) {
+		assert(pap->pa_cnt == 0);
 		return 0;
 	}
 
 	pap->pa_cnt--;
-	assert( pap->pa_array[ pap->pa_cnt ] );
-	free( ( void * )pap->pa_array[ pap->pa_cnt ] );
-	pap->pa_array[ pap->pa_cnt ] = 0;
+	assert(pap->pa_array[pap->pa_cnt]);
+	free((void *)pap->pa_array[pap->pa_cnt]);
+	pap->pa_array[pap->pa_cnt] = 0;
 
 	return 1;
 }
 
 static char *
-pa_gen( pa_t *pap )
+pa_gen(pa_t *pap)
 {
 	size_t sz;
 	int i;
@@ -288,23 +288,23 @@
 	char *p;
 
 	sz = 0;
-	for ( i = 0 ; i < pap->pa_cnt ; i++ ) {
-		sz += strlen( pap->pa_array[ i ] ) + 1;
+	for (i = 0 ; i < pap->pa_cnt ; i++) {
+		sz += strlen(pap->pa_array[i]) + 1;
 	}
-	if ( i == 0 )
+	if (i == 0)
 		sz++;
 	sz++;
 
-	retp = ( char * )malloc( sz );
+	retp = (char *)malloc(sz);
 
-	if (  pap->pa_cnt <= 0 ) {
-		assert(  pap->pa_cnt == 0 );
-		sprintf( retp, "/" );
+	if (pap->pa_cnt <= 0) {
+		assert(pap->pa_cnt == 0);
+		sprintf(retp, "/");
 	} else {
 		p = retp;
-		for ( i = 0 ; i < pap->pa_cnt ; i++ ) {
-			sprintf( p, "/%s", pap->pa_array[ i ] );
-			p += strlen( p );
+		for (i = 0 ; i < pap->pa_cnt ; i++) {
+			sprintf(p, "/%s", pap->pa_array[ i]);
+			p += strlen(p);
 		}
 	}
 
diff --git a/common/path.h b/common/path.h
index 9092233..f05f5c7 100644
--- a/common/path.h
+++ b/common/path.h
@@ -20,9 +20,9 @@
 
 /* various pathname helpers
  */
-extern char * path_reltoabs( char *dir, char *basedir );
-extern char *path_normalize( char *path );
-extern char * path_diff( char *path, char *base );
-extern int path_beginswith( char *path, char *base );
+extern char * path_reltoabs(char *dir, char *basedir);
+extern char *path_normalize(char *path);
+extern char * path_diff(char *path, char *base);
+extern int path_beginswith(char *path, char *base);
 
 #endif /* PATH_H */
diff --git a/common/qlock.c b/common/qlock.c
index 1db461d..ae36817 100644
--- a/common/qlock.c
+++ b/common/qlock.c
@@ -43,7 +43,7 @@
 	 * been allocated.
 	 */
 
-#define ORDMAX					( 8 * sizeof( ordmap_t ))
+#define ORDMAX					(8 * sizeof(ordmap_t))
 	/* ordinals must fit into a wordsize bitmap
 	 */
 
@@ -55,53 +55,53 @@
 	/* holds the ordmap for each thread
 	 */
 
-#define QLOCK_ORDMAP_SET( ordmap, ord )	( ordmap |= 1U << ord )
+#define QLOCK_ORDMAP_SET(ordmap, ord)	(ordmap |= 1U << ord)
 	/* sets the ordinal bit in an ordmap
 	 */
 
-#define QLOCK_ORDMAP_CLR( ordmap, ord )	( ordmap &= ~( 1U << ord ))
+#define QLOCK_ORDMAP_CLR(ordmap, ord)	(ordmap &= ~(1U << ord))
 	/* clears the ordinal bit in an ordmap
 	 */
 
-#define QLOCK_ORDMAP_GET( ordmap, ord )	( ordmap & ( 1U << ord ))
+#define QLOCK_ORDMAP_GET(ordmap, ord)	(ordmap & (1U << ord))
 	/* checks if ordinal set in ordmap
 	 */
 
-#define QLOCK_ORDMAP_CHK( ordmap, ord )	( ordmap & (( 1U << ord ) - 1U ))
+#define QLOCK_ORDMAP_CHK(ordmap, ord)	(ordmap & ((1U << ord) - 1U))
 	/* checks if any bits less than ord are set in the ordmap
 	 */
 
 
 qlockh_t
-qlock_alloc( ix_t ord )
+qlock_alloc(ix_t ord)
 {
 	qlock_t *qlockp;
 
 	/* verify the ordinal is not already taken, and mark as taken
 	 */
-	assert( ! QLOCK_ORDMAP_GET( qlock_ordalloced, ord ));
-	QLOCK_ORDMAP_SET( qlock_ordalloced, ord );
+	assert(! QLOCK_ORDMAP_GET(qlock_ordalloced, ord));
+	QLOCK_ORDMAP_SET(qlock_ordalloced, ord);
 
 	/* allocate lock memory
 	 */
-	qlockp = ( qlock_t * )calloc( 1, sizeof( qlock_t ));
-	assert( qlockp );
+	qlockp = (qlock_t *)calloc(1, sizeof(qlock_t));
+	assert(qlockp);
 
 	/* initialize the mutex
 	 */
-	pthread_mutex_init( &qlockp->ql_mutex, NULL );
+	pthread_mutex_init(&qlockp->ql_mutex, NULL);
 
 	/* assign the ordinal position
 	 */
 	qlockp->ql_ord = ord;
 
-	return ( qlockh_t )qlockp;
+	return (qlockh_t)qlockp;
 }
 
 void
-qlock_lock( qlockh_t qlockh )
+qlock_lock(qlockh_t qlockh)
 {
-	qlock_t *qlockp = ( qlock_t * )qlockh;
+	qlock_t *qlockp = (qlock_t *)qlockh;
 	pthread_t tid;
 	/* REFERENCED */
 	int rval;
@@ -112,138 +112,138 @@
 
 	/* assert that this lock not already held by this thread
 	 */
-	if ( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_NOLOCK,
+	if (QLOCK_ORDMAP_GET(thread_ordmap, qlockp->ql_ord)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_NOLOCK,
 		      _("lock already held: tid %lu ord %d map %x\n"),
 		      tid,
 		      qlockp->ql_ord,
-		      thread_ordmap );
+		      thread_ordmap);
 	}
-	assert( ! QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
+	assert(! QLOCK_ORDMAP_GET(thread_ordmap, qlockp->ql_ord));
 
 	/* assert that no locks with a lesser ordinal are held by this thread
 	 */
-	if ( QLOCK_ORDMAP_CHK( thread_ordmap, qlockp->ql_ord )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_NOLOCK,
+	if (QLOCK_ORDMAP_CHK(thread_ordmap, qlockp->ql_ord)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_NOLOCK,
 		      _("lock ordinal violation: tid %lu ord %d map %x\n"),
 		      tid,
 		      qlockp->ql_ord,
-		      thread_ordmap );
+		      thread_ordmap);
 	}
-	assert( ! QLOCK_ORDMAP_CHK( thread_ordmap, qlockp->ql_ord ));
+	assert(! QLOCK_ORDMAP_CHK(thread_ordmap, qlockp->ql_ord));
 
 	/* acquire the lock
 	 */
-	rval = pthread_mutex_lock( &qlockp->ql_mutex );
-	assert( !rval );
+	rval = pthread_mutex_lock(&qlockp->ql_mutex);
+	assert(!rval);
 
 	/* add ordinal to this threads ordmap
 	 */
-	QLOCK_ORDMAP_SET( thread_ordmap, qlockp->ql_ord );
+	QLOCK_ORDMAP_SET(thread_ordmap, qlockp->ql_ord);
 }
 
 void
-qlock_unlock( qlockh_t qlockh )
+qlock_unlock(qlockh_t qlockh)
 {
-	qlock_t *qlockp = ( qlock_t * )qlockh;
+	qlock_t *qlockp = (qlock_t *)qlockh;
 	/* REFERENCED */
 	int rval;
 
 	/* verify lock is held by this thread
 	 */
-	assert( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
+	assert(QLOCK_ORDMAP_GET(thread_ordmap, qlockp->ql_ord));
 
 	/* clear lock's ord from thread's ord map
 	 */
-	QLOCK_ORDMAP_CLR( thread_ordmap, qlockp->ql_ord );
+	QLOCK_ORDMAP_CLR(thread_ordmap, qlockp->ql_ord);
 
 	/* release the lock
 	 */
-	rval = pthread_mutex_unlock( &qlockp->ql_mutex );
-	assert( ! rval );
+	rval = pthread_mutex_unlock(&qlockp->ql_mutex);
+	assert(! rval);
 }
 
 qsemh_t
-qsem_alloc( ix_t cnt )
+qsem_alloc(ix_t cnt)
 {
 	sem_t *semp;
 	int rval;
 
 	/* allocate a semaphore
 	 */
-	semp = ( sem_t * )calloc( 1, sizeof( sem_t ));
-	assert( semp );
+	semp = (sem_t *)calloc(1, sizeof(sem_t));
+	assert(semp);
 
 	/* initialize the semaphore
 	 */
-	rval = sem_init( semp, 0, cnt );
-	assert( !rval );
+	rval = sem_init(semp, 0, cnt);
+	assert(!rval);
 
-	return ( qsemh_t )semp;
+	return (qsemh_t)semp;
 }
 
 void
-qsem_free( qsemh_t qsemh )
+qsem_free(qsemh_t qsemh)
 {
-	sem_t *semp = ( sem_t * )qsemh;
+	sem_t *semp = (sem_t *)qsemh;
 	int rval;
 
 	/* destroy the mutex and condition
 	 */
-	rval = sem_destroy( semp );
-	assert( !rval );
+	rval = sem_destroy(semp);
+	assert(!rval);
 
 	/* free the semaphore
 	 */
-	free( semp );
+	free(semp);
 }
 
 void
-qsemP( qsemh_t qsemh )
+qsemP(qsemh_t qsemh)
 {
-	sem_t *semp = ( sem_t * )qsemh;
+	sem_t *semp = (sem_t *)qsemh;
 	int rval;
 
 	/* "P" the semaphore
 	 */
-	rval = sem_wait( semp );
-	assert( !rval );
+	rval = sem_wait(semp);
+	assert(!rval);
 }
 
 void
-qsemV( qsemh_t qsemh )
+qsemV(qsemh_t qsemh)
 {
-	sem_t *semp = ( sem_t * )qsemh;
+	sem_t *semp = (sem_t *)qsemh;
 	int rval;
 
 	/* "V" the semaphore
 	 */
-	rval = sem_post( semp );
-	assert( !rval );
+	rval = sem_post(semp);
+	assert(!rval);
 }
 
 bool_t
-qsemPwouldblock( qsemh_t qsemh )
+qsemPwouldblock(qsemh_t qsemh)
 {
-	sem_t *semp = ( sem_t * )qsemh;
+	sem_t *semp = (sem_t *)qsemh;
 	int count;
 	int rval;
 
-	rval = sem_getvalue( semp, &count );
-	assert( !rval );
+	rval = sem_getvalue(semp, &count);
+	assert(!rval);
 
 	return count <= 0 ? BOOL_TRUE : BOOL_FALSE;
 }
 
 size_t
-qsemPavail( qsemh_t qsemh )
+qsemPavail(qsemh_t qsemh)
 {
-	sem_t *semp = ( sem_t * )qsemh;
+	sem_t *semp = (sem_t *)qsemh;
 	int count;
 	int rval;
 
-	rval = sem_getvalue( semp, &count );
-	assert( !rval );
+	rval = sem_getvalue(semp, &count);
+	assert(!rval);
 
 	return count < 0 ? 0 : count;
 }
diff --git a/common/qlock.h b/common/qlock.h
index 6c2dd18..52a8467 100644
--- a/common/qlock.h
+++ b/common/qlock.h
@@ -48,14 +48,14 @@
 	/* opaque handle
 	 */
 
-extern qlockh_t qlock_alloc( ix_t ord );
+extern qlockh_t qlock_alloc(ix_t ord);
 	/* allocates a qlock with the specified ordinal. returns
 	 * NULL if lock can't be allocated.
 	 */
-extern void qlock_lock( qlockh_t qlockh );
+extern void qlock_lock(qlockh_t qlockh);
 	/* acquires the specified lock.
 	 */
-extern void qlock_unlock( qlockh_t qlockh );
+extern void qlock_unlock(qlockh_t qlockh);
 	/* releases the specified lock.
 	 */
 
@@ -64,23 +64,23 @@
 	/* opaque handle
 	 */
 
-extern qsemh_t qsem_alloc( size_t cnt );
+extern qsemh_t qsem_alloc(size_t cnt);
 	/* allocates a counting semaphore initialized to the specified
 	 * count. returns a qsem handle
 	 */
-extern void qsem_free( qsemh_t qsemh );
+extern void qsem_free(qsemh_t qsemh);
 	/* frees the counting semaphore
 	 */
-extern void qsemP( qsemh_t qsemh );
+extern void qsemP(qsemh_t qsemh);
 	/* "P" (decrement) op
 	 */
-extern void qsemV( qsemh_t qsemh );
+extern void qsemV(qsemh_t qsemh);
 	/* "V" (increment) op
 	 */
-extern bool_t qsemPwouldblock( qsemh_t qsemh );
+extern bool_t qsemPwouldblock(qsemh_t qsemh);
 	/* returns true if a qsemP op would block
 	 */
-extern size_t qsemPavail( qsemh_t qsemh );
+extern size_t qsemPavail(qsemh_t qsemh);
 	/* number of resources available
 	 */
 
diff --git a/common/rec_hdr.h b/common/rec_hdr.h
index 1ab783c..a33c54e 100644
--- a/common/rec_hdr.h
+++ b/common/rec_hdr.h
@@ -51,7 +51,7 @@
 	int32_t capability;			/*   4  18 */
 		/* tape drive capabilities (from drive.h)
 		 */
-	char pad1[ 8 ];				/*   8  20 */
+	char pad1[8];				/*   8  20 */
 		/* padding
 		 */
 	off64_t file_offset;			/*   8  28 */
@@ -73,7 +73,7 @@
 
 	uuid_t dump_uuid;			/*  10  4c */
 
-	char pad2[ 0x1b4 ];			/* 1b4 200 */
+	char pad2[0x1b4];			/* 1b4 200 */
 };		/* pad to sizeof drive_hdr_t dh_specific */
 
 typedef struct rec_hdr rec_hdr_t;
diff --git a/common/ring.c b/common/ring.c
index 70c0f45..d1fbcb7 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -33,17 +33,17 @@
 #include "cldmgr.h"
 #include "ring.h"
 
-static int ring_slave_entry( void *ringctxp );
+static int ring_slave_entry(void *ringctxp);
 
 ring_t *
-ring_create( size_t ringlen,
+ring_create(size_t ringlen,
 	     size_t bufsz,
 	     bool_t pinpr,
 	     ix_t drive_index,
-	     int ( *readfunc )( void *clientctxp, char *bufp ),
-	     int ( *writefunc )( void *clientctxp, char *bufp ),
+	     int (*readfunc)(void *clientctxp, char *bufp),
+	     int (*writefunc)(void *clientctxp, char *bufp),
 	     void *clientctxp,
-	     int *rvalp )
+	     int *rvalp)
 {
 	bool_t ok;
 	ring_t *ringp;
@@ -55,8 +55,8 @@
 
 	/* allocate a ring descriptor
 	 */
-	ringp = ( ring_t * )calloc( 1, sizeof( ring_t ));
-	assert( ringp );
+	ringp = (ring_t *)calloc(1, sizeof(ring_t));
+	assert(ringp);
 	ringp->r_len = ringlen;
 	ringp->r_clientctxp = clientctxp;
 	ringp->r_readfunc = readfunc;
@@ -65,8 +65,8 @@
 	/* allocate counting semaphores for the ready and active queues,
 	 * and initialize the queue input and output indices.
 	 */
-	ringp->r_ready_qsemh = qsem_alloc( ringlen );
-	ringp->r_active_qsemh = qsem_alloc( 0 );
+	ringp->r_ready_qsemh = qsem_alloc(ringlen);
+	ringp->r_active_qsemh = qsem_alloc(0);
 	ringp->r_ready_in_ix = 0;
 	ringp->r_ready_out_ix = 0;
 	ringp->r_active_in_ix = 0;
@@ -85,87 +85,87 @@
 
 	/* allocate the ring messages
 	 */
-	ringp->r_msgp = ( ring_msg_t * )calloc( ringlen, sizeof( ring_msg_t ));
-	assert( ringp->r_msgp );
+	ringp->r_msgp = (ring_msg_t *)calloc(ringlen, sizeof(ring_msg_t));
+	assert(ringp->r_msgp);
 
 	/* allocate the buffers and initialize the messages
 	 */
-	for ( mix = 0 ; mix < ringlen ; mix++ ) {
-		ring_msg_t *msgp = &ringp->r_msgp[ mix ];
+	for (mix = 0 ; mix < ringlen ; mix++) {
+		ring_msg_t *msgp = &ringp->r_msgp[mix];
 		msgp->rm_mix = mix;
 		msgp->rm_op = RING_OP_NONE;
 		msgp->rm_stat = RING_STAT_INIT;
 		msgp->rm_user = 0;
 		msgp->rm_loc = RING_LOC_READY;
 
-		msgp->rm_bufp = ( char * )memalign( PGSZ, bufsz );
-		if ( ! msgp->rm_bufp ) {
+		msgp->rm_bufp = (char *)memalign(PGSZ, bufsz);
+		if (! msgp->rm_bufp) {
 			*rvalp = ENOMEM;
 			return 0;
 		}
-		if ( pinpr ) {
+		if (pinpr) {
 			int rval;
-			rval = mlock( ( void * )msgp->rm_bufp, bufsz );
-			if ( rval ) {
-				if ( errno == ENOMEM ) {
+			rval = mlock((void *)msgp->rm_bufp, bufsz);
+			if (rval) {
+				if (errno == ENOMEM) {
 					*rvalp = E2BIG;
 					return 0;
 				}
-				if ( errno == EPERM ) {
+				if (errno == EPERM) {
 					*rvalp = EPERM;
 					return 0;
 				}
-				assert( 0 );
+				assert(0);
 			}
 		}
 	}
 
 	/* kick off the slave thread
 	 */
-	ok = cldmgr_create( ring_slave_entry,
+	ok = cldmgr_create(ring_slave_entry,
 			    drive_index,
 			    _("slave"),
-			    ringp );
-	assert( ok );
+			    ringp);
+	assert(ok);
 
 	return ringp;
 }
 
 ring_msg_t *
-ring_get( ring_t *ringp )
+ring_get(ring_t *ringp)
 {
 	ring_msg_t *msgp;
 
 	/* assert client currently holds no messages
 	 */
-	assert( ringp->r_client_cnt == 0 );
+	assert(ringp->r_client_cnt == 0);
 
 	/* bump client message count and note if client needs to block
 	 */
 	ringp->r_client_msgcnt++;
-	if ( qsemPwouldblock( ringp->r_ready_qsemh )) {
+	if (qsemPwouldblock(ringp->r_ready_qsemh)) {
 		ringp->r_client_blkcnt++;
 	}
 
 	/* block until msg available on ready queue ("P")
 	 */
-	qsemP( ringp->r_ready_qsemh );
+	qsemP(ringp->r_ready_qsemh);
 
 	/* get a pointer to the next msg on the queue
 	 */
-	msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
+	msgp = &ringp->r_msgp[ringp->r_ready_out_ix];
 
 	/* assert the message is where it belongs
 	 */
-	assert( msgp->rm_loc == RING_LOC_READY );
+	assert(msgp->rm_loc == RING_LOC_READY);
 
 	/* verify the message index has not become corrupted
 	 */
-	assert( msgp->rm_mix == ringp->r_ready_out_ix );
+	assert(msgp->rm_mix == ringp->r_ready_out_ix);
 
 	/* bump the output index
 	 */
-	ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
+	ringp->r_ready_out_ix = (ringp->r_ready_out_ix + 1)
 				%
 				ringp->r_len;
 
@@ -183,19 +183,19 @@
 }
 
 void
-ring_put( ring_t *ringp, ring_msg_t *msgp )
+ring_put(ring_t *ringp, ring_msg_t *msgp)
 {
 	/* assert the client holds exactly one message
 	 */
-	assert( ringp->r_client_cnt == 1 );
+	assert(ringp->r_client_cnt == 1);
 
 	/* assert the client is returning the right message
 	 */
-	assert( msgp->rm_mix == ringp->r_active_in_ix );
+	assert(msgp->rm_mix == ringp->r_active_in_ix);
 
 	/* assert the message is where it belongs
 	 */
-	assert( msgp->rm_loc == RING_LOC_CLIENT );
+	assert(msgp->rm_loc == RING_LOC_CLIENT);
 
 	/* decrement the count of messages held by the client
 	 */
@@ -207,150 +207,150 @@
 
 	/* bump the active queue input ix
 	 */
-	ringp->r_active_in_ix = ( ringp->r_active_in_ix + 1 )
+	ringp->r_active_in_ix = (ringp->r_active_in_ix + 1)
 				%
 				ringp->r_len;
 
 	/* bump the semaphore for the active queue ("V")
 	 */
-	qsemV( ringp->r_active_qsemh );
+	qsemV(ringp->r_active_qsemh);
 }
 
 void
-ring_reset( ring_t *ringp, ring_msg_t *msgp )
+ring_reset(ring_t *ringp, ring_msg_t *msgp)
 {
 	size_t mix;
 
 	/* if the client is not holding a message, get the next message
 	 */
-	if ( ringp->r_client_cnt == 0 ) {
-		assert( ! msgp );
-		msgp = ring_get( ringp );
-		assert( msgp );
-		assert( ringp->r_client_cnt == 1 );
+	if (ringp->r_client_cnt == 0) {
+		assert(! msgp);
+		msgp = ring_get(ringp);
+		assert(msgp);
+		assert(ringp->r_client_cnt == 1);
 	} else {
-		assert( msgp );
-		assert( ringp->r_client_cnt == 1 );
+		assert(msgp);
+		assert(ringp->r_client_cnt == 1);
 	}
 
 	/* tell the slave to abort
 	 */
 	msgp->rm_op = RING_OP_RESET;
-	ring_put( ringp, msgp );
+	ring_put(ringp, msgp);
 
 	/* wait for the reset to be acknowledged
 	 */
-	assert( ringp->r_client_cnt == 0 );
+	assert(ringp->r_client_cnt == 0);
 	do {
 		/* pull a message from the ready queue
 		 */
-		qsemP( ringp->r_ready_qsemh );
-		msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
-		assert( msgp->rm_loc == RING_LOC_READY );
-		ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
+		qsemP(ringp->r_ready_qsemh);
+		msgp = &ringp->r_msgp[ringp->r_ready_out_ix];
+		assert(msgp->rm_loc == RING_LOC_READY);
+		ringp->r_ready_out_ix = (ringp->r_ready_out_ix + 1)
 					%
 					ringp->r_len;
 		ringp->r_client_cnt++;
-	} while ( msgp->rm_stat != RING_STAT_RESETACK );
-	assert( ringp->r_client_cnt == ringp->r_len );
+	} while (msgp->rm_stat != RING_STAT_RESETACK);
+	assert(ringp->r_client_cnt == ringp->r_len);
 
 	/* re-initialize the ring
 	 */
-	assert( qsemPavail( ringp->r_ready_qsemh ) == 0 );
-	assert( qsemPavail( ringp->r_active_qsemh ) == 0 );
+	assert(qsemPavail(ringp->r_ready_qsemh) == 0);
+	assert(qsemPavail(ringp->r_active_qsemh) == 0);
 	ringp->r_ready_in_ix = 0;
 	ringp->r_ready_out_ix = 0;
 	ringp->r_active_in_ix = 0;
 	ringp->r_active_out_ix = 0;
 	ringp->r_client_cnt = 0;
 	ringp->r_slave_cnt = 0;
-	for ( mix = 0 ; mix < ringp->r_len ; mix++ ) {
-		ring_msg_t *msgp = &ringp->r_msgp[ mix ];
+	for (mix = 0 ; mix < ringp->r_len ; mix++) {
+		ring_msg_t *msgp = &ringp->r_msgp[mix];
 		msgp->rm_mix = mix;
 		msgp->rm_op = RING_OP_NONE;
 		msgp->rm_stat = RING_STAT_INIT;
 		msgp->rm_user = 0;
 		msgp->rm_loc = RING_LOC_READY;
-		qsemV( ringp->r_ready_qsemh );
+		qsemV(ringp->r_ready_qsemh);
 	}
-	assert( qsemPavail( ringp->r_ready_qsemh ) == ringp->r_len );
-	assert( qsemPavail( ringp->r_active_qsemh ) == 0 );
+	assert(qsemPavail(ringp->r_ready_qsemh) == ringp->r_len);
+	assert(qsemPavail(ringp->r_active_qsemh) == 0);
 }
 
 void
-ring_destroy( ring_t *ringp )
+ring_destroy(ring_t *ringp)
 {
 	ring_msg_t *msgp;
 
 	/* the client must not be holding a message
 	 */
-	assert( ringp->r_client_cnt == 0 );
+	assert(ringp->r_client_cnt == 0);
 
 	/* get a message
 	 */
-	msgp = ring_get( ringp );
+	msgp = ring_get(ringp);
 
 	/* tell the slave to exit
 	 */
 	msgp->rm_op = RING_OP_DIE;
-	ring_put( ringp, msgp );
+	ring_put(ringp, msgp);
 
 	/* wait for the die to be acknowledged
 	 */
 	do {
 		/* pull a message from the ready queue
 		 */
-		qsemP( ringp->r_ready_qsemh );
-		msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
-		assert( msgp->rm_loc == RING_LOC_READY );
-		ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
+		qsemP(ringp->r_ready_qsemh);
+		msgp = &ringp->r_msgp[ringp->r_ready_out_ix];
+		assert(msgp->rm_loc == RING_LOC_READY);
+		ringp->r_ready_out_ix = (ringp->r_ready_out_ix + 1)
 					%
 					ringp->r_len;
-	} while ( msgp->rm_stat != RING_STAT_DIEACK );
+	} while (msgp->rm_stat != RING_STAT_DIEACK);
 
 	/* the slave is dead.
 	 */
-	qsem_free( ringp->r_ready_qsemh );
-	qsem_free( ringp->r_active_qsemh );
-	free( ( void * )ringp );
+	qsem_free(ringp->r_ready_qsemh);
+	qsem_free(ringp->r_active_qsemh);
+	free((void *)ringp);
 }
 
 
 static ring_msg_t *
-ring_slave_get( ring_t *ringp )
+ring_slave_get(ring_t *ringp)
 {
 	ring_msg_t *msgp;
 
 	/* assert slave currently holds no messages
 	 */
-	assert( ringp->r_slave_cnt == 0 );
+	assert(ringp->r_slave_cnt == 0);
 
 	/* bump slave message count and note if slave needs to block
 	 */
 	ringp->r_slave_msgcnt++;
-	if ( qsemPwouldblock( ringp->r_active_qsemh )) {
+	if (qsemPwouldblock(ringp->r_active_qsemh)) {
 		ringp->r_slave_blkcnt++;
 	}
 
 	/* block until msg available on active queue ("P")
 	 */
-	qsemP( ringp->r_active_qsemh );
+	qsemP(ringp->r_active_qsemh);
 
 	/* get a pointer to the next msg on the queue
 	 */
-	msgp = &ringp->r_msgp[ ringp->r_active_out_ix ];
+	msgp = &ringp->r_msgp[ringp->r_active_out_ix];
 
 	/* assert the message is where it belongs
 	 */
-	assert( msgp->rm_loc == RING_LOC_ACTIVE );
+	assert(msgp->rm_loc == RING_LOC_ACTIVE);
 
 	/* verify the message index has not become corrupted
 	 */
-	assert( msgp->rm_mix == ringp->r_active_out_ix );
+	assert(msgp->rm_mix == ringp->r_active_out_ix);
 
 	/* bump the output index
 	 */
-	ringp->r_active_out_ix = ( ringp->r_active_out_ix + 1 )
+	ringp->r_active_out_ix = (ringp->r_active_out_ix + 1)
 				 %
 				 ringp->r_len;
 
@@ -368,19 +368,19 @@
 }
 
 static void
-ring_slave_put( ring_t *ringp, ring_msg_t *msgp )
+ring_slave_put(ring_t *ringp, ring_msg_t *msgp)
 {
 	/* assert the slave holds exactly one message
 	 */
-	assert( ringp->r_slave_cnt == 1 );
+	assert(ringp->r_slave_cnt == 1);
 
 	/* assert the slave is returning the right message
 	 */
-	assert( msgp->rm_mix == ringp->r_ready_in_ix );
+	assert(msgp->rm_mix == ringp->r_ready_in_ix);
 
 	/* assert the message is where it belongs
 	 */
-	assert( msgp->rm_loc == RING_LOC_SLAVE );
+	assert(msgp->rm_loc == RING_LOC_SLAVE);
 
 	/* decrement the count of messages held by the slave
 	 */
@@ -392,56 +392,56 @@
 
 	/* bump the ready queue input ix
 	 */
-	ringp->r_ready_in_ix = ( ringp->r_ready_in_ix + 1 )
+	ringp->r_ready_in_ix = (ringp->r_ready_in_ix + 1)
 			       %
 			       ringp->r_len;
 
 	/* bump the semaphore for the ready queue ("V")
 	 */
-	qsemV( ringp->r_ready_qsemh );
+	qsemV(ringp->r_ready_qsemh);
 }
 
 static int
-ring_slave_entry( void *ringctxp )
+ring_slave_entry(void *ringctxp)
 {
 	sigset_t blocked_set;
-	ring_t *ringp = ( ring_t * )ringctxp;
+	ring_t *ringp = (ring_t *)ringctxp;
 	enum { LOOPMODE_NORMAL, LOOPMODE_IGNORE, LOOPMODE_DIE } loopmode;
 
 	/* block signals, let the main thread handle them
 	 */
-	sigemptyset( &blocked_set );
-	sigaddset( &blocked_set, SIGINT );
-	sigaddset( &blocked_set, SIGHUP );
-	sigaddset( &blocked_set, SIGTERM );
-	sigaddset( &blocked_set, SIGQUIT );
-	sigaddset( &blocked_set, SIGALRM );
-	pthread_sigmask( SIG_SETMASK, &blocked_set, NULL );
+	sigemptyset(&blocked_set);
+	sigaddset(&blocked_set, SIGINT);
+	sigaddset(&blocked_set, SIGHUP);
+	sigaddset(&blocked_set, SIGTERM);
+	sigaddset(&blocked_set, SIGQUIT);
+	sigaddset(&blocked_set, SIGALRM);
+	pthread_sigmask(SIG_SETMASK, &blocked_set, NULL);
 
 	/* loop reading and precessing messages until told to die
 	 */
-	for ( loopmode = LOOPMODE_NORMAL ; loopmode != LOOPMODE_DIE ; ) {
+	for (loopmode = LOOPMODE_NORMAL ; loopmode != LOOPMODE_DIE ;) {
 		ring_msg_t *msgp;
 		int rval;
 
-		msgp = ring_slave_get( ringp );
+		msgp = ring_slave_get(ringp);
 		msgp->rm_rval = 0;
 
-		switch( msgp->rm_op ) {
+		switch(msgp->rm_op) {
 		case RING_OP_READ:
-			if ( loopmode == LOOPMODE_IGNORE ) {
+			if (loopmode == LOOPMODE_IGNORE) {
 				msgp->rm_stat = RING_STAT_IGNORE;
 				break;
 			}
-			if ( ! ringp->r_first_io_time ) {
-				ringp->r_first_io_time = time( 0 );
-				assert( ringp->r_first_io_time );
+			if (! ringp->r_first_io_time) {
+				ringp->r_first_io_time = time(0);
+				assert(ringp->r_first_io_time);
 			}
-			rval = ( ringp->r_readfunc )( ringp->r_clientctxp,
-						      msgp->rm_bufp );
+			rval = (ringp->r_readfunc)(ringp->r_clientctxp,
+						      msgp->rm_bufp);
 			msgp->rm_rval = rval;
 			ringp->r_all_io_cnt++;
-			if ( msgp->rm_rval == 0 ) {
+			if (msgp->rm_rval == 0) {
 				msgp->rm_stat = RING_STAT_OK;
 			} else {
 				msgp->rm_stat = RING_STAT_ERROR;
@@ -449,19 +449,19 @@
 			}
 			break;
 		case RING_OP_WRITE:
-			if ( loopmode == LOOPMODE_IGNORE ) {
+			if (loopmode == LOOPMODE_IGNORE) {
 				msgp->rm_stat = RING_STAT_IGNORE;
 				break;
 			}
-			if ( ! ringp->r_first_io_time ) {
-				ringp->r_first_io_time = time( 0 );
-				assert( ringp->r_first_io_time );
+			if (! ringp->r_first_io_time) {
+				ringp->r_first_io_time = time(0);
+				assert(ringp->r_first_io_time);
 			}
-			rval = ( ringp->r_writefunc )( ringp->r_clientctxp,
-						       msgp->rm_bufp );
+			rval = (ringp->r_writefunc)(ringp->r_clientctxp,
+						       msgp->rm_bufp);
 			msgp->rm_rval = rval;
 			ringp->r_all_io_cnt++;
-			if ( msgp->rm_rval == 0 ) {
+			if (msgp->rm_rval == 0) {
 				msgp->rm_stat = RING_STAT_OK;
 			} else {
 				msgp->rm_stat = RING_STAT_ERROR;
@@ -486,7 +486,7 @@
 			msgp->rm_stat = RING_STAT_IGNORE;
 			break;
 		}
-		ring_slave_put( ringp, msgp );
+		ring_slave_put(ringp, msgp);
 	}
 
 	return 0;
diff --git a/common/ring.h b/common/ring.h
index 6126b77..be4ae69 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -144,8 +144,8 @@
 	qsemh_t r_active_qsemh;
 	size_t r_client_cnt;
 	size_t r_slave_cnt;
-	int ( *r_readfunc )( void *contextp, char *bufp );
-	int ( *r_writefunc )( void *contextp, char *bufp );
+	int (*r_readfunc)(void *contextp, char *bufp);
+	int (*r_writefunc)(void *contextp, char *bufp);
 	void *r_clientctxp;
 };
 
@@ -164,34 +164,34 @@
  * E2BIG - insufficient physical memory available for pinning;
  * EPERM - exceeds allowed amount of pinned down memory.
  */
-extern ring_t *ring_create( size_t ringlen,
+extern ring_t *ring_create(size_t ringlen,
 			    size_t bufsz,
 			    bool_t pinpr,
 			    ix_t drive_index,
-			    int ( * readfunc )( void *clientctxp, char *bufp ),
-			    int ( * writefunc )( void *clientctxp, char *bufp ),
+			    int (* readfunc)(void *clientctxp, char *bufp),
+			    int (* writefunc)(void *clientctxp, char *bufp),
 			    void *clientctxp,
-			    int *rvalp );
+			    int *rvalp);
 
 
 /* ring_get - get a message off the ready queue
  */
-extern ring_msg_t *ring_get( ring_t *ringp );
+extern ring_msg_t *ring_get(ring_t *ringp);
 
 
 /* ring_put - put a message on the active queue
  */
-extern void ring_put( ring_t *ringp, ring_msg_t *msgp );
+extern void ring_put(ring_t *ringp, ring_msg_t *msgp);
 
 
 /* ring_reset - re-initialize the ring, after the current I/O completes.
  * msgp must be NULL if the client is not currently holding a ring message.
  * otherwise it must point to that message.
  */
-extern void ring_reset( ring_t *ringp, ring_msg_t *msgp );
+extern void ring_reset(ring_t *ringp, ring_msg_t *msgp);
 
 /* ring_destroy - de-allocates ring
  */
-extern void ring_destroy( ring_t *ringp );
+extern void ring_destroy(ring_t *ringp);
 
 #endif /* RING_H */
diff --git a/common/stream.c b/common/stream.c
index eadaaea..64a112a 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -40,13 +40,13 @@
 };
 
 typedef struct spm spm_t;
-static spm_t spm[ STREAM_SIMMAX * 3 ];
+static spm_t spm[STREAM_SIMMAX * 3];
 static bool_t initialized = BOOL_FALSE;
 
 void
-stream_init( void )
+stream_init(void)
 {
-	( void )memset( ( void * )spm, 0, sizeof( spm ));
+	(void)memset((void *)spm, 0, sizeof(spm));
 	initialized = BOOL_TRUE;
 }
 
@@ -61,24 +61,24 @@
  */
 
 void
-stream_register( pthread_t tid, int streamix )
+stream_register(pthread_t tid, int streamix)
 {
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
 
-	assert( streamix < STREAM_SIMMAX );
+	assert(streamix < STREAM_SIMMAX);
 
 	lock();
-	for ( ; p < ep ; p++ ) {
-		if ( p->s_state == S_FREE ) {
+	for (; p < ep ; p++) {
+		if (p->s_state == S_FREE) {
 			p->s_state = S_RUNNING;
 			break;
 		}
 	}
 	unlock();
-	assert( p < ep );
+	assert(p < ep);
 
-	if ( p >= ep ) return;
+	if (p >= ep) return;
 
 	p->s_tid = tid;
 	p->s_ix = streamix;
@@ -89,40 +89,40 @@
 
 /* NOTE: lock() must be held when calling stream_dead() */
 void
-stream_dead( pthread_t tid )
+stream_dead(pthread_t tid)
 {
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
 
-	for ( ; p < ep ; p++ )
-		if ( pthread_equal( p->s_tid, tid ) ) {
+	for (; p < ep ; p++)
+		if (pthread_equal(p->s_tid, tid)) {
 			p->s_state = S_ZOMBIE;
 			break;
 		}
-	assert( p < ep );
+	assert(p < ep);
 }
 
 void
-stream_free( pthread_t tid )
+stream_free(pthread_t tid)
 {
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
 
 	lock();
-	for ( ; p < ep ; p++ ) {
-		if ( pthread_equal( p->s_tid, tid ) ) {
-			(void) memset( (void *) p, 0, sizeof(spm_t) );
+	for (; p < ep ; p++) {
+		if (pthread_equal(p->s_tid, tid)) {
+			(void) memset((void *) p, 0, sizeof(spm_t));
 			p->s_state = S_FREE;
 			break;
 		}
 	}
 	unlock();
-	assert( p < ep );
+	assert(p < ep);
 }
 
 int
-stream_find_all( stream_state_t states[], int nstates,
-		 pthread_t tids[], int ntids )
+stream_find_all(stream_state_t states[], int nstates,
+		 pthread_t tids[], int ntids)
 {
 	int i, count = 0;
 	spm_t *p = spm;
@@ -134,7 +134,7 @@
 
 	/* lock - make sure we get a consistent snapshot of the stream status */
 	lock();
-	for ( ; p < ep && count < ntids; p++ )
+	for (; p < ep && count < ntids; p++)
 		for (i = 0; i < nstates; i++)
 			if (p->s_state == states[i]) {
 				tids[count++] = p->s_tid;
@@ -145,7 +145,7 @@
 }
 
 static spm_t *
-stream_find( pthread_t tid, stream_state_t s[], int nstates )
+stream_find(pthread_t tid, stream_state_t s[], int nstates)
 {
 	int i;
 	spm_t *p = spm;
@@ -154,8 +154,8 @@
 	assert(nstates > 0);
 
 	/* note we don't lock the stream array in this function */
-	for ( ; p < ep ; p++ )
-		if ( pthread_equal( p->s_tid, tid ) ) {
+	for (; p < ep ; p++)
+		if (pthread_equal(p->s_tid, tid)) {
 			/* check state */
 			for (i = 0; i < nstates; i++)
 				if (p->s_state == s[i])
@@ -165,13 +165,13 @@
 #ifdef STREAM_DEBUG
 	{
 		static const char *state_strings[] = { "S_FREE", "S_RUNNING", "S_ZOMBIE" };
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK | MLOG_BARE,
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK | MLOG_BARE,
 		      "stream_find(): no stream with tid: %lu and state%s:",
-		      tid, nstates == 1 ? "" : "s" );
+		      tid, nstates == 1 ? "" : "s");
 		for (i = 0; i < nstates; i++)
-			mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK | MLOG_BARE,
+			mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK | MLOG_BARE,
 			      " %s", state_strings[s[i]]);
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK | MLOG_BARE, "\n");
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK | MLOG_BARE, "\n");
 	}
 #endif /* STREAM_DEBUG */
 
@@ -185,12 +185,12 @@
  */
 
 int
-stream_getix( pthread_t tid )
+stream_getix(pthread_t tid)
 {
 	stream_state_t states[] = { S_RUNNING };
 	spm_t *p;
 	int ix;
-	p = stream_find( tid, states, N(states) );
+	p = stream_find(tid, states, N(states));
 	ix = p ? p->s_ix : -1;
 	return ix;
 }
@@ -208,8 +208,8 @@
 	spm_t *p;							\
 	pthread_t mytid = pthread_self();				\
 									\
-	if ( !pthread_equal(mytid, (tid))) {				\
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,		\
+	if (!pthread_equal(mytid, (tid))) {				\
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,		\
 		      "stream_set_" #field_name "(): "			\
 		      "foreign stream (tid %lu) "			\
 		      "not permitted to update this stream (tid %lu)\n",\
@@ -218,28 +218,28 @@
 	}								\
 									\
 	lock();								\
-	p = stream_find( (tid), states, N(states) );			\
+	p = stream_find((tid), states, N(states));			\
 	if (p) p->s_exit_ ## field_name = (value);			\
 	unlock();
 
-void stream_set_code( pthread_t tid, int exit_code )
+void stream_set_code(pthread_t tid, int exit_code)
 {
-	stream_set( code, tid, exit_code );
+	stream_set(code, tid, exit_code);
 }
 
-void stream_set_return( pthread_t tid, rv_t rv )
+void stream_set_return(pthread_t tid, rv_t rv)
 {
-	stream_set( return, tid, rv );
+	stream_set(return, tid, rv);
 }
 
-void stream_set_hint( pthread_t tid, rv_t rv )
+void stream_set_hint(pthread_t tid, rv_t rv)
 {
-	stream_set( hint, tid, rv );
+	stream_set(hint, tid, rv);
 }
 
 
 bool_t
-stream_get_exit_status( pthread_t tid,
+stream_get_exit_status(pthread_t tid,
 			stream_state_t states[],
 			int nstates,
 			stream_state_t *state,
@@ -252,7 +252,7 @@
 	spm_t *p;
 
 	lock();
-	p = stream_find( tid, states, nstates );
+	p = stream_find(tid, states, nstates);
 	if (! p) goto unlock;
 
 	if (state) *state = p->s_state;
@@ -268,7 +268,7 @@
 }
 
 size_t
-stream_cnt( void )
+stream_cnt(void)
 {
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
@@ -276,19 +276,19 @@
 	size_t ixcnt;
 	size_t bitix;
 
-	assert( sizeof( ixmap ) * NBBY >= STREAM_SIMMAX );
+	assert(sizeof(ixmap) * NBBY >= STREAM_SIMMAX);
 
 	lock();
-	for ( ; p < ep ; p++ ) {
-		if ( p->s_state == S_RUNNING ) {
-			ixmap |= ( size_t )1 << p->s_ix;
+	for (; p < ep ; p++) {
+		if (p->s_state == S_RUNNING) {
+			ixmap |= (size_t)1 << p->s_ix;
 		}
 	}
 	unlock();
 
 	ixcnt = 0;
-	for ( bitix = 0 ; bitix < STREAM_SIMMAX ; bitix++ ) {
-		if ( ixmap & ( ( size_t )1 << bitix )) {
+	for (bitix = 0 ; bitix < STREAM_SIMMAX ; bitix++) {
+		if (ixmap & ((size_t)1 << bitix)) {
 			ixcnt++;
 		}
 	}
diff --git a/common/stream.h b/common/stream.h
index a83a5a5..b3417fa 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -41,21 +41,21 @@
 
 typedef enum { S_FREE, S_RUNNING, S_ZOMBIE } stream_state_t;
 
-extern void stream_init( void );
-extern void stream_register( pthread_t tid, int streamix );
+extern void stream_init(void);
+extern void stream_register(pthread_t tid, int streamix);
 /* NOTE: lock() must be held when calling stream_dead */
-extern void stream_dead( pthread_t tid );
-extern void stream_free( pthread_t tid );
-extern int stream_find_all( stream_state_t states[],
+extern void stream_dead(pthread_t tid);
+extern void stream_free(pthread_t tid);
+extern int stream_find_all(stream_state_t states[],
 			    int nstates,
 			    pthread_t tids[],
-			    int ntids );
-extern int stream_getix( pthread_t tid );
-extern void stream_set_code( pthread_t tid, int code );
-extern void stream_set_return( pthread_t tid, rv_t rv );
-extern void stream_set_hint( pthread_t tid, rv_t rv );
-extern bool_t stream_exists( pthread_t tid );
-extern bool_t stream_get_exit_status( pthread_t tid,
+			    int ntids);
+extern int stream_getix(pthread_t tid);
+extern void stream_set_code(pthread_t tid, int code);
+extern void stream_set_return(pthread_t tid, rv_t rv);
+extern void stream_set_hint(pthread_t tid, rv_t rv);
+extern bool_t stream_exists(pthread_t tid);
+extern bool_t stream_get_exit_status(pthread_t tid,
 				      stream_state_t states[],
 				      int nstates,
 				      stream_state_t *state,
@@ -63,7 +63,7 @@
 				      int *exit_code,
 				      rv_t *exit_return,
 				      rv_t *exit_hint);
-extern size_t stream_cnt( void );
+extern size_t stream_cnt(void);
 
 
 #endif /* STREAM_H */
diff --git a/common/timeutil.c b/common/timeutil.c
index 0e52968..a25b0c4 100644
--- a/common/timeutil.c
+++ b/common/timeutil.c
@@ -38,12 +38,12 @@
 }
 
 char *
-ctimennl( const time32_t *clockp )
+ctimennl(const time32_t *clockp)
 {
-	char *p = ctime32( clockp );
+	char *p = ctime32(clockp);
 
-	if ( p && strlen( p ) > 0 ) {
-		p[ strlen( p ) - 1 ] = 0;
+	if (p && strlen(p) > 0) {
+		p[strlen(p) - 1] = 0;
 	}
 
 	return p;
diff --git a/common/timeutil.h b/common/timeutil.h
index b200855..5b9567d 100644
--- a/common/timeutil.h
+++ b/common/timeutil.h
@@ -24,14 +24,14 @@
 
 /* ctime32 - takes a time32_t instead of a time_t
  */
-extern char *ctime32( const time32_t *timep );
+extern char *ctime32(const time32_t *timep);
 
 /* ctime32_r - takes a time32_t instead of a time_t
  */
-extern char *ctime32_r( const time32_t *timep, char *buf );
+extern char *ctime32_r(const time32_t *timep, char *buf);
 
 /* ctimennl - ctime(3C) with newline removed
  */
-extern char *ctimennl( const time32_t *clockp );
+extern char *ctimennl(const time32_t *clockp);
 
 #endif /* TIMEUTIL_H */
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 92fd889..9e4ae4c 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -42,7 +42,7 @@
  * #define MTSEEK	22	 Seek to the given block number.  Not all
  *				 drives support this option.  For drives
  *				 that support audio, the block number
- *				 actually becomes the program number ( 0
+ *				 actually becomes the program number (0
  *				 meaning leadin area, 0xfffffffe meaning
  *				 leadout, and other values (currently 1-
  *				 799 decimal) the program #).  For seeking
diff --git a/common/types.h b/common/types.h
index b619667..080cc1a 100644
--- a/common/types.h
+++ b/common/types.h
@@ -43,8 +43,8 @@
  * for now we will
  */
 #define PGSZLOG2	12
-#define PGSZ		( 1 << PGSZLOG2 )
-#define PGMASK		( PGSZ - 1 )
+#define PGSZ		(1 << PGSZLOG2)
+#define PGMASK		(PGSZ - 1)
 
 /* integers
  */
@@ -68,37 +68,37 @@
 #define NBBY		8
 #endif
 
-#define	MKMAX( t, s )	( ( t )						\
-			  ( ( ( 1ull					\
+#define	MKMAX(t, s)	((t)						\
+			  (((1ull					\
 			        <<					\
-			        ( ( unsigned long long )sizeof( t )	\
+			        ((unsigned long long)sizeof(t)	\
 				  *					\
-				  ( unsigned long long )NBBY		\
+				  (unsigned long long)NBBY		\
 			          -					\
-			          ( s + 1ull )))			\
+			          (s + 1ull)))			\
 			      -						\
-			      1ull )					\
+			      1ull)					\
 			    *						\
 			    2ull					\
 			    +						\
-			    1ull ))
-#define MKSMAX( t )	MKMAX( t, 1ull )
-#define MKUMAX( t )	MKMAX( t, 0ull )
-#define INT32MAX	MKSMAX( int32_t )
-#define UINT32MAX	MKUMAX( uint32_t )
-#define SIZE32MAX	MKUMAX( size32_t )
-#define INT64MAX	MKSMAX( int64_t )
-#define UINT64MAX	MKUMAX( uint64_t )
-#define SIZE64MAX	MKUMAX( size64_t )
-#define INO64MAX	MKUMAX( xfs_ino_t )
-#define OFF64MAX	MKSMAX( off64_t )
-#define INTGENMAX	MKSMAX( int )
-#define UINTGENMAX	MKUMAX( uint )
-#define OFFMAX		MKSMAX( off_t )
-#define SIZEMAX		MKUMAX( size_t )
-#define IXMAX		MKUMAX( size_t )
-#define INOMAX		MKUMAX( ino_t )
-#define TIMEMAX		MKSMAX( time32_t )
+			    1ull))
+#define MKSMAX(t)	MKMAX(t, 1ull)
+#define MKUMAX(t)	MKMAX(t, 0ull)
+#define INT32MAX	MKSMAX(int32_t)
+#define UINT32MAX	MKUMAX(uint32_t)
+#define SIZE32MAX	MKUMAX(size32_t)
+#define INT64MAX	MKSMAX(int64_t)
+#define UINT64MAX	MKUMAX(uint64_t)
+#define SIZE64MAX	MKUMAX(size64_t)
+#define INO64MAX	MKUMAX(xfs_ino_t)
+#define OFF64MAX	MKSMAX(off64_t)
+#define INTGENMAX	MKSMAX(int)
+#define UINTGENMAX	MKUMAX(uint)
+#define OFFMAX		MKSMAX(off_t)
+#define SIZEMAX		MKUMAX(size_t)
+#define IXMAX		MKUMAX(size_t)
+#define INOMAX		MKUMAX(ino_t)
+#define TIMEMAX		MKSMAX(time32_t)
 #define INT16MAX	0x7fff
 #define UINT16MAX	0xffff
 
@@ -107,8 +107,8 @@
 typedef int bool_t;
 #define BOOL_TRUE	1
 #define BOOL_FALSE	0
-#define BOOL_UNKNOWN	( -1 )
-#define BOOL_ERROR	( -2 )
+#define BOOL_UNKNOWN	(-1)
+#define BOOL_ERROR	(-2)
 
 /* useful return code scheme
  * NOTE: that there are macros and error messages in common/types.h that should
@@ -122,7 +122,7 @@
 	       RV_EOM,		/* hit end of media object */
 	       RV_ERROR,	/* operator error or resource exhaustion */
 	       RV_DONE,		/* return early because someone else did work */
-	       RV_INTR,		/* cldmgr_stop_requested( ) */
+	       RV_INTR,		/* cldmgr_stop_requested() */
 	       RV_CORRUPT,	/* stopped because corrupt data encountered */
 	       RV_QUIT,		/* stop using resource */
 	       RV_DRIVE,	/* drive quit working */
diff --git a/common/util.c b/common/util.c
index 70b17eb..081a40f 100644
--- a/common/util.c
+++ b/common/util.c
@@ -38,31 +38,31 @@
 extern size_t pgsz;
 
 int
-write_buf( char *bufp,
+write_buf(char *bufp,
 	   size_t bufsz,
 	   void *contextp,
 	   gwbfp_t get_write_buf_funcp,
-	   wfp_t write_funcp )
+	   wfp_t write_funcp)
 {
 	char *mbufp;	/* buffer obtained from manager */
 	size_t mbufsz;/* size of buffer obtained from manager */
 
-	while ( bufsz ) {
+	while (bufsz) {
 		int rval;
 
-		assert( bufsz > 0 );
-		mbufp = ( *get_write_buf_funcp )( contextp, bufsz, &mbufsz );
-		assert( mbufsz <= bufsz );
-		if ( bufp ) {
-			(void)memcpy( ( void * )mbufp, ( void * )bufp, mbufsz );
+		assert(bufsz > 0);
+		mbufp = (*get_write_buf_funcp)(contextp, bufsz, &mbufsz);
+		assert(mbufsz <= bufsz);
+		if (bufp) {
+			(void)memcpy((void *)mbufp, (void *)bufp, mbufsz);
 		} else {
-			(void)memset( ( void * )mbufp, 0, mbufsz );
+			(void)memset((void *)mbufp, 0, mbufsz);
 		}
-		rval = ( * write_funcp )( contextp, mbufp, mbufsz );
-		if ( rval ) {
+		rval = (* write_funcp)(contextp, mbufp, mbufsz);
+		if (rval) {
 			return rval;
 		}
-		if ( bufp ) {
+		if (bufp) {
 			bufp += mbufsz;
 		}
 		bufsz -= mbufsz;
@@ -72,12 +72,12 @@
 }
 
 int
-read_buf( char *bufp,
+read_buf(char *bufp,
 	  size_t bufsz,
 	  void *contextp,
 	  rfp_t read_funcp,
 	  rrbfp_t return_read_buf_funcp,
-	  int *statp )
+	  int *statp)
 {
 	char *mbufp;		/* manager's buffer pointer */
 	size_t mbufsz;	/* size of manager's buffer */
@@ -85,37 +85,37 @@
 
 	nread = 0;
 	*statp = 0;
-	while ( bufsz ) {
-		mbufp = ( * read_funcp )( contextp, bufsz, &mbufsz, statp );
-		if ( *statp ) {
+	while (bufsz) {
+		mbufp = (* read_funcp)(contextp, bufsz, &mbufsz, statp);
+		if (*statp) {
 			break;
 		}
-		assert( mbufsz <= bufsz );
-		if ( bufp ) {
-			( void )memcpy( (void *)bufp, (void *)mbufp, mbufsz );
+		assert(mbufsz <= bufsz);
+		if (bufp) {
+			(void)memcpy((void *)bufp, (void *)mbufp, mbufsz);
 			bufp += mbufsz;
 		}
 		bufsz -= mbufsz;
-		nread += ( int )mbufsz;
-		( * return_read_buf_funcp )( contextp, mbufp, mbufsz );
+		nread += (int)mbufsz;
+		(* return_read_buf_funcp)(contextp, mbufp, mbufsz);
 	}
 
 	return nread;
 }
 
 char
-*strncpyterm( char *s1, char *s2, size_t n )
+*strncpyterm(char *s1, char *s2, size_t n)
 {
 	char *rval;
 
-	if ( n < 1 ) return 0;
-	rval = strncpy( s1, s2, n );
-	s1[ n - 1 ] = 0;
+	if (n < 1) return 0;
+	rval = strncpy(s1, s2, n);
+	s1[n - 1] = 0;
 	return rval;
 }
 
 int
-bigstat_iter( jdm_fshandle_t *fshandlep,
+bigstat_iter(jdm_fshandle_t *fshandlep,
 	      int fsfd,
 	      int selector,
 	      xfs_ino_t start_ino,
@@ -124,9 +124,9 @@
 	      bstat_seekfp_t seekfp,
 	      void * seek_arg1,
 	      int *statp,
-	      bool_t ( pfp )( int ),
+	      bool_t (pfp)(int),
 	      xfs_bstat_t *buf,
-	      size_t buflenin )
+	      size_t buflenin)
 {
 	__s32 buflenout;
 	xfs_ino_t lastino;
@@ -141,20 +141,20 @@
 	/* NOT COOL: open will affect root dir's access time
 	 */
 
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "bulkstat iteration initiated: start_ino == %llu\n",
-	      start_ino );
+	      start_ino);
 
 	/* quirk of the interface: I want to play in terms of the
 	 * ino to begin with, and ino 0 is not used. so, ...
 	 */
-	if ( start_ino > 0 ) {
+	if (start_ino > 0) {
 		lastino = start_ino - 1;
 	} else {
 		lastino = 0;
 	}
-	mlog( MLOG_NITTY + 1,
-	      "calling bulkstat\n" );
+	mlog(MLOG_NITTY + 1,
+	      "calling bulkstat\n");
 
 	bulkstatcnt = 0;
 	bulkreq.lastip = (__u64 *)&lastino;
@@ -165,101 +165,101 @@
 		xfs_bstat_t *p;
 		xfs_bstat_t *endp;
 
-		if ( buflenout == 0 ) {
-			mlog( MLOG_NITTY + 1,
+		if (buflenout == 0) {
+			mlog(MLOG_NITTY + 1,
 			      "bulkstat returns buflen %d\n",
-			      buflenout );
+			      buflenout);
 			return 0;
 		}
-		mlog( MLOG_NITTY + 1,
+		mlog(MLOG_NITTY + 1,
 		      "bulkstat returns buflen %d ino %llu\n",
 		      buflenout,
-		      buf->bs_ino );
-		for ( p = buf, endp = buf + buflenout ; p < endp ; p++ ) {
+		      buf->bs_ino);
+		for (p = buf, endp = buf + buflenout ; p < endp ; p++) {
 			int rval;
 
-			if ( p->bs_ino == 0 )
+			if (p->bs_ino == 0)
 				continue;
 
-			if ( !p->bs_nlink || !p->bs_mode ) {
+			if (!p->bs_nlink || !p->bs_mode) {
 				/* inode being modified, get synced data */
-				mlog( MLOG_NITTY + 1,
+				mlog(MLOG_NITTY + 1,
 				      "ino %llu needed second bulkstat\n",
-				      p->bs_ino );
+				      p->bs_ino);
 
-				if( bigstat_one( fsfd, p->bs_ino, p ) < 0 ) {
-				    mlog( MLOG_WARNING,
+				if(bigstat_one(fsfd, p->bs_ino, p) < 0) {
+				    mlog(MLOG_WARNING,
 					  _("failed to get bulkstat information for inode %llu\n"),
-					  p->bs_ino );
+					  p->bs_ino);
 				    continue;
 				}
-				if ( !p->bs_nlink || !p->bs_mode || !p->bs_ino ) {
-					mlog( MLOG_TRACE,
+				if (!p->bs_nlink || !p->bs_mode || !p->bs_ino) {
+					mlog(MLOG_TRACE,
 					      _("failed to get valid bulkstat information for inode %llu\n"),
-					      p->bs_ino );
+					      p->bs_ino);
 					continue;
 				}
 			}
 
-			if ( ( p->bs_mode & S_IFMT ) == S_IFDIR ) {
-				if ( ! ( selector & BIGSTAT_ITER_DIR )){
+			if ((p->bs_mode & S_IFMT) == S_IFDIR) {
+				if (! (selector & BIGSTAT_ITER_DIR)){
 					continue;
 				}
 			} else {
-				if ( ! ( selector & BIGSTAT_ITER_NONDIR )){
+				if (! (selector & BIGSTAT_ITER_NONDIR)){
 					continue;
 				}
 			}
-			rval = ( * fp )( cb_arg1, fshandlep, fsfd, p );
-			if ( rval ) {
+			rval = (* fp)(cb_arg1, fshandlep, fsfd, p);
+			if (rval) {
 				*statp = rval;
 				return 0;
 			}
-			if ( pfp ) ( pfp )( PREEMPT_PROGRESSONLY );
+			if (pfp) (pfp)(PREEMPT_PROGRESSONLY);
 		}
 
-		if ( pfp && (++bulkstatcnt % 10) == 0 &&
-		     ( pfp )( PREEMPT_FULL )) {
+		if (pfp && (++bulkstatcnt % 10) == 0 &&
+		     (pfp)(PREEMPT_FULL)) {
 			return EINTR;
 		}
 
 		if (seekfp) {
 			lastino = seekfp(seek_arg1, lastino);
 			if (lastino == INO64MAX) {
-				mlog( MLOG_DEBUG,
+				mlog(MLOG_DEBUG,
 				      "bulkstat seeked to EOS\n");
 				return 0;
 			}
 
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "bulkstat seeked to %llu\n", lastino);
 
 			lastino = (lastino > 0) ? lastino - 1 : 0;
 		}
 
-		mlog( MLOG_NITTY + 1,
-		      "calling bulkstat\n" );
+		mlog(MLOG_NITTY + 1,
+		      "calling bulkstat\n");
 	}
 
 	saved_errno = errno;
 
-	mlog( MLOG_NORMAL,
+	mlog(MLOG_NORMAL,
 	      _("syssgi( SGI_FS_BULKSTAT ) on fsroot failed: %s\n"),
-	      strerror( saved_errno ));
+	      strerror(saved_errno));
 
 	return saved_errno;
 }
 
 /* ARGSUSED */
 int
-bigstat_one( int fsfd,
+bigstat_one(int fsfd,
 	     xfs_ino_t ino,
-	     xfs_bstat_t *statp )
+	     xfs_bstat_t *statp)
 {
         xfs_fsop_bulkreq_t bulkreq;
 	int count = 0;
 
-	assert( ino > 0 );
+	assert(ino > 0);
         bulkreq.lastip = (__u64 *)&ino;
         bulkreq.icount = 1;
         bulkreq.ubuffer = statp;
@@ -271,12 +271,12 @@
  */
 #define INOGRPLEN	256
 int
-inogrp_iter( int fsfd,
-	     int ( * fp )( void *arg1,
+inogrp_iter(int fsfd,
+	     int (* fp)(void *arg1,
 				int fsfd,
-				xfs_inogrp_t *inogrp ),
+				xfs_inogrp_t *inogrp),
 	     void * arg1,
-	     int *statp )
+	     int *statp)
 {
 	xfs_ino_t lastino;
 	int inogrpcnt;
@@ -304,15 +304,15 @@
 	while (!ioctl(fsfd, XFS_IOC_FSINUMBERS, &bulkreq)) {
 		xfs_inogrp_t *p, *endp;
 
-		if ( inogrpcnt == 0 ) {
+		if (inogrpcnt == 0) {
 			free(igrp);
 			return 0;
 		}
-		for ( p = igrp, endp = igrp + inogrpcnt ; p < endp ; p++ ) {
+		for (p = igrp, endp = igrp + inogrpcnt ; p < endp ; p++) {
 			int rval;
 
-			rval = ( * fp )( arg1, fsfd, p );
-			if ( rval ) {
+			rval = (* fp)(arg1, fsfd, p);
+			if (rval) {
 				*statp = rval;
 				free(igrp);
 				return 0;
@@ -337,18 +337,18 @@
  * caller may supply a dirent buffer. if not, will malloc one
  */
 int
-diriter( jdm_fshandle_t *fshandlep,
+diriter(jdm_fshandle_t *fshandlep,
 	 int fsfd,
 	 xfs_bstat_t *statp,
-	 int ( *cbfp )( void *arg1,
+	 int (*cbfp)(void *arg1,
 			     jdm_fshandle_t *fshandlep,
 			     int fsfd,
 			     xfs_bstat_t *statp,
-			     char *namep ),
+			     char *namep),
 	 void *arg1,
 	 int *cbrvalp,
 	 char *usrgdp,
-	 size_t usrgdsz )
+	 size_t usrgdsz)
 {
 	size_t gdsz;
 	struct dirent *gdp;
@@ -357,105 +357,105 @@
 	int scrval;
 	int cbrval;
 
-	if ( usrgdp ) {
-		assert( usrgdsz >= sizeof( struct dirent ) );
+	if (usrgdp) {
+		assert(usrgdsz >= sizeof(struct dirent));
 		gdsz = usrgdsz;
-		gdp = ( struct dirent * )usrgdp;
+		gdp = (struct dirent *)usrgdp;
 	} else {
 		gdsz = pgsz;
-		gdp = ( struct dirent * )malloc( gdsz );
-		assert( gdp );
+		gdp = (struct dirent *)malloc(gdsz);
+		assert(gdp);
 	}
 
 	/* open the directory
 	 */
-	fd = jdm_open( fshandlep, statp, O_RDONLY );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL,
+	fd = jdm_open(fshandlep, statp, O_RDONLY);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL,
 		      _("WARNING: unable to open directory ino %llu: %s\n"),
 		      statp->bs_ino,
-		      strerror( errno ));
+		      strerror(errno));
 		*cbrvalp = 0;
-		if ( ! usrgdp ) {
-			free( ( void * )gdp );
+		if (! usrgdp) {
+			free((void *)gdp);
 		}
 		return -1;
 	}
-	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
+	assert((statp->bs_mode & S_IFMT) == S_IFDIR);
 
 	/* lots of buffering done here, to achieve OS-independence.
 	 * if proves to be to much overhead, can streamline.
 	 */
 	scrval = 0;
 	cbrval = 0;
-	for ( gdcnt = 1 ; ; gdcnt++ ) {
+	for (gdcnt = 1 ; ; gdcnt++) {
 		struct dirent *p;
 		int nread;
 		register size_t reclen;
 
-		assert( scrval == 0 );
-		assert( cbrval == 0 );
+		assert(scrval == 0);
+		assert(cbrval == 0);
 
-		nread = getdents_wrap( fd, (char *)gdp, gdsz );
+		nread = getdents_wrap(fd, (char *)gdp, gdsz);
 
 		/* negative count indicates something very bad happened;
 		 * try to gracefully end this dir.
 		 */
-		if ( nread < 0 ) {
-			mlog( MLOG_NORMAL,
+		if (nread < 0) {
+			mlog(MLOG_NORMAL,
 			      _("WARNING: unable to read dirents (%d) for "
 			      "directory ino %llu: %s\n"),
 			      gdcnt,
 			      statp->bs_ino,
-			      strerror( errno ));
+			      strerror(errno));
 			nread = 0; /* pretend we are done */
 		}
 
 		/* no more directory entries: break;
 		 */
-		if ( nread == 0 ) {
+		if (nread == 0) {
 			break;
 		}
 
 		/* translate and invoke cb each entry: skip "." and "..".
 		 */
-		for ( p = gdp,
-		      reclen = ( size_t )p->d_reclen
+		for (p = gdp,
+		      reclen = (size_t)p->d_reclen
 		      ;
 		      nread > 0
 		      ;
-		      nread -= ( int )reclen,
-		      assert( nread >= 0 ),
-		      p = ( struct dirent * )( ( char * )p + reclen ),
-		      reclen = ( size_t )p->d_reclen ) {
+		      nread -= (int)reclen,
+		      assert(nread >= 0),
+		      p = (struct dirent *)((char *)p + reclen),
+		      reclen = (size_t)p->d_reclen) {
 			xfs_bstat_t statbuf;
-			assert( scrval == 0 );
-			assert( cbrval == 0 );
+			assert(scrval == 0);
+			assert(cbrval == 0);
 
 			/* skip "." and ".."
 			 */
-			if ( *( p->d_name + 0 ) == '.'
+			if (*(p->d_name + 0) == '.'
 			     &&
-			     ( *( p->d_name + 1 ) == 0
+			     (*(p->d_name + 1) == 0
 			       ||
-			       ( *( p->d_name + 1 ) == '.'
+			       (*(p->d_name + 1) == '.'
 				 &&
-				 *( p->d_name + 2 ) == 0 ))) {
+				 *(p->d_name + 2) == 0))) {
 				continue;
 			}
 
 			/* use bigstat
 			 */
-			scrval = bigstat_one( fsfd,
+			scrval = bigstat_one(fsfd,
 					      p->d_ino,
-					      &statbuf );
-			if ( scrval ) {
-				mlog( MLOG_NORMAL,
+					      &statbuf);
+			if (scrval) {
+				mlog(MLOG_NORMAL,
 				      _("WARNING: could not stat "
 				      "dirent %s ino %llu: %s\n"),
 				      p->d_name,
-				      ( xfs_ino_t )p->d_ino,
-				      strerror( errno ));
+				      (xfs_ino_t)p->d_ino,
+				      strerror(errno));
 				scrval = 0;
 				continue;
 			}
@@ -464,45 +464,45 @@
 			 * occupied more than 32 bits, warn and skip.
 			 */
 #ifndef __USE_LARGEFILE64
-			if ( statbuf.bs_ino > ( xfs_ino_t )INOMAX ) {
-				mlog( MLOG_NORMAL,
+			if (statbuf.bs_ino > (xfs_ino_t)INOMAX) {
+				mlog(MLOG_NORMAL,
 				      _("WARNING: unable to process dirent %s: "
 				      "ino %llu too large\n"),
 				      p->d_name,
-				      ( xfs_ino_t )p->d_ino );
+				      (xfs_ino_t)p->d_ino);
 				continue;
 			}
 #endif
 
 			/* invoke the callback
 			 */
-			cbrval = ( * cbfp )( arg1,
+			cbrval = (* cbfp)(arg1,
 					     fshandlep,
 					     fsfd,
 					     &statbuf,
-					     p->d_name );
+					     p->d_name);
 
 			/* abort the iteration if the callback returns non-zero
 			 */
-			if ( cbrval ) {
+			if (cbrval) {
 				break;
 			}
 		}
 
-		if ( scrval || cbrval ) {
+		if (scrval || cbrval) {
 			break;
 		}
 	}
 
-	( void )close( fd );
-	if ( ! usrgdp ) {
-		free( ( void * )gdp );
+	(void)close(fd);
+	if (! usrgdp) {
+		free((void *)gdp);
 	}
 
-	if ( scrval ) {
+	if (scrval) {
 		*cbrvalp = 0;
 		return -1;
-	} else if ( cbrval ) {
+	} else if (cbrval) {
 		*cbrvalp = cbrval;
 		return 1;
 	} else {
@@ -512,7 +512,7 @@
 }
 
 int
-cvtnum( int blocksize, char *s )
+cvtnum(int blocksize, char *s)
 {
 	int i;
 	char *sp;
diff --git a/common/util.h b/common/util.h
index 07fdd36..ab43739 100644
--- a/common/util.h
+++ b/common/util.h
@@ -32,14 +32,14 @@
  *
  * if bufp is null, writes bufsz zeros.
  */
-typedef char * ( * gwbfp_t )( void *contextp, size_t wantedsz, size_t *szp);
-typedef int ( * wfp_t )( void *contextp, char *bufp, size_t bufsz );
+typedef char * (* gwbfp_t)(void *contextp, size_t wantedsz, size_t *szp);
+typedef int (* wfp_t)(void *contextp, char *bufp, size_t bufsz);
 
-extern int write_buf( char *bufp,
+extern int write_buf(char *bufp,
 			   size_t bufsz,
 			   void *contextp,
 			   gwbfp_t get_write_buf_funcp,
-			   wfp_t write_funcp );
+			   wfp_t write_funcp);
 
 
 /* read_buf - converts the normal manager read method into something simpler
@@ -56,21 +56,21 @@
  * status of the first failure of the read funcp. if no read failures occur,
  * *statp will be zero.
  */
-typedef char * ( *rfp_t )( void *contextp, size_t wantedsz, size_t *szp, int *statp );
-typedef void ( * rrbfp_t )( void *contextp, char *bufp, size_t bufsz );
+typedef char * (*rfp_t)(void *contextp, size_t wantedsz, size_t *szp, int *statp);
+typedef void (* rrbfp_t)(void *contextp, char *bufp, size_t bufsz);
 
-extern int read_buf( char *bufp,
+extern int read_buf(char *bufp,
 			  size_t bufsz,
 			  void *contextp,
 			  rfp_t read_funcp,
 			  rrbfp_t return_read_buf_funcp,
-			  int *statp );
+			  int *statp);
 
 
 
 /* strncpyterm - like strncpy, but guarantees the destination is null-terminated
  */
-extern char *strncpyterm( char *s1, char *s2, size_t n );
+extern char *strncpyterm(char *s1, char *s2, size_t n);
 
 /* bigstat - efficient file status gatherer. presents an iterative
  * callback interface, invoking the caller's callback for each in-use
@@ -80,19 +80,19 @@
  * stat is set to zero. return value set to errno if the system call fails,
  * or EINTR if optional pre-emption func returns TRUE.
  */
-#define BIGSTAT_ITER_DIR	( 1 << 0 )
-#define BIGSTAT_ITER_NONDIR	( 1 << 1 )
-#define BIGSTAT_ITER_ALL	( ~0 )
+#define BIGSTAT_ITER_DIR	(1 << 0)
+#define BIGSTAT_ITER_NONDIR	(1 << 1)
+#define BIGSTAT_ITER_ALL	(~0)
 
 typedef int (*bstat_cbfp_t)(void *arg1,
 				 jdm_fshandle_t *fshandlep,
 				 int fsfd,
-				 xfs_bstat_t *statp );
+				 xfs_bstat_t *statp);
 
 typedef xfs_ino_t (*bstat_seekfp_t)(void *arg1,
 				    xfs_ino_t lastino);
 
-extern int bigstat_iter( jdm_fshandle_t *fshandlep,
+extern int bigstat_iter(jdm_fshandle_t *fshandlep,
 			      int fsfd,
 			      int selector,
 			      xfs_ino_t start_ino,
@@ -101,20 +101,20 @@
 			      bstat_seekfp_t seekfp,
 			      void * seek_arg1,
 			      int *statp,
-			      bool_t ( pfp )( int ), /* preemption chk func */
+			      bool_t (pfp)(int), /* preemption chk func */
 			      xfs_bstat_t *buf,
-			      size_t buflen );
+			      size_t buflen);
 
-extern int bigstat_one( int fsfd,
+extern int bigstat_one(int fsfd,
 			     xfs_ino_t ino,
-			     xfs_bstat_t *statp );
+			     xfs_bstat_t *statp);
 
-extern int inogrp_iter( int fsfd,
-			     int ( * fp )( void *arg1,
+extern int inogrp_iter(int fsfd,
+			     int (* fp)(void *arg1,
 				     		int fsfd,
-						xfs_inogrp_t *inogrp ),
+						xfs_inogrp_t *inogrp),
 			     void * arg1,
-			     int *statp );
+			     int *statp);
 
 /* calls the callback for every entry in the directory specified
  * by the stat buffer. supplies the callback with a file system
@@ -122,31 +122,31 @@
  *
  * NOTE: does NOT invoke callback for "." or ".."!
  *
- * caller may supply getdents buffer. size must be >= sizeof( dirent_t )
+ * caller may supply getdents buffer. size must be >= sizeof(dirent_t)
  * + MAXPATHLEN. if not supplied (usrgdp NULL), one will be malloc()ed.
  *
  * if the callback returns non-zero, returns 1 with cbrval set to the
  * callback's return value. if syscall fails, returns -1 with errno set.
  * otherwise returns 0.
  */
-extern int diriter( jdm_fshandle_t *fshandlep,
+extern int diriter(jdm_fshandle_t *fshandlep,
 			 int fsfd,
 			 xfs_bstat_t *statp,
-			 int ( *cbfp )( void *arg1,
+			 int (*cbfp)(void *arg1,
 					     jdm_fshandle_t *fshandlep,
 					     int fsfd,
 					     xfs_bstat_t *statp,
-					     char *namep ),
+					     char *namep),
 			 void *arg1,
 			 int *cbrvalp,
 			 char *usrgdp,
-			 size_t usrgdsz );
+			 size_t usrgdsz);
 
 
 
 /* macro to copy uuid structures
  */
-#define COPY_LABEL( lab1, lab2) ( bcopy( lab1, lab2, GLOBAL_HDR_STRING_SZ) )
+#define COPY_LABEL(lab1, lab2) (bcopy(lab1, lab2, GLOBAL_HDR_STRING_SZ))
 
 /*
  * Align pointer up to alignment
diff --git a/dump/content.c b/dump/content.c
index ecc867d..43f51db 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -109,7 +109,7 @@
 
 typedef struct mark mark_t;
 
-/* Media_mfile_begin( ) entry state.
+/* Media_mfile_begin() entry state.
  */
 enum bes { BES_INIT,	/* in the beginning */
 	   BES_ENDOK,   /* last media file successfully flushed to media */
@@ -197,7 +197,7 @@
 #define BMAP_LEN	512
 
 struct extent_group_context {
-	getbmapx_t eg_bmap[ BMAP_LEN ];
+	getbmapx_t eg_bmap[BMAP_LEN];
 	getbmapx_t *eg_nextbmapp;	/* ptr to the next extent to dump */
 	getbmapx_t *eg_endbmapp;		/* to detect extent exhaustion */
 	int eg_fd;			/* file desc. */
@@ -208,27 +208,27 @@
 typedef struct extent_group_context extent_group_context_t;
 
 
-/* minimum getdents( ) buffer size
+/* minimum getdents() buffer size
  */
-#define GETDENTSBUF_SZ_MIN	( 2 * pgsz )
+#define GETDENTSBUF_SZ_MIN	(2 * pgsz)
 
 
 /* minimum sizes for extended attributes buffers
  */
-#define EXTATTR_LISTBUF_SZ	( XATTR_LIST_MAX )
-#define EXTATTR_RTRVARRAY_LEN	( 1 * pgsz )
-#define EXTATTR_DUMPBUF_SZ	( 4 * pgsz )
+#define EXTATTR_LISTBUF_SZ	(XATTR_LIST_MAX)
+#define EXTATTR_RTRVARRAY_LEN	(1 * pgsz)
+#define EXTATTR_DUMPBUF_SZ	(4 * pgsz)
 
 /* for printing ext attr namespace
  */
-#define EXTATTR_NAMESPACE(flag)	( ((flag) & ATTR_ROOT) ? _("root") : \
-				( ((flag) & ATTR_SECURE) ? _("secure") : \
-				  _("non-root") ) )
+#define EXTATTR_NAMESPACE(flag)	(((flag) & ATTR_ROOT) ? _("root") : \
+				(((flag) & ATTR_SECURE) ? _("secure") : \
+				  _("non-root")))
 
 /* for printing file type
  */
-#define FILETYPE(statp)		( ( (statp)->bs_mode & S_IFMT ) == S_IFDIR \
-				  ? _("dir") : _("nondir") )
+#define FILETYPE(statp)		(((statp)->bs_mode & S_IFMT) == S_IFDIR \
+				  ? _("dir") : _("nondir"))
 
 /* per-drive status descriptor
  */
@@ -248,8 +248,8 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
-extern bool_t preemptchk( int );
+extern void usage(void);
+extern bool_t preemptchk(int);
 extern char *homedir;
 extern bool_t pipeline;
 extern bool_t stdoutpiped;
@@ -261,51 +261,51 @@
 
 /* file dumpers
  */
-static rv_t dump_dirs( ix_t strmix,
+static rv_t dump_dirs(ix_t strmix,
 		       xfs_bstat_t *bstatbufp,
 		       size_t bstatbuflen,
-		       void *inomap_contextp );
-static rv_t dump_dir( ix_t strmix,
+		       void *inomap_contextp);
+static rv_t dump_dir(ix_t strmix,
 		      jdm_fshandle_t *,
 		      int,
-		      xfs_bstat_t * );
-static rv_t dump_file( void *,
+		      xfs_bstat_t *);
+static rv_t dump_file(void *,
 		       jdm_fshandle_t *,
 		       int,
-		       xfs_bstat_t * );
-static rv_t dump_file_reg( drive_t *drivep,
+		       xfs_bstat_t *);
+static rv_t dump_file_reg(drive_t *drivep,
 			   context_t *contextp,
 			   content_inode_hdr_t *scwhdrp,
 			   jdm_fshandle_t *,
 			   xfs_bstat_t *,
 			   bool_t *);
-static rv_t dump_file_spec( drive_t *drivep,
+static rv_t dump_file_spec(drive_t *drivep,
 			    context_t *contextp,
 			    jdm_fshandle_t *,
-			    xfs_bstat_t * );
-static rv_t dump_filehdr( drive_t *drivep,
+			    xfs_bstat_t *);
+static rv_t dump_filehdr(drive_t *drivep,
 			  context_t *contextp,
 			  xfs_bstat_t *,
 			  off64_t,
-			  int );
-static rv_t dump_extenthdr( drive_t *drivep,
+			  int);
+static rv_t dump_extenthdr(drive_t *drivep,
 			    context_t *contextp,
 			    int32_t,
 			    int32_t,
 			    off64_t,
-			    off64_t );
-static rv_t dump_dirent( drive_t *drivep,
+			    off64_t);
+static rv_t dump_dirent(drive_t *drivep,
 			 context_t *contextp,
 			 xfs_bstat_t *,
 			 xfs_ino_t,
 			 gen_t,
 			 char *,
-			 size_t );
-static rv_t init_extent_group_context( jdm_fshandle_t *,
+			 size_t);
+static rv_t init_extent_group_context(jdm_fshandle_t *,
 				       xfs_bstat_t *,
-				       extent_group_context_t * );
-static void cleanup_extent_group_context( extent_group_context_t * );
-static rv_t dump_extent_group( drive_t *drivep,
+				       extent_group_context_t *);
+static void cleanup_extent_group_context(extent_group_context_t *);
+static rv_t dump_extent_group(drive_t *drivep,
 			       context_t *contextp,
 			       xfs_bstat_t *,
 			       extent_group_context_t *,
@@ -314,70 +314,70 @@
 			       bool_t,
 			       off64_t *,
 			       off64_t *,
-			       bool_t * );
-static bool_t dump_session_inv( drive_t *drivep,
+			       bool_t *);
+static bool_t dump_session_inv(drive_t *drivep,
 			        context_t *contextp,
 			        media_hdr_t *mwhdrp,
-			        content_inode_hdr_t *scwhdrp );
-static rv_t write_pad( drive_t *drivep, size_t );
+			        content_inode_hdr_t *scwhdrp);
+static rv_t write_pad(drive_t *drivep, size_t);
 
-static void mark_callback( void *, drive_markrec_t *, bool_t );
+static void mark_callback(void *, drive_markrec_t *, bool_t);
 
-static void inv_cleanup( void );
-static void dump_terminator( drive_t *drivep,
+static void inv_cleanup(void);
+static void dump_terminator(drive_t *drivep,
 			     context_t *contextp,
-			     media_hdr_t *mwhdrp );
-static rv_t Media_mfile_begin( drive_t *drivep,
+			     media_hdr_t *mwhdrp);
+static rv_t Media_mfile_begin(drive_t *drivep,
 			       context_t *contextp,
-			       bool_t intr_allowed );
-static rv_t Media_mfile_end( drive_t *drivep,
+			       bool_t intr_allowed);
+static rv_t Media_mfile_end(drive_t *drivep,
 			     context_t *contextp,
 			     media_hdr_t *mwhdrp,
 			     off64_t *ncommittedp,
-			     bool_t hit_eom );
-static bool_t Media_prompt_overwrite( drive_t *drivep );
-static rv_t Media_erasechk( drive_t *drivep,
+			     bool_t hit_eom);
+static bool_t Media_prompt_overwrite(drive_t *drivep);
+static rv_t Media_erasechk(drive_t *drivep,
 			    int dcaps,
 			    bool_t intr_allowed,
-			    bool_t prevmediapresentpr );
-static bool_t Media_prompt_erase( drive_t *drivep );
-static char *Media_prompt_label( drive_t *drivep, char *bufp, size_t bufsz );
-static void update_cc_Media_useterminatorpr( drive_t *drivep,
-					     context_t *contextp );
-static void set_mcflag( ix_t thrdix );
-static void clr_mcflag( ix_t thrdix );
+			    bool_t prevmediapresentpr);
+static bool_t Media_prompt_erase(drive_t *drivep);
+static char *Media_prompt_label(drive_t *drivep, char *bufp, size_t bufsz);
+static void update_cc_Media_useterminatorpr(drive_t *drivep,
+					     context_t *contextp);
+static void set_mcflag(ix_t thrdix);
+static void clr_mcflag(ix_t thrdix);
 
-static bool_t check_complete_flags( void );
+static bool_t check_complete_flags(void);
 
-static rv_t dump_extattrs( drive_t *drivep,
+static rv_t dump_extattrs(drive_t *drivep,
 			   context_t *contextp,
 	       		   jdm_fshandle_t *fshandlep,
 			   xfs_bstat_t *statp);
-static rv_t dump_extattr_list( drive_t *drivep,
+static rv_t dump_extattr_list(drive_t *drivep,
 			       context_t *contextp,
 	       		       jdm_fshandle_t *fshandlep,
 			       xfs_bstat_t *statp,
 			       attrlist_t *listp,
 			       int flag,
-			       bool_t *abortprp );
-static char *dump_extattr_buildrecord( xfs_bstat_t *statp,
+			       bool_t *abortprp);
+static char *dump_extattr_buildrecord(xfs_bstat_t *statp,
 				       char *dumpbufp,
 				       char *dumpbufendp,
 				       char *namesrcp,
 				       uint32_t valuesz,
 				       int flag,
-				       char **valuepp );
-static rv_t dump_extattrhdr( drive_t *drivep,
+				       char **valuepp);
+static rv_t dump_extattrhdr(drive_t *drivep,
 			     context_t *contextp,
 			     xfs_bstat_t *statp,
 			     size_t recsz,
 			     size_t valoff,
 			     ix_t flags,
-			     uint32_t valsz );
+			     uint32_t valsz);
 
-static bool_t save_quotas( char *mntpnt,
-			   quota_info_t *quotainfo );
-static int getxfsqstat( char *fsdev );
+static bool_t save_quotas(char *mntpnt,
+			   quota_info_t *quotainfo);
+static int getxfsqstat(char *fsdev);
 
 
 
@@ -448,7 +448,7 @@
 static size64_t sc_stat_dircnt = 0;
 	/* total number of directory inodes to be dumped (strm 0)
 	 */
-static pds_t sc_stat_pds[ STREAM_SIMMAX ];
+static pds_t sc_stat_pds[STREAM_SIMMAX];
 	/* per-drive stream status
 	 */
 static size64_t sc_stat_nondircnt = 0;
@@ -470,13 +470,13 @@
 	 */
 static size_t sc_thrdsdonecnt = 0;
 	/* number of threads which are ready to dump the session inventory.
-	 * when equal to the number of streams remaining (stream_cnt( )),
+	 * when equal to the number of streams remaining (stream_cnt()),
 	 * can proceed with inventory dumps
 	 */
 static context_t *sc_contextp;
 	/* an array of per-stream context descriptors
 	 */
-static bool_t sc_mcflag[ STREAM_SIMMAX ];
+static bool_t sc_mcflag[STREAM_SIMMAX];
 	/* media change flag
 	 */
 static bool_t sc_dumpextattrpr = BOOL_TRUE;
@@ -512,9 +512,9 @@
 		size_t strmix);
 
 bool_t
-content_init( int argc,
-	      char *argv[ ],
-	      global_hdr_t *gwhdrtemplatep )
+content_init(int argc,
+	      char *argv[],
+	      global_hdr_t *gwhdrtemplatep)
 {
 
 	inv_idbtoken_t inv_idbt;
@@ -528,13 +528,13 @@
 	ix_t subtreeix;
 	bool_t resumereqpr = BOOL_FALSE;
 	char *srcname;
-	char mntpnt[ GLOBAL_HDR_STRING_SZ ];
-	char fsdevice[ GLOBAL_HDR_STRING_SZ ];
-	char fstype[ CONTENT_HDR_FSTYPE_SZ ];
+	char mntpnt[GLOBAL_HDR_STRING_SZ];
+	char fsdevice[GLOBAL_HDR_STRING_SZ];
+	char fstype[CONTENT_HDR_FSTYPE_SZ];
 	bool_t skip_unchanged_dirs = BOOL_FALSE;
 	uuid_t fsid;
 	bool_t underfoundpr;
-	ix_t underlevel = ( ix_t )( -1 );
+	ix_t underlevel = (ix_t)(-1);
 	time32_t undertime = 0;
 	uuid_t underid;
 	bool_t underpartialpr = BOOL_FALSE;
@@ -566,27 +566,27 @@
 
 	/* basic sanity checks
 	 */
-	assert( sizeof( mode_t ) == MODE_SZ );
-	assert( sizeof( timestruct_t ) == TIMESTRUCT_SZ );
-	assert( sizeof( bstat_t ) == BSTAT_SZ );
-	assert( sizeof( filehdr_t ) == FILEHDR_SZ );
-	assert( sizeof( extenthdr_t ) == EXTENTHDR_SZ );
-	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
-	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
-	assert( DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0 );
-	assert( sizeofmember( content_hdr_t, ch_specific )
+	assert(sizeof(mode_t) == MODE_SZ);
+	assert(sizeof(timestruct_t) == TIMESTRUCT_SZ);
+	assert(sizeof(bstat_t) == BSTAT_SZ);
+	assert(sizeof(filehdr_t) == FILEHDR_SZ);
+	assert(sizeof(extenthdr_t) == EXTENTHDR_SZ);
+	assert(sizeof(direnthdr_t) == DIRENTHDR_SZ);
+	assert(sizeof(direnthdr_v1_t) == DIRENTHDR_SZ);
+	assert(DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0);
+	assert(sizeofmember(content_hdr_t, ch_specific)
 		>=
-		sizeof( content_inode_hdr_t ));
-	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
+		sizeof(content_inode_hdr_t));
+	assert(sizeof(extattrhdr_t) == EXTATTRHDR_SZ);
 
 	/* calculate offsets of portions of the write hdr template
 	 */
-	dwhdrtemplatep = ( drive_hdr_t * )gwhdrtemplatep->gh_upper;
-	mwhdrtemplatep = ( media_hdr_t * )dwhdrtemplatep->dh_upper;
-	cwhdrtemplatep = ( content_hdr_t * )mwhdrtemplatep->mh_upper;
-	scwhdrtemplatep = ( content_inode_hdr_t * ) cwhdrtemplatep->ch_specific;
+	dwhdrtemplatep = (drive_hdr_t *)gwhdrtemplatep->gh_upper;
+	mwhdrtemplatep = (media_hdr_t *)dwhdrtemplatep->dh_upper;
+	cwhdrtemplatep = (content_hdr_t *)mwhdrtemplatep->mh_upper;
+	scwhdrtemplatep = (content_inode_hdr_t *) cwhdrtemplatep->ch_specific;
 
-	if ( gwhdrtemplatep->gh_version < GLOBAL_HDR_VERSION_3 ) {
+	if (gwhdrtemplatep->gh_version < GLOBAL_HDR_VERSION_3) {
 		sc_use_old_direntpr = BOOL_TRUE;
 	}
 
@@ -596,61 +596,61 @@
 	opterr = 0;
 	subtreecnt = 0;
 	baseuuidvalpr = BOOL_FALSE;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_LEVEL:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			sc_level = ( ix_t )atoi( optarg );
-			if ( sc_level > LEVEL_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			sc_level = (ix_t)atoi(optarg);
+			if (sc_level > LEVEL_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument must be "
 				      "between 0 and %d\n"),
 				      c,
-				      LEVEL_MAX );
-				usage( );
+				      LEVEL_MAX);
+				usage();
 				return BOOL_FALSE;
 			}
 			break;
 		case GETOPT_SUBTREE:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( optarg[ 0 ] == '/' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (optarg[0] == '/') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument (subtree) "
 				      "must be a relative pathname\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			subtreecnt++;
 			break;
 		case GETOPT_MAXDUMPFILESIZE:
-			if ( ! optarg || optarg [ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg [0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			maxdumpfilesize = strtoull(optarg, NULL, 0);
-			if ( maxdumpfilesize == 0 ||
+			if (maxdumpfilesize == 0 ||
 			     maxdumpfilesize > ULONGLONG_MAX / 1024 ||
-			     ( maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE ) ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			     (maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE)) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument is not a valid file size\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			maxdumpfilesize *= 1024;
@@ -671,11 +671,11 @@
 			sc_preerasepr = BOOL_TRUE;
 			break;
 		case GETOPT_ALERTPROG:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					"-%c argument missing\n"),
-				    c );
-				usage( );
+				    c);
+				usage();
 				return BOOL_FALSE;
 			}
 			media_change_alert_program = optarg;
@@ -687,32 +687,32 @@
 			sc_dumpasoffline = BOOL_TRUE;
 			break;
 		case GETOPT_BASED:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			baseuuidstr = optarg;
 
-			if ( uuid_parse( baseuuidstr, baseuuid ) < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (uuid_parse(baseuuidstr, baseuuid) < 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument not a valid "
 				      "dump session id\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			baseuuidvalpr = BOOL_TRUE;
 		}
 	}
 
-	if ( resumereqpr && baseuuidvalpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (resumereqpr && baseuuidvalpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "may not specify both -%c and -%c\n"),
 		      GETOPT_BASED,
-		      GETOPT_RESUME );
+		      GETOPT_RESUME);
 		return BOOL_FALSE;
 	}
 
@@ -720,44 +720,44 @@
 	 * dash ('-') with no option letter. This must appear between
 	 * all lettered arguments and the source file system pathname.
 	 */
-	if ( optind < argc && ! strcmp( argv[ optind ], "-" )) {
+	if (optind < argc && ! strcmp(argv[optind ], "-")) {
 		optind++;
 	}
 
 	/* the last argument must be either the mount point or a
 	 * device pathname of the file system to be dumped.
 	 */
-	if ( optind >= argc ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (optind >= argc) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "source file system "
-		      "not specified\n") );
-		usage( );
+		      "not specified\n"));
+		usage();
 		return BOOL_FALSE;
 	}
-	srcname = argv[ optind ];
+	srcname = argv[optind];
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* allocate space for the subtree pointer array and load it
 	 */
-	if ( subtreecnt ) {
-		subtreep = ( char ** )calloc( subtreecnt, sizeof( char * ));
-		assert( subtreep );
+	if (subtreecnt) {
+		subtreep = (char **)calloc(subtreecnt, sizeof(char *));
+		assert(subtreep);
 		optind = 1;
 		opterr = 0;
 		subtreeix = 0;
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-			switch ( c ) {
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+			switch (c) {
 			case GETOPT_SUBTREE:
-				assert( subtreeix < subtreecnt );
-				assert( optarg && optarg[ 0 ] != '-' );
-				subtreep[ subtreeix++ ] = optarg;
+				assert(subtreeix < subtreecnt);
+				assert(optarg && optarg[0] != '-');
+				subtreep[subtreeix++] = optarg;
 				break;
 			}
 		}
-		assert( subtreeix == subtreecnt );
+		assert(subtreeix == subtreecnt);
 	} else {
 		subtreep = 0;
 	}
@@ -769,20 +769,20 @@
 	 * system ID (uuid). returns BOOL_FALSE if the last
 	 * argument doesn't look like a file system.
 	 */
-	if ( ! fs_info( fstype,
-			sizeof( fstype ),
+	if (! fs_info(fstype,
+			sizeof(fstype),
 			FS_DEFAULT,
 			fsdevice,
-			sizeof( fsdevice ),
+			sizeof(fsdevice),
 			mntpnt,
-			sizeof( mntpnt ),
+			sizeof(mntpnt),
 			&fsid,
-			srcname )) {
+			srcname)) {
 
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "%s does not identify a file system\n"),
-		      srcname );
-		usage( );
+		      srcname);
+		usage();
 		return BOOL_FALSE;
 	}
 
@@ -790,49 +790,49 @@
 	 * to mount an unmounted file system on a temporary mount point,
 	 * if it is not currently mounted.
 	 */
-	if ( ! fs_mounted( fstype, fsdevice, mntpnt, &fsid )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (! fs_mounted(fstype, fsdevice, mntpnt, &fsid)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "%s must be mounted to be dumped\n"),
-		      srcname );
+		      srcname);
 		return BOOL_FALSE;
 	}
 
 	/* place the fs info in the write hdr template
 	 */
-	( void )strncpyterm( cwhdrtemplatep->ch_mntpnt,
+	(void)strncpyterm(cwhdrtemplatep->ch_mntpnt,
 			     mntpnt,
-			     sizeof( cwhdrtemplatep->ch_mntpnt ));
-	( void )strncpyterm( cwhdrtemplatep->ch_fsdevice,
+			     sizeof(cwhdrtemplatep->ch_mntpnt));
+	(void)strncpyterm(cwhdrtemplatep->ch_fsdevice,
 			     fsdevice,
-			     sizeof( cwhdrtemplatep->ch_fsdevice ));
-	( void )strncpyterm( cwhdrtemplatep->ch_fstype,
+			     sizeof(cwhdrtemplatep->ch_fsdevice));
+	(void)strncpyterm(cwhdrtemplatep->ch_fstype,
 			     fstype,
-			     sizeof( cwhdrtemplatep->ch_fstype ));
-	uuid_copy( cwhdrtemplatep->ch_fsid, fsid );
+			     sizeof(cwhdrtemplatep->ch_fstype));
+	uuid_copy(cwhdrtemplatep->ch_fsid, fsid);
 
 	/* write quota information */
-	if( sc_savequotas ) {
+	if(sc_savequotas) {
 
 		sc_savequotas = BOOL_FALSE;
 		for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
 			quotas[i].savequotas = BOOL_FALSE;
-			qstat = getxfsqstat( fsdevice );
-			if (qstat > 0 && (qstat & quotas[i].statflag) ) {
-				sprintf( quotas[i].quotapath, "%s/%s", mntpnt, quotas[i].quotafile );
-				if( save_quotas( mntpnt, &quotas[i] )) {
-					if( subtreecnt ) {
+			qstat = getxfsqstat(fsdevice);
+			if (qstat > 0 && (qstat & quotas[i].statflag)) {
+				sprintf(quotas[i].quotapath, "%s/%s", mntpnt, quotas[i].quotafile);
+				if(save_quotas(mntpnt, &quotas[i])) {
+					if(subtreecnt) {
 						subtreecnt++;
-						subtreep = (char **) realloc( subtreep,
+						subtreep = (char **) realloc(subtreep,
 								subtreecnt * sizeof(char *));
-						assert( subtreep );
-						subtreep[ subtreecnt - 1 ] = quotas[i].quotafile;
+						assert(subtreep);
+						subtreep[subtreecnt - 1] = quotas[i].quotafile;
 					}
 					sc_savequotas = BOOL_TRUE;
 					quotas[i].savequotas = BOOL_TRUE;
 				} else {
-					mlog( MLOG_NORMAL | MLOG_ERROR, _(
+					mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					      "failed to save %s information, continuing\n"),
-					      quotas[i].desc );
+					      quotas[i].desc);
 				}
 			}
 		}
@@ -841,7 +841,7 @@
 
 	/* create my /var directory if it doesn't already exist.
 	 */
-	var_create( );
+	var_create();
 
 	/* get two session descriptors from the inventory: one for the last
 	 * dump at this level, and one for the last dump at a lower level.
@@ -851,23 +851,23 @@
 	 * will give us a change date for all other inos.
 	 */
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* briefly open the online dump inventory, so it can be used
 	 * to calculate incremental and resumed dumps.
 	 */
-	inv_idbt = inv_open( ( inv_predicate_t )INV_BY_UUID,
+	inv_idbt = inv_open((inv_predicate_t)INV_BY_UUID,
 			     INV_SEARCH_ONLY,
-			     ( void * )&fsid );
+			     (void *)&fsid);
 
 	/* if a based request, look for the indicated session.
 	 * if found, and not interrupted, this will be used as an
 	 * incremental base. if interrupted, will be used as
 	 * resume base.
 	 */
-	if ( baseuuidvalpr ) {
+	if (baseuuidvalpr) {
 		ix_t strix;
 		ix_t strcnt;
 		inv_stream_t *bsp;
@@ -880,53 +880,53 @@
 		interruptedpr = BOOL_FALSE;
 
 		ok = inv_get_session_byuuid(&fsid, &baseuuid, &sessp);
-		if ( ! ok ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (! ok) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not find specified base dump (%s) "
 			      "in inventory\n"),
-			      baseuuidstr );
+			      baseuuidstr);
 			return BOOL_FALSE;
 		}
-		strcnt =  ( ix_t )sessp->s_nstreams;
-		for ( strix = 0 ; strix < strcnt ; strix++ ) {
-			bsp = &sessp->s_streams[ strix ];
-			if ( bsp->st_interrupted ) {
+		strcnt =  (ix_t)sessp->s_nstreams;
+		for (strix = 0 ; strix < strcnt ; strix++) {
+			bsp = &sessp->s_streams[strix];
+			if (bsp->st_interrupted) {
 				interruptedpr = BOOL_TRUE;
 				break;
 			}
 		}
 
-		if ( interruptedpr ) {
-			sc_level = ( ix_t )sessp->s_level;
+		if (interruptedpr) {
+			sc_level = (ix_t)sessp->s_level;
 			resumereqpr = BOOL_TRUE;
 			samefoundpr = BOOL_TRUE;
 			sametime = sessp->s_time;
 			uuid_copy (sameid, sessp->s_sesid);
 			samepartialpr = sessp->s_ispartial;
 			sameinterruptedpr = BOOL_TRUE;
-			sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
-			sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
-								sizeof( drange_t ));
-			assert( sc_resumerangep );
-			for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
+			sc_resumerangecnt =  (size_t)sessp->s_nstreams;
+			sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
+								sizeof(drange_t));
+			assert(sc_resumerangep);
+			for (strmix = 0 ; strmix < sc_resumerangecnt ; strmix++) {
 				inv_stream_t *bsp;
 				inv_stream_t *esp;
-				drange_t *p = &sc_resumerangep[ strmix ];
-				bsp = &sessp->s_streams[ strmix ];
-				esp = ( strmix < sc_resumerangecnt - 1 )
+				drange_t *p = &sc_resumerangep[strmix];
+				bsp = &sessp->s_streams[strmix];
+				esp = (strmix < sc_resumerangecnt - 1)
 				      ?
 				      bsp + 1
 				      :
 				      0;
-				if ( bsp->st_interrupted ) {
+				if (bsp->st_interrupted) {
 					sameinterruptedpr = BOOL_TRUE;
 					p->dr_begin.sp_ino = bsp->st_endino;
 					p->dr_begin.sp_offset = bsp->st_endino_off;
-					if ( esp ) {
+					if (esp) {
 						p->dr_end.sp_ino = esp->st_startino;
 						p->dr_end.sp_offset =
 								esp->st_startino_off;
-						mlog( MLOG_DEBUG,
+						mlog(MLOG_DEBUG,
 						      "resume range stream %u "
 						      "ino %llu:%lld to "
 						      "%llu:%lld\n",
@@ -934,16 +934,16 @@
 						      p->dr_begin.sp_ino,
 						      p->dr_begin.sp_offset,
 						      p->dr_end.sp_ino,
-						      p->dr_end.sp_offset );
+						      p->dr_end.sp_offset);
 					} else {
 						p->dr_end.sp_flags = STARTPT_FLAGS_END;
-						mlog( MLOG_DEBUG,
+						mlog(MLOG_DEBUG,
 						      "resume range stream %u "
 						      "ino %llu:%lld to "
 						      "end\n",
 						      strmix,
 						      p->dr_begin.sp_ino,
-						      p->dr_begin.sp_offset );
+						      p->dr_begin.sp_offset);
 					}
 				} else {
 					/* set the range start pt's END flag to
@@ -953,27 +953,27 @@
 				}
 			}
 		} else {
-			if ( sessp->s_level >= LEVEL_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (sessp->s_level >= LEVEL_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot select dump session %d as base "
 				      "for incremental dump: "
 				      "level must be less than %d\n"),
 				      sessp->s_level,
-				      LEVEL_MAX );
+				      LEVEL_MAX);
 				return BOOL_FALSE;
 			}
-			sc_level = ( ix_t )sessp->s_level + 1;
+			sc_level = (ix_t)sessp->s_level + 1;
 			undertime = sessp->s_time;
-			underlevel = ( ix_t )sessp->s_level;
+			underlevel = (ix_t)sessp->s_level;
 			uuid_copy (underid, sessp->s_sesid);
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
 			underfoundpr = BOOL_TRUE;
 		}
-		inv_free_session( &sessp );
+		inv_free_session(&sessp);
 		sessp = 0;
-		ok = inv_close( inv_idbt );
-		assert( ok );
+		ok = inv_close(inv_idbt);
+		assert(ok);
 		inv_idbt = INV_TOKEN_NULL;
 		goto baseuuidbypass;
 	}
@@ -983,41 +983,41 @@
 	 * and interrupted.
 	 */
 	underfoundpr = BOOL_FALSE;
-	if ( sc_level > 0 ) {
-		if ( inv_idbt == INV_TOKEN_NULL ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (sc_level > 0) {
+		if (inv_idbt == INV_TOKEN_NULL) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "cannot calculate incremental dump: "
-			      "online inventory not available\n") );
+			      "online inventory not available\n"));
 			return BOOL_FALSE;
 		}
 		ok = inv_lastsession_level_lessthan(&fsid,
 						    inv_idbt,
 						    (u_char_t)sc_level,
 						    &sessp);
-		if ( ! ok ) {
+		if (! ok) {
 			sessp = 0;
 		}
 
-		if ( sessp ) {
+		if (sessp) {
 			ix_t strix;
 			ix_t strcnt;
 			inv_stream_t *bsp;
 
 			undertime = sessp->s_time;
-			underlevel = ( ix_t )sessp->s_level;
+			underlevel = (ix_t)sessp->s_level;
 			uuid_copy (underid, sessp->s_sesid);
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
-			strcnt =  ( ix_t )sessp->s_nstreams;
-			for ( strix = 0 ; strix < strcnt ; strix++ ) {
-				bsp = &sessp->s_streams[ strix ];
-				if ( bsp->st_interrupted ) {
+			strcnt =  (ix_t)sessp->s_nstreams;
+			for (strix = 0 ; strix < strcnt ; strix++) {
+				bsp = &sessp->s_streams[strix];
+				if (bsp->st_interrupted) {
 					underinterruptedpr = BOOL_TRUE;
 					break;
 				}
 			}
 			underfoundpr = BOOL_TRUE;
-			inv_free_session( & sessp );
+			inv_free_session(& sessp);
 			sessp = 0;
 		}
 	}
@@ -1027,16 +1027,16 @@
 	 * and interrupted, and for each stream the range of ino/offset
 	 * values not dumped.
 	 */
-	if ( inv_idbt != INV_TOKEN_NULL ) {
+	if (inv_idbt != INV_TOKEN_NULL) {
 		/* REFERENCED */
 		bool_t ok1;
 		ok = inv_lastsession_level_equalto(&fsid,
 						   inv_idbt,
 						   (u_char_t)sc_level,
 						   &sessp);
-		ok1 = inv_close( inv_idbt );
-		assert( ok1 );
-		if ( ! ok ) {
+		ok1 = inv_close(inv_idbt);
+		assert(ok1);
+		if (! ok) {
 			sessp = 0;
 		}
 		inv_idbt = INV_TOKEN_NULL;
@@ -1045,34 +1045,34 @@
 	}
 
 	samefoundpr = BOOL_FALSE;
-	if ( sessp ) {
+	if (sessp) {
 		sametime = sessp->s_time;
 		uuid_copy(sameid, sessp->s_sesid);
 		samepartialpr = sessp->s_ispartial;
 		sameinterruptedpr = BOOL_FALSE;
-		sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
-		sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
-						        sizeof( drange_t ));
-		assert( sc_resumerangep );
-		for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
+		sc_resumerangecnt =  (size_t)sessp->s_nstreams;
+		sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
+						        sizeof(drange_t));
+		assert(sc_resumerangep);
+		for (strmix = 0 ; strmix < sc_resumerangecnt ; strmix++) {
 			inv_stream_t *bsp;
 			inv_stream_t *esp;
-			drange_t *p = &sc_resumerangep[ strmix ];
-			bsp = &sessp->s_streams[ strmix ];
-			esp = ( strmix < sc_resumerangecnt - 1 )
+			drange_t *p = &sc_resumerangep[strmix];
+			bsp = &sessp->s_streams[strmix];
+			esp = (strmix < sc_resumerangecnt - 1)
 			      ?
 			      bsp + 1
 			      :
 			      0;
-			if ( bsp->st_interrupted ) {
+			if (bsp->st_interrupted) {
 				sameinterruptedpr = BOOL_TRUE;
 				p->dr_begin.sp_ino = bsp->st_endino;
 				p->dr_begin.sp_offset = bsp->st_endino_off;
-				if ( esp ) {
+				if (esp) {
 					p->dr_end.sp_ino = esp->st_startino;
 					p->dr_end.sp_offset =
 							esp->st_startino_off;
-					mlog( MLOG_DEBUG,
+					mlog(MLOG_DEBUG,
 					      "resume range stream %u "
 					      "ino %llu:%lld to "
 					      "%llu:%lld\n",
@@ -1080,16 +1080,16 @@
 					      p->dr_begin.sp_ino,
 					      p->dr_begin.sp_offset,
 					      p->dr_end.sp_ino,
-					      p->dr_end.sp_offset );
+					      p->dr_end.sp_offset);
 				} else {
 					p->dr_end.sp_flags = STARTPT_FLAGS_END;
-					mlog( MLOG_DEBUG,
+					mlog(MLOG_DEBUG,
 					      "resume range stream %u "
 					      "ino %llu:%lld to "
 					      "end\n",
 					      strmix,
 					      p->dr_begin.sp_ino,
-					      p->dr_begin.sp_offset );
+					      p->dr_begin.sp_offset);
 				}
 			} else {
 				/* set the range start pt's END flag to
@@ -1098,7 +1098,7 @@
 				p->dr_begin.sp_flags = STARTPT_FLAGS_END;
 			}
 		}
-		inv_free_session( & sessp );
+		inv_free_session(& sessp);
 		sessp = 0;
 		samefoundpr = BOOL_TRUE;
 	}
@@ -1107,166 +1107,166 @@
 
 	/* now determine the incremental and resume bases, if any.
 	 */
-	if ( samefoundpr && ! sameinterruptedpr ) {
-		free( ( void * )sc_resumerangep );
+	if (samefoundpr && ! sameinterruptedpr) {
+		free((void *)sc_resumerangep);
 		sc_resumerangep = 0;
 		samefoundpr = BOOL_FALSE;
 	}
-	if ( samefoundpr && ! resumereqpr ) {
-		if ( ! underfoundpr || undertime <= sametime ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+	if (samefoundpr && ! resumereqpr) {
+		if (! underfoundpr || undertime <= sametime) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "most recent level %d dump "
 			      "was interrupted, "
 			      "but not resuming that dump since "
 			      "resume (-R) option not specified\n"),
-			      sc_level );
+			      sc_level);
 		}
-		free( ( void * )sc_resumerangep );
+		free((void *)sc_resumerangep);
 		sc_resumerangep = 0;
 		samefoundpr = BOOL_FALSE;
 	}
-	if ( underfoundpr ) {
-		assert( underlevel <= LEVEL_MAX );
-		assert( undertime );
-		if ( samefoundpr ) {
-			if ( undertime >= sametime ) {
-				if ( underinterruptedpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (underfoundpr) {
+		assert(underlevel <= LEVEL_MAX);
+		assert(undertime);
+		if (samefoundpr) {
+			if (undertime >= sametime) {
+				if (underinterruptedpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "most recent base for "
 					      "incremental dump was "
 					      "interrupted (level %u): "
 					      "must resume or redump "
 					      "at or below level %d\n"),
 					      underlevel,
-					      sc_level );
+					      sc_level);
 					return BOOL_FALSE;
 				}
-				if ( subtreecnt && ! underpartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (subtreecnt && ! underpartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "subtree dump "
 					      "will be based on non-subtree "
 					      "level %u dump\n"),
 					      sc_level,
-					      underlevel );
+					      underlevel);
 				}
-				if ( ! subtreecnt && underpartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (! subtreecnt && underpartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "non-subtree dump "
 					      "will be based on subtree "
 					      "level %u dump\n"),
 					      sc_level,
-					      underlevel );
+					      underlevel);
 				}
 				sc_incrpr = BOOL_TRUE;
 				sc_incrbasetime = undertime;
 				sc_incrbaselevel = underlevel;
 				uuid_copy(sc_incrbaseid, underid);
 				sc_resumepr = BOOL_FALSE;
-				assert( sc_resumerangep );
-				free( ( void * )sc_resumerangep );
+				assert(sc_resumerangep);
+				free((void *)sc_resumerangep);
 				sc_resumerangep = 0;
 			} else {
-				if ( subtreecnt && ! samepartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (subtreecnt && ! samepartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "subtree dump "
 					      "will be based on non-subtree "
 					      "level %u resumed dump\n"),
 					      sc_level,
-					      sc_level );
+					      sc_level);
 				}
-				if ( ! subtreecnt && samepartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (! subtreecnt && samepartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "non-subtree dump "
 					      "will be based on subtree "
 					      "level %u resumed dump\n"),
 					      sc_level,
-					      sc_level );
+					      sc_level);
 				}
-				assert( sametime );
+				assert(sametime);
 				sc_incrpr = BOOL_TRUE;
 				sc_incrbasetime = undertime;
 				sc_incrbaselevel = underlevel;
 				sc_resumepr = BOOL_TRUE;
 				sc_resumebasetime = sametime;
 				uuid_copy(sc_resumebaseid, sameid);
-				assert( sc_resumerangep );
+				assert(sc_resumerangep);
 			}
 		} else {
-			if ( underinterruptedpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (underinterruptedpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "most recent base for "
 				      "incremental dump was "
 				      "interrupted (level %u): "
 				      "must resume or redump "
 				      "at or below level %d\n"),
 				      underlevel,
-				      sc_level );
+				      sc_level);
 				return BOOL_FALSE;
 			}
-			if ( subtreecnt && ! underpartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (subtreecnt && ! underpartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u incremental "
 				      "subtree dump "
 				      "will be based on non-subtree "
 				      "level %u dump\n"),
 				      sc_level,
-				      underlevel );
+				      underlevel);
 			}
-			if ( ! subtreecnt && underpartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (! subtreecnt && underpartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u incremental "
 				      "non-subtree dump "
 				      "will be based on subtree "
 				      "level %u dump\n"),
 				      sc_level,
-				      underlevel );
+				      underlevel);
 			}
 			sc_incrpr = BOOL_TRUE;
 			sc_incrbasetime = undertime;
 			sc_incrbaselevel = underlevel;
 			uuid_copy(sc_incrbaseid, underid);
 			sc_resumepr = BOOL_FALSE;
-			assert( ! sc_resumerangep );
+			assert(! sc_resumerangep);
 		}
 	} else {
-		if ( samefoundpr ) {
-			assert( sametime );
-			if ( subtreecnt && ! samepartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if (samefoundpr) {
+			assert(sametime);
+			if (subtreecnt && ! samepartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u "
 				      "subtree dump "
 				      "will be based on non-subtree "
 				      "level %u resumed dump\n"),
 				      sc_level,
-				      sc_level );
+				      sc_level);
 			}
-			if ( ! subtreecnt && samepartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (! subtreecnt && samepartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u "
 				      "non-subtree dump "
 				      "will be based on subtree "
 				      "level %u resumed dump\n"),
 				      sc_level,
-				      sc_level );
+				      sc_level);
 			}
 			sc_incrpr = BOOL_FALSE;
 			sc_resumepr = BOOL_TRUE;
 			sc_resumebasetime = sametime;
 			uuid_copy(sc_resumebaseid, sameid);
-			assert( sc_resumerangep );
+			assert(sc_resumerangep);
 		} else {
 			sc_incrpr = BOOL_FALSE;
 			sc_resumepr = BOOL_FALSE;
-			assert( ! sc_resumerangep );
-			if ( sc_level > 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			assert(! sc_resumerangep);
+			if (sc_level > 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot find earlier dump "
 				      "to base level %d increment upon\n"),
-				      sc_level );
+				      sc_level);
 				return BOOL_FALSE;
 			}
 		}
@@ -1274,38 +1274,38 @@
 
 	/* don't allow interrupted dumps of a lesser level to be bases
 	 */
-	if ( sc_incrpr && underinterruptedpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (sc_incrpr && underinterruptedpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "most recent base dump (level %d begun %s) "
 		      "was interrupted: aborting\n"),
 		      sc_incrbaselevel,
-		      ctimennl( &sc_incrbasetime ));
+		      ctimennl(&sc_incrbasetime));
 		return BOOL_FALSE;
 	}
 
 	/* reject if resume (-R) specified, but base was not interrupted
 	 */
-	if ( ! sc_resumepr && resumereqpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (! sc_resumepr && resumereqpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "resume (-R) option inappropriate: "
 		      "no interrupted level %d dump to resume\n"),
-		      sc_level );
+		      sc_level);
 		return BOOL_FALSE;
 	}
 
 	/* announce the dump characteristics
 	 */
-	if ( sc_incrpr ) {
-		if ( sc_resumepr ) {
-			char restimestr[ 30 ];
-			char incrtimestr[ 30 ];
+	if (sc_incrpr) {
+		if (sc_resumepr) {
+			char restimestr[30];
+			char incrtimestr[30];
 
-			strcpy( restimestr, ctimennl( &sc_resumebasetime ));
-			assert( strlen( restimestr ) < sizeof( restimestr ));
-			strcpy( incrtimestr, ctimennl( &sc_incrbasetime ));
-			assert( strlen( incrtimestr ) < sizeof( incrtimestr ));
+			strcpy(restimestr, ctimennl(&sc_resumebasetime));
+			assert(strlen(restimestr) < sizeof(restimestr));
+			strcpy(incrtimestr, ctimennl(&sc_incrbasetime));
+			assert(strlen(incrtimestr) < sizeof(incrtimestr));
 
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "resuming level %d incremental dump of %s:%s "
 			      "begun %s "
 			      "(incremental base level %d begun %s)\n"),
@@ -1314,70 +1314,70 @@
 			      mntpnt,
 			      restimestr,
 			      sc_incrbaselevel,
-			      incrtimestr );
+			      incrtimestr);
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "level %d incremental dump of %s:%s "
 			      "based on level %d dump begun %s\n"),
 			      sc_level,
 			      gwhdrtemplatep->gh_hostname,
 			      mntpnt,
 			      sc_incrbaselevel,
-			      ctimennl( &sc_incrbasetime ));
+			      ctimennl(&sc_incrbasetime));
 		}
 	} else {
-		if ( sc_resumepr ) {
-			mlog( MLOG_VERBOSE, _(
+		if (sc_resumepr) {
+			mlog(MLOG_VERBOSE, _(
 			      "resuming level %d dump of %s:%s begun %s\n"),
 			      sc_level,
 			      gwhdrtemplatep->gh_hostname,
 			      mntpnt,
-			      ctimennl( &sc_resumebasetime ));
+			      ctimennl(&sc_resumebasetime));
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "level %d dump of %s:%s\n"),
 			      sc_level,
 			      gwhdrtemplatep->gh_hostname,
-			      mntpnt );
+			      mntpnt);
 		}
 	}
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* announce the dump time
 	 */
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "dump date: %s\n"),
-	      ctimennl( &gwhdrtemplatep->gh_timestamp ));
+	      ctimennl(&gwhdrtemplatep->gh_timestamp));
 
 	/* display the session UUID
 	 */
 	{
 		char string_uuid[UUID_STR_LEN + 1];
-		uuid_unparse( gwhdrtemplatep->gh_dumpid, string_uuid );
-		mlog( MLOG_VERBOSE, _(
+		uuid_unparse(gwhdrtemplatep->gh_dumpid, string_uuid);
+		mlog(MLOG_VERBOSE, _(
 		      "session id: %s\n"),
-		      string_uuid );
+		      string_uuid);
 	}
 
 	/* display the session label
 	 */
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "session label: \"%s\"\n"),
-	      gwhdrtemplatep->gh_dumplabel );
+	      gwhdrtemplatep->gh_dumplabel);
 
 	/* get a file descriptor for the file system. any file
 	 * contained in the file system will do; use the mntpnt.
 	 * needed by bigstat.
 	 */
-	sc_fsfd = open( mntpnt, O_RDONLY );
-	if ( sc_fsfd < 0 ) {
-		mlog( MLOG_NORMAL, _(
+	sc_fsfd = open(mntpnt, O_RDONLY);
+	if (sc_fsfd < 0) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to open %s: %s\n"),
 		      mntpnt,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -1393,16 +1393,16 @@
 		xfs_fsop_bulkreq_t bulkreq;
 
 		/* Get the inode of the mount point */
-		rval = fstat64( sc_fsfd, &rootstat );
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _(
+		rval = fstat64(sc_fsfd, &rootstat);
+		if (rval) {
+			mlog(MLOG_NORMAL, _(
 			      "could not stat %s\n"),
-			      mntpnt );
+			      mntpnt);
 			return BOOL_FALSE;
 		}
 		sc_rootxfsstatp =
-			( xfs_bstat_t * )calloc( 1, sizeof( xfs_bstat_t ));
-		assert( sc_rootxfsstatp );
+			(xfs_bstat_t *)calloc(1, sizeof(xfs_bstat_t));
+		assert(sc_rootxfsstatp);
 
 		/* Get the first valid (i.e. root) inode in this fs */
 		bulkreq.lastip = (__u64 *)&lastino;
@@ -1410,13 +1410,13 @@
 		bulkreq.ubuffer = sc_rootxfsstatp;
 		bulkreq.ocount = &ocount;
 		if (ioctl(sc_fsfd, XFS_IOC_FSBULKSTAT, &bulkreq) < 0) {
-			mlog( MLOG_ERROR,
+			mlog(MLOG_ERROR,
 			      _("failed to get bulkstat information for root inode\n"));
 			return BOOL_FALSE;
 		}
 
 		if (sc_rootxfsstatp->bs_ino != rootstat.st_ino)
-			mlog ( MLOG_NORMAL | MLOG_NOTE,
+			mlog (MLOG_NORMAL | MLOG_NOTE,
 			       _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
 			         sc_rootxfsstatp->bs_ino, rootstat.st_ino);
 	}
@@ -1424,16 +1424,16 @@
 	/* alloc a file system handle, to be used with the jdm_open()
 	 * functions.
 	 */
-	sc_fshandlep = jdm_getfshandle( mntpnt );
-	if ( ! sc_fshandlep ) {
-		mlog( MLOG_NORMAL, _(
+	sc_fshandlep = jdm_getfshandle(mntpnt);
+	if (! sc_fshandlep) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to construct a file system handle for %s: %s\n"),
 		      mntpnt,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
@@ -1454,11 +1454,11 @@
 	 * until the startpoints are copied into each streams header. will
 	 * be freed at the end of this function.
 	 */
-	sc_stat_inomapcnt = ( size64_t )fs_getinocnt( mntpnt );
+	sc_stat_inomapcnt = (size64_t)fs_getinocnt(mntpnt);
 
-	sc_startptp = ( startpt_t * )calloc( drivecnt, sizeof( startpt_t ));
-	assert( sc_startptp );
-	ok = inomap_build( sc_fshandlep,
+	sc_startptp = (startpt_t *)calloc(drivecnt, sizeof(startpt_t));
+	assert(sc_startptp);
+	ok = inomap_build(sc_fshandlep,
 			   sc_fsfd,
 			   sc_rootxfsstatp,
 			   sc_incrpr,
@@ -1475,58 +1475,58 @@
 			   &sc_stat_inomapphase,
 			   &sc_stat_inomappass,
 			   sc_stat_inomapcnt,
-			   &sc_stat_inomapdone );
-	free( ( void * )subtreep );
+			   &sc_stat_inomapdone);
+	free((void *)subtreep);
 	subtreep = 0;
-	if ( ! ok ) {
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
 	/* ask var to ask inomap to skip files under var if var is in
 	 * the fs being dumped
 	 */
-	var_skip( &fsid, inomap_skip );
+	var_skip(&fsid, inomap_skip);
 
 	/* fill in write header template content info. always produce
 	 * an inomap for each media file. the dirdump flag will be set
 	 * in content_stream_dump() for streams which dump the directories.
 	 */
-	assert( sizeof( cwhdrtemplatep->ch_specific ) >= sizeof( *scwhdrtemplatep ));
+	assert(sizeof(cwhdrtemplatep->ch_specific) >= sizeof(*scwhdrtemplatep));
 	scwhdrtemplatep->cih_mediafiletype = CIH_MEDIAFILETYPE_DATA;
-	scwhdrtemplatep->cih_level = ( int32_t )sc_level;
+	scwhdrtemplatep->cih_level = (int32_t)sc_level;
 	scwhdrtemplatep->cih_dumpattr = CIH_DUMPATTR_INOMAP;
-	if ( subtreecnt ) {
+	if (subtreecnt) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_SUBTREE;
 	}
-	if ( sc_inv_updatepr ) {
+	if (sc_inv_updatepr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_INVENTORY;
 	}
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_FILEHDR_CHECKSUM;
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_EXTENTHDR_CHECKSUM;
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_DIRENTHDR_CHECKSUM;
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_DIRENTHDR_GEN;
-	if ( sc_incrpr ) {
+	if (sc_incrpr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_INCREMENTAL;
 		scwhdrtemplatep->cih_last_time = sc_incrbasetime;
 		uuid_copy(scwhdrtemplatep->cih_last_id, sc_incrbaseid);
-		if ( skip_unchanged_dirs ) {
+		if (skip_unchanged_dirs) {
 			scwhdrtemplatep->cih_dumpattr |=
 				CIH_DUMPATTR_NOTSELFCONTAINED;
 		}
 	}
-	if ( sc_resumepr ) {
+	if (sc_resumepr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_RESUME;
 		scwhdrtemplatep->cih_resume_time = sc_resumebasetime;
 		uuid_copy(scwhdrtemplatep->cih_resume_id, sc_resumebaseid);
 	}
-	if ( sc_dumpextattrpr ) {
+	if (sc_dumpextattrpr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_EXTATTR;
 		scwhdrtemplatep->cih_dumpattr |=
 					CIH_DUMPATTR_EXTATTRHDR_CHECKSUM;
 	}
 
 	scwhdrtemplatep->cih_rootino = sc_rootxfsstatp->bs_ino;
-	inomap_writehdr( scwhdrtemplatep );
+	inomap_writehdr(scwhdrtemplatep);
 
 	/* log the dump size. just a rough approx.
 	 */
@@ -1534,9 +1534,9 @@
 	nondircnt = scwhdrtemplatep->cih_inomap_nondircnt;
 	datasz = scwhdrtemplatep->cih_inomap_datasz;
 	inocnt = dircnt + nondircnt;
-	inomapsz = inomap_getsz( );
-	direntsz = inocnt * ( uint64_t )( DIRENTHDR_SZ + 8 );
-	filesz = inocnt * ( uint64_t )( FILEHDR_SZ + EXTENTHDR_SZ );
+	inomapsz = inomap_getsz();
+	direntsz = inocnt * (uint64_t)(DIRENTHDR_SZ + 8);
+	filesz = inocnt * (uint64_t)(FILEHDR_SZ + EXTENTHDR_SZ);
 
 	hdr_mfilesz =	GLOBAL_HDR_SZ
 			+
@@ -1548,27 +1548,27 @@
 			filesz
 			+
 			datasz;
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "estimated dump size: %llu bytes\n"),
-	      size_estimate );
+	      size_estimate);
 
 	if (drivecnt > 1) {
-	    mlog( MLOG_VERBOSE, _(
+	    mlog(MLOG_VERBOSE, _(
 		  "estimated dump size per stream: %llu bytes\n"),
 		    hdr_mfilesz + (filesz + datasz) / drivecnt);
 	}
-	mlog( MLOG_DEBUG,
+	mlog(MLOG_DEBUG,
 	      "estimated dump header size: %llu bytes\n",
-	      hdr_mfilesz );
-	mlog( MLOG_DEBUG,
+	      hdr_mfilesz);
+	mlog(MLOG_DEBUG,
 	      "estimated component sizes: global hdr: %llu bytes, "
 	      "inomap: %llu bytes,  dir entries: %llu bytes, "
 	      "file hdrs: %llu bytes, datasz: %llu bytes\n",
 	      GLOBAL_HDR_SZ, inomapsz, direntsz,
-	      filesz, datasz );
+	      filesz, datasz);
 
 	/* extract the progress stat denominators from the write hdr
-	 * template. placed there by inomap_writehdr( )
+	 * template. placed there by inomap_writehdr()
 	 */
 	sc_stat_dircnt = scwhdrtemplatep->cih_inomap_dircnt;
 	sc_stat_nondircnt = scwhdrtemplatep->cih_inomap_nondircnt;
@@ -1576,55 +1576,55 @@
 
 	/* allocate and populate per-stream context descriptors
 	 */
-	sc_contextp = ( context_t * )calloc( drivecnt, sizeof( context_t ));
-	assert( sc_contextp );
-	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-		context_t *contextp = &sc_contextp[ strmix ];
+	sc_contextp = (context_t *)calloc(drivecnt, sizeof(context_t));
+	assert(sc_contextp);
+	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		context_t *contextp = &sc_contextp[strmix];
 
 		contextp->cc_filehdrp =
-				( filehdr_t * )calloc( 1, sizeof( filehdr_t ));
-		assert( contextp->cc_filehdrp );
+				(filehdr_t *)calloc(1, sizeof(filehdr_t));
+		assert(contextp->cc_filehdrp);
 
 		contextp->cc_extenthdrp =
-			    ( extenthdr_t * )calloc( 1, sizeof( extenthdr_t ));
-		assert( contextp->cc_extenthdrp );
+			    (extenthdr_t *)calloc(1, sizeof(extenthdr_t));
+		assert(contextp->cc_extenthdrp);
 
-		contextp->cc_getdentsbufsz = sizeof( struct dirent )
+		contextp->cc_getdentsbufsz = sizeof(struct dirent)
 					       +
 					       NAME_MAX + 1;
-		if ( contextp->cc_getdentsbufsz < GETDENTSBUF_SZ_MIN ) {
+		if (contextp->cc_getdentsbufsz < GETDENTSBUF_SZ_MIN) {
 			contextp->cc_getdentsbufsz = GETDENTSBUF_SZ_MIN;
 		}
 		contextp->cc_getdentsbufp =
-			   ( char * ) calloc( 1, contextp->cc_getdentsbufsz );
-		assert( contextp->cc_getdentsbufp );
+			   (char *) calloc(1, contextp->cc_getdentsbufsz);
+		assert(contextp->cc_getdentsbufp);
 
-		contextp->cc_mdirentbufsz = sizeof( direnthdr_t  )
+		contextp->cc_mdirentbufsz = sizeof(direnthdr_t)
 					    +
 					    NAME_MAX + 1
 					    +
 					    DIRENTHDR_ALIGN;
 		contextp->cc_mdirentbufp =
-			   ( char * ) calloc( 1, contextp->cc_mdirentbufsz );
-		assert( contextp->cc_mdirentbufp );
+			   (char *) calloc(1, contextp->cc_mdirentbufsz);
+		assert(contextp->cc_mdirentbufp);
 
 		contextp->cc_extattrlistbufsz = EXTATTR_LISTBUF_SZ;
 		contextp->cc_extattrrtrvarraylen = EXTATTR_RTRVARRAY_LEN;
 		contextp->cc_extattrdumpbufsz = 2 * ATTR_MAX_VALUELEN;
-		if ( contextp->cc_extattrdumpbufsz < EXTATTR_DUMPBUF_SZ ) {
+		if (contextp->cc_extattrdumpbufsz < EXTATTR_DUMPBUF_SZ) {
 			contextp->cc_extattrdumpbufsz = EXTATTR_DUMPBUF_SZ;
 		}
 		contextp->cc_extattrlistbufp =
-			   ( char * )calloc( 1, contextp->cc_extattrlistbufsz );
-		assert( contextp->cc_extattrlistbufp );
+			   (char *)calloc(1, contextp->cc_extattrlistbufsz);
+		assert(contextp->cc_extattrlistbufp);
 		contextp->cc_extattrrtrvarrayp =
-		  ( attr_multiop_t * )calloc( contextp->cc_extattrrtrvarraylen,
-				    sizeof( attr_multiop_t ));
-		assert( contextp->cc_extattrrtrvarrayp );
+		  (attr_multiop_t *)calloc(contextp->cc_extattrrtrvarraylen,
+				    sizeof(attr_multiop_t));
+		assert(contextp->cc_extattrrtrvarrayp);
 		contextp->cc_extattrdumpbufp =
-			   ( char * )memalign( sizeof( extattrhdr_t ),
-					       contextp->cc_extattrdumpbufsz );
-		assert( contextp->cc_extattrdumpbufp );
+			   (char *)memalign(sizeof(extattrhdr_t),
+					       contextp->cc_extattrdumpbufsz);
+		assert(contextp->cc_extattrdumpbufp);
 		if (hsm_fs_ctxtp) {
 			contextp->cc_hsm_f_ctxtp = HsmAllocateFileContext(
 				hsm_fs_ctxtp);
@@ -1634,10 +1634,10 @@
 
 		contextp->cc_readlinkbufsz = MAXPATHLEN + SYMLINK_ALIGN;
 		contextp->cc_readlinkbufp =
-			   ( char * ) calloc( 1, contextp->cc_readlinkbufsz );
-		assert( contextp->cc_readlinkbufp );
+			   (char *) calloc(1, contextp->cc_readlinkbufsz);
+		assert(contextp->cc_readlinkbufp);
 
-		contextp->cc_inomap_contextp = inomap_alloc_context( );
+		contextp->cc_inomap_contextp = inomap_alloc_context();
 	}
 
 	/* look for command line media labels. these will be assigned
@@ -1652,22 +1652,22 @@
 
 		optind = 1;
 		opterr = 0;
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-			switch ( c ) {
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+			switch (c) {
 			case GETOPT_MEDIALABEL:
-				if ( cp >= ep ) {
-					mlog( MLOG_NORMAL, _(
+				if (cp >= ep) {
+					mlog(MLOG_NORMAL, _(
 					      "more -%c arguments "
 					      "than number of drives\n"),
-					      c );
-					usage( );
+					      c);
+					usage();
 					return BOOL_FALSE;
 				}
-				if ( ! optarg || optarg[ 0 ] == '-' ) {
-					mlog( MLOG_NORMAL, _(
+				if (! optarg || optarg[0] == '-') {
+					mlog(MLOG_NORMAL, _(
 					      "-%c argument missing\n"),
-					      c );
-					usage( );
+					      c);
+					usage();
 					return BOOL_FALSE;
 				}
 				cp->cc_Media_firstlabel = optarg;
@@ -1676,39 +1676,39 @@
 			}
 		}
 
-		if ( cp > sc_contextp && cp < ep ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if (cp > sc_contextp && cp < ep) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "media labels given for only %d out of %d "
 			      "drives\n"),
 			      cp - sc_contextp,
-			      drivecnt );
+			      drivecnt);
 		}
 	}
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* open the dump inventory and a dump inventory write session
 	 * if an inventory update is to be done.
 	 */
-	if ( sc_inv_updatepr ) {
+	if (sc_inv_updatepr) {
 		bool_t result;
 		sigset_t tty_set, orig_set;
 
 		/* hold tty signals while creating a new inventory session */
-		sigemptyset( &tty_set );
-		sigaddset( &tty_set, SIGINT );
-		sigaddset( &tty_set, SIGQUIT );
-		sigaddset( &tty_set, SIGHUP );
-		pthread_sigmask( SIG_BLOCK, &tty_set, &orig_set );
+		sigemptyset(&tty_set);
+		sigaddset(&tty_set, SIGINT);
+		sigaddset(&tty_set, SIGQUIT);
+		sigaddset(&tty_set, SIGHUP);
+		pthread_sigmask(SIG_BLOCK, &tty_set, &orig_set);
 
-		result = create_inv_session( gwhdrtemplatep, &fsid, mntpnt,
-					     fsdevice, subtreecnt, strmix );
+		result = create_inv_session(gwhdrtemplatep, &fsid, mntpnt,
+					     fsdevice, subtreecnt, strmix);
 
-		pthread_sigmask( SIG_SETMASK, &orig_set, NULL );
+		pthread_sigmask(SIG_SETMASK, &orig_set, NULL);
 
-		if ( !result ) {
+		if (!result) {
 			return BOOL_FALSE;
 		}
 	}
@@ -1717,11 +1717,11 @@
 	 */
 	{
 		ix_t ix;
-		ix_t endix = sizeof( sc_mcflag )
+		ix_t endix = sizeof(sc_mcflag)
 			     /
-			     sizeof( sc_mcflag[ 0 ] );
-		for ( ix = 0 ; ix < endix ; ix++ ) {
-			sc_mcflag[ ix ] = BOOL_FALSE;
+			     sizeof(sc_mcflag[0]);
+		for (ix = 0 ; ix < endix ; ix++) {
+			sc_mcflag[ix] = BOOL_FALSE;
 		}
 	}
 	content_media_change_needed = BOOL_FALSE;
@@ -1730,8 +1730,8 @@
 	 */
 	{
 		ix_t driveix;
-		for ( driveix = 0 ; driveix < STREAM_SIMMAX ; driveix++ ) {
-			sc_stat_pds[ driveix ].pds_phase = PDS_NULL;
+		for (driveix = 0 ; driveix < STREAM_SIMMAX ; driveix++) {
+			sc_stat_pds[driveix].pds_phase = PDS_NULL;
 		}
 	}
 
@@ -1741,10 +1741,10 @@
 #define STATLINESZ	160
 
 size_t
-content_statline( char **linespp[ ] )
+content_statline(char **linespp[])
 {
-	static char statlinebuf[ STREAM_SIMMAX + 1 ][ STATLINESZ ];
-	static char *statline[ STREAM_SIMMAX + 1 ];
+	static char statlinebuf[STREAM_SIMMAX + 1][STATLINESZ];
+	static char *statline[STREAM_SIMMAX + 1];
 	size_t statlinecnt;
 	size64_t nondirdone;
 	size64_t datadone;
@@ -1756,32 +1756,32 @@
 
 	/* build and supply the line array
 	 */
-	for ( i = 0 ; i < STREAM_SIMMAX + 1 ; i++ ) {
-		statline[ i ] = &statlinebuf[ i ][ 0 ];
+	for (i = 0 ; i < STREAM_SIMMAX + 1 ; i++) {
+		statline[i] = &statlinebuf[i][0];
 	}
 	*linespp = statline;
 	statlinecnt = 0;
 
 	/* if start time not initialized, return no strings
 	 */
-	if ( ! sc_stat_starttime ) {
+	if (! sc_stat_starttime) {
 		return 0;
 	}
 
 	/* calculate the elapsed time
 	 */
-	now = time( 0 );
+	now = time(0);
 	elapsed = now - sc_stat_starttime;
 
 	/* get local time
 	 */
-	tmp = localtime( &now );
+	tmp = localtime(&now);
 
 	/* if inomap phase indicated, report on that
 	 */
-	if ( sc_stat_inomapphase && sc_stat_inomapcnt ) {
-		if ( sc_stat_inomappass ) {
-			sprintf( statline[ 0 ],
+	if (sc_stat_inomapphase && sc_stat_inomapcnt) {
+		if (sc_stat_inomappass) {
+			sprintf(statline[0],
 				 "status at %02d:%02d:%02d: "
 				 "inomap phase %u pass %u "
 				 "%llu/%llu inos scanned, "
@@ -1793,10 +1793,10 @@
 				 (unsigned int)sc_stat_inomappass,
 				 (unsigned long long)sc_stat_inomapdone,
 				 (unsigned long long)sc_stat_inomapcnt,
-				 elapsed );
-			assert( strlen( statline[ 0 ] ) < STATLINESZ );
+				 elapsed);
+			assert(strlen(statline[0]) < STATLINESZ);
 		} else {
-			sprintf( statline[ 0 ],
+			sprintf(statline[0],
 				 "status at %02d:%02d:%02d: "
 				 "inomap phase %u "
 				 "%llu/%llu inos scanned, "
@@ -1807,38 +1807,38 @@
 				 (unsigned int)sc_stat_inomapphase,
 				 (unsigned long long)sc_stat_inomapdone,
 				 (unsigned long long)sc_stat_inomapcnt,
-				 elapsed );
-			assert( strlen( statline[ 0 ] ) < STATLINESZ );
+				 elapsed);
+			assert(strlen(statline[0]) < STATLINESZ);
 		}
 		return 1;
 	}
 
 	/* get the accumulated totals for non-dir inos and data bytes dumped
 	 */
-	lock( );
+	lock();
 	nondirdone = sc_stat_nondirdone;
 	datadone = sc_stat_datadone;
-	unlock( );
+	unlock();
 
 	/* non-dir dump phase */
-	if ( nondirdone || datadone ) {
+	if (nondirdone || datadone) {
 		/* calculate percentage of data dumped
 		*/
-		if ( sc_stat_datasz ) {
-			percent = ( double )datadone
+		if (sc_stat_datasz) {
+			percent = (double)datadone
 				/
-				( double )sc_stat_datasz;
+				(double)sc_stat_datasz;
 			percent *= 100.0;
 		} else {
 			percent = 100.0;
 		}
-		if ( percent > 100.0 ) {
+		if (percent > 100.0) {
 			percent = 100.0;
 		}
 
 		/* format the status line in a local static buffer (non-re-entrant!)
 		*/
-		sprintf( statline[ 0 ],
+		sprintf(statline[0],
 				"status at %02d:%02d:%02d: %llu/%llu files dumped, "
 				"%.1lf%%%% data dumped, "
 				"%ld seconds elapsed\n",
@@ -1848,66 +1848,66 @@
 				(unsigned long long) nondirdone,
 				(unsigned long long) sc_stat_nondircnt,
 				percent,
-				elapsed );
+				elapsed);
 	} else {
-		sprintf( statline[ 0 ],
+		sprintf(statline[0],
 				"status at %02d:%02d:%02d: "
 				"%ld seconds elapsed\n",
 				tmp->tm_hour,
 				tmp->tm_min,
 				tmp->tm_sec,
-				elapsed );
+				elapsed);
 	}
 
-	assert( strlen( statline[ 0 ] ) < STATLINESZ );
+	assert(strlen(statline[0]) < STATLINESZ);
 
 	/* optionally create stat lines for each drive
 	 */
 	statlinecnt = 1;
-	for ( i = 0 ; i < drivecnt ; i++ ) {
-		pds_t *pdsp = &sc_stat_pds[ i ];
-		if ( pdsp->pds_phase == PDS_NULL
+	for (i = 0 ; i < drivecnt ; i++) {
+		pds_t *pdsp = &sc_stat_pds[i];
+		if (pdsp->pds_phase == PDS_NULL
 		     ||
-		     pdsp->pds_phase == PDS_NONDIR ) {
+		     pdsp->pds_phase == PDS_NONDIR) {
 			continue;
 		}
-		statline[ statlinecnt ][ 0 ] = 0;
-		if ( drivecnt > 1 ) {
-			sprintf( statline[ statlinecnt ],
+		statline[statlinecnt][0] = 0;
+		if (drivecnt > 1) {
+			sprintf(statline[statlinecnt],
 				 "drive %u: ",
-				 (unsigned int)i );
+				 (unsigned int)i);
 		}
-		switch( pdsp->pds_phase ) {
+		switch(pdsp->pds_phase) {
 		case PDS_INOMAP:
-			strcat( statline[ statlinecnt ],
-				"dumping inomap" );
+			strcat(statline[statlinecnt],
+				"dumping inomap");
 			break;
 		case PDS_DIRDUMP:
-			sprintf( &statline[ statlinecnt ]
-					  [ strlen( statline[ statlinecnt ] ) ],
+			sprintf(&statline[statlinecnt]
+					  [strlen(statline[statlinecnt])],
 				 "%llu/%llu directories dumped",
 				 (unsigned long long)pdsp->pds_dirdone,
-				 (unsigned long long)sc_stat_dircnt );
+				 (unsigned long long)sc_stat_dircnt);
 			break;
 		case PDS_INVSYNC:
-			strcat( statline[ statlinecnt ],
-				"waiting to dump inventory" );
+			strcat(statline[statlinecnt],
+				"waiting to dump inventory");
 			break;
 		case PDS_INVDUMP:
-			strcat( statline[ statlinecnt ],
-				"dumping inventory" );
+			strcat(statline[statlinecnt],
+				"dumping inventory");
 			break;
 		case PDS_TERMDUMP:
-			strcat( statline[ statlinecnt ],
-				"dumping stream terminator" );
+			strcat(statline[statlinecnt],
+				"dumping stream terminator");
 			break;
 		default:
 			break;
 		}
-		sprintf( &statline[ statlinecnt ]
-				  [ strlen( statline[ statlinecnt ] ) ],
-			 "\n" );
-		assert( strlen( statline[ statlinecnt ] ) < STATLINESZ );
+		sprintf(&statline[statlinecnt]
+				  [strlen(statline[statlinecnt])],
+			 "\n");
+		assert(strlen(statline[statlinecnt]) < STATLINESZ);
 		statlinecnt++;
 	}
 
@@ -1928,61 +1928,61 @@
 	char *qfsdevice;
 
 	/* create a cleanup handler to close the inventory on exit. */
-	rval = atexit( inv_cleanup );
-	assert( ! rval );
+	rval = atexit(inv_cleanup);
+	assert(! rval);
 
-	sc_inv_idbtoken = inv_open( ( inv_predicate_t )INV_BY_UUID,
+	sc_inv_idbtoken = inv_open((inv_predicate_t)INV_BY_UUID,
 					INV_SEARCH_N_MOD,
-					( void * )fsidp );
-	if ( sc_inv_idbtoken == INV_TOKEN_NULL ) {
+					(void *)fsidp);
+	if (sc_inv_idbtoken == INV_TOKEN_NULL) {
 		return BOOL_FALSE;
 	}
-	qmntpnt = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
-					+ 1 + strlen( mntpnt ) + 1 );
-	assert( qmntpnt );
-	assert( strlen( gwhdrtemplatep->gh_hostname ));
-	sprintf( qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt );
-	qfsdevice = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
-					 + 1 + strlen( fsdevice ) + 1 );
-	assert( qfsdevice );
-	sprintf( qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice );
+	qmntpnt = (char *)calloc(1, strlen(gwhdrtemplatep->gh_hostname)
+					+ 1 + strlen(mntpnt) + 1);
+	assert(qmntpnt);
+	assert(strlen(gwhdrtemplatep->gh_hostname));
+	sprintf(qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt);
+	qfsdevice = (char *)calloc(1, strlen(gwhdrtemplatep->gh_hostname)
+					 + 1 + strlen(fsdevice) + 1);
+	assert(qfsdevice);
+	sprintf(qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice);
 
-	sc_inv_sestoken = inv_writesession_open( sc_inv_idbtoken,
+	sc_inv_sestoken = inv_writesession_open(sc_inv_idbtoken,
 						fsidp,
 						&gwhdrtemplatep->gh_dumpid,
 						gwhdrtemplatep->gh_dumplabel,
 						subtreecnt ? BOOL_TRUE
 							   : BOOL_FALSE,
 						sc_resumepr,
-						( u_char_t )sc_level,
+						(u_char_t)sc_level,
 						drivecnt,
 						gwhdrtemplatep->gh_timestamp,
 						qmntpnt,
-						qfsdevice );
-	if ( sc_inv_sestoken == INV_TOKEN_NULL ) {
+						qfsdevice);
+	if (sc_inv_sestoken == INV_TOKEN_NULL) {
 		return BOOL_FALSE;
 	}
 
 	/* open an inventory stream for each stream
 	*/
-	sc_inv_stmtokenp = ( inv_stmtoken_t * )
-				calloc( drivecnt, sizeof( inv_stmtoken_t ));
-	assert( sc_inv_stmtokenp );
-	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-		drive_t *drivep = drivepp[ strmix ];
+	sc_inv_stmtokenp = (inv_stmtoken_t *)
+				calloc(drivecnt, sizeof(inv_stmtoken_t));
+	assert(sc_inv_stmtokenp);
+	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		drive_t *drivep = drivepp[strmix];
 		char *drvpath;
 
-		if ( strcmp( drivep->d_pathname, "stdio" )) {
-			drvpath = path_reltoabs( drivep->d_pathname, homedir );
+		if (strcmp(drivep->d_pathname, "stdio")) {
+			drvpath = path_reltoabs(drivep->d_pathname, homedir);
 		} else {
 			drvpath = drivep->d_pathname;
 		}
-		sc_inv_stmtokenp[ strmix ] = inv_stream_open( sc_inv_sestoken,
-								drvpath );
-		if ( strcmp( drivep->d_pathname, "stdio" )) {
-			free( ( void * )drvpath );
+		sc_inv_stmtokenp[strmix] = inv_stream_open(sc_inv_sestoken,
+								drvpath);
+		if (strcmp(drivep->d_pathname, "stdio")) {
+			free((void *)drvpath);
 		}
-		if ( sc_inv_stmtokenp[ strmix ] == INV_TOKEN_NULL ) {
+		if (sc_inv_stmtokenp[strmix] == INV_TOKEN_NULL) {
 			return BOOL_FALSE;
 		}
 	}
@@ -1991,55 +1991,55 @@
 }
 
 static void
-mark_set( drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags )
+mark_set(drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags)
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	mark_t *markp = ( mark_t * )calloc( 1, sizeof( mark_t ));
-	assert( markp );
+	mark_t *markp = (mark_t *)calloc(1, sizeof(mark_t));
+	assert(markp);
 
-	if ( flags & STARTPT_FLAGS_NULL ) {
-		mlog( MLOG_DEBUG,
-		      "setting media NULL mark\n" );
-	} else if ( flags & STARTPT_FLAGS_END ) {
-		mlog( MLOG_DEBUG,
-		      "setting media END mark\n" );
+	if (flags & STARTPT_FLAGS_NULL) {
+		mlog(MLOG_DEBUG,
+		      "setting media NULL mark\n");
+	} else if (flags & STARTPT_FLAGS_END) {
+		mlog(MLOG_DEBUG,
+		      "setting media END mark\n");
 	} else {
-		mlog( MLOG_DEBUG,
+		mlog(MLOG_DEBUG,
 		      "setting media mark"
 		      " for ino %llu offset %lld\n",
 		      ino,
-		      offset );
+		      offset);
 	}
 
 	markp->startpt.sp_ino = ino;
 	markp->startpt.sp_offset = offset;
 	markp->startpt.sp_flags = flags;
-	( * dop->do_set_mark )( drivep,
+	(* dop->do_set_mark)(drivep,
 				mark_callback,
-				( void * )drivep->d_index,
-				( drive_markrec_t * )markp );
+				(void *)drivep->d_index,
+				(drive_markrec_t *)markp);
 }
 
 static void
-mark_callback( void *p, drive_markrec_t *dmp, bool_t committed )
+mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 {
 	/* get context
 	 */
-	ix_t strmix = ( ix_t )p;
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	ix_t strmix = (ix_t)p;
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
-	content_hdr_t *cwhdrp = ( content_hdr_t * )mwhdrp->mh_upper;
-	content_inode_hdr_t *scwhdrp = ( content_inode_hdr_t * )
-				       ( void * )
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
+	content_hdr_t *cwhdrp = (content_hdr_t *)mwhdrp->mh_upper;
+	content_inode_hdr_t *scwhdrp = (content_inode_hdr_t *)
+				       (void *)
 				       cwhdrp->ch_specific;
 
 	/* this is really a mark_t, allocated by mark_set()
 	 */
-	mark_t *markp = ( mark_t * )dmp;
+	mark_t *markp = (mark_t *)dmp;
 
-	if ( committed ) {
+	if (committed) {
 		/* bump the per-mfile mark committed count
 		 */
 		contextp->cc_markscommitted++;
@@ -2051,18 +2051,18 @@
 
 		/* log the mark commit
 		 */
-		if ( markp->startpt.sp_flags & STARTPT_FLAGS_NULL ) {
-			mlog( MLOG_DEBUG,
+		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
+			mlog(MLOG_DEBUG,
 			      "media NULL mark committed"
 			      " in media file %d\n",
-			      mwhdrp->mh_dumpfileix );
+			      mwhdrp->mh_dumpfileix);
 			scwhdrp->cih_startpt.sp_flags |= STARTPT_FLAGS_NULL;
-		} else if ( markp->startpt.sp_flags & STARTPT_FLAGS_END ) {
-			mlog( MLOG_DEBUG,
+		} else if (markp->startpt.sp_flags & STARTPT_FLAGS_END) {
+			mlog(MLOG_DEBUG,
 			      "media END mark committed"
 			      " in media file %d\n",
-			      mwhdrp->mh_dumpfileix );
-			if ( scwhdrp->cih_endpt.sp_flags & STARTPT_FLAGS_END ) {
+			      mwhdrp->mh_dumpfileix);
+			if (scwhdrp->cih_endpt.sp_flags & STARTPT_FLAGS_END) {
 				scwhdrp->cih_startpt.sp_ino++;
 				scwhdrp->cih_startpt.sp_offset = 0;
 			} else {
@@ -2070,49 +2070,49 @@
 			}
 			scwhdrp->cih_startpt.sp_flags |= STARTPT_FLAGS_END;
 		} else {
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "media mark committed"
 			      " for ino %llu offset %lld"
 			      " in media file %d\n",
 			      markp->startpt.sp_ino,
 			      markp->startpt.sp_offset,
-			      mwhdrp->mh_dumpfileix );
+			      mwhdrp->mh_dumpfileix);
 			scwhdrp->cih_startpt = markp->startpt;
 		}
 	} else {
 		/* note the mark was not committed
 		 */
-		if ( markp->startpt.sp_flags & STARTPT_FLAGS_NULL ) {
-			mlog( MLOG_DEBUG,
-			      "media NULL mark -NOT- committed\n" );
-		} else if ( markp->startpt.sp_flags & STARTPT_FLAGS_END ) {
-			mlog( MLOG_DEBUG,
-			      "media END mark -NOT- committed\n" );
+		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
+			mlog(MLOG_DEBUG,
+			      "media NULL mark -NOT- committed\n");
+		} else if (markp->startpt.sp_flags & STARTPT_FLAGS_END) {
+			mlog(MLOG_DEBUG,
+			      "media END mark -NOT- committed\n");
 		} else {
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "media mark -NOT- committed"
 			      " for ino %llu offset %lld\n",
 			      markp->startpt.sp_ino,
-			      markp->startpt.sp_offset );
+			      markp->startpt.sp_offset);
 		}
 	}
 
 	/* get rid of this mark (it was allocated by mark_set())
 	 */
-	free( ( void * )markp );
+	free((void *)markp);
 }
 
 /* begin - called by stream process to invoke the dump stream
  */
 int
-content_stream_dump( ix_t strmix )
+content_stream_dump(ix_t strmix)
 {
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
-	content_hdr_t *cwhdrp = ( content_hdr_t * )mwhdrp->mh_upper;
-	content_inode_hdr_t *scwhdrp = ( content_inode_hdr_t * )
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
+	content_hdr_t *cwhdrp = (content_hdr_t *)mwhdrp->mh_upper;
+	content_inode_hdr_t *scwhdrp = (content_inode_hdr_t *)
 				       cwhdrp->ch_specific;
 	void *inomap_contextp;
 	bool_t all_nondirs_committed;
@@ -2126,46 +2126,46 @@
 
 	/* sanity checks
 	 */
-	assert( RV_OK == 0 ); /* bigstat_iter depends on this */
+	assert(RV_OK == 0); /* bigstat_iter depends on this */
 
 	/* allocate a buffer for use by bstat_iter
 	 */
-	bstatbufp = ( xfs_bstat_t * )calloc( bstatbuflen,
-					     sizeof( xfs_bstat_t ));
-	assert( bstatbufp );
+	bstatbufp = (xfs_bstat_t *)calloc(bstatbuflen,
+					     sizeof(xfs_bstat_t));
+	assert(bstatbufp);
 
 	/* allocate an inomap context */
 	inomap_contextp = inomap_alloc_context();
-	assert( inomap_contextp );
+	assert(inomap_contextp);
 
 	/* determine if stream terminators will be used and are expected.
 	 * this will be revised each time a new media file is begun.
 	 */
-	update_cc_Media_useterminatorpr( drivep, contextp );
+	update_cc_Media_useterminatorpr(drivep, contextp);
 
 	/* check in
 	 */
-	lock( );
+	lock();
 	sc_thrdsarrivedcnt++;
-	unlock( );
+	unlock();
 
 	/* fill in write hdr stream start and end points
 	 */
-	scwhdrp->cih_startpt = sc_startptp[ strmix ];
-	if ( strmix < drivecnt - 1 ) {
-		scwhdrp->cih_endpt = sc_startptp[ strmix + 1 ];
+	scwhdrp->cih_startpt = sc_startptp[strmix];
+	if (strmix < drivecnt - 1) {
+		scwhdrp->cih_endpt = sc_startptp[strmix + 1];
 	} else {
 		scwhdrp->cih_endpt.sp_flags = STARTPT_FLAGS_END;
 	}
 
 	// the first stream dumps the directories
-	if ( strmix == 0 ) {
+	if (strmix == 0) {
 		scwhdrp->cih_dumpattr |= CIH_DUMPATTR_DIRDUMP;
 	}
 
 	/* fill in inomap fields of write hdr
 	 */
-	inomap_writehdr( scwhdrp );
+	inomap_writehdr(scwhdrp);
 
 	/* used to decide if any non-dirs not yet on media
 	 */
@@ -2183,8 +2183,8 @@
 
 	/* get the inventory stream token
 	 */
-	if ( sc_inv_stmtokenp ) {
-		inv_stmt = sc_inv_stmtokenp[ strmix ];
+	if (sc_inv_stmtokenp) {
+		inv_stmt = sc_inv_stmtokenp[strmix];
 	} else {
 		inv_stmt = INV_TOKEN_NULL;
 	}
@@ -2195,7 +2195,7 @@
 	 * The current startpoint will be updated each time a media mark
 	 * is committed.
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		xfs_ino_t startino;
 		bool_t stop_requested;
 		bool_t hit_eom;
@@ -2248,48 +2248,48 @@
 		 * and begin a new media file. This will dump the media
 		 * file header if successful.
 		 */
-		rv = Media_mfile_begin( drivep, contextp, BOOL_TRUE );
-		if ( rv == RV_INTR ) {
+		rv = Media_mfile_begin(drivep, contextp, BOOL_TRUE);
+		if (rv == RV_INTR) {
 			return mlog_exit(EXIT_INTERRUPT, rv);
 		}
-		if ( rv == RV_TIMEOUT ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		if (rv == RV_TIMEOUT) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change timeout will be treated as "
 			      "a request to stop using drive: "
-			      "can resume later\n") );
+			      "can resume later\n"));
 			mlog_exit_hint(RV_QUIT);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_QUIT ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		if (rv == RV_QUIT) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change decline will be treated as "
 			      "a request to stop using drive: "
-			      "can resume later\n") );
+			      "can resume later\n"));
 			mlog_exit_hint(RV_QUIT);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_DRIVE ) {
+		if (rv == RV_DRIVE) {
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_ERROR ) {
+		if (rv == RV_ERROR) {
 			return mlog_exit(EXIT_ERROR, rv);
 		}
-		if ( rv == RV_CORE ) {
+		if (rv == RV_CORE) {
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		assert( rv == RV_OK );
-		if ( rv != RV_OK ) {
+		assert(rv == RV_OK);
+		if (rv != RV_OK) {
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
 		/* sync up here with other streams if reasonable
 		 */
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "creating dump session media file %u "
 		      "(media %u, file %u)\n"),
 		      mwhdrp->mh_dumpfileix,
 		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix );
+		      mwhdrp->mh_mediafileix);
 
 		/* initialize the count of marks committed in the media file.
 		 * will be bumped by mark_callback().
@@ -2298,33 +2298,33 @@
 
 		/* first dump the inomap
 		 */
-		mlog( MLOG_VERBOSE, _(
-		      "dumping ino map\n") );
-		sc_stat_pds[ strmix ].pds_phase = PDS_INOMAP;
-		rv = inomap_dump( drivep );
-		if ( rv == RV_INTR ) {
+		mlog(MLOG_VERBOSE, _(
+		      "dumping ino map\n"));
+		sc_stat_pds[strmix].pds_phase = PDS_INOMAP;
+		rv = inomap_dump(drivep);
+		if (rv == RV_INTR) {
 			stop_requested = BOOL_TRUE;
 			goto decision_more;
 		}
-		if ( rv == RV_EOM ) {
+		if (rv == RV_EOM) {
 			hit_eom = BOOL_TRUE;
 			goto decision_more;
 		}
-		if ( rv == RV_DRIVE ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_DRIVE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_ERROR ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_ERROR) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_ERROR, rv);
 		}
-		if ( rv == RV_CORE ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_CORE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		assert( rv == RV_OK );
-		if ( rv != RV_OK ) {
-			free( ( void * )bstatbufp );
+		assert(rv == RV_OK);
+		if (rv != RV_OK) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
@@ -2332,35 +2332,35 @@
 		 * directories. use the bigstat iterator capability to call
 		 * my dump_dir function for each directory in the bitmap.
 		 */
-		if ( scwhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP ) {
-			sc_stat_pds[ strmix ].pds_dirdone = 0;
-			rv = dump_dirs( strmix,
+		if (scwhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP) {
+			sc_stat_pds[strmix].pds_dirdone = 0;
+			rv = dump_dirs(strmix,
 					bstatbufp,
 					bstatbuflen,
-					inomap_contextp );
-			if ( rv == RV_INTR ) {
+					inomap_contextp);
+			if (rv == RV_INTR) {
 				stop_requested = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_EOM ) {
+			if (rv == RV_EOM) {
 				hit_eom = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_DRIVE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_DRIVE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
 			}
-			if ( rv == RV_ERROR ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_ERROR) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_ERROR, rv);
 			}
-			if ( rv == RV_CORE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_CORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			assert( rv == RV_OK );
-			if ( rv != RV_OK ) {
-				free( ( void * )bstatbufp );
+			assert(rv == RV_OK);
+			if (rv != RV_OK) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
 		}
@@ -2372,55 +2372,55 @@
 		 * non-directory file is fully committed to media,
 		 * the starting point for the next media file will be advanced.
 		 */
-		if ( ! all_nondirs_committed ) {
-			mlog( MLOG_VERBOSE, _(
-			      "dumping non-directory files\n") );
-			sc_stat_pds[ strmix ].pds_phase = PDS_NONDIR;
+		if (! all_nondirs_committed) {
+			mlog(MLOG_VERBOSE, _(
+			      "dumping non-directory files\n"));
+			sc_stat_pds[strmix].pds_phase = PDS_NONDIR;
 			rv = RV_OK;
 			inomap_reset_context(inomap_contextp);
-			rval = bigstat_iter( sc_fshandlep,
+			rval = bigstat_iter(sc_fshandlep,
 					     sc_fsfd,
 					     BIGSTAT_ITER_NONDIR,
 					     scwhdrp->cih_startpt.sp_ino,
-					     ( bstat_cbfp_t )dump_file,
-					     ( void * )strmix,
+					     (bstat_cbfp_t)dump_file,
+					     (void *)strmix,
 					     inomap_next_nondir,
 					     inomap_contextp,
-					     ( int * )&rv,
+					     (int *)&rv,
 					     pipeline ?
 					       (bool_t (*)(int))preemptchk : 0,
 					     bstatbufp,
-					     bstatbuflen );
-			if ( rval ) {
-				free( ( void * )bstatbufp );
+					     bstatbuflen);
+			if (rval) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, RV_CORE);
 			}
-			if ( rv == RV_INTR ) {
+			if (rv == RV_INTR) {
 				stop_requested = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_EOM ) {
+			if (rv == RV_EOM) {
 				hit_eom = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_EOF ) {
+			if (rv == RV_EOF) {
 				goto decision_more;
 			}
-			if ( rv == RV_DRIVE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_DRIVE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
 			}
-			if ( rv == RV_ERROR ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_ERROR) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_ERROR, rv);
 			}
-			if ( rv == RV_CORE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_CORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			assert( rv == RV_OK || rv == RV_NOMORE );
-			if ( rv != RV_OK && rv != RV_NOMORE ) {
-				free( ( void * )bstatbufp );
+			assert(rv == RV_OK || rv == RV_NOMORE);
+			if (rv != RV_OK && rv != RV_NOMORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
 		}
@@ -2435,10 +2435,10 @@
 		 * we attempt to end the write stream.
 		 */
 		all_nondirs_sent = BOOL_TRUE;
-		mark_set( drivep,
+		mark_set(drivep,
 			  INO64MAX,
 			  OFF64MAX,
-			  STARTPT_FLAGS_END );
+			  STARTPT_FLAGS_END);
 
 decision_more:
 		/* write a null file hdr, to let restore recognize
@@ -2447,28 +2447,28 @@
 		 * media file in the stream. don't bother if we hit
 		 * EOM.
 		 */
-		if ( ! hit_eom ) {
-			rv = dump_filehdr( drivep,
+		if (! hit_eom) {
+			rv = dump_filehdr(drivep,
 					   contextp,
 					   0,
 					   0,
 					   all_nondirs_sent
 					   ?
-					   ( FILEHDR_FLAGS_NULL
+					   (FILEHDR_FLAGS_NULL
 					     |
-					     FILEHDR_FLAGS_END )
+					     FILEHDR_FLAGS_END)
 					   :
-					   FILEHDR_FLAGS_NULL );
-			if ( rv == RV_DRIVE ) {
-				free( ( void * )bstatbufp );
+					   FILEHDR_FLAGS_NULL);
+			if (rv == RV_DRIVE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
 			}
-			if ( rv == RV_CORE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_CORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			if ( rv == RV_ERROR ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_ERROR) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_ERROR, rv);
 			}
 
@@ -2476,14 +2476,14 @@
 			 * it. mark callback will adjust start pt before this
 			 * call returns if the null file header made it.
 			 */
-			mark_set( drivep,
+			mark_set(drivep,
 				  INO64MAX,
 				  OFF64MAX,
 				  all_nondirs_sent
 				  ?
 				  STARTPT_FLAGS_NULL | STARTPT_FLAGS_END
 				  :
-				  STARTPT_FLAGS_NULL );
+				  STARTPT_FLAGS_NULL);
 		}
 
 		/* tell the Media abstraction to end the media file.
@@ -2492,38 +2492,38 @@
 		 * will invoke drive end_write, which will flush
 		 * all pending marks.
 		 */
-		mlog( MLOG_VERBOSE, _(
-		      "ending media file\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "ending media file\n"));
 		ncommitted = 0;
-		rv = Media_mfile_end( drivep,
+		rv = Media_mfile_end(drivep,
 				      contextp,
 				      mwhdrp,
 				      &ncommitted,
-				      hit_eom );
-		if ( rv == RV_DRIVE ) {
-			free( ( void * )bstatbufp );
+				      hit_eom);
+		if (rv == RV_DRIVE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_CORE ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_CORE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "media file size %lld bytes\n"),
-		      ncommitted );
+		      ncommitted);
 
 		/* if at least one mark committed, we know all of
 		 * the inomap and dirdump was committed.
 		 */
-		all_dirs_committed = ( contextp->cc_markscommitted > 0 );
+		all_dirs_committed = (contextp->cc_markscommitted > 0);
 
 		/* at this point we can check the new start point
 		 * to determine if all nondirs have been committed.
 		 * if this flag was already set, then this is a
 		 * inomap and dirdump-only media file.
 		 */
-		if ( scwhdrp->cih_startpt.sp_flags & STARTPT_FLAGS_END ) {
-			if ( all_nondirs_committed ) {
+		if (scwhdrp->cih_startpt.sp_flags & STARTPT_FLAGS_END) {
+			if (all_nondirs_committed) {
 				empty_mediafile = BOOL_TRUE;
 			}
 			all_nondirs_committed = BOOL_TRUE;
@@ -2537,51 +2537,51 @@
 
 		/* tell the inventory about the media file
 		 */
-		if ( inv_stmt != INV_TOKEN_NULL ) {
+		if (inv_stmt != INV_TOKEN_NULL) {
 			bool_t ok;
 
-			if ( ! all_dirs_committed ) {
-				mlog( MLOG_DEBUG,
+			if (! all_dirs_committed) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
-				      "partial dirdump media file\n" );
-			} else if ( done && empty_mediafile ) {
-				mlog( MLOG_DEBUG,
+				      "partial dirdump media file\n");
+			} else if (done && empty_mediafile) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "empty last media file: "
 				      "%llu:%lld\n",
 				       startino,
-				       startoffset );
-			} else if ( empty_mediafile ) {
-				mlog( MLOG_DEBUG,
+				       startoffset);
+			} else if (empty_mediafile) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "empty media file: "
 				      "%llu:%lld\n",
 				       startino,
-				       startoffset );
-			} else if ( done ) {
-				mlog( MLOG_DEBUG,
+				       startoffset);
+			} else if (done) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "last media file: "
 				      "%llu:%lld\n",
 				       startino,
-				       startoffset );
+				       startoffset);
 			} else {
-				mlog( MLOG_DEBUG,
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "media file: "
 				      "%llu:%lld - %llu:%lld\n",
 				       startino,
 				       startoffset,
 				       scwhdrp->cih_startpt.sp_ino,
-				       scwhdrp->cih_startpt.sp_offset );
+				       scwhdrp->cih_startpt.sp_offset);
 			}
 
 			/* already thread-safe, don't need to lock
 			 */
-			ok = inv_put_mediafile( inv_stmt,
+			ok = inv_put_mediafile(inv_stmt,
 						&mwhdrp->mh_mediaid,
 						mwhdrp->mh_medialabel,
-					( uint )mwhdrp->mh_mediafileix,
+					(uint)mwhdrp->mh_mediafileix,
 						startino,
 						startoffset,
 						scwhdrp->cih_startpt.sp_ino,
@@ -2590,13 +2590,13 @@
 					        all_dirs_committed
 						&&
 						! empty_mediafile,
-						BOOL_FALSE );
-			if ( ! ok ) {
-				mlog( MLOG_NORMAL, _(
-				      "inventory media file put failed\n") );
+						BOOL_FALSE);
+			if (! ok) {
+				mlog(MLOG_NORMAL, _(
+				      "inventory media file put failed\n"));
 			}
 		}
-		if ( done ) {
+		if (done) {
 			contextp->cc_completepr = BOOL_TRUE;
 			    /* so inv_end_stream and main will know
 			     */
@@ -2604,58 +2604,58 @@
 
 		/* don't go back for more if done or stop was requested
 		 */
-		if ( done || stop_requested ) {
+		if (done || stop_requested) {
 			break;
 		}
 	} /* end main dump loop */
 
 	/* check in
 	 */
-	lock( );
+	lock();
 	sc_thrdsdonecnt++;
-	unlock( );
+	unlock();
 
 	/* dump the session inventory and terminator here, if the drive
 	 * supports multiple media files. must wait until all
 	 * streams have completed or given up, so all media files
 	 * from all streams have been registered.
 	 */
-	if ( drivep->d_capabilities & DRIVE_CAP_FILES ) {
-		if ( stream_cnt( ) > 1 ) {
-			mlog( MLOG_VERBOSE, _(
+	if (drivep->d_capabilities & DRIVE_CAP_FILES) {
+		if (stream_cnt() > 1) {
+			mlog(MLOG_VERBOSE, _(
 			      "waiting for synchronized "
-			      "session inventory dump\n") );
-			sc_stat_pds[ strmix ].pds_phase = PDS_INVSYNC;
+			      "session inventory dump\n"));
+			sc_stat_pds[strmix].pds_phase = PDS_INVSYNC;
 		}
 
 		/* first be sure all threads have begun
 		*/
-		while ( sc_thrdsarrivedcnt < drivecnt ) {
-			sleep( 1 );
+		while (sc_thrdsarrivedcnt < drivecnt) {
+			sleep(1);
 		}
 		/* now wait for survivors to checkin
 		*/
-		while ( sc_thrdsdonecnt < stream_cnt( )) {
-			sleep( 1 );
+		while (sc_thrdsdonecnt < stream_cnt()) {
+			sleep(1);
 		}
 		/* proceeed
 		 */
-		sc_stat_pds[ strmix ].pds_phase = PDS_INVDUMP;
-		if ( dump_session_inv( drivep, contextp, mwhdrp, scwhdrp )) {
-			sc_stat_pds[ strmix ].pds_phase = PDS_TERMDUMP;
-			dump_terminator( drivep, contextp, mwhdrp );
+		sc_stat_pds[strmix].pds_phase = PDS_INVDUMP;
+		if (dump_session_inv(drivep, contextp, mwhdrp, scwhdrp)) {
+			sc_stat_pds[strmix].pds_phase = PDS_TERMDUMP;
+			dump_terminator(drivep, contextp, mwhdrp);
 		}
 	}
 
-	sc_stat_pds[ strmix ].pds_phase = PDS_NULL;
+	sc_stat_pds[strmix].pds_phase = PDS_NULL;
 
-	free( ( void * )bstatbufp );
+	free((void *)bstatbufp);
 
-	elapsed = time( 0 ) - sc_stat_starttime;
+	elapsed = time(0) - sc_stat_starttime;
 
-	mlog( MLOG_TRACE, _(
+	mlog(MLOG_TRACE, _(
 	      "ending stream: %ld seconds elapsed\n"),
-	      elapsed );
+	      elapsed);
 
 	return mlog_exit(EXIT_NORMAL, rv);
 }
@@ -2666,53 +2666,53 @@
  * dump is not complete.
  */
 bool_t
-content_complete( void )
+content_complete(void)
 {
 	time_t elapsed;
 	bool_t completepr;
 	int i;
 
-	completepr = check_complete_flags( );
+	completepr = check_complete_flags();
 
-	elapsed = time( 0 ) - sc_stat_starttime;
+	elapsed = time(0) - sc_stat_starttime;
 
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "dump size (non-dir files) : %llu bytes\n"),
-	      sc_stat_datadone );
+	      sc_stat_datadone);
 
-	if ( completepr ) {
-		if( sc_savequotas ) {
+	if (completepr) {
+		if(sc_savequotas) {
 			for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
-				if( quotas[i].savequotas && unlink( quotas[i].quotapath ) < 0 ) {
-					mlog( MLOG_ERROR, _(
+				if(quotas[i].savequotas && unlink(quotas[i].quotapath) < 0) {
+					mlog(MLOG_ERROR, _(
 					"unable to remove %s: %s\n"),
 					quotas[i].quotapath,
-					strerror ( errno ));
+					strerror (errno));
 				}
 			}
 		}
 
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "dump complete"
 		      ": %ld seconds elapsed"
 		      "\n"),
-		      elapsed );
+		      elapsed);
 	} else {
-		if ( sc_inv_updatepr ) {
-			mlog( MLOG_VERBOSE | MLOG_NOTE, _(
+		if (sc_inv_updatepr) {
+			mlog(MLOG_VERBOSE | MLOG_NOTE, _(
 			      "dump interrupted"
 			      ": %ld seconds elapsed"
 			      ": may resume later using -%c option"
 			      "\n"),
 			      elapsed,
-			      GETOPT_RESUME );
+			      GETOPT_RESUME);
 			mlog_exit_hint(RV_INTR);
 		} else {
-			mlog( MLOG_VERBOSE | MLOG_NOTE, _(
+			mlog(MLOG_VERBOSE | MLOG_NOTE, _(
 			      "dump interrupted"
 			      ": %ld seconds elapsed"
 			      "\n"),
-			      elapsed );
+			      elapsed);
 			mlog_exit_hint(RV_INTR);
 		}
 	}
@@ -2728,15 +2728,15 @@
 #define DLOG_TIMEOUT_MEDIA	3600
 
 #define CHOICESTRSZ	10
-typedef struct { ix_t thrdix; char choicestr[ CHOICESTRSZ ]; } cttm_t;
+typedef struct { ix_t thrdix; char choicestr[CHOICESTRSZ]; } cttm_t;
 
 char *
-content_mediachange_query( void )
+content_mediachange_query(void)
 {
-	cttm_t choicetothrdmap[ STREAM_SIMMAX ];
-	char *querystr[ QUERYMAX ];
+	cttm_t choicetothrdmap[STREAM_SIMMAX];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
 	size_t maxdrvchoiceix;
 	size_t nochangeix;
@@ -2744,25 +2744,25 @@
 	ix_t thrdix;
 
 	querycnt = 0;
-	querystr[ querycnt++ ] = "select a drive to acknowledge media change\n";
+	querystr[querycnt++ ] = "select a drive to acknowledge media change\n";
 	choicecnt = 0;
 	maxdrvchoiceix = 0;
-	for ( thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++ ) {
-		if ( sc_mcflag[ thrdix ] ) {
-			choicetothrdmap[ choicecnt ].thrdix = thrdix;
-			sprintf( choicetothrdmap[ choicecnt ].choicestr,
+	for (thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++) {
+		if (sc_mcflag[thrdix]) {
+			choicetothrdmap[choicecnt].thrdix = thrdix;
+			sprintf(choicetothrdmap[choicecnt].choicestr,
 				 "drive %u",
-				 (unsigned int)thrdix );
-			choicestr[ choicecnt ] =
-					choicetothrdmap[ choicecnt ].choicestr;
+				 (unsigned int)thrdix);
+			choicestr[choicecnt] =
+					choicetothrdmap[choicecnt].choicestr;
 			maxdrvchoiceix = choicecnt;
 			choicecnt++;
 		}
 	}
 	nochangeix = choicecnt;
-	choicestr[ choicecnt++ ] = "continue";
-	assert( choicecnt <= CHOICEMAX );
-	responseix = dlog_multi_query( querystr,
+	choicestr[choicecnt++ ] = "continue";
+	assert(choicecnt <= CHOICEMAX);
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -2775,40 +2775,40 @@
 				       nochangeix, /* sigint ix */
 				       nochangeix, /* sighup ix */
 				       nochangeix);/* sigquit ix */
-	if ( responseix <= maxdrvchoiceix ) {
-		clr_mcflag( choicetothrdmap[ responseix ].thrdix );
+	if (responseix <= maxdrvchoiceix) {
+		clr_mcflag(choicetothrdmap[responseix].thrdix);
 		return "media change acknowledged\n";
 	}
-	assert( responseix == nochangeix );
+	assert(responseix == nochangeix);
 	return "continuing\n";
 }
 
 
 static void
-update_cc_Media_useterminatorpr( drive_t *drivep, context_t *contextp )
+update_cc_Media_useterminatorpr(drive_t *drivep, context_t *contextp)
 {
 	int dcaps = drivep->d_capabilities;
 
 	contextp->cc_Media_useterminatorpr = BOOL_TRUE;
-	if ( ! ( dcaps & DRIVE_CAP_FILES )) {
+	if (! (dcaps & DRIVE_CAP_FILES)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if ( ! ( dcaps & DRIVE_CAP_OVERWRITE )) {
+	if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if ( ! ( dcaps & DRIVE_CAP_BSF )) {
+	if (! (dcaps & DRIVE_CAP_BSF)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if ( ! ( dcaps & DRIVE_CAP_APPEND )) {
+	if (! (dcaps & DRIVE_CAP_APPEND)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
 }
 
 static rv_t
-dump_dirs( ix_t strmix,
+dump_dirs(ix_t strmix,
 	   xfs_bstat_t *bstatbufp,
 	   size_t bstatbuflen,
-	   void *inomap_contextp )
+	   void *inomap_contextp)
 {
 	xfs_ino_t lastino;
 	size_t bulkstatcallcnt;
@@ -2819,30 +2819,30 @@
 	/* begin iteration at ino zero
 	 */
 	lastino = 0;
-	for ( bulkstatcallcnt = 0 ; ; bulkstatcallcnt++ ) {
+	for (bulkstatcallcnt = 0 ; ; bulkstatcallcnt++) {
 		xfs_bstat_t *p;
 		xfs_bstat_t *endp;
 		__s32 buflenout;
 		int rval;
 
-		if ( bulkstatcallcnt == 0 ) {
-			mlog( MLOG_VERBOSE, _(
-			      "dumping directories\n") );
+		if (bulkstatcallcnt == 0) {
+			mlog(MLOG_VERBOSE, _(
+			      "dumping directories\n"));
 		}
-		sc_stat_pds[ strmix ].pds_phase = PDS_DIRDUMP;
+		sc_stat_pds[strmix].pds_phase = PDS_DIRDUMP;
 
 		/* check for interruption
 		 */
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
 		/* get a bunch of bulkstats
 		 */
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "dump_dirs SGI_FS_BULKSTAT %u buf len %u\n",
 		      bulkstatcallcnt,
-		      bstatbuflen );
+		      bstatbuflen);
 
 		bulkreq.lastip = (__u64 *)&lastino;
 		bulkreq.icount = bstatbuflen;
@@ -2851,73 +2851,73 @@
 
 		rval = ioctl(sc_fsfd, XFS_IOC_FSBULKSTAT, &bulkreq);
 
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _(
+		if (rval) {
+			mlog(MLOG_NORMAL, _(
 			      "SGI_FS_BULKSTAT failed: "
 			      "%s (%d)\n"),
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			return RV_ERROR;
 		}
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "dump_dirs SGI_FS_BULKSTAT returns %d entries\n",
-		      buflenout );
+		      buflenout);
 
 		/* check if done
 		 */
-		if ( buflenout == 0 ) {
+		if (buflenout == 0) {
 			return RV_OK;
 		}
 
 		/* step through each node, dumping if
 		 * appropriate
 		 */
-		for ( p = bstatbufp, endp = bstatbufp + buflenout
+		for (p = bstatbufp, endp = bstatbufp + buflenout
 		      ;
 		      p < endp
 		      ;
-		      p++ ) {
+		      p++) {
 			rv_t rv;
 
-			if ( p->bs_ino == 0 )
+			if (p->bs_ino == 0)
 				continue;
 
-			if ( !p->bs_nlink || !p->bs_mode ) {
+			if (!p->bs_nlink || !p->bs_mode) {
 				/* inode being modified, get synced data */
-				mlog( MLOG_NITTY,
+				mlog(MLOG_NITTY,
 				      "ino %llu needs second bulkstat\n",
-				      p->bs_ino );
+				      p->bs_ino);
 
-				if ( bigstat_one( sc_fsfd, p->bs_ino, p ) < 0 ) {
-					mlog( MLOG_WARNING,  _(
+				if (bigstat_one(sc_fsfd, p->bs_ino, p) < 0) {
+					mlog(MLOG_WARNING,  _(
 					      "failed to get bulkstat information for inode %llu\n"),
-					      p->bs_ino );
+					      p->bs_ino);
 					continue;
 				}
-				if ( !p->bs_nlink || !p->bs_mode || !p->bs_ino ) {
-					mlog( MLOG_TRACE,
+				if (!p->bs_nlink || !p->bs_mode || !p->bs_ino) {
+					mlog(MLOG_TRACE,
 					      "failed to get valid bulkstat information for inode %llu\n",
-					      p->bs_ino );
+					      p->bs_ino);
 					continue;
 				}
 			}
-			if ( ( p->bs_mode & S_IFMT ) != S_IFDIR ) {
+			if ((p->bs_mode & S_IFMT) != S_IFDIR) {
 				continue;
 			}
 
-			rv = dump_dir( strmix, sc_fshandlep, sc_fsfd, p );
-			if ( rv != RV_OK ) {
+			rv = dump_dir(strmix, sc_fshandlep, sc_fsfd, p);
+			if (rv != RV_OK) {
 				return rv;
 			}
 		}
 
 		lastino = inomap_next_dir(inomap_contextp, lastino);
 		if (lastino == INO64MAX) {
-			mlog( MLOG_DEBUG, "bulkstat seeked to EOS\n" );
+			mlog(MLOG_DEBUG, "bulkstat seeked to EOS\n");
 			return 0;
 		}
 
-		mlog( MLOG_DEBUG, "bulkstat seeked to %llu\n", lastino );
+		mlog(MLOG_DEBUG, "bulkstat seeked to %llu\n", lastino);
 
 		lastino = (lastino > 0) ? lastino - 1 : 0;
 	}
@@ -2925,17 +2925,17 @@
 }
 
 static rv_t
-dump_dir( ix_t strmix,
+dump_dir(ix_t strmix,
 	  jdm_fshandle_t *fshandlep,
 	  int fsfd,
-	  xfs_bstat_t *statp )
+	  xfs_bstat_t *statp)
 {
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	void *inomap_contextp = contextp->cc_inomap_contextp;
 	int state;
 	int fd;
-	struct dirent *gdp = ( struct dirent *)contextp->cc_getdentsbufp;
+	struct dirent *gdp = (struct dirent *)contextp->cc_getdentsbufp;
 	size_t gdsz = contextp->cc_getdentsbufsz;
 	int gdcnt;
 	gen_t gen;
@@ -2943,104 +2943,104 @@
 
 	/* no way this can be non-dir, but check anyway
 	 */
-	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
-	if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
+	assert((statp->bs_mode & S_IFMT) == S_IFDIR);
+	if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 		return RV_OK;
 	}
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink < 1 ) {
+	if (statp->bs_nlink < 1) {
 		return RV_OK;
 	}
 
 	/* see what the inomap says about this ino
 	 */
-	state = inomap_get_state( inomap_contextp, statp->bs_ino );
+	state = inomap_get_state(inomap_contextp, statp->bs_ino);
 
 	/* skip if not in inomap
 	 */
-	if ( state == MAP_INO_UNUSED
+	if (state == MAP_INO_UNUSED
 	     ||
 	     state == MAP_DIR_NOCHNG
 	     ||
-	     state == MAP_NDR_NOCHNG ) {
-		if ( state == MAP_NDR_NOCHNG ) {
-			mlog( MLOG_DEBUG,
+	     state == MAP_NDR_NOCHNG) {
+		if (state == MAP_NDR_NOCHNG) {
+			mlog(MLOG_DEBUG,
 			      "inomap inconsistency ino %llu: "
 			      "map says is non-dir but is dir: skipping\n",
-			      statp->bs_ino );
+			      statp->bs_ino);
 		}
 		return RV_OK;
 	}
 
 	/* note if map says a non-dir
 	 */
-	if ( state == MAP_NDR_CHANGE ) {
-		mlog( MLOG_DEBUG,
+	if (state == MAP_NDR_CHANGE) {
+		mlog(MLOG_DEBUG,
 		      "inomap inconsistency ino %llu: "
 		      "map says non-dir but is dir: skipping\n",
-		      statp->bs_ino );
+		      statp->bs_ino);
 		return RV_OK;
 	}
 
 	/* bump the stats now. a bit early, but fewer lines of code
 	 */
-	sc_stat_pds[ strmix ].pds_dirdone++;
+	sc_stat_pds[strmix].pds_dirdone++;
 
         /* if bulkstat ino# occupied more than 32 bits and
          * linux ino# for getdents is 32 bits then
          * warn and skip.
          */
-	if ( statp->bs_ino > ( xfs_ino_t )INOMAX ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (statp->bs_ino > (xfs_ino_t)INOMAX) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "unable to dump directory: ino %llu too large\n"),
-		      statp->bs_ino );
+		      statp->bs_ino);
 		return RV_OK; /* continue anyway */
 	}
 
-	mlog( MLOG_TRACE,
+	mlog(MLOG_TRACE,
 	      "dumping directory ino %llu\n",
-	      statp->bs_ino );
+	      statp->bs_ino);
 
 	/* open the directory named by statp
 	 */
-	fd = jdm_open( fshandlep, statp, O_RDONLY );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	fd = jdm_open(fshandlep, statp, O_RDONLY);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "unable to open directory: ino %llu: %s\n"),
-		      statp->bs_ino, strerror( errno ) );
+		      statp->bs_ino, strerror(errno));
 		return RV_OK; /* continue anyway */
 	}
 
 	/* dump the file header.
 	 */
-	rv = dump_filehdr( drivep, contextp, statp, 0, 0 );
-	if ( rv != RV_OK ) {
-		close( fd );
+	rv = dump_filehdr(drivep, contextp, statp, 0, 0);
+	if (rv != RV_OK) {
+		close(fd);
 		return rv;
 	}
 
 	/* dump dirents - lots of buffering done here, to achieve OS-
 	 * independence. if proves to be to much overhead, can streamline.
 	 */
-	for ( gdcnt = 1, rv = RV_OK ; rv == RV_OK ; gdcnt++ ) {
+	for (gdcnt = 1, rv = RV_OK ; rv == RV_OK ; gdcnt++) {
 		struct dirent *p;
 		int nread;
 		register size_t reclen;
 
-		nread = getdents_wrap( fd, (char *)gdp, gdsz );
+		nread = getdents_wrap(fd, (char *)gdp, gdsz);
 
 		/* negative count indicates something very bad happened;
 		 * try to gracefully end this dir.
 		 */
-		if ( nread < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if (nread < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "unable to read dirents (%d) for "
 			      "directory ino %llu: %s\n"),
 			      gdcnt,
 			      statp->bs_ino,
-			      strerror( errno ));
+			      strerror(errno));
 			/* !!! curtis looked at this, and pointed out that
 			 * we could take some recovery action here. if the
 			 * errno is appropriate, lseek64 to the value of
@@ -3052,93 +3052,93 @@
 
 		/* no more directory entries: break;
 		 */
-		if ( nread == 0 ) {
+		if (nread == 0) {
 			break;
 		}
 
 		/* translate and dump each entry: skip "." and ".."
 		 * and null entries.
 		 */
-		for ( p = gdp,
-		      reclen = ( size_t )p->d_reclen
+		for (p = gdp,
+		      reclen = (size_t)p->d_reclen
 		      ;
 		      nread > 0
 		      ;
-		      nread -= ( int )reclen,
-		      assert( nread >= 0 ),
-		      p = ( struct dirent * )( ( char * )p + reclen ),
-		      reclen = ( size_t )p->d_reclen ) {
+		      nread -= (int)reclen,
+		      assert(nread >= 0),
+		      p = (struct dirent *)((char *)p + reclen),
+		      reclen = (size_t)p->d_reclen) {
 			xfs_ino_t ino;
-			register size_t namelen = strlen( p->d_name );
+			register size_t namelen = strlen(p->d_name);
 #ifdef DEBUG
-			register size_t nameszmax = ( size_t )reclen
+			register size_t nameszmax = (size_t)reclen
 						    -
-						    offsetofmember( struct dirent,
-								    d_name );
+						    offsetofmember(struct dirent,
+								    d_name);
 
 			/* getdents(2) guarantees that the string will
 			 * be null-terminated, but the record may have
 			 * padding after the null-termination.
 			 */
-			assert( namelen < nameszmax );
+			assert(namelen < nameszmax);
 #endif
 
 			/* skip "." and ".."
 			 */
-			if ( *( p->d_name + 0 ) == '.'
+			if (*(p->d_name + 0) == '.'
 			     &&
-			     ( *( p->d_name + 1 ) == 0
+			     (*(p->d_name + 1) == 0
 			       ||
-			       ( *( p->d_name + 1 ) == '.'
+			       (*(p->d_name + 1) == '.'
 				 &&
-				 *( p->d_name + 2 ) == 0 ))) {
+				 *(p->d_name + 2) == 0))) {
 				continue;
 			}
 
 			ino = (xfs_ino_t)p->d_ino;
 
-			if ( ino == 0 ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (ino == 0) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "encountered 0 ino (%s) in "
 				      "directory ino %llu: NOT dumping\n"),
 				      p->d_name,
-				      statp->bs_ino );
+				      statp->bs_ino);
 				continue;
 			}
 
 			/* lookup the gen number in the ino-to-gen map.
 			 * if it's not there, we have to get it the slow way.
 			 */
-			if ( inomap_get_gen( NULL, p->d_ino, &gen) ) {
+			if (inomap_get_gen(NULL, p->d_ino, &gen)) {
 				xfs_bstat_t statbuf;
 				int scrval;
 
-				scrval = bigstat_one( fsfd,
+				scrval = bigstat_one(fsfd,
 						      p->d_ino,
-						      &statbuf );
-				if ( scrval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+						      &statbuf);
+				if (scrval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "could not stat "
 					      "dirent %s ino %llu: %s: "
 					      "using null generation count "
 					      "in directory entry\n"),
 					      p->d_name,
-					      ( xfs_ino_t )p->d_ino,
-					      strerror( errno ));
+					      (xfs_ino_t)p->d_ino,
+					      strerror(errno));
 					gen = 0;
 				} else {
 					gen = statbuf.bs_gen;
 				}
 			}
 
-			rv = dump_dirent( drivep,
+			rv = dump_dirent(drivep,
 					  contextp,
 					  statp,
 					  ino,
 					  gen,
 					  p->d_name,
-					  namelen );
-			if ( rv != RV_OK ) {
+					  namelen);
+			if (rv != RV_OK) {
 				break;
 			}
 		}
@@ -3146,19 +3146,19 @@
 
 	/* write a null dirent hdr, unless trouble encountered in the loop
 	 */
-	if ( rv == RV_OK ) {
-		rv = dump_dirent( drivep, contextp, statp, 0, 0, 0, 0 );
+	if (rv == RV_OK) {
+		rv = dump_dirent(drivep, contextp, statp, 0, 0, 0, 0);
 	}
 
-	if ( rv == RV_OK
+	if (rv == RV_OK
 	     &&
 	     sc_dumpextattrpr
 	     &&
-	     ( statp->bs_xflags & XFS_XFLAG_HASATTR )) {
-		rv = dump_extattrs( drivep, contextp, fshandlep, statp);
+	     (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
+		rv = dump_extattrs(drivep, contextp, fshandlep, statp);
 	}
 
-	close( fd );
+	close(fd);
 
 	/* if an error occurred, just return the error
 	 */
@@ -3166,7 +3166,7 @@
 }
 
 static rv_t
-dump_extattrs( drive_t *drivep,
+dump_extattrs(drive_t *drivep,
 	       context_t *contextp,
 	       jdm_fshandle_t *fshandlep,
 	       xfs_bstat_t *statp)
@@ -3179,39 +3179,39 @@
 
 	/* dump a file header specially marked as heading extended attributes
 	 */
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "dumping %s ino %llu extended attributes filehdr\n",
 	      FILETYPE(statp),
-	      statp->bs_ino );
+	      statp->bs_ino);
 
-	rv = dump_filehdr( drivep, contextp, statp, 0, FILEHDR_FLAGS_EXTATTR );
-	if ( rv != RV_OK ) {
+	rv = dump_filehdr(drivep, contextp, statp, 0, FILEHDR_FLAGS_EXTATTR);
+	if (rv != RV_OK) {
 		return rv;
 	}
 
 	/* loop three times: once for the non-root, once for root, and
 	 * again for the secure attributes.
 	 */
-	for ( pass = 0; pass < 3; pass++ ) {
+	for (pass = 0; pass < 3; pass++) {
 		bool_t more;
 
-		if ( pass == 0 )
+		if (pass == 0)
 			flag = 0;
-		else if ( pass == 1)
+		else if (pass == 1)
 			flag = ATTR_ROOT;
 		else
 			flag = ATTR_SECURE;
 
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "dumping %s extended attributes for %s ino %llu\n",
 		      EXTATTR_NAMESPACE(flag),
 		      FILETYPE(statp),
-		      statp->bs_ino );
+		      statp->bs_ino);
 
 		/* loop dumping the extended attributes from the namespace
 		 * selected by the outer loop
 		 */
-		memset( &cursor, 0, sizeof( cursor ));
+		memset(&cursor, 0, sizeof(cursor));
 		more = BOOL_FALSE;
 		do {
 			attrlist_t *listp;
@@ -3219,62 +3219,62 @@
 
 			rval = jdm_attr_list(fshandlep, statp,
 				contextp->cc_extattrlistbufp,
-				( int )contextp->cc_extattrlistbufsz,
-				flag, &cursor );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				(int)contextp->cc_extattrlistbufsz,
+				flag, &cursor);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "could not get list of %s attributes for "
 				      "%s ino %llu: %s (%d)\n"),
 				      EXTATTR_NAMESPACE(flag),
 				      FILETYPE(statp),
 				      statp->bs_ino,
-				      strerror( errno ),
-				      errno );
+				      strerror(errno),
+				      errno);
 				break;
 			}
 
-			listp = ( attrlist_t * )contextp->cc_extattrlistbufp;
+			listp = (attrlist_t *)contextp->cc_extattrlistbufp;
 			more = listp->al_more;
 
 			abort = BOOL_FALSE;
-			rv = dump_extattr_list( drivep,
+			rv = dump_extattr_list(drivep,
 						contextp,
 						fshandlep,
 						statp,
 						listp,
 						flag,
-						&abort );
-			if ( rv != RV_OK ) {
+						&abort);
+			if (rv != RV_OK) {
 				return rv;
 			}
-		} while ( more && !abort );
+		} while (more && !abort);
 	}
 
 	/* finally, dump a dummy extattr hdr so restore will know
 	 * we're done.
 	 */
-	/*DBG*/mlog( MLOG_NITTY,
-		     "dumping NULL extattrhdr\n" );
-	rv = dump_extattrhdr( drivep,
+	/*DBG*/mlog(MLOG_NITTY,
+		     "dumping NULL extattrhdr\n");
+	rv = dump_extattrhdr(drivep,
 			      contextp,
 			      statp,
 			      EXTATTRHDR_SZ,
 			      0,
 			      EXTATTRHDR_FLAGS_NULL,
-			      0 );
+			      0);
 	return rv;
 }
 
 static rv_t
-dump_extattr_list( drive_t *drivep,
+dump_extattr_list(drive_t *drivep,
 		   context_t *contextp,
 		   jdm_fshandle_t *fshandlep,
 		   xfs_bstat_t *statp,
 		   attrlist_t *listp,
 		   int flag,
-		   bool_t *abortprp )
+		   bool_t *abortprp)
 {
-	size_t listlen = ( size_t )listp->al_count;
+	size_t listlen = (size_t)listp->al_count;
 	ix_t nameix;
 	char *dumpbufp;
 	char *endp;
@@ -3287,7 +3287,7 @@
 
 	/* sanity checks
 	 */
-	assert( listp->al_count >= 0 );
+	assert(listp->al_count >= 0);
 
 	/* fill up a retrieve array and build a dump buffer;
 	 * can run out of entries in the name list, space in the
@@ -3295,7 +3295,7 @@
 	 */
 	dumpbufp = contextp->cc_extattrdumpbufp;
 	endp = dumpbufp;
-	for ( nameix = 0 ; nameix < listlen ; ) {
+	for (nameix = 0 ; nameix < listlen ;) {
 		ix_t rtrvix;
 		size_t rtrvcnt;
 
@@ -3305,8 +3305,8 @@
 			char *valuep;
 			attr_multiop_t *opp;
 
-			entp = ATTR_ENTRY( listp, nameix );
-			opp = &contextp->cc_extattrrtrvarrayp[ rtrvix ];
+			entp = ATTR_ENTRY(listp, nameix);
+			opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
 
 			/* Offer the HSM a chance to avoid dumping certain
 			 * attributes.
@@ -3319,7 +3319,7 @@
 				    contextp->cc_hsm_f_ctxtp, entp->a_name,
 				    entp->a_valuelen, flag,
 				    &skip_entry)) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      		    "HSM could not filter %s "
 					    "attribute %s for %s ino %llu\n"),
 					    EXTATTR_NAMESPACE(flag),
@@ -3335,21 +3335,21 @@
 				}
 			}
 
-			dumpbufp = dump_extattr_buildrecord( statp,
+			dumpbufp = dump_extattr_buildrecord(statp,
 							     dumpbufp,
 							     dumpbufendp,
 							     entp->a_name,
 							     entp->a_valuelen,
 							     flag,
-							     &valuep );
-			if ( dumpbufp > dumpbufendp ) {
+							     &valuep);
+			if (dumpbufp > dumpbufendp) {
 				break;		/* won't fit in buffer */
 			}
 			if (valuep != NULL) {	/* if added to dump buffer */
 				endp = dumpbufp;
 				opp->am_attrname = entp->a_name;
 				opp->am_attrvalue = valuep;
-				opp->am_length = ( int )entp->a_valuelen;
+				opp->am_length = (int)entp->a_valuelen;
 				opp->am_flags = flag;
 				opp->am_error = 0;
 				opp->am_opcode = ATTR_OP_GET;
@@ -3365,29 +3365,29 @@
 
 		rtrvcnt = rtrvix;
 		if (rtrvcnt > 0) {
-			rval = jdm_attr_multi( fshandlep, statp,
+			rval = jdm_attr_multi(fshandlep, statp,
 					(void *)contextp->cc_extattrrtrvarrayp,
-					( int )rtrvcnt,
-					0 );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					(int)rtrvcnt,
+					0);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "could not retrieve %s attributes for "
 				      "%s ino %llu: %s (%d)\n"),
 				      EXTATTR_NAMESPACE(flag),
 				      FILETYPE(statp),
 				      statp->bs_ino,
-				      strerror( errno ),
-				      errno );
+				      strerror(errno),
+				      errno);
 				*abortprp = BOOL_TRUE;
 				return RV_OK;
 			}
 
-			for ( rtrvix = 0 ; rtrvix < rtrvcnt ; rtrvix++ ) {
+			for (rtrvix = 0 ; rtrvix < rtrvcnt ; rtrvix++) {
 				attr_multiop_t *opp;
-				opp = &contextp->cc_extattrrtrvarrayp[ rtrvix ];
-				if ( opp->am_error ) {
-					if ( opp->am_error == ENOATTR &&
-					     flag & ATTR_SECURE ) {
+				opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
+				if (opp->am_error) {
+					if (opp->am_error == ENOATTR &&
+					     flag & ATTR_SECURE) {
 				/* Security attributes are supported by
 				 * the kernel but jdm_attr_multi() returns
 				 * ENOATTR for every 'user' space attribute
@@ -3399,7 +3399,7 @@
 				 */
 						continue;
 					}
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					     "attr_multi indicates error while "
 					     "retrieving %s attribute [%s] for "
 					     "%s ino %llu: %s (%d)\n"),
@@ -3407,8 +3407,8 @@
 					     opp->am_attrname,
 					     FILETYPE(statp),
 					     statp->bs_ino,
-					     strerror( opp->am_error ),
-					     opp->am_error );
+					     strerror(opp->am_error),
+					     opp->am_error);
 				}
 			}
 		}
@@ -3421,15 +3421,15 @@
 		if (dumpbufp <= dumpbufendp)
 			continue;	/* no buffer overflow yet */
 
-		assert( endp > contextp->cc_extattrdumpbufp );
-		bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
+		assert(endp > contextp->cc_extattrdumpbufp);
+		bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
-		rval = write_buf( contextp->cc_extattrdumpbufp,
+		rval = write_buf(contextp->cc_extattrdumpbufp,
 				  bufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -3445,7 +3445,7 @@
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			*abortprp = BOOL_FALSE;
 			return rv;
 		}
@@ -3471,7 +3471,7 @@
 						&hsmnamep,
 						&hsmvaluep,
 						&hsmvaluesz)) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      		"HSM could not add new %s attribute "
 					"#%d for %s ino %llu\n"),
 					EXTATTR_NAMESPACE(flag),
@@ -3485,30 +3485,30 @@
 				break;		/* No more attributes to add */
 			}
 
-			dumpbufp = dump_extattr_buildrecord( statp,
+			dumpbufp = dump_extattr_buildrecord(statp,
 							     dumpbufp,
 							     dumpbufendp,
 							     hsmnamep,
 							     hsmvaluesz,
 							     flag,
-							     &valuep );
+							     &valuep);
 
-			if ( dumpbufp < dumpbufendp ) {	/* if fits in buffer */
+			if (dumpbufp < dumpbufendp) {	/* if fits in buffer */
 				endp = dumpbufp;
 				(void)memcpy(valuep, hsmvaluep, hsmvaluesz);
 				hsmcursor++;
 				continue;
 			}
 
-			assert( endp > contextp->cc_extattrdumpbufp );
-			bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
+			assert(endp > contextp->cc_extattrdumpbufp);
+			bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
-			rval = write_buf( contextp->cc_extattrdumpbufp,
+			rval = write_buf(contextp->cc_extattrdumpbufp,
 				  bufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-			switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+			switch (rval) {
 			case 0:
 				rv = RV_OK;
 				break;
@@ -3524,7 +3524,7 @@
 				rv = RV_CORE;
 				break;
 			}
-			if ( rv != RV_OK ) {
+			if (rv != RV_OK) {
 				*abortprp = BOOL_FALSE;
 				return rv;
 			}
@@ -3538,14 +3538,14 @@
 	 */
 
 	if (endp > contextp->cc_extattrdumpbufp) {
-		bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
+		bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
-		rval = write_buf( contextp->cc_extattrdumpbufp,
+		rval = write_buf(contextp->cc_extattrdumpbufp,
 				  bufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -3561,7 +3561,7 @@
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			*abortprp = BOOL_FALSE;
 			return rv;
 		}
@@ -3572,58 +3572,58 @@
 }
 
 static char *
-dump_extattr_buildrecord( xfs_bstat_t *statp,
+dump_extattr_buildrecord(xfs_bstat_t *statp,
 			  char *dumpbufp,
 			  char *dumpbufendp,
 			  char *namesrcp,
 			  uint32_t valuesz,
 			  int flag,
-			  char **valuepp )
+			  char **valuepp)
 {
-	extattrhdr_t *ahdrp = ( extattrhdr_t * )dumpbufp;
+	extattrhdr_t *ahdrp = (extattrhdr_t *)dumpbufp;
 	char *namep = dumpbufp + EXTATTRHDR_SZ;
-	uint32_t namelen = strlen( namesrcp );
+	uint32_t namelen = strlen(namesrcp);
 	uint32_t namesz = namelen + 1;
 	char *valuep = namep + namesz;
 	uint32_t recsz = EXTATTRHDR_SZ + namesz + valuesz;
 	extattrhdr_t tmpah;
 
-	recsz = ( recsz + ( EXTATTRHDR_ALIGN - 1 ))
+	recsz = (recsz + (EXTATTRHDR_ALIGN - 1))
 		&
-		~( EXTATTRHDR_ALIGN - 1 );
+		~(EXTATTRHDR_ALIGN - 1);
 
-	if ( dumpbufp + recsz > dumpbufendp ) {
+	if (dumpbufp + recsz > dumpbufendp) {
 		*valuepp = 0;
 		return dumpbufp + recsz;
 	}
 
-	if ( namelen > NAME_MAX ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (namelen > NAME_MAX) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "%s extended attribute name for %s ino %llu too long: "
 		      "%u, max is %u: skipping\n"),
 		      EXTATTR_NAMESPACE(flag),
 		      FILETYPE(statp),
 		      statp->bs_ino,
 		      namelen,
-		      NAME_MAX );
+		      NAME_MAX);
 		*valuepp = 0;
 		return dumpbufp;
 	}
 
-	if ( valuesz > ATTR_MAX_VALUELEN ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (valuesz > ATTR_MAX_VALUELEN) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "%s extended attribute value for %s ino %llu too long: "
 		      "%u, max is %u: skipping\n"),
 		      EXTATTR_NAMESPACE(flag),
 		      FILETYPE(statp),
 		      statp->bs_ino,
 		      valuesz,
-		      ATTR_MAX_VALUELEN );
+		      ATTR_MAX_VALUELEN);
 		*valuepp = 0;
 		return dumpbufp;
 	}
 
-	/*DBG*/mlog( MLOG_NITTY,
+	/*DBG*/mlog(MLOG_NITTY,
 		     "building extattr "
 		     "record sz %u "
 		     "hdrsz %u "
@@ -3632,19 +3632,19 @@
 		     recsz,
 		     EXTATTRHDR_SZ,
 		     namesz, namesrcp,
-		     valuesz );
-	( void )strcpy( namep, namesrcp );
+		     valuesz);
+	(void)strcpy(namep, namesrcp);
 
-	memset( ( void * )&tmpah, 0, sizeof( tmpah ));
+	memset((void *)&tmpah, 0, sizeof(tmpah));
 	tmpah.ah_sz = recsz;
-	assert( EXTATTRHDR_SZ + namesz < UINT16MAX );
-	tmpah.ah_valoff = ( uint16_t )( EXTATTRHDR_SZ + namesz );
-	tmpah.ah_flags = ( uint16_t )
-		(( flag & ATTR_ROOT ) ? EXTATTRHDR_FLAGS_ROOT :
-		(( flag & ATTR_SECURE ) ? EXTATTRHDR_FLAGS_SECURE : 0));
+	assert(EXTATTRHDR_SZ + namesz < UINT16MAX);
+	tmpah.ah_valoff = (uint16_t)(EXTATTRHDR_SZ + namesz);
+	tmpah.ah_flags = (uint16_t)
+		((flag & ATTR_ROOT) ? EXTATTRHDR_FLAGS_ROOT :
+		((flag & ATTR_SECURE) ? EXTATTRHDR_FLAGS_SECURE : 0));
 	tmpah.ah_valsz = valuesz;
 	tmpah.ah_flags |= EXTATTRHDR_FLAGS_CHECKSUM;
-	tmpah.ah_checksum = calc_checksum( &tmpah, EXTATTRHDR_SZ );
+	tmpah.ah_checksum = calc_checksum(&tmpah, EXTATTRHDR_SZ);
 
 	xlate_extattrhdr(ahdrp, &tmpah, -1);
 	*valuepp = valuep;
@@ -3653,34 +3653,34 @@
 
 /* ARGSUSED */
 static rv_t
-dump_extattrhdr( drive_t *drivep,
+dump_extattrhdr(drive_t *drivep,
 		 context_t *contextp,
 		 xfs_bstat_t *statp,
 		 size_t recsz,
 		 size_t valoff,
 		 ix_t flags,
-		 uint32_t valsz )
+		 uint32_t valsz)
 {
 	extattrhdr_t ahdr;
 	extattrhdr_t tmpahdr;
 	int rval;
 	rv_t rv;
 
-	memset( ( void * )&ahdr, 0, sizeof( ahdr ));
+	memset((void *)&ahdr, 0, sizeof(ahdr));
 	ahdr.ah_sz = recsz;
-	assert( valoff < UINT16MAX );
-	ahdr.ah_valoff = ( uint16_t )valoff;
-	ahdr.ah_flags = ( uint16_t )flags | EXTATTRHDR_FLAGS_CHECKSUM;
+	assert(valoff < UINT16MAX);
+	ahdr.ah_valoff = (uint16_t)valoff;
+	ahdr.ah_flags = (uint16_t)flags | EXTATTRHDR_FLAGS_CHECKSUM;
 	ahdr.ah_valsz = valsz;
-	ahdr.ah_checksum = calc_checksum( &ahdr, EXTATTRHDR_SZ );
+	ahdr.ah_checksum = calc_checksum(&ahdr, EXTATTRHDR_SZ);
 
 	xlate_extattrhdr(&ahdr, &tmpahdr, 1);
-	rval = write_buf( ( char * )&tmpahdr,
+	rval = write_buf((char *)&tmpahdr,
 			  EXTATTRHDR_SZ,
-			  ( void * )drivep,
-			  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-			  ( wfp_t )drivep->d_opsp->do_write );
-	switch ( rval ) {
+			  (void *)drivep,
+			  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+			  (wfp_t)drivep->d_opsp->do_write);
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -3709,19 +3709,19 @@
  */
 /* ARGSUSED */
 static rv_t
-dump_file( void *arg1,
+dump_file(void *arg1,
 	   jdm_fshandle_t *fshandlep,
 	   int fsfd,
-	   xfs_bstat_t *statp )
+	   xfs_bstat_t *statp)
 {
-	ix_t strmix = ( ix_t )arg1;
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	ix_t strmix = (ix_t)arg1;
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
-	content_hdr_t *cwhdrp = ( content_hdr_t * )mwhdrp->mh_upper;
-	content_inode_hdr_t *scwhdrp = ( content_inode_hdr_t * )
-				       ( void * )
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
+	content_hdr_t *cwhdrp = (content_hdr_t *)mwhdrp->mh_upper;
+	content_inode_hdr_t *scwhdrp = (content_inode_hdr_t *)
+				       (void *)
 				       cwhdrp->ch_specific;
 	startpt_t *startptp = &scwhdrp->cih_startpt;
 	startpt_t *endptp = &scwhdrp->cih_endpt;
@@ -3731,22 +3731,22 @@
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink < 1 ) {
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+	if (statp->bs_nlink < 1) {
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as no links for ino %llu\n",
+		mlog(MLOG_DEBUG, "skip as no links for ino %llu\n",
 			statp->bs_ino);
 		return RV_OK;
 	}
 
 	/* skip if prior to startpoint
 	 */
-	if ( statp->bs_ino < startptp->sp_ino ) {
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+	if (statp->bs_ino < startptp->sp_ino) {
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n",
+		mlog(MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n",
 			statp->bs_ino);
 		return RV_OK;
 	}
@@ -3754,22 +3754,22 @@
 	/* skip if at or beyond next startpoint. return non-zero to
 	 * abort iteration.
 	 */
-	if ( ! ( endptp->sp_flags & STARTPT_FLAGS_END )) {
-		if ( endptp->sp_offset == 0 ) {
-			if ( statp->bs_ino >= endptp->sp_ino ) {
-				if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+	if (! (endptp->sp_flags & STARTPT_FLAGS_END)) {
+		if (endptp->sp_offset == 0) {
+			if (statp->bs_ino >= endptp->sp_ino) {
+				if (statp->bs_ino > contextp->cc_stat_lastino) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
-				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
+				mlog(MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
 					statp->bs_ino);
 				return RV_NOMORE;
 			}
 		} else {
-			if ( statp->bs_ino > endptp->sp_ino ) {
-				if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+			if (statp->bs_ino > endptp->sp_ino) {
+				if (statp->bs_ino > contextp->cc_stat_lastino) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
-				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
+				mlog(MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
 					statp->bs_ino);
 				return RV_NOMORE;
 			}
@@ -3778,35 +3778,35 @@
 
 	/* see what the inomap says about this ino
 	 */
-	state = inomap_get_state( contextp->cc_inomap_contextp, statp->bs_ino );
+	state = inomap_get_state(contextp->cc_inomap_contextp, statp->bs_ino);
 
 	/* skip if not in inomap
 	 */
-	if ( state == MAP_INO_UNUSED
+	if (state == MAP_INO_UNUSED
 	     ||
 	     state == MAP_DIR_NOCHNG
 	     ||
-	     state == MAP_NDR_NOCHNG ) {
-		if ( state == MAP_DIR_NOCHNG ) {
-			mlog( MLOG_DEBUG,
+	     state == MAP_NDR_NOCHNG) {
+		if (state == MAP_DIR_NOCHNG) {
+			mlog(MLOG_DEBUG,
 			      "inomap inconsistency ino %llu: "
 			      "MAP_DIR_NOCHNG but is non-dir: skipping\n",
-			      statp->bs_ino );
+			      statp->bs_ino);
 		}
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n",
+		mlog(MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n",
 			statp->bs_ino);
-		mlog( MLOG_DEBUG, "ino %llu is in state %d\n",
+		mlog(MLOG_DEBUG, "ino %llu is in state %d\n",
 			statp->bs_ino, state);
 		return RV_OK;
 	}
 
 	/* note if map says a dir
 	 */
-	if ( state == MAP_DIR_CHANGE || state == MAP_DIR_SUPPRT ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (state == MAP_DIR_CHANGE || state == MAP_DIR_SUPPRT) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "inomap inconsistency ino %llu: "
 		      "%s but is now non-dir: NOT dumping\n"),
 		      statp->bs_ino,
@@ -3814,7 +3814,7 @@
 		      ?
 		      "map says changed dir"
 		      :
-		      "map says unchanged dir" );
+		      "map says unchanged dir");
 	}
 
 	/* if GETOPT_DUMPASOFFLINE was specified, initialize the HSM's file
@@ -3824,11 +3824,11 @@
 
 	if (hsm_fs_ctxtp) {
 		if (HsmInitFileContext(contextp->cc_hsm_f_ctxtp, statp)) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "inomap inconsistency ino %llu: "
 			      "hsm detected error: NOT dumping\n"),
 			      statp->bs_ino);
-			if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+			if (statp->bs_ino > contextp->cc_stat_lastino) {
 				contextp->cc_stat_lastino = statp->bs_ino;
 			}
 			return RV_OK;
@@ -3837,7 +3837,7 @@
 
 	/* pass on to specific dump function
 	 */
-	switch( statp->bs_mode & S_IFMT ) {
+	switch(statp->bs_mode & S_IFMT) {
 	case S_IFREG:
 		/* ordinary file
 		 */
@@ -3847,7 +3847,7 @@
 		 */
 		if (maxdumpfilesize) {
 			off64_t estimated_size = statp->bs_blocks *
-						 ( off64_t )statp->bs_blksize;
+						 (off64_t)statp->bs_blksize;
 
 			if (hsm_fs_ctxtp) {
 				HsmEstimateFileSpace(hsm_fs_ctxtp,
@@ -3860,23 +3860,23 @@
 			/* quota files are exempt from max size check */
 			if (estimated_size > maxdumpfilesize &&
 			    !is_quota_file(statp->bs_ino)) {
-				mlog( MLOG_DEBUG | MLOG_NOTE,
+				mlog(MLOG_DEBUG | MLOG_NOTE,
 				      "ino %llu increased beyond maximum size: "
 				      "NOT dumping\n",
 				      statp->bs_ino);
 				return RV_OK;
 			}
 		}
-		rv = dump_file_reg( drivep,
+		rv = dump_file_reg(drivep,
 				    contextp,
 				    scwhdrp,
 				    fshandlep,
 				    statp,
-				    &file_skipped );
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
-			lock( );
+				    &file_skipped);
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
+			lock();
 			sc_stat_nondirdone++;
-			unlock( );
+			unlock();
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		break; /* drop out of switch to extattr dump */
@@ -3890,11 +3890,11 @@
 	case S_IFSOCK:
 		/* only need a filehdr_t; no data
 		 */
-		rv = dump_file_spec( drivep, contextp, fshandlep, statp );
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
-			lock( );
+		rv = dump_file_spec(drivep, contextp, fshandlep, statp);
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
+			lock();
 			sc_stat_nondirdone++;
-			unlock( );
+			unlock();
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		break; /* drop out of switch to extattr dump */
@@ -3902,14 +3902,14 @@
 	default:
 		/* don't know how to dump these
 		 */
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "don't know how to dump ino %llu: mode %08x\n"),
 		      statp->bs_ino,
-		      statp->bs_mode );
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
-			lock( );
+		      statp->bs_mode);
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
+			lock();
 			sc_stat_nondirdone++;
-			unlock( );
+			unlock();
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		return RV_OK;
@@ -3918,14 +3918,14 @@
 	 */
 	}
 
-	if ( rv == RV_OK
+	if (rv == RV_OK
 	     &&
 	     file_skipped == BOOL_FALSE
 	     &&
 	     sc_dumpextattrpr
 	     &&
-	     ( statp->bs_xflags & XFS_XFLAG_HASATTR )) {
-		rv = dump_extattrs( drivep, contextp, fshandlep, statp);
+	     (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
+		rv = dump_extattrs(drivep, contextp, fshandlep, statp);
 	}
 
 	return rv;
@@ -3938,12 +3938,12 @@
  * operator requested stop.
  */
 static rv_t
-dump_file_reg( drive_t *drivep,
+dump_file_reg(drive_t *drivep,
 	       context_t *contextp,
 	       content_inode_hdr_t *scwhdrp,
 	       jdm_fshandle_t *fshandlep,
 	       xfs_bstat_t *statp,
-	       bool_t *file_skippedp )
+	       bool_t *file_skippedp)
 {
 	startpt_t *startptp = &scwhdrp->cih_startpt;
 	startpt_t *endptp = &scwhdrp->cih_endpt;
@@ -3959,9 +3959,9 @@
 	 * it must have been aligned to the basic fs block size by the
 	 * startpoint calculations done during strategy initialization.
 	 */
-	if ( statp->bs_ino == startptp->sp_ino ) {
+	if (statp->bs_ino == startptp->sp_ino) {
 		offset = startptp->sp_offset;
-		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
 	} else {
 		offset = 0;
 	}
@@ -3971,35 +3971,35 @@
 	 * above, and that file hasn't changed since the resumed dump,
 	 * modify offset.
 	 */
-	if ( sc_resumepr ) {
+	if (sc_resumepr) {
 		drange_t *drangep = sc_resumerangep;
 		size_t drangecnt = sc_resumerangecnt;
 		size_t drangeix;
 
-		for ( drangeix = 0 ; drangeix < drangecnt ; drangeix++ ) {
-			drange_t *rp = &drangep[ drangeix ];
-			if ( statp->bs_ino == rp->dr_begin.sp_ino ) {
+		for (drangeix = 0 ; drangeix < drangecnt ; drangeix++) {
+			drange_t *rp = &drangep[drangeix];
+			if (statp->bs_ino == rp->dr_begin.sp_ino) {
 				register time32_t mtime = statp->bs_mtime.tv_sec;
 				register time32_t ctime = statp->bs_ctime.tv_sec;
-				register time32_t ltime = max( mtime, ctime );
-				if ( ltime < sc_resumebasetime ) {
-					if ( rp->dr_begin.sp_offset > offset ){
+				register time32_t ltime = max(mtime, ctime);
+				if (ltime < sc_resumebasetime) {
+					if (rp->dr_begin.sp_offset > offset){
 						offset =rp->dr_begin.sp_offset;
 					}
 				}
 				break;
 			}
 		}
-		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
 	}
 
 	/* determine the offset within the file where the dump should end.
 	 * only significant if this is an inode spanning a startpoint.
 	 */
-	if ( endptp->sp_flags & STARTPT_FLAGS_END ) {
+	if (endptp->sp_flags & STARTPT_FLAGS_END) {
 		sosig = BOOL_FALSE;
 		stopoffset = 0;
-	} else if ( statp->bs_ino == endptp->sp_ino ) {
+	} else if (statp->bs_ino == endptp->sp_ino) {
 		sosig = BOOL_TRUE;
 		stopoffset = endptp->sp_offset;
 	} else {
@@ -4007,7 +4007,7 @@
 		stopoffset = 0;
 	}
 
-	mlog( MLOG_TRACE,
+	mlog(MLOG_TRACE,
 	      "dumping regular file ino %llu "
 	      "offset %lld "
 	      "to offset %lld "
@@ -4015,7 +4015,7 @@
 	      statp->bs_ino,
 	      offset,
 	      sosig ? stopoffset : statp->bs_size,
-	      statp->bs_size );
+	      statp->bs_size);
 
 	/* calculate the maximum extent group size. files larger than this
 	 * will be broken into multiple extent groups, each with its own
@@ -4026,16 +4026,16 @@
 	/* initialize the extent group context. if fails, just return,
 	 * pretending the dump succeeded.
 	 */
-	rv = init_extent_group_context( fshandlep,
+	rv = init_extent_group_context(fshandlep,
 					statp,
-					&extent_group_context );
-	if ( rv != RV_OK ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					&extent_group_context);
+	if (rv != RV_OK) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not open regular file ino %llu mode 0x%08x: "
 		      "%s: not dumped\n"),
 		      statp->bs_ino,
 		      statp->bs_mode,
-		      strerror( errno ));
+		      strerror(errno));
 		*file_skippedp = BOOL_TRUE;
 		return RV_OK;
 	}
@@ -4051,14 +4051,14 @@
 	cmpltflg = BOOL_FALSE;
 
 	rv = RV_OK;
-	for ( ; ; ) {
+	for (; ;) {
 		off64_t bytecnt = 0;
 		off64_t bc;
 
 		/* see if we are done.
 		 */
-		if ( cmpltflg ) {
-			assert( rv == RV_OK );
+		if (cmpltflg) {
+			assert(rv == RV_OK);
 			break;
 		}
 
@@ -4067,23 +4067,23 @@
 		 * interrupt the dump. this mark, if committed, indicates
 		 * the previous fs file / extent group was completely dumped.
 		 */
-		mark_set( drivep, statp->bs_ino, offset, 0 );
+		mark_set(drivep, statp->bs_ino, offset, 0);
 
 		/* spoof EOF if the media file size is getting too big.
 		 * note that the most we can go over is d_recmarksep.
 		 */
-		if ( contextp->cc_mfilesz >= drivep->d_recmfilesz ){
+		if (contextp->cc_mfilesz >= drivep->d_recmfilesz){
 			rv = RV_EOF;
 			break;
 		}
 
 		/* check if the operator has requested to interrupt the dump.
 		 */
-		if ( cldmgr_stop_requested( )) {
-			mlog( MLOG_NORMAL, _(
+		if (cldmgr_stop_requested()) {
+			mlog(MLOG_NORMAL, _(
 			      "dump interrupted prior to ino %llu offset %lld\n"),
 			      statp->bs_ino,
-			      offset );
+			      offset);
 			mlog_exit_hint(RV_INTR);
 			rv = RV_INTR;
 			break;
@@ -4091,15 +4091,15 @@
 
 		/* dump the file header
 		 */
-		mlog( MLOG_DEBUG,
+		mlog(MLOG_DEBUG,
 		      "dumping extent group ino %llu offset %lld\n",
 		      statp->bs_ino,
-		      offset );
-		rv = dump_filehdr( drivep, contextp, statp, offset, 0 );
-		if ( rv != RV_OK ) {
+		      offset);
+		rv = dump_filehdr(drivep, contextp, statp, offset, 0);
+		if (rv != RV_OK) {
 			break;
 		}
-		bytecnt += sizeof( filehdr_t );
+		bytecnt += sizeof(filehdr_t);
 
 		/* dump a group of extents. returns by reference
 		 * the offset of the next extent group (to be placed
@@ -4108,7 +4108,7 @@
 		 * all extents have been dumped.
 		 */
 		bc = 0; /* for lint */
-		rv = dump_extent_group( drivep,
+		rv = dump_extent_group(drivep,
 					contextp,
 					statp,
 					&extent_group_context,
@@ -4117,33 +4117,33 @@
 					sosig,
 					&offset,
 					&bc,
-					&cmpltflg );
-		assert( bc >= 0 );
+					&cmpltflg);
+		assert(bc >= 0);
 		bytecnt += bc;
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			break;
 		}
 
 		/* update global stat
 		 */
-		lock( );
-		sc_stat_datadone += ( size64_t )bc;
-		unlock( );
+		lock();
+		sc_stat_datadone += (size64_t)bc;
+		unlock();
 
 		/* dump LAST extent hdr. one of these is placed at the
 		 * end of each dumped file. necessary to detect the
 		 * end of the file.
 		 */
-		rv = dump_extenthdr( drivep,
+		rv = dump_extenthdr(drivep,
 				     contextp,
 				     EXTENTHDR_TYPE_LAST,
 				     0,
 				     0,
-				     0 );
-		if ( rv != RV_OK ) {
+				     0);
+		if (rv != RV_OK) {
 			break;
 		}
-		bytecnt += sizeof( extenthdr_t );
+		bytecnt += sizeof(extenthdr_t);
 
 		/* update the media file size
 		 */
@@ -4151,7 +4151,7 @@
 
 	}
 
-	cleanup_extent_group_context( &extent_group_context );
+	cleanup_extent_group_context(&extent_group_context);
 	return rv;
 }
 
@@ -4160,42 +4160,42 @@
  * appends a variable-length string after the filehdr_t.
  */
 static rv_t
-dump_file_spec( drive_t *drivep,
+dump_file_spec(drive_t *drivep,
 		context_t *contextp,
 		jdm_fshandle_t *fshandlep,
-		xfs_bstat_t *statp )
+		xfs_bstat_t *statp)
 {
 	int rval;
 	rv_t rv;
 
-	mlog( MLOG_TRACE,
+	mlog(MLOG_TRACE,
 	      "dumping special file ino %llu mode 0x%04x\n",
 	      statp->bs_ino,
-	      statp->bs_mode );
+	      statp->bs_mode);
 
 	/* set a mark - important to do this now, before deciding
 	 * the media file is to big. this mark, if committed,
 	 * indicates the previous fs file was completely dumped.
 	 */
-	mark_set( drivep, statp->bs_ino, 0, 0 );
+	mark_set(drivep, statp->bs_ino, 0, 0);
 
 	/* dump the file header
 	 */
-	rv = dump_filehdr( drivep, contextp, statp, 0, 0 );
-	if ( rv != RV_OK ) {
+	rv = dump_filehdr(drivep, contextp, statp, 0, 0);
+	if (rv != RV_OK) {
 		return rv;
 	}
 
 	/* update the media file size
 	 */
-	contextp->cc_mfilesz += sizeof( filehdr_t );
+	contextp->cc_mfilesz += sizeof(filehdr_t);
 
 	/* if a symbolic link, also dump the link pathname.
 	 * use an extent header to represent the pathname. the
 	 * extent sz will always be a multiple of SYMLINK_ALIGN.
 	 * the symlink pathname char string will always  be NULL-terminated.
 	 */
-	if ( ( statp->bs_mode & S_IFMT ) == S_IFLNK ) {
+	if ((statp->bs_mode & S_IFMT) == S_IFLNK) {
 		int nread;
 		size_t extentsz;
 
@@ -4204,50 +4204,50 @@
 		 * bytes to dump, and contextp->cc_direntbufp will contain
 		 * the bytes.
 		 */
-		nread = jdm_readlink( fshandlep,
+		nread = jdm_readlink(fshandlep,
 				      statp,
 				      contextp->cc_readlinkbufp,
-				      contextp->cc_readlinkbufsz );
-		if ( nread < 0 ) {
-			mlog( MLOG_DEBUG,
+				      contextp->cc_readlinkbufsz);
+		if (nread < 0) {
+			mlog(MLOG_DEBUG,
 			      "could not read symlink ino %llu\n",
-			      statp->bs_ino );
+			      statp->bs_ino);
 			nread = 0;
 		}
 
 		/* null-terminate the string
 		 */
-		assert( ( size_t )nread < contextp->cc_readlinkbufsz );
-		contextp->cc_readlinkbufp[ nread ] = 0;
+		assert((size_t)nread < contextp->cc_readlinkbufsz);
+		contextp->cc_readlinkbufp[nread] = 0;
 
 		/* calculate the extent size - be sure to include room
 		 * for the null-termination.
 		 */
-		extentsz = ( ( size_t )nread + 1 + ( SYMLINK_ALIGN - 1 ))
+		extentsz = ((size_t)nread + 1 + (SYMLINK_ALIGN - 1))
 			   &
-			   ~ ( SYMLINK_ALIGN - 1 );
-		assert( extentsz <= contextp->cc_readlinkbufsz );
+			   ~ (SYMLINK_ALIGN - 1);
+		assert(extentsz <= contextp->cc_readlinkbufsz);
 
 		/* dump an extent header
 		 */
-		rv = dump_extenthdr( drivep,
+		rv = dump_extenthdr(drivep,
 				     contextp,
 				     EXTENTHDR_TYPE_DATA,
 				     0,
 				     0,
-				     ( off64_t )extentsz );
-		if ( rv != RV_OK ) {
+				     (off64_t)extentsz);
+		if (rv != RV_OK) {
 			return rv;
 		}
 
 		/* dump the link path extent
 		 */
-		rval = write_buf( contextp->cc_readlinkbufp,
+		rval = write_buf(contextp->cc_readlinkbufp,
 				  extentsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -4263,7 +4263,7 @@
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			return rv;
 		}
 	}
@@ -4276,30 +4276,30 @@
  * does anything else.
  */
 static rv_t
-init_extent_group_context( jdm_fshandle_t *fshandlep,
+init_extent_group_context(jdm_fshandle_t *fshandlep,
 			   xfs_bstat_t *statp,
-			   extent_group_context_t *gcp )
+			   extent_group_context_t *gcp)
 {
 	bool_t isrealtime;
 	int oflags;
 	struct flock fl;
 
-	isrealtime = ( bool_t )(statp->bs_xflags & XFS_XFLAG_REALTIME );
+	isrealtime = (bool_t)(statp->bs_xflags & XFS_XFLAG_REALTIME);
 	oflags = O_RDONLY;
-	if ( isrealtime ) {
+	if (isrealtime) {
 		oflags |= O_DIRECT;
 	}
-	( void )memset( ( void * )gcp, 0, sizeof( *gcp ));
-	gcp->eg_bmap[ 0 ].bmv_offset = 0;
-	gcp->eg_bmap[ 0 ].bmv_length = -1;
-	gcp->eg_bmap[ 0 ].bmv_count = BMAP_LEN;
-	gcp->eg_bmap[ 0 ].bmv_iflags = BMV_IF_NO_DMAPI_READ;
-	gcp->eg_nextbmapp = &gcp->eg_bmap[ 1 ];
-	gcp->eg_endbmapp = &gcp->eg_bmap[ 1 ];
+	(void)memset((void *)gcp, 0, sizeof(*gcp));
+	gcp->eg_bmap[0].bmv_offset = 0;
+	gcp->eg_bmap[0].bmv_length = -1;
+	gcp->eg_bmap[0].bmv_count = BMAP_LEN;
+	gcp->eg_bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
+	gcp->eg_nextbmapp = &gcp->eg_bmap[1];
+	gcp->eg_endbmapp = &gcp->eg_bmap[1];
 	gcp->eg_bmapix = 0;
 	gcp->eg_gbmcnt = 0;
-	gcp->eg_fd = jdm_open( fshandlep, statp, oflags );
-	if ( gcp->eg_fd < 0 ) {
+	gcp->eg_fd = jdm_open(fshandlep, statp, oflags);
+	if (gcp->eg_fd < 0) {
 		return RV_ERROR;
 	}
 
@@ -4309,15 +4309,15 @@
 	 * after this check but before all reads have completed.
 	 * This change just closes the window a bit.
 	 */
-	if ( (statp->bs_mode & S_ISGID) && ( ! (statp->bs_mode&S_IXOTH) ) ) {
+	if ((statp->bs_mode & S_ISGID) && (! (statp->bs_mode&S_IXOTH))) {
 		fl.l_type = F_RDLCK;
 		fl.l_whence = SEEK_SET;
 		fl.l_start = (off_t)0;
 		fl.l_len = 0;
-		if ((fcntl(gcp->eg_fd, F_GETLK, &fl)) < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if ((fcntl(gcp->eg_fd, F_GETLK, &fl)) < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "locking check failed ino %llu\n"),
-			      statp->bs_ino );
+			      statp->bs_ino);
 			close(gcp->eg_fd);
 			return RV_ERROR;
 		}
@@ -4332,13 +4332,13 @@
 }
 
 static void
-cleanup_extent_group_context( extent_group_context_t *gcp )
+cleanup_extent_group_context(extent_group_context_t *gcp)
 {
-	( void )close( gcp->eg_fd );
+	(void)close(gcp->eg_fd);
 }
 
 static rv_t
-dump_extent_group( drive_t *drivep,
+dump_extent_group(drive_t *drivep,
 		   context_t *contextp,
 		   xfs_bstat_t *statp,
 		   extent_group_context_t *gcp,
@@ -4347,13 +4347,13 @@
 		   bool_t sosig,
 		   off64_t *nextoffsetp,
 		   off64_t *bytecntp,
-		   bool_t *cmpltflgp )
+		   bool_t *cmpltflgp)
 {
 	struct dioattr da;
 	drive_ops_t *dop = drivep->d_opsp;
-	bool_t isrealtime = ( bool_t )( statp->bs_xflags
+	bool_t isrealtime = (bool_t)(statp->bs_xflags
 					&
-					XFS_XFLAG_REALTIME );
+					XFS_XFLAG_REALTIME);
 	off64_t nextoffset;
 	off64_t bytecnt;	/* accumulates total bytes sent to media */
 	int rval;
@@ -4362,11 +4362,11 @@
 	/*
 	 * Setup realtime I/O size.
 	 */
-	if ( isrealtime ) {
-		if ( (ioctl(gcp->eg_fd, XFS_IOC_DIOINFO, &da) < 0) ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (isrealtime) {
+		if ((ioctl(gcp->eg_fd, XFS_IOC_DIOINFO, &da) < 0)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "dioinfo failed ino %llu\n"),
-			      statp->bs_ino );
+			      statp->bs_ino);
 			da.d_miniosz = PGSZ;
 		}
 	}
@@ -4375,17 +4375,17 @@
 	 */
 	nextoffset = *nextoffsetp;
 	bytecnt = 0;
-	assert( ( nextoffset & ( BBSIZE - 1 )) == 0 );
+	assert((nextoffset & (BBSIZE - 1)) == 0);
 
-	for ( ; ; ) {
+	for (; ;) {
 		off64_t offset;
 		off64_t extsz;
 
 		/* if we've dumped to the stop point return.
 		 */
-		if ( sosig && nextoffset >= stopoffset ) {
-			mlog( MLOG_NITTY,
-			      "dumped to stop offset\n" );
+		if (sosig && nextoffset >= stopoffset) {
+			mlog(MLOG_NITTY,
+			      "dumped to stop offset\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4394,9 +4394,9 @@
 
 		/* if we've dumped the entire file, return
 		 */
-		if ( nextoffset >= statp->bs_size ) {
-			mlog( MLOG_NITTY,
-			      "dumped to end of file\n" );
+		if (nextoffset >= statp->bs_size) {
+			mlog(MLOG_NITTY,
+			      "dumped to end of file\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4407,9 +4407,9 @@
 		 * call it quits. we'll be called back for more because the
 		 * completion flag is set FALSE.
 		 */
-		if ( bytecnt >= maxcnt ) {
-			mlog( MLOG_NITTY,
-			      "reached per-extent group byte count\n" );
+		if (bytecnt >= maxcnt) {
+			mlog(MLOG_NITTY,
+			      "reached per-extent group byte count\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_FALSE;
@@ -4419,21 +4419,21 @@
 		/* if we are not looking at a valid bmap entry,
 		 * get one.
 		 */
-		if ( gcp->eg_nextbmapp >= gcp->eg_endbmapp ) {
+		if (gcp->eg_nextbmapp >= gcp->eg_endbmapp) {
 			int entrycnt; /* entries in new bmap */
 
-			assert( gcp->eg_nextbmapp == gcp->eg_endbmapp );
+			assert(gcp->eg_nextbmapp == gcp->eg_endbmapp);
 
 			/* get a new extent block
 			 */
-			mlog( MLOG_NITTY,
+			mlog(MLOG_NITTY,
 			      "calling getbmapx for ino %llu\n",
-			      statp->bs_ino );
-			rval = ioctl( gcp->eg_fd, XFS_IOC_GETBMAPX, gcp->eg_bmap );
+			      statp->bs_ino);
+			rval = ioctl(gcp->eg_fd, XFS_IOC_GETBMAPX, gcp->eg_bmap);
 			gcp->eg_gbmcnt++;
-			entrycnt = gcp->eg_bmap[ 0 ].bmv_entries;
-			if ( entrycnt < 0 ) { /* workaround for getbmap bug */
-				mlog( MLOG_DEBUG | MLOG_WARNING, _(
+			entrycnt = gcp->eg_bmap[0].bmv_entries;
+			if (entrycnt < 0) { /* workaround for getbmap bug */
+				mlog(MLOG_DEBUG | MLOG_WARNING, _(
 				      "getbmapx %d ino %lld mode 0x%08x "
 				      "offset %lld ix %d "
 				      "returns negative entry count\n"),
@@ -4441,21 +4441,21 @@
 				      statp->bs_ino,
 				      statp->bs_mode,
 				      nextoffset,
-				      gcp->eg_bmapix );
+				      gcp->eg_bmapix);
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
 				return RV_OK;
 			}
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "getbmapx %d ino %lld mode 0x%08x "
 				      "offset %lld failed: %s\n"),
 				      gcp->eg_gbmcnt,
 				      statp->bs_ino,
 				      statp->bs_mode,
 				      nextoffset,
-				      strerror( errno ));
+				      strerror(errno));
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
@@ -4470,7 +4470,7 @@
 			if (hsm_fs_ctxtp) {
 				if (!HsmModifyExtentMap(contextp->cc_hsm_f_ctxtp,
 					&gcp->eg_bmap[0])) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 						"hsm detected an extent map "
 						"error in ino %lld, skipping\n"),
 						statp->bs_ino);
@@ -4479,74 +4479,74 @@
 					*cmpltflgp = BOOL_TRUE;
 					return RV_OK;
 				}
-				entrycnt = gcp->eg_bmap[ 0 ].bmv_entries;
+				entrycnt = gcp->eg_bmap[0].bmv_entries;
 			}
 
-			if ( entrycnt <= 0 ) {
-				mlog( MLOG_NITTY,
-				      "all extent groups dumped\n" );
+			if (entrycnt <= 0) {
+				mlog(MLOG_NITTY,
+				      "all extent groups dumped\n");
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
 				return RV_OK;
 			}
-			gcp->eg_nextbmapp = &gcp->eg_bmap[ 1 ];
-			gcp->eg_endbmapp = &gcp->eg_bmap[ entrycnt + 1 ];
-			mlog( MLOG_NITTY,
+			gcp->eg_nextbmapp = &gcp->eg_bmap[1];
+			gcp->eg_endbmapp = &gcp->eg_bmap[entrycnt + 1];
+			mlog(MLOG_NITTY,
 			      "getbmapx supplied %d extent entries\n",
-			      entrycnt );
+			      entrycnt);
 		}
 
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "bmap entry %d ix %d block %lld offset %lld length %lld\n",
-		      gcp->eg_nextbmapp - &gcp->eg_bmap[ 0 ],
+		      gcp->eg_nextbmapp - &gcp->eg_bmap[0],
 		      gcp->eg_bmapix,
 		      gcp->eg_nextbmapp->bmv_block,
 		      gcp->eg_nextbmapp->bmv_offset,
-		      gcp->eg_nextbmapp->bmv_length );
+		      gcp->eg_nextbmapp->bmv_length);
 
 		/* if the next bmap entry represents a hole, go to the next
 		 * one in the bmap, and rescan to check above assumptions.
 		 * bump nextoffset to after the hole, if beyond current value.
 		 */
-		if ( gcp->eg_nextbmapp->bmv_block == -1 ) {
+		if (gcp->eg_nextbmapp->bmv_block == -1) {
 			off64_t tmpoffset;
 
 			/* extract the offset and extent size from this
 			 * entry
 			 */
 			offset = gcp->eg_nextbmapp->bmv_offset
-					* ( off64_t )BBSIZE;
+					* (off64_t)BBSIZE;
 			extsz  = gcp->eg_nextbmapp->bmv_length
-					* ( off64_t )BBSIZE;
+					* (off64_t)BBSIZE;
 
-			mlog( MLOG_NITTY,
+			mlog(MLOG_NITTY,
 			      "hole extent offset = %lld size = %lld\n",
-			      offset, extsz );
+			      offset, extsz);
 
 			/* Encode the hole - dump the extent header
 			 * with the right extent type.
 			 */
-			rv = dump_extenthdr( drivep,
+			rv = dump_extenthdr(drivep,
 					     contextp,
 					     EXTENTHDR_TYPE_HOLE,
 					     0,
 					     offset,
-					     extsz );
-			if ( rv != RV_OK ) {
+					     extsz);
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE; /*moot since rv != OK */
 				return rv;
 			}
-			bytecnt += sizeof( extenthdr_t );
+			bytecnt += sizeof(extenthdr_t);
 
-			tmpoffset = ( gcp->eg_nextbmapp->bmv_offset
+			tmpoffset = (gcp->eg_nextbmapp->bmv_offset
 				      +
-				      gcp->eg_nextbmapp->bmv_length )
+				      gcp->eg_nextbmapp->bmv_length)
 				    *
-				    ( off64_t )BBSIZE;
-			if ( tmpoffset > nextoffset ) {
+				    (off64_t)BBSIZE;
+			if (tmpoffset > nextoffset) {
 				nextoffset = tmpoffset;
 			}
 			gcp->eg_nextbmapp++;
@@ -4557,15 +4557,15 @@
 		/* if the next bmap entry has a zero size, go to the next
 		 * one in the bmap, and rescan to check above assumptions.
 		 */
-		if ( gcp->eg_nextbmapp->bmv_length <= 0 ) {
+		if (gcp->eg_nextbmapp->bmv_length <= 0) {
 			off64_t tmpoffset;
 
-			mlog( MLOG_NITTY,
-			      "non-positive extent\n" );
+			mlog(MLOG_NITTY,
+			      "non-positive extent\n");
 			tmpoffset = gcp->eg_nextbmapp->bmv_offset
 				    *
-				    ( off64_t )BBSIZE;
-			if ( tmpoffset > nextoffset ) {
+				    (off64_t)BBSIZE;
+			if (tmpoffset > nextoffset) {
 				nextoffset = tmpoffset;
 			}
 			gcp->eg_nextbmapp++;
@@ -4576,22 +4576,22 @@
 		/* extract the offset and extent size from this
 		 * entry
 		 */
-		offset = gcp->eg_nextbmapp->bmv_offset * ( off64_t )BBSIZE;
-		extsz = gcp->eg_nextbmapp->bmv_length * ( off64_t )BBSIZE;
-		mlog( MLOG_NITTY,
+		offset = gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE;
+		extsz = gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE;
+		mlog(MLOG_NITTY,
 		      "extent offset %lld sz %lld; nextoffset %lld\n",
 		      offset,
 		      extsz,
-		      nextoffset );
+		      nextoffset);
 
 		/* if the new bmap entry begins below the stop offset
 		 * but does not contain any data above the current
 		 * offset, go to the next one and rescan.
 		 */
-		if ( ! sosig || offset < stopoffset ) {
-			if ( offset + extsz <= nextoffset ) {
-				mlog( MLOG_NITTY,
-				      "extent ends before nextoffset\n" );
+		if (! sosig || offset < stopoffset) {
+			if (offset + extsz <= nextoffset) {
+				mlog(MLOG_NITTY,
+				      "extent ends before nextoffset\n");
 				gcp->eg_nextbmapp++;
 				gcp->eg_bmapix++;
 				continue;
@@ -4601,9 +4601,9 @@
 		/* if the new bmap entry begins beyond the end of the file,
 		 * we are done.
 		 */
-		if ( offset >= statp->bs_size ) {
-			mlog( MLOG_NITTY,
-			      "extent beyond end of file\n" );
+		if (offset >= statp->bs_size) {
+			mlog(MLOG_NITTY,
+			      "extent beyond end of file\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4613,9 +4613,9 @@
 		/* if the new bmap entry begins at or above the stop offset,
 		 * stop. we are done.
 		 */
-		if ( sosig && offset >= stopoffset ) {
-			mlog( MLOG_NITTY,
-			      "extent beyond stop offset\n" );
+		if (sosig && offset >= stopoffset) {
+			mlog(MLOG_NITTY,
+			      "extent beyond stop offset\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4627,41 +4627,41 @@
 		 * beginning of the range of interest, and shorten
 		 * extsz accordingly.
 		 */
-		if ( offset < nextoffset ) {
+		if (offset < nextoffset) {
 			extsz -= nextoffset - offset;
 			offset = nextoffset;
-			mlog( MLOG_NITTY,
+			mlog(MLOG_NITTY,
 			      "adjusted bottom of extent to nextoffset: "
 			      "offset %lld, sz %lld; nextoffset %lld\n",
 			      offset,
 			      extsz,
-			      nextoffset );
+			      nextoffset);
 		}
-		assert( extsz > 0 );
+		assert(extsz > 0);
 
 		/* if the resultant extent would put us over maxcnt,
 		 * shorten it, and round up to the next BBSIZE (round
 		 * upto d_miniosz for realtime).
 		 */
-		if ( extsz > maxcnt - ( bytecnt + sizeof( extenthdr_t ))) {
+		if (extsz > maxcnt - (bytecnt + sizeof(extenthdr_t))) {
 			int iosz;
 
 			if (isrealtime)
 				iosz = da.d_miniosz;
 			else
 				iosz = BBSIZE;
-			extsz = maxcnt - ( bytecnt + sizeof( extenthdr_t ));
-			extsz = ( extsz + ( off64_t )( iosz - 1 ))
+			extsz = maxcnt - (bytecnt + sizeof(extenthdr_t));
+			extsz = (extsz + (off64_t)(iosz - 1))
 				&
-				~( off64_t )( iosz - 1 );
-			mlog( MLOG_NITTY,
+				~(off64_t)(iosz - 1);
+			mlog(MLOG_NITTY,
 			      "adjusted top of extent to honor maxcnt "
 			      "(rounded up %d): "
 			      "offset %lld, sz %lld; maxcnt %lld\n",
 			      iosz,
 			      offset,
 			      extsz,
-			      maxcnt );
+			      maxcnt);
 		}
 
 		/* if the shortened extent is too small, return; we'll
@@ -4669,15 +4669,15 @@
 		 * size is zero, indicate we are done.
 		 * !!! I don't believe this rule can ever fire!
 		 */
-		if ( extsz <= 0 ) {
-			mlog( MLOG_NITTY,
+		if (extsz <= 0) {
+			mlog(MLOG_NITTY,
 			      "adjusted extent size is non-positive: "
 			      "%lld (bs_size %lld)\n",
 			      extsz,
-			      statp->bs_size );
+			      statp->bs_size);
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
-			if ( statp->bs_size == 0 ) {
+			if (statp->bs_size == 0) {
 			    *cmpltflgp = BOOL_TRUE;
 			} else {
 			    *cmpltflgp = BOOL_FALSE;
@@ -4690,7 +4690,7 @@
 		 * at or beyond EOF.  (Shorten to d_miniosz for realtime
 		 * files).
 		 */
-		if ( extsz > statp->bs_size - offset ) {
+		if (extsz > statp->bs_size - offset) {
 			int iosz;
 
 			if (isrealtime)
@@ -4698,33 +4698,33 @@
 			else
 				iosz = BBSIZE;
 			extsz = statp->bs_size - offset;
-			extsz = ( extsz + ( off64_t )( iosz - 1 ))
+			extsz = (extsz + (off64_t)(iosz - 1))
 				&
-				~( off64_t )( iosz - 1 );
-			mlog( MLOG_NITTY,
+				~(off64_t)(iosz - 1);
+			mlog(MLOG_NITTY,
 			      "adjusted top of extent to match file size "
 			      "(rounded up %d): "
 			      "offset %lld, sz %lld; bs_size %lld\n",
 			      iosz,
 			      offset,
 			      extsz,
-			      statp->bs_size );
+			      statp->bs_size);
 		}
 
 		/* if the extent extends beyond the stop offset,
 		 * shorten it to the stop offset.
 		 */
-		if ( sosig && ( extsz > stopoffset - offset )) {
+		if (sosig && (extsz > stopoffset - offset)) {
 			extsz = stopoffset - offset;
-			assert( extsz >= 0 );
-			assert( ! ( extsz & ( off64_t )( BBSIZE - 1 )));
-			mlog( MLOG_NITTY,
+			assert(extsz >= 0);
+			assert(! (extsz & (off64_t)(BBSIZE - 1)));
+			mlog(MLOG_NITTY,
 			      "adjusted top of extent "
 			      "to adhere to stop offset: "
 			      "offset %lld, sz %lld; bs_size %lld\n",
 			      offset,
 			      extsz,
-			      statp->bs_size );
+			      statp->bs_size);
 		}
 
 		/* I/O performance is better if we align the media write
@@ -4732,131 +4732,131 @@
 		 * at least a page in length. Also, necessary for real time
 		 * files
 		 */
-		if ( isrealtime || extsz >= PGALIGNTHRESH * PGSZ ) {
+		if (isrealtime || extsz >= PGALIGNTHRESH * PGSZ) {
 			size_t cnt_to_align;
-			cnt_to_align = ( * dop->do_get_align_cnt )( drivep );
-			if ( ( size_t )cnt_to_align < 2*sizeof( extenthdr_t )) {
+			cnt_to_align = (* dop->do_get_align_cnt)(drivep);
+			if ((size_t)cnt_to_align < 2*sizeof(extenthdr_t)) {
 				cnt_to_align += PGSZ;
 			}
 
 			/* account for the DATA header following the alignment
 			 */
-			cnt_to_align -= sizeof( extenthdr_t );
+			cnt_to_align -= sizeof(extenthdr_t);
 
-			rv = dump_extenthdr( drivep,
+			rv = dump_extenthdr(drivep,
 					     contextp,
 					     EXTENTHDR_TYPE_ALIGN,
 					     0,
 					     0,
-					     ( off64_t )
-					     ( ( size_t )cnt_to_align
+					     (off64_t)
+					     ((size_t)cnt_to_align
 					       -
 					       sizeof(extenthdr_t)));
-			if ( rv != RV_OK ) {
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
 				return rv;
 			}
-			bytecnt += sizeof( extenthdr_t );
-			cnt_to_align -= sizeof( extenthdr_t );
-			rv = write_pad( drivep, cnt_to_align );
-			if ( rv != RV_OK ) {
+			bytecnt += sizeof(extenthdr_t);
+			cnt_to_align -= sizeof(extenthdr_t);
+			rv = write_pad(drivep, cnt_to_align);
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE; /* moot: rv != OK */
 				return rv;
 			}
-			bytecnt += ( off64_t )cnt_to_align;
+			bytecnt += (off64_t)cnt_to_align;
 		}
 		/* adjust the next offset
 		 */
-		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
-		assert( ( extsz & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
+		assert((extsz & (off64_t)(BBSIZE - 1)) == 0);
 		nextoffset = offset + extsz;
 
 		/* dump the extent header
 		 */
-		rv = dump_extenthdr( drivep,
+		rv = dump_extenthdr(drivep,
 				     contextp,
 				     EXTENTHDR_TYPE_DATA,
 				     0,
 				     offset,
-				     extsz );
-		if ( rv != RV_OK ) {
+				     extsz);
+		if (rv != RV_OK) {
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE; /* moot since rv != OK */
 			return rv;
 		}
-		bytecnt += sizeof( extenthdr_t );
+		bytecnt += sizeof(extenthdr_t);
 
 		/* dump the extent. if read fails to return all
 		 * asked for, pad out the extent with zeros. necessary
 		 * because the extent hdr is already out there!
 		 */
-		while ( extsz ) {
+		while (extsz) {
 			off64_t new_off;
 			int nread;
 			size_t reqsz;
 			size_t actualsz;
 			char *bufp;
 
-			reqsz = extsz > ( off64_t )INTGENMAX
+			reqsz = extsz > (off64_t)INTGENMAX
 				?
 				INTGENMAX
 				:
-				( size_t )extsz;
-			bufp = ( * dop->do_get_write_buf )( drivep,
+				(size_t)extsz;
+			bufp = (* dop->do_get_write_buf)(drivep,
 							    reqsz,
-							    &actualsz );
-			assert( actualsz <= reqsz );
-			new_off = lseek64( gcp->eg_fd, offset, SEEK_SET );
-			if ( new_off == ( off64_t )( -1 )) {
-				mlog( MLOG_NORMAL, _(
+							    &actualsz);
+			assert(actualsz <= reqsz);
+			new_off = lseek64(gcp->eg_fd, offset, SEEK_SET);
+			if (new_off == (off64_t)(-1)) {
+				mlog(MLOG_NORMAL, _(
 				      "can't lseek ino %llu\n"),
-				      statp->bs_ino );
+				      statp->bs_ino);
 				nread = 0;
 			} else {
-				nread = read( gcp->eg_fd, bufp, actualsz);
+				nread = read(gcp->eg_fd, bufp, actualsz);
 			}
-			if ( nread < 0 ) {
+			if (nread < 0) {
 #ifdef HIDDEN
 				struct statvfs64 s;
 
  				/* Be quiet if this is a swap file - #510197 */
-				if ( (fstatvfs64(gcp->eg_fd, &s) < 0 ) ||
-				     ((s.f_flag & ST_LOCAL) != 0) )
-				   mlog( MLOG_NORMAL, _(
+				if ((fstatvfs64(gcp->eg_fd, &s) < 0) ||
+				     ((s.f_flag & ST_LOCAL) != 0))
+				   mlog(MLOG_NORMAL, _(
 		"can't read ino %llu at offset %d (act=%d req=%d) rt=%d\n"),
-		statp->bs_ino, new_off, actualsz , reqsz, isrealtime );
+		statp->bs_ino, new_off, actualsz , reqsz, isrealtime);
 #endif /* HIDDEN */
 
 				nread = 0;
 			}
-			assert( ( size_t )nread <= actualsz );
-			mlog( MLOG_NITTY,
+			assert((size_t)nread <= actualsz);
+			mlog(MLOG_NITTY,
 			      "read ino %llu offset %lld sz %d actual %d\n",
 			      statp->bs_ino,
 			      offset,
 			      actualsz,
-			      nread );
+			      nread);
 
 			/* must return entire buffer supplied by call to
 			 * do_get_write_buf; so pad end with zeros. below
 			 * we assume the short read implies EOF, so will
 			 * then pad out remainder of extent as well.
 			 */
-			if ( ( size_t )nread < actualsz ) {
-				memset( ( void * )( bufp + nread ),
+			if ((size_t)nread < actualsz) {
+				memset((void *)(bufp + nread),
 					0,
-					actualsz - ( size_t )nread );
+					actualsz - (size_t)nread);
 			}
 
-			rval = ( * dop->do_write )( drivep,
+			rval = (* dop->do_write)(drivep,
 						    bufp,
-						    actualsz );
-			switch ( rval ) {
+						    actualsz);
+			switch (rval) {
 			case 0:
 				rv = RV_OK;
 				break;
@@ -4872,41 +4872,41 @@
 				rv = RV_CORE;
 				break;
 			}
-			if ( rv != RV_OK ) {
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE; /* moot: rv != OK */
 				return rv;
 			}
-			bytecnt += ( off64_t )actualsz;
-			extsz -= ( off64_t )actualsz;
-			offset += ( off64_t )actualsz;
+			bytecnt += (off64_t)actualsz;
+			extsz -= (off64_t)actualsz;
+			offset += (off64_t)actualsz;
 
 			/* if we got a short read, assume we are at the
 			 * end of the file; pad out the remainder of the
 			 * extent to match the header.
 			 */
-			if ( ( size_t )nread < actualsz ) {
-				mlog( MLOG_NITTY,
+			if ((size_t)nread < actualsz) {
+				mlog(MLOG_NITTY,
 				      "padding remaind %lld bytes of extent\n",
-				      extsz );
-				while ( extsz ) {
-					reqsz = extsz > ( off64_t )INTGENMAX
+				      extsz);
+				while (extsz) {
+					reqsz = extsz > (off64_t)INTGENMAX
 						?
 						INTGENMAX
 						:
-						( size_t )extsz;
-					rv = write_pad( drivep,
-							( size_t )reqsz );
-					if ( rv != RV_OK ) {
+						(size_t)extsz;
+					rv = write_pad(drivep,
+							(size_t)reqsz);
+					if (rv != RV_OK) {
 						*nextoffsetp = nextoffset;
 						*bytecntp = bytecnt;
 						*cmpltflgp = BOOL_TRUE;
 						return rv;
 					}
-					bytecnt += ( off64_t )reqsz;
-					extsz -= ( off64_t )reqsz;
-					offset += ( off64_t )reqsz;
+					bytecnt += (off64_t)reqsz;
+					extsz -= (off64_t)reqsz;
+					offset += (off64_t)reqsz;
 				}
 			}
 		}
@@ -4916,13 +4916,13 @@
 		 * !!! not be necessary, taken care of near the
 		 * !!! top of the loop.
 		 */
-		if ( nextoffset
+		if (nextoffset
 		     >=
-		     gcp->eg_nextbmapp->bmv_offset * ( off64_t )BBSIZE
+		     gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE
 		     +
-		     gcp->eg_nextbmapp->bmv_length * ( off64_t )BBSIZE ) {
-			mlog( MLOG_NITTY,
-			      "advancing to next extent in bmap\n" );
+		     gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE) {
+			mlog(MLOG_NITTY,
+			      "advancing to next extent in bmap\n");
 			gcp->eg_nextbmapp++;
 			gcp->eg_bmapix++;
 		}
@@ -4961,11 +4961,11 @@
 }
 
 static rv_t
-dump_filehdr( drive_t *drivep,
+dump_filehdr(drive_t *drivep,
 	      context_t *contextp,
 	      xfs_bstat_t *statp,
 	      off64_t offset,
-	      int flags )
+	      int flags)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register filehdr_t *fhdrp = contextp->cc_filehdrp;
@@ -4973,8 +4973,8 @@
 	int rval;
 	rv_t rv;
 
-	( void )memset( ( void * )fhdrp, 0, sizeof( *fhdrp ));
-	if ( statp ) {
+	(void)memset((void *)fhdrp, 0, sizeof(*fhdrp));
+	if (statp) {
 		if (hsm_fs_ctxtp) {
 			HsmModifyInode(contextp->cc_hsm_f_ctxtp, statp);
 		}
@@ -4982,16 +4982,16 @@
 	}
 	fhdrp->fh_offset = offset;
 	fhdrp->fh_flags = flags | FILEHDR_FLAGS_CHECKSUM;
-	fhdrp->fh_checksum = calc_checksum( fhdrp, FILEHDR_SZ );
+	fhdrp->fh_checksum = calc_checksum(fhdrp, FILEHDR_SZ);
 
 	xlate_filehdr(fhdrp, &tmpfhdrp, 1);
-	rval = write_buf( ( char * )&tmpfhdrp,
-			  sizeof( tmpfhdrp ),
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+	rval = write_buf((char *)&tmpfhdrp,
+			  sizeof(tmpfhdrp),
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5012,12 +5012,12 @@
 }
 
 static rv_t
-dump_extenthdr( drive_t *drivep,
+dump_extenthdr(drive_t *drivep,
 		context_t *contextp,
 		int32_t type,
 		int32_t flags,
 		off64_t offset,
-		off64_t sz )
+		off64_t sz)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register extenthdr_t *ehdrp = contextp->cc_extenthdrp;
@@ -5026,44 +5026,44 @@
 	rv_t rv;
 	char typestr[20];
 
-	switch( type )  {
+	switch(type)  {
 		case EXTENTHDR_TYPE_LAST:
-			strcpy( typestr, "LAST" );
+			strcpy(typestr, "LAST");
 			break;
 		case EXTENTHDR_TYPE_ALIGN:
-			strcpy( typestr, "ALIGN" );
+			strcpy(typestr, "ALIGN");
 			break;
 		case EXTENTHDR_TYPE_DATA:
-			strcpy( typestr, "DATA" );
+			strcpy(typestr, "DATA");
 			break;
 		case EXTENTHDR_TYPE_HOLE:
-			strcpy( typestr, "HOLE" );
+			strcpy(typestr, "HOLE");
 			break;
 		default:
-			strcpy( typestr, "UNKNOWN" );
+			strcpy(typestr, "UNKNOWN");
 	}
 
-	mlog( MLOG_DEBUG,
+	mlog(MLOG_DEBUG,
 	      "dumping extent type = %s offset = %lld size = %lld\n",
 	      typestr,
 	      offset,
-	       sz );
+	       sz);
 
-	( void )memset( ( void * )ehdrp, 0, sizeof( *ehdrp ));
+	(void)memset((void *)ehdrp, 0, sizeof(*ehdrp));
 	ehdrp->eh_type = type;
 	ehdrp->eh_flags = flags | EXTENTHDR_FLAGS_CHECKSUM;
 	ehdrp->eh_offset = offset;
 	ehdrp->eh_sz = sz;
-	ehdrp->eh_checksum = calc_checksum( ehdrp, EXTENTHDR_SZ );
+	ehdrp->eh_checksum = calc_checksum(ehdrp, EXTENTHDR_SZ);
 
 	xlate_extenthdr(ehdrp, &tmpehdrp, 1);
-	rval = write_buf( ( char * )&tmpehdrp,
-			  sizeof( tmpehdrp ),
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+	rval = write_buf((char *)&tmpehdrp,
+			  sizeof(tmpehdrp),
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5084,13 +5084,13 @@
 }
 
 static rv_t
-dump_dirent( drive_t *drivep,
+dump_dirent(drive_t *drivep,
 	     context_t *contextp,
 	     xfs_bstat_t *statp,
 	     xfs_ino_t ino,
 	     gen_t gen,
 	     char *name,
-	     size_t namelen )
+	     size_t namelen)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	char *outbufp;
@@ -5100,10 +5100,10 @@
 	int rval;
 	rv_t rv;
 
-	if ( sc_use_old_direntpr ) {
-		name_offset = offsetofmember( direnthdr_v1_t, dh_name );
+	if (sc_use_old_direntpr) {
+		name_offset = offsetofmember(direnthdr_v1_t, dh_name);
 	} else {
-		name_offset = offsetofmember( direnthdr_t, dh_name );
+		name_offset = offsetofmember(direnthdr_t, dh_name);
 	}
 
 	sz = name_offset
@@ -5111,72 +5111,72 @@
 	     namelen
 	     +
 	     1;
-	sz = ( sz + DIRENTHDR_ALIGN - 1 )
+	sz = (sz + DIRENTHDR_ALIGN - 1)
 	     &
-	     ~( DIRENTHDR_ALIGN - 1 );
+	     ~(DIRENTHDR_ALIGN - 1);
 
-	if ( sz > direntbufsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (sz > direntbufsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "unable to dump "
 		      "directory %llu entry %s (%llu): "
 		      "name too long\n"),
 		      statp->bs_ino,
 		      name,
-		      ino );
+		      ino);
 		mlog_exit_hint(RV_INCOMPLETE);
 		return RV_OK;
 	}
 
-	assert( sz <= UINT16MAX );
-	assert( sz >= DIRENTHDR_SZ );
+	assert(sz <= UINT16MAX);
+	assert(sz >= DIRENTHDR_SZ);
 
 	outbufp = malloc(sz);
 
-	if ( sc_use_old_direntpr ) {
-		direnthdr_v1_t *dhdrp = ( direnthdr_v1_t * )contextp->cc_mdirentbufp;
-		direnthdr_v1_t *tmpdhdrp = ( direnthdr_v1_t * )outbufp;
+	if (sc_use_old_direntpr) {
+		direnthdr_v1_t *dhdrp = (direnthdr_v1_t *)contextp->cc_mdirentbufp;
+		direnthdr_v1_t *tmpdhdrp = (direnthdr_v1_t *)outbufp;
 
-		memset( ( void * )dhdrp, 0, sz );
+		memset((void *)dhdrp, 0, sz);
 		dhdrp->dh_ino = ino;
-		dhdrp->dh_sz = ( uint16_t )sz;
-		dhdrp->dh_gen = ( uint16_t )( gen & DENTGENMASK );
-		if ( name ) {
-			strcpy( dhdrp->dh_name, name );
+		dhdrp->dh_sz = (uint16_t)sz;
+		dhdrp->dh_gen = (uint16_t)(gen & DENTGENMASK);
+		if (name) {
+			strcpy(dhdrp->dh_name, name);
 		}
 
-		dhdrp->dh_checksum = calc_checksum( dhdrp, DIRENTHDR_SZ );
+		dhdrp->dh_checksum = calc_checksum(dhdrp, DIRENTHDR_SZ);
 
-		xlate_direnthdr_v1( dhdrp, tmpdhdrp, 1 );
-		if ( name ) {
-			strcpy( tmpdhdrp->dh_name, name );
+		xlate_direnthdr_v1(dhdrp, tmpdhdrp, 1);
+		if (name) {
+			strcpy(tmpdhdrp->dh_name, name);
 		}
 	} else {
-		direnthdr_t *dhdrp = ( direnthdr_t * )contextp->cc_mdirentbufp;
-		direnthdr_t *tmpdhdrp = ( direnthdr_t * )outbufp;
+		direnthdr_t *dhdrp = (direnthdr_t *)contextp->cc_mdirentbufp;
+		direnthdr_t *tmpdhdrp = (direnthdr_t *)outbufp;
 
-		memset( ( void * )dhdrp, 0, sz );
+		memset((void *)dhdrp, 0, sz);
 		dhdrp->dh_ino = ino;
 		dhdrp->dh_gen = gen;
-		dhdrp->dh_sz = ( uint16_t )sz;
-		if ( name ) {
-			strcpy( dhdrp->dh_name, name );
+		dhdrp->dh_sz = (uint16_t)sz;
+		if (name) {
+			strcpy(dhdrp->dh_name, name);
 		}
 
-		dhdrp->dh_checksum = calc_checksum( dhdrp, DIRENTHDR_SZ );
+		dhdrp->dh_checksum = calc_checksum(dhdrp, DIRENTHDR_SZ);
 
-		xlate_direnthdr( dhdrp, tmpdhdrp, 1 );
-		if ( name ) {
-			strcpy( tmpdhdrp->dh_name, name );
+		xlate_direnthdr(dhdrp, tmpdhdrp, 1);
+		if (name) {
+			strcpy(tmpdhdrp->dh_name, name);
 		}
 	}
 
-	rval = write_buf( outbufp,
+	rval = write_buf(outbufp,
 			  sz,
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 	free(outbufp);
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5197,10 +5197,10 @@
 }
 
 static bool_t
-dump_session_inv( drive_t *drivep,
+dump_session_inv(drive_t *drivep,
 		  context_t *contextp,
 		  media_hdr_t *mwhdrp,
-		  content_inode_hdr_t *scwhdrp )
+		  content_inode_hdr_t *scwhdrp)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	ix_t strmix = drivep->d_index;
@@ -5213,24 +5213,24 @@
 
 	/* if the inventory session token is null, skip
 	 */
-	if ( sc_inv_sestoken == INV_TOKEN_NULL ) {
+	if (sc_inv_sestoken == INV_TOKEN_NULL) {
 		return BOOL_TRUE;
 	}
 
-	mlog( MLOG_VERBOSE, _(
-	      "dumping session inventory\n") );
+	mlog(MLOG_VERBOSE, _(
+	      "dumping session inventory\n"));
 
 	/* get a buffer from the inventory manager
 	 */
 	inv_sbufp = 0;
 	inv_sbufsz = 0;
-	ok = inv_get_sessioninfo( sc_inv_sestoken, ( void * )&inv_sbufp, &inv_sbufsz );
-	if ( ! ok ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
-		      "unable to get session inventory to dump\n") );
+	ok = inv_get_sessioninfo(sc_inv_sestoken, (void *)&inv_sbufp, &inv_sbufsz);
+	if (! ok) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
+		      "unable to get session inventory to dump\n"));
 		return BOOL_TRUE;
 	}
-	assert( inv_sbufp );
+	assert(inv_sbufp);
 
 	/* modify the write header to indicate the media file type.
 	 */
@@ -5240,32 +5240,32 @@
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
-	for ( done = BOOL_FALSE ; ! done ; ) {
+	for (done = BOOL_FALSE ; ! done ;) {
 		uuid_t mediaid;
-		char medialabel[ GLOBAL_HDR_STRING_SZ ];
+		char medialabel[GLOBAL_HDR_STRING_SZ];
 		bool_t partial;
 		int mediafileix;
 		int rval;
 		rv_t rv;
 
-		mlog( MLOG_VERBOSE, _(
-		      "beginning inventory media file\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "beginning inventory media file\n"));
 
 		partial = BOOL_FALSE;
-		rv = Media_mfile_begin( drivep, contextp, BOOL_FALSE );
-		switch( rv ) {
+		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_TIMEOUT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change timeout: "
-			      "session inventory not dumped\n") );
+			      "session inventory not dumped\n"));
 			mlog_exit_hint(RV_INV);
 			return BOOL_FALSE;
 		case RV_QUIT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change declined: "
-			      "session inventory not dumped\n") );
+			      "session inventory not dumped\n"));
 			mlog_exit_hint(RV_INV);
 			return BOOL_FALSE;
 		case RV_DRIVE:
@@ -5275,22 +5275,22 @@
 			return BOOL_FALSE;
 		}
 
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "media file %u (media %u, file %u)\n"),
 		      mwhdrp->mh_dumpfileix,
 		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix );
+		      mwhdrp->mh_mediafileix);
 
 		uuid_copy(mediaid, mwhdrp->mh_mediaid);
-		strcpy( medialabel, mwhdrp->mh_medialabel );
-		mediafileix = ( int )mwhdrp->mh_mediafileix;
+		strcpy(medialabel, mwhdrp->mh_medialabel);
+		mediafileix = (int)mwhdrp->mh_mediafileix;
 
-		rval = write_buf( inv_sbufp,
+		rval = write_buf(inv_sbufp,
 				  inv_sbufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )dop->do_get_write_buf,
-				  ( wfp_t )dop->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)dop->do_get_write_buf,
+				  (wfp_t)dop->do_write);
+		switch (rval) {
 		case 0:
 			break;
 		case DRIVE_ERROR_MEDIA:
@@ -5303,15 +5303,15 @@
 			return BOOL_FALSE;
 		}
 
-		mlog( MLOG_VERBOSE, _(
-		      "ending inventory media file\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "ending inventory media file\n"));
 		ncommitted = 0;
-		rv = Media_mfile_end( drivep,
+		rv = Media_mfile_end(drivep,
 				      contextp,
 				      mwhdrp,
 				      &ncommitted,
-				      partial );
-		switch( rv ) {
+				      partial);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_EOM:
@@ -5321,42 +5321,42 @@
 			return BOOL_FALSE;
 		}
 
-		if ( partial ) {
-			mlog( MLOG_VERBOSE, _(
+		if (partial) {
+			mlog(MLOG_VERBOSE, _(
 			      "encountered EOM while writing "
 			      "inventory media file size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 			mlog_exit_hint(RV_INV);
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "inventory media file size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 		}
-		if ( sc_inv_stmtokenp ) {
-			inv_stmt = sc_inv_stmtokenp[ strmix ];
+		if (sc_inv_stmtokenp) {
+			inv_stmt = sc_inv_stmtokenp[strmix];
 		} else {
 			inv_stmt = INV_TOKEN_NULL;
 		}
 
-		if ( inv_stmt != INV_TOKEN_NULL ) {
-			mlog( MLOG_DEBUG,
+		if (inv_stmt != INV_TOKEN_NULL) {
+			mlog(MLOG_DEBUG,
 			      "giving inventory "
-			      "session dump media file\n" );
-			ok = inv_put_mediafile( inv_stmt,
+			      "session dump media file\n");
+			ok = inv_put_mediafile(inv_stmt,
 						&mediaid,
 						medialabel,
-						( uint )mediafileix,
-						(xfs_ino_t )0,
-						( off64_t )0,
-						(xfs_ino_t )0,
-						( off64_t )0,
+						(uint)mediafileix,
+						(xfs_ino_t)0,
+						(off64_t)0,
+						(xfs_ino_t)0,
+						(off64_t)0,
 						ncommitted,
 						! partial,
-						BOOL_TRUE );
-			if ( ! ok ) {
-				mlog( MLOG_NORMAL, _(
+						BOOL_TRUE);
+			if (! ok) {
+				mlog(MLOG_NORMAL, _(
 				      "inventory session media file "
-				      "put failed\n") );
+				      "put failed\n"));
 				return BOOL_FALSE;
 			}
 		}
@@ -5368,49 +5368,49 @@
 }
 
 static void
-dump_terminator( drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp )
+dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 {
 	off64_t ncommitted;
 	bool_t done;
 
 	/* if the drive doesn't support use of stream terminators, don't bother
 	 */
-	if ( ! contextp->cc_Media_useterminatorpr ) {
+	if (! contextp->cc_Media_useterminatorpr) {
 		return;
 	}
 
-	mlog( MLOG_VERBOSE, _(
-	      "writing stream terminator\n") );
+	mlog(MLOG_VERBOSE, _(
+	      "writing stream terminator\n"));
 
 	/* modify the write header to indicate a terminator
 	 */
-	MEDIA_TERMINATOR_SET( mwhdrp );
+	MEDIA_TERMINATOR_SET(mwhdrp);
 
 	/* loop attempting to write a complete media file header
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
-	for ( done = BOOL_FALSE ; ! done ; ) {
+	for (done = BOOL_FALSE ; ! done ;) {
 		bool_t partial;
 		rv_t rv;
 
-		mlog( MLOG_VERBOSE, _(
-		      "beginning media stream terminator\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "beginning media stream terminator\n"));
 
 		partial = BOOL_FALSE;
-		rv = Media_mfile_begin( drivep, contextp, BOOL_FALSE );
-		switch( rv ) {
+		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_TIMEOUT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change timeout: "
-			      "media stream terminator not written\n") );
+			      "media stream terminator not written\n"));
 			return;
 		case RV_QUIT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change declined: "
-			      "media stream terminator not written\n") );
+			      "media stream terminator not written\n"));
 			return;
 		case RV_DRIVE:
 		case RV_ERROR:
@@ -5419,21 +5419,21 @@
 			return;
 		}
 
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "media file %u (media %u, file %u)\n"),
 		      mwhdrp->mh_dumpfileix,
 		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix );
+		      mwhdrp->mh_mediafileix);
 
-		mlog( MLOG_VERBOSE, _(
-		      "ending media stream terminator\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "ending media stream terminator\n"));
 		ncommitted = 0;
-		rv = Media_mfile_end( drivep,
+		rv = Media_mfile_end(drivep,
 				      contextp,
 				      mwhdrp,
 				      &ncommitted,
-				      BOOL_FALSE );
-		switch( rv ) {
+				      BOOL_FALSE);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_EOM:
@@ -5443,15 +5443,15 @@
 			return;
 		}
 
-		if ( partial ) {
-			mlog( MLOG_VERBOSE, _(
+		if (partial) {
+			mlog(MLOG_VERBOSE, _(
 			      "encountered EOM while writing "
 			      "media stream terminator size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "media stream terminator size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 		}
 
 		done = ! partial;
@@ -5459,19 +5459,19 @@
 }
 
 static rv_t
-write_pad( drive_t *drivep, size_t sz )
+write_pad(drive_t *drivep, size_t sz)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int rval;
 	rv_t rv;
 
-	rval = write_buf( 0,
+	rval = write_buf(0,
 			  sz,
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5492,16 +5492,16 @@
 }
 
 static void
-inv_cleanup( void )
+inv_cleanup(void)
 {
 	/* REFERENCED */
 	bool_t ok;
 
-	if ( sc_inv_stmtokenp && sc_contextp ) {
+	if (sc_inv_stmtokenp && sc_contextp) {
 		size_t strmix;
 		inv_stmtoken_t *inv_stmtp;
 		context_t *contextp;
-		for ( strmix = 0,
+		for (strmix = 0,
 		      inv_stmtp = sc_inv_stmtokenp,
 		      contextp = sc_contextp
 		      ;
@@ -5509,30 +5509,30 @@
 		      ;
 		      strmix++,
 		      inv_stmtp++,
-		      contextp++ ) {
+		      contextp++) {
 			bool_t interrupted;
 			interrupted = ! contextp->cc_completepr;
-			if ( *inv_stmtp == INV_TOKEN_NULL ) {
+			if (*inv_stmtp == INV_TOKEN_NULL) {
 				continue;
 			}
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "closing inventory stream %d%s\n",
 			      strmix,
-			      interrupted ? ": interrupted" : "" );
+			      interrupted ? ": interrupted" : "");
 			if (interrupted) mlog_exit_hint(RV_INTR);
-			ok = inv_stream_close( *inv_stmtp, interrupted );
-			assert( ok );
+			ok = inv_stream_close(*inv_stmtp, interrupted);
+			assert(ok);
 		}
 	}
 
-	if ( sc_inv_sestoken != INV_TOKEN_NULL ) {
-		ok = inv_writesession_close( sc_inv_sestoken );
-		assert( ok );
+	if (sc_inv_sestoken != INV_TOKEN_NULL) {
+		ok = inv_writesession_close(sc_inv_sestoken);
+		assert(ok);
 	}
 
-	if ( sc_inv_idbtoken != INV_TOKEN_NULL ) {
-		ok = inv_close( sc_inv_idbtoken );
-		assert( ok );
+	if (sc_inv_idbtoken != INV_TOKEN_NULL) {
+		ok = inv_close(sc_inv_idbtoken);
+		assert(ok);
 	}
 }
 
@@ -5546,15 +5546,15 @@
  * of automatic variables.
  */
 static rv_t
-Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
+Media_mfile_begin(drive_t *drivep, context_t *contextp, bool_t intr_allowed)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int dcaps = drivep->d_capabilities;
 	global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 	drive_hdr_t *drhdrp = drivep->d_readhdrp;
-	media_hdr_t *mrhdrp = ( media_hdr_t * )drhdrp->dh_upper;
+	media_hdr_t *mrhdrp = (media_hdr_t *)drhdrp->dh_upper;
 	char *cmdlinemedialabel;
 	bool_t virginmediapr;
 	bool_t mediapresentpr;
@@ -5566,10 +5566,10 @@
 
 	/* sanity checks
 	 */
-	assert( BES_INIT == 0 );
+	assert(BES_INIT == 0);
 
-	mlog( MLOG_DEBUG | MLOG_MEDIA,
-	      "Media op: begin media file\n" );
+	mlog(MLOG_DEBUG | MLOG_MEDIA,
+	      "Media op: begin media file\n");
 
 	/* the command line-specified media label is good only for the
 	 * first media object written to. after that, the operator will
@@ -5587,12 +5587,12 @@
 		bes_t entrystate;
 		entrystate = contextp->cc_Media_begin_entrystate;
 		contextp->cc_Media_begin_entrystate = BES_INVAL;
-		switch ( entrystate ) {
+		switch (entrystate) {
 		case BES_INIT:
 			mediawrittentopr = BOOL_FALSE;
-			mwhdrp->mh_mediaix = ( uint32_t )( -1 );
-			mwhdrp->mh_dumpfileix = ( uint32_t )( -1 );
-			if ( dcaps & DRIVE_CAP_READ ) {
+			mwhdrp->mh_mediaix = (uint32_t)(-1);
+			mwhdrp->mh_dumpfileix = (uint32_t)(-1);
+			if (dcaps & DRIVE_CAP_READ) {
 				mediapresentpr = BOOL_UNKNOWN;
 				virginmediapr = BOOL_UNKNOWN;
 				goto position;
@@ -5612,7 +5612,7 @@
 			mediawrittentopr = BOOL_TRUE;
 			goto changemedia;
 		default:
-			assert( 0 );
+			assert(0);
 			return RV_CORE;
 		}
 	}
@@ -5626,40 +5626,40 @@
 	 * be concatenated but not jumbled. a dump stream must be virtually
 	 * contiguous.
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		/* check if a stop has been requested
 		 */
-		if ( intr_allowed && cldmgr_stop_requested( )) {
+		if (intr_allowed && cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
 		/* do a begin_read to see the disposition of the drive/media.
 		 */
-		rval = ( * dop->do_begin_read )( drivep );
+		rval = (* dop->do_begin_read)(drivep);
 
 		/* update cc_Media_useterminatorpr after every begin_read,
 		 * since begin_read will cause some unknown drive params
 		 * to be resolved.
 		 */
-		update_cc_Media_useterminatorpr( drivep, contextp );
+		update_cc_Media_useterminatorpr(drivep, contextp);
 
-		switch( rval ) {
+		switch(rval) {
 		case 0:
-			mlog_lock( );
-			mlog( MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
+			mlog_lock();
+			mlog(MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
 			      "positioned at media file %u: "
 			      "dump %u, "
 			      "stream %u\n"),
 			      mrhdrp->mh_mediafileix,
 			      mrhdrp->mh_dumpmediaix,
-			      drhdrp->dh_driveix );
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			      drhdrp->dh_driveix);
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "stream media file %u (%u in object), "
 			      "stream media object %d\n",
 			      mrhdrp->mh_dumpfileix,
 			      mrhdrp->mh_dumpmediafileix,
-			      mrhdrp->mh_mediaix );
-			mlog_unlock( );
+			      mrhdrp->mh_mediaix);
+			mlog_unlock();
 
 			/* successfully read media file header.
 			 * we know media must be present in drive, and
@@ -5679,12 +5679,12 @@
 			 * media object a virgin.
 			 * also, check for erase option.
 			 */
-			( * dop->do_end_read )( drivep );
+			(* dop->do_end_read)(drivep);
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5693,34 +5693,34 @@
 				break;
 			}
 
-			if ( ( int32_t )mwhdrp->mh_mediaix >= 0 ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			if ((int32_t)mwhdrp->mh_mediaix >= 0) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "cannot interleave dump streams: "
-				      "must supply a blank media object\n") );
+				      "must supply a blank media object\n"));
 				goto changemedia;
 			}
-			if ( ! ( dcaps & DRIVE_CAP_APPEND )) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+			if (! (dcaps & DRIVE_CAP_APPEND)) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 				      "media contains valid xfsdump "
-				      "but does not support append\n") );
+				      "but does not support append\n"));
 				goto changemedia;
 			}
-			if ( MEDIA_TERMINATOR_CHK( mrhdrp )) {
+			if (MEDIA_TERMINATOR_CHK(mrhdrp)) {
 				int status;
-				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-				      "stream terminator found\n") );
-				assert( contextp->cc_Media_useterminatorpr );
-				assert( dcaps & DRIVE_CAP_BSF ); /* redundant */
+				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+				      "stream terminator found\n"));
+				assert(contextp->cc_Media_useterminatorpr);
+				assert(dcaps & DRIVE_CAP_BSF); /* redundant */
 				status = 0;
-				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				assert( rval == 0 );
-				if ( status == DRIVE_ERROR_DEVICE ) {
-					mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+				rval = (* dop->do_bsf)(drivep, 0, &status);
+				assert(rval == 0);
+				if (status == DRIVE_ERROR_DEVICE) {
+					mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 					      "encountered media error "
-					      "attempting BSF\n") );
+					      "attempting BSF\n"));
 					goto changemedia;
 				}
-				if ( mrhdrp->mh_mediafileix == 0 ) {
+				if (mrhdrp->mh_mediafileix == 0) {
 					virginmediapr = BOOL_TRUE;
 				}
 				goto write;
@@ -5729,16 +5729,16 @@
 		case DRIVE_ERROR_FOREIGN:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "media contains non-xfsdump data "
 			      "or a corrupt xfsdump media file header "
-			      "at beginning of media\n") );
+			      "at beginning of media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5747,30 +5747,30 @@
 				break;
 			}
 
-			if ( dlog_allowed( )) {
+			if (dlog_allowed()) {
 				bool_t ok;
-				ok = Media_prompt_overwrite( drivep );
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+				ok = Media_prompt_overwrite(drivep);
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
-				if ( ! ok ) {
+				if (! ok) {
 					goto changemedia;
 				}
 			}
 
-			if ( ! ( dcaps & DRIVE_CAP_OVERWRITE )) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "unable to overwrite\n") );
+			if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+				      "unable to overwrite\n"));
 				goto changemedia;
 			} else {
 				int status;
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "repositioning to overwrite\n") );
-				assert( dcaps & DRIVE_CAP_BSF );
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+				      "repositioning to overwrite\n"));
+				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
-				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				assert( rval == 0 );
-				if ( status == DRIVE_ERROR_DEVICE ) {
+				rval = (* dop->do_bsf)(drivep, 0, &status);
+				assert(rval == 0);
+				if (status == DRIVE_ERROR_DEVICE) {
 					return RV_DRIVE;
 				}
 
@@ -5782,17 +5782,17 @@
 		case DRIVE_ERROR_OVERWRITE:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				"media may contain data. "
-				"Overwrite option specified\n") );
+				"Overwrite option specified\n"));
 
-			if ( dlog_allowed( )) {
+			if (dlog_allowed()) {
 				bool_t ok;
-				ok = Media_prompt_overwrite( drivep );
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+				ok = Media_prompt_overwrite(drivep);
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
-				if ( ! ok ) {
+				if (! ok) {
 					goto changemedia;
 				}
 			}
@@ -5810,16 +5810,16 @@
 		case DRIVE_ERROR_DEVICE:
 			return RV_DRIVE;
 		case DRIVE_ERROR_EOD:
-			mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-			      "at end of data\n") );
+			mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+			      "at end of data\n"));
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5828,11 +5828,11 @@
 				break;
 			}
 
-			if ( contextp->cc_Media_useterminatorpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			if (contextp->cc_Media_useterminatorpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered EOD but expecting a media "
 				      "stream terminator: "
-				      "assuming full media\n") );
+				      "assuming full media\n"));
 				goto changemedia;
 			} else {
 				goto write;
@@ -5841,13 +5841,13 @@
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-			      "encountered EOM: media is full\n") );
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			      "encountered EOM: media is full\n"));
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5864,15 +5864,15 @@
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "encountered corrupt or foreign data: "
-			      "assuming corrupted media\n") );
+			      "assuming corrupted media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5881,32 +5881,32 @@
 				break;
 			}
 
-			if ( contextp->cc_Media_useterminatorpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			if (contextp->cc_Media_useterminatorpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data "
 				      "but expecting a media "
 				      "stream terminator: "
-				      "assuming corrupted media\n") );
+				      "assuming corrupted media\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
-			} else if ( ! ( dcaps & DRIVE_CAP_OVERWRITE )) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			} else if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data: "
 				      "unable to overwrite: "
-				      "assuming corrupted media\n") );
+				      "assuming corrupted media\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
 			} else {
 				int status;
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data: "
-				      "repositioning to overwrite\n") );
+				      "repositioning to overwrite\n"));
 				mlog_exit_hint(RV_CORRUPT);
-				assert( dcaps & DRIVE_CAP_BSF );
+				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
-				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				assert( rval == 0 );
-				if ( status == DRIVE_ERROR_DEVICE ) {
+				rval = (* dop->do_bsf)(drivep, 0, &status);
+				assert(rval == 0);
+				if (status == DRIVE_ERROR_DEVICE) {
 					return RV_DRIVE;
 				}
 				goto write;
@@ -5917,19 +5917,19 @@
 			return RV_ERROR;
 		case DRIVE_ERROR_EOF:
 		default:
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 			      "unexpected error from do_begin_read: %d\n"),
-			      rval );
+			      rval);
 			return RV_CORE;
 		}
 	}
 	/* NOTREACHED */
 
 erasemedia:
-	mlog( MLOG_VERBOSE | MLOG_WARNING | MLOG_MEDIA, _(
-	      "erasing media\n") );
-	rval = ( * dop->do_erase )( drivep );
-	if ( rval ) {
+	mlog(MLOG_VERBOSE | MLOG_WARNING | MLOG_MEDIA, _(
+	      "erasing media\n"));
+	rval = (* dop->do_erase)(drivep);
+	if (rval) {
 		return RV_DRIVE;
 	}
 	prevmediapresentpr = mediapresentpr;
@@ -5941,17 +5941,17 @@
 changemedia:
 	/* if the drive does not support media change, quit.
 	 */
-	if ( ! ( dcaps & DRIVE_CAP_REMOVABLE )) {
+	if (! (dcaps & DRIVE_CAP_REMOVABLE)) {
 		return RV_ERROR;
 	}
 
 	/* first eject the current media object if capability supported
 	 */
-	assert( mediapresentpr != BOOL_UNKNOWN );
-	if ( mediapresentpr == BOOL_TRUE ) {
-		if ( dcaps & DRIVE_CAP_EJECT ) {
-			rval = ( * dop->do_eject_media )( drivep );
-			if ( rval ) {
+	assert(mediapresentpr != BOOL_UNKNOWN);
+	if (mediapresentpr == BOOL_TRUE) {
+		if (dcaps & DRIVE_CAP_EJECT) {
+			rval = (* dop->do_eject_media)(drivep);
+			if (rval) {
 				return RV_DRIVE;
 			}
 		}
@@ -5959,7 +5959,7 @@
 
 	/* if dialogs not allowed, we are done.
 	 */
-	if ( ! dlog_allowed( )) {
+	if (! dlog_allowed()) {
 		return RV_QUIT; /* this return value will cause approp. msg */
 	}
 
@@ -5971,29 +5971,29 @@
 	/* if media change prompt declined or times out,
 	 * we are done
 	 */
-	if ( drivecnt > 1 && ! stdoutpiped ) {
+	if (drivecnt > 1 && ! stdoutpiped) {
 		ix_t thrdix = drivep->d_index;
-		assert( sistr );
-		mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
+		assert(sistr);
+		mlog(MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
 		      "please change media: "
 		      "type %s to confirm media change\n"),
-		      sistr );
-		set_mcflag( thrdix );
-		while ( sc_mcflag[ thrdix ] ) {
-			sleep( 2 );
-			if ( cldmgr_stop_requested( )) {
-				clr_mcflag( thrdix );
+		      sistr);
+		set_mcflag(thrdix);
+		while (sc_mcflag[thrdix]) {
+			sleep(2);
+			if (cldmgr_stop_requested()) {
+				clr_mcflag(thrdix);
 				return RV_INTR;
 			}
 		}
 		ok = BOOL_TRUE;
 	} else {
-		ok = Media_prompt_change( drivep );
+		ok = Media_prompt_change(drivep);
 	}
-	if ( intr_allowed && cldmgr_stop_requested( )) {
+	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
-	if ( ! ok ) {
+	if (! ok) {
 		return RV_QUIT;
 	}
 
@@ -6007,10 +6007,10 @@
 	goto position;
 
 write:
-	assert( mediapresentpr == BOOL_TRUE );
-	assert( virginmediapr != BOOL_UNKNOWN );
+	assert(mediapresentpr == BOOL_TRUE);
+	assert(virginmediapr != BOOL_UNKNOWN);
 
-	if ( intr_allowed && cldmgr_stop_requested( )) {
+	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
 
@@ -6021,104 +6021,104 @@
 	 */
 	saved_gwhdr = *gwhdrp;
 
-	if ( mediawrittentopr ) {
+	if (mediawrittentopr) {
 		mwhdrp->mh_dumpmediafileix++;
 	} else {
 		mwhdrp->mh_dumpmediafileix = 0;
 	}
 	mwhdrp->mh_dumpfileix++; /* pre-initialized to -1 */
-	if ( virginmediapr ) {
+	if (virginmediapr) {
 		mwhdrp->mh_mediafileix = 0;
 		mwhdrp->mh_dumpmediaix = 0;
 	} else {
-		if ( mwhdrp->mh_dumpmediafileix == 0 ) {
+		if (mwhdrp->mh_dumpmediafileix == 0) {
 			mwhdrp->mh_dumpmediaix = mrhdrp->mh_dumpmediaix + 1;
 		}
-		if ( mediawrittentopr ) {
+		if (mediawrittentopr) {
 			mwhdrp->mh_mediafileix++;
 		} else {
 			mwhdrp->mh_mediafileix = mrhdrp->mh_mediafileix;
-			if ( ! MEDIA_TERMINATOR_CHK( mrhdrp )) {
+			if (! MEDIA_TERMINATOR_CHK(mrhdrp)) {
 				mwhdrp->mh_mediafileix++;
 			}
 		}
 	}
 
-	if ( ! mediawrittentopr ) {
+	if (! mediawrittentopr) {
 		mwhdrp->mh_mediaix++; /* pre-initialized to -1 */
 	}
 
-	assert( mwhdrp->mh_mediaix != ( uint32_t )( -1 ));
-	assert( mwhdrp->mh_dumpfileix != ( uint32_t )( -1 ));
+	assert(mwhdrp->mh_mediaix != (uint32_t)(-1));
+	assert(mwhdrp->mh_dumpfileix != (uint32_t)(-1));
 
 	/* do not allow interleaving of media files from different xfsdumps.
 	 */
-	if ( mwhdrp->mh_mediaix != 0
+	if (mwhdrp->mh_mediaix != 0
 	     &&
 	     mwhdrp->mh_dumpmediafileix == 0
 	     &&
-	     ! virginmediapr ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+	     ! virginmediapr) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 		      "cannot interleave dump streams: must supply a blank "
-		      "media object\n") );
+		      "media object\n"));
 		*gwhdrp = saved_gwhdr;
 		goto changemedia;
 	}
 
 	/* update the media object previous id and label
 	 */
-	if ( ! mediawrittentopr && mwhdrp->mh_dumpfileix != 0 ) {
+	if (! mediawrittentopr && mwhdrp->mh_dumpfileix != 0) {
 		uuid_copy(mwhdrp->mh_prevmediaid, mwhdrp->mh_mediaid);
-		( void )strncpyterm( mwhdrp->mh_prevmedialabel,
+		(void)strncpyterm(mwhdrp->mh_prevmedialabel,
 				     mwhdrp->mh_medialabel,
-				     sizeof( mwhdrp->mh_medialabel ));
+				     sizeof(mwhdrp->mh_medialabel));
 	}
 
 	/* update the media object current id and label
 	 */
-	if ( ! mediawrittentopr ) {
-		if ( mwhdrp->mh_mediafileix == 0 ) {
-			char labelbuf[ GLOBAL_HDR_STRING_SZ ];
+	if (! mediawrittentopr) {
+		if (mwhdrp->mh_mediafileix == 0) {
+			char labelbuf[GLOBAL_HDR_STRING_SZ];
 
-			uuid_generate( mwhdrp->mh_mediaid );
+			uuid_generate(mwhdrp->mh_mediaid);
 
-			if ( ! cmdlinemedialabel
+			if (! cmdlinemedialabel
 			     &&
 			     ! drivep->d_isnamedpipepr
 			     &&
 			     ! drivep->d_isunnamedpipepr
 			     &&
-			     dlog_allowed( )) {
-				cmdlinemedialabel = Media_prompt_label( drivep,
+			     dlog_allowed()) {
+				cmdlinemedialabel = Media_prompt_label(drivep,
 							labelbuf,
-							sizeof( labelbuf ));
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+							sizeof(labelbuf));
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
 			}
-			if ( cmdlinemedialabel && strlen( cmdlinemedialabel )) {
-				( void )strncpyterm( mwhdrp->mh_medialabel,
+			if (cmdlinemedialabel && strlen(cmdlinemedialabel)) {
+				(void)strncpyterm(mwhdrp->mh_medialabel,
 						     cmdlinemedialabel,
-					       sizeof( mwhdrp->mh_medialabel ));
+					       sizeof(mwhdrp->mh_medialabel));
 			} else {
-				( void )memset( ( void * )mwhdrp->mh_medialabel,
+				(void)memset((void *)mwhdrp->mh_medialabel,
 						     0,
-					       sizeof( mwhdrp->mh_medialabel ));
-				if ( ! pipeline ) {
-					mlog( MLOG_VERBOSE
+					       sizeof(mwhdrp->mh_medialabel));
+				if (! pipeline) {
+					mlog(MLOG_VERBOSE
 					      |
 					      MLOG_WARNING
 					      |
 					      MLOG_MEDIA, _(
-					      "no media label specified\n") );
+					      "no media label specified\n"));
 				}
 			}
 		} else {
-			assert( ! virginmediapr );
+			assert(! virginmediapr);
 			uuid_copy(mwhdrp->mh_mediaid, mrhdrp->mh_mediaid);
-			( void )strncpyterm( mwhdrp->mh_medialabel,
+			(void)strncpyterm(mwhdrp->mh_medialabel,
 					     mrhdrp->mh_medialabel,
-					     sizeof( mwhdrp->mh_medialabel ));
+					     sizeof(mwhdrp->mh_medialabel));
 		}
 	}
 
@@ -6126,17 +6126,17 @@
 
 	/* write hdr is prepared. place it on media
 	 */
-	if ( intr_allowed && cldmgr_stop_requested( )) {
+	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
-	rval = ( * dop->do_begin_write )( drivep );
-	switch( rval ) {
+	rval = (* dop->do_begin_write)(drivep);
+	switch(rval) {
 	case 0:
 		return RV_OK;
 	case DRIVE_ERROR_EOM:
-		mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+		mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 		      "encountered end of media "
-		      "while attempting to begin new media file\n") );
+		      "while attempting to begin new media file\n"));
 		*gwhdrp = saved_gwhdr;
 		goto changemedia;
 	case DRIVE_ERROR_MEDIA:
@@ -6151,38 +6151,38 @@
 
 /* ARGSUSED */
 static rv_t
-Media_mfile_end( drive_t *drivep,
+Media_mfile_end(drive_t *drivep,
 		 context_t *contextp,
 		 media_hdr_t *mwhdrp,
 		 off64_t *ncommittedp,
-		 bool_t hit_eom )
+		 bool_t hit_eom)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_MEDIA,
-	      "Media op: end media file\n" );
+	mlog(MLOG_DEBUG | MLOG_MEDIA,
+	      "Media op: end media file\n");
 
-	assert( contextp->cc_Media_begin_entrystate == BES_INVAL );
+	assert(contextp->cc_Media_begin_entrystate == BES_INVAL);
 
 	/* call drive's end_write op to flush the tail of the media file
 	 * if has previously hit EOM, this is moot.
 	 */
-	rval = ( dop->do_end_write )( drivep, ncommittedp );
-	if ( hit_eom ) {
-		assert( ! rval );
+	rval = (dop->do_end_write)(drivep, ncommittedp);
+	if (hit_eom) {
+		assert(! rval);
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
 	}
-	switch( rval ) {
+	switch(rval) {
 	case 0:
 		contextp->cc_Media_begin_entrystate = BES_ENDOK;
 		return RV_OK;
 	case DRIVE_ERROR_MEDIA:
 	case DRIVE_ERROR_EOM:
-		mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+		mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 		      "encountered end of media "
-		      "while ending media file\n") );
+		      "while ending media file\n"));
 		mlog_exit_hint(RV_EOM);
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
@@ -6197,19 +6197,19 @@
 }
 
 static bool_t
-Media_prompt_overwrite( drive_t *drivep )
+Media_prompt_overwrite(drive_t *drivep)
 {
 	fold_t fold;
-	char question[ 100 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char question[100];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -6218,31 +6218,31 @@
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, "media overwrite dialog", '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, "media overwrite dialog", '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* query: ask if overwrite ok
 	 */
-	sprintf( question,
+	sprintf(question,
 		 "overwrite data on media in "
 		 "drive %u?\n",
-		 (unsigned int)drivep->d_index );
+		 (unsigned int)drivep->d_index);
 	querycnt = 0;
-	querystr[ querycnt++ ] = question;
-	assert( querycnt <= QUERYMAX );
+	querystr[querycnt++] = question;
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = "don't overwrite";
+	choicestr[choicecnt++ ] = "don't overwrite";
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = "overwrite";
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++ ] = "overwrite";
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -6254,41 +6254,41 @@
 				       dontix,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = "media will be overwritten\n";
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = "media will NOT be overwritten\n";
+	if (responseix == doix) {
+		ackstr[ackcnt++ ] = "media will be overwritten\n";
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++ ] = "media will NOT be overwritten\n";
 	} else {
-		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
+		ackstr[ackcnt++ ] = "keyboard interrupt\n";
 	}
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, "end dialog", '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	if (responseix == sigintix) {
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying media overwrite dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media overwrite dialog\n");
 		goto retry;
 	}
 
@@ -6297,24 +6297,24 @@
 }
 
 static rv_t
-Media_erasechk( drive_t *drivep,
+Media_erasechk(drive_t *drivep,
 		int dcaps,
 		bool_t intr_allowed,
-		bool_t prevmediapresentpr )
+		bool_t prevmediapresentpr)
 {
-	if ( prevmediapresentpr == BOOL_TRUE ) {
+	if (prevmediapresentpr == BOOL_TRUE) {
 		return RV_NOTOK;
 	}
 
-	if ( sc_preerasepr ) {
-		if ( dcaps & DRIVE_CAP_ERASE ) {
-			if ( dlog_allowed( )) {
+	if (sc_preerasepr) {
+		if (dcaps & DRIVE_CAP_ERASE) {
+			if (dlog_allowed()) {
 				bool_t ok;
-				ok = Media_prompt_erase( drivep );
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+				ok = Media_prompt_erase(drivep);
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
-				if ( ok ) {
+				if (ok) {
 					return RV_OK;
 				} else {
 					return RV_NOTOK;
@@ -6323,10 +6323,10 @@
 				return RV_OK;
 			}
 		} else {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "drive does not support media erase: "
 			      "ignoring -%c option\n"),
-			      GETOPT_ERASE );
+			      GETOPT_ERASE);
 			return RV_NOTOK;
 		}
 	} else {
@@ -6335,19 +6335,19 @@
 }
 
 static bool_t
-Media_prompt_erase( drive_t *drivep )
+Media_prompt_erase(drive_t *drivep)
 {
 	fold_t fold;
-	char question[ 100 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char question[100];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -6356,34 +6356,34 @@
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, "media erase dialog", '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, "media erase dialog", '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* query: ask if overwrite ok
 	 */
-	sprintf( question,
+	sprintf(question,
 		 "pre-erase (-%c) option specified "
 		 "and non-blank media encountered:\n"
 		 "please confirm media erase "
 		 "drive %u\n",
 		 GETOPT_ERASE,
-		 (unsigned int)drivep->d_index );
+		 (unsigned int)drivep->d_index);
 	querycnt = 0;
-	querystr[ querycnt++ ] = question;
-	assert( querycnt <= QUERYMAX );
+	querystr[querycnt++] = question;
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = "don't erase";
+	choicestr[choicecnt++ ] = "don't erase";
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = "erase";
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++ ] = "erase";
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -6395,41 +6395,41 @@
 				       dontix,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = "media will be erased\n";
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = "media will NOT be erased\n";
+	if (responseix == doix) {
+		ackstr[ackcnt++ ] = "media will be erased\n";
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++ ] = "media will NOT be erased\n";
 	} else {
-		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
+		ackstr[ackcnt++ ] = "keyboard interrupt\n";
 	}
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, "end dialog", '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	if (responseix == sigintix) {
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying media erase dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media erase dialog\n");
 		goto retry;
 	}
 
@@ -6438,27 +6438,27 @@
 }
 
 static void
-Media_prompt_label_cb( void *uctxp, dlog_pcbp_t pcb, void *pctxp )
+Media_prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
-	drive_t *drivep = ( drive_t * )uctxp;
+	drive_t *drivep = (drive_t *)uctxp;
 
 	/* query: ask for a label
 	 */
-	( * pcb )( pctxp,
+	(* pcb)(pctxp,
 		   "please enter label for media in "
 		   "drive %u",
-		   drivep->d_index );
+		   drivep->d_index);
 }
 
 static char *
-Media_prompt_label( drive_t *drivep, char *bufp, size_t bufsz )
+Media_prompt_label(drive_t *drivep, char *bufp, size_t bufsz)
 {
 	fold_t fold;
-	char *preamblestr[ PREAMBLEMAX ];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	const ix_t timeoutix = 1;
 	const ix_t abortix = 2;
@@ -6468,15 +6468,15 @@
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, "media label dialog", '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, "media label dialog", '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
-	responseix = dlog_string_query( Media_prompt_label_cb,
-					( void * )drivep,
+	responseix = dlog_string_query(Media_prompt_label_cb,
+					(void *)drivep,
 					bufp,
 					bufsz,
 					DLOG_TIMEOUT,
@@ -6484,51 +6484,51 @@
 					sigintix, /* sigint ix */
 					abortix,  /* sighup ix */
 					abortix,  /* sigquit ix */
-					okix );   /* ok ix */
+					okix);   /* ok ix */
 	ackcnt = 0;
-	if ( responseix == okix ) {
-		ackstr[ ackcnt++ ] = "media label entered: \"";
-		ackstr[ ackcnt++ ] = bufp;
-		ackstr[ ackcnt++ ] = "\"\n";
-	} else if ( responseix == timeoutix ) {
-		ackstr[ ackcnt++ ] = "timeout: media label left blank\n";
-	} else if ( responseix == sigintix ) {
-		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
+	if (responseix == okix) {
+		ackstr[ackcnt++ ] = "media label entered: \"";
+		ackstr[ackcnt++] = bufp;
+		ackstr[ackcnt++ ] = "\"\n";
+	} else if (responseix == timeoutix) {
+		ackstr[ackcnt++ ] = "timeout: media label left blank\n";
+	} else if (responseix == sigintix) {
+		ackstr[ackcnt++ ] = "keyboard interrupt\n";
 	} else {
-		ackstr[ ackcnt++ ] = "abort\n";
+		ackstr[ackcnt++ ] = "abort\n";
 	}
 
-	assert( ackcnt <= ACKMAX );
-	dlog_string_ack( ackstr,
-			 ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_string_ack(ackstr,
+			 ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, "end dialog", '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	if (responseix == sigintix) {
+		if (cldmgr_stop_requested()) {
 			return 0;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return 0;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying media label dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media label dialog\n");
 		goto retry;
 	}
 
 
-	if ( responseix == okix ) {
+	if (responseix == okix) {
 		return bufp;
 	} else {
 		return 0;
@@ -6536,38 +6536,38 @@
 }
 
 static void
-set_mcflag( ix_t thrdix )
+set_mcflag(ix_t thrdix)
 {
-	lock( );
-	sc_mcflag[ thrdix ] = BOOL_TRUE;
+	lock();
+	sc_mcflag[thrdix] = BOOL_TRUE;
 	content_media_change_needed = BOOL_TRUE;
-	unlock( );
+	unlock();
 }
 
 static void
-clr_mcflag( ix_t thrdix )
+clr_mcflag(ix_t thrdix)
 {
-	lock( );
-	sc_mcflag[ thrdix ] = BOOL_FALSE;
-	for ( thrdix = 0 ; thrdix < drivecnt ; thrdix++ ) {
-		if ( sc_mcflag[ thrdix ] ) {
-			unlock( );
+	lock();
+	sc_mcflag[thrdix] = BOOL_FALSE;
+	for (thrdix = 0 ; thrdix < drivecnt ; thrdix++) {
+		if (sc_mcflag[thrdix]) {
+			unlock();
 			return;
 		}
 	}
 	content_media_change_needed = BOOL_FALSE;
-	unlock( );
+	unlock();
 }
 
 static bool_t
-check_complete_flags( void )
+check_complete_flags(void)
 {
 	ix_t strmix;
 	bool_t completepr = BOOL_TRUE;
 
-	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-		context_t *contextp = &sc_contextp[ strmix ];
-		if ( ! contextp->cc_completepr ) {
+	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		context_t *contextp = &sc_contextp[strmix];
+		if (! contextp->cc_completepr) {
 			completepr = BOOL_FALSE;
 			break;
 		}
@@ -6591,7 +6591,7 @@
 #define REPQUOTA "xfs_quota"
 
 static bool_t
-save_quotas( char *mntpnt, quota_info_t *quotainfo )
+save_quotas(char *mntpnt, quota_info_t *quotainfo)
 {
         int             sts = 0;
         char            buf[1024] = "";
@@ -6599,50 +6599,50 @@
         char            tmp;
         struct stat     statb;
 
-        mlog( MLOG_VERBOSE, _(
-		"saving %s information for: %s\n"), quotainfo->desc, mntpnt );
+        mlog(MLOG_VERBOSE, _(
+		"saving %s information for: %s\n"), quotainfo->desc, mntpnt);
 
-        if( unlink( quotainfo->quotapath ) == 0 ) {
-            mlog( MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
+        if(unlink(quotainfo->quotapath) == 0) {
+            mlog(MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
         }
         else {
-            if( errno != ENOENT ) {
-                mlog( MLOG_ERROR, _(
+            if(errno != ENOENT) {
+                mlog(MLOG_ERROR, _(
                       "unable to remove %s: %s\n"),
                       quotainfo->quotapath,
-                      strerror( errno ));
+                      strerror(errno));
                 return BOOL_FALSE;
             }
         }
 
-        sprintf( buf,
+        sprintf(buf,
 		 "%s -x -c 'dump %s %s' %s 2> /dev/null",
 		 REPQUOTA,
                  quotainfo->repquotaargs,
                  quotainfo->quotapath,
-                 mntpnt );
+                 mntpnt);
 
-        mlog( MLOG_NITTY, "saving quotas: %s\n", buf );
+        mlog(MLOG_NITTY, "saving quotas: %s\n", buf);
 
-        sts = system( buf );
-        if( sts != 0 ) {
-            mlog( MLOG_ERROR, _(
+        sts = system(buf);
+        if(sts != 0) {
+            mlog(MLOG_ERROR, _(
                   "%s failed with exit status: %d\n"), REPQUOTA,
 		  sts == -1 ? -1 : WEXITSTATUS(sts));
             return BOOL_FALSE;
         }
-        if((fd = open( quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
-            mlog( MLOG_ERROR, _(
+        if((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
+            mlog(MLOG_ERROR, _(
                   "open failed %s: %s\n"),
                   quotainfo->quotapath,
-                  strerror( errno ));
+                  strerror(errno));
             return BOOL_FALSE;
         }
         if(fstat(fd, &statb) < 0) {
-            mlog( MLOG_ERROR, _(
+            mlog(MLOG_ERROR, _(
                   "stat failed %s: %s\n"),
                   quotainfo->quotapath,
-                  strerror( errno ));
+                  strerror(errno));
             close(fd);
             return BOOL_FALSE;
         }
diff --git a/dump/getopt.h b/dump/getopt.h
index 3bab87a..dd798d8 100644
--- a/dump/getopt.h
+++ b/dump/getopt.h
@@ -50,7 +50,7 @@
 #define	GETOPT_SUBTREE		's'	/* subtree dump (content_inode.c) */
 #define GETOPT_DUMPTIME		't'	/* use mtime of file as dump time */
 /*				'u' */
-#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4 ) */
+#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4) */
 /*				'w' */
 /*				'x'	   used in irix for xvm snapshot */
 /*				'y' */
diff --git a/dump/inomap.c b/dump/inomap.c
index 238fcaf..4c8d490 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -57,7 +57,7 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern bool_t preemptchk( int );
+extern bool_t preemptchk(int);
 extern size_t pgsz;
 extern hsm_fs_ctxt_t *hsm_fs_ctxtp;
 extern uint64_t maxdumpfilesize;
@@ -67,7 +67,7 @@
 
 /* inomap construction callbacks
  */
-static int cb_context( bool_t last,
+static int cb_context(bool_t last,
 			    time32_t,
 			    bool_t,
 			    time32_t,
@@ -78,50 +78,50 @@
 			    int,
 			    bool_t,
 			    bool_t *);
-static void cb_context_free( void );
-static int cb_count_inogrp( void *, int, xfs_inogrp_t *);
-static int cb_add_inogrp( void *, int, xfs_inogrp_t * );
-static int cb_add( void *, jdm_fshandle_t *, int, xfs_bstat_t * );
-static bool_t cb_inoinresumerange( xfs_ino_t );
-static bool_t cb_inoresumed( xfs_ino_t );
-static void cb_accuminit_sz( void );
-static void cb_spinit( void );
-static int cb_startpt( void *,
+static void cb_context_free(void);
+static int cb_count_inogrp(void *, int, xfs_inogrp_t *);
+static int cb_add_inogrp(void *, int, xfs_inogrp_t *);
+static int cb_add(void *, jdm_fshandle_t *, int, xfs_bstat_t *);
+static bool_t cb_inoinresumerange(xfs_ino_t);
+static bool_t cb_inoresumed(xfs_ino_t);
+static void cb_accuminit_sz(void);
+static void cb_spinit(void);
+static int cb_startpt(void *,
 			    jdm_fshandle_t *,
 			    int,
-			    xfs_bstat_t * );
-static int supprt_prune( void *,
+			    xfs_bstat_t *);
+static int supprt_prune(void *,
 			      jdm_fshandle_t *,
 			      int,
 			      xfs_bstat_t *,
-			      char * );
-static off64_t quantity2offset( jdm_fshandle_t *, xfs_bstat_t *, off64_t );
-static off64_t estimate_dump_space( xfs_bstat_t * );
+			      char *);
+static off64_t quantity2offset(jdm_fshandle_t *, xfs_bstat_t *, off64_t);
+static off64_t estimate_dump_space(xfs_bstat_t *);
 
 /* inomap primitives
  */
-static int inomap_init( int igrpcnt );
-static void inomap_add( void *, xfs_ino_t ino, gen_t gen, int );
-static int inomap_set_state( void *, xfs_ino_t ino, int );
-static void inomap_set_gen(void *, xfs_ino_t, gen_t );
+static int inomap_init(int igrpcnt);
+static void inomap_add(void *, xfs_ino_t ino, gen_t gen, int);
+static int inomap_set_state(void *, xfs_ino_t ino, int);
+static void inomap_set_gen(void *, xfs_ino_t, gen_t);
 
 /* subtree abstraction
  */
-static int subtree_descend_cb( void *,
+static int subtree_descend_cb(void *,
 				    jdm_fshandle_t *,
 				    int fsfd,
 				    xfs_bstat_t *,
-				    char * );
-static int subtreelist_parse_cb( void *,
+				    char *);
+static int subtreelist_parse_cb(void *,
 				      jdm_fshandle_t *,
 				      int fsfd,
 				      xfs_bstat_t *,
-				      char * );
-static int subtreelist_parse( jdm_fshandle_t *,
+				      char *);
+static int subtreelist_parse(jdm_fshandle_t *,
 				   int,
 				   xfs_bstat_t *,
 				   char *[],
-				   ix_t );
+				   ix_t);
 
 /* definition of locally defined global variables ****************************/
 
@@ -142,7 +142,7 @@
  */
 /* ARGSUSED */
 bool_t
-inomap_build( jdm_fshandle_t *fshandlep,
+inomap_build(jdm_fshandle_t *fshandlep,
 	      int fsfd,
 	      xfs_bstat_t *rootstatp,
 	      bool_t last,
@@ -159,7 +159,7 @@
 	      ix_t *statphasep,
 	      ix_t *statpassp,
 	      size64_t statcnt,
-	      size64_t *statdonep )
+	      size64_t *statdonep)
 {
 	xfs_bstat_t *bstatbufp;
 	size_t bstatbuflen;
@@ -185,24 +185,24 @@
 	/* allocate a bulkstat buf
 	 */
 	bstatbuflen = BSTATBUFLEN;
-	bstatbufp = ( xfs_bstat_t * )memalign( pgsz,
+	bstatbufp = (xfs_bstat_t *)memalign(pgsz,
 					       bstatbuflen
 					       *
-					       sizeof( xfs_bstat_t ));
-	assert( bstatbufp );
+					       sizeof(xfs_bstat_t));
+	assert(bstatbufp);
 
 	/* count the number of inode groups, which will serve as a
 	 * starting point for the size of the inomap.
 	 */
-	rval = inogrp_iter( fsfd, cb_count_inogrp, (void *)&igrpcnt, &stat );
-	if ( rval || stat ) {
-		free( ( void * )bstatbufp );
+	rval = inogrp_iter(fsfd, cb_count_inogrp, (void *)&igrpcnt, &stat);
+	if (rval || stat) {
+		free((void *)bstatbufp);
 		return BOOL_FALSE;
 	}
 
 	/* initialize the callback context
 	 */
-	rval = cb_context( last,
+	rval = cb_context(last,
 			   lasttime,
 			   resume,
 			   resumetime,
@@ -212,9 +212,9 @@
 			   startptcnt,
 			   igrpcnt,
 			   skip_unchanged_dirs,
-			   &pruneneeded );
- 	if ( rval ) {
- 		free( ( void * )bstatbufp );
+			   &pruneneeded);
+ 	if (rval) {
+ 		free((void *)bstatbufp);
  		return BOOL_FALSE;
  	}
 
@@ -225,10 +225,10 @@
 	 * in this filesystem. each inode will be marked unused until its
 	 * correct state is set in cb_add.
 	 */
-	rval = inogrp_iter( fsfd, cb_add_inogrp, NULL, &stat );
- 	if ( rval || stat ) {
+	rval = inogrp_iter(fsfd, cb_add_inogrp, NULL, &stat);
+ 	if (rval || stat) {
 		cb_context_free();
- 		free( ( void * )bstatbufp );
+ 		free((void *)bstatbufp);
  		return BOOL_FALSE;
  	}
 
@@ -244,26 +244,26 @@
 	 * set a flag if any ino not put in a dump state. This will be used
 	 * to decide if any pruning can be done.
 	 */
-	mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+	mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 	      "ino map phase 1: "
-	      "constructing initial dump list\n") );
+	      "constructing initial dump list\n"));
 
 	*inomap_statdonep = 0;
 	*inomap_statphasep = 1;
 	stat = 0;
-	cb_accuminit_sz( );
+	cb_accuminit_sz();
 
-	if ( subtreecnt ) {
-		rval = subtreelist_parse( fshandlep,
+	if (subtreecnt) {
+		rval = subtreelist_parse(fshandlep,
 					  fsfd,
 					  rootstatp,
 					  subtreebuf,
-					  subtreecnt );
+					  subtreecnt);
 	} else {
-		rval = bigstat_iter( fshandlep,
+		rval = bigstat_iter(fshandlep,
 				     fsfd,
 				     BIGSTAT_ITER_ALL,
-				     ( xfs_ino_t )0,
+				     (xfs_ino_t)0,
 				     cb_add,
 				     NULL,
 				     NULL,
@@ -271,80 +271,80 @@
 				     &stat,
 				     preemptchk,
 				     bstatbufp,
-				     bstatbuflen );
+				     bstatbuflen);
 	}
 	*inomap_statphasep = 0;
-	if ( rval || preemptchk( PREEMPT_FULL )) {
+	if (rval || preemptchk(PREEMPT_FULL)) {
 		cb_context_free();
-		free( ( void * )bstatbufp );
+		free((void *)bstatbufp);
 		return BOOL_FALSE;
 	}
 
-	if ( inomap_exclude_filesize > 0 ) {
-		mlog( MLOG_NOTE | MLOG_VERBOSE, _(
+	if (inomap_exclude_filesize > 0) {
+		mlog(MLOG_NOTE | MLOG_VERBOSE, _(
 		      "pruned %llu files: maximum size exceeded\n"),
-		      inomap_exclude_filesize );
+		      inomap_exclude_filesize);
 	}
-	if ( inomap_exclude_skipattr > 0 ) {
-		mlog( MLOG_NOTE | MLOG_VERBOSE, _(
+	if (inomap_exclude_skipattr > 0) {
+		mlog(MLOG_NOTE | MLOG_VERBOSE, _(
 		      "pruned %llu files: skip attribute set\n"),
-		      inomap_exclude_skipattr );
+		      inomap_exclude_skipattr);
 	}
 
 	/* prune directories unchanged since the last dump and containing
 	 * no children needing dumping.
 	 */
-	if ( pruneneeded ) {
+	if (pruneneeded) {
 		bool_t	rootdump = BOOL_FALSE;
 
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 2: "
-		      "pruning unneeded subtrees\n") );
+		      "pruning unneeded subtrees\n"));
 		*inomap_statdonep = 0;
 		*inomap_statpassp = 0;
 		*inomap_statphasep = 2;
 
-		(void) supprt_prune( &rootdump,
+		(void) supprt_prune(&rootdump,
 				     fshandlep,
 				     fsfd,
 				     rootstatp,
-				     NULL );
+				     NULL);
 		*inomap_statphasep = 0;
 
-		if ( preemptchk( PREEMPT_FULL )) {
+		if (preemptchk(PREEMPT_FULL)) {
 			cb_context_free();
-			free( ( void * )bstatbufp );
+			free((void *)bstatbufp);
 			return BOOL_FALSE;
 		}
 
 	} else {
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 2: "
-		      "skipping (no pruning necessary)\n") );
+		      "skipping (no pruning necessary)\n"));
 	}
 
 	/* initialize the callback context for startpoint calculation
 	 */
-	cb_spinit( );
+	cb_spinit();
 
 	/* identify dump stream startpoints
 	 */
-	if ( startptcnt > 1 ) {
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+	if (startptcnt > 1) {
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 3: "
-		      "identifying stream starting points\n") );
+		      "identifying stream starting points\n"));
 	} else {
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 3: "
-		      "skipping (only one dump stream)\n") );
+		      "skipping (only one dump stream)\n"));
 	}
 	stat = 0;
 	*inomap_statdonep = 0;
 	*inomap_statphasep = 3;
-	rval = bigstat_iter( fshandlep,
+	rval = bigstat_iter(fshandlep,
 			     fsfd,
 			     BIGSTAT_ITER_NONDIR,
-			     ( xfs_ino_t )0,
+			     (xfs_ino_t)0,
 			     cb_startpt,
 			     NULL,
 			     inomap_next_nondir,
@@ -352,66 +352,66 @@
 			     &stat,
 			     preemptchk,
 			     bstatbufp,
-			     bstatbuflen );
+			     bstatbuflen);
 	*inomap_statphasep = 0;
 
-	if ( rval ) {
+	if (rval) {
 		cb_context_free();
-		free( ( void * )bstatbufp );
+		free((void *)bstatbufp);
 		return BOOL_FALSE;
 	}
 
-	if ( startptcnt > 1 ) {
+	if (startptcnt > 1) {
 		ix_t startptix;
-		for ( startptix = 0 ; startptix < startptcnt ; startptix++ ) {
+		for (startptix = 0 ; startptix < startptcnt ; startptix++) {
 			startpt_t *p;
 			startpt_t *ep;
 
-			p = &startptp[ startptix ];
-			if ( startptix == startptcnt - 1 ) {
+			p = &startptp[startptix];
+			if (startptix == startptcnt - 1) {
 				ep = 0;
 			} else {
-				ep = &startptp[ startptix + 1 ];
+				ep = &startptp[startptix + 1];
 			}
-			assert( ! p->sp_flags );
-			mlog( MLOG_VERBOSE | MLOG_INOMAP,
+			assert(! p->sp_flags);
+			mlog(MLOG_VERBOSE | MLOG_INOMAP,
 			      _("stream %u: ino %llu offset %lld to "),
 			      startptix,
 			      p->sp_ino,
-			      p->sp_offset );
-			if ( ! ep ) {
-				mlog( MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
-				      _("end\n") );
+			      p->sp_offset);
+			if (! ep) {
+				mlog(MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
+				      _("end\n"));
 			} else {
-				mlog( MLOG_VERBOSE |  MLOG_BARE | MLOG_INOMAP,
+				mlog(MLOG_VERBOSE |  MLOG_BARE | MLOG_INOMAP,
 				      _("ino %llu offset %lld\n"),
 				      ep->sp_ino,
-				      ep->sp_offset );
+				      ep->sp_offset);
 			}
 		}
 	}
 
 	cb_context_free();
-	free( ( void * )bstatbufp );
-	mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
-	      "ino map construction complete\n") );
+	free((void *)bstatbufp);
+	mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
+	      "ino map construction complete\n"));
 	return BOOL_TRUE;
 }
 
 void
-inomap_skip( xfs_ino_t ino )
+inomap_skip(xfs_ino_t ino)
 {
 	int oldstate;
 
-	oldstate = inomap_get_state( NULL, ino );
-	if ( oldstate == MAP_NDR_CHANGE) {
-		inomap_set_state( NULL, ino, MAP_NDR_NOCHNG );
+	oldstate = inomap_get_state(NULL, ino);
+	if (oldstate == MAP_NDR_CHANGE) {
+		inomap_set_state(NULL, ino, MAP_NDR_NOCHNG);
 	}
 
-	if ( oldstate == MAP_DIR_CHANGE
+	if (oldstate == MAP_DIR_CHANGE
 	     ||
-	     oldstate == MAP_DIR_SUPPRT ) {
-		inomap_set_state( NULL, ino, MAP_DIR_NOCHNG );
+	     oldstate == MAP_DIR_SUPPRT) {
+		inomap_set_state(NULL, ino, MAP_DIR_NOCHNG);
 	}
 }
 
@@ -445,7 +445,7 @@
  * phases of inomap_build().
  */
 static int
-cb_context( bool_t last,
+cb_context(bool_t last,
 	    time32_t lasttime,
 	    bool_t resume,
 	    time32_t resumetime,
@@ -455,7 +455,7 @@
 	    size_t startptcnt,
 	    int igrpcnt,
 	    bool_t skip_unchanged_dirs,
-	    bool_t *pruneneededp )
+	    bool_t *pruneneededp)
 {
 	cb_last = last;
 	cb_lasttime = lasttime;
@@ -471,7 +471,7 @@
 	cb_pruneneededp = pruneneededp;
 	cb_skip_unchanged_dirs = skip_unchanged_dirs;
 
-	if (inomap_init( igrpcnt ))
+	if (inomap_init(igrpcnt))
 		return -1;
 
 	cb_inomap_contextp = inomap_alloc_context();
@@ -482,13 +482,13 @@
 }
 
 static void
-cb_context_free( void )
+cb_context_free(void)
 {
-	inomap_free_context( cb_inomap_contextp );
+	inomap_free_context(cb_inomap_contextp);
 }
 
 static int
-cb_count_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
+cb_count_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 {
 	int *count = (int *)arg1;
 	(*count)++;
@@ -502,25 +502,25 @@
  */
 /* ARGSUSED */
 static int
-cb_add( void *arg1,
+cb_add(void *arg1,
 	jdm_fshandle_t *fshandlep,
 	int fsfd,
-	xfs_bstat_t *statp )
+	xfs_bstat_t *statp)
 {
 	register time32_t mtime = statp->bs_mtime.tv_sec;
 	register time32_t ctime = statp->bs_ctime.tv_sec;
-	register time32_t ltime = max( mtime, ctime );
+	register time32_t ltime = max(mtime, ctime);
 	register mode_t mode = statp->bs_mode & S_IFMT;
 	xfs_off_t estimated_size = 0;
 	xfs_ino_t ino = statp->bs_ino;
 	bool_t changed;
 	bool_t resumed;
 
-	( *inomap_statdonep )++;
+	(*inomap_statdonep)++;
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink == 0 ) {
+	if (statp->bs_nlink == 0) {
 		return 0;
 	}
 
@@ -533,14 +533,14 @@
 	 * increment was based, dump it if it has changed since that
 	 * original base dump.
 	 */
-	if ( cb_resume && ! cb_inoinresumerange( ino )) {
-		if ( ltime >= cb_resumetime ) {
+	if (cb_resume && ! cb_inoinresumerange(ino)) {
+		if (ltime >= cb_resumetime) {
 			changed = BOOL_TRUE;
 		} else {
 			changed = BOOL_FALSE;
 		}
-	} else if ( cb_last ) {
-		if ( ltime >= cb_lasttime ) {
+	} else if (cb_last) {
+		if (ltime >= cb_lasttime) {
 			changed = BOOL_TRUE;
 		} else {
 			changed = BOOL_FALSE;
@@ -552,86 +552,86 @@
 	/* this is redundant: make sure any ino partially dumped
 	 * is completed.
 	 */
-	if ( cb_resume && cb_inoresumed( ino )) {
+	if (cb_resume && cb_inoresumed(ino)) {
 		resumed = BOOL_TRUE;
 	} else {
 		resumed = BOOL_FALSE;
 	}
 
-	if ( changed ) {
-		if ( mode == S_IFDIR ) {
-			inomap_add( cb_inomap_contextp,
+	if (changed) {
+		if (mode == S_IFDIR) {
+			inomap_add(cb_inomap_contextp,
 				    ino,
 				    (gen_t)statp->bs_gen,
-				    MAP_DIR_CHANGE );
+				    MAP_DIR_CHANGE);
 			cb_dircnt++;
 		} else {
-			estimated_size = estimate_dump_space( statp );
+			estimated_size = estimate_dump_space(statp);
 
 			/* skip if size is greater than prune size. quota
 			 * files are exempt from the check.
 			 */
-			if ( maxdumpfilesize > 0 &&
+			if (maxdumpfilesize > 0 &&
 			     estimated_size > maxdumpfilesize &&
-			     !is_quota_file(statp->bs_ino) ) {
-				mlog( MLOG_DEBUG | MLOG_EXCLFILES,
+			     !is_quota_file(statp->bs_ino)) {
+				mlog(MLOG_DEBUG | MLOG_EXCLFILES,
 				      "pruned ino %llu, owner %u, estimated size %llu: maximum size exceeded\n",
 				      statp->bs_ino,
 				      statp->bs_uid,
-				      estimated_size );
-				inomap_add( cb_inomap_contextp,
+				      estimated_size);
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_NDR_NOCHNG );
+					    MAP_NDR_NOCHNG);
 				inomap_exclude_filesize++;
 				return 0;
 			}
 
 			if (allowexcludefiles_pr && statp->bs_xflags & XFS_XFLAG_NODUMP) {
-				mlog( MLOG_DEBUG | MLOG_EXCLFILES,
+				mlog(MLOG_DEBUG | MLOG_EXCLFILES,
 				      "pruned ino %llu, owner %u, estimated size %llu: skip flag set\n",
 				      statp->bs_ino,
 				      statp->bs_uid,
-				      estimated_size );
-				inomap_add( cb_inomap_contextp,
+				      estimated_size);
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_NDR_NOCHNG );
+					    MAP_NDR_NOCHNG);
 				inomap_exclude_skipattr++;
 				return 0;
 			}
 
-			inomap_add( cb_inomap_contextp,
+			inomap_add(cb_inomap_contextp,
 				    ino,
 				    (gen_t)statp->bs_gen,
-				    MAP_NDR_CHANGE );
+				    MAP_NDR_CHANGE);
 			cb_nondircnt++;
 			cb_datasz += estimated_size;
-			cb_hdrsz += ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
+			cb_hdrsz += (EXTENTHDR_SZ * (statp->bs_extents + 1));
 		}
-	} else if ( resumed ) {
-		assert( mode != S_IFDIR );
-		assert( changed );
+	} else if (resumed) {
+		assert(mode != S_IFDIR);
+		assert(changed);
 	} else {
-		if ( mode == S_IFDIR ) {
-			if ( cb_skip_unchanged_dirs ) {
-				inomap_add( cb_inomap_contextp,
+		if (mode == S_IFDIR) {
+			if (cb_skip_unchanged_dirs) {
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_DIR_NOCHNG );
+					    MAP_DIR_NOCHNG);
 			} else {
 				*cb_pruneneededp = BOOL_TRUE;
-				inomap_add( cb_inomap_contextp,
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_DIR_SUPPRT );
+					    MAP_DIR_SUPPRT);
 				cb_dircnt++;
 			}
 		} else {
-			inomap_add( cb_inomap_contextp,
+			inomap_add(cb_inomap_contextp,
 				    ino,
 				    (gen_t)statp->bs_gen,
-				    MAP_NDR_NOCHNG );
+				    MAP_NDR_NOCHNG);
 		}
 	}
 
@@ -639,23 +639,23 @@
 }
 
 static bool_t
-cb_inoinresumerange( xfs_ino_t ino )
+cb_inoinresumerange(xfs_ino_t ino)
 {
 	register size_t streamix;
 
-	for ( streamix = 0 ; streamix < cb_resumerangecnt ; streamix++ ) {
-		register drange_t *rp = &cb_resumerangep[ streamix ];
-		if ( ! ( rp->dr_begin.sp_flags & STARTPT_FLAGS_END )
+	for (streamix = 0 ; streamix < cb_resumerangecnt ; streamix++) {
+		register drange_t *rp = &cb_resumerangep[streamix];
+		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
 		     &&
 		     ino >= rp->dr_begin.sp_ino
 		     &&
-		     ( ( rp->dr_end.sp_flags & STARTPT_FLAGS_END )
+		     ((rp->dr_end.sp_flags & STARTPT_FLAGS_END)
 		       ||
 		       ino < rp->dr_end.sp_ino
 		       ||
-		       ( ino == rp->dr_end.sp_ino
+		       (ino == rp->dr_end.sp_ino
 			 &&
-			 rp->dr_end.sp_offset != 0 ))) {
+			 rp->dr_end.sp_offset != 0))) {
 			return BOOL_TRUE;
 		}
 	}
@@ -664,17 +664,17 @@
 }
 
 static bool_t
-cb_inoresumed( xfs_ino_t ino )
+cb_inoresumed(xfs_ino_t ino)
 {
 	size_t streamix;
 
-	for ( streamix = 0 ; streamix < cb_resumerangecnt ; streamix++ ) {
-		drange_t *rp = &cb_resumerangep[ streamix ];
-		if ( ! ( rp->dr_begin.sp_flags & STARTPT_FLAGS_END )
+	for (streamix = 0 ; streamix < cb_resumerangecnt ; streamix++) {
+		drange_t *rp = &cb_resumerangep[streamix];
+		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
 		     &&
 		     ino == rp->dr_begin.sp_ino
 		     &&
-		     rp->dr_begin.sp_offset != 0 ) {
+		     rp->dr_begin.sp_offset != 0) {
 			return BOOL_TRUE;
 		}
 	}
@@ -688,20 +688,20 @@
  */
 /* ARGSUSED */
 static bool_t			/* false, used as diriter callback */
-supprt_prune( void *arg1,	/* ancestors marked as changed? */
+supprt_prune(void *arg1,	/* ancestors marked as changed? */
 	      jdm_fshandle_t *fshandlep,
 	      int fsfd,
 	      xfs_bstat_t *statp,
-	      char *name )
+	      char *name)
 {
 	static bool_t cbrval = BOOL_FALSE;
 	int state;
 
-	if ( ( statp->bs_mode & S_IFMT ) == S_IFDIR ) {
+	if ((statp->bs_mode & S_IFMT) == S_IFDIR) {
 		bool_t changed_below = BOOL_FALSE;
 
-		state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
-		if ( state != MAP_DIR_CHANGE &&
+		state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
+		if (state != MAP_DIR_CHANGE &&
                      state != MAP_DIR_NOCHNG &&
 		     state != MAP_DIR_SUPPRT) {
 			/*
@@ -709,67 +709,67 @@
 			 * certainly changed.
 			 */
 			state = MAP_DIR_CHANGE;
-			inomap_set_state( cb_inomap_contextp,
+			inomap_set_state(cb_inomap_contextp,
 					  statp->bs_ino,
-					  state );
+					  state);
 		}
 
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 supprt_prune,
 				 (void *)&changed_below,
 				 &cbrval,
 				 NULL,
-				 0 );
+				 0);
 
-		if ( state == MAP_DIR_SUPPRT ) {
-			if ( changed_below == BOOL_FALSE ) {
-				inomap_set_state( cb_inomap_contextp,
+		if (state == MAP_DIR_SUPPRT) {
+			if (changed_below == BOOL_FALSE) {
+				inomap_set_state(cb_inomap_contextp,
 						  statp->bs_ino,
-						  MAP_DIR_NOCHNG );
+						  MAP_DIR_NOCHNG);
 				cb_dircnt--;	/* dump size just changed! */
 			}
 			else {
 				/* Directory entries back up the hierarchy */
 				/* to be dumped - as either MAP_DIR_SUPPRT */
 				/* or as MAP_DIR_CHANGE in inode state map */
-				*( bool_t * )arg1 = BOOL_TRUE;
+				*(bool_t *)arg1 = BOOL_TRUE;
 			}
 		}
-		else if ( state == MAP_DIR_CHANGE ) {
+		else if (state == MAP_DIR_CHANGE) {
 			/* Directory entries back up the hierarchy must get */
 			/* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */
-			*( bool_t * )arg1 = BOOL_TRUE;
+			*(bool_t *)arg1 = BOOL_TRUE;
 		}
 		return cbrval;
 	}
 
-	if ( *(bool_t *)arg1 == BOOL_TRUE ) {	/* shortcut, sibling changed */
+	if (*(bool_t *)arg1 == BOOL_TRUE) {	/* shortcut, sibling changed */
 		return cbrval;
 	}
 
-	state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
-	if ( state != MAP_NDR_CHANGE &&
-	     state != MAP_NDR_NOCHNG ) {
+	state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
+	if (state != MAP_NDR_CHANGE &&
+	     state != MAP_NDR_NOCHNG) {
 		/*
 		 * if dir is now a file then it has
 		 * certainly changed.
 		 */
 		state = MAP_NDR_CHANGE;
-		inomap_set_state( cb_inomap_contextp, statp->bs_ino, state );
+		inomap_set_state(cb_inomap_contextp, statp->bs_ino, state);
 	}
-	if ( state == MAP_NDR_CHANGE ) {
+	if (state == MAP_NDR_CHANGE) {
 		/* Directory entries back up the hierarchy must get */
 		/* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */
-		*( bool_t * )arg1 = BOOL_TRUE;
+		*(bool_t *)arg1 = BOOL_TRUE;
 	}
 	return cbrval;
 }
 
 
 static void
-cb_accuminit_sz( void )
+cb_accuminit_sz(void)
 {
 	cb_datasz = 0;
 	cb_hdrsz = 0;
@@ -782,10 +782,10 @@
  * cb_accum accumulates the dump space.
  */
 static void
-cb_spinit( void )
+cb_spinit(void)
 {
 	cb_startptix = 0;
-	cb_incr = (cb_datasz + cb_hdrsz) / ( off64_t )cb_startptcnt;
+	cb_incr = (cb_datasz + cb_hdrsz) / (off64_t)cb_startptcnt;
 	cb_target = 0; /* so first ino will push us over the edge */
 	cb_accum = 0;
 }
@@ -809,10 +809,10 @@
 
 /* ARGSUSED */
 static int
-cb_startpt( void *arg1,
+cb_startpt(void *arg1,
 	    jdm_fshandle_t *fshandlep,
 	    int fsfd,
-	    xfs_bstat_t *statp )
+	    xfs_bstat_t *statp)
 {
 	register int state;
 
@@ -821,31 +821,31 @@
 	off64_t qty;	/* amount of a SPLIT file to skip */
 	action_t action;
 
-	( *inomap_statdonep )++;
+	(*inomap_statdonep)++;
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink == 0 ) {
+	if (statp->bs_nlink == 0) {
 		return 0;
 	}
 
 	/* skip if not in inomap or not a non-dir
 	 */
-	state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
-	if ( state != MAP_NDR_CHANGE ) {
+	state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
+	if (state != MAP_NDR_CHANGE) {
 		return 0;
 	}
 
-	assert( cb_startptix < cb_startptcnt );
+	assert(cb_startptix < cb_startptcnt);
 
-	estimate = estimate_dump_space( statp );
-	cb_accum += estimate + ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
+	estimate = estimate_dump_space(statp);
+	cb_accum += estimate + (EXTENTHDR_SZ * (statp->bs_extents + 1));
 
 	/* loop until no new start points found. loop is necessary
 	 * to handle the pathological case of a huge file so big it
 	 * spans several streams.
 	 */
-	action = ( action_t )HOLD; /* irrelevant, but demanded by lint */
+	action = (action_t)HOLD; /* irrelevant, but demanded by lint */
 	do {
 		/* decide what to do: hold, bump, or split. there are
 		 * 8 valid cases to consider:
@@ -874,69 +874,69 @@
 		 *    accum incl. this file is would be way beyond the
 		 *    target: HOLD.
 		 */
-		if ( cb_target - old_accum >= TOO_SHY ) {
-			if ( cb_target - cb_accum >= TOO_SHY ) {
-				action = ( action_t )HOLD;
-			} else if ( cb_accum <= cb_target ) {
-				action = ( action_t )HOLD;
-			} else if ( cb_accum - cb_target < TOO_BOLD ) {
-				action = ( action_t )HOLD;
+		if (cb_target - old_accum >= TOO_SHY) {
+			if (cb_target - cb_accum >= TOO_SHY) {
+				action = (action_t)HOLD;
+			} else if (cb_accum <= cb_target) {
+				action = (action_t)HOLD;
+			} else if (cb_accum - cb_target < TOO_BOLD) {
+				action = (action_t)HOLD;
 			} else {
-				action = ( action_t )SPLIT;
+				action = (action_t)SPLIT;
 			}
 		} else {
-			if ( cb_target - cb_accum >= TOO_SHY ) {
-				action = ( action_t )YELL;
-			} else if ( cb_accum < cb_target ) {
-				action = ( action_t )HOLD;
-			} else if ( cb_accum - cb_target < TOO_BOLD ) {
-				if ( cb_accum - cb_target >=
-						      cb_target - old_accum ) {
-					action = ( action_t )BUMP;
+			if (cb_target - cb_accum >= TOO_SHY) {
+				action = (action_t)YELL;
+			} else if (cb_accum < cb_target) {
+				action = (action_t)HOLD;
+			} else if (cb_accum - cb_target < TOO_BOLD) {
+				if (cb_accum - cb_target >=
+						      cb_target - old_accum) {
+					action = (action_t)BUMP;
 				} else {
-					action = ( action_t )HOLD;
+					action = (action_t)HOLD;
 				}
 			} else {
-				action = ( action_t )BUMP;
+				action = (action_t)BUMP;
 			}
 		}
 
 		/* perform the action selected above
 		 */
-		switch ( action ) {
-		case ( action_t )HOLD:
+		switch (action) {
+		case (action_t)HOLD:
 			break;
-		case ( action_t )BUMP:
+		case (action_t)BUMP:
 			cb_startptp->sp_ino = statp->bs_ino;
 			cb_startptp->sp_offset = 0;
 			cb_startptix++;
 			cb_startptp++;
 			cb_target += cb_incr;
-			if ( cb_startptix == cb_startptcnt ) {
+			if (cb_startptix == cb_startptcnt) {
 				return 1; /* done; abort the iteration */
 			}
 			break;
-		case ( action_t )SPLIT:
+		case (action_t)SPLIT:
 			cb_startptp->sp_ino = statp->bs_ino;
-			qty = ( cb_target - old_accum )
+			qty = (cb_target - old_accum)
 			      &
-			      ~( off64_t )( BBSIZE - 1 );
+			      ~(off64_t)(BBSIZE - 1);
 			cb_startptp->sp_offset =
-					quantity2offset( fshandlep,
+					quantity2offset(fshandlep,
 							 statp,
-							 qty );
+							 qty);
 			cb_startptix++;
 			cb_startptp++;
 			cb_target += cb_incr;
-			if ( cb_startptix == cb_startptcnt ) {
+			if (cb_startptix == cb_startptcnt) {
 				return 1; /* done; abort the iteration */
 			}
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 			return 1;
 		}
-	} while ( action == ( action_t )BUMP || action == ( action_t )SPLIT );
+	} while (action == (action_t)BUMP || action == (action_t)SPLIT);
 
 	return 0;
 }
@@ -948,7 +948,7 @@
  */
 struct i2gseg {
 	uint64_t s_valid;
-	gen_t s_gen[ INOPERSEG ];
+	gen_t s_gen[INOPERSEG];
 };
 typedef struct i2gseg i2gseg_t;
 
@@ -966,15 +966,15 @@
 } inomap;
 
 static inline void
-SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
+SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 {
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	register uint64_t clrmask;
 	relino = ino - segp->base;
-	mask = ( uint64_t )1 << relino;
+	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
-	switch( state ) {
+	switch(state) {
 	case 0:
 		segp->lobits &= clrmask;
 		segp->mebits &= clrmask;
@@ -1019,22 +1019,22 @@
 }
 
 static inline int
-SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
+SEG_GET_BITS(seg_t *segp, xfs_ino_t ino)
 {
 	int state;
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	relino = ino - segp->base;
-	mask = ( uint64_t )1 << relino;
-	if ( segp->lobits & mask ) {
+	mask = (uint64_t)1 << relino;
+	if (segp->lobits & mask) {
 		state = 1;
 	} else {
 		state = 0;
 	}
-	if ( segp->mebits & mask ) {
+	if (segp->mebits & mask) {
 		state |= 2;
 	}
-	if ( segp->hibits & mask ) {
+	if (segp->hibits & mask) {
 		state |= 4;
 	}
 
@@ -1044,9 +1044,9 @@
 /* context for inomap construction - initialized by map_init
  */
 static int
-inomap_init( int igrpcnt )
+inomap_init(int igrpcnt)
 {
-	assert( sizeof( hnk_t ) == HNKSZ );
+	assert(sizeof(hnk_t) == HNKSZ);
 
 	/* lastseg must be initialized with -1 offsets since
 	 * no segments have been added yet */
@@ -1055,58 +1055,58 @@
 	inomap.hnkmaplen = (igrpcnt + SEGPERHNK - 1) / SEGPERHNK;
 	inomap.hnkmap = (hnk_t *)malloc(inomap.hnkmaplen * HNKSZ);
 	inomap.i2gmap = (i2gseg_t *)
-		calloc( inomap.hnkmaplen * SEGPERHNK, sizeof(i2gseg_t) );
+		calloc(inomap.hnkmaplen * SEGPERHNK, sizeof(i2gseg_t));
 	if (!inomap.hnkmap || !inomap.i2gmap)
 		return -1;
 	return 0;
 }
 
 uint64_t
-inomap_getsz( void )
+inomap_getsz(void)
 {
 	return (inomap.lastseg.hnkoff + 1) * HNKSZ;
 }
 
 static inline bool_t
-inomap_validaddr( seg_addr_t *addrp )
+inomap_validaddr(seg_addr_t *addrp)
 {
 	int maxseg;
 
-	if ( addrp->hnkoff < 0 || addrp->hnkoff > inomap.lastseg.hnkoff )
+	if (addrp->hnkoff < 0 || addrp->hnkoff > inomap.lastseg.hnkoff)
 		return BOOL_FALSE;
 
-	maxseg = ( addrp->hnkoff == inomap.lastseg.hnkoff ) ?
+	maxseg = (addrp->hnkoff == inomap.lastseg.hnkoff) ?
 			inomap.lastseg.segoff : SEGPERHNK - 1;
 
-	if ( addrp->segoff < 0 || addrp->segoff > maxseg )
+	if (addrp->segoff < 0 || addrp->segoff > maxseg)
 		return BOOL_FALSE;
 
 	return BOOL_TRUE;
 }
 
 static inline hnk_t *
-inomap_addr2hnk( seg_addr_t *addrp )
+inomap_addr2hnk(seg_addr_t *addrp)
 {
 	return &inomap.hnkmap[addrp->hnkoff];
 }
 
 static inline seg_t *
-inomap_addr2seg( seg_addr_t *addrp )
+inomap_addr2seg(seg_addr_t *addrp)
 {
-	hnk_t *hunkp = inomap_addr2hnk( addrp );
+	hnk_t *hunkp = inomap_addr2hnk(addrp);
 	return &hunkp->seg[addrp->segoff];
 }
 
 static inline int
-inomap_addr2segix( seg_addr_t *addrp )
+inomap_addr2segix(seg_addr_t *addrp)
 {
-	return ( addrp->hnkoff * SEGPERHNK ) + addrp->segoff;
+	return (addrp->hnkoff * SEGPERHNK) + addrp->segoff;
 }
 
 static inline int
-inomap_lastseg( int hnkoff )
+inomap_lastseg(int hnkoff)
 {
-	if ( hnkoff == inomap.lastseg.hnkoff )
+	if (hnkoff == inomap.lastseg.hnkoff)
 		return inomap.lastseg.segoff;
 	else
 		return SEGPERHNK - 1;
@@ -1116,7 +1116,7 @@
  * order. adds a new segment to the inomap and ino-to-gen map.
  */
 static int
-cb_add_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
+cb_add_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 {
 	hnk_t *hunk;
 	seg_t *segp;
@@ -1149,13 +1149,13 @@
 			       SEGPERHNK * sizeof(i2gseg_t));
 		}
 
-		memset(inomap_addr2hnk( lastsegp ), 0, HNKSZ);
+		memset(inomap_addr2hnk(lastsegp), 0, HNKSZ);
 	}
 
-	hunk = inomap_addr2hnk( lastsegp );
+	hunk = inomap_addr2hnk(lastsegp);
 	hunk->maxino = inogrp->xi_startino + INOPERSEG - 1;
 
-	segp = inomap_addr2seg( lastsegp );
+	segp = inomap_addr2seg(lastsegp);
 	segp->base = inogrp->xi_startino;
 
 	return 0;
@@ -1164,41 +1164,41 @@
 /* called for every ino to be added to the map.
  */
 static void
-inomap_add( void *contextp, xfs_ino_t ino, gen_t gen, int state )
+inomap_add(void *contextp, xfs_ino_t ino, gen_t gen, int state)
 {
-	inomap_set_state( contextp, ino, state );
-	inomap_set_gen( contextp, ino, gen );
+	inomap_set_state(contextp, ino, state);
+	inomap_set_gen(contextp, ino, gen);
 }
 
 void *
-inomap_alloc_context( void )
+inomap_alloc_context(void)
 {
-	void *addr = calloc( 1, sizeof(seg_addr_t) );
+	void *addr = calloc(1, sizeof(seg_addr_t));
 	if (!addr) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
+		mlog(MLOG_NORMAL | MLOG_ERROR,
 		      _("failed to allocate inomap context: %s\n"),
-		      strerror(errno) );
+		      strerror(errno));
 	}
 	return addr;
 }
 
 void
-inomap_reset_context( void *p )
+inomap_reset_context(void *p)
 {
-	memset( p, 0, sizeof(seg_addr_t) );
+	memset(p, 0, sizeof(seg_addr_t));
 }
 
 void
-inomap_free_context( void *p )
+inomap_free_context(void *p)
 {
-	free( p );
+	free(p);
 }
 
 /* use binary search to find the hunk containing the given inode.
  * use the supplied addr as the starting point for the search.
  */
 static bool_t
-inomap_find_hnk( seg_addr_t *addrp, xfs_ino_t ino )
+inomap_find_hnk(seg_addr_t *addrp, xfs_ino_t ino)
 {
 	hnk_t *hunkp;
 	int lower;
@@ -1206,12 +1206,12 @@
 
 	lower = 0;
 	upper = inomap.lastseg.hnkoff;
-	while ( upper >= lower ) {
-		hunkp = inomap_addr2hnk( addrp );
+	while (upper >= lower) {
+		hunkp = inomap_addr2hnk(addrp);
 
-		if ( hunkp->seg[0].base > ino ) {
+		if (hunkp->seg[0].base > ino) {
 			upper = addrp->hnkoff - 1;
-		} else if ( hunkp->maxino < ino ) {
+		} else if (hunkp->maxino < ino) {
 			lower = addrp->hnkoff + 1;
 		} else {
 			return BOOL_TRUE;
@@ -1230,29 +1230,29 @@
  * point for the search.
  */
 static bool_t
-inomap_find_seg( seg_addr_t *addrp, xfs_ino_t ino )
+inomap_find_seg(seg_addr_t *addrp, xfs_ino_t ino)
 {
 	seg_t *segp;
 	int lower;
 	int upper;
 
-	if ( !inomap_validaddr( addrp ) ) {
-		inomap_reset_context( addrp );
+	if (!inomap_validaddr(addrp)) {
+		inomap_reset_context(addrp);
 	}
 
-	if ( !inomap_find_hnk( addrp, ino ) )
+	if (!inomap_find_hnk(addrp, ino))
 		return BOOL_FALSE;
 
 	/* find the correct segment */
 	lower = 0;
 	upper = inomap_lastseg(addrp->hnkoff);
 
-	while ( upper >= lower ) {
-		segp = inomap_addr2seg( addrp );
+	while (upper >= lower) {
+		segp = inomap_addr2seg(addrp);
 
-		if ( segp->base > ino ) {
+		if (segp->base > ino) {
 			upper = addrp->segoff - 1;
-		} else if ( segp->base + INOPERSEG <= ino ) {
+		} else if (segp->base + INOPERSEG <= ino) {
 			lower = addrp->segoff + 1;
 		} else {
 			return BOOL_TRUE;
@@ -1265,28 +1265,28 @@
 }
 
 static xfs_ino_t
-inomap_iter( void *contextp, int statemask )
+inomap_iter(void *contextp, int statemask)
 {
 	xfs_ino_t ino, endino;
 	seg_t *segp;
 	seg_addr_t *addrp = (seg_addr_t *)contextp;
 
-	for ( ;
+	for (;
 	      addrp->hnkoff <= inomap.lastseg.hnkoff;
-	      addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0 ) {
+	      addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0) {
 
-		for ( ;
+		for (;
 		      addrp->segoff <= inomap_lastseg(addrp->hnkoff);
-		      addrp->segoff++, addrp->inooff = 0 ) {
+		      addrp->segoff++, addrp->inooff = 0) {
 
-			segp = inomap_addr2seg( addrp );
+			segp = inomap_addr2seg(addrp);
 
 			ino = segp->base + addrp->inooff;
 			endino = segp->base + INOPERSEG;
-			for ( ; ino < endino ; ino++, addrp->inooff++ ) {
+			for (; ino < endino ; ino++, addrp->inooff++) {
 				int st;
-				st = SEG_GET_BITS( segp, ino );
-				if ( statemask & ( 1 << st )) {
+				st = SEG_GET_BITS(segp, ino);
+				if (statemask & (1 << st)) {
 					addrp->inooff++; /* for next call */
 					return ino;
 				}
@@ -1324,7 +1324,7 @@
 }
 
 static int
-inomap_set_state( void *contextp, xfs_ino_t ino, int state )
+inomap_set_state(void *contextp, xfs_ino_t ino, int state)
 {
 	int oldstate;
 	seg_addr_t *addrp;
@@ -1332,31 +1332,31 @@
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino))
 		return MAP_INO_UNUSED;
 
-	segp = inomap_addr2seg( addrp );
+	segp = inomap_addr2seg(addrp);
 
-	oldstate = SEG_GET_BITS( segp, ino );
-	SEG_SET_BITS( segp, ino, state );
+	oldstate = SEG_GET_BITS(segp, ino);
+	SEG_SET_BITS(segp, ino, state);
 
 	return oldstate;
 }
 
 int
-inomap_get_state( void *contextp, xfs_ino_t ino )
+inomap_get_state(void *contextp, xfs_ino_t ino)
 {
 	seg_addr_t *addrp;
 	seg_addr_t addr;
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino))
 		return MAP_INO_UNUSED;
 
-	segp = inomap_addr2seg( addrp );
+	segp = inomap_addr2seg(addrp);
 
-	return SEG_GET_BITS( segp, ino );
+	return SEG_GET_BITS(segp, ino);
 }
 
 static void
@@ -1369,11 +1369,11 @@
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino))
 		return;
 
-	segp = inomap_addr2seg( addrp );
-	i2gsegp = &inomap.i2gmap[inomap_addr2segix( addrp )];
+	segp = inomap_addr2seg(addrp);
+	i2gsegp = &inomap.i2gmap[inomap_addr2segix(addrp)];
 
 	relino = ino - segp->base;
 	i2gsegp->s_valid |= (uint64_t)1 << relino;
@@ -1381,7 +1381,7 @@
 }
 
 int
-inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen )
+inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen)
 {
 	seg_addr_t *addrp;
 	seg_addr_t addr;
@@ -1390,14 +1390,14 @@
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino))
 		return 1;
 
-	segp = inomap_addr2seg( addrp );
-	i2gsegp = &inomap.i2gmap[inomap_addr2segix( addrp )];
+	segp = inomap_addr2seg(addrp);
+	i2gsegp = &inomap.i2gmap[inomap_addr2segix(addrp)];
 
 	relino = ino - segp->base;
-	if ( ! (i2gsegp->s_valid & ((uint64_t)1 << relino)) )
+	if (! (i2gsegp->s_valid & ((uint64_t)1 << relino)))
 		return 1;
 
 	*gen = i2gsegp->s_gen[relino];
@@ -1405,21 +1405,21 @@
 }
 
 void
-inomap_writehdr( content_inode_hdr_t *scwhdrp )
+inomap_writehdr(content_inode_hdr_t *scwhdrp)
 {
 	/* update the inomap info in the content header
 	 */
 	scwhdrp->cih_inomap_hnkcnt = inomap.lastseg.hnkoff + 1;
-	scwhdrp->cih_inomap_segcnt = inomap_addr2segix( &inomap.lastseg ) + 1;
-	scwhdrp->cih_inomap_dircnt = ( uint64_t )cb_dircnt;
-	scwhdrp->cih_inomap_nondircnt = ( uint64_t )cb_nondircnt;
-	scwhdrp->cih_inomap_firstino = inomap.hnkmap[0].seg[ 0 ].base;
+	scwhdrp->cih_inomap_segcnt = inomap_addr2segix(&inomap.lastseg) + 1;
+	scwhdrp->cih_inomap_dircnt = (uint64_t)cb_dircnt;
+	scwhdrp->cih_inomap_nondircnt = (uint64_t)cb_nondircnt;
+	scwhdrp->cih_inomap_firstino = inomap.hnkmap[0].seg[0].base;
 	scwhdrp->cih_inomap_lastino = inomap.hnkmap[inomap.lastseg.hnkoff].maxino;
-	scwhdrp->cih_inomap_datasz = ( uint64_t )cb_datasz;
+	scwhdrp->cih_inomap_datasz = (uint64_t)cb_datasz;
 }
 
 rv_t
-inomap_dump( drive_t *drivep )
+inomap_dump(drive_t *drivep)
 {
 	seg_addr_t addr;
 	hnk_t *hnkp;
@@ -1427,22 +1427,22 @@
 
 	/* use write_buf to dump the hunks
 	 */
-	for ( addr.hnkoff = 0 ;
+	for (addr.hnkoff = 0 ;
 	      addr.hnkoff <= inomap.lastseg.hnkoff ;
-	      addr.hnkoff++ ) {
+	      addr.hnkoff++) {
 		int rval;
 		rv_t rv;
 		drive_ops_t *dop = drivep->d_opsp;
 
-		hnkp = inomap_addr2hnk( &addr );
+		hnkp = inomap_addr2hnk(&addr);
 
 		xlate_hnk(hnkp, &tmphnkp, 1);
-		rval = write_buf( ( char * )&tmphnkp,
-				  sizeof( tmphnkp ),
-				  ( void * )drivep,
-				  ( gwbfp_t )dop->do_get_write_buf,
-				  ( wfp_t )dop->do_write );
-		switch ( rval ) {
+		rval = write_buf((char *)&tmphnkp,
+				  sizeof(tmphnkp),
+				  (void *)drivep,
+				  (gwbfp_t)dop->do_get_write_buf,
+				  (wfp_t)dop->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -1461,7 +1461,7 @@
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			return rv;
 		}
 	}
@@ -1470,38 +1470,38 @@
 }
 
 static int
-subtreelist_parse( jdm_fshandle_t *fshandlep,
+subtreelist_parse(jdm_fshandle_t *fshandlep,
 		   int fsfd,
 		   xfs_bstat_t *rootstatp,
 		   char *subtreebuf[],
-		   ix_t subtreecnt )
+		   ix_t subtreecnt)
 {
 	ix_t subtreeix;
 
 	/* add the root ino to the dump
 	 */
-	cb_add( NULL, fshandlep, fsfd, rootstatp );
+	cb_add(NULL, fshandlep, fsfd, rootstatp);
 
 	/* do a recursive descent for each subtree specified
 	 */
-	for ( subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++ ) {
+	for (subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++) {
 		int cbrval = 0;
-		char *currentpath = subtreebuf[ subtreeix ];
-		assert( *currentpath != '/' );
-		( void )diriter( fshandlep,
+		char *currentpath = subtreebuf[subtreeix];
+		assert(*currentpath != '/');
+		(void)diriter(fshandlep,
 				 fsfd,
 				 rootstatp,
 				 subtreelist_parse_cb,
-				 ( void * )currentpath,
+				 (void *)currentpath,
 				 &cbrval,
 				 NULL,
-				 0 );
-		if ( cbrval != 1 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_INOMAP,
+				 0);
+		if (cbrval != 1) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_INOMAP,
 			      "%s: %s\n",
 			      cbrval == 0 ? _("subtree not present")
 					  : _("invalid subtree specified"),
-			      currentpath );
+			      currentpath);
 			return -1;
 		}
 	}
@@ -1510,30 +1510,30 @@
 }
 
 static int
-subtreelist_parse_cb( void *arg1,
+subtreelist_parse_cb(void *arg1,
 		      jdm_fshandle_t *fshandlep,
 		      int fsfd,
 		      xfs_bstat_t *statp,
-		      char *name  )
+		      char *name)
 {
 	int cbrval = 0;
 
 	/* arg1 is used to carry the tail of the subtree path
 	 */
-	char *subpath = ( char * )arg1;
+	char *subpath = (char *)arg1;
 
 	/* temporarily terminate the subpath at the next slash
 	 */
-	char *nextslash = strchr( subpath, '/' );
-	if ( nextslash ) {
+	char *nextslash = strchr(subpath, '/');
+	if (nextslash) {
 		*nextslash = 0;
 	}
 
 	/* if the first element of the subpath doesn't match this
 	 * directory entry, try the next entry.
 	 */
-	if ( strcmp( subpath, name )) {
-		if ( nextslash ) {
+	if (strcmp(subpath, name)) {
+		if (nextslash) {
 			*nextslash = '/';
 		}
 		return 0;
@@ -1541,15 +1541,15 @@
 
 	/* it matches, so add ino to list and continue down the path
 	 */
-	cb_add( NULL, fshandlep, fsfd, statp );
+	cb_add(NULL, fshandlep, fsfd, statp);
 
-	if ( nextslash ) {
+	if (nextslash) {
 
 		/* if we're not at the end of the path, yet the current
 		 * path element is not a directory, complain and abort the
 		 * iteration in a way which terminates the application
 		 */
-		if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
+		if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 			*nextslash = '/';
 			return 2;
 		}
@@ -1560,14 +1560,14 @@
 
 		/* peel the first element of the subpath and recurse
 		*/
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 subtreelist_parse_cb,
-				 ( void * )( nextslash + 1 ),
+				 (void *)(nextslash + 1),
 				 &cbrval,
 				 NULL,
-				 0 );
+				 0);
 		return cbrval;
 
 	} else {
@@ -1576,43 +1576,43 @@
 		 * to the inomap.
 		 */
 
-		if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
+		if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 			return 1;
 		}
 
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 subtree_descend_cb,
 				 NULL,
 				 &cbrval,
 				 0,
-				 0 );
+				 0);
 		return 1;
 	}
 }
 
 static int
-subtree_descend_cb( void *arg1,
+subtree_descend_cb(void *arg1,
 		    jdm_fshandle_t *fshandlep,
 		    int fsfd,
 		    xfs_bstat_t *statp,
-		    char *name  )
+		    char *name)
 {
 	int cbrval = 0;
 
-	cb_add( NULL, fshandlep, fsfd, statp );
+	cb_add(NULL, fshandlep, fsfd, statp);
 
-	if ( ( statp->bs_mode & S_IFMT ) == S_IFDIR ) {
+	if ((statp->bs_mode & S_IFMT) == S_IFDIR) {
 
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 subtree_descend_cb,
 				 NULL,
 				 &cbrval,
 				 NULL,
-				 0 );
+				 0);
 	}
 
 	return cbrval;
@@ -1624,10 +1624,10 @@
 #define BMAP_LEN	512
 
 static off64_t
-quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
+quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 {
 	int fd;
-	getbmapx_t bmap[ BMAP_LEN ];
+	getbmapx_t bmap[BMAP_LEN];
 	off64_t offset;
 	off64_t offset_next;
 	off64_t qty_accum;
@@ -1644,51 +1644,51 @@
 	offset = 0;
 	offset_next = 0;
 	qty_accum = 0;
-	bmap[ 0 ].bmv_offset = 0;
-	bmap[ 0 ].bmv_length = -1;
-	bmap[ 0 ].bmv_count = BMAP_LEN;
-	bmap[ 0 ].bmv_iflags = BMV_IF_NO_DMAPI_READ;
-	bmap[ 0 ].bmv_entries = -1;
-	fd = jdm_open( fshandlep, statp, O_RDONLY );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
+	bmap[0].bmv_offset = 0;
+	bmap[0].bmv_length = -1;
+	bmap[0].bmv_count = BMAP_LEN;
+	bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
+	bmap[0].bmv_entries = -1;
+	fd = jdm_open(fshandlep, statp, O_RDONLY);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 		      "could not open ino %llu to read extent map: %s\n"),
 		      statp->bs_ino,
-		      strerror( errno ));
+		      strerror(errno));
 		return 0;
 	}
 
-	for ( ; ; ) {
+	for (; ;) {
 		int eix;
 		int rval;
 
-		rval = ioctl( fd, XFS_IOC_GETBMAPX, bmap );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
+		rval = ioctl(fd, XFS_IOC_GETBMAPX, bmap);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 			      "could not read extent map for ino %llu: %s\n"),
 			      statp->bs_ino,
-			      strerror( errno ));
-			( void )close( fd );
+			      strerror(errno));
+			(void)close(fd);
 			return 0;
 		}
 
-		if ( bmap[ 0 ].bmv_entries <= 0 ) {
-			assert( bmap[ 0 ].bmv_entries == 0 );
-			( void )close( fd );
+		if (bmap[0].bmv_entries <= 0) {
+			assert(bmap[0].bmv_entries == 0);
+			(void)close(fd);
 			return offset_next;
 		}
 
-		for ( eix = 1 ; eix <= bmap[ 0 ].bmv_entries ; eix++ ) {
-			getbmapx_t *bmapp = &bmap[ eix ];
+		for (eix = 1 ; eix <= bmap[0].bmv_entries ; eix++) {
+			getbmapx_t *bmapp = &bmap[eix];
 			off64_t qty_new;
-			if ( bmapp->bmv_block == -1 ) {
+			if (bmapp->bmv_block == -1) {
 				continue; /* hole */
 			}
 			offset = bmapp->bmv_offset * BBSIZE;
 			qty_new = qty_accum + bmapp->bmv_length * BBSIZE;
-			if ( qty_new >= qty ) {
-				( void )close( fd );
-				return offset + ( qty - qty_accum );
+			if (qty_new >= qty) {
+				(void)close(fd);
+				return offset + (qty - qty_accum);
 			}
 			offset_next = offset + bmapp->bmv_length * BBSIZE;
 			qty_accum = qty_new;
@@ -1699,9 +1699,9 @@
 
 
 static off64_t
-estimate_dump_space( xfs_bstat_t *statp )
+estimate_dump_space(xfs_bstat_t *statp)
 {
-	switch ( statp->bs_mode & S_IFMT ) {
+	switch (statp->bs_mode & S_IFMT) {
 	case S_IFREG:
 		/* very rough: must improve this.  If GETOPT_DUMPASOFFLINE was
 		 * specified and the HSM provided an estimate, then use it.
@@ -1719,7 +1719,7 @@
 			if (HsmEstimateFileSpace(hsm_fs_ctxtp, NULL, statp, &bytes, accurate))
 				return bytes;
 		}
-		return statp->bs_blocks * ( off64_t )statp->bs_blksize;
+		return statp->bs_blocks * (off64_t)statp->bs_blksize;
 	case S_IFIFO:
 	case S_IFCHR:
 	case S_IFDIR:
@@ -1734,11 +1734,11 @@
 	*/
 		return 0;
 	default:
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 		      "unknown inode type: ino=%llu, mode=0x%04x 0%06o\n"),
 		      statp->bs_ino,
 		      statp->bs_mode,
-		      statp->bs_mode );
+		      statp->bs_mode);
 		return 0;
 	}
 }
diff --git a/dump/inomap.h b/dump/inomap.h
index fb9bbf7..64b769a 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -47,7 +47,7 @@
  * fall at file boundaries. returns BOOL_FALSE if error encountered (should
  * abort the dump; else returns BOOL_TRUE.
  */
-extern bool_t inomap_build( void *fshandlep,
+extern bool_t inomap_build(void *fshandlep,
 			    int fsfd,
 			    struct xfs_bstat *rootstatp,
 			    bool_t last,
@@ -64,26 +64,26 @@
 			    ix_t *statphasep,
 			    ix_t *statpassp,
 			    size64_t statcnt,
-			    size64_t *statdonep );
+			    size64_t *statdonep);
 
-extern uint64_t inomap_getsz( void );
+extern uint64_t inomap_getsz(void);
 
 /* inomap_skip - tell inomap about inodes to skip in the dump
  */
-extern void inomap_skip( xfs_ino_t ino );
+extern void inomap_skip(xfs_ino_t ino);
 
 
 /* inomap_writehdr - updates the write header with inomap-private info
  * to be communicated to the restore side
  */
-extern void inomap_writehdr( content_inode_hdr_t *scwhdrp );
+extern void inomap_writehdr(content_inode_hdr_t *scwhdrp);
 
 
 /* inomap_dump - dumps the map to media - content-abstraction-knowledgable
  *
  * returns error from media write op
  */
-extern rv_t inomap_dump( drive_t *drivep );
+extern rv_t inomap_dump(drive_t *drivep);
 
 
 /* map state values
@@ -111,16 +111,16 @@
 
 typedef struct seg seg_t;
 
-#define INOPERSEG	( sizeof( (( seg_t * )0 )->lobits ) * NBBY )
+#define INOPERSEG	(sizeof(((seg_t *)0)->lobits) * NBBY)
 
-#define HNKSZ		( 4 * PGSZ )
-#define SEGPERHNK	( ( HNKSZ / sizeof( seg_t )) - 1 )
+#define HNKSZ		(4 * PGSZ)
+#define SEGPERHNK	((HNKSZ / sizeof(seg_t)) - 1)
 
 struct hnk {
-	seg_t seg[ SEGPERHNK ];
+	seg_t seg[SEGPERHNK];
 	xfs_ino_t maxino;
 	struct hnk *nextp;		/* no longer used, kept for binary compat */
-	char pad[sizeof( seg_t ) - sizeof( xfs_ino_t ) - sizeof( struct hnk * )];
+	char pad[sizeof(seg_t) - sizeof(xfs_ino_t) - sizeof(struct hnk *)];
 };
 
 typedef struct hnk hnk_t;
@@ -129,11 +129,11 @@
  * requires a pointer to a context block, obtained from
  * inomap_alloc_context(), and released by inomap_free_context().
  */
-extern void *inomap_alloc_context( void );
-extern void inomap_reset_context( void *contextp );
-extern void inomap_free_context( void *contextp );
-extern int inomap_get_state( void *contextp, xfs_ino_t ino );
-extern int inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen );
+extern void *inomap_alloc_context(void);
+extern void inomap_reset_context(void *contextp);
+extern void inomap_free_context(void *contextp);
+extern int inomap_get_state(void *contextp, xfs_ino_t ino);
+extern int inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen);
 
 
 /* generators returning the next dir or non-dir ino selected in this dump.
diff --git a/dump/var.c b/dump/var.c
index 6e3ead0..440e42d 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -34,137 +34,137 @@
 #include "global.h"
 #include "inventory.h"
 
-static void var_skip_recurse( char *, void ( * )( xfs_ino_t ));
-static int  var_create_component( char * );
+static void var_skip_recurse(char *, void (*)(xfs_ino_t));
+static int  var_create_component(char *);
 
 void
-var_create( void )
+var_create(void)
 {
 	char path[PATH_MAX];
 	char *p;
 
-	p = strcpy( path, XFSDUMP_DIRPATH );
-	mlog( MLOG_DEBUG, "creating directory %s\n", path );
+	p = strcpy(path, XFSDUMP_DIRPATH);
+	mlog(MLOG_DEBUG, "creating directory %s\n", path);
 
 	do {
 		p++;
-		if ( *p == '/' ) {
+		if (*p == '/') {
 			*p = '\0';
-			if ( ! var_create_component( path ) )
+			if (! var_create_component(path))
 				return;
 			*p = '/';
 		}
-	} while ( *p );
+	} while (*p);
 
-	( void ) var_create_component( path );
+	(void) var_create_component(path);
 }
 
 static int
-var_create_component( char *path )
+var_create_component(char *path)
 {
-	int rval = mkdir( path, 0755 );
+	int rval = mkdir(path, 0755);
 
-	if ( rval && errno != EEXIST ) {
-		mlog( MLOG_NORMAL, _("unable to create %s: %s\n"),
-		      path, strerror( errno ));
+	if (rval && errno != EEXIST) {
+		mlog(MLOG_NORMAL, _("unable to create %s: %s\n"),
+		      path, strerror(errno));
 		return 0;
 	}
-	if ( rval == 0 ) {
-		rval = chown( path, 0, 0 );
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _("unable to chown %s: %s\n"),
-			      path, strerror( errno ));
+	if (rval == 0) {
+		rval = chown(path, 0, 0);
+		if (rval) {
+			mlog(MLOG_NORMAL, _("unable to chown %s: %s\n"),
+			      path, strerror(errno));
 		}
 	}
 	return 1;
 }
 
 void
-var_skip( uuid_t *dumped_fsidp, void ( *cb )( xfs_ino_t ino ))
+var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino))
 {
 	uuid_t fsid;
 	int rval;
 
 	/* see if the fs uuid's match
 	 */
-	rval = fs_getid( XFSDUMP_DIRPATH, &fsid );
-	if ( rval ) {
+	rval = fs_getid(XFSDUMP_DIRPATH, &fsid);
+	if (rval) {
 #ifdef HIDDEN
                 /* NOTE: this will happen for non-XFS file systems */
                 /*       and is expected, so no msg */
-		mlog( MLOG_NORMAL, _(
+		mlog(MLOG_NORMAL, _(
 		      "unable to determine uuid of fs containing %s: "
 		      "%s\n"),
 		      XFSDUMP_DIRPATH,
-		      strerror( errno ));
+		      strerror(errno));
 #endif
 		return;
 	}
 
-	if ( uuid_compare( *dumped_fsidp, fsid ) != 0) {
+	if (uuid_compare(*dumped_fsidp, fsid) != 0) {
 		return;
 	}
 
 	/* traverse the xfsdump directory, getting inode numbers of it
 	 * and all of its children, and reporting those to the callback.
 	 */
-	var_skip_recurse( XFSDUMP_DIRPATH, cb );
+	var_skip_recurse(XFSDUMP_DIRPATH, cb);
 }
 
 static void
-var_skip_recurse( char *base, void ( *cb )( xfs_ino_t ino ))
+var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 {
 	struct stat64 statbuf;
 	DIR *dirp;
 	struct dirent *direntp;
 	int rval;
 
-	rval = lstat64( base, &statbuf );
-	if ( rval ) {
-		mlog( MLOG_NORMAL, _(
+	rval = lstat64(base, &statbuf);
+	if (rval) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to get status of %s: %s\n"),
 		      base,
-		      strerror( errno ));
+		      strerror(errno));
 		return;
 	}
 
-	mlog( MLOG_DEBUG,
+	mlog(MLOG_DEBUG,
 	      "excluding %s from dump\n",
-	      base );
+	      base);
 
-	( * cb )( statbuf.st_ino );
+	(* cb)(statbuf.st_ino);
 
-	if ( ( statbuf.st_mode & S_IFMT ) != S_IFDIR ) {
+	if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
 		return;
 	}
 
-	dirp = opendir( base );
-	if ( ! dirp ) {
-		mlog( MLOG_NORMAL, _(
+	dirp = opendir(base);
+	if (! dirp) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to open directory %s\n"),
-		      base );
+		      base);
 		return;
 	}
 
-	while ( ( direntp = readdir( dirp )) != NULL ) {
+	while ((direntp = readdir(dirp)) != NULL) {
 		char *path;
 
 		/* skip "." and ".."
 		 */
-		if ( *( direntp->d_name + 0 ) == '.'
+		if (*(direntp->d_name + 0) == '.'
 		     &&
-		     ( *( direntp->d_name + 1 ) == 0
+		     (*(direntp->d_name + 1) == 0
 		       ||
-		       ( *( direntp->d_name + 1 ) == '.'
+		       (*(direntp->d_name + 1) == '.'
 			 &&
-			 *( direntp->d_name + 2 ) == 0 ))) {
+			 *(direntp->d_name + 2) == 0))) {
 			continue;
 		}
 
-		path = open_pathalloc( base, direntp->d_name, 0 );
-		var_skip_recurse( path, cb );
-		free( ( void * )path );
+		path = open_pathalloc(base, direntp->d_name, 0);
+		var_skip_recurse(path, cb);
+		free((void *)path);
 	}
 
-	closedir( dirp );
+	closedir(dirp);
 }
diff --git a/dump/var.h b/dump/var.h
index 889a389..0a8f13d 100644
--- a/dump/var.h
+++ b/dump/var.h
@@ -21,8 +21,8 @@
 /* var.[ch] - abstraction dealing with /var/[lib/]xfsdump/
  */
 
-extern void var_create( void );
+extern void var_create(void);
 
-extern void var_skip( uuid_t *dumped_fsidp, void ( *cb )( xfs_ino_t ino ));
+extern void var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino));
 
 #endif /* VAR_H */
diff --git a/include/swab.h b/include/swab.h
index 2684aa7..abfeeb6 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -7,25 +7,25 @@
 #define ___swab16(x) \
 ({ \
 	__u16 __x = (x); \
-	((__u16)( \
+	((__u16)(\
 		(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
-		(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
+		(((__u16)(__x) & (__u16)0xff00U) >> 8))); \
 })
 
 #define ___swab32(x) \
 ({ \
 	__u32 __x = (x); \
-	((__u32)( \
+	((__u32)(\
 		(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
 		(((__u32)(__x) & (__u32)0x0000ff00UL) <<  8) | \
 		(((__u32)(__x) & (__u32)0x00ff0000UL) >>  8) | \
-		(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
+		(((__u32)(__x) & (__u32)0xff000000UL) >> 24))); \
 })
 
 #define ___swab64(x) \
 ({ \
 	__u64 __x = (x); \
-	((__u64)( \
+	((__u64)(\
 		(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
 		(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
 		(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
@@ -33,21 +33,21 @@
 		(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >>  8) | \
 		(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
 		(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-		(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
+		(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56))); \
 })
 
 #define ___constant_swab16(x) \
-	((__u16)( \
+	((__u16)(\
 		(((__u16)(x) & (__u16)0x00ffU) << 8) | \
-		(((__u16)(x) & (__u16)0xff00U) >> 8) ))
+		(((__u16)(x) & (__u16)0xff00U) >> 8)))
 #define ___constant_swab32(x) \
-	((__u32)( \
+	((__u32)(\
 		(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
 		(((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
 		(((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
-		(((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+		(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
 #define ___constant_swab64(x) \
-	((__u64)( \
+	((__u64)(\
 		(__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
 		(__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
 		(__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
@@ -55,7 +55,7 @@
 		(__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) | \
 		(__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
 		(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-		(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+		(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
 
 /*
  * provide defaults when no architecture-specific optimization is detected
diff --git a/include/swap.h b/include/swap.h
index fa6aec6..d74453f 100644
--- a/include/swap.h
+++ b/include/swap.h
@@ -51,11 +51,11 @@
 
 #define INT_SET(ref,arch,valueref) \
 	(__builtin_constant_p(valueref) ? \
-	(void)( (ref) = ( ((arch) != ARCH_NOCONVERT) ? \
-	  		   (INT_SWAP((ref),(valueref))) : (valueref)) ) : \
-	(void)( ((ref) = (valueref)), \
-			( ((arch) != ARCH_NOCONVERT) ? \
-			   (ref) = INT_SWAP((ref),(ref)) : 0 ) ))
+	(void)((ref) = (((arch) != ARCH_NOCONVERT) ? \
+	  		   (INT_SWAP((ref),(valueref))) : (valueref))) : \
+	(void)(((ref) = (valueref)), \
+			(((arch) != ARCH_NOCONVERT) ? \
+			   (ref) = INT_SWAP((ref),(ref)) : 0)))
 
 #define INT_XLATE(buf,p,dir,arch) \
 	((dir > 0) ? ((p) = INT_GET((buf),(arch))) : INT_SET((buf),(arch),(p)))
diff --git a/inventory/getopt.h b/inventory/getopt.h
index 7bebc6d..4ae23e4 100644
--- a/inventory/getopt.h
+++ b/inventory/getopt.h
@@ -32,7 +32,7 @@
 #define	GETOPT_DUMPDEST		'f'	/* dump dest. file (drive.c) */
 #define	GETOPT_LEVEL		'l'	/* dump level (content_inode.c) */
 #define	GETOPT_SUBTREE		's'	/* subtree dump (content_inode.c) */
-#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4 ) */
+#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4) */
 #define	GETOPT_DUMPLABEL	'L'	/* dump session label (global.c) */
 #define	GETOPT_MEDIALABEL	'M'	/* media object label (content.c) */
 #define	GETOPT_RESUME		'R'	/* resume intr dump (content_inode.c) */
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index eee128e..a5cb4df 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -47,7 +47,7 @@
 /*----------------------------------------------------------------------*/
 
 inv_idbtoken_t
-inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
+inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 {
 	int fd, stobjfd, num, retval;
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
@@ -55,17 +55,17 @@
 
 	int index = 0;
 
-	assert ( pred );
-	fd = retval = init_idb ( pred, bywhat, forwhat, &tok );
+	assert (pred);
+	fd = retval = init_idb (pred, bywhat, forwhat, &tok);
 
-	if ( retval == I_DONE )
+	if (retval == I_DONE)
 		return tok;
 
 	/* if we just want to search the db, all we need is the invidx.
 	   at this point, we know that a tok wasnt created in init_idb() */
-	if ( forwhat == INV_SEARCH_ONLY ) {
+	if (forwhat == INV_SEARCH_ONLY) {
 		/* fd == I_EMPTYINV or fd == valid fd */
-		tok = get_token( fd, -1);
+		tok = get_token(fd, -1);
 		tok->d_oflag = forwhat;
 		return tok;
 	}
@@ -73,51 +73,51 @@
 	/* XXX also, see if it is too full. if so, make another and leave a
 	   reference to the new file in the old one */
 
-	stobjfd = idx_get_stobj( fd, forwhat, &index );
-	if ( stobjfd < 0 ) {
-		close( fd );
+	stobjfd = idx_get_stobj(fd, forwhat, &index);
+	if (stobjfd < 0) {
+		close(fd);
 		return INV_TOKEN_NULL;
 	}
 
-	assert ( index > 0 );
+	assert (index > 0);
 
 	/* Now we need to make sure that this has enough space */
-	INVLOCK( stobjfd, LOCK_SH );
+	INVLOCK(stobjfd, LOCK_SH);
 
-	num = GET_SESCOUNTERS( stobjfd, &sescnt );
-	if ( num < 0 ) {
-		close( fd );
-		INVLOCK( stobjfd, LOCK_UN );
-		close( stobjfd );
+	num = GET_SESCOUNTERS(stobjfd, &sescnt);
+	if (num < 0) {
+		close(fd);
+		INVLOCK(stobjfd, LOCK_UN);
+		close(stobjfd);
 		return INV_TOKEN_NULL;
 	}
 
-	/* create another storage object ( and, an inv_index entry for it
-	   too ) if we've filled this one up */
+	/* create another storage object (and, an inv_index entry for it
+	   too) if we've filled this one up */
 
-	if ( (uint) num >= sescnt->ic_maxnum ) {
-		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
-		      "index entry. \n" );
-		INVLOCK( stobjfd, LOCK_UN );
+	if ((uint) num >= sescnt->ic_maxnum) {
+		mlog(MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
+		      "index entry. \n");
+		INVLOCK(stobjfd, LOCK_UN);
 		close (stobjfd);
 
-		INVLOCK( fd, LOCK_EX );
-		stobjfd = idx_create_entry( &tok, fd, BOOL_FALSE );
-		INVLOCK( fd, LOCK_UN );
+		INVLOCK(fd, LOCK_EX);
+		stobjfd = idx_create_entry(&tok, fd, BOOL_FALSE);
+		INVLOCK(fd, LOCK_UN);
 
-		free ( sescnt );
-		if ( stobjfd < 0 ) {
-			close( fd );
+		free (sescnt);
+		if (stobjfd < 0) {
+			close(fd);
 			return INV_TOKEN_NULL;
 		}
 		return tok;
 	}
 
-	INVLOCK( stobjfd, LOCK_UN );
+	INVLOCK(stobjfd, LOCK_UN);
 
-	free ( sescnt );
-	tok = get_token( fd, stobjfd );
-	tok->d_invindex_off = IDX_HDR_OFFSET( index - 1 );
+	free (sescnt);
+	tok = get_token(fd, stobjfd);
+	tok->d_invindex_off = IDX_HDR_OFFSET(index - 1);
 	tok->d_oflag = forwhat;
 	return tok;
 
@@ -134,12 +134,12 @@
 
 
 bool_t
-inv_close( inv_idbtoken_t tok )
+inv_close(inv_idbtoken_t tok)
 {
-	close ( tok->d_invindex_fd );
-	if ( tok->d_stobj_fd >= 0 )
-		close ( tok->d_stobj_fd );
-	destroy_token( tok );
+	close (tok->d_invindex_fd);
+	if (tok->d_stobj_fd >= 0)
+		close (tok->d_stobj_fd);
+	destroy_token(tok);
 	return BOOL_TRUE;
 }
 
@@ -167,7 +167,7 @@
 	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
-	char		*devpath )
+	char		*devpath)
 {
 	invt_session_t  ses;
 	int		fd;
@@ -177,17 +177,17 @@
 	inv_sestoken_t	sestok;
 	inv_oflag_t     forwhat;
 
-	assert ( tok != INV_TOKEN_NULL );
-	assert ( sesid && fsid && mntpt && devpath );
+	assert (tok != INV_TOKEN_NULL);
+	assert (sesid && fsid && mntpt && devpath);
 	forwhat = tok->d_oflag;
 	fd = tok->d_stobj_fd;
-	assert ( forwhat != INV_SEARCH_ONLY );
-	assert ( fd > 0 );
+	assert (forwhat != INV_SEARCH_ONLY);
+	assert (fd > 0);
 
-	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
-		if ( fstab_put_entry( fsid, mntpt, devpath, forwhat ) < 0 ) {
-		       mlog( MLOG_NORMAL | MLOG_INV, _(
-				"INV: put_fstab_entry failed.\n") );
+	if (! (tok->d_update_flag & FSTAB_UPDATED)) {
+		if (fstab_put_entry(fsid, mntpt, devpath, forwhat) < 0) {
+		       mlog(MLOG_NORMAL | MLOG_INV, _(
+				"INV: put_fstab_entry failed.\n"));
 		       return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag |= FSTAB_UPDATED;
@@ -195,12 +195,12 @@
 
 
 	/* copy the session information to store */
-	memset( (void *)&ses, 0, sizeof( ses ) );	/* paranoia */
-	memcpy( &ses.s_sesid, sesid, sizeof( uuid_t ) );
-	memcpy( &ses.s_fsid, fsid, sizeof( uuid_t ) );
-	strcpy( ses.s_label, label );
-	strcpy( ses.s_mountpt, mntpt );
-	strcpy( ses.s_devpath, devpath );
+	memset((void *)&ses, 0, sizeof(ses));	/* paranoia */
+	memcpy(&ses.s_sesid, sesid, sizeof(uuid_t));
+	memcpy(&ses.s_fsid, fsid, sizeof(uuid_t));
+	strcpy(ses.s_label, label);
+	strcpy(ses.s_mountpt, mntpt);
+	strcpy(ses.s_devpath, devpath);
 	ses.s_max_nstreams = nstreams;
 
         hdr.sh_pruned = 0; /* session is not pruned by invutil */
@@ -210,41 +210,41 @@
 	hdr.sh_flag |= (isresumed) ? INVT_RESUMED : 0;
 	/* sh_streams_off and sh_sess_off will be set in create_session() */
 
-	sestok = get_sesstoken( tok );
+	sestok = get_sesstoken(tok);
 
 	/* we need to put the new session in the appropriate place in
 	   storage object. So first find out howmany sessions are there */
 
-	INVLOCK( fd, LOCK_EX );
-	if ( GET_SESCOUNTERS( fd, &sescnt) < 0 ) {
-		free ( sestok );
-		INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_EX);
+	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
+		free (sestok);
+		INVLOCK(fd, LOCK_UN);
 		return INV_TOKEN_NULL;
 	}
 
 	/* create the writesession, and get ready for the streams to come
 	   afterwards */
-	rval = stobj_create_session( sestok, fd, sescnt, &ses, &hdr );
+	rval = stobj_create_session(sestok, fd, sescnt, &ses, &hdr);
 	assert (rval > 0);
 
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
 	sestok->sd_sesstime = time;
 
-	if ( tok->d_update_flag & NEW_INVINDEX ) {
-		if ( idx_put_sesstime( sestok, INVT_STARTTIME ) < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
-				"INV: put_starttime failed.\n") );
+	if (tok->d_update_flag & NEW_INVINDEX) {
+		if (idx_put_sesstime(sestok, INVT_STARTTIME) < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
+				"INV: put_starttime failed.\n"));
 			return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag &= ~(NEW_INVINDEX);
 	}
 
-	free ( sescnt );
+	free (sescnt);
 
 
-	return ( rval < 0 )? INV_TOKEN_NULL: sestok;
+	return (rval < 0)? INV_TOKEN_NULL: sestok;
 }
 
 
@@ -259,19 +259,19 @@
 
 
 bool_t
-inv_writesession_close( inv_sestoken_t tok )
+inv_writesession_close(inv_sestoken_t tok)
 {
 	int		rval;
 
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
 	/* now update end_time in the inv index header */
-	rval = idx_put_sesstime( tok, INVT_ENDTIME );
+	rval = idx_put_sesstime(tok, INVT_ENDTIME);
 
-	memset( tok, 0, sizeof( invt_sesdesc_entry_t ) );
-	free ( tok );
+	memset(tok, 0, sizeof(invt_sesdesc_entry_t));
+	free (tok);
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -285,7 +285,7 @@
 inv_stmtoken_t
 inv_stream_open(
 	inv_sestoken_t tok,
-	char		*cmdarg )
+	char		*cmdarg)
 {
 	inv_stmtoken_t stok;
 	invt_stream_t  stream;
@@ -294,21 +294,21 @@
 	int fd;
 	bool_t err = BOOL_FALSE;
 
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
 	/* this memset is needed as a dump interrupted/crashed very soon
 	 * after starting results in an inventory with exteremely large
 	 * starting/ending inodes or offsets. This can be misleading.
 	 * See bug #463702 for an example.
 	 */
-	memset( (void *)&stream, 0 , sizeof(invt_stream_t) );
+	memset((void *)&stream, 0 , sizeof(invt_stream_t));
 
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_TRUE; /* fix for 353197 */
-	strcpy( stream.st_cmdarg, cmdarg );
+	strcpy(stream.st_cmdarg, cmdarg);
 
 	/* XXX yukk... make the token descriptors not pointers */
-	stok = ( inv_stmtoken_t ) malloc( sizeof( invt_strdesc_entry_t ) );
+	stok = (inv_stmtoken_t) malloc(sizeof(invt_strdesc_entry_t));
 
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
@@ -316,46 +316,46 @@
 	/* get the session to find out where the stream is going to go */
 	fd = tok->sd_invtok->d_stobj_fd;
 
-	INVLOCK( fd, LOCK_EX );
+	INVLOCK(fd, LOCK_EX);
 
 	/* get the session header and the session */
-	if ( stobj_get_sessinfo( tok, &seshdr, &ses ) <= 0 )
+	if (stobj_get_sessinfo(tok, &seshdr, &ses) <= 0)
 		err = BOOL_TRUE;
 
-	if ( ( ! err )  && ses.s_cur_nstreams < ses.s_max_nstreams ) {
+	if ((! err)  && ses.s_cur_nstreams < ses.s_max_nstreams) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) *
-					         ses.s_cur_nstreams )
+		stok->md_stream_off = (off64_t) (sizeof(invt_stream_t) *
+					         ses.s_cur_nstreams)
 			                         + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
 
 		/* write it back. */
-		if ( PUT_REC_NOLOCK( fd, &ses, sizeof( ses ),
-				     tok->sd_session_off ) < 0 )
+		if (PUT_REC_NOLOCK(fd, &ses, sizeof(ses),
+				     tok->sd_session_off) < 0)
 			err = BOOL_TRUE;
-	} else if ( ! err ) {
-		mlog ( MLOG_NORMAL, _(
+	} else if (! err) {
+		mlog (MLOG_NORMAL, _(
 		       "INV: cant create more than %d streams."
-		       " Max'd out..\n"), ses.s_cur_nstreams );
+		       " Max'd out..\n"), ses.s_cur_nstreams);
 		err = BOOL_TRUE;
 	}
 
-	if ( ! err ) {
+	if (! err) {
 		stream.st_firstmfile = stream.st_lastmfile =
 			               stok->md_stream_off;
 
 		/* now write the stream header on to the disk */
-		if ( PUT_REC_NOLOCK( fd, &stream, sizeof( invt_stream_t ),
-				    stok->md_stream_off ) > 0 ) {
+		if (PUT_REC_NOLOCK(fd, &stream, sizeof(invt_stream_t),
+				    stok->md_stream_off) > 0) {
 			/* we're all set */
-			INVLOCK( fd, LOCK_UN );
+			INVLOCK(fd, LOCK_UN);
 			return stok;
 		}
 	}
 
 	/* error occured somewhere */
-	free ( stok );
-	INVLOCK( fd, LOCK_UN );
+	free (stok);
+	INVLOCK(fd, LOCK_UN);
 	return INV_TOKEN_NULL;
 
 }
@@ -372,36 +372,36 @@
 bool_t
 inv_stream_close(
 		inv_stmtoken_t	tok,
-		bool_t wasinterrupted )
+		bool_t wasinterrupted)
 {
 	invt_stream_t strm;
 	int fd = tok->md_sesstok->sd_invtok->d_stobj_fd;
 	int rval;
 	bool_t dowrite = BOOL_FALSE;
 
-	rval = idx_put_sesstime( tok->md_sesstok, INVT_ENDTIME );
+	rval = idx_put_sesstime(tok->md_sesstok, INVT_ENDTIME);
 	if (rval < 0)
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		      "INV: idx_put_sesstime failed in "
-		      "inv_stream_close() \n") );
-	INVLOCK( fd, LOCK_EX );
-	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ),
-			       tok->md_stream_off )) > 0 ) {
+		      "inv_stream_close() \n"));
+	INVLOCK(fd, LOCK_EX);
+	if ((rval = GET_REC_NOLOCK(fd, &strm, sizeof(invt_stream_t),
+			       tok->md_stream_off)) > 0) {
 
-		if ( strm.st_interrupted != wasinterrupted ) {
+		if (strm.st_interrupted != wasinterrupted) {
 			strm.st_interrupted = wasinterrupted;
 			dowrite = BOOL_TRUE;
 		}
 
 		/* get the last media file to figure out what our last
 		   ino was. we have a pointer to that in the stream token */
-		if ( tok->md_lastmfile ){
-			if ( strm.st_endino.ino !=
+		if (tok->md_lastmfile){
+			if (strm.st_endino.ino !=
 			      tok->md_lastmfile->mf_endino.ino ||
 			     strm.st_endino.offset !=
 			      tok->md_lastmfile->mf_endino.offset) {
 
-			      mlog( MLOG_DEBUG | MLOG_INV, "INV: stream_close() "
+			      mlog(MLOG_DEBUG | MLOG_INV, "INV: stream_close() "
 				    " - endinos dont match ! \n");
 			      dowrite = BOOL_TRUE;
 			      strm.st_endino = tok->md_lastmfile->mf_endino;
@@ -414,15 +414,15 @@
 		}
 	}
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
-	if ( tok->md_lastmfile ) {
-		free ( tok->md_lastmfile );
+	if (tok->md_lastmfile) {
+		free (tok->md_lastmfile);
 	}
-	memset( tok, 0, sizeof( invt_strdesc_entry_t ) );
-	free ( tok );
+	memset(tok, 0, sizeof(invt_strdesc_entry_t));
+	free (tok);
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 }
 
 
@@ -452,15 +452,15 @@
 	int 		 rval;
 
 
-	assert ( tok != INV_TOKEN_NULL );
-	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
-	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
+	assert (tok != INV_TOKEN_NULL);
+	assert (tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
+	assert (tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
 
-	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
+	mf = (invt_mediafile_t *) calloc(1, sizeof(invt_mediafile_t));
 
 	/* copy the media file information */
-	memcpy( &mf->mf_moid, moid, sizeof( uuid_t ) );
-	strcpy( mf->mf_label, label );
+	memcpy(&mf->mf_moid, moid, sizeof(uuid_t));
+	strcpy(mf->mf_label, label);
 	mf->mf_mfileidx = mfileindex;
 	mf->mf_startino.ino = startino;
 	mf->mf_startino.offset = startino_offset;
@@ -468,25 +468,25 @@
 	mf->mf_endino.offset = endino_offset;
 	mf->mf_size = size;
 	mf->mf_flag = 0;
-	if ( isgood )
+	if (isgood)
 		mf->mf_flag |= INVT_MFILE_GOOD;
 
 	/* This flag is used to indicate the media file that contains the
 	   dump of the sessioninfo structure that contains all but this
 	   media file */
-	if ( isinvdump )
+	if (isinvdump)
 		mf->mf_flag |= INVT_MFILE_INVDUMP;
 
-	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX );
-	rval = stobj_put_mediafile( tok, mf );
-	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN );
+	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX);
+	rval = stobj_put_mediafile(tok, mf);
+	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN);
 
 	/* we dont free the mfile here. we always keep the last mfile
 	   around, inside the inv_stmtoken, and when we add a new mfile,
 	   we free the previous one. The last one is freed in stream_close()
 	   */
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -510,7 +510,7 @@
 inv_get_sessioninfo(
 	inv_sestoken_t		tok,
 	void		      **bufpp,	/* buf to fill */
-	size_t		       *bufszp )/* size of that buffer */
+	size_t		       *bufszp)/* size of that buffer */
 {
 	invt_session_t 	ses;
 	invt_seshdr_t	hdr;
@@ -518,23 +518,23 @@
 	int		fd;
 
 
-	assert( tok != INV_TOKEN_NULL );
-	assert( tok->sd_invtok );
+	assert(tok != INV_TOKEN_NULL);
+	assert(tok->sd_invtok);
 	*bufpp = NULL;
 	*bufszp = 0;
 	fd = tok->sd_invtok->d_stobj_fd;
 
-	INVLOCK( fd, LOCK_SH );
+	INVLOCK(fd, LOCK_SH);
 
 	/* Next we get the session header, and the session information. Then
 	   we can figure out how much space to allocate */
-	if ( stobj_get_sessinfo( tok, &hdr, &ses ) <= 0 ) {
-		INVLOCK( fd, LOCK_UN );
+	if (stobj_get_sessinfo(tok, &hdr, &ses) <= 0) {
+		INVLOCK(fd, LOCK_UN);
 		return BOOL_FALSE;
 	}
 
-	rval = stobj_pack_sessinfo( fd, &ses, &hdr, bufpp, bufszp );
-	INVLOCK( fd, LOCK_UN );
+	rval = stobj_pack_sessinfo(fd, &ses, &hdr, bufpp, bufszp);
+	INVLOCK(fd, LOCK_UN);
 
 
 	return rval;
@@ -555,18 +555,18 @@
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_put_sessioninfo( invt_sessinfo_t *s )
+inv_put_sessioninfo(invt_sessinfo_t *s)
 {
 	static bool_t invdir_ok = BOOL_FALSE;
 
-	if ( !invdir_ok ) {
-		if ( make_invdirectory( INV_SEARCH_N_MOD ) < 0 )
+	if (!invdir_ok) {
+		if (make_invdirectory(INV_SEARCH_N_MOD) < 0)
 			return BOOL_FALSE;
 		else
 			invdir_ok = BOOL_TRUE;
 	}
 
-      	return insert_session( s );
+      	return insert_session(s);
 
 }
 
@@ -588,7 +588,7 @@
 	assert(ses);
 	assert(*ses);
 
-	for ( i = 0; i < (*ses)->s_nstreams; i++ ) {
+	for (i = 0; i < (*ses)->s_nstreams; i++) {
 		/* the array of mediafiles is contiguous */
 		free ((*ses)->s_streams[i].st_mediafiles);
 	}
@@ -619,12 +619,12 @@
 	time32_t	**tm)
 {
 	int 	rval;
-	if ( tok != INV_TOKEN_NULL ) {
+	if (tok != INV_TOKEN_NULL) {
 		rval =  search_invt(fsidp, tok->d_invindex_fd, &level,
 				    (void **)tm,
 				    (search_callback_t)tm_level_lessthan);
 
-		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+		return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
 
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid ptr */
@@ -652,12 +652,12 @@
 	inv_session_t	**ses)
 {
 	int 	rval;
-	if ( tok != INV_TOKEN_NULL ) {
+	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)ses,
 				   (search_callback_t)lastsess_level_lessthan);
 
-		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+		return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
 
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid */
@@ -684,15 +684,15 @@
 	uuid_t		*fsidp,
 	inv_idbtoken_t	tok,
 	u_char		level,
-	inv_session_t	**ses )
+	inv_session_t	**ses)
 {
 	int 	rval;
-	if ( tok != INV_TOKEN_NULL ) {
+	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)ses,
 				   (search_callback_t)lastsess_level_equalto);
 
-		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+		return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
 
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid */
@@ -758,7 +758,7 @@
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_delete_mediaobj( uuid_t *moid )
+inv_delete_mediaobj(uuid_t *moid)
 {
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 
@@ -771,8 +771,8 @@
 		         forall mediafiles (m) in strm {
 			     if (m.mediaobj == moid) {
 			     // delete m
-			     if ( --strm.nmediafiles == 0 )
-			        if ( --s.nstreams == 0 )
+			     if (--strm.nmediafiles == 0)
+			        if (--s.nstreams == 0)
 			            delete-session (s)
 			     }
 			 }
@@ -786,40 +786,40 @@
 	int numfs, i, fd, invfd;
 	char fname[INV_STRLEN];
 
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-	if ( fd < 0 || numfs <= 0 ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n") );
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+	if (fd < 0 || numfs <= 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n"));
 		return BOOL_FALSE;
 	}
 
-	close( fd );
+	close(fd);
 
-	for ( i = 0; i < numfs; i++) {
-		if ( fstab_get_fname( &arr[i].ft_uuid,
+	for (i = 0; i < numfs; i++) {
+		if (fstab_get_fname(&arr[i].ft_uuid,
 				      fname,
 				      (inv_predicate_t)INV_BY_UUID,
 				      forwhat
 				     )
-		     < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
-			      "INV: Cant get inv-name for uuid\n") );
+		     < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
+			      "INV: Cant get inv-name for uuid\n"));
 			return BOOL_FALSE;
 		}
-		strcat( fname, INV_INVINDEX_PREFIX );
-		invfd = open( fname, INV_OFLAG(forwhat));
-		if ( invfd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+		strcat(fname, INV_INVINDEX_PREFIX);
+		invfd = open(fname, INV_OFLAG(forwhat));
+		if (invfd < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Open failed on %s\n"),
-			     fname );
+			     fname);
 			return BOOL_FALSE;
 		}
 
 		if (search_invt(&arr[i].ft_uuid, invfd, NULL, (void **)&moid,
 				(search_callback_t)stobj_delete_mobj)
-		    < 0 )
+		    < 0)
 			return BOOL_FALSE;
 		/* we have to delete the session, etc */
-		close( invfd );
+		close(invfd);
 	}
 
 	return BOOL_TRUE;
@@ -899,8 +899,8 @@
 		rptr = wptr + 1;
 		while (*wptr != '\0')
 			*wptr++ = *rptr++;
-		while ( ( c = getopt( argc, argv, invoptstring)) != EOF ) {
-			switch ( c ) {
+		while ((c = getopt(argc, argv, invoptstring)) != EOF) {
+			switch (c) {
 			case GETOPT_INVPRINT:
 				prctx->depth = 0;
 				rval |= I_IFOUND ;
@@ -912,8 +912,8 @@
 		optarg = NULL;
 	}
 
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_INVPRINT:
 			rval |= I_IFOUND ;
 			if ((options = optarg) == NULL)
@@ -924,7 +924,7 @@
 				if (value == NULL && d != OPT_FSTAB &&
 				     d != OPT_INVIDX && d != OPT_INVCHECK)
 					continue;
-				switch( d ) {
+				switch(d) {
 					/* process mntpt option */
 				      case OPT_MNT:
 					bywhat = (inv_predicate_t) INV_BY_MOUNTPT;
@@ -950,14 +950,14 @@
 				      case OPT_DEPTH:
 					prctx->depth = atoi(value);
 					if (prctx->depth < 0 ||
-					    prctx->depth > 4 )
+					    prctx->depth > 4)
 						prctx->depth = 0;
 					break;
 
 				      case OPT_MOBJID:
 					{
 					uuid_t *u;
-					u = malloc ( sizeof( uuid_t ) );
+					u = malloc (sizeof(uuid_t));
 					uuid_parse(value, *u);
 					prctx->mobj.type = INVT_MOID;
 					prctx->mobj.value = (void *)u;
@@ -988,13 +988,13 @@
 					break;
 
 				      default:
-					if ( strlen(value) == 1 &&
-					     atoi(value) < PR_MAXDEPTH )
+					if (strlen(value) == 1 &&
+					     atoi(value) < PR_MAXDEPTH)
 						prctx->depth = atoi(value);
 					else {
-						mlog( MLOG_NORMAL | MLOG_INV, _(
+						mlog(MLOG_NORMAL | MLOG_INV, _(
 					       "INV: invalid sub-option %s"
-					       " for -I option\n"), value );
+					       " for -I option\n"), value);
 						rval |= I_IERR;
 					}
 					break;
@@ -1006,18 +1006,18 @@
 	}
 
 	if (npreds > 1) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		     "INV: Only one of mnt=,dev= and fsid=value can be used.\n")
 		     );
 		rval |= I_IERR;
 	}
 	else if (npreds2 > 1) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		     "INV: Only one of mobjid= and mobjlabel= can be used.\n")
 		     );
 		rval |= I_IERR;
 	}
-	else if ( (rval & I_IFOUND) && !(rval & I_IERR) && fs
+	else if ((rval & I_IFOUND) && !(rval & I_IERR) && fs
 		 && ! prctx->fstab && ! prctx->invcheck) {
 		inv_idbtoken_t tok;
 
@@ -1032,33 +1032,33 @@
 			invt_counter_t *cnt = NULL;
 			inv_oflag_t forwhat = INV_SEARCH_ONLY;
 
-			fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-			free( cnt );
+			fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+			free(cnt);
 
 			rval |= I_IERR; /* Cleared if successful */
 
-			if ( fd >= 0 ) {
-				for ( i = 0; i < numfs; i++ ) {
+			if (fd >= 0) {
+				for (i = 0; i < numfs; i++) {
 					tok = inv_open(
-						(inv_predicate_t )INV_BY_UUID,
+						(inv_predicate_t)INV_BY_UUID,
 						INV_SEARCH_ONLY,
-						&arr[i].ft_uuid );
-					if ( tok == INV_TOKEN_NULL )
+						&arr[i].ft_uuid);
+					if (tok == INV_TOKEN_NULL)
 						break;
-					if ( STREQL( arr[i].ft_mountpt, fs) ) {
+					if (STREQL(arr[i].ft_mountpt, fs)) {
 						prctx->index = i;
 						invmgr_inv_print(
 						          tok->d_invindex_fd,
-							  prctx );
+							  prctx);
 						rval &= ~(I_IERR);
 					}
-					inv_close( tok );
+					inv_close(tok);
 				}
-				free ( arr );
+				free (arr);
 				rval |= I_IDONE;
 			}
-			if ( (rval&I_IERR) ) {
-				mlog( MLOG_NORMAL | MLOG_INV, _(
+			if ((rval&I_IERR)) {
+				mlog(MLOG_NORMAL | MLOG_INV, _(
 				    "INV: open failed on mount point \"%s\"\n"),
 				     fs);
 			}
@@ -1066,14 +1066,14 @@
 		}
 
 		/* We have to print only one file system to print by UUID */
-		tok = inv_open( bywhat, INV_SEARCH_ONLY, fs);
-		if ( tok != INV_TOKEN_NULL ) {
+		tok = inv_open(bywhat, INV_SEARCH_ONLY, fs);
+		if (tok != INV_TOKEN_NULL) {
 			prctx->index = 0;
 			invmgr_inv_print(tok->d_invindex_fd, prctx);
-			inv_close( tok );
+			inv_close(tok);
 			rval |= I_IDONE;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: open failed on file system id \"%s\"\n"),
 			     fs);
 			rval |= I_IERR;
@@ -1085,7 +1085,7 @@
 
 /* This prints out all the sessions of a filesystem that are in the inventory */
 bool_t
-inv_DEBUG_print( int argc, char **argv )
+inv_DEBUG_print(int argc, char **argv)
 {
 	invt_counter_t *cnt = NULL;
 	invt_fstab_t *arr = NULL;
@@ -1099,37 +1099,37 @@
 	prctx.level = PR_MAXLEVEL;
 
 	/* If user didnt indicate -i option, we can't do anything */
-	rval = inv_getopt( argc, argv, &prctx );
+	rval = inv_getopt(argc, argv, &prctx);
 
 	if (!prctx.invcheck && ! prctx.fstab) {
 		if (! (rval & I_IFOUND)) {
 			return BOOL_TRUE;
-		} else if ( rval & I_IERR || rval & I_IDONE ) {
+		} else if (rval & I_IERR || rval & I_IDONE) {
 			return BOOL_FALSE;
 		}
 	}
 
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-	free( cnt );
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+	free(cnt);
 
-	if ( fd >= 0 ) {
+	if (fd >= 0) {
 		 if (prctx.fstab) {
-			 fstab_DEBUG_print( arr, numfs );
+			 fstab_DEBUG_print(arr, numfs);
 			 if (! prctx.invidx)
 				 return BOOL_FALSE;
 		 }
 
-		for ( i = 0; i < numfs; i++ ) {
-			tok = inv_open( ( inv_predicate_t )INV_BY_UUID,
+		for (i = 0; i < numfs; i++) {
+			tok = inv_open((inv_predicate_t)INV_BY_UUID,
 					forwhat,
-				        &arr[i].ft_uuid );
-			if ( tok == INV_TOKEN_NULL ) {
-				free ( arr );
+				        &arr[i].ft_uuid);
+			if (tok == INV_TOKEN_NULL) {
+				free (arr);
 				return BOOL_FALSE;
 			}
 
 			if (prctx.invcheck) {
-				mlog( MLOG_VERBOSE | MLOG_INV, _(
+				mlog(MLOG_VERBOSE | MLOG_INV, _(
 				     "INV: checking fs \"%s\"\n"),
 				     &arr[i].ft_mountpt
 				     );
@@ -1137,10 +1137,10 @@
 			}
 			else {
 				prctx.index = i;
-				invmgr_inv_print( tok->d_invindex_fd,
-						 &prctx );
+				invmgr_inv_print(tok->d_invindex_fd,
+						 &prctx);
 			}
-			inv_close( tok );
+			inv_close(tok);
 		}
 	}
 
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index f9866a5..d95d0c5 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -46,30 +46,30 @@
 /*----------------------------------------------------------------------*/
 
 int
-get_counters( int fd, void **cntpp, size_t cntsz )
+get_counters(int fd, void **cntpp, size_t cntsz)
 {
 	/* object must be locked at least SHARED by caller */
 	uint num;
-	assert( cntsz >= sizeof( invt_counter_t ) );
+	assert(cntsz >= sizeof(invt_counter_t));
 
-	*cntpp =  calloc( 1, cntsz);
+	*cntpp =  calloc(1, cntsz);
 
 	/* find the number of sessions and the max possible */
-	if ( GET_REC_NOLOCK( fd, (void *) *cntpp, cntsz, (off64_t) 0 ) < 0 ) {
-		free( *cntpp );
+	if (GET_REC_NOLOCK(fd, (void *) *cntpp, cntsz, (off64_t) 0) < 0) {
+		free(*cntpp);
 		*cntpp = NULL;
 		return -1;
 	}
 
 	num = ((invt_counter_t *)(*cntpp))->ic_curnum;
 
-	if ( ( (invt_counter_t *)(*cntpp))->ic_vernum != INV_VERSION ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+	if (((invt_counter_t *)(*cntpp))->ic_vernum != INV_VERSION) {
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		      "INV : Unknown version %d - Expected version %d\n"),
-		      (int) ( (invt_counter_t *)(*cntpp))->ic_vernum,
-		      (int) INV_VERSION );
-		assert ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
-			INV_VERSION );
+		      (int) ((invt_counter_t *)(*cntpp))->ic_vernum,
+		      (int) INV_VERSION);
+		assert (((invt_counter_t *)(*cntpp))->ic_vernum ==
+			INV_VERSION);
 	}
 
 	return (int) num;
@@ -84,19 +84,19 @@
 /*----------------------------------------------------------------------*/
 
 int
-get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
+get_headers(int fd, void **hdrs, size_t bufsz, size_t off)
 {
 
-	*hdrs = malloc( bufsz );
-	if ( *hdrs == NULL ) {
-		INV_PERROR( _("get_headers() - malloc(seshdrs)\n") );
+	*hdrs = malloc(bufsz);
+	if (*hdrs == NULL) {
+		INV_PERROR(_("get_headers() - malloc(seshdrs)\n"));
 		return -1;
 	}
 	/* file must be locked at least SHARED by caller */
 
 	/* get the array of hdrs */
-	if ( GET_REC_NOLOCK( fd, (void *) *hdrs, bufsz, (off64_t)off ) < 0 ) {
-		free ( *hdrs );
+	if (GET_REC_NOLOCK(fd, (void *) *hdrs, bufsz, (off64_t)off) < 0) {
+		free (*hdrs);
 		*hdrs = NULL;
 		return -1;
 	}
@@ -111,26 +111,26 @@
 /*----------------------------------------------------------------------*/
 
 int
-get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
-		bool_t dolock )
+get_invtrecord(int fd, void *buf, size_t bufsz, off64_t off,
+		bool_t dolock)
 {
 	int  nread;
 
-	assert ( fd >= 0 );
+	assert (fd >= 0);
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_SH );
+	if (dolock)
+		INVLOCK(fd, LOCK_SH);
 
 	nread = pread(fd, buf, bufsz, (off_t)off);
-	if (  nread != (int) bufsz ) {
-		INV_PERROR( _("Error in reading inventory record :") );
-		if ( dolock )
-			INVLOCK( fd, LOCK_UN );
+	if (nread != (int) bufsz) {
+		INV_PERROR(_("Error in reading inventory record :"));
+		if (dolock)
+			INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_UN );
+	if (dolock)
+		INVLOCK(fd, LOCK_UN);
 
 	return nread;
 }
@@ -145,23 +145,23 @@
 /*----------------------------------------------------------------------*/
 
 int
-put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock )
+put_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock)
 {
 	int nwritten;
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_EX );
+	if (dolock)
+		INVLOCK(fd, LOCK_EX);
 
 	nwritten = pwrite(fd, buf, bufsz, (off_t)off);
-	if (nwritten != (int) bufsz ) {
-		INV_PERROR( _("Error in writing inventory record :") );
-		if ( dolock )
-			INVLOCK( fd, LOCK_UN );
+	if (nwritten != (int) bufsz) {
+		INV_PERROR(_("Error in writing inventory record :"));
+		if (dolock)
+			INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_UN );
+	if (dolock)
+		INVLOCK(fd, LOCK_UN);
 	return nwritten;
 }
 
@@ -177,25 +177,25 @@
 
 
 int
-get_headerinfo( int fd, void **hdrs, void **cnt,
-	        size_t hdrsz, size_t cntsz, bool_t dolock )
+get_headerinfo(int fd, void **hdrs, void **cnt,
+	        size_t hdrsz, size_t cntsz, bool_t dolock)
 {
 	int num;
 
 	/* get a lock on the table for reading */
-	if ( dolock ) INVLOCK( fd, LOCK_SH );
+	if (dolock) INVLOCK(fd, LOCK_SH);
 
-	num = get_counters( fd, cnt, cntsz );
+	num = get_counters(fd, cnt, cntsz);
 
 	/* If there are no sessions recorded yet, we're done too */
-	if ( num > 0 ) {
-		if ( get_headers( fd, hdrs, hdrsz * (size_t)num, cntsz ) < 0 ) {
-			free ( *cnt );
+	if (num > 0) {
+		if (get_headers(fd, hdrs, hdrsz * (size_t)num, cntsz) < 0) {
+			free (*cnt);
 			num = -1;
 		}
 	}
 
-	if ( dolock ) INVLOCK( fd, LOCK_UN );
+	if (dolock) INVLOCK(fd, LOCK_UN);
 	return num;
 }
 
@@ -206,25 +206,25 @@
 /*----------------------------------------------------------------------*/
 
 int
-get_lastheader( int fd, void **ent, size_t hdrsz, size_t cntsz )
+get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 {
 	int	     	 nindices;
 	void	 	 *arr = NULL;
 	invt_counter_t	 *cnt = NULL;
 	char 		 *pos;
 	/* get the entries in the inv_index */
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( fd, &arr, (void **)&cnt,
-					 hdrsz, cntsz )) <= 0 ) {
+	if ((nindices = GET_ALLHDRS_N_CNTS(fd, &arr, (void **)&cnt,
+					 hdrsz, cntsz)) <= 0) {
 		return -1;
 	}
 
 	/* if there's space anywhere at all, then it must be in the last
 	   entry */
-	*ent = malloc( hdrsz );
-	pos = (char *) arr + ( (uint)nindices - 1 ) * hdrsz;
-	memcpy( *ent, pos, hdrsz );
-	free ( arr );
-	free ( cnt );
+	*ent = malloc(hdrsz);
+	pos = (char *) arr + ((uint)nindices - 1) * hdrsz;
+	memcpy(*ent, pos, hdrsz);
+	free (arr);
+	free (cnt);
 
 	return nindices;
 }
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index 46f6b8f..ae4642d 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -49,35 +49,35 @@
 static char inv_lockfilep[MGR_PATH_MAX];
 
 char *
-inv_dirpath( void )
+inv_dirpath(void)
 {
 	assert(inv_base);
 	return inv_dirpathp;
 }
 
 char *
-inv_fstab( void )
+inv_fstab(void)
 {
 	assert(inv_base);
 	return inv_fstabp;
 }
 
 char *
-inv_lockfile( void )
+inv_lockfile(void)
 {
 	assert(inv_base);
 	return inv_lockfilep;
 }
 
 char *
-inv_basepath( void )
+inv_basepath(void)
 {
 	assert(inv_base);
 	return inv_base;
 }
 
 int
-inv_setup_base( void )
+inv_setup_base(void)
 {
 	struct stat64 new_sbuf, old_sbuf;
 	int new_exists, old_exists;
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 5f7e734..bc56f30 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -49,28 +49,28 @@
 
 
 int
-fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
-	      inv_oflag_t forwhat )
+fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
+	      inv_oflag_t forwhat)
 {
 	int fd;
 
-	fd = open ( INV_FSTAB, INV_OFLAG(forwhat) );
+	fd = open (INV_FSTAB, INV_OFLAG(forwhat));
 
-	if ( fd < 0 )
+	if (fd < 0)
 		return -1; /* if ENOENT, fstab_put_entry will CREAT */
 
-	INVLOCK( fd, LOCK_EX );
-	if (( *numfs = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void**) arr,
+	INVLOCK(fd, LOCK_EX);
+	if ((*numfs = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void**) arr,
 						 (void **)cnt,
-						 sizeof( invt_fstab_t ),
-						 sizeof( invt_counter_t ) )
-	     ) < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
-			"INV: couldn't get fstab headers\n") );
+						 sizeof(invt_fstab_t),
+						 sizeof(invt_counter_t))
+	     ) < 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _(
+			"INV: couldn't get fstab headers\n"));
 	}
 #ifdef INVT_DEBUG
-	mlog( MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n",
-	      *numfs );
+	mlog(MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n",
+	      *numfs);
 #endif
 	/* fstab is left locked EX on exit. The caller takes does
 	   the unlocking */
@@ -88,53 +88,53 @@
 
 
 int
-fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
+fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 {
 	int numfs, i, fd;
 	invt_counter_t *cnt;
 	invt_fstab_t *arr;
 	int rval = 1;
 
-	assert( forwhat != INV_SEARCH_ONLY );
+	assert(forwhat != INV_SEARCH_ONLY);
 
 	/* fd is locked on succesful return */
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-	if ( fd < 0 ) {
-		if ( errno != ENOENT ) {
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+	if (fd < 0) {
+		if (errno != ENOENT) {
 			return -1;
 		}
-		if ((fd = open( INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ))
-		    < 0 ) {
-			INV_PERROR ( INV_FSTAB );
+		if ((fd = open(INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR))
+		    < 0) {
+			INV_PERROR (INV_FSTAB);
 			return -1;
 		}
 
-		INVLOCK( fd, LOCK_EX );
-		fchmod( fd, INV_PERMS );
+		INVLOCK(fd, LOCK_EX);
+		fchmod(fd, INV_PERMS);
 
-		cnt = (invt_counter_t *) malloc( sizeof ( invt_counter_t ) );
+		cnt = (invt_counter_t *) malloc(sizeof (invt_counter_t));
 
 		cnt->ic_maxnum = -1;
 		cnt->ic_curnum = 0;
 		cnt->ic_vernum = INV_VERSION;
 
-	} else if ( numfs > 0 ) {
+	} else if (numfs > 0) {
 
 		for (i = 0; i < numfs; i++) {
-		    if ( uuid_compare( *fsidp, arr[ i ].ft_uuid ) == 0 ) {
+		    if (uuid_compare(*fsidp, arr[i].ft_uuid) == 0) {
 
-/*			if ( ( STREQL( arr[i].ft_mountpt, mntpt ) ) &&
-			    ( STREQL( arr[i].ft_devpath, dev ) ) )
+/*			if ((STREQL(arr[i].ft_mountpt, mntpt)) &&
+			    (STREQL(arr[i].ft_devpath, dev)))
 */
-				free ( arr );
-				free ( cnt );
-				close( fd );
+				free (arr);
+				free (cnt);
+				close(fd);
 				return 1;
 
 		}
 	    }
 	    /* entry not found. just follow thru to create a new one */
-	    free ( arr );
+	    free (arr);
 	}
 
 	/* make a new fstab entry and insert it at the end. the table
@@ -143,29 +143,29 @@
 		invt_fstab_t ent;
 		off64_t hoff;
 
-		memcpy( &ent.ft_uuid, fsidp, sizeof( uuid_t ) );
-		strcpy( ent.ft_mountpt, mntpt );
-		strcpy( ent.ft_devpath, dev );
+		memcpy(&ent.ft_uuid, fsidp, sizeof(uuid_t));
+		strcpy(ent.ft_mountpt, mntpt);
+		strcpy(ent.ft_devpath, dev);
 
 		/* increase the number of entries first */
 #ifdef INVT_DEBUG
-		mlog( MLOG_NITTY | MLOG_INV,"INV: putting new fstab entry for %s ....\n",
+		mlog(MLOG_NITTY | MLOG_INV,"INV: putting new fstab entry for %s ....\n",
 		      mntpt);
 #endif
 		cnt->ic_curnum++;
-		hoff = (off64_t) ( sizeof( invt_counter_t ) +
-				 (size_t)( cnt->ic_curnum - 1 ) *
-				           sizeof( invt_fstab_t ) );
+		hoff = (off64_t) (sizeof(invt_counter_t) +
+				 (size_t)(cnt->ic_curnum - 1) *
+				           sizeof(invt_fstab_t));
 
-		rval = PUT_COUNTERS( fd, cnt );
-		if ( rval > 0 ) {
-		      rval = PUT_REC_NOLOCK( fd, &ent, sizeof( ent ), hoff );
+		rval = PUT_COUNTERS(fd, cnt);
+		if (rval > 0) {
+		      rval = PUT_REC_NOLOCK(fd, &ent, sizeof(ent), hoff);
 		}
 
 	}
-	INVLOCK( fd, LOCK_UN );
-	free ( cnt );
-	close ( fd );
+	INVLOCK(fd, LOCK_UN);
+	free (cnt);
+	close (fd);
 	return rval;
 }
 
@@ -174,7 +174,7 @@
 
 
 int
-fstab_get_fname( void *pred,
+fstab_get_fname(void *pred,
 		 char *fname,
 		 inv_predicate_t bywhat,
 		 inv_oflag_t forwhat)
@@ -189,34 +189,34 @@
 		invt_counter_t *cnt;
 
 		/* on sucessful return fd is locked */
-		fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-		if ( fd < 0 )
+		fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+		if (fd < 0)
 			return -1;
-		if ( numfs <= 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+		if (numfs <= 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			      "INV: No recorded filesystems in"
-			      " inventory's fstab.\n") );
+			      " inventory's fstab.\n"));
 			return -1;
 		}
-		INVLOCK( fd, LOCK_UN );
-		close ( fd );
-		free ( cnt ); /* we dont need it */
+		INVLOCK(fd, LOCK_UN);
+		close (fd);
+		free (cnt); /* we dont need it */
 
 		/* first get hold of the uuid for this mount point/device */
 
 		for (i = 0; i < numfs; i++) {
-			if ( ( bywhat == INV_BY_MOUNTPT &&
-			     ( STREQL( arr[i].ft_mountpt, pred ) )) ||
-			     ( bywhat == INV_BY_DEVPATH &&
-			     ( STREQL( arr[i].ft_devpath, pred ) )) ) {
+			if ((bywhat == INV_BY_MOUNTPT &&
+			     (STREQL(arr[i].ft_mountpt, pred))) ||
+			     (bywhat == INV_BY_DEVPATH &&
+			     (STREQL(arr[i].ft_devpath, pred)))) {
 
 				uuidp = &arr[i].ft_uuid;
 				break;
 			}
 		}
 #ifdef INVT_DEBUG
-		if (! uuidp )
-			mlog( MLOG_DEBUG | MLOG_INV,"INV: get_fname: unable to find %s"
+		if (! uuidp)
+			mlog(MLOG_DEBUG | MLOG_INV,"INV: get_fname: unable to find %s"
 			      " in the inventory\n", (char *)pred);
 #endif
 
@@ -224,35 +224,35 @@
 		uuidp = (uuid_t *)pred;
 	}
 
-	if (! uuidp )
+	if (! uuidp)
 		return -1;
 
-	uuid_unparse( *uuidp, uuidstr );
+	uuid_unparse(*uuidp, uuidstr);
 
-	strncpy ( fname, INV_DIRPATH, INV_STRLEN );
-	strcat ( fname, "/" );
-	strcat ( fname, uuidstr);
+	strncpy (fname, INV_DIRPATH, INV_STRLEN);
+	strcat (fname, "/");
+	strcat (fname, uuidstr);
 
-	if ( bywhat != INV_BY_UUID )
-		free ( arr );
+	if (bywhat != INV_BY_UUID)
+		free (arr);
 
-	assert( (int) strlen( fname ) < INV_STRLEN );
+	assert((int) strlen(fname) < INV_STRLEN);
 	return 1;
 }
 
 
 void
-fstab_DEBUG_print( invt_fstab_t *arr, int num )
+fstab_DEBUG_print(invt_fstab_t *arr, int num)
 {
 	int i;
 	char str[UUID_STR_LEN + 1];
 
-	mlog( MLOG_NORMAL | MLOG_INV, _("\n\n--------- fstab ------------\n") );
-	for ( i = 0; i < num; i++ ) {
-		printf( _("Mount\t%s\n"), arr[i].ft_mountpt );
-		printf( _("Dev\t%s\n"), arr[i].ft_devpath );
-		uuid_unparse( arr[i].ft_uuid, str );
-		printf( _("FSid\t%s\n\n"), str );
+	mlog(MLOG_NORMAL | MLOG_INV, _("\n\n--------- fstab ------------\n"));
+	for (i = 0; i < num; i++) {
+		printf(_("Mount\t%s\n"), arr[i].ft_mountpt);
+		printf(_("Dev\t%s\n"), arr[i].ft_devpath);
+		uuid_unparse(arr[i].ft_uuid, str);
+		printf(_("FSid\t%s\n\n"), str);
 	}
-	mlog( MLOG_NORMAL | MLOG_INV, "\n---------========------------\n" );
+	mlog(MLOG_NORMAL | MLOG_INV, "\n---------========------------\n");
 }
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index b33983d..7f50a2b 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -44,10 +44,10 @@
 /* into.                                                                */
 /*----------------------------------------------------------------------*/
 uint
-idx_insert_newentry( int fd, /* kept locked EX by caller */
+idx_insert_newentry(int fd, /* kept locked EX by caller */
 		     int *stobjfd, /* OUT */
 		     invt_entry_t *iarr, invt_counter_t *icnt,
-		     time32_t tm )
+		     time32_t tm)
 {
 	uint i;
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
@@ -56,42 +56,42 @@
 
 	/* If time period of the new entry is before our first invindex,
 	   we have to insert a new invindex in the first slot */
-	if ( iarr[0].ie_timeperiod.tp_start > tm ) {
-		/* *stobjfd = idx_put_newentry( fd, 0, iarr, icnt, &ient );*/
-		*stobjfd = open( iarr[0].ie_filename, INV_OFLAG(forwhat) );
+	if (iarr[0].ie_timeperiod.tp_start > tm) {
+		/* *stobjfd = idx_put_newentry(fd, 0, iarr, icnt, &ient);*/
+		*stobjfd = open(iarr[0].ie_filename, INV_OFLAG(forwhat));
 		return 0;
 	}
 
-	for ( i = 0; i < icnt->ic_curnum; i++ ) {
+	for (i = 0; i < icnt->ic_curnum; i++) {
 		/* if our time is nicely within an existing entry's time
 		   period, hellalujah */
-		if ( IS_WITHIN( &iarr[i].ie_timeperiod, tm ) ) {
+		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm)) {
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n",i );
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n",i);
 #endif
-			*stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+			*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			return i;
 		}
-		if ( iarr[i].ie_timeperiod.tp_end == 0  &&
-		     iarr[i].ie_timeperiod.tp_start  == 0 ) {
+		if (iarr[i].ie_timeperiod.tp_end == 0  &&
+		     iarr[i].ie_timeperiod.tp_start  == 0) {
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV, "INV: end = start \n" );
-			mlog( MLOG_DEBUG | MLOG_INV,"BEF: st %ld end %ld\n",
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: end = start \n");
+			mlog(MLOG_DEBUG | MLOG_INV,"BEF: st %ld end %ld\n",
 			     iarr[i].ie_timeperiod.tp_start,
-			     iarr[i].ie_timeperiod.tp_end );
+			     iarr[i].ie_timeperiod.tp_end);
 #endif
 
 			iarr[i].ie_timeperiod.tp_start =
 				iarr[i].ie_timeperiod.tp_end = tm;
-			PUT_REC_NOLOCK( fd, iarr,
+			PUT_REC_NOLOCK(fd, iarr,
 				       icnt->ic_curnum * sizeof(invt_entry_t),
-				       (off64_t) sizeof( invt_counter_t ) );
+				       (off64_t) sizeof(invt_counter_t));
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV,"AFT: st %ld end %ld\n",
+			mlog(MLOG_DEBUG | MLOG_INV,"AFT: st %ld end %ld\n",
 			     iarr[i].ie_timeperiod.tp_start,
-			     iarr[i].ie_timeperiod.tp_end );
+			     iarr[i].ie_timeperiod.tp_end);
 #endif
-			*stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+			*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			return i;
 		}
 
@@ -99,9 +99,9 @@
 
 		/* if it is beyond the end of this timeperiod, see if we
 		   belong to a timeperiod that doesn't have an entry */
-		if ( iarr[i].ie_timeperiod.tp_end < tm ) {
+		if (iarr[i].ie_timeperiod.tp_end < tm) {
 			/* see if we're the last entry here */
-			if ( i == icnt->ic_curnum - 1 ) {
+			if (i == icnt->ic_curnum - 1) {
 				/* our slot is (i+1)th entry. Make the
 				   timeperiod's the same as it was. As far
 				   as I can see there is no way that
@@ -109,13 +109,13 @@
 
 				   insert the new entry and write back
 				   icnt and invindex entry */
-				/* *stobjfd = idx_put_newentry( fd, i+1, iarr,
-							     icnt, &ient );*/
-			      *stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
+							     icnt, &ient);*/
+			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			      return i;
 			}
 			/* see if the next entry starts later than us */
-			if ( iarr[i+1].ie_timeperiod.tp_start > tm ) {
+			if (iarr[i+1].ie_timeperiod.tp_start > tm) {
 
 
 				/* We have the option of pushing entries
@@ -125,22 +125,22 @@
 				   We choose the former. */
 
 				/* the timeperiods had better not overlap */
-				assert(( tm > iarr[i].ie_timeperiod.tp_end ) &&
-				       ( tm < iarr[i+1].ie_timeperiod.tp_start ));
+				assert((tm > iarr[i].ie_timeperiod.tp_end) &&
+				       (tm < iarr[i+1].ie_timeperiod.tp_start));
 
 				/* shift everything from (i+1) onwards by
 				   one. Then insert the new entry and write
 				   back icnt and invindex entries */
-				/* *stobjfd = idx_put_newentry( fd, i+1, iarr,
-							     icnt, &ient );*/
-			      *stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
+							     icnt, &ient);*/
+			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 				return i;
 			}
 		}
 	}
 
 	/* We couldnt find anything that fits */
-	assert( 0 );	/* We can't get here ! */
+	assert(0);	/* We can't get here ! */
 	return -1;
 
 
@@ -156,7 +156,7 @@
 int
 idx_put_newentry(
 	invt_idxinfo_t *idx,
-	invt_entry_t *ient )
+	invt_entry_t *ient)
 {
 	invt_entry_t	*idxarr;
 	int stobjfd;
@@ -166,37 +166,37 @@
 	invt_entry_t *iarr = idx->iarr;
 	invt_counter_t *icnt = idx->icnt;
 
-	stobj_makefname( ient->ie_filename );
-	if ( ( stobjfd = stobj_create( ient->ie_filename ) ) < 0 )
+	stobj_makefname(ient->ie_filename);
+	if ((stobjfd = stobj_create(ient->ie_filename)) < 0)
 		return -1;
 
 	icnt->ic_curnum++; /* there is no maximum */
 
-	idxarr = ( invt_entry_t * ) calloc ( icnt->ic_curnum,
-					     sizeof( invt_entry_t ) );
-	memcpy( idxarr, iarr, ( size_t ) ( sizeof( invt_entry_t ) * index ) );
+	idxarr = (invt_entry_t *) calloc (icnt->ic_curnum,
+					     sizeof(invt_entry_t));
+	memcpy(idxarr, iarr, (size_t) (sizeof(invt_entry_t) * index));
 
 	/* shift everything from (i+1) onwards by one */
-	if ( index <  icnt->ic_curnum - 1 )
-		memcpy( &idxarr[ index + 1 ], &iarr[ index ],
-		       ( size_t ) ( ( icnt->ic_curnum - index - 1 ) *
-				    sizeof( invt_entry_t ) ) );
+	if (index <  icnt->ic_curnum - 1)
+		memcpy(&idxarr[index + 1], &iarr[index],
+		       (size_t) ((icnt->ic_curnum - index - 1) *
+				    sizeof(invt_entry_t)));
 	/* insert the new entry */
-	memcpy( &idxarr[ index ], ient, sizeof( invt_entry_t ) );
+	memcpy(&idxarr[index], ient, sizeof(invt_entry_t));
 
 
-	if ( ( PUT_COUNTERS( fd, icnt ) < 0 ) ||
-		( PUT_REC_NOLOCK( fd, idxarr,
-				  icnt->ic_curnum * sizeof( invt_entry_t ),
-				  sizeof( invt_counter_t ) ) < 0 ) ) {
+	if ((PUT_COUNTERS(fd, icnt) < 0) ||
+		(PUT_REC_NOLOCK(fd, idxarr,
+				  icnt->ic_curnum * sizeof(invt_entry_t),
+				  sizeof(invt_counter_t)) < 0)) {
 			/* XXX delete the stobj that we just created */
 
-			memset( ient->ie_filename, 0 , INV_STRLEN );
-			free( idxarr );
+			memset(ient->ie_filename, 0 , INV_STRLEN);
+			free(idxarr);
 			return -1;
 		}
 
-	free( iarr );
+	free(iarr);
 	idx->iarr = idxarr;
 	return stobjfd;
 
@@ -213,8 +213,8 @@
 
 
 int
-idx_find_stobj( invt_idxinfo_t *idx,
-	        time32_t tm )
+idx_find_stobj(invt_idxinfo_t *idx,
+	        time32_t tm)
 {
 
 	int 		stobjfd;
@@ -222,22 +222,22 @@
 	/* since sessions can be inserted in random order, the invindex
 	   table can contain time-periods that don't have corresponding
 	   entries for */
-	if ( GET_ALLHDRS_N_CNTS_NOLOCK( idx->invfd, (void **)&idx->iarr,
+	if (GET_ALLHDRS_N_CNTS_NOLOCK(idx->invfd, (void **)&idx->iarr,
 						     (void **)&idx->icnt,
-						     sizeof( invt_entry_t ),
-				sizeof( invt_counter_t ) ) < 0 ) {
+						     sizeof(invt_entry_t),
+				sizeof(invt_counter_t)) < 0) {
 		return -1;
 	}
 
 #ifdef INVT_DEBUG
-	printf( "idx_find_stobj Time: %ld\n", tm );
-	idx_DEBUG_printinvindices( idx->iarr, idx->icnt->ic_curnum );
+	printf("idx_find_stobj Time: %ld\n", tm);
+	idx_DEBUG_printinvindices(idx->iarr, idx->icnt->ic_curnum);
 #endif
 
 	/* Now figure out where we are going to insert this stobj among the
 	   invindices and put it there */
-	idx->index = idx_insert_newentry( idx->invfd, &stobjfd, idx->iarr,
-						 idx->icnt, tm );
+	idx->index = idx_insert_newentry(idx->invfd, &stobjfd, idx->iarr,
+						 idx->icnt, tm);
 
 	return stobjfd;
 }
@@ -254,33 +254,33 @@
 /*----------------------------------------------------------------------*/
 
 inv_idbtoken_t
-idx_create( char *fname, inv_oflag_t forwhat )
+idx_create(char *fname, inv_oflag_t forwhat)
 {
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
 	/* This is not to be called when the user wants to open
 	   the db for SEARCH_ONLY. */
-	assert( forwhat != INV_SEARCH_ONLY );
+	assert(forwhat != INV_SEARCH_ONLY);
 
-	if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
-		INV_PERROR ( fname );
+	if ((fd = open (fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+		INV_PERROR (fname);
 		return INV_TOKEN_NULL;
 	}
 
-	INVLOCK( fd, LOCK_EX );
-	fchmod( fd, INV_PERMS );
+	INVLOCK(fd, LOCK_EX);
+	fchmod(fd, INV_PERMS);
 
 #ifdef INVT_DEBUG
-	mlog( MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
+	mlog(MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
 #endif
 
 	/* create the first entry in the new inv_index */
-	stobjfd = idx_create_entry( &tok, fd, BOOL_TRUE );
+	stobjfd = idx_create_entry(&tok, fd, BOOL_TRUE);
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
-	if ( stobjfd < 0 )
+	if (stobjfd < 0)
 		return INV_TOKEN_NULL;
 	return tok;
 }
@@ -292,18 +292,18 @@
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 int
-idx_recons_time( time32_t tm, invt_idxinfo_t *idx )
+idx_recons_time(time32_t tm, invt_idxinfo_t *idx)
 {
 	invt_timeperiod_t *tp = &idx->iarr[idx->index].ie_timeperiod;
-	if ( tp->tp_start && IS_WITHIN( tp, tm ) )
+	if (tp->tp_start && IS_WITHIN(tp, tm))
 		return 1;
 
-	if ( tm > tp->tp_end || tp->tp_end == 0 )
+	if (tm > tp->tp_end || tp->tp_end == 0)
 		tp->tp_end =  tm;
-	if ( tm < tp->tp_start || tp->tp_start == 0 )
+	if (tm < tp->tp_start || tp->tp_start == 0)
 		tp->tp_start = tm;
-	PUT_REC_NOLOCK( idx->invfd,  &idx->iarr[idx->index],
-		        sizeof( invt_entry_t ), IDX_HDR_OFFSET(idx->index) );
+	PUT_REC_NOLOCK(idx->invfd,  &idx->iarr[idx->index],
+		        sizeof(invt_entry_t), IDX_HDR_OFFSET(idx->index));
 	return 1;
 }
 
@@ -317,29 +317,29 @@
 /*----------------------------------------------------------------------*/
 
 int
-idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
+idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime)
 {
 	int rval;
 	invt_entry_t ent;
 	int fd = tok->sd_invtok->d_invindex_fd;
 
-	INVLOCK( fd, LOCK_EX );
+	INVLOCK(fd, LOCK_EX);
 
-	rval = GET_REC_NOLOCK( fd, &ent, sizeof( invt_entry_t ),
+	rval = GET_REC_NOLOCK(fd, &ent, sizeof(invt_entry_t),
 			        tok->sd_invtok->d_invindex_off);
-	if ( rval < 0 ) {
-		INVLOCK( fd, LOCK_UN );
+	if (rval < 0) {
+		INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 	ent.ie_timeperiod.tp_end = tok->sd_sesstime;
 
-	if ( whichtime == INVT_STARTTIME || ent.ie_timeperiod.tp_start == 0 ) {
+	if (whichtime == INVT_STARTTIME || ent.ie_timeperiod.tp_start == 0) {
 		ent.ie_timeperiod.tp_start = tok->sd_sesstime;
 	}
 #ifdef INVT_DEBUG
-	mlog( MLOG_DEBUG | MLOG_INV,"Putsestime: st %ld end %ld\n",
+	mlog(MLOG_DEBUG | MLOG_INV,"Putsestime: st %ld end %ld\n",
 			      ent.ie_timeperiod.tp_start,
-			      ent.ie_timeperiod.tp_end );
+			      ent.ie_timeperiod.tp_end);
 #endif
 	rval = PUT_REC_NOLOCK(fd, &ent, sizeof(invt_entry_t),
 			      tok->sd_invtok->d_invindex_off);
@@ -349,20 +349,20 @@
 		int nindices;
 		invt_entry_t *iarr = NULL;
 		invt_counter_t *icnt = NULL;
-		if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd,
+		if ((nindices = GET_ALLHDRS_N_CNTS_NOLOCK(fd,
 						     (void **)&iarr,
 						     (void **)&icnt,
-						sizeof( invt_entry_t ),
-				sizeof( invt_counter_t ))) < 0 ) {
+						sizeof(invt_entry_t),
+				sizeof(invt_counter_t))) < 0) {
 			return -1;
 		}
-		idx_DEBUG_printinvindices( iarr, (uint) nindices );
-		free( iarr );
-		free( icnt );
+		idx_DEBUG_printinvindices(iarr, (uint) nindices);
+		free(iarr);
+		free(icnt);
 	}
 #endif
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 	return rval;
 }
 
@@ -384,42 +384,42 @@
 idx_create_entry(
 	inv_idbtoken_t *tok,
 	int invfd, 	/* kept locked EX  by caller */
-	bool_t firstentry )
+	bool_t firstentry)
 {
 	invt_entry_t   	ent;
 	int	      	fd;
 	off64_t 	hoff;
 
 
-	memset ( &ent, 0, sizeof( ent ) );
+	memset (&ent, 0, sizeof(ent));
 
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
-	stobj_makefname( ent.ie_filename );
+	stobj_makefname(ent.ie_filename);
 
-	if ( firstentry ) {
+	if (firstentry) {
 		invt_counter_t cnt;
 
 		cnt.ic_maxnum = INVT_MAX_INVINDICES;
 		cnt.ic_curnum = 1;
 		cnt.ic_vernum = INV_VERSION;
 
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			return -1;
 		}
 
-		if ( PUT_REC_NOLOCK( invfd, &cnt, sizeof(cnt), (off64_t)0 ) < 0 )
+		if (PUT_REC_NOLOCK(invfd, &cnt, sizeof(cnt), (off64_t)0) < 0)
 			return -1;
 
-		hoff = sizeof( invt_counter_t );
+		hoff = sizeof(invt_counter_t);
 
-		if ( PUT_REC_NOLOCK( invfd, &ent, sizeof( ent ), hoff ) < 0)
+		if (PUT_REC_NOLOCK(invfd, &ent, sizeof(ent), hoff) < 0)
 			return -1;
 	} else {
 		invt_counter_t *cnt = NULL;
 
-		if ( GET_COUNTERS( invfd, &cnt )  < 0 ) {
+		if (GET_COUNTERS(invfd, &cnt)  < 0) {
 			return -1;
 		}
 
@@ -427,29 +427,29 @@
 		   another and leave a pointer to that in here */
 
 		/* create the new storage object */
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			return -1;
 		}
 		++(cnt->ic_curnum);
-		if ( PUT_COUNTERS( invfd, cnt ) < 0 ) {
+		if (PUT_COUNTERS(invfd, cnt) < 0) {
 			return -1;
 		}
 
 		/* add the new index entry to the array, at the end */
 
-		hoff = IDX_HDR_OFFSET( cnt->ic_curnum - 1 );
+		hoff = IDX_HDR_OFFSET(cnt->ic_curnum - 1);
 		free (cnt);
 #ifdef INVT_DEBUG
-		mlog( MLOG_NITTY | MLOG_INV, "new stobj name %s @ offset %d\n",
-		      ent.ie_filename,(int)hoff );
+		mlog(MLOG_NITTY | MLOG_INV, "new stobj name %s @ offset %d\n",
+		      ent.ie_filename,(int)hoff);
 #endif
-		if (PUT_REC_NOLOCK( invfd, &ent, sizeof( ent ), hoff) < 0 )
+		if (PUT_REC_NOLOCK(invfd, &ent, sizeof(ent), hoff) < 0)
 			return -1;
 
 	}
 
-	*tok = get_token( invfd, fd );
+	*tok = get_token(invfd, fd);
 	(*tok)->d_invindex_off = hoff;
 	(*tok)->d_update_flag |= NEW_INVINDEX;
 	(*tok)->d_oflag = INV_SEARCH_N_MOD;
@@ -469,7 +469,7 @@
 /*----------------------------------------------------------------------*/
 
 int
-idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
+idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index)
 {
 	invt_entry_t 	*ent = 0;
 	int	     	 fd;
@@ -477,65 +477,65 @@
 	/* if there's space anywhere at all, then it must be in the last
 	   entry. get_lastheader() does the locking */
 
-	if ((*index = get_lastheader( invfd, (void **)&ent,
+	if ((*index = get_lastheader(invfd, (void **)&ent,
 				       sizeof(invt_entry_t),
-				       sizeof(invt_counter_t) ) ) < 0 )
+				       sizeof(invt_counter_t))) < 0)
 		return -1;
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	assert ( ent != NULL );
-	assert ( ent->ie_filename );
+	assert (ent != NULL);
+	assert (ent->ie_filename);
 
-	fd = open( ent->ie_filename, INV_OFLAG(forwhat) );
-	if ( fd < 0 )
-		INV_PERROR( ent->ie_filename );
-	free ( ent );
+	fd = open(ent->ie_filename, INV_OFLAG(forwhat));
+	if (fd < 0)
+		INV_PERROR(ent->ie_filename);
+	free (ent);
 
 	return fd;
 }
 
 
 int
-idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num )
+idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num)
 {
 	uint i;
 	uint k;
 
 	char s[9];
-	printf( "\n ==================================\n"
-	        " InvIndex\n # StObjs\t%d\n", num );
+	printf("\n ==================================\n"
+	        " InvIndex\n # StObjs\t%d\n", num);
 #define INV_UUID_STR_LEN	36 /* not exported via uuid.h */
-	for ( i = 0; i < num; i++ ) {
-		k = strlen( iarr[i].ie_filename );
-		strncpy( s, (char *) iarr[i].ie_filename + k -
-			( INV_UUID_STR_LEN + strlen(INV_STOBJ_PREFIX)), 8 );
+	for (i = 0; i < num; i++) {
+		k = strlen(iarr[i].ie_filename);
+		strncpy(s, (char *) iarr[i].ie_filename + k -
+			(INV_UUID_STR_LEN + strlen(INV_STOBJ_PREFIX)), 8);
 		s[8]= 0;
 		printf("%d. %s \t( %d - %d )\n", i, s,
 		       iarr[i].ie_timeperiod.tp_start,
-		       iarr[i].ie_timeperiod.tp_end );
+		       iarr[i].ie_timeperiod.tp_end);
 	}
 #undef INV_UUID_STR_LEN
-	printf( "\n ==================================\n");
+	printf("\n ==================================\n");
 	return 1;
 
 }
 
 int
-idx_DEBUG_print ( int fd )
+idx_DEBUG_print (int fd)
 {
 	int nindices;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
-	if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd,
+	if ((nindices = GET_ALLHDRS_N_CNTS_NOLOCK(fd,
 						    (void **)&iarr,
 						    (void **)&icnt,
-						    sizeof( invt_entry_t ),
-				         sizeof( invt_counter_t ))) < 0 ) {
+						    sizeof(invt_entry_t),
+				         sizeof(invt_counter_t))) < 0) {
 		return -1;
 	}
-	idx_DEBUG_printinvindices( iarr, (uint) nindices );
-	free( iarr );
-	free( icnt );
+	idx_DEBUG_printinvindices(iarr, (uint) nindices);
+	free(iarr);
+	free(icnt);
 
 	return 1;
 }
@@ -543,16 +543,16 @@
 
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
+DEBUG_displayallsessions(int fd, invt_seshdr_t *hdr, uint ref,
 			  invt_pr_ctx_t *prctx)
 {
 	inv_session_t *ses;
-	if ( stobj_make_invsess( fd, &ses, hdr ) < 1 )
+	if (stobj_make_invsess(fd, &ses, hdr) < 1)
 		return -1;
 
-	DEBUG_sessionprint( ses, ref, prctx);
-	free( ses->s_streams );
-	free( ses );
+	DEBUG_sessionprint(ses, ref, prctx);
+	free(ses->s_streams);
+	free(ses);
 
 	return 0;
 }
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index f175c02..c78e64e 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -45,33 +45,33 @@
 /*----------------------------------------------------------------------*/
 
 int
-init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
-	  inv_idbtoken_t *tok )
+init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
+	  inv_idbtoken_t *tok)
 {
-	char fname[ INV_STRLEN ];
-	char uuname[ INV_STRLEN ];
+	char fname[INV_STRLEN];
+	char uuname[INV_STRLEN];
 	int fd;
 
 	*tok = INV_TOKEN_NULL;
 	/* make sure INV_DIRPATH exists, and is writable */
-	if ( make_invdirectory( forwhat ) < 0 )
+	if (make_invdirectory(forwhat) < 0)
 		return I_DONE;
 
 	/* come up with the unique file suffix that refers to this
 	   filesystem */
-	if ( fstab_get_fname( pred, uuname, bywhat, forwhat ) < 0 ) {
+	if (fstab_get_fname(pred, uuname, bywhat, forwhat) < 0) {
 		return I_DONE;
 	}
 
-	( void )strcpy( fname, uuname );
-	strcat ( fname, INV_INVINDEX_PREFIX );
+	(void)strcpy(fname, uuname);
+	strcat (fname, INV_INVINDEX_PREFIX);
 
 	/* first check if the inv_index file exists: if not create it */
-	if ( ( fd = open( fname, INV_OFLAG(forwhat) ) ) == -1 ) {
+	if ((fd = open(fname, INV_OFLAG(forwhat))) == -1) {
 		if (errno != ENOENT) {
-			INV_PERROR ( fname );
+			INV_PERROR (fname);
 		} else if (forwhat == INV_SEARCH_N_MOD) {
-			*tok = idx_create( fname, forwhat );
+			*tok = idx_create(fname, forwhat);
 		} else {
 			/* this happens when the inv is empty and the user
 			   wants to do a search. this is legal - not an error */
@@ -89,12 +89,12 @@
 
 
 inv_idbtoken_t
-get_token( int invfd, int stobjfd  )
+get_token(int invfd, int stobjfd)
 {
 	invt_desc_entry_t *desc;
 
 	desc = (invt_desc_entry_t *) malloc
-		( sizeof( invt_desc_entry_t ) );
+		(sizeof(invt_desc_entry_t));
 
 	desc->d_invindex_fd = invfd;
 	desc->d_stobj_fd  = stobjfd;
@@ -110,19 +110,19 @@
 
 
 void
-destroy_token( inv_idbtoken_t tok )
+destroy_token(inv_idbtoken_t tok)
 {
-	free ( (invt_desc_entry_t *) tok );
+	free ((invt_desc_entry_t *) tok);
 }
 
 
 
 inv_sestoken_t
-get_sesstoken( inv_idbtoken_t tok )
+get_sesstoken(inv_idbtoken_t tok)
 {
 	inv_sestoken_t stok;
 
-	stok = (inv_sestoken_t) malloc( sizeof( invt_sesdesc_entry_t ) );
+	stok = (inv_sestoken_t) malloc(sizeof(invt_sesdesc_entry_t));
 	stok->sd_invtok = tok;
 	stok->sd_session_off = stok->sd_sesshdr_off = -1;
 	stok->sd_sesstime = (time32_t) 0;
@@ -159,31 +159,31 @@
 	*outarg = NULL;
 	assert(inarg);
 
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
 	/* special case missing file: ok, outarg says zero */
-	if ( fd < 0 && errno == ENOENT ) {
+	if (fd < 0 && errno == ENOENT) {
 		return BOOL_TRUE;
 	}
-	if ( fd < 0 || numfs <= 0 ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n") );
+	if (fd < 0 || numfs <= 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n"));
 		return ret;
 	}
 
-	close( fd );
+	close(fd);
 
-	for ( i = 0; i < numfs; i++) {
-		if ( fstab_get_fname( &arr[i].ft_uuid, fname,
+	for (i = 0; i < numfs; i++) {
+		if (fstab_get_fname(&arr[i].ft_uuid, fname,
 				     (inv_predicate_t)INV_BY_UUID,
-				     forwhat) < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+				     forwhat) < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Cant get inv-name for uuid\n")
 			     );
 			continue;
 		}
-		strcat( fname, INV_INVINDEX_PREFIX );
-		invfd = open( fname, INV_OFLAG(forwhat) );
-		if ( invfd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+		strcat(fname, INV_INVINDEX_PREFIX);
+		invfd = open(fname, INV_OFLAG(forwhat));
+		if (invfd < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Open failed on %s\n"),
 			     fname
 			     );
@@ -216,7 +216,7 @@
 /*----------------------------------------------------------------------*/
 /* search_invt                                                          */
 /*                                                                      */
-/* Used by the toplevel (inv layer ) to do common searches on the inven-*/
+/* Used by the toplevel (inv layer) to do common searches on the inven-*/
 /* tory. Caller supplies a callback routine that performs the real      */
 /* comparison/check.                                                    */
 /*----------------------------------------------------------------------*/
@@ -243,17 +243,17 @@
 	 * if no session found, the caller will expect to see
 	 * NULL.
 	 */
-	*( char ** )buf = NULL;
+	*(char **)buf = NULL;
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
 
-	free( icnt );
+	free(icnt);
 
 	/* we need to get all the invindex headers and seshdrs in reverse
 	   order */
@@ -263,25 +263,25 @@
 		invt_seshdr_t		*harr = NULL;
 		bool_t                  found;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY );
+		fd = open (iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
-			INV_PERROR( iarr[i].ie_filename );
+			INV_PERROR(iarr[i].ie_filename);
 			continue;
 		}
-		INVLOCK( fd, LOCK_SH );
+		INVLOCK(fd, LOCK_SH);
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+		if ((nsess = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)&harr,
 						  (void **)&scnt,
-						  sizeof( invt_seshdr_t ),
-						 sizeof( invt_sescounter_t ))
-		     ) < 0 ) {
-			INV_PERROR( iarr[i].ie_filename );
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
+						  sizeof(invt_seshdr_t),
+						 sizeof(invt_sescounter_t))
+		     ) < 0) {
+			INV_PERROR(iarr[i].ie_filename);
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
 			continue;
 		}
-		free ( scnt );
+		free (scnt);
 
 		for (j = nsess - 1; j >= 0; j--) {
 			invt_session_t ses;
@@ -311,18 +311,18 @@
 			}
 
 			found = (* do_chkcriteria)(fd, &harr[j], arg, buf);
-			if (! found ) continue;
+			if (! found) continue;
 
 			/* we found what we need; just return */
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
-			free( harr );
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
+			free(harr);
 
 			return found; /* == -1 or 1 */
 		}
 
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 	}
 
 	return 0;
@@ -353,66 +353,66 @@
 		return 0;
 
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
 
-	free( icnt );
+	free(icnt);
 
 	if (prctx->invidx) {
-		idx_DEBUG_printinvindices( iarr, (uint) nindices );
+		idx_DEBUG_printinvindices(iarr, (uint) nindices);
 		free(iarr);
 		return (0);
 	}
 
 
 
-	for ( i = 0; i < nindices; i++ ) {
+	for (i = 0; i < nindices; i++) {
 		int 			nsess;
 		invt_sescounter_t 	*scnt = NULL;
 		invt_seshdr_t		*harr = NULL;
 		int                     s;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY );
+		fd = open (iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
-			INV_PERROR( iarr[i].ie_filename );
+			INV_PERROR(iarr[i].ie_filename);
 			continue;
 		}
-		INVLOCK( fd, LOCK_SH );
+		INVLOCK(fd, LOCK_SH);
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+		if ((nsess = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)&harr,
 						  (void **)&scnt,
-						  sizeof( invt_seshdr_t ),
-						 sizeof( invt_sescounter_t ))
-		     ) < 0 ) {
-			INV_PERROR( iarr[i].ie_filename );
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
+						  sizeof(invt_seshdr_t),
+						 sizeof(invt_sescounter_t))
+		     ) < 0) {
+			INV_PERROR(iarr[i].ie_filename);
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
 			continue;
 		}
-		free ( scnt );
-		for( s = 0; s < nsess; s++ ) {
+		free (scnt);
+		for(s = 0; s < nsess; s++) {
 			/* fd is kept locked until we return from the
 			   callback routine */
 
 			/* Check to see if this session has been pruned
 			 * by xfsinvutil before returning it.
 			 */
-			if ( harr[s].sh_pruned ) {
+			if (harr[s].sh_pruned) {
 				continue;
 			}
 
-			(void)DEBUG_displayallsessions( fd, &harr[ s ],
+			(void)DEBUG_displayallsessions(fd, &harr[s],
 						        ref++, prctx);
 		}
 
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 	}
 
 	free (iarr);
@@ -441,42 +441,42 @@
 	if (invfd == I_EMPTYINV)
 		return 0;
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
 
-	free( icnt );
+	free(icnt);
 
 
-	for ( i = 0; i < nindices; i++ ) {
+	for (i = 0; i < nindices; i++) {
 		int 			nsess;
 		invt_sescounter_t 	*scnt = NULL;
 		invt_seshdr_t		*harr = NULL;
 		int                     s;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY );
+		fd = open (iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
-			INV_PERROR( iarr[i].ie_filename );
+			INV_PERROR(iarr[i].ie_filename);
 			continue;
 		}
-		INVLOCK( fd, LOCK_SH );
+		INVLOCK(fd, LOCK_SH);
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+		if ((nsess = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)&harr,
 						  (void **)&scnt,
-						  sizeof( invt_seshdr_t ),
-						 sizeof( invt_sescounter_t ))
-		     ) < 0 ) {
-			INV_PERROR( iarr[i].ie_filename );
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
+						  sizeof(invt_seshdr_t),
+						 sizeof(invt_sescounter_t))
+		     ) < 0) {
+			INV_PERROR(iarr[i].ie_filename);
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
 			continue;
 		}
-		free ( scnt );
+		free (scnt);
 
 		if ((iarr[i].ie_timeperiod.tp_start != harr[0].sh_time) ||
 		    (iarr[i].ie_timeperiod.tp_end != harr[nsess-1].sh_time)) {
@@ -485,7 +485,7 @@
 			       i+1,
 			       iarr[i].ie_timeperiod.tp_start,
 			       iarr[i].ie_timeperiod.tp_end);
-			for( s = 0; s < nsess; s++ ) {
+			for(s = 0; s < nsess; s++) {
 				printf(_("tm (%d)\t%d\n"), s, harr[s].sh_time);
 			}
 		}
@@ -493,8 +493,8 @@
 			printf(_("INV: Check %d out of %d succeeded\n"),
 			       i+1, nindices);
 		}
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 	}
 
 	return 0;
@@ -509,20 +509,20 @@
 
 /* ARGSUSED */
 bool_t
-tm_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
-		   void **tm )
+tm_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
+		   void **tm)
 {
 	u_char level = *(u_char *)arg;
 	*tm = NULL;
-	if ( IS_PARTIAL_SESSION( hdr ) )
+	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
-	if (hdr->sh_level < level ) {
+	if (hdr->sh_level < level) {
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level,
-		     level );
+		mlog(MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level,
+		     level);
 #endif
-		*tm = calloc( 1, sizeof( time32_t ) );
-		memcpy( *tm, &hdr->sh_time, sizeof( time32_t ) );
+		*tm = calloc(1, sizeof(time32_t));
+		memcpy(*tm, &hdr->sh_time, sizeof(time32_t));
 		return 1;
 	}
 	return 0;
@@ -538,19 +538,19 @@
 /*----------------------------------------------------------------------*/
 
 bool_t
-lastsess_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
-			 void **buf )
+lastsess_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
+			 void **buf)
 {
 	u_char level = *(u_char *)arg;
 	*buf = NULL;
-	if ( IS_PARTIAL_SESSION( hdr ) )
+	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
-	if (hdr->sh_level < level ) {
+	if (hdr->sh_level < level) {
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d < %d \n",
-		     hdr->sh_level, level );
+		mlog(MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d < %d \n",
+		     hdr->sh_level, level);
 #endif
-		return stobj_make_invsess( fd, (inv_session_t **) buf, hdr );
+		return stobj_make_invsess(fd, (inv_session_t **) buf, hdr);
 	}
 	return 0;
 
@@ -565,19 +565,19 @@
 /*----------------------------------------------------------------------*/
 
 bool_t
-lastsess_level_equalto( int fd, invt_seshdr_t *hdr,
-		       void *arg, void **buf )
+lastsess_level_equalto(int fd, invt_seshdr_t *hdr,
+		       void *arg, void **buf)
 {
 	u_char level = *(u_char *)arg;
 	*buf = NULL;
-	if ( IS_PARTIAL_SESSION( hdr ) )
+	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
-	if (hdr->sh_level == level ) {
+	if (hdr->sh_level == level) {
 #ifdef INVT_DEBUG
-	mlog( MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d == %d \n", hdr->sh_level,
-	     level );
+	mlog(MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d == %d \n", hdr->sh_level,
+	     level);
 #endif
-		return stobj_make_invsess( fd, (inv_session_t **) buf, hdr );
+		return stobj_make_invsess(fd, (inv_session_t **) buf, hdr);
 	}
 	return 0;
 
@@ -596,7 +596,7 @@
 /* this is used in reconstructing the database.                         */
 /*----------------------------------------------------------------------*/
 bool_t
-insert_session( invt_sessinfo_t *s)
+insert_session(invt_sessinfo_t *s)
 {
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
 	int invfd, stobjfd = -1;
@@ -605,21 +605,21 @@
 	inv_oflag_t       forwhat = INV_SEARCH_N_MOD;
 
 	/* initialize the inventory */
-	if ( ( invfd = init_idb ( (void *) s->ses->s_fsid,
+	if ((invfd = init_idb ((void *) s->ses->s_fsid,
 				  (inv_predicate_t) INV_BY_UUID,
  				  forwhat,
-				  &tok ) ) < 0 ) {
-		if ( tok == INV_TOKEN_NULL ) {
+				  &tok)) < 0) {
+		if (tok == INV_TOKEN_NULL) {
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV, "INV: insert_session: init_db "
-			      "failed\n" );
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: insert_session: init_db "
+			      "failed\n");
 #endif
 			return BOOL_FALSE;
 		}
 
 		invfd = tok->d_invindex_fd;
-		close( tok->d_stobj_fd );
-		destroy_token( tok );
+		close(tok->d_stobj_fd);
+		destroy_token(tok);
 	}
 
 	/* at this point we know that invindex has at least one entry
@@ -629,33 +629,33 @@
 	   contain this session, it suffices to sequentially search the
 	   inventory indices of this filesystem for the particular invt-entry
 	 */
-	INVLOCK( invfd, LOCK_EX );
+	INVLOCK(invfd, LOCK_EX);
 	idx.invfd = invfd;
-	stobjfd = idx_find_stobj( &idx, s->seshdr->sh_time );
+	stobjfd = idx_find_stobj(&idx, s->seshdr->sh_time);
 	if (stobjfd < 0) {
-		INVLOCK( invfd, LOCK_UN );
-		free( idx.icnt );
-		free( idx.iarr );
+		INVLOCK(invfd, LOCK_UN);
+		free(idx.icnt);
+		free(idx.iarr);
 		return BOOL_FALSE;
 	}
 
 	/* Now put the session in the storage-object */
-	INVLOCK( stobjfd, LOCK_EX );
-	if ( ( stobj_insert_session( &idx, stobjfd, s ) < 0 ) ||
-		( idx_recons_time ( s->seshdr->sh_time, &idx ) < 0 ) )
+	INVLOCK(stobjfd, LOCK_EX);
+	if ((stobj_insert_session(&idx, stobjfd, s) < 0) ||
+		(idx_recons_time (s->seshdr->sh_time, &idx) < 0))
 			ret = BOOL_TRUE;
 
-	INVLOCK( stobjfd, LOCK_UN );
-	INVLOCK( invfd, LOCK_UN );
+	INVLOCK(stobjfd, LOCK_UN);
+	INVLOCK(invfd, LOCK_UN);
 
-	free( idx.icnt );
-	free( idx.iarr );
+	free(idx.icnt);
+	free(idx.iarr);
 
 	if (ret) return BOOL_FALSE;
 
 	/* make sure the fstab is uptodate too */
-	if ( fstab_put_entry( &s->ses->s_fsid, s->ses->s_mountpt, s->ses->s_devpath,
-			      forwhat ) < 0 )
+	if (fstab_put_entry(&s->ses->s_fsid, s->ses->s_mountpt, s->ses->s_devpath,
+			      forwhat) < 0)
 		return BOOL_FALSE;
 
 	/* and we are done */
@@ -672,82 +672,82 @@
 /*----------------------------------------------------------------------*/
 
 int
-make_invdirectory( inv_oflag_t forwhat )
+make_invdirectory(inv_oflag_t forwhat)
 {
 	struct stat64 st;
 	char path[PATH_MAX];
 	char *p;
 
-	p = strcpy( path, INV_DIRPATH );
+	p = strcpy(path, INV_DIRPATH);
 
-	if ( stat64( path, &st ) == 0 )
+	if (stat64(path, &st) == 0)
 		return 1;
 
-	if ( forwhat == INV_SEARCH_ONLY || errno != ENOENT )
+	if (forwhat == INV_SEARCH_ONLY || errno != ENOENT)
 		return -1;
 
 	do {
 		p++;
-		if ( *p == '/' ) {
+		if (*p == '/') {
 			*p = '\0';
-			if ( mkdir( path, (mode_t)0755 ) < 0 ) {
-				if ( errno != EEXIST ) {
-					INV_PERROR( path );
+			if (mkdir(path, (mode_t)0755) < 0) {
+				if (errno != EEXIST) {
+					INV_PERROR(path);
 					return -1;
 				}
 			}
 			*p = '/';
 		}
-	} while ( *p );
+	} while (*p);
 
-	if ( mkdir( path, (mode_t)0755 ) < 0 ) {
-		if ( errno != EEXIST ) {
-			INV_PERROR( path );
+	if (mkdir(path, (mode_t)0755) < 0) {
+		if (errno != EEXIST) {
+			INV_PERROR(path);
 			return -1;
 		}
 	}
 
-	mlog( MLOG_VERBOSE | MLOG_INV, _("%s created\n"), path );
+	mlog(MLOG_VERBOSE | MLOG_INV, _("%s created\n"), path);
 	return 1;
 }
 
 #ifdef NOTDEF
 
 bool_t
-invmgr_lockinit( void )
+invmgr_lockinit(void)
 {
-	if ( invlock_fd == -1 ) {
-		if (( invlock_fd = open( INV_LOCKFILE,
-					O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
-			INV_PERROR( INV_LOCKFILE );
+	if (invlock_fd == -1) {
+		if ((invlock_fd = open(INV_LOCKFILE,
+					O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+			INV_PERROR(INV_LOCKFILE);
 			return BOOL_FALSE;
 		}
-		fchmod ( invlock_fd, INV_PERMS );
+		fchmod (invlock_fd, INV_PERMS);
 	}
 	return BOOL_TRUE;
 }
 
 
 bool_t
-invmgr_trylock( invt_mode_t mode )
+invmgr_trylock(invt_mode_t mode)
 {
 	int md;
-	assert( invlock_fd >= 0 );
+	assert(invlock_fd >= 0);
 
 	md = (mode == INVT_RECONSTRUCT) ? LOCK_EX: LOCK_SH;
 
-	if (INVLOCK( invlock_fd, md | LOCK_NB ) < 0)
+	if (INVLOCK(invlock_fd, md | LOCK_NB) < 0)
 		return BOOL_FALSE;
 
 	return BOOL_TRUE;
 }
 
 void
-invmgr_unlock( void )
+invmgr_unlock(void)
 {
-	assert( invlock_fd >= 0 );
+	assert(invlock_fd >= 0);
 
-	INVLOCK( invlock_fd, LOCK_UN );
+	INVLOCK(invlock_fd, LOCK_UN);
 
 }
 
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 56ac5e5..a2e08d6 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -269,7 +269,7 @@
 	 */
 	OREF_UNLOCK(obj);
 
-	if (OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ) ){
+	if (OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ)){
 		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_sescnt);
 		if (OREF_ISRESOLVED(obj, INVT_RES_HDRS))
@@ -311,8 +311,8 @@
 	inv_predicate_t bywhat,
 	void 		*pred)
 {
-	char 		fname[ INV_STRLEN ];
-	char 		uuname[ INV_STRLEN ];
+	char 		fname[INV_STRLEN];
+	char 		uuname[INV_STRLEN];
 	int 		fd;
 	invt_oref_t	*stobj;
 	int		index;
@@ -358,13 +358,13 @@
 		return INV_ERR;
 	}
 
-	/* create another storage object ( and, an inv_index entry for it
-	   too ) if we've filled this one up */
+	/* create another storage object (and, an inv_index entry for it
+	   too) if we've filled this one up */
 	if (OREF_CNT_CURNUM(stobj) >= OREF_CNT_MAXNUM(stobj)) {
 		int 	rval;
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
-		      "index entry. \n" );
+		mlog(MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
+		      "index entry. \n");
 #endif
 		/* Close(), Destroy() and mark unresolved */
 		OREF_UNRESOLVE_CHILD(invidx);
@@ -405,12 +405,12 @@
 
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	assert ( ent != NULL );
-	assert ( ent->ie_filename );
+	assert (ent != NULL);
+	assert (ent->ie_filename);
 
-	fd = open( ent->ie_filename, O_RDWR );
-	if ( fd < 0 ) {
-		INV_PERROR( ent->ie_filename );
+	fd = open(ent->ie_filename, O_RDWR);
+	if (fd < 0) {
+		INV_PERROR(ent->ie_filename);
 		return INV_ERR;
 	}
 
@@ -432,8 +432,8 @@
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
-	if ((fd = open ( fname , O_RDWR | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
-		INV_PERROR ( fname );
+	if ((fd = open (fname , O_RDWR | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+		INV_PERROR (fname);
 		return INV_ERR;
 	}
 	invidx->fd = fd;
@@ -441,7 +441,7 @@
 	fchmod(fd, INV_PERMS);
 
 #ifdef INVT_DEBUG
-	mlog( MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
+	mlog(MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
 #endif
 	/* create the new stobj as its first entry */
 	rval = oref_resolve_new_stobj(invidx, IS_EMPTY);
@@ -467,15 +467,15 @@
 
 	assert(OREF_ISLOCKED(invidx));
 
-	memset ( &ent, 0, sizeof( ent ) );
+	memset (&ent, 0, sizeof(ent));
 	stobj = calloc(1, sizeof(invt_oref_t));
 	OREF_SET_CHILD(invidx, stobj);
 
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
-	stobj_makefname( ent.ie_filename );
+	stobj_makefname(ent.ie_filename);
 
-	if ( firstentry ) {
+	if (firstentry) {
 		invt_counter_t *cnt;
 		cnt = malloc(sizeof(invt_counter_t));
 
@@ -483,8 +483,8 @@
 		cnt->ic_curnum = 1;
 		cnt->ic_vernum = INV_VERSION;
 
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			free(cnt);
 			return INV_ERR;
 		}
@@ -501,8 +501,8 @@
 			return INV_ERR;
 
 		/* create the new storage object */
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			return -1;
 		}
 
@@ -516,7 +516,7 @@
 			return INV_ERR;
 
 	}
-	tok = get_token( invfd, fd );
+	tok = get_token(invfd, fd);
 	tok->d_invindex_off = IDX_HDR_OFFSET(OREF_CNT_CURNUM(invidx) - 1);
 	tok->d_update_flag |= NEW_INVINDEX;
 
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 0061722..836ce82 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -120,7 +120,7 @@
  * For locking/unlocking orefs - mode { LOCK_SH, LOCK_EX, LOCK_UN }
  */
 
-#define OREF_LOCKMODE_EQL(oref, mode) ((oref)->lockflag == mode )
+#define OREF_LOCKMODE_EQL(oref, mode) ((oref)->lockflag == mode)
 #define OREF_ISLOCKED(oref)	      ((oref)->lockflag == 0 ||
 				       (oref)->lockflag == LOCK_UN)
 
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index ed50782..2310dc1 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -47,11 +47,11 @@
 #define FSTAB_UPDATED		1
 #define NEW_INVINDEX		2
 
-/* session flags ( seshdr.sh_flag ) */
+/* session flags (seshdr.sh_flag) */
 #define INVT_PARTIAL		(uint)0x0001
 #define INVT_RESUMED            (uint)0x0002
 
-/* media file flags ( mfile.mf_flag ) */
+/* media file flags (mfile.mf_flag) */
 #define INVT_MFILE_GOOD         (u_char)0x01
 #define INVT_MFILE_INVDUMP      (u_char)0x02
 
@@ -60,7 +60,7 @@
 #define INVT_DOLOCK		BOOL_TRUE
 #define INVT_DONTLOCK		BOOL_FALSE
 
-#define INVLOCK( fd, m )	flock( fd, m )
+#define INVLOCK(fd, m)	flock(fd, m)
 
 /* return values */
 #define INV_OK			(int) 1
@@ -75,27 +75,27 @@
 
 #define INV_PERMS               S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-#define IS_WITHIN(ttpe, tm)	( tm >= (ttpe)->tp_start && \
-				  tm <= (ttpe)->tp_end )
-#define IDX_HDR_OFFSET(n) 	(off64_t) ( sizeof( invt_entry_t ) * \
+#define IS_WITHIN(ttpe, tm)	(tm >= (ttpe)->tp_start && \
+				  tm <= (ttpe)->tp_end)
+#define IDX_HDR_OFFSET(n) 	(off64_t) (sizeof(invt_entry_t) * \
 					   (size_t) (n)\
-					   + sizeof( invt_counter_t ) )
-#define STOBJ_OFFSET( nhdrs, nsess ) (off64_t) ( \
-			       sizeof( invt_sescounter_t ) + \
-			       (size_t) nhdrs * sizeof( invt_seshdr_t ) + \
-			       (size_t) nsess * sizeof( invt_session_t ) )
+					   + sizeof(invt_counter_t))
+#define STOBJ_OFFSET(nhdrs, nsess) (off64_t) (\
+			       sizeof(invt_sescounter_t) + \
+			       (size_t) nhdrs * sizeof(invt_seshdr_t) + \
+			       (size_t) nsess * sizeof(invt_session_t))
 
-#define STREQL( n,m )		( strcmp((n),(m)) == 0 )
-#define UUID_EQL( n,m,t )	( uuid_compare( n, m, t ) == 0 )
-#define IS_PARTIAL_SESSION( h ) ( (h)->sh_flag & INVT_PARTIAL )
-#define IS_RESUMED_SESSION( h ) ( (h)->sh_flag & INVT_RESUMED )
-#define SC_EOF_INITIAL_POS	(off64_t) (sizeof( invt_sescounter_t ) + \
+#define STREQL(n,m)		(strcmp((n),(m)) == 0)
+#define UUID_EQL(n,m,t)	(uuid_compare(n, m, t) == 0)
+#define IS_PARTIAL_SESSION(h) ((h)->sh_flag & INVT_PARTIAL)
+#define IS_RESUMED_SESSION(h) ((h)->sh_flag & INVT_RESUMED)
+#define SC_EOF_INITIAL_POS	(off64_t) (sizeof(invt_sescounter_t) + \
 					 INVT_STOBJ_MAXSESSIONS * \
-					 ( sizeof( invt_seshdr_t ) + \
-					   sizeof( invt_session_t ) ) )
+					 (sizeof(invt_seshdr_t) + \
+					   sizeof(invt_session_t)))
 
-#define INV_PERROR(s)  	mlog( MLOG_NORMAL,"INV: %s %s\n", s,strerror(errno) )
-#define INV_OFLAG(f)    ( f == INV_SEARCH_ONLY ) ? O_RDONLY: O_RDWR
+#define INV_PERROR(s)  	mlog(MLOG_NORMAL,"INV: %s %s\n", s,strerror(errno))
+#define INV_OFLAG(f)    (f == INV_SEARCH_ONLY) ? O_RDONLY: O_RDWR
 
 /*----------------------------------------------------------------------*/
 /* On Disk Data Structures                                              */
@@ -200,8 +200,8 @@
 	INVT_COUNTER_FIELDS
 	off64_t	       ic_eof;   /* current end of the file, where the next
 				 media file or stream will be written to */
-	char 	       ic_padding[0x20 - ( INVT_COUNTER_FIELDS_SIZE +
-					   sizeof( off64_t) )];
+	char 	       ic_padding[0x20 - (INVT_COUNTER_FIELDS_SIZE +
+					   sizeof(off64_t))];
 } invt_sescounter_t;
 
 
@@ -297,41 +297,41 @@
 typedef bool_t (*search_callback_t) (int, invt_seshdr_t *, void *, void *);
 
 
-#define GET_REC( fd, buf, sz, off )  \
-                 get_invtrecord( fd, buf, sz, off, INVT_DOLOCK )
+#define GET_REC(fd, buf, sz, off)  \
+                 get_invtrecord(fd, buf, sz, off, INVT_DOLOCK)
 
-#define GET_REC_NOLOCK( fd, buf, sz, off )  \
-                 get_invtrecord( fd, buf, sz, off, INVT_DONTLOCK )
+#define GET_REC_NOLOCK(fd, buf, sz, off)  \
+                 get_invtrecord(fd, buf, sz, off, INVT_DONTLOCK)
 
-#define GET_ALLHDRS_N_CNTS( fd, h, c, hsz, csz ) \
-                 get_headerinfo( fd, h, c, hsz, csz, INVT_DOLOCK )
+#define GET_ALLHDRS_N_CNTS(fd, h, c, hsz, csz) \
+                 get_headerinfo(fd, h, c, hsz, csz, INVT_DOLOCK)
 
-#define GET_ALLHDRS_N_CNTS_NOLOCK( fd, h, c, hsz, csz ) \
-                 get_headerinfo( fd, h, c, hsz, csz, INVT_DONTLOCK )
+#define GET_ALLHDRS_N_CNTS_NOLOCK(fd, h, c, hsz, csz) \
+                 get_headerinfo(fd, h, c, hsz, csz, INVT_DONTLOCK)
 
-#define PUT_REC( fd, buf, sz, off )  \
-                 put_invtrecord( fd, buf, sz, off, INVT_DOLOCK )
+#define PUT_REC(fd, buf, sz, off)  \
+                 put_invtrecord(fd, buf, sz, off, INVT_DOLOCK)
 
-#define PUT_REC_NOLOCK( fd, buf, sz, off )  \
-                 put_invtrecord( fd, buf, sz, off, INVT_DONTLOCK )
+#define PUT_REC_NOLOCK(fd, buf, sz, off)  \
+                 put_invtrecord(fd, buf, sz, off, INVT_DONTLOCK)
 
 
-#define GET_COUNTERS( fd, cnt ) get_counters( fd, (void **)(cnt), \
-					      sizeof(invt_counter_t) )
-#define GET_SESCOUNTERS( fd, cnt ) get_counters( fd, (void **)(cnt), \
-						sizeof(invt_sescounter_t) )
+#define GET_COUNTERS(fd, cnt) get_counters(fd, (void **)(cnt), \
+					      sizeof(invt_counter_t))
+#define GET_SESCOUNTERS(fd, cnt) get_counters(fd, (void **)(cnt), \
+						sizeof(invt_sescounter_t))
 
-#define PUT_COUNTERS( fd, cnt ) PUT_REC_NOLOCK( fd, (void *)(cnt), \
-					     sizeof( invt_counter_t ), \
-					     (off64_t) 0 )
+#define PUT_COUNTERS(fd, cnt) PUT_REC_NOLOCK(fd, (void *)(cnt), \
+					     sizeof(invt_counter_t), \
+					     (off64_t) 0)
 
-#define PUT_SESCOUNTERS( fd, cnt )  PUT_REC_NOLOCK( fd, (void *)(cnt), \
-					     sizeof( invt_sescounter_t ), \
-					     (off64_t) 0 )
+#define PUT_SESCOUNTERS(fd, cnt)  PUT_REC_NOLOCK(fd, (void *)(cnt), \
+					     sizeof(invt_sescounter_t), \
+					     (off64_t) 0)
 
-#define GET_SESHEADERS( fd, hdrs, n ) get_headers( fd, (void**)(hdrs), \
-				   (size_t) ( n * sizeof(invt_seshdr_t ) ),\
-				          sizeof( invt_sescounter_t )  )
+#define GET_SESHEADERS(fd, hdrs, n) get_headers(fd, (void**)(hdrs), \
+				   (size_t) (n * sizeof(invt_seshdr_t)),\
+				          sizeof(invt_sescounter_t))
 
 #define GET_ENTRIES(fd, hdrs, n, sz) get_headers(fd, (void**)(hdrs), \
 				   (size_t) (n * sz), sizeof(invt_counter_t))
@@ -345,48 +345,48 @@
 
 /*----------------------------------------------------------------------*/
 inv_idbtoken_t
-idx_create( char *fname, inv_oflag_t forwhat );
+idx_create(char *fname, inv_oflag_t forwhat);
 
 int
-idx_create_entry( inv_idbtoken_t *tok, int invfd, bool_t firstentry );
+idx_create_entry(inv_idbtoken_t *tok, int invfd, bool_t firstentry);
 
 int
-idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime);
+idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime);
 
 
 int
-idx_find_stobj( invt_idxinfo_t *idx, time32_t tm );
+idx_find_stobj(invt_idxinfo_t *idx, time32_t tm);
 
 uint
-idx_insert_newentry( int fd, int *stobjfd, invt_entry_t *iarr,
+idx_insert_newentry(int fd, int *stobjfd, invt_entry_t *iarr,
 		     invt_counter_t *icnt,
-		     time32_t tm );
+		     time32_t tm);
 int
-idx_put_newentry( invt_idxinfo_t *idx, invt_entry_t *ient );
+idx_put_newentry(invt_idxinfo_t *idx, invt_entry_t *ient);
 
 int
-idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index );
+idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index);
 
 int
-idx_recons_time( time32_t tm, invt_idxinfo_t *idx );
+idx_recons_time(time32_t tm, invt_idxinfo_t *idx);
 
 int
-idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num );
+idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num);
 
 int
-idx_DEBUG_print ( int fd );
+idx_DEBUG_print (int fd);
 
 /*----------------------------------------------------------------------*/
 
 int
-stobj_create( char *fname );
+stobj_create(char *fname);
 
 int
-stobj_create_session( inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt,
-		      invt_session_t *ses, invt_seshdr_t *hdr );
+stobj_create_session(inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt,
+		      invt_session_t *ses, invt_seshdr_t *hdr);
 
 int
-stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf );
+stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf);
 
 off64_t
 stobj_put_session(
@@ -395,73 +395,73 @@
 	invt_session_t *ses,
 	invt_seshdr_t *hdr,
 	invt_stream_t *strms,
-	invt_mediafile_t *mfiles );
+	invt_mediafile_t *mfiles);
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
-		   invt_mediafile_t *mfiles );
+		   invt_mediafile_t *mfiles);
 
 int
-stobj_hdrcmp( const void *h1, const void *h2 );
+stobj_hdrcmp(const void *h1, const void *h2);
 
 int
-stobj_sortheaders( int fd, uint num );
+stobj_sortheaders(int fd, uint num);
 
 uint
-stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm );
+stobj_find_splitpoint(int fd, invt_seshdr_t *harr, uint ns, time32_t tm);
 
 int
-stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
-	     invt_sessinfo_t *newsess );
+stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
+	     invt_sessinfo_t *newsess);
 bool_t
-stobj_replace_session( int fd, invt_sescounter_t *sescnt, invt_session_t *ses,
-		       invt_seshdr_t *hdr, invt_sessinfo_t *newsess );
+stobj_replace_session(int fd, invt_sescounter_t *sescnt, invt_session_t *ses,
+		       invt_seshdr_t *hdr, invt_sessinfo_t *newsess);
 
 int
-stobj_delete_mfile( int fd, inv_stream_t *strm, invt_mediafile_t *mf,
-		    off64_t  mfileoff );
+stobj_delete_mfile(int fd, inv_stream_t *strm, invt_mediafile_t *mf,
+		    off64_t  mfileoff);
 
 bool_t
-stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
-		     void  **bufpp, size_t *bufszp );
+stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
+		     void  **bufpp, size_t *bufszp);
 
 bool_t
 stobj_unpack_sessinfo(
         void              *bufp,
         size_t             bufsz,
-	invt_sessinfo_t   *s );
+	invt_sessinfo_t   *s);
 
 bool_t
-stobj_delete_sessinfo( int fd, invt_sescounter_t *sescnt,
-		       invt_session_t *ses, invt_seshdr_t *hdr );
+stobj_delete_sessinfo(int fd, invt_sescounter_t *sescnt,
+		       invt_session_t *ses, invt_seshdr_t *hdr);
 
 bool_t
-stobj_delete_mobj( int fd, invt_seshdr_t *hdr, void *arg,
-		   void **buf );
+stobj_delete_mobj(int fd, invt_seshdr_t *hdr, void *arg,
+		   void **buf);
 
 int
-stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses );
+stobj_get_sessinfo (inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses);
 
 void
-stobj_makefname( char *fname );
+stobj_makefname(char *fname);
 
 int
-stobj_insert_session( invt_idxinfo_t *idx, int fd,
-		      invt_sessinfo_t *s );
+stobj_insert_session(invt_idxinfo_t *idx, int fd,
+		      invt_sessinfo_t *s);
 
 int
-stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr );
+stobj_make_invsess(int fd, inv_session_t **buf, invt_seshdr_t *hdr);
 
 int
-stobj_copy_invsess( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_copy_invsess(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		    inv_session_t **buf);
 
 void
-DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx);
+DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx);
 
 void
-DEBUG_sessprint( invt_session_t *ses );
+DEBUG_sessprint(invt_session_t *ses);
 
 bool_t
 stobj_getsession_byuuid(int fd, invt_seshdr_t *hdr, void *sesid, void **buf);
@@ -486,57 +486,57 @@
 /*----------------------------------------------------------------------*/
 
 int
-fstab_get_fname( void *pred, char *fname, inv_predicate_t bywhat,
-		 inv_oflag_t forwhat );
+fstab_get_fname(void *pred, char *fname, inv_predicate_t bywhat,
+		 inv_oflag_t forwhat);
 
 int
-fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat );
+fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat);
 
 int
-fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
-	      inv_oflag_t forwhat );
+fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
+	      inv_oflag_t forwhat);
 
 void
-fstab_DEBUG_print( invt_fstab_t *arr, int num );
+fstab_DEBUG_print(invt_fstab_t *arr, int num);
 
 
 /*----------------------------------------------------------------------*/
 
 int
-get_invtentry( char *fname, time32_t tm, invt_entry_t *buf, size_t bufsz );
+get_invtentry(char *fname, time32_t tm, invt_entry_t *buf, size_t bufsz);
 
 int
-get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock );
+get_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock);
 
 int
-put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock );
+put_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock);
 
 inv_idbtoken_t
-get_token( int fd, int objfd );
+get_token(int fd, int objfd);
 
 void
-destroy_token( inv_idbtoken_t tok );
+destroy_token(inv_idbtoken_t tok);
 
 
 int
-get_headers( int fd, void **hdrs, size_t bufsz, size_t cntsz );
+get_headers(int fd, void **hdrs, size_t bufsz, size_t cntsz);
 
 int
-get_counters( int fd, void **cntpp, size_t sz );
+get_counters(int fd, void **cntpp, size_t sz);
 
 int
-get_sescounters( int fd, invt_sescounter_t **cntpp );
+get_sescounters(int fd, invt_sescounter_t **cntpp);
 
 int
-get_lastheader( int fd, void **ent, size_t hdrsz,  size_t cntsz );
+get_lastheader(int fd, void **ent, size_t hdrsz,  size_t cntsz);
 
 
 inv_sestoken_t
-get_sesstoken( inv_idbtoken_t tok );
+get_sesstoken(inv_idbtoken_t tok);
 
 int
-get_headerinfo( int fd, void **hdrs, void **cnt,
-	        size_t hdrsz, size_t cntsz, bool_t doblock );
+get_headerinfo(int fd, void **hdrs, void **cnt,
+	        size_t hdrsz, size_t cntsz, bool_t doblock);
 
 bool_t
 invmgr_query_all_sessions(uuid_t *fsidp, void *inarg, void **outarg,
@@ -546,42 +546,42 @@
 search_invt(uuid_t *fsidp, int invfd, void *arg, void **buf,
 	    search_callback_t do_chkcriteria);
 int
-invmgr_inv_print( int invfd, invt_pr_ctx_t *prctx);
+invmgr_inv_print(int invfd, invt_pr_ctx_t *prctx);
 
 int
-invmgr_inv_check( int invfd );
+invmgr_inv_check(int invfd);
 
 bool_t
-tm_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
-		   void **tm );
+tm_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
+		   void **tm);
 
 bool_t
-lastsess_level_lessthan( int fd, invt_seshdr_t *hdr,  void *arg,
-			 void **buf );
+lastsess_level_lessthan(int fd, invt_seshdr_t *hdr,  void *arg,
+			 void **buf);
 
 bool_t
-lastsess_level_equalto( int fd, invt_seshdr_t *hdr,  void *arg, void **buf );
+lastsess_level_equalto(int fd, invt_seshdr_t *hdr,  void *arg, void **buf);
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
+DEBUG_displayallsessions(int fd, invt_seshdr_t *hdr, uint ref,
 			  invt_pr_ctx_t *prctx);
 
 int
-make_invdirectory( inv_oflag_t forwhat );
+make_invdirectory(inv_oflag_t forwhat);
 
 bool_t
-init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
-	 inv_idbtoken_t *tok );
+init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
+	 inv_idbtoken_t *tok);
 
 int
-inv_getopt( int argc, char **argv, invt_pr_ctx_t *prctx);
+inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx);
 
 bool_t
-insert_session( invt_sessinfo_t *s);
+insert_session(invt_sessinfo_t *s);
 
 /* To reconstruct a complete inventory from dumped inventories */
 extern bool_t
-inv_put_sessioninfo( invt_sessinfo_t *s );
+inv_put_sessioninfo(invt_sessinfo_t *s);
 
 
 #endif
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 25df2fe..74893d3 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -49,67 +49,67 @@
 /* storage object whether or not it has reached its maximum.            */
 /*----------------------------------------------------------------------*/
 int
-stobj_insert_session( invt_idxinfo_t *idx,
+stobj_insert_session(invt_idxinfo_t *idx,
 		      int fd, /* kept locked EX by caller */
-		      invt_sessinfo_t *s )
+		      invt_sessinfo_t *s)
 {
 	invt_sescounter_t *sescnt = NULL;
 
-	if ( GET_SESCOUNTERS( fd, &sescnt ) < 0 ) {
-		INVLOCK( fd, LOCK_UN );
+	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
+		INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 
 	/* Check the existing sessions to make sure that we're not
 	   duplicating this session */
-	if ( sescnt->ic_curnum > 0 ) {
+	if (sescnt->ic_curnum > 0) {
 		uint i;
-		invt_session_t	*sessions = calloc( sescnt->ic_curnum,
-				   sizeof( invt_session_t ) );
-		if ( GET_REC_NOLOCK( fd, sessions, sescnt->ic_curnum *
-				     sizeof( invt_session_t ),
-				     (off64_t) ( sizeof( *sescnt ) +
-         		sescnt->ic_maxnum * sizeof( invt_seshdr_t ))) < 0 ) {
-			free ( sescnt );
-			free ( sessions );
+		invt_session_t	*sessions = calloc(sescnt->ic_curnum,
+				   sizeof(invt_session_t));
+		if (GET_REC_NOLOCK(fd, sessions, sescnt->ic_curnum *
+				     sizeof(invt_session_t),
+				     (off64_t) (sizeof(*sescnt) +
+         		sescnt->ic_maxnum * sizeof(invt_seshdr_t))) < 0) {
+			free (sescnt);
+			free (sessions);
 			return -1;
 		}
 
-		for( i = 0; i <  sescnt->ic_curnum; i++ ) {
-			if ( uuid_compare( sessions[i].s_sesid,
-					   s->ses->s_sesid ) == 0 )
+		for(i = 0; i <  sescnt->ic_curnum; i++) {
+			if (uuid_compare(sessions[i].s_sesid,
+					   s->ses->s_sesid) == 0)
 				break;
 
 		}
-		free ( sessions );
-		if ( i < sescnt->ic_curnum ) {
-			mlog( MLOG_DEBUG | MLOG_INV,
+		free (sessions);
+		if (i < sescnt->ic_curnum) {
+			mlog(MLOG_DEBUG | MLOG_INV,
 			      "INV: attempt to insert an "
 			      "existing session.\n"
 			     );
-			free ( sescnt );
+			free (sescnt);
 			return 1;
 		}
 
 	}
 
-	if ( sescnt->ic_curnum >= sescnt->ic_maxnum ) {
-		if ( stobj_split( idx, fd, sescnt, s ) < 0 ) {
-			free( sescnt );
+	if (sescnt->ic_curnum >= sescnt->ic_maxnum) {
+		if (stobj_split(idx, fd, sescnt, s) < 0) {
+			free(sescnt);
 			return -1;
 		}
-		free( sescnt );
+		free(sescnt);
 		return 1;
 
 	}
 
-	if ( stobj_put_session( fd, sescnt, s->ses, s->seshdr, s->strms,
-			        s->mfiles ) < 0 ){
-		free ( sescnt);
+	if (stobj_put_session(fd, sescnt, s->ses, s->seshdr, s->strms,
+			        s->mfiles) < 0){
+		free (sescnt);
 		return -1;
 	}
 
-	free ( sescnt);
+	free (sescnt);
 	return 1;
 }
 
@@ -125,16 +125,16 @@
 
 /* ARGSUSED */
 uint
-stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm )
+stobj_find_splitpoint(int fd, invt_seshdr_t *harr, uint ns, time32_t tm)
 {
 	uint i;
 
-	if ( harr[ns-1].sh_time < tm )
+	if (harr[ns-1].sh_time < tm)
 		return ns;
 	/* since ns > 1, our split point > 0  */
-	for ( i = ns - 1; i > 0; i-- ) {
+	for (i = ns - 1; i > 0; i--) {
 		/* these are ordered in ascending order */
-		if ( harr[i].sh_time > harr[i-1].sh_time )
+		if (harr[i].sh_time > harr[i-1].sh_time)
 			return i;
 	}
 
@@ -143,7 +143,7 @@
 	   really possible, but either way, we split at the last entry.
 	   This will impact the guarantee that invindex tries to give - that
 	   there's always a unique stobj for every session. */
-	mlog( MLOG_VERBOSE | MLOG_INV, _(
+	mlog(MLOG_VERBOSE | MLOG_INV, _(
 	      "INV: failed to find a different sh_time to split\n")
 	     );
 
@@ -162,8 +162,8 @@
 /*----------------------------------------------------------------------*/
 
 int
-stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
-	     invt_sessinfo_t *newsess )
+stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
+	     invt_sessinfo_t *newsess)
 {
 	invt_seshdr_t 	*harr = NULL;
 	uint          	i, ix, ns = sescnt->ic_curnum;
@@ -172,22 +172,22 @@
 	invt_sessinfo_t sesinfo;
 	invt_entry_t 	ient;
 
-	if ( GET_SESHEADERS( fd, &harr, ns ) < 0 )
+	if (GET_SESHEADERS(fd, &harr, ns) < 0)
 		return -1;
 
-	assert( harr != NULL );
+	assert(harr != NULL);
 
-	if ( ( ix = stobj_find_splitpoint( fd, harr, ns,
-				       newsess->seshdr->sh_time ) ) == 0 )
+	if ((ix = stobj_find_splitpoint(fd, harr, ns,
+				       newsess->seshdr->sh_time)) == 0)
 		return -1;
 
-	if ( ix == ns ) {
+	if (ix == ns) {
 		ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end =
 			 newsess->seshdr->sh_time;
 	} else {
 		ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end =
 		harr[ix].sh_time;
-		if ( harr[ix - 1].sh_time >  newsess->seshdr->sh_time )
+		if (harr[ix - 1].sh_time >  newsess->seshdr->sh_time)
 			idx->iarr[idx->index].ie_timeperiod.tp_end
 				= harr[ix - 1].sh_time;
 		else
@@ -198,11 +198,11 @@
 	/* Get the new stobj to put the 'spilling' sessinfo in. We know the
 	   idx of the current stobj, and by definition, the new stobj
 	   should come right afterwards. */
-	newsess->stobjfd = idx_put_newentry( idx, &ient );
-	if ( newsess->stobjfd < 0 )
+	newsess->stobjfd = idx_put_newentry(idx, &ient);
+	if (newsess->stobjfd < 0)
 		return -1;
 
-	if ( ix == ns ) {
+	if (ix == ns) {
 		invt_sescounter_t *scnt = NULL;
 		off64_t rval;
 
@@ -210,55 +210,55 @@
 		   the new stobj, and rest in peace */
 		idx->index++;
 
-		if ( GET_SESCOUNTERS( newsess->stobjfd, &scnt ) < 0 )
+		if (GET_SESCOUNTERS(newsess->stobjfd, &scnt) < 0)
 			return -1;
 
-		rval = stobj_put_session( newsess->stobjfd, scnt,
+		rval = stobj_put_session(newsess->stobjfd, scnt,
 				        newsess->ses,
 				        newsess->seshdr, newsess->strms,
-				        newsess->mfiles );
-		free( scnt );
+				        newsess->mfiles);
+		free(scnt);
 		return (rval < 0)? -1: 1;
 	}
 
 
 
-	for ( i = ix; i < ns; i++ ) {
+	for (i = ix; i < ns; i++) {
 		invt_session_t session;
 		bufpp = NULL;
 		bufszp = 0;
 
 		newsess->seshdr->sh_sess_off = harr[i].sh_sess_off;
 
-		if ( GET_REC_NOLOCK( fd, &session, sizeof( invt_session_t ),
-			     harr[i].sh_sess_off ) < 0 )
+		if (GET_REC_NOLOCK(fd, &session, sizeof(invt_session_t),
+			     harr[i].sh_sess_off) < 0)
 			return -1;
-		if (! stobj_pack_sessinfo( fd, &session, &harr[i], &bufpp,
-					   &bufszp ))
+		if (! stobj_pack_sessinfo(fd, &session, &harr[i], &bufpp,
+					   &bufszp))
 			return -1;
 		/* Now we need to put this in the new StObj. So, first
 		   unpack it. */
-		if (! stobj_unpack_sessinfo( bufpp, bufszp, &sesinfo ) )
+		if (! stobj_unpack_sessinfo(bufpp, bufszp, &sesinfo))
 			return -1;
 
 		/* There is no chance of a recursion here */
-		if ( stobj_insert_session( idx, newsess->stobjfd, &sesinfo )
-		     < 0 )
+		if (stobj_insert_session(idx, newsess->stobjfd, &sesinfo)
+		     < 0)
 			return -1;
 
 		/* Now delete that session from this StObj */
-		if (! stobj_delete_sessinfo( fd, sescnt, &session,
-					     &harr[i] ) )
+		if (! stobj_delete_sessinfo(fd, sescnt, &session,
+					     &harr[i]))
 			return -1;
-		free( bufpp );
+		free(bufpp);
 	}
 	/* Put the new session in the stobj that we just split. Make
 	   sure that we use the updated sescnt and not the stale stuff
 	   from disk. stobj_put_session() writes sescnt and sessinfo to
 	   disk */
-	if ( stobj_put_session( fd, sescnt, newsess->ses, newsess->seshdr,
-			        newsess->strms, newsess->mfiles ) < 0 ) {
-		free ( sescnt);
+	if (stobj_put_session(fd, sescnt, newsess->ses, newsess->seshdr,
+			        newsess->strms, newsess->mfiles) < 0) {
+		free (sescnt);
 		return -1;
 	}
 
@@ -271,8 +271,8 @@
 
 /* ARGSUSED */
 int
-stobj_delete_mfile( int fd, inv_stream_t *strm, invt_mediafile_t *mf,
-		    off64_t  mfileoff )
+stobj_delete_mfile(int fd, inv_stream_t *strm, invt_mediafile_t *mf,
+		    off64_t  mfileoff)
 {
 
 	return 1;
@@ -284,9 +284,9 @@
 
 /* ARGSUSED */
 bool_t
-stobj_delete_sessinfo( int fd, /* kept locked EX by caller */
+stobj_delete_sessinfo(int fd, /* kept locked EX by caller */
 		       invt_sescounter_t *sescnt,
-		       invt_session_t *ses, invt_seshdr_t *hdr )
+		       invt_session_t *ses, invt_seshdr_t *hdr)
 {
 	/* we change the sescnt here, but dont write it back to disk
 	   until later */
@@ -314,65 +314,65 @@
 	invt_session_t *ses,
 	invt_seshdr_t *hdr,
 	invt_stream_t *strms,
-	invt_mediafile_t *mfiles )
+	invt_mediafile_t *mfiles)
 {
 	off64_t hoff;
 
 	/* figure out the place where the header will go */
-	hoff =  STOBJ_OFFSET( sescnt->ic_curnum, 0 );
+	hoff =  STOBJ_OFFSET(sescnt->ic_curnum, 0);
 
 	/* figure out where the session information is going to go. */
-	if ( hdr->sh_sess_off < 0 )
-		hdr->sh_sess_off = STOBJ_OFFSET( sescnt->ic_maxnum,
-						 sescnt->ic_curnum );
+	if (hdr->sh_sess_off < 0)
+		hdr->sh_sess_off = STOBJ_OFFSET(sescnt->ic_maxnum,
+						 sescnt->ic_curnum);
 	sescnt->ic_curnum++;
 
 #ifdef INVT_DEBUG
-	mlog ( MLOG_VERBOSE,
+	mlog (MLOG_VERBOSE,
 	       "INV: create sess #%d @ offset %d ic_eof = %d\n",
 	       sescnt->ic_curnum, (int) hdr->sh_sess_off,
-	       (int) sescnt->ic_eof );
+	       (int) sescnt->ic_eof);
 #endif
 
 	/* we need to know where the streams begin, and where the
 	   media files will begin, at the end of the streams */
 	hdr->sh_streams_off = sescnt->ic_eof;
 
-	if ( strms == NULL ) {
-		sescnt->ic_eof += (off64_t)( ses->s_max_nstreams *
-					     sizeof( invt_stream_t ) );
+	if (strms == NULL) {
+		sescnt->ic_eof += (off64_t)(ses->s_max_nstreams *
+					     sizeof(invt_stream_t));
 	} else {
 		uint i;
 		size_t nmf = 0;
-		sescnt->ic_eof += (off64_t)( ses->s_cur_nstreams *
-					     sizeof( invt_stream_t ) );
+		sescnt->ic_eof += (off64_t)(ses->s_cur_nstreams *
+					     sizeof(invt_stream_t));
 		for (i=0; i<ses->s_cur_nstreams; i++)
-			nmf += ( size_t ) strms[i].st_nmediafiles;
+			nmf += (size_t) strms[i].st_nmediafiles;
 
-		sescnt->ic_eof += (off64_t)( sizeof( invt_mediafile_t )
-					     * nmf );
-		if ( stobj_put_streams( fd, hdr, ses, strms, mfiles ) < 0 )
+		sescnt->ic_eof += (off64_t)(sizeof(invt_mediafile_t)
+					     * nmf);
+		if (stobj_put_streams(fd, hdr, ses, strms, mfiles) < 0)
 			return -1;
 
 	}
 
 	/* we write back the counters of this storage object first */
-	if ( PUT_SESCOUNTERS( fd, sescnt ) < 0 )
+	if (PUT_SESCOUNTERS(fd, sescnt) < 0)
 		return -1;
 
 	/* write the header next; lseek to the right position */
-	if ( PUT_REC_NOLOCK( fd, hdr, sizeof( invt_seshdr_t ), hoff ) < 0 ) {
+	if (PUT_REC_NOLOCK(fd, hdr, sizeof(invt_seshdr_t), hoff) < 0) {
 		return -1;
 	}
 
 	/* write the header information to the storage object */
-	if ( PUT_REC_NOLOCK( fd, ses, sizeof( invt_session_t ),
-			     hdr->sh_sess_off ) < 0 ) {
+	if (PUT_REC_NOLOCK(fd, ses, sizeof(invt_session_t),
+			     hdr->sh_sess_off) < 0) {
 		return -1;
 	}
 
-	if ( strms != NULL )
-		stobj_sortheaders( fd, sescnt->ic_curnum );
+	if (strms != NULL)
+		stobj_sortheaders(fd, sescnt->ic_curnum);
 
 	return hoff;
 }
@@ -387,41 +387,41 @@
 /*----------------------------------------------------------------------*/
 
 int
-stobj_sortheaders( int fd, uint num )
+stobj_sortheaders(int fd, uint num)
 {
-	size_t sz = sizeof( invt_seshdr_t ) * num;
+	size_t sz = sizeof(invt_seshdr_t) * num;
 	invt_seshdr_t *hdrs;
 #ifdef INVT_DEBUG
 	int i;
 #endif
-	if ( num < 2 ) return 1;
+	if (num < 2) return 1;
 
-	hdrs = malloc( sz );
-	assert( hdrs );
+	hdrs = malloc(sz);
+	assert(hdrs);
 
-	if ( GET_REC_NOLOCK( fd, hdrs, sz, STOBJ_OFFSET( 0, 0 ) ) < 0 ) {
-		free ( hdrs );
+	if (GET_REC_NOLOCK(fd, hdrs, sz, STOBJ_OFFSET(0, 0)) < 0) {
+		free (hdrs);
 		return -1;
 	}
 #ifdef INVT_DEBUG
-	printf("\nBEF\n" );
+	printf("\nBEF\n");
 	for (i=0; i<(int)num; i++)
-		printf("%ld\n", (long) hdrs[i].sh_time );
+		printf("%ld\n", (long) hdrs[i].sh_time);
 #endif
-	qsort( (void*) hdrs, (size_t) num,
-	      sizeof( invt_seshdr_t ), stobj_hdrcmp );
+	qsort((void*) hdrs, (size_t) num,
+	      sizeof(invt_seshdr_t), stobj_hdrcmp);
 
 #ifdef INVT_DEBUG
-	printf("\n\nAFT\n" );
+	printf("\n\nAFT\n");
 	for (i=0; i<(int)num; i++)
-		printf("%ld\n", (long) hdrs[i].sh_time );
+		printf("%ld\n", (long) hdrs[i].sh_time);
 #endif
-	if ( PUT_REC_NOLOCK( fd, hdrs, sz, STOBJ_OFFSET( 0, 0 ) ) < 0 ) {
-		free ( hdrs );
+	if (PUT_REC_NOLOCK(fd, hdrs, sz, STOBJ_OFFSET(0, 0)) < 0) {
+		free (hdrs);
 		return -1;
 	}
 
-	free ( hdrs );
+	free (hdrs);
 	return 1;
 
 }
@@ -437,51 +437,51 @@
 /*----------------------------------------------------------------------*/
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
-		   invt_mediafile_t *mfiles )
+		   invt_mediafile_t *mfiles)
 {
 	uint	nstm = ses->s_cur_nstreams;
 	off64_t off  = hdr->sh_streams_off;
-	off64_t mfileoff = off + (off64_t)( nstm * sizeof( invt_stream_t ) );
+	off64_t mfileoff = off + (off64_t)(nstm * sizeof(invt_stream_t));
 	uint nmfiles = 0;
 	uint i,j;
 
 	/* fix the offsets in streams */
-	for ( i = 0; i < nstm; i++ ) {
+	for (i = 0; i < nstm; i++) {
 		strms[i].st_firstmfile = mfileoff +
-		  (off64_t) ((size_t) nmfiles * sizeof( invt_mediafile_t ) );
+		  (off64_t) ((size_t) nmfiles * sizeof(invt_mediafile_t));
 		/* now fix the offsets in mediafiles */
-		for ( j = 0; j < strms[i].st_nmediafiles; j++ ) {
+		for (j = 0; j < strms[i].st_nmediafiles; j++) {
 
 			/* no need to fix the last element's next ptr */
-			if ( j < strms[i].st_nmediafiles - 1 )
-				mfiles[ nmfiles + j ].mf_nextmf =
+			if (j < strms[i].st_nmediafiles - 1)
+				mfiles[nmfiles + j].mf_nextmf =
 				        strms[i].st_firstmfile +
-			      (off64_t) ((j+1) * sizeof( invt_mediafile_t ));
+			      (off64_t) ((j+1) * sizeof(invt_mediafile_t));
 
 			/* no need to fix the first element's prev ptr */
-			if ( j )
-				mfiles[ nmfiles + j ].mf_prevmf =
+			if (j)
+				mfiles[nmfiles + j].mf_prevmf =
 				        strms[i].st_firstmfile +
-			    (off64_t) ((j-1) * sizeof( invt_mediafile_t ));
+			    (off64_t) ((j-1) * sizeof(invt_mediafile_t));
 		}
 
 		/* adjust the offsets of the first and the last elements
 		   in the mediafile chain */
-		mfiles[ nmfiles ].mf_prevmf = 0;
+		mfiles[nmfiles].mf_prevmf = 0;
 		nmfiles += strms[i].st_nmediafiles;
-		mfiles[ nmfiles - 1 ].mf_nextmf = 0;
+		mfiles[nmfiles - 1].mf_nextmf = 0;
 
 	}
 
 	/* first put the streams. hdr already points at the right place */
-	if ( PUT_REC_NOLOCK( fd, strms, nstm * sizeof( invt_stream_t ),
-			     off ) < 0 )
+	if (PUT_REC_NOLOCK(fd, strms, nstm * sizeof(invt_stream_t),
+			     off) < 0)
 		return -1;
 
-	if ( PUT_REC_NOLOCK( fd, mfiles, nmfiles * sizeof( invt_mediafile_t ),
-			     mfileoff ) < 0 )
+	if (PUT_REC_NOLOCK(fd, mfiles, nmfiles * sizeof(invt_mediafile_t),
+			     mfileoff) < 0)
 		return -1;
 
 	return 1;
@@ -498,21 +498,21 @@
 /*----------------------------------------------------------------------*/
 
 void
-stobj_makefname( char *fname )
+stobj_makefname(char *fname)
 {
 	/* come up with a new unique name */
 	uuid_t	fn;
 	char str[UUID_STR_LEN + 1];
 
-	uuid_generate( fn );
-        uuid_unparse( fn, str );
+	uuid_generate(fn);
+        uuid_unparse(fn, str);
 
-	strcpy( fname, INV_DIRPATH );
-	strcat( fname, "/" );
-	strcat( fname, str );
-	strcat( fname, INV_STOBJ_PREFIX );
+	strcpy(fname, INV_DIRPATH);
+	strcat(fname, "/");
+	strcat(fname, str);
+	strcat(fname, INV_STOBJ_PREFIX);
 
-	assert( (int) strlen( fname ) < INV_STRLEN );
+	assert((int) strlen(fname) < INV_STRLEN);
 }
 
 
@@ -523,39 +523,39 @@
 
 /* NOTE: this doesnt update counters or headers in the inv_index */
 int
-stobj_create( char *fname )
+stobj_create(char *fname)
 {
 	int fd;
 	invt_sescounter_t sescnt;
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 
 #ifdef INVT_DEBUG
-	mlog( MLOG_VERBOSE | MLOG_INV, "INV: creating storage obj %s\n", fname);
+	mlog(MLOG_VERBOSE | MLOG_INV, "INV: creating storage obj %s\n", fname);
 #endif
 
 	/* create the new storage object */
-	if (( fd = open( fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
-		INV_PERROR ( fname );
-		memset( fname, 0, INV_STRLEN );
+	if ((fd = open(fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+		INV_PERROR (fname);
+		memset(fname, 0, INV_STRLEN);
 		return -1;
 	}
 
-	INVLOCK( fd, LOCK_EX );
-	fchmod( fd, INV_PERMS );
+	INVLOCK(fd, LOCK_EX);
+	fchmod(fd, INV_PERMS);
 
 	sescnt.ic_vernum = INV_VERSION;
 	sescnt.ic_curnum = 0; /* there are no sessions as yet */
 	sescnt.ic_maxnum = INVT_STOBJ_MAXSESSIONS;
 	sescnt.ic_eof = SC_EOF_INITIAL_POS;
 
-	if ( PUT_SESCOUNTERS ( fd, &sescnt ) < 0 ) {
-		memset( fname, 0, INV_STRLEN );
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+	if (PUT_SESCOUNTERS (fd, &sescnt) < 0) {
+		memset(fname, 0, INV_STRLEN);
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 		return -1;
 	}
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 	return fd;
 }
 
@@ -574,16 +574,16 @@
 	int fd, /* kept locked EX by caller */
 	invt_sescounter_t *sescnt,
 	invt_session_t *ses,
-	invt_seshdr_t *hdr )
+	invt_seshdr_t *hdr)
 {
 	off64_t hoff;
 
-	assert( tok && sescnt && ses && hdr );
+	assert(tok && sescnt && ses && hdr);
 
 	hdr->sh_sess_off = -1;
 	ses->s_cur_nstreams = 0;
 
-	if ((hoff = stobj_put_session( fd, sescnt, ses, hdr, NULL, NULL ))
+	if ((hoff = stobj_put_session(fd, sescnt, ses, hdr, NULL, NULL))
 	    < 0) {
 		return -1;
 	}
@@ -603,7 +603,7 @@
 /*----------------------------------------------------------------------*/
 
 int
-stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
+stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 {
 	int  rval;
 	invt_sescounter_t *sescnt = NULL;
@@ -615,31 +615,31 @@
 	/* first we need to find out where the current write-position is.
 	   so, we first read the sescounter that is at the top of this
 	   storage object */
-	if ( GET_SESCOUNTERS( fd, &sescnt ) < 0 )
+	if (GET_SESCOUNTERS(fd, &sescnt) < 0)
 		return -1;
 
 	pos = sescnt->ic_eof;
 
 	/* increment the pointer to give space for this media file */
-	sescnt->ic_eof += (off64_t) sizeof( invt_mediafile_t );
+	sescnt->ic_eof += (off64_t) sizeof(invt_mediafile_t);
 
-	if ( PUT_SESCOUNTERS( fd, sescnt ) < 0 )
+	if (PUT_SESCOUNTERS(fd, sescnt) < 0)
 		return -1;
 
 	/* get the stream information, and update number of mediafiles.
 	   we also need to link the new mediafile into the linked-list of
 	   media files of this stream */
 
-	if ( GET_REC_NOLOCK( fd, &stream, sizeof( stream ),
-			     tok->md_stream_off ) < 0 )
+	if (GET_REC_NOLOCK(fd, &stream, sizeof(stream),
+			     tok->md_stream_off) < 0)
 		return -1;
 
 	/* We need to update the last ino of this STREAM, which is now the
 	   last ino of the new mediafile. If this is the first mediafile, we
 	   have to update the startino as well. Note that ino is a <ino,off>
 	   tuple */
-	if ( ! ( mf->mf_flag & INVT_MFILE_INVDUMP )) {
-		if ( stream.st_nmediafiles == 0 )
+	if (! (mf->mf_flag & INVT_MFILE_INVDUMP)) {
+		if (stream.st_nmediafiles == 0)
 			stream.st_startino = mf->mf_startino;
 		stream.st_endino = mf->mf_endino;
 	}
@@ -655,7 +655,7 @@
 	mf->mf_prevmf = stream.st_lastmfile;
 
 
-	if ( tok->md_lastmfile )
+	if (tok->md_lastmfile)
 		tok->md_lastmfile->mf_nextmf = pos;
 	else {
 		stream.st_firstmfile = pos;
@@ -665,29 +665,29 @@
 
 
 	/* write the stream to disk */
-	if ( PUT_REC_NOLOCK( fd, &stream, sizeof( stream ),
-			     tok->md_stream_off ) < 0 )
+	if (PUT_REC_NOLOCK(fd, &stream, sizeof(stream),
+			     tok->md_stream_off) < 0)
 		return -1;
 
 	/* write the prev media file to disk too */
-	if ( tok->md_lastmfile ) {
-		rval = PUT_REC_NOLOCK( fd, tok->md_lastmfile,
-				       sizeof( invt_mediafile_t ),
-				       mf->mf_prevmf );
-		free (  tok->md_lastmfile );
-		if ( rval < 0 )
+	if (tok->md_lastmfile) {
+		rval = PUT_REC_NOLOCK(fd, tok->md_lastmfile,
+				       sizeof(invt_mediafile_t),
+				       mf->mf_prevmf);
+		free (tok->md_lastmfile);
+		if (rval < 0)
 			return -1;
 	}
 
-	if ( ! ( mf->mf_flag & INVT_MFILE_INVDUMP )) {
+	if (! (mf->mf_flag & INVT_MFILE_INVDUMP)) {
 		tok->md_lastmfile = mf;
 	} else {
 		tok->md_lastmfile = NULL;
 	}
 
 	/* at last, write the new media file to disk */
-	rval = PUT_REC_NOLOCK( fd, mf, sizeof( invt_mediafile_t ), pos );
-	if ( rval < 0 ) {
+	rval = PUT_REC_NOLOCK(fd, mf, sizeof(invt_mediafile_t), pos);
+	if (rval < 0) {
 		return -1;
 	}
 
@@ -709,17 +709,17 @@
 /*----------------------------------------------------------------------*/
 
 int
-stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr,
-		     invt_session_t *ses )
+stobj_get_sessinfo (inv_sestoken_t tok, invt_seshdr_t *hdr,
+		     invt_session_t *ses)
 {
 	int rval;
 	int fd = tok->sd_invtok->d_stobj_fd;
 
 	/* get the session header first */
-	if ( ( rval = GET_REC_NOLOCK( fd, hdr, sizeof( invt_seshdr_t ),
-			     tok->sd_sesshdr_off ) ) > 0 ) {
-		rval = GET_REC_NOLOCK( fd, ses, sizeof( invt_session_t ),
-			     tok->sd_session_off );
+	if ((rval = GET_REC_NOLOCK(fd, hdr, sizeof(invt_seshdr_t),
+			     tok->sd_sesshdr_off)) > 0) {
+		rval = GET_REC_NOLOCK(fd, ses, sizeof(invt_session_t),
+			     tok->sd_session_off);
 	}
 
 	return rval;
@@ -734,8 +734,8 @@
 /*----------------------------------------------------------------------*/
 
 bool_t
-stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
-		     void  **bufpp, size_t *bufszp )
+stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
+		     void  **bufpp, size_t *bufszp)
 {
 	size_t	      	stmsz;
 	uint		i, j;
@@ -745,38 +745,38 @@
 	off64_t		off;
 	invt_mediafile_t mf;
 
-	stmsz = sizeof( invt_stream_t ) * ses->s_cur_nstreams;
+	stmsz = sizeof(invt_stream_t) * ses->s_cur_nstreams;
 
 	/* the initial size without the mediafiles */
-	sessz = strlen( INVTSESS_COOKIE ) * sizeof( char ) +
-		sizeof( inv_version_t ) +
-		sizeof( inv_version_t ) +  /* added to fix 64 bit alignment prob */
-		sizeof( invt_session_t) + sizeof( invt_seshdr_t ) + stmsz;
+	sessz = strlen(INVTSESS_COOKIE) * sizeof(char) +
+		sizeof(inv_version_t) +
+		sizeof(inv_version_t) +  /* added to fix 64 bit alignment prob */
+		sizeof(invt_session_t) + sizeof(invt_seshdr_t) + stmsz;
 
 	/* now get all the streams of this session */
-	strms = calloc ( ses->s_cur_nstreams, sizeof( invt_stream_t ) );
-	if ( GET_REC_NOLOCK( fd, strms, stmsz, hdr->sh_streams_off ) < 0 ) {
-		free ( strms );
+	strms = calloc (ses->s_cur_nstreams, sizeof(invt_stream_t));
+	if (GET_REC_NOLOCK(fd, strms, stmsz, hdr->sh_streams_off) < 0) {
+		free (strms);
 		return BOOL_FALSE;
 	}
 
-	for ( i = 0; i < ses->s_cur_nstreams; i++ )
-		sessz += sizeof( invt_mediafile_t ) *
+	for (i = 0; i < ses->s_cur_nstreams; i++)
+		sessz += sizeof(invt_mediafile_t) *
 			 (size_t) strms[i].st_nmediafiles;
 
 	/* Now we know how big this entire thing is going to be */
-	sesbufcp = sesbuf = calloc( 1, sessz );
-	assert( sesbuf );
+	sesbufcp = sesbuf = calloc(1, sessz);
+	assert(sesbuf);
 
 	/* Copy everything. Note that we don't bother to adjust the offsets
 	   either in the seshdr or in the mediafiles, because we don't need
-	   those in order to restore this session ( since everything's
-	   contiguous ) */
+	   those in order to restore this session (since everything's
+	   contiguous) */
 
 	/* magic cookie that we put for sanity checking in case of an
 	   earthquake or something :) */
-	strcpy( sesbuf, INVTSESS_COOKIE );
-	sesbuf += (size_t)( strlen( INVTSESS_COOKIE ) * sizeof( char ) );
+	strcpy(sesbuf, INVTSESS_COOKIE);
+	sesbuf += (size_t)(strlen(INVTSESS_COOKIE) * sizeof(char));
 
 	/* This was originally INV_VERSION. Changed it to mean packed inventory
 	 * version number and added another inv_version_t to contain the INV_VERSION.
@@ -785,43 +785,43 @@
 	 * the general inventory version
 	 */
 	*(inv_version_t *)sesbuf = INT_GET(PACKED_INV_VERSION, ARCH_CONVERT);
-	sesbuf += sizeof( inv_version_t );
+	sesbuf += sizeof(inv_version_t);
 
 	/* This has the INV_VERSION */
 	*(inv_version_t *)sesbuf = INT_GET(INV_VERSION, ARCH_CONVERT);
-	sesbuf += sizeof( inv_version_t );
+	sesbuf += sizeof(inv_version_t);
 
 	xlate_invt_seshdr(hdr, (invt_seshdr_t *)sesbuf, 1);
-	sesbuf += sizeof( invt_seshdr_t );
+	sesbuf += sizeof(invt_seshdr_t);
 
-	xlate_invt_session( ses, (invt_session_t *)sesbuf, 1 );
-	sesbuf += sizeof( invt_session_t );
+	xlate_invt_session(ses, (invt_session_t *)sesbuf, 1);
+	sesbuf += sizeof(invt_session_t);
 
-	for ( i = 0; i < ses->s_cur_nstreams; i++ ) {
-		xlate_invt_stream( strms, (invt_stream_t *)sesbuf, 1 );
-		sesbuf += sizeof( invt_stream_t );
+	for (i = 0; i < ses->s_cur_nstreams; i++) {
+		xlate_invt_stream(strms, (invt_stream_t *)sesbuf, 1);
+		sesbuf += sizeof(invt_stream_t);
 	}
 
 	/* now append all the mediafiles */
-	for ( i = 0; i < ses->s_cur_nstreams; i++ ) {
+	for (i = 0; i < ses->s_cur_nstreams; i++) {
 		off = strms[i].st_firstmfile;
-		for ( j = 0; j < strms[i].st_nmediafiles;
+		for (j = 0; j < strms[i].st_nmediafiles;
 		     j++,
-		     off = mf.mf_nextmf ) {
-			assert( off );
-			if ( GET_REC_NOLOCK( fd, &mf,
-					     sizeof( invt_mediafile_t ),
-					     off ) <= 0 ) {
-				free( strms );
-				free( sesbuf );
+		     off = mf.mf_nextmf) {
+			assert(off);
+			if (GET_REC_NOLOCK(fd, &mf,
+					     sizeof(invt_mediafile_t),
+					     off) <= 0) {
+				free(strms);
+				free(sesbuf);
 				return BOOL_FALSE;
 			}
 			xlate_invt_mediafile(&mf, (invt_mediafile_t *)sesbuf, 1);
-			sesbuf += sizeof( invt_mediafile_t );
+			sesbuf += sizeof(invt_mediafile_t);
 		}
 	}
 
-	free( strms );
+	free(strms);
 	*bufpp = sesbufcp;
 	*bufszp = sessz;
 
@@ -840,13 +840,13 @@
 	int fd,
 	invt_seshdr_t *hdr,
 	void *sesid,
-	void **buf )
+	void **buf)
 {
 	invt_session_t ses;
 
 	/* retrieve the session */
-	if ( GET_REC_NOLOCK( fd, &ses, sizeof( invt_session_t ),
-			     hdr->sh_sess_off ) < 0 )
+	if (GET_REC_NOLOCK(fd, &ses, sizeof(invt_session_t),
+			     hdr->sh_sess_off) < 0)
 		return -1;
 
 	/* now see if this is the one that caller is askin for */
@@ -876,13 +876,13 @@
 	int fd,
 	invt_seshdr_t *hdr,
 	void *seslabel,
-	void **buf )
+	void **buf)
 {
 	invt_session_t ses;
 
 	/* retrieve the session */
-	if ( GET_REC_NOLOCK( fd, &ses, sizeof( invt_session_t ),
-			     hdr->sh_sess_off ) < 0 )
+	if (GET_REC_NOLOCK(fd, &ses, sizeof(invt_session_t),
+			     hdr->sh_sess_off) < 0)
 		return -1;
 
 	/* now see if this is the one that caller is askin for */
@@ -910,7 +910,7 @@
 stobj_delete_mobj(int fd,
 		  invt_seshdr_t *hdr,
 		  void *arg ,
-		  void **buf )
+		  void **buf)
 {
 	/* XXX fd needs to be locked EX, not SH */
 	uuid_t *moid = *buf;
@@ -922,38 +922,38 @@
 	uint		i, j;
 	bool_t 		dirty;
 
-	if ( GET_REC_NOLOCK( fd, &ses, sizeof( invt_session_t ),
-			     hdr->sh_sess_off ) < 0 )
+	if (GET_REC_NOLOCK(fd, &ses, sizeof(invt_session_t),
+			     hdr->sh_sess_off) < 0)
 		return -1;
 
 	/* now get all the streams of this session */
-	strms = calloc ( ses.s_cur_nstreams, sizeof( invt_stream_t ) );
-	if ( GET_REC_NOLOCK( fd, strms,
-			     sizeof( invt_stream_t ) * ses.s_cur_nstreams,
-			     hdr->sh_streams_off ) < 0 ) {
-		free ( strms );
+	strms = calloc (ses.s_cur_nstreams, sizeof(invt_stream_t));
+	if (GET_REC_NOLOCK(fd, strms,
+			     sizeof(invt_stream_t) * ses.s_cur_nstreams,
+			     hdr->sh_streams_off) < 0) {
+		free (strms);
 		return BOOL_FALSE;
 	}
 
 	/* now look at all the mediafiles in all the streams */
-	for ( i = 0; i < ses.s_cur_nstreams; i++ ) {
+	for (i = 0; i < ses.s_cur_nstreams; i++) {
 		off = strms[i].st_firstmfile;
 		nmfiles = strms[i].st_nmediafiles;
-		mfiles = mf = calloc( nmfiles, sizeof( invt_mediafile_t ) );
-		for ( j = 0; j < nmfiles;
+		mfiles = mf = calloc(nmfiles, sizeof(invt_mediafile_t));
+		for (j = 0; j < nmfiles;
 		     j++,
 		     off = mf->mf_nextmf,
-		     mf++ ) {
+		     mf++) {
 
 /*  The prob is that we need to keep track of where we got these mfiles from
     as we get them, or we wont know how to put them back if they are dirty.
 */
-			assert( off );
-			if ( GET_REC_NOLOCK( fd, mf,
-					     sizeof( invt_mediafile_t ),
-					     off ) <= 0 ) {
-				free( strms );
-				free( mfiles );
+			assert(off);
+			if (GET_REC_NOLOCK(fd, mf,
+					     sizeof(invt_mediafile_t),
+					     off) <= 0) {
+				free(strms);
+				free(mfiles);
 				return BOOL_FALSE;
 			}
 		}
@@ -962,31 +962,31 @@
 		   pass, checking to see if we need to remove any mfiles */
  		dirty = BOOL_FALSE;
 
-		for ( j = 0; j < nmfiles; j++ ) {
+		for (j = 0; j < nmfiles; j++) {
 			mf = &mfiles[j];
-			if ( !uuid_compare( mf->mf_moid, *moid ) ) {
+			if (!uuid_compare(mf->mf_moid, *moid)) {
 #ifdef INVT_DEBUG
-				printf(" found one\n" );
+				printf(" found one\n");
 #endif
 
 /*                                dirty = BOOL_TRUE;
 
-				if ( j == 0 )
+				if (j == 0)
 				       strms[i].st_firstmfile = mf->mf_nextmf;
 				else
 				       mfiles[j-1].mf_nextmf = mf->mf_nextmf;
 
-				if ( j == nmfiles - 1 )
+				if (j == nmfiles - 1)
 				       strms[i].st_lastmfile = ;
 */
 			}
 
 		}
-		free ( mfiles );
-		if ( dirty );
+		free (mfiles);
+		if (dirty);
 	}
 
-	free ( strms );
+	free (strms);
 
 	return BOOL_FALSE; /* ret FALSE, or it'll stop iteration */
 }
@@ -1006,36 +1006,36 @@
 stobj_unpack_sessinfo(
         void              *bufp,
         size_t             bufsz,
-	invt_sessinfo_t   *s )
+	invt_sessinfo_t   *s)
 {
 	uint 		 i;
 	char	         *tmpbuf;
 	char 		 *p = (char *)bufp;
 
-	assert ( bufp );
+	assert (bufp);
 
 	tmpbuf = (char *)malloc(bufsz);
 
 	/* first make sure that the magic cookie at the beginning is right.
 	   this isn't null-terminated */
-	if (strncmp( p, INVTSESS_COOKIE, strlen( INVTSESS_COOKIE ) ) != 0) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
-			"INV: inv_put_session: unknown cookie\n") );
+	if (strncmp(p, INVTSESS_COOKIE, strlen(INVTSESS_COOKIE)) != 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _(
+			"INV: inv_put_session: unknown cookie\n"));
 		return BOOL_FALSE;
 	}
 	/* skip the cookie */
-	p += strlen( INVTSESS_COOKIE ) * sizeof( char );
+	p += strlen(INVTSESS_COOKIE) * sizeof(char);
 
 	/* Check the packing version number. In version 1 , this was the only version number.
 	 * see the comment in stobj_pack_sessinfo().
 	 */
-	if ( INT_GET(*( inv_version_t *) p, ARCH_CONVERT) == PACKED_INV_VERSION_1 ) {
+	if (INT_GET(*(inv_version_t *) p, ARCH_CONVERT) == PACKED_INV_VERSION_1) {
 		char *temp_p;
 		size_t		 tempsz;
 
-	        mlog( MLOG_DEBUG | MLOG_INV,"INV: packed inventory version  = 1\n" );
+	        mlog(MLOG_DEBUG | MLOG_INV,"INV: packed inventory version  = 1\n");
 
-		p += sizeof( inv_version_t );
+		p += sizeof(inv_version_t);
 
 		/* We hit a 64 bit alignment issue at this point leading to a
 		 * SIGBUS and core dump. The best way to handle it is to
@@ -1047,19 +1047,19 @@
 		 * have the INV_VERSION. This makes everything 64 bit aligned.
 		 */
 
-		tempsz = bufsz - (strlen( INVTSESS_COOKIE ) * sizeof( char ))
-			       - sizeof( inv_version_t ) ;
+		tempsz = bufsz - (strlen(INVTSESS_COOKIE) * sizeof(char))
+			       - sizeof(inv_version_t) ;
 		temp_p = calloc(1, tempsz);
 		bcopy(p, temp_p, tempsz);
 		p = temp_p;
-	} else if ( INT_GET(*( inv_version_t *) p, ARCH_CONVERT) == PACKED_INV_VERSION_2 ) {
-	        mlog( MLOG_DEBUG | MLOG_INV,"INV: packed inventory version = 2\n" );
+	} else if (INT_GET(*(inv_version_t *) p, ARCH_CONVERT) == PACKED_INV_VERSION_2) {
+	        mlog(MLOG_DEBUG | MLOG_INV,"INV: packed inventory version = 2\n");
 
-		p += sizeof( inv_version_t ); /* skip the packed inventory version */
+		p += sizeof(inv_version_t); /* skip the packed inventory version */
 		/* At this point , don't care about the INV_VERSION. Maybe in future */
-		p += sizeof( inv_version_t ); /* skip the inventory version */
+		p += sizeof(inv_version_t); /* skip the inventory version */
 	} else {
-	        mlog( MLOG_NORMAL | MLOG_INV, _(
+	        mlog(MLOG_NORMAL | MLOG_INV, _(
 		      "INV: inv_put_session: unknown packed inventory version"
 		      " %d\n"), *( inv_version_t *) p);
 		return BOOL_FALSE;
@@ -1071,52 +1071,52 @@
 	/* get the seshdr and then, the remainder of the session */
 	s->seshdr = (invt_seshdr_t *)p;
 	s->seshdr->sh_sess_off = -1;
-	p += sizeof( invt_seshdr_t );
+	p += sizeof(invt_seshdr_t);
 
 
 	xlate_invt_session((invt_session_t *)p, (invt_session_t *)tmpbuf, 1);
 	bcopy (tmpbuf, p, sizeof(invt_session_t));
 	s->ses = (invt_session_t *)p;
-	p += sizeof( invt_session_t );
+	p += sizeof(invt_session_t);
 
 	/* the array of all the streams belonging to this session */
 	xlate_invt_stream((invt_stream_t *)p, (invt_stream_t *)tmpbuf, 1);
 	bcopy(tmpbuf, p, sizeof(invt_stream_t));
 	s->strms = (invt_stream_t *)p;
-	p += s->ses->s_cur_nstreams * sizeof( invt_stream_t );
+	p += s->ses->s_cur_nstreams * sizeof(invt_stream_t);
 
 	/* all the media files */
 	s->mfiles = (invt_mediafile_t *)p;
 
 #ifdef INVT_DELETION
 	{
-		int tmpfd = open( "moids", O_RDWR | O_CREAT, S_IRUSR|S_IWUSR );
+		int tmpfd = open("moids", O_RDWR | O_CREAT, S_IRUSR|S_IWUSR);
 		uint j;
 		invt_mediafile_t *mmf = s->mfiles;
-		for (i=0; i< s->ses->s_cur_nstreams; i++ ) {
-			for (j=0; j< s->strms[ i ].st_nmediafiles;
-			     j++, mmf++ )
+		for (i=0; i< s->ses->s_cur_nstreams; i++) {
+			for (j=0; j< s->strms[i].st_nmediafiles;
+			     j++, mmf++)
 				xlate_invt_mediafile((invt_mediafile_t *)mmf, (invt_mediafile_t *)tmpbuf, 1);
 				bcopy(tmpbuf, mmf, sizeof(invt_mediafile_t));
-				put_invtrecord( tmpfd, &mmf->mf_moid,
-					 sizeof( uuid_t ), 0, SEEK_END, 0 );
+				put_invtrecord(tmpfd, &mmf->mf_moid,
+					 sizeof(uuid_t), 0, SEEK_END, 0);
 		}
-		close( tmpfd );
+		close(tmpfd);
 	}
 #endif
-	for ( i = 0; i < s->ses->s_cur_nstreams; i++ ) {
-		p += (size_t) ( s->strms[ i ].st_nmediafiles )
-			* sizeof( invt_mediafile_t );
+	for (i = 0; i < s->ses->s_cur_nstreams; i++) {
+		p += (size_t) (s->strms[i].st_nmediafiles)
+			* sizeof(invt_mediafile_t);
 	}
 
 	/* sanity check the size of the buffer given to us vs. the size it
 	   should be */
-	if ( (size_t) ( p - (char *) bufp ) != bufsz ) {
-		mlog( MLOG_DEBUG | MLOG_INV, "p-bufp %d != bufsz %d entsz %d\n",
-		      (int)( p - (char *) bufp ), (int) bufsz,
-	      (int) ( sizeof( invt_entry_t ) ) );
+	if ((size_t) (p - (char *) bufp) != bufsz) {
+		mlog(MLOG_DEBUG | MLOG_INV, "p-bufp %d != bufsz %d entsz %d\n",
+		      (int)(p - (char *) bufp), (int) bufsz,
+	      (int) (sizeof(invt_entry_t)));
 	}
-	assert( (size_t) ( p - (char *) bufp ) == bufsz );
+	assert((size_t) (p - (char *) bufp) == bufsz);
 
 	return BOOL_TRUE;
 }
@@ -1129,13 +1129,13 @@
 /*----------------------------------------------------------------------*/
 
 int
-stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr )
+stobj_make_invsess(int fd, inv_session_t **buf, invt_seshdr_t *hdr)
 {
 	invt_session_t ses;
 
 	/* load in the rest of the session, but not the streams */
-	if ( GET_REC_NOLOCK( fd, &ses, sizeof(ses), hdr->sh_sess_off )
-	    < 0 ) {
+	if (GET_REC_NOLOCK(fd, &ses, sizeof(ses), hdr->sh_sess_off)
+	    < 0) {
 		return -1;
 	}
 
@@ -1147,15 +1147,15 @@
 stobj_convert_mfile(inv_mediafile_t *expmf, invt_mediafile_t *mf)
 {
 	/* copy the mediafile into the exported structure */
-	memcpy( &expmf->m_moid, &mf->mf_moid, sizeof( uuid_t ) );
-	strcpy( expmf->m_label, mf->mf_label );
+	memcpy(&expmf->m_moid, &mf->mf_moid, sizeof(uuid_t));
+	strcpy(expmf->m_label, mf->mf_label);
 	expmf->m_mfile_index = mf->mf_mfileidx;
 	expmf->m_startino = mf->mf_startino.ino;
 	expmf->m_startino_off = mf->mf_startino.offset;
 	expmf->m_endino = mf->mf_endino.ino;
 	expmf->m_endino_off = mf->mf_endino.offset;
 	expmf->m_size = mf->mf_size;
-	expmf->m_isgood = (mf->mf_flag & INVT_MFILE_GOOD ) ?
+	expmf->m_isgood = (mf->mf_flag & INVT_MFILE_GOOD) ?
 		BOOL_TRUE : BOOL_FALSE;
 	expmf->m_isinvdump = (mf->mf_flag & INVT_MFILE_INVDUMP)?
 		BOOL_TRUE : BOOL_FALSE;
@@ -1172,7 +1172,7 @@
 		strm->st_startino.offset;
 	expstrm->st_endino = strm->st_endino.ino;
 	expstrm->st_endino_off = strm->st_endino.offset;
-	strcpy( expstrm->st_cmdarg, strm->st_cmdarg );
+	strcpy(expstrm->st_cmdarg, strm->st_cmdarg);
 
 	expstrm->st_nmediafiles = strm->st_nmediafiles;
 
@@ -1186,14 +1186,14 @@
 {
 	ises->s_time = hdr->sh_time;
 	ises->s_level = hdr->sh_level;
-	ises->s_ispartial = IS_PARTIAL_SESSION( hdr )? BOOL_TRUE: BOOL_FALSE;
-	ises->s_isresumed = IS_RESUMED_SESSION( hdr )? BOOL_TRUE: BOOL_FALSE;
+	ises->s_ispartial = IS_PARTIAL_SESSION(hdr)? BOOL_TRUE: BOOL_FALSE;
+	ises->s_isresumed = IS_RESUMED_SESSION(hdr)? BOOL_TRUE: BOOL_FALSE;
 	ises->s_nstreams = ses->s_cur_nstreams;
-	memcpy( &ises->s_sesid, &ses->s_sesid, sizeof( uuid_t ) );
-	memcpy( &ises->s_fsid, &ses->s_fsid, sizeof( uuid_t ) );
-	strcpy( ises->s_mountpt, ses->s_mountpt );
-	strcpy( ises->s_devpath, ses->s_devpath );
-	strcpy( ises->s_label, ses->s_label );
+	memcpy(&ises->s_sesid, &ses->s_sesid, sizeof(uuid_t));
+	memcpy(&ises->s_fsid, &ses->s_fsid, sizeof(uuid_t));
+	strcpy(ises->s_mountpt, ses->s_mountpt);
+	strcpy(ises->s_devpath, ses->s_devpath);
+	strcpy(ises->s_label, ses->s_label);
 
 	/* caller is responsible for initializing this */
 	ises->s_streams = NULL;
@@ -1218,23 +1218,23 @@
 	int i;
 	invt_mediafile_t mf;
 
-	strms = calloc ( ses->s_cur_nstreams, sizeof( invt_stream_t ) );
+	strms = calloc (ses->s_cur_nstreams, sizeof(invt_stream_t));
 
 	/* load in all the stream-headers */
-	if ( GET_REC_NOLOCK( fd, strms,
-			     ses->s_cur_nstreams * sizeof( invt_stream_t ),
-			     hdr->sh_streams_off ) < 0 ) {
+	if (GET_REC_NOLOCK(fd, strms,
+			     ses->s_cur_nstreams * sizeof(invt_stream_t),
+			     hdr->sh_streams_off) < 0) {
 		free (strms);
 		return -1;
 	}
 
-	ises = calloc( 1, sizeof( inv_session_t ) );
+	ises = calloc(1, sizeof(inv_session_t));
 	stobj_convert_session(ises, ses, hdr);
-	ises->s_streams = calloc(ses->s_cur_nstreams, sizeof( inv_stream_t ));
+	ises->s_streams = calloc(ses->s_cur_nstreams, sizeof(inv_stream_t));
 
 	/* fill in the stream structures too */
 	i = (int) ses->s_cur_nstreams;
-	while ( i-- ) {
+	while (i--) {
 		off64_t		 off;
 		uint            j, nmf;
 
@@ -1243,31 +1243,31 @@
 		off = strms[i].st_firstmfile;
 
 		if (nmf)
-			ises->s_streams[i].st_mediafiles = calloc( nmf,
-						    sizeof( inv_mediafile_t ) );
-		assert( !nmf || ises->s_streams[i].st_mediafiles );
+			ises->s_streams[i].st_mediafiles = calloc(nmf,
+						    sizeof(inv_mediafile_t));
+		assert(!nmf || ises->s_streams[i].st_mediafiles);
 
-		for ( j = 0; j < nmf;
+		for (j = 0; j < nmf;
 		      j++,
-		      off = mf.mf_nextmf ) {
-			assert( off );
-			if ( GET_REC_NOLOCK( fd, &mf,
-					     sizeof( invt_mediafile_t ),
-					     off ) <= 0 ) {
-				INV_PERROR( "stobj::make_invsess\n" );
-				free( strms );
-				free( ises );
+		      off = mf.mf_nextmf) {
+			assert(off);
+			if (GET_REC_NOLOCK(fd, &mf,
+					     sizeof(invt_mediafile_t),
+					     off) <= 0) {
+				INV_PERROR("stobj::make_invsess\n");
+				free(strms);
+				free(ises);
 				return -1;
 			}
 
 			/* copy the mediafile into the exported structure */
 			if (ises->s_streams[i].st_mediafiles) {
-				stobj_convert_mfile( &ises->s_streams[i].st_mediafiles[j],
+				stobj_convert_mfile(&ises->s_streams[i].st_mediafiles[j],
 						&mf);
 			} else {
 				mlog(MLOG_ERROR, _(
 					"Failed to get data from media file: "
-					"possible file corruption\n") );
+					"possible file corruption\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				return -1;
 			}
@@ -1276,7 +1276,7 @@
 	}
 
 
-	free( strms );
+	free(strms);
 	*buf = ises;
 
 	return 1;
@@ -1297,21 +1297,21 @@
 	int nstreams;
 	invt_mediafile_t *mf;
 
-	ises = calloc( 1, sizeof( inv_session_t ) );
+	ises = calloc(1, sizeof(inv_session_t));
 
 	stobj_convert_session(ises, sinfo->ses, sinfo->seshdr);
-	ises->s_streams = calloc( ises->s_nstreams, sizeof( inv_stream_t ) );
+	ises->s_streams = calloc(ises->s_nstreams, sizeof(inv_stream_t));
 	mf = sinfo->mfiles;
 	nstreams = (int) ises->s_nstreams;
-	for ( i = 0 ; i < nstreams ; i++ ) {
+	for (i = 0 ; i < nstreams ; i++) {
 		stobj_convert_strm(&ises->s_streams[i], &sinfo->strms[i]);
 		nmf = (int) ises->s_streams[i].st_nmediafiles;
-		ises->s_streams[i].st_mediafiles = calloc( (uint) nmf,
-						    sizeof( inv_mediafile_t ) );
+		ises->s_streams[i].st_mediafiles = calloc((uint) nmf,
+						    sizeof(inv_mediafile_t));
 
-		for ( j = 0; j < nmf; j++ ) {
-			stobj_convert_mfile( &ises->s_streams[i].st_mediafiles[j],
-					     mf++ );
+		for (j = 0; j < nmf; j++) {
+			stobj_convert_mfile(&ises->s_streams[i].st_mediafiles[j],
+					     mf++);
 		}
 	}
 
@@ -1321,10 +1321,10 @@
 
 
 int
-stobj_hdrcmp( const void *h1, const void *h2 )
+stobj_hdrcmp(const void *h1, const void *h2)
 {
-	return (int) ( ((invt_seshdr_t *)h1)->sh_time -
-		       ((invt_seshdr_t *)h2)->sh_time );
+	return (int) (((invt_seshdr_t *)h1)->sh_time -
+		       ((invt_seshdr_t *)h2)->sh_time);
 }
 
 
@@ -1335,32 +1335,32 @@
 
 
 void
-DEBUG_sessprint( invt_session_t *ses )
+DEBUG_sessprint(invt_session_t *ses)
 {
 	char str[UUID_STR_LEN + 1];
-	uuid_unparse( ses->s_fsid, str );
+	uuid_unparse(ses->s_fsid, str);
 
 	printf("-------- session -------------\n");
 	printf("label\t%s\n", ses->s_label);
 	printf("mount\t%s\n", ses->s_mountpt);
 	printf("devpath\t%s\n", ses->s_devpath);
-	printf("strms\t%d\n", ses->s_cur_nstreams );
+	printf("strms\t%d\n", ses->s_cur_nstreams);
 	printf("fsid\t%s\n", str);
 	printf("-------- end -------------\n");
 }
 
 bool_t
-mobj_eql ( inv_mediafile_t *mfp, invt_mobjinfo_t *mobj )
+mobj_eql (inv_mediafile_t *mfp, invt_mobjinfo_t *mobj)
 {
 
-	if ( mobj->type == INVT_MOID ) {
-		if ( !uuid_compare( *((uuid_t*) mobj->value),
-			      mfp->m_moid) ) {
+	if (mobj->type == INVT_MOID) {
+		if (!uuid_compare(*((uuid_t*) mobj->value),
+			      mfp->m_moid)) {
 			return BOOL_TRUE;
 		}
 	} else {
-		if ( STREQL( (char*) mobj->value,
-			    mfp->m_label ) ) {
+		if (STREQL((char*) mobj->value,
+			    mfp->m_label)) {
 			return BOOL_TRUE;
 		}
 	}
@@ -1370,16 +1370,16 @@
 
 
 bool_t
-check_for_mobj ( inv_session_t *ses, invt_mobjinfo_t *mobj )
+check_for_mobj (inv_session_t *ses, invt_mobjinfo_t *mobj)
 {
 	int i;
 	uint j;
 	inv_mediafile_t *mfp;
 
-	for (i = 0; i < (int) ses->s_nstreams; i++ ) {
-		for ( j = 0 ; j < ses->s_streams[i].st_nmediafiles ; j++ ) {
+	for (i = 0; i < (int) ses->s_nstreams; i++) {
+		for (j = 0 ; j < ses->s_streams[i].st_nmediafiles ; j++) {
 			mfp = &ses->s_streams[i].st_mediafiles[j];
-			if (mobj_eql( mfp, mobj ))
+			if (mobj_eql(mfp, mobj))
 				return BOOL_TRUE;
 		}
 	}
@@ -1391,7 +1391,7 @@
 
 
 void
-DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
+DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 {
 	char str[UUID_STR_LEN + 1];
 	int i;
@@ -1400,17 +1400,17 @@
 
        invt_mobjinfo_t *mobj = &prctx->mobj;
 
-	bool_t  moidsearch = ( mobj && mobj->type != INVT_NULLTYPE );
-	if ( moidsearch ){
+	bool_t  moidsearch = (mobj && mobj->type != INVT_NULLTYPE);
+	if (moidsearch){
 		if (!check_for_mobj (ses, mobj))
 			return;
 	}
 
-	if ( ref == 0 || fsidxprinted != (uint) prctx->index ) {
+	if (ref == 0 || fsidxprinted != (uint) prctx->index) {
 		fsidxprinted = (uint) prctx->index;
 
 		printf("file system %d:\n", prctx->index);
-		uuid_unparse( ses->s_fsid, str );
+		uuid_unparse(ses->s_fsid, str);
 		printf("\tfs id:\t\t%s\n", str);
 	}
 
@@ -1423,73 +1423,73 @@
 	printf("\tsession %d:\n", ref);
 	printf("\t\tmount point:\t%s\n", ses->s_mountpt);
 	printf("\t\tdevice:\t\t%s\n", ses->s_devpath);
-	printf("\t\ttime:\t\t%s", ctime32( &ses->s_time ));
+	printf("\t\ttime:\t\t%s", ctime32( &ses->s_time));
 	printf("\t\tsession label:\t\"%s\"\n", ses->s_label);
-	uuid_unparse( ses->s_sesid, str );
+	uuid_unparse(ses->s_sesid, str);
 	printf("\t\tsession id:\t%s\n", str);
 	printf("\t\tlevel:\t\t%d\n", ses->s_level);
-	printf("\t\tresumed:\t%s\n", ses->s_isresumed ? "YES" : "NO" );
-	printf( "\t\tsubtree:\t%s\n", ses->s_ispartial ? "YES" : "NO" );
-	printf("\t\tstreams:\t%d\n", ses->s_nstreams );
+	printf("\t\tresumed:\t%s\n", ses->s_isresumed ? "YES" : "NO");
+	printf("\t\tsubtree:\t%s\n", ses->s_ispartial ? "YES" : "NO");
+	printf("\t\tstreams:\t%d\n", ses->s_nstreams);
 
-	if (prctx->depth == PR_SESSONLY )
+	if (prctx->depth == PR_SESSONLY)
 		return;
 
-	for (i = 0; i < (int) ses->s_nstreams; i++ ) {
+	for (i = 0; i < (int) ses->s_nstreams; i++) {
 		uint j;
-		printf("\t\tstream %d:\n", i );
-		printf( "\t\t\tpathname:\t%s\n", ses->s_streams[i].st_cmdarg );
-		printf( "\t\t\tstart:\t\tino %llu offset %lld\n",
+		printf("\t\tstream %d:\n", i);
+		printf("\t\t\tpathname:\t%s\n", ses->s_streams[i].st_cmdarg);
+		printf("\t\t\tstart:\t\tino %llu offset %lld\n",
 		        (unsigned long long)ses->s_streams[i].st_startino,
-		        (long long)ses->s_streams[i].st_startino_off );
-		printf( "\t\t\tend:\t\tino %llu offset %lld\n",
+		        (long long)ses->s_streams[i].st_startino_off);
+		printf("\t\t\tend:\t\tino %llu offset %lld\n",
 		        (unsigned long long)ses->s_streams[i].st_endino,
-		        (long long)ses->s_streams[i].st_endino_off );
-		printf( "\t\t\tinterrupted:\t%s\n",
-		        ses->s_streams[i].st_interrupted ? "YES" : "NO" );
-		printf( "\t\t\tmedia files:\t%d\n",
+		        (long long)ses->s_streams[i].st_endino_off);
+		printf("\t\t\tinterrupted:\t%s\n",
+		        ses->s_streams[i].st_interrupted ? "YES" : "NO");
+		printf("\t\t\tmedia files:\t%d\n",
 		        ses->s_streams[i].st_nmediafiles);
 
-		if (prctx->depth == PR_STRMSONLY )
+		if (prctx->depth == PR_STRMSONLY)
 			continue;
 
-		for ( j = 0 ; j < ses->s_streams[i].st_nmediafiles ; j++ ) {
+		for (j = 0 ; j < ses->s_streams[i].st_nmediafiles ; j++) {
 			mfp = &ses->s_streams[i].st_mediafiles[j];
-			if ( moidsearch ) {
-				if (! mobj_eql( mfp, mobj ) )
+			if (moidsearch) {
+				if (! mobj_eql(mfp, mobj))
 					continue;
 			}
-			printf( "\t\t\tmedia file %d:", j );
+			printf("\t\t\tmedia file %d:", j);
 			/*
 			if (mfp->m_isinvdump)
 				printf(" SESSION INVENTORY");
 			*/
-			printf( "\n");
-			printf( "\t\t\t\tmfile index:\t%d\n", mfp->m_mfile_index );
-			printf( "\t\t\t\tmfile type:\t" );
+			printf("\n");
+			printf("\t\t\t\tmfile index:\t%d\n", mfp->m_mfile_index);
+			printf("\t\t\t\tmfile type:\t");
 			if (mfp->m_isinvdump) {
-				printf( "inventory\n" );
+				printf("inventory\n");
 			} else {
-				printf( "data\n" );
+				printf("data\n");
 			}
-			printf( "\t\t\t\tmfile size:\t%llu\n",
+			printf("\t\t\t\tmfile size:\t%llu\n",
 				(unsigned long long)mfp->m_size);
 
 			if (! mfp->m_isinvdump) {
-				printf( "\t\t\t\tmfile start:"
+				printf("\t\t\t\tmfile start:"
 					"\tino %llu offset %lld\n",
 					(unsigned long long)mfp->m_startino,
-					(long long)mfp->m_startino_off );
-				printf( "\t\t\t\tmfile end:"
+					(long long)mfp->m_startino_off);
+				printf("\t\t\t\tmfile end:"
 					"\tino %llu offset %lld\n",
 					(unsigned long long)mfp->m_endino,
-					(long long)mfp->m_endino_off );
+					(long long)mfp->m_endino_off);
 			}
 
-			printf( "\t\t\t\tmedia label:\t\"%s\"\n",
+			printf("\t\t\t\tmedia label:\t\"%s\"\n",
 				mfp->m_label);
-			uuid_unparse( mfp->m_moid, str );
-			printf( "\t\t\t\tmedia id:\t%s\n", str );
+			uuid_unparse(mfp->m_moid, str);
+			printf("\t\t\t\tmedia id:\t%s\n", str);
 		}
 	}
 }
diff --git a/inventory/inventory.h b/inventory/inventory.h
index 076b83e..ad27205 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -189,12 +189,12 @@
 inv_open(
 	 inv_predicate_t bywhat, /* BY_UUID, BY_MOUNTPT, BY_DEVPATH */
 	 inv_oflag_t      forwhat,/* SEARCH_ONLY, SEARCH_N_MOD */
-	 void 		 *pred );/* uuid_t *,char * mntpt, or char *dev */
+	 void 		 *pred);/* uuid_t *,char * mntpt, or char *dev */
 
 
 extern bool_t
 inv_close(
-	inv_idbtoken_t	tok );
+	inv_idbtoken_t	tok);
 
 
 extern inv_sestoken_t
@@ -209,21 +209,21 @@
 	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
-	char		*devpath );
+	char		*devpath);
 
 extern bool_t
 inv_writesession_close(
-	inv_sestoken_t  tok );
+	inv_sestoken_t  tok);
 
 extern inv_stmtoken_t
 inv_stream_open(
 	inv_sestoken_t 	tok,
-	char		*cmdarg );
+	char		*cmdarg);
 
 extern bool_t
 inv_stream_close(
 	inv_stmtoken_t	tok,
-	bool_t 		wasinterrupted );
+	bool_t 		wasinterrupted);
 
 extern bool_t
 inv_put_mediafile(
@@ -291,29 +291,29 @@
 inv_get_sessioninfo(
 	inv_sestoken_t		tok,
 	void		      **bufpp,		/* out */
-	size_t		       *bufszp );	/* out */
+	size_t		       *bufszp);	/* out */
 
 
 extern bool_t
-inv_delete_mediaobj( uuid_t *moid );
+inv_delete_mediaobj(uuid_t *moid);
 
 extern bool_t
-inv_DEBUG_print( int argc, char **argv );
+inv_DEBUG_print(int argc, char **argv);
 
 extern int
-inv_setup_base( void );
+inv_setup_base(void);
 
 extern char *
-inv_dirpath( void );
+inv_dirpath(void);
 
 extern char *
-inv_fstab( void );
+inv_fstab(void);
 
 extern char *
-inv_lockfile( void );
+inv_lockfile(void);
 
 extern char *
-inv_basepath( void );
+inv_basepath(void);
 
 
 #endif /* INVENTORY_H */
diff --git a/inventory/testmain.c b/inventory/testmain.c
index e43e392..90654cc 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -52,28 +52,28 @@
 
 typedef enum { BULL = -1, WRI, REC, QUE, DEL, MP, QUE2 } hi;
 
-void usage( void );
+void usage(void);
 char *progname;
 char *sesfile;
 
 
 void
-CREAT_mfiles( inv_stmtoken_t tok, uuid_t *moid, ino_t f, ino_t n )
+CREAT_mfiles(inv_stmtoken_t tok, uuid_t *moid, ino_t f, ino_t n)
 {
 	uuid_t labelid;
 	char label[128], strbuf[20];
 	char *str;
 	unsigned int stat;
 
-	uuid_create( &labelid, &stat );
-	uuid_to_string( &labelid, &str, &stat );
-	strncpy( strbuf, str, 8 );
+	uuid_create(&labelid, &stat);
+	uuid_to_string(&labelid, &str, &stat);
+	strncpy(strbuf, str, 8);
 	free (str);
 	strbuf[8] = '\0';
-	sprintf(label,"%s_%s (%d-%d)\0","MEDIA_FILE", strbuf, (int)f, (int)n );
+	sprintf(label,"%s_%s (%d-%d)\0","MEDIA_FILE", strbuf, (int)f, (int)n);
 
-	inv_put_mediafile( tok, moid, label, 12, f, 0, n, 0, 0xffff,
-			  BOOL_TRUE, BOOL_FALSE );
+	inv_put_mediafile(tok, moid, label, 12, f, 0, n, 0, 0xffff,
+			  BOOL_TRUE, BOOL_FALSE);
 
 }
 
@@ -86,33 +86,33 @@
 #define SESLIM  240
 
 int
-recons_test( int howmany )
+recons_test(int howmany)
 {
 	int fd, i, rval = 1;
 	off64_t off = 0;
 
-	ses sarr[ SESLIM];
+	ses sarr[SESLIM];
 
-	fd = open( sesfile, O_RDONLY );
+	fd = open(sesfile, O_RDONLY);
 
-	for ( i=0; i<howmany && i < SESLIM; i++ ){
-		rval = get_invtrecord( fd, &sarr[i],
-				       sizeof( uuid_t ) + sizeof( size_t ), off,
-				       BOOL_FALSE );
-		assert( rval > 0 );
-		assert( sarr[i].sz > 0 );
-		sarr[i].buf = calloc( 1,  sarr[i].sz );
+	for (i=0; i<howmany && i < SESLIM; i++){
+		rval = get_invtrecord(fd, &sarr[i],
+				       sizeof(uuid_t) + sizeof(size_t), off,
+				       BOOL_FALSE);
+		assert(rval > 0);
+		assert(sarr[i].sz > 0);
+		sarr[i].buf = calloc(1,  sarr[i].sz);
 		off += (off64_t)(sizeof(uuid_t) + sizeof(size_t));
-		rval = get_invtrecord( fd, sarr[i].buf,  sarr[i].sz, off,
-				       BOOL_FALSE );
-		assert( rval > 0 );
+		rval = get_invtrecord(fd, sarr[i].buf,  sarr[i].sz, off,
+				       BOOL_FALSE);
+		assert(rval > 0);
 		off += sarr[i].sz;
 	}
 
 
 
-	for ( i=0; i<howmany && i < SESLIM; i++ ){
-		if ( inv_put_sessioninfo( sarr[i].buf, sarr[i].sz ) < 0)
+	for (i=0; i<howmany && i < SESLIM; i++){
+		if (inv_put_sessioninfo(sarr[i].buf, sarr[i].sz) < 0)
 			printf("$ insert failed.\n");
 	}
 
@@ -125,21 +125,21 @@
 
 
 int
-delete_test( int n )
+delete_test(int n)
 {
 	int fd, i;
 	uuid_t moid;
 	char *str = 0;
 	unsigned int stat;
 
-	fd = open( "moids", O_RDONLY );
-	if ( fd < 0 ) return -1;
+	fd = open("moids", O_RDONLY);
+	if (fd < 0) return -1;
 
-	get_invtrecord( fd, &moid, sizeof(uuid_t), (n-1)* sizeof( uuid_t), 0 );
-	uuid_to_string( &moid, &str, &stat );
-	printf("Searching for Moid = %s\n", str );
-	free( str );
-	if (! inv_delete_mediaobj( &moid ) ) return -1;
+	get_invtrecord(fd, &moid, sizeof(uuid_t), (n-1)* sizeof(uuid_t), 0);
+	uuid_to_string(&moid, &str, &stat);
+	printf("Searching for Moid = %s\n", str);
+	free(str);
+	if (! inv_delete_mediaobj(&moid)) return -1;
 
 	return 1;
 
@@ -193,7 +193,7 @@
 
 
 int
-query_test( int level )
+query_test(int level)
 {
 	int i;
 	inv_idbtoken_t tok;
@@ -203,40 +203,40 @@
 
 	if (level == -2) {
 		printf("mount pt %s\n",sesfile);
-		tok = inv_open( INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile );
-		if (! tok ) return -1;
+		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile);
+		if (! tok) return -1;
 		idx_DEBUG_print (tok->d_invindex_fd);
 		return 1;
 	}
 
 	for (i = 7; i<8; i++) {
 		printf("\n\n\n----------------------------------\n"
-		       "$ Searching fs %s\n", mnt_str[7-i] );
-		tok = inv_open( INV_BY_MOUNTPT, INV_SEARCH_ONLY, mnt_str[7-i] );
-		if (! tok ) return -1;
+		       "$ Searching fs %s\n", mnt_str[7-i]);
+		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, mnt_str[7-i]);
+		if (! tok) return -1;
 
 		prctx.index = i;
-		if (level == -1 )
-			invmgr_inv_print( tok->d_invindex_fd, &prctx );
+		if (level == -1)
+			invmgr_inv_print(tok->d_invindex_fd, &prctx);
 		else {
-		if (inv_lasttime_level_lessthan( tok, level, &tm ) && tm) {
-			printf("\n\nTIME %s %ld\n", ctime(tm), (long) *tm );
+		if (inv_lasttime_level_lessthan(tok, level, &tm) && tm) {
+			printf("\n\nTIME %s %ld\n", ctime(tm), (long) *tm);
 			free (tm);
 		}
-		if (inv_lastsession_level_lessthan( tok, level, &ses ) && ses) {
-			DEBUG_sessionprint( ses, 99, &prctx);
-			free ( ses->s_streams );
-			free ( ses );
+		if (inv_lastsession_level_lessthan(tok, level, &ses) && ses) {
+			DEBUG_sessionprint(ses, 99, &prctx);
+			free (ses->s_streams);
+			free (ses);
 		}
 
-		if (inv_lastsession_level_equalto( tok, level, &ses ) && ses) {
+		if (inv_lastsession_level_equalto(tok, level, &ses) && ses) {
 			printf("Gotcha\n");
-			DEBUG_sessionprint( ses, 99, &prctx );
-			free ( ses->s_streams );
-			free ( ses );
+			DEBUG_sessionprint(ses, 99, &prctx);
+			free (ses->s_streams);
+			free (ses);
 		}
 	        }
-		inv_close( tok );
+		inv_close(tok);
 	}
 	return 1;
 }
@@ -249,7 +249,7 @@
 /*----------------------------------------------------------------------*/
 
 int
-write_test( int nsess, int nstreams, int nmedia, int dumplevel )
+write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 {
 	int i,j,k,m,fd;
 	unsigned int stat;
@@ -274,23 +274,23 @@
 #ifdef FIRSTTIME
 	printf("first time!\n");
 	for (i=0; i<8; i++) {
-		uuid_create( &fsidarr[i], &stat );
-		assert ( stat == uuid_s_ok );
-		uuid_create( &sesidarr[i], &stat );
-		assert ( stat == uuid_s_ok );
+		uuid_create(&fsidarr[i], &stat);
+		assert (stat == uuid_s_ok);
+		uuid_create(&sesidarr[i], &stat);
+		assert (stat == uuid_s_ok);
 	}
-	fd = open( "uuids", O_RDWR | O_CREAT );
-	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L );
-	PUT_REC(fd, (void *)sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8 );
+	fd = open("uuids", O_RDWR | O_CREAT);
+	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L);
+	PUT_REC(fd, (void *)sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8);
 	close(fd);
 #endif
-	fd = open("uuids", O_RDONLY );
-	GET_REC( fd, fsidarr, sizeof (uuid_t) * 8, 0L );
-	GET_REC( fd, sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8 );
+	fd = open("uuids", O_RDONLY);
+	GET_REC(fd, fsidarr, sizeof (uuid_t) * 8, 0L);
+	GET_REC(fd, sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8);
 	close(fd);
 #ifdef RECONS
-	rfd = open( sesfile, O_RDWR | O_CREAT );
-	fchmod( rfd, INV_PERMS );
+	rfd = open(sesfile, O_RDWR | O_CREAT);
+	fchmod(rfd, INV_PERMS);
 	if (fstat64(fd, &statbuf) < 0) {
 		perror("fstat64 session file");
 		return -1;
@@ -298,22 +298,22 @@
 	off = (off64_t)statbuf.st_size;
 #endif
 
-	for ( i = 0; i < nsess; i++ ) {
+	for (i = 0; i < nsess; i++) {
 		j = i % 8;
 		/*mnt = mnt_str[j];
 		dev = dev_str[7-j];*/
 		mnt = mnt_str[0];
 		dev = dev_str[7];
 		fsidp = &fsidarr[0]; /* j */
-		tok1 = inv_open( INV_BY_UUID, INV_SEARCH_N_MOD, fsidp );
-		assert (tok1 != INV_TOKEN_NULL );
+		tok1 = inv_open(INV_BY_UUID, INV_SEARCH_N_MOD, fsidp);
+		assert (tok1 != INV_TOKEN_NULL);
 
-		uuid_create( &labelid, &stat );
-		uuid_to_string( &labelid, &str, &stat );
-		strncpy( strbuf, str, 8 );
+		uuid_create(&labelid, &stat);
+		uuid_to_string(&labelid, &str, &stat);
+		strncpy(strbuf, str, 8);
 		free (str);
 		strbuf[8] = '\0';
-		sprintf(label,"%s_%s (%d)\0","SESSION_LABEL", strbuf, i );
+		sprintf(label,"%s_%s (%d)\0","SESSION_LABEL", strbuf, i);
 
 		tok2 = inv_writesession_open(tok1, fsidp,
 					     &labelid,
@@ -322,47 +322,47 @@
 					     (bool_t)i%2,
 					     dumplevel, nstreams,
 					     time(NULL),
-					     mnt, dev );
-		assert (tok2 != INV_TOKEN_NULL );
+					     mnt, dev);
+		assert (tok2 != INV_TOKEN_NULL);
 		for (m = 0; m<nstreams; m++) {
-			tok3 = inv_stream_open( tok2,"/dev/rmt");
-			assert (tok3 != INV_TOKEN_NULL );
+			tok3 = inv_stream_open(tok2,"/dev/rmt");
+			assert (tok3 != INV_TOKEN_NULL);
 
-			for (k = 0; k<nmedia; k++ )
-				CREAT_mfiles( tok3, &labelid, k*100,
-					      k*100 + 99 );
-			inv_stream_close( tok3, BOOL_TRUE );
+			for (k = 0; k<nmedia; k++)
+				CREAT_mfiles(tok3, &labelid, k*100,
+					      k*100 + 99);
+			inv_stream_close(tok3, BOOL_TRUE);
 		}
 
 #ifdef RECONS
-		if (inv_get_sessioninfo( tok2, &bufp, &sz ) == BOOL_TRUE ) {
-			put_invtrecord( rfd, fsidp, sizeof( uuid_t ), off,
-					BOOL_FALSE );
+		if (inv_get_sessioninfo(tok2, &bufp, &sz) == BOOL_TRUE) {
+			put_invtrecord(rfd, fsidp, sizeof(uuid_t), off,
+					BOOL_FALSE);
 			off += (off64_t)sizeof(uuid_t);
-			put_invtrecord( rfd, &sz, sizeof( size_t ), off,
+			put_invtrecord(rfd, &sz, sizeof(size_t), off,
 					BOOL_FALSE);
 			off += (off64_t)sizeof(size_t);
-			put_invtrecord( rfd, bufp, sz, off, BOOL_FALSE );
+			put_invtrecord(rfd, bufp, sz, off, BOOL_FALSE);
 		}
 #endif
 #ifdef NOTDEF
-		if (inv_get_sessioninfo( tok2, &bufp, &sz ) == BOOL_TRUE )
-			inv_put_sessioninfo(  fsidp, bufp, sz );
+		if (inv_get_sessioninfo(tok2, &bufp, &sz) == BOOL_TRUE)
+			inv_put_sessioninfo(fsidp, bufp, sz);
 #endif
-		inv_writesession_close( tok2 );
-		inv_close( tok1 );
+		inv_writesession_close(tok2);
+		inv_close(tok1);
 	}
 #ifdef RECONS
-	close( rfd );
+	close(rfd);
 #endif
 	return 1;
 }
 
 
-void usage( void )
+void usage(void)
 {
 	printf("( %s ./inv w|r|q -v <verbosity> -s <nsess>"
-	       "-t <strms> -m <nmediafiles> \n", optarg );
+	       "-t <strms> -m <nmediafiles> \n", optarg);
 }
 
 
@@ -370,8 +370,8 @@
 mp_test(int nstreams)
 {
 #if 0
-	tok1 = inv_open( INV_BY_UUID, fsidp );
-	assert (tok1 != INV_TOKEN_NULL );
+	tok1 = inv_open(INV_BY_UUID, fsidp);
+	assert (tok1 != INV_TOKEN_NULL);
 
 	tok2 = inv_writesession_open(tok1, fsidp,
 				     &labelid,
@@ -380,17 +380,17 @@
 				     (bool_t)i%2,
 				     dumplevel, nstreams,
 				     time(NULL),
-				     mnt, dev );
-	assert (tok2 != INV_TOKEN_NULL );
+				     mnt, dev);
+	assert (tok2 != INV_TOKEN_NULL);
 
 	for (m = 0; m<nstreams; m++) {
-			tok3 = inv_stream_open( tok2,"/dev/rmt");
-			assert (tok3 != INV_TOKEN_NULL );
+			tok3 = inv_stream_open(tok2,"/dev/rmt");
+			assert (tok3 != INV_TOKEN_NULL);
 
-			for (k = 0; k<nmedia; k++ )
-				CREAT_mfiles( tok3, &labelid, k*100,
-					      k*100 + 99 );
-			inv_stream_close( tok3, BOOL_TRUE );
+			for (k = 0; k<nmedia; k++)
+				CREAT_mfiles(tok3, &labelid, k*100,
+					      k*100 + 99);
+			inv_stream_close(tok3, BOOL_TRUE);
 		}
 #endif
 }
@@ -417,9 +417,9 @@
 
 	progname = argv[0];
 	sesfile = "sessions";
-	assert( argc > 1 );
+	assert(argc > 1);
 
-	mlog_init( argc, argv );
+	mlog_init(argc, argv);
 
 	if (! inv_DEBUG_print(argc, argv))
 		return 0;
@@ -427,8 +427,8 @@
 	optind = 1;
 	optarg = 0;
 
-	while( ( cc = getopt( argc, argv, GETOPT_CMDSTRING)) != EOF ) {
-		switch ( cc ) {
+	while((cc = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (cc) {
 		      case 'w':
 			op = WRI;
 			break;
@@ -473,7 +473,7 @@
 			break;
 
 		      case 'm':
-			nmedia = atoi( optarg );
+			nmedia = atoi(optarg);
 			break;
 		      case 'v':
 			break;
@@ -489,17 +489,17 @@
 	}
 
 
-	if ( op == WRI )
-		rval = write_test( nsess, nstreams, nmedia, level );
-	else if ( op == QUE )
-		rval = query_test( level );
-	else if ( op == REC )
-		rval = recons_test( nsess );
-	else if ( op == DEL )
-		rval = delete_test( nsess );
-	else if ( op == MP )
+	if (op == WRI)
+		rval = write_test(nsess, nstreams, nmedia, level);
+	else if (op == QUE)
+		rval = query_test(level);
+	else if (op == REC)
+		rval = recons_test(nsess);
+	else if (op == DEL)
+		rval = delete_test(nsess);
+	else if (op == MP)
 		rval = mp_test (nstreams);
-	else if ( op == QUE2 ) {
+	else if (op == QUE2) {
 		if (uuid)
 			rval = sess_queries_byuuid(uuid);
 		else if (label)
@@ -508,10 +508,10 @@
 	else
 		usage();
 
-	if (rval < 0 )
-		printf( "aborted\n");
+	if (rval < 0)
+		printf("aborted\n");
 	else
-		printf( "done\n" );
+		printf("done\n");
 
 
 }
diff --git a/invutil/cmenu.h b/invutil/cmenu.h
index a9788f2..f3c205f 100644
--- a/invutil/cmenu.h
+++ b/invutil/cmenu.h
@@ -44,18 +44,18 @@
 } alignment_t;
 
 typedef struct menu_ops_s {
-    int (* op_delete		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_undelete		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_saveexit		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_select		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_collapse		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_expand		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_collapseall	) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_expandall		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_highlight		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_unhighlight	) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_commit		) (WINDOW *win, node_t *current, node_t *list);
-    int (* op_prune		) (char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, node_t *list);
+    int (* op_delete) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_undelete) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_saveexit) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_select) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_collapse) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_expand) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_collapseall) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_expandall) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_highlight) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_unhighlight) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_commit) (WINDOW *win, node_t *current, node_t *list);
+    int (* op_prune) (char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, node_t *list);
 } menu_ops_t;
 
 typedef struct {
diff --git a/invutil/fstab.c b/invutil/fstab.c
index a4333ad..3319a5c 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -83,7 +83,7 @@
 
 	fstabentry_idx = (int)(((long)fstabentry - (long)fstab_file[fidx].mapaddr - sizeof(invt_counter_t)) / sizeof(invt_fstab_t));
 
-	if ( fstab_file[fidx].counter->ic_curnum > 1 ) {
+	if (fstab_file[fidx].counter->ic_curnum > 1) {
 	    memmove(fstabentry,
 		    fstabentry + 1,
 		    (sizeof(invt_fstab_t) * (fstab_file[fidx].counter->ic_curnum - fstabentry_idx - 1)));
@@ -355,7 +355,7 @@
 
     nEntries = fstab_file[fidx].counter->ic_curnum;
 
-    munmap( fstab_file[fidx].mapaddr,
+    munmap(fstab_file[fidx].mapaddr,
 	    (nEntries * sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
 
     /* need to lseek on the file to grow it to the right size - no autogrow on linux */
@@ -395,9 +395,9 @@
     char		*name;
     invt_counter_t	cnt;
 
-    fd = open_and_lock( fstabname, FILE_WRITE, wait_for_locks );
+    fd = open_and_lock(fstabname, FILE_WRITE, wait_for_locks);
     if (fd < 0) {
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
 
@@ -426,7 +426,7 @@
 
     fstabentries = fstab_file[fidx].counter->ic_curnum;
 
-    munmap( fstab_file[fidx].mapaddr,
+    munmap(fstab_file[fidx].mapaddr,
 	    (fstab_file[fidx].counter->ic_curnum * sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
 
     if ((fstabentries != 0)  && (fstabentries < fstab_file[fidx].nEntries)) {
@@ -437,7 +437,7 @@
     close(fstab_file[fidx].fd);
 
     if (fstabentries == 0) {
-	unlink( fstab_file[fidx].name );
+	unlink(fstab_file[fidx].name);
     }
 
     free(fstab_file[fidx].name);
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 5e540a3..3ba2d44 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -47,7 +47,7 @@
 extern stobj_fileinfo_t *stobj_file;
 extern int stobj_numfiles;
 
-static void stobj_makefname_len( char *fname, int fname_len );
+static void stobj_makefname_len(char *fname, int fname_len);
 
 menu_ops_t invidx_ops = {
     NULL,
@@ -94,7 +94,7 @@
 	}
 	mark_all_children_commited(current);
 
-	if ( invidx_file[fidx].counter->ic_curnum > 1 ) {
+	if (invidx_file[fidx].counter->ic_curnum > 1) {
 	    memmove(&inv_entry[idx],
 		    &inv_entry[idx + 1],
 		    (sizeof(invt_entry_t) * (invidx_file[fidx].counter->ic_curnum - idx - 1)));
@@ -547,7 +547,7 @@
     }
 
     /* stobj file not full, just insert the entry */
-    hdr->sh_sess_off = STOBJ_OFFSET( sescnt.ic_maxnum, pos);
+    hdr->sh_sess_off = STOBJ_OFFSET(sescnt.ic_maxnum, pos);
     hdr->sh_streams_off = sescnt.ic_eof;
 
     /* for seshdr: malloc buffer, copy new entry into buffer, read file entries into buffer, write the lot out */
@@ -584,31 +584,31 @@
 }
 
 static void
-stobj_makefname_len( char *fname, int fname_len )
+stobj_makefname_len(char *fname, int fname_len)
 {
     /* come up with a new unique name */
     uuid_t	fn;
     char	str[UUID_STR_LEN + 1];
 
-    uuid_generate( fn );
-    uuid_unparse( fn, str );
+    uuid_generate(fn);
+    uuid_unparse(fn, str);
 
     snprintf(fname, fname_len, "%s/%s.StObj", inventory_path, str);
 }
 
 int
-stobj_create( char *fname )
+stobj_create(char *fname)
 {
     int fd;
     invt_sescounter_t sescnt;
 
     /* create the new storage object */
-    if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
+    if ((fd = open(fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
 	return -1;
     }
 
-    INVLOCK( fd, LOCK_EX );
-    fchmod( fd, INV_PERMS );
+    INVLOCK(fd, LOCK_EX);
+    fchmod(fd, INV_PERMS);
 
     memset(&sescnt, 0, sizeof(sescnt));
     sescnt.ic_vernum = INV_VERSION;
@@ -617,51 +617,51 @@
     sescnt.ic_eof = SC_EOF_INITIAL_POS;
 
     lseek(fd, 0, SEEK_SET);
-    write_n_bytes ( fd, (char *)&sescnt, sizeof(sescnt), "new stobj file" );
+    write_n_bytes (fd, (char *)&sescnt, sizeof(sescnt), "new stobj file");
 
-    INVLOCK( fd, LOCK_UN );
+    INVLOCK(fd, LOCK_UN);
     return fd;
 }
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
-		   invt_mediafile_t *mfiles )
+		   invt_mediafile_t *mfiles)
 {
     uint	nstm	= ses->s_cur_nstreams;
     off64_t	off	= hdr->sh_streams_off;
-    off64_t	mfileoff= off + (off64_t)( nstm * sizeof( invt_stream_t ) );
+    off64_t	mfileoff= off + (off64_t)(nstm * sizeof(invt_stream_t));
     uint	nmfiles = 0;
     uint	i,j;
 
     /* fix the offsets in streams */
-     for ( i = 0; i < nstm; i++ ) {
-	strms[i].st_firstmfile = mfileoff + (off64_t) ((size_t) nmfiles * sizeof( invt_mediafile_t ) );
+     for (i = 0; i < nstm; i++) {
+	strms[i].st_firstmfile = mfileoff + (off64_t) ((size_t) nmfiles * sizeof(invt_mediafile_t));
 	/* now fix the offsets in mediafiles */
-	for ( j = 0; j < strms[i].st_nmediafiles; j++ ) {
+	for (j = 0; j < strms[i].st_nmediafiles; j++) {
 
 	    /* no need to fix the last element's next ptr */
-	    if ( j < strms[i].st_nmediafiles - 1 )
-		mfiles[ nmfiles + j ].mf_nextmf =  strms[i].st_firstmfile + (off64_t) ((j+1) * sizeof( invt_mediafile_t ));
+	    if (j < strms[i].st_nmediafiles - 1)
+		mfiles[nmfiles + j].mf_nextmf =  strms[i].st_firstmfile + (off64_t) ((j+1) * sizeof(invt_mediafile_t));
 
 	    /* no need to fix the first element's prev ptr */
-	    if ( j )
-		mfiles[ nmfiles + j ].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof( invt_mediafile_t ));
+	    if (j)
+		mfiles[nmfiles + j].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof(invt_mediafile_t));
 	}
 
 	/* adjust the offsets of the first and the last elements
 	   in the mediafile chain */
-	mfiles[ nmfiles ].mf_prevmf = 0;
+	mfiles[nmfiles].mf_prevmf = 0;
 	nmfiles += strms[i].st_nmediafiles;
-	mfiles[ nmfiles - 1 ].mf_nextmf = 0;
+	mfiles[nmfiles - 1].mf_nextmf = 0;
     }
 
     /* first put the streams. hdr already points at the right place */
     lseek(fd, off, SEEK_SET);
-    write_n_bytes( fd, strms, nstm * sizeof( invt_stream_t ), "stobj file" );
+    write_n_bytes(fd, strms, nstm * sizeof(invt_stream_t ), "stobj file");
 
     lseek(fd, mfileoff, SEEK_SET);
-    write_n_bytes( fd, mfiles, nmfiles * sizeof( invt_mediafile_t ), "stobj file" );
+    write_n_bytes(fd, mfiles, nmfiles * sizeof(invt_mediafile_t ), "stobj file");
 
     return 1;
 }
@@ -834,7 +834,7 @@
 	next_entry = invidx_file[fidx].data[i+1];
 
 	if(inv_entry->ie_timeperiod.tp_start > entry->ie_timeperiod.tp_end
-	   && inv_entry->ie_timeperiod.tp_end < next_entry->ie_timeperiod.tp_start ) {
+	   && inv_entry->ie_timeperiod.tp_end < next_entry->ie_timeperiod.tp_start) {
 	    return i;
 	}
     }
@@ -916,7 +916,7 @@
 	return startnode;
     }
 
-    invidx_entry = (invt_entry_t *)( invidx_file[idx].mapaddr + sizeof(invt_counter_t));
+    invidx_entry = (invt_entry_t *)(invidx_file[idx].mapaddr + sizeof(invt_counter_t));
 
     n = startnode;
     for (i=0; i < invidx_file[idx].counter->ic_curnum; i++) {
@@ -947,7 +947,7 @@
 
 	add_invidx_data(idx, &(invidx_entry[i]));
 	stobjname = GetNameOfStobj(inv_path, invidx_entry[i].ie_filename);
-	n = generate_stobj_menu( n, level + 1, stobjname );
+	n = generate_stobj_menu(n, level + 1, stobjname);
 	free(stobjname);
     }
 
@@ -1001,7 +1001,7 @@
 
     nEntries = invidx_file[fidx].counter->ic_curnum;
 
-    munmap( invidx_file[fidx].mapaddr,
+    munmap(invidx_file[fidx].mapaddr,
 	    (nEntries * sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     /* need to lseek on the file to grow it to the right size - no autogrow on linux */
@@ -1042,7 +1042,7 @@
     invt_counter_t header;
 
     errno=0;
-    fd = open_and_lock( idxFileName, FILE_WRITE, wait_for_locks );
+    fd = open_and_lock(idxFileName, FILE_WRITE, wait_for_locks);
     if (fd < 0) {
         return fd;
     }
@@ -1053,7 +1053,7 @@
 	exit(1);
     }
 
-    read_n_bytes( fd, &header, sizeof(invt_counter_t), idxFileName);
+    read_n_bytes(fd, &header, sizeof(invt_counter_t), idxFileName);
 
     nEntries = header.ic_curnum;
 
@@ -1075,21 +1075,21 @@
 	return 0;
 
     nEntries = invidx_file[idx].counter->ic_curnum;
-    munmap( invidx_file[idx].mapaddr,
-	    (invidx_file[idx].nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t) );
+    munmap(invidx_file[idx].mapaddr,
+	    (invidx_file[idx].nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     if(nEntries != 0 && nEntries != invidx_file[idx].nEntries) {
 	ftruncate(invidx_file[idx].fd,
-		  sizeof(invt_counter_t) + (nEntries * sizeof(invt_entry_t)) );
+		  sizeof(invt_counter_t) + (nEntries * sizeof(invt_entry_t)));
     }
 
-    close( invidx_file[idx].fd );
+    close(invidx_file[idx].fd);
 
     if(nEntries == 0) {
 	unlink(invidx_file[idx].name);
     }
-    free( invidx_file[idx].name );
-    free( invidx_file[idx].data );
+    free(invidx_file[idx].name);
+    free(invidx_file[idx].data);
 
     invidx_file[idx].fd = -1;
     invidx_file[idx].name = NULL;
diff --git a/invutil/invutil.c b/invutil/invutil.c
index e06b1f4..242574f 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -78,51 +78,51 @@
     uuid_clear(uuid);
     uuid_clear(session);
 
-    while((c = getopt( argc, argv, GETOPT_CMDSTRING)) != EOF) {
+    while((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 	switch(c) {
 	case GETOPT_DEBUG:
 	    debug = BOOL_TRUE;
 	    break;
 	case GETOPT_INTERACTIVE:
 	    if (force) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_FORCE,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    interactive_option = BOOL_TRUE;
 	    break;
 	case GETOPT_NONINTERACTIVE: /* obsoleted by -F */
 	    if (interactive_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_INTERACTIVE,
-			 c );
+			 c);
 		usage();
 	    }
 	    force = BOOL_TRUE;
 	    break;
 	case GETOPT_UUID:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (mntpnt_option || session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 mntpnt_option ? GETOPT_PRUNEMNT : GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    uuid_option = BOOL_TRUE;
@@ -133,51 +133,51 @@
 	    break;
 	case GETOPT_CHECKPRUNEFSTAB:
 	    if (mntpnt_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNEMNT,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (uuid_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_UUID,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    check_option = BOOL_TRUE;
 	    break;
 	case GETOPT_FORCE:
 	    if (interactive_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_INTERACTIVE,
-			 c );
+			 c);
 		usage();
 	    }
 	    force = BOOL_TRUE;
 	    break;
 	case GETOPT_PRUNEMNT:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (uuid_option || session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 uuid_option ? GETOPT_UUID : GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    mntpnt_option = BOOL_TRUE;
@@ -188,24 +188,24 @@
 	    break;
 	case GETOPT_PRUNESESSION:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (interactive_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_INTERACTIVE,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (mntpnt_option || uuid_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 mntpnt_option ? GETOPT_PRUNEMNT : GETOPT_UUID,
-			 c );
+			 c);
 		usage();
 	    }
 	    session_option = BOOL_TRUE;
@@ -218,11 +218,11 @@
     }
 
     if (r_mf_label != NULL && !(mntpnt_option || uuid_option)) {
-	    fprintf( stderr, "%s: -%c requires either -%c or -%c\n",
+	    fprintf(stderr, "%s: -%c requires either -%c or -%c\n",
 			 g_programName,
 			 GETOPT_PRUNEMEDIALABEL,
 			 GETOPT_PRUNEMNT,
-			 GETOPT_UUID );
+			 GETOPT_UUID);
 	    usage();
     }
 
@@ -245,9 +245,9 @@
     /* sanity check the inventory database directory, setup global paths
      */
     if (!inv_setup_base()) {
-        fprintf( stderr,
+        fprintf(stderr,
                 "%s: both /var/lib/xfsdump and /var/xfsdump exist - fatal\n",
-	        g_programName );
+	        g_programName);
         exit(1);
     }
     inventory_path = INV_DIRPATH;
@@ -276,7 +276,7 @@
 		    &session, timeSecs, r_mf_label);
 	}
     }
-    else if ( interactive_option ) {
+    else if (interactive_option) {
 	invutil_interactive(inventory_path, mntPoint, &uuid, 0);
 	printf("\n");
     }
@@ -370,7 +370,7 @@
 #endif
 
     if (*fmt == NULL || (date = mktime(&tm)) < 0) {
-        fprintf(stderr, "%s: bad date, \"%s\"\n", g_programName, strDate );
+        fprintf(stderr, "%s: bad date, \"%s\"\n", g_programName, strDate);
         usage();
     }
 
@@ -408,10 +408,10 @@
     char *name;
 
     str = basename(filename);
-    name = (char *) malloc( strlen( inv_path ) + 1  + strlen( str ) + 1);
-    strcpy( name, inv_path );
-    strcat( name, "/" );
-    strcat( name, str );
+    name = (char *) malloc(strlen(inv_path) + 1  + strlen(str) + 1);
+    strcpy(name, inv_path);
+    strcat(name, "/");
+    strcat(name, str);
 
     return(name);
 }
@@ -422,13 +422,13 @@
     char str[UUID_STR_LEN + 1];
     char *name;
 
-    uuid_unparse( uuid, str );
-    name = (char *) malloc( strlen( inv_path ) + 1  + strlen( str )
-			     + strlen( INV_INVINDEX_PREFIX ) + 1);
-    strcpy( name, inv_path );
-    strcat( name, "/" );
-    strcat( name, str );
-    strcat( name, INV_INVINDEX_PREFIX );
+    uuid_unparse(uuid, str);
+    name = (char *) malloc(strlen(inv_path) + 1  + strlen(str)
+			     + strlen(INV_INVINDEX_PREFIX) + 1);
+    strcpy(name, inv_path);
+    strcat(name, "/");
+    strcat(name, str);
+    strcat(name, INV_INVINDEX_PREFIX);
 
     return(name);
 }
@@ -438,11 +438,11 @@
 {
     char *fstabname;
 
-    fstabname = (char *) malloc( strlen(inv_path) + 1 /* one for the "/" */
-				   + strlen("fstab") + 1 );
-    strcpy( fstabname, inv_path );
-    strcat( fstabname, "/" );
-    strcat( fstabname, "fstab" );
+    fstabname = (char *) malloc(strlen(inv_path) + 1 /* one for the "/" */
+				   + strlen("fstab") + 1);
+    strcpy(fstabname, inv_path);
+    strcat(fstabname, "/");
+    strcat(fstabname, "fstab");
     return(fstabname);
 }
 
@@ -463,18 +463,18 @@
     invt_counter_t *counter,cnt;
 
     if (mountPt == NULL && uuid_is_null(*uuidp) && uuid_is_null(*sessionp)) {
-	fprintf( stderr, "%s: mountpoint, uuid or session "
-			 "must be specified\n", g_programName );
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: mountpoint, uuid or session "
+			 "must be specified\n", g_programName);
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
 
     fstabname = GetFstabFullPath(inv_path);
-    fd = open_and_lock( fstabname,
+    fd = open_and_lock(fstabname,
 			FILE_WRITE,
-			wait_for_locks );
+			wait_for_locks);
     if (fd < 0) {
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
 
@@ -492,13 +492,13 @@
     printf("Processing file %s\n", fstabname);
 
     /* check each entry in fstab for mount pt or uuid match */
-    for (i = 0; i < counter->ic_curnum; )
+    for (i = 0; i < counter->ic_curnum;)
     {
 	removeflag = BOOL_FALSE;
 
 	printf("   Found entry for %s\n" , fstabentry[i].ft_mountpt);
 
-	for (j = i +1 ; j < counter->ic_curnum ; j++ ) {
+	for (j = i +1 ; j < counter->ic_curnum ; j++) {
 	    if (uuid_compare(fstabentry[i].ft_uuid, fstabentry[j].ft_uuid) == 0)
 	    {
 		printf("     duplicate fstab entry\n");
@@ -519,7 +519,7 @@
 		   (r_mf_label ? r_mf_label : "(NULL)"));
 #endif
 
-	    if ( checkonly == BOOL_FALSE ) {
+	    if (checkonly == BOOL_FALSE) {
 		if(mountPt != NULL && strcmp(mountPt, fstabentry[i].ft_mountpt) == 0) {
 		    printf("     Match on hostname and path\n");
 		    IdxCheckOnly = BOOL_FALSE;
@@ -542,18 +542,18 @@
 
 	    if (CheckAndPruneInvIndexFile(
 			IdxCheckOnly, invname, sessionp,
-			prunetime, r_mf_label) == -1 ) {
+			prunetime, r_mf_label) == -1) {
 		removeflag = BOOL_TRUE;
 	    }
 
-	    free( invname );
+	    free(invname);
 
 	}
 
 	if (removeflag == BOOL_TRUE)
 	{
 	    printf("     removing fstab entry %s\n", fstabentry[i].ft_mountpt);
-	    if ( counter->ic_curnum > 1 ) {
+	    if (counter->ic_curnum > 1) {
 		bcopy((void *)&fstabentry[i + 1],
 		      (void *)&fstabentry[i],
 		      (sizeof(invt_fstab_t) * (counter->ic_curnum - i - 1)));
@@ -566,7 +566,7 @@
 
     fstabEntries = counter->ic_curnum;
 
-    munmap( mapaddr,
+    munmap(mapaddr,
 	    (nEntries*sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
 
     if ((fstabEntries != 0)  && (fstabEntries != nEntries)) {
@@ -588,14 +588,14 @@
 	if(debug) {
 	    printf("unlink fstab file %s\n", fstabname);
 	}
-	unlink( fstabname );
+	unlink(fstabname);
     }
 
-    free( fstabname );
+    free(fstabname);
 }
 
 int
-CheckAndPruneInvIndexFile( bool_t checkonly,
+CheckAndPruneInvIndexFile(bool_t checkonly,
 			   char *idxFileName,
 			   uuid_t *sessionp,
 			   time32_t prunetime,
@@ -615,14 +615,14 @@
     printf("      processing index file \n"
 	   "       %s\n",idxFileName);
 
-    fd = open_and_lock( idxFileName,
+    fd = open_and_lock(idxFileName,
 			FILE_WRITE,
-			wait_for_locks );
+			wait_for_locks);
     if (fd < 0) {
         return -1;
     }
 
-    read_n_bytes( fd, &header, sizeof(invt_counter_t), idxFileName);
+    read_n_bytes(fd, &header, sizeof(invt_counter_t), idxFileName);
     nEntries = header.ic_curnum;
 
     temp = mmap_n_bytes(fd,
@@ -630,9 +630,9 @@
 			BOOL_FALSE, idxFileName);
 
     counter = (invt_counter_t *)temp;
-    invIndexEntry = (invt_entry_t *)( temp + sizeof(invt_counter_t));
+    invIndexEntry = (invt_entry_t *)(temp + sizeof(invt_counter_t));
 
-    for (i=0; i < counter->ic_curnum; )
+    for (i=0; i < counter->ic_curnum;)
     {
 	removeflag = BOOL_FALSE;
 	printf("         Checking access for\n"
@@ -644,7 +644,7 @@
 		   ctime32(&(invIndexEntry[i].ie_timeperiod.tp_end)));
 	}
 
-	if (( access( invIndexEntry[i].ie_filename, R_OK | W_OK ) == -1)  &&
+	if ((access(invIndexEntry[i].ie_filename, R_OK | W_OK) == -1)  &&
 	   (errno == ENOENT))
 	{
 	    printf("         Unable to access %s referred in %s\n",
@@ -660,7 +660,7 @@
 
 	if (removeflag == BOOL_TRUE)
 	{
-	    if ( counter->ic_curnum > 1 ) {
+	    if (counter->ic_curnum > 1) {
 	        bcopy((void *)&invIndexEntry[i + 1],
 		      (void *)&invIndexEntry[i],
 		      (sizeof(invt_entry_t) * (counter->ic_curnum - i - 1)));
@@ -673,18 +673,18 @@
 
     validEntries = counter->ic_curnum;
 
-    munmap( temp, (nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t) );
+    munmap(temp, (nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     if ((validEntries != 0)  && (validEntries != nEntries)) {
 	if(debug) {
 	    printf("ftruncate idx from %d to %d (%ld bytes)\n",
 		   nEntries,
 		   validEntries,
-		   (long) sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)) );
+		   (long) sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)));
             printf("- truncate %s\n", idxFileName);
 	}
-    	ftruncate( fd,
-		   sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)) );
+    	ftruncate(fd,
+		   sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)));
     }
 
     if (debug) {
@@ -693,14 +693,14 @@
 	       validEntries);
     }
 
-    close( fd );
+    close(fd);
 
     if (validEntries == 0)
     {
 	if(debug) {
 	    printf("unlink idx file %s\n", idxFileName);
 	}
-	unlink( idxFileName );
+	unlink(idxFileName);
 	return(-1);
     }
 
@@ -708,7 +708,7 @@
 }
 
 int
-CheckAndPruneStObjFile( bool_t checkonly,
+CheckAndPruneStObjFile(bool_t checkonly,
 			char *StObjFileName,
 			uuid_t *sessionp,
 			time32_t prunetime,
@@ -734,9 +734,9 @@
     invt_sescounter_t *counter;
     invt_sescounter_t header;
 
-    fd = open_and_lock( StObjFileName,
+    fd = open_and_lock(StObjFileName,
 			FILE_WRITE,
-			wait_for_locks );
+			wait_for_locks);
     if (fd < 0) {
         return -1;
     }
@@ -751,11 +751,11 @@
 
     temp = mmap_n_bytes(fd, sb.st_size, BOOL_FALSE, StObjFileName);
     counter = (invt_sescounter_t *)temp;
-    StObjhdr = (invt_seshdr_t *)( temp + sizeof(invt_sescounter_t));
+    StObjhdr = (invt_seshdr_t *)(temp + sizeof(invt_sescounter_t));
     StObjses = (invt_session_t *)(temp + StObjhdr->sh_sess_off);
 
     sescount = 0;
-    for (i=0; i < counter->ic_curnum; ) {
+    for (i=0; i < counter->ic_curnum;) {
 	removeflag = BOOL_FALSE;
 	if (StObjhdr->sh_pruned)
 	    prunedcount++;
@@ -788,37 +788,37 @@
 		       ctime32(&StObjhdr->sh_time));
 	    printf("\t\tdevice:\t\t%s\n", StObjses->s_devpath);
 	    printf("\t\tsession label:\t\"%s\"\n", StObjses->s_label);
-	    uuid_unparse( StObjses->s_sesid, str );
+	    uuid_unparse(StObjses->s_sesid, str);
 	    printf("\t\tsession id:\t%s\n", str);
 	    printf("\t\tlevel:\t\t%d\n", StObjhdr->sh_level);
-	    printf("\t\tstreams:\t%d\n", StObjses->s_cur_nstreams );
-	    for ( i = 0; i < (int) StObjses->s_cur_nstreams; i++ ) {
-		printf( "\t\tstream %d:\n", i);
+	    printf("\t\tstreams:\t%d\n", StObjses->s_cur_nstreams);
+	    for (i = 0; i < (int) StObjses->s_cur_nstreams; i++) {
+		printf("\t\tstream %d:\n", i);
 		StObjstrm = (invt_stream_t *)(temp +
 					      StObjhdr->sh_streams_off +
 					      (i * sizeof(invt_stream_t)));
-		printf( "\t\t\tpathname:\t%s\n",
+		printf("\t\t\tpathname:\t%s\n",
 			StObjstrm->st_cmdarg);
-		printf( "\t\t\tinode start:\t%llu\n",
+		printf("\t\t\tinode start:\t%llu\n",
 			(unsigned long long) StObjstrm->st_startino.ino);
-		printf( "\t\t\tinode   end:\t%llu\n",
+		printf("\t\t\tinode   end:\t%llu\n",
 			(unsigned long long) StObjstrm->st_endino.ino);
-		printf( "\t\t\tinterrupted:\t%s\n",
-			StObjstrm->st_interrupted ? "YES" : "NO" );
-		printf( "\t\t\tmedia files:\t%d\n",
+		printf("\t\t\tinterrupted:\t%s\n",
+			StObjstrm->st_interrupted ? "YES" : "NO");
+		printf("\t\t\tmedia files:\t%d\n",
 			StObjstrm->st_nmediafiles);
-		for ( j = 0; j < StObjstrm->st_nmediafiles; j++) {
+		for (j = 0; j < StObjstrm->st_nmediafiles; j++) {
 		    StObjmed = (invt_mediafile_t *)(temp +
 						    StObjstrm->st_firstmfile +
 						    (j * sizeof(invt_mediafile_t)));
-		    printf( "\t\t\tmfile file %d:\n", j);
-		    printf( "\t\t\t\tmfile size:\t%lld\n",
+		    printf("\t\t\tmfile file %d:\n", j);
+		    printf("\t\t\t\tmfile size:\t%lld\n",
 			    (long long) StObjmed->mf_size);
-		    printf( "\t\t\t\tmfile start:\t%llu\n",
+		    printf("\t\t\t\tmfile start:\t%llu\n",
 			    (unsigned long long) StObjmed->mf_startino.ino);
-		    printf( "\t\t\t\tmfile end:\t%llu\n",
+		    printf("\t\t\t\tmfile end:\t%llu\n",
 			    (unsigned long long) StObjmed->mf_endino.ino);
-		    printf( "\t\t\t\tmedia label:\t\"%s\"\n",
+		    printf("\t\t\t\tmedia label:\t\"%s\"\n",
 			    StObjmed->mf_label);
 		}
 	    }
@@ -842,12 +842,12 @@
 	    && (uses_specified_mf_label(StObjhdr, StObjses, temp, r_mf_label))){
 	    bool_t GotResponse = BOOL_FALSE;
 
-	    uuid_unparse( StObjses->s_sesid, str );
+	    uuid_unparse(StObjses->s_sesid, str);
 
 	    if(force) {
 		printf("-------------------------------------------------\n");
 		printf("Pruning this matching entry:\n");
-		printf( "UUID\t\t:\t%s\nMOUNT POINT\t:\t%s\n"
+		printf("UUID\t\t:\t%s\nMOUNT POINT\t:\t%s\n"
 			"DEV PATH\t:\t%s\n"
 			"LABEL\t\t:\t%s\n"
 			"TIME OF DUMP\t:\t%s",
@@ -862,20 +862,20 @@
 		       "DEV PATH\t:\t%s\nTIME OF DUMP\t:\t%s",
 		       str, StObjses->s_mountpt, StObjses->s_devpath,
 		       ctime32(&StObjhdr->sh_time));
-		while ( GotResponse == BOOL_FALSE )
+		while (GotResponse == BOOL_FALSE)
 		{
 		    char *chp;
 
 		    printf("\nDo you want to prune this entry: [y/n] ");
-		    fgets( response, GEN_STRLEN, stdin );
-		    chp = strchr( response, '\n');
+		    fgets(response, GEN_STRLEN, stdin);
+		    chp = strchr(response, '\n');
 		    if (chp)
 			*chp = '\0';
-		    if (strcasecmp( response, "Y" ) == 0) {
+		    if (strcasecmp(response, "Y") == 0) {
 			removeflag = BOOL_TRUE;
 			GotResponse = BOOL_TRUE;
 		    }
-		    else if (strcasecmp( response, "N" ) == 0) {
+		    else if (strcasecmp(response, "N") == 0) {
 			GotResponse = BOOL_TRUE;
 		    }
 		}
@@ -891,26 +891,26 @@
 
 	i++;
 
-	StObjhdr = (invt_seshdr_t *)( temp + sizeof(invt_sescounter_t) +
-				      (i * sizeof(invt_seshdr_t)) );
+	StObjhdr = (invt_seshdr_t *)(temp + sizeof(invt_sescounter_t) +
+				      (i * sizeof(invt_seshdr_t)));
 	StObjses = (invt_session_t *)(temp + StObjhdr->sh_sess_off);
     }
 
     validEntries = counter->ic_curnum - prunedcount - removedcount;
 
-    munmap( temp, sb.st_size);
+    munmap(temp, sb.st_size);
 
     if (debug && removedcount)
 	printf("       pruned %d entries from this StObj file,"
 	       " %d remaining\n", removedcount, validEntries);
 
-    close( fd );
+    close(fd);
 
     if (validEntries == 0)
     {
 	if (debug)
 	    printf("Removing: %s\n", StObjFileName);
-	unlink( StObjFileName );
+	unlink(StObjFileName);
 	return(-1);
     }
 
@@ -938,10 +938,10 @@
     if (!r_mf_label) {
 	return 1;	/* prune */
     }
-    for ( s = 0; s < (int) StObjses->s_cur_nstreams; s++ ) {
+    for (s = 0; s < (int) StObjses->s_cur_nstreams; s++) {
 	StObjstrm = (invt_stream_t *)
 	    (temp + StObjhdr->sh_streams_off + (s * sizeof(invt_stream_t)));
-	for ( m = 0; m < StObjstrm->st_nmediafiles; m++, num_media_objects++) {
+	for (m = 0; m < StObjstrm->st_nmediafiles; m++, num_media_objects++) {
 	    StObjmed = (invt_mediafile_t *)
 		(temp + StObjstrm->st_firstmfile + (m * sizeof(invt_mediafile_t)));
 	    if (!strncmp(StObjmed->mf_label, r_mf_label,
@@ -963,7 +963,7 @@
 
 /* copied from inv_api.c */
 char *
-inv_DEBUG_lock_str( int c )
+inv_DEBUG_lock_str(int c)
 {
 #ifdef USE_LOCKF
     static char *lockstr[] = {
@@ -1050,9 +1050,9 @@
 
     fd = open(path, open_mode);
     if (fd < 0) {
-	fprintf( stderr, "%s: open of %s failed.\n",
+	fprintf(stderr, "%s: open of %s failed.\n",
 		 g_programName, path);
-	perror( "open" );
+	perror("open");
 	return SYSCALL_FAILED;
     }
 
@@ -1146,16 +1146,16 @@
 {
     void *  temp;
 
-    lseek( fd, 0, SEEK_SET );
-    temp = mmap( NULL, count,
+    lseek(fd, 0, SEEK_SET);
+    temp = mmap(NULL, count,
 		 (checkonly == BOOL_TRUE) ? PROT_READ : PROT_READ|PROT_WRITE,
-		 MAP_SHARED, fd, 0 );
+		 MAP_SHARED, fd, 0);
 
     if (temp == (void *)-1) {
-	fprintf( stderr, "%s: error in mmap of %ld bytes for file %s\n",
+	fprintf(stderr, "%s: error in mmap of %ld bytes for file %s\n",
 		 g_programName, (long) count, path);
 	perror("mmap");
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
     return temp;
diff --git a/invutil/invutil.h b/invutil/invutil.h
index f1b1681..db5fc26 100644
--- a/invutil/invutil.h
+++ b/invutil/invutil.h
@@ -46,8 +46,8 @@
 char *	GetNameOfStobj (char *inv_path, char *filename);
 void	CheckAndPruneFstab(
 		char *, bool_t, char *, uuid_t *, uuid_t *, time32_t, char *);
-int	CheckAndPruneInvIndexFile( bool_t, char *, uuid_t *, time32_t, char *);
-int	CheckAndPruneStObjFile( bool_t, char *, uuid_t *, time32_t, char *);
+int	CheckAndPruneInvIndexFile(bool_t, char *, uuid_t *, time32_t, char *);
+int	CheckAndPruneStObjFile(bool_t, char *, uuid_t *, time32_t, char *);
 int	uses_specified_mf_label(
 		invt_seshdr_t *, invt_session_t *, char	*, char *);
 time32_t ParseDate(char *);
@@ -57,7 +57,7 @@
 void	write_n_bytes(int, void *, size_t, char *);
 void *	mmap_n_bytes(int, size_t, bool_t, char *);
 void	ListFstab(void);
-int	ListInvIndexFile( char *);
+int	ListInvIndexFile(char *);
 int	ListStObjFile(char *);
 int	invutil_interactive(char *, char *, uuid_t *, time32_t timeSecs);
 int	mntpnt_equal(char *s1, char *s2);
diff --git a/invutil/stobj.c b/invutil/stobj.c
index 582858f..2912e0c 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -409,12 +409,12 @@
 	return startnode;
     }
 
-    StObjhdr = (invt_seshdr_t *)( stobj_file[idx].mapaddr + sizeof(invt_sescounter_t));
+    StObjhdr = (invt_seshdr_t *)(stobj_file[idx].mapaddr + sizeof(invt_sescounter_t));
     StObjses = (invt_session_t *)(stobj_file[idx].mapaddr + StObjhdr->sh_sess_off);
 
     data_idx = 0;
     n = startnode;
-    for (i=0; i < stobj_file[idx].counter->ic_curnum; ) {
+    for (i=0; i < stobj_file[idx].counter->ic_curnum;) {
 	session = malloc(sizeof(*session));
 	if(session == NULL) {
 	    fprintf(stderr, "%s: internal memory error: session malloc\n", g_programName);
@@ -453,7 +453,7 @@
 	add_stobj_data(idx, session);
 
 	parent_session = n;
-	for ( j = 0; j < (int) StObjses->s_cur_nstreams; j++ ) {
+	for (j = 0; j < (int) StObjses->s_cur_nstreams; j++) {
 	    StObjstrm = (invt_stream_t *)(stobj_file[idx].mapaddr +
 					  StObjhdr->sh_streams_off +
 					  (j * sizeof(invt_stream_t)));
@@ -486,7 +486,7 @@
 	    add_stobj_data(idx, StObjstrm);
 
 	    parent_stream = n;
-	    for ( k = 0; k < StObjstrm->st_nmediafiles; k++) {
+	    for (k = 0; k < StObjstrm->st_nmediafiles; k++) {
 		StObjmed = (invt_mediafile_t *)(stobj_file[idx].mapaddr +
 						StObjstrm->st_firstmfile +
 						(k * sizeof(invt_mediafile_t)));
@@ -522,8 +522,8 @@
 
 	i++;
 
-	StObjhdr = (invt_seshdr_t *)( stobj_file[idx].mapaddr + sizeof(invt_sescounter_t) +
-				      (i * sizeof(invt_seshdr_t)) );
+	StObjhdr = (invt_seshdr_t *)(stobj_file[idx].mapaddr + sizeof(invt_sescounter_t) +
+				      (i * sizeof(invt_seshdr_t)));
 	StObjses = (invt_session_t *)(stobj_file[idx].mapaddr + StObjhdr->sh_sess_off);
     }
 
@@ -578,13 +578,13 @@
     char		*name;
 
     errno=0;
-    fd = open_and_lock( StObjFileName, FILE_WRITE, wait_for_locks );
+    fd = open_and_lock(StObjFileName, FILE_WRITE, wait_for_locks);
     if (fd < 0) {
 	return fd;
     }
 
     read_n_bytes(fd, &cnt, sizeof(invt_sescounter_t), StObjFileName);
-    lseek( fd, 0, SEEK_SET );
+    lseek(fd, 0, SEEK_SET);
     errno = 0;
     if (fstat(fd, &sb) < 0) {
 	fprintf(stderr, "Could not get stat info on %s\n", StObjFileName);
@@ -610,16 +610,16 @@
     if(fidx >= stobj_numfiles || stobj_file[fidx].fd < 0)
 	return 0;
 
-    munmap( stobj_file[fidx].mapaddr, stobj_file[fidx].size);
-    close( stobj_file[fidx].fd );
+    munmap(stobj_file[fidx].mapaddr, stobj_file[fidx].size);
+    close(stobj_file[fidx].fd);
     stobj_file[fidx].fd = -1;
 
     if(unlink_ok == BOOL_TRUE) {
 	unlink(stobj_file[fidx].name);
     }
 
-    free( stobj_file[fidx].name );
-    free( stobj_file[fidx].data );
+    free(stobj_file[fidx].name);
+    free(stobj_file[fidx].data);
 
     stobj_file[fidx].name = NULL;
     stobj_file[fidx].data = NULL;
@@ -641,15 +641,15 @@
 	    continue;
 
 	unlink_ok = BOOL_TRUE;
-	StObjhdr = (invt_seshdr_t *)( stobj_file[i].mapaddr + sizeof(invt_sescounter_t));
-	for(j = 0; j < stobj_file[i].counter->ic_curnum; ) {
+	StObjhdr = (invt_seshdr_t *)(stobj_file[i].mapaddr + sizeof(invt_sescounter_t));
+	for(j = 0; j < stobj_file[i].counter->ic_curnum;) {
 	    if(StObjhdr->sh_pruned != 1) {
 		unlink_ok = BOOL_FALSE;
 		break;
 	    }
 	    j++;
-	    StObjhdr = (invt_seshdr_t *)( stobj_file[i].mapaddr + sizeof(invt_sescounter_t) +
-					  (j * sizeof(invt_seshdr_t)) );
+	    StObjhdr = (invt_seshdr_t *)(stobj_file[i].mapaddr + sizeof(invt_sescounter_t) +
+					  (j * sizeof(invt_seshdr_t)));
 	}
 
 	close_stobj_file(i, unlink_ok);
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index 82c9032..b5726d9 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -56,7 +56,7 @@
 
 	_rmt_abort(fildes);
 
-	setoserror( EIO );
+	setoserror(EIO);
 	return(-1);
 }
 
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 92a49d7..8bfaea7 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -54,10 +54,10 @@
 static int
 _rmt_fstat(int fildes, char *arg)
 {
-	char buffer[ BUFMAGIC ];
+	char buffer[BUFMAGIC];
 	int rc, cnt, adj_rc;
 
-	sprintf( buffer, "Z%d\n", fildes );
+	sprintf(buffer, "Z%d\n", fildes);
 
 	/*
 	 *	grab the status and read it directly into the structure
@@ -83,7 +83,7 @@
 		{
 abortit:
 			_rmt_abort(fildes);
-			setoserror( EIO );
+			setoserror(EIO);
 			return(-1);
 		}
 	}
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index edcd611..84932a5 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -193,7 +193,7 @@
 		if (RMTHOST(fildes) == UNAME_UNDEFINED) {
 			_rmt_msg(RMTWARN,
 		_("rmtioctl: remote host type not supported for MTIOCTOP\n"));
-			setoserror( EPROTONOSUPPORT );
+			setoserror(EPROTONOSUPPORT);
 			return(-1);
 		}
 
@@ -201,7 +201,7 @@
 		if (RMTHOST(fildes) == UNAME_IRIX) {
 			mt_op = mtop_irixmap[mt_op];
 			if (mt_op == -1) {
-			    setoserror( EINVAL );
+			    setoserror(EINVAL);
 			    return(-1);
 			}
 		}
@@ -209,7 +209,7 @@
 		/* map the linux op code to the standard/fallback op code */
 			mt_op = mtop_stdmap[mt_op];
 			if (mt_op == -1) {
-			    setoserror( EINVAL );
+			    setoserror(EINVAL);
 			    return(-1);
 			}
 		}
@@ -248,7 +248,7 @@
 		    case UNAME_UNDEFINED:
 			_rmt_msg(RMTWARN,
 		_("rmtioctl: remote host type not supported for MTIOCGET\n"));
-			setoserror( EPROTONOSUPPORT );
+			setoserror(EPROTONOSUPPORT);
 			return(-1);
 		    case UNAME_IRIX:
 			if (sizeof(struct irix_mtget) != rc) {
@@ -256,7 +256,7 @@
 				_("rmtioctl: IRIX mtget structure of wrong size"
 				  " - got %d, wanted %d\n"),
 				rc, sizeof(struct irix_mtget));
-			    setoserror( EPROTONOSUPPORT );
+			    setoserror(EPROTONOSUPPORT);
 			    return(-1);
 			}
 			break;
@@ -273,12 +273,12 @@
 			  "- got %d, wanted %d or %d\n"),
 				rc, sizeof(struct linux32_mtget),
 				sizeof(struct linux64_mtget));
-			    setoserror( EPROTONOSUPPORT );
+			    setoserror(EPROTONOSUPPORT);
 			    return(-1);
 			}
 			break;
 		    default:
-			setoserror( EPROTONOSUPPORT );
+			setoserror(EPROTONOSUPPORT);
 			return(-1);
 		}
 
@@ -303,7 +303,7 @@
 			cnt = read(READ(fildes), p, ssize);
 			if (cnt <= 0) {
 				_rmt_abort(fildes);
-				setoserror( EIO );
+				setoserror(EIO);
 				return(-1);
 			}
 		}
@@ -421,7 +421,7 @@
 
 	}
         else {
-	    setoserror( EINVAL );
+	    setoserror(EINVAL);
 	    return(-1);
 	}
 }
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 09ba3e4..a091c72 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -120,7 +120,7 @@
 
 	if (i == MAXUNIT)
 	{
-		setoserror( EMFILE );
+		setoserror(EMFILE);
 		return(-1);
 	}
 
@@ -144,7 +144,7 @@
 	}
 	else
 	{
-		for ( user = login; (*sys = *user); user++, sys++ )
+		for (user = login; (*sys = *user); user++, sys++)
 			;
 		user = login;
 	}
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index 21d909d..f141395 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -47,7 +47,7 @@
 		if (read(READ(fildes), cp, 1) != 1)
 		{
 			_rmt_abort(fildes);
-			setoserror( EIO );
+			setoserror(EIO);
 			return(-1);
 		}
 		if (*cp == '\n')
@@ -60,7 +60,7 @@
 	if (i == BUFMAGIC)
 	{
 		_rmt_abort(fildes);
-		setoserror( EIO );
+		setoserror(EIO);
 		return(-1);
 	}
 
@@ -74,7 +74,7 @@
 
 	if (*cp == 'E' || *cp == 'F')
 	{
-		setoserror( atoi(cp + 1) );
+		setoserror(atoi(cp + 1));
 		while (read(READ(fildes), &c, 1) == 1)
 			if (c == '\n')
 				break;
@@ -92,7 +92,7 @@
 	if (*cp != 'A')
 	{
 		_rmt_abort(fildes);
-		setoserror( EIO );
+		setoserror(EIO);
 		return(-1);
 	}
 
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index 9e5a1a3..9b4cc50 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -67,6 +67,6 @@
 	}
 
 	_rmt_abort(fildes);
-	setoserror( EIO );
+	setoserror(EIO);
 	return(-1);
 }
diff --git a/restore/bag.c b/restore/bag.c
index dfe7aa5..d35f8b8 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -28,33 +28,33 @@
 #include "bag.h"
 
 bag_t *
-bag_alloc( void )
+bag_alloc(void)
 {
 	bag_t *bagp;
 
-	bagp = ( bag_t * )calloc( 1, sizeof( bag_t ));
-	assert( bagp );
+	bagp = (bag_t *)calloc(1, sizeof(bag_t));
+	assert(bagp);
 	return bagp;
 }
 
 void
-bag_insert( bag_t *bagp,
+bag_insert(bag_t *bagp,
 	    bagelem_t *newp,
 	    size64_t key,
-	    void *payloadp )
+	    void *payloadp)
 {
 	register bagelem_t *nextp;
 	register bagelem_t *prevp;
 
-	assert( ! newp->be_loaded );
+	assert(! newp->be_loaded);
 	newp->be_loaded = BOOL_TRUE;
-	assert( ! newp->be_bagp );
+	assert(! newp->be_bagp);
 	newp->be_bagp = bagp;
 
 	newp->be_key = key;
 	newp->be_payloadp = payloadp;
 
-	if ( bagp->b_headp ) {
+	if (bagp->b_headp) {
 		nextp = bagp->b_headp;
 		prevp = bagp->b_headp->be_prevp;
 	} else {
@@ -71,16 +71,16 @@
 }
 
 void
-bag_remove( bag_t *bagp,
+bag_remove(bag_t *bagp,
 	    bagelem_t *oldp,
 	    size64_t *keyp,
-	    void **payloadpp )
+	    void **payloadpp)
 {
 	register bagelem_t *nextp;
 	register bagelem_t *prevp;
 
-	assert( oldp->be_loaded );
-	assert( oldp->be_bagp == bagp );
+	assert(oldp->be_loaded);
+	assert(oldp->be_bagp == bagp);
 
 	nextp = oldp->be_nextp;
 	prevp = oldp->be_prevp;
@@ -88,9 +88,9 @@
 	nextp->be_prevp = prevp;
 	prevp->be_nextp = nextp;
 
-	if ( bagp->b_headp == oldp ) {
-		if ( nextp == oldp ) {
-			assert( prevp == oldp );
+	if (bagp->b_headp == oldp) {
+		if (nextp == oldp) {
+			assert(prevp == oldp);
 			bagp->b_headp = 0;
 		} else {
 			bagp->b_headp = nextp;
@@ -100,29 +100,29 @@
 	*keyp = oldp->be_key;
 	*payloadpp = oldp->be_payloadp;
 
-	memset( ( void * )oldp, 0, sizeof( bagelem_t ));
+	memset((void *)oldp, 0, sizeof(bagelem_t));
 }
 
 bagelem_t *
-bag_find( bag_t *bagp,
+bag_find(bag_t *bagp,
 	 size64_t key,
-	 void **payloadpp )
+	 void **payloadpp)
 {
 	register bagelem_t *p;
 
-	for ( p = bagp->b_headp
+	for (p = bagp->b_headp
 	      ;
 	      p && p->be_nextp != bagp->b_headp && p->be_key != key
 	      ;
-	      p = p->be_nextp )
+	      p = p->be_nextp)
 		;
 
-	if ( ! p || p->be_key != key ) {
+	if (! p || p->be_key != key) {
 		*payloadpp = 0;
 		return 0;
 	} else {
-		assert( p->be_loaded );
-		assert( p->be_bagp == bagp );
+		assert(p->be_loaded);
+		assert(p->be_bagp == bagp);
 		*payloadpp = p->be_payloadp;
 		return p;
 	}
@@ -130,10 +130,10 @@
 
 
 void
-bagiter_init( bag_t *bagp, bagiter_t *iterp )
+bagiter_init(bag_t *bagp, bagiter_t *iterp)
 {
 	iterp->bi_bagp = bagp;
-	if ( ! bagp->b_headp ) {
+	if (! bagp->b_headp) {
 		iterp->bi_nextp = 0;
 		return;
 	}
@@ -142,13 +142,13 @@
 }
 
 bagelem_t *
-bagiter_next( bagiter_t *iterp, void **payloadpp )
+bagiter_next(bagiter_t *iterp, void **payloadpp)
 {
 	bagelem_t *returnp;
 
 	/* termination condition
 	 */
-	if ( ! iterp->bi_nextp ) {
+	if (! iterp->bi_nextp) {
 		*payloadpp = 0;
 		return 0;
 	}
@@ -159,7 +159,7 @@
 
 	/* calculate next. if returning last, set next to NULL
 	 */
-	if ( iterp->bi_nextp == iterp->bi_lastp ) {
+	if (iterp->bi_nextp == iterp->bi_lastp) {
 		iterp->bi_nextp = 0;
 	} else {
 		iterp->bi_nextp = iterp->bi_nextp->be_nextp;
@@ -170,21 +170,21 @@
 }
 
 void
-bag_free( bag_t *bagp )
+bag_free(bag_t *bagp)
 {
 	register bagelem_t *p;
 
 	p = bagp->b_headp;
-	while ( p ) {
+	while (p) {
 		register bagelem_t *nextp = p->be_nextp;
-		memset( ( void * )p, 0, sizeof( bagelem_t ));
+		memset((void *)p, 0, sizeof(bagelem_t));
 		p = nextp;
-		if ( p == bagp->b_headp ) {
+		if (p == bagp->b_headp) {
 			break;
 		}
-		assert( p );
+		assert(p);
 	}
 
-	memset( ( void * )bagp, 0, sizeof( bag_t ));
-	free( ( void * )bagp );
+	memset((void *)bagp, 0, sizeof(bag_t));
+	free((void *)bagp);
 }
diff --git a/restore/bag.h b/restore/bag.h
index 6bcb86f..c2aef2c 100644
--- a/restore/bag.h
+++ b/restore/bag.h
@@ -45,32 +45,32 @@
 
 /* creates a new bag
  */
-extern bag_t *bag_alloc( void );
+extern bag_t *bag_alloc(void);
 
 /* insert the item into the bag. the caller supplies a search key
  * and arbitrary payload.
  */
-extern void bag_insert( bag_t *bagp,
+extern void bag_insert(bag_t *bagp,
 			bagelem_t *bagelemp,
 			size64_t key,
-			void *payloadp );
+			void *payloadp);
 
 /* remove the item from the bag. the key and payload originally supplied
  * to the insert operator are returned by reference.
  */
-extern void bag_remove( bag_t *bagp,
+extern void bag_remove(bag_t *bagp,
 			bagelem_t *bagelemp,
 			size64_t *keyp,
-			void **payloadpp );
+			void **payloadpp);
 
 /* search by key for an element in the bag.
  * returns the element pointer if a matching item is found, as well as
  * the payload (by reference). if the item is not in the bag, returns
  * a null pointer and (by reference) payload.
  */
-extern bagelem_t *bag_find( bag_t *bagp,
+extern bagelem_t *bag_find(bag_t *bagp,
 			    size64_t key,
-			    void **payloadpp );
+			    void **payloadpp);
 
 /* private bag iterator
  */
@@ -84,15 +84,15 @@
 
 /* initializes a bag iterator
  */
-extern void bagiter_init( bag_t *bagp, bagiter_t *iterp );
+extern void bagiter_init(bag_t *bagp, bagiter_t *iterp);
 
 /* returns the next element in the bag. caller may remove the element
  * prior to the next call.
  */
-extern bagelem_t * bagiter_next( bagiter_t *iterp, void **payloadpp );
+extern bagelem_t * bagiter_next(bagiter_t *iterp, void **payloadpp);
 
 /* destroys the bag.
  */
-extern void bag_free( bag_t *bagp );
+extern void bag_free(bag_t *bagp);
 
 #endif /* BAG_H */
diff --git a/restore/content.c b/restore/content.c
index 078c6b8..930a76c 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -94,7 +94,7 @@
 typedef struct { xfs_ino_t eg_ino; off64_t eg_off; } egrp_t;
 	/* extent group descriptor
 	 */
-typedef char label_t[ GLOBAL_HDR_STRING_SZ ];
+typedef char label_t[GLOBAL_HDR_STRING_SZ];
 	/* dump or mobj label
 	 */
 typedef enum { PURP_SEARCH, PURP_DIR, PURP_NONDIR } purp_t;
@@ -106,14 +106,14 @@
 	 * encoded as byte offset plus one of descriptor into descriptor
 	 * portion of persistent state. plus one so DH_NULL can be zero.
 	 */
-#define DH_NULL		( ( dh_t )0 )
+#define DH_NULL		((dh_t)0)
 	/* NULL inv. descriptor handles, to terminate linked descriptor lists.
 	 * must be zero-valued, so memset of pers.s sets freeh to DH_NULL.
 	 */
-#define DH2F( h )	( ( pers_file_t * )( ( char * )descp + ( h - 1 )))
-#define DH2O( h )	( ( pers_obj_t * )( ( char * )descp + ( h - 1 )))
-#define DH2S( h )	( ( pers_strm_t * )( ( char * )descp + ( h - 1 )))
-#define DH2D( h )	( ( pers_desc_t * )( ( char * )descp + ( h - 1 )))
+#define DH2F(h)	((pers_file_t *)((char *)descp + (h - 1)))
+#define DH2O(h)	((pers_obj_t *)((char *)descp + (h - 1)))
+#define DH2S(h)	((pers_strm_t *)((char *)descp + (h - 1)))
+#define DH2D(h)	((pers_desc_t *)((char *)descp + (h - 1)))
 	/* convert file, object, and stream inv. descriptor handle into
 	 * descriptor pointers
 	 */
@@ -226,8 +226,8 @@
 
 /* f_flags
  */
-#define PF_INV	( 1 << 0 )
-#define PF_TERM	( 1 << 1 )
+#define PF_INV	(1 << 0)
+#define PF_TERM	(1 << 1)
 
 typedef struct pers_file pers_file_t;
 
@@ -331,7 +331,7 @@
 	off_t std_nextoff;
 		/* offset to next descriptor, in bytes relative to this
 		 */
-	char std_path[ 1 ];
+	char std_path[1];
 		/* first character of a NULL-terminated string containing the
 		 * the relative subtree pathname
 		 */
@@ -430,7 +430,7 @@
 			 * have been initialized, and the session history
 			 * has been initialized and validated.
 			 */
-		char dstdir[ MAXPATHLEN ];
+		char dstdir[MAXPATHLEN];
 			/* absolute pathname of the destination directory
 			 */
 		bool_t dstdirisxfspr;
@@ -489,7 +489,7 @@
 			 * up searches in parrest.
 			 */
 
-		partial_rest_t parrest[ STREAM_SIMMAX * 2 - 2 ];
+		partial_rest_t parrest[STREAM_SIMMAX * 2 - 2];
 			/* record of bytes restored to partially restored files.
 			 * Max possible is two per stream except the first
 			 * drive will never finish another drives file and the
@@ -677,8 +677,8 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
-extern bool_t preemptchk( void );
+extern void usage(void);
+extern bool_t preemptchk(void);
 extern char *homedir;
 extern bool_t pipeline;
 extern bool_t stdoutpiped;
@@ -689,13 +689,13 @@
 
 /* forward declarations of locally defined static functions ******************/
 
-static void toconly_cleanup( void );
+static void toconly_cleanup(void);
 
-static Media_t *Media_create( ix_t thrdix );
-static void Media_indir( Media_t *Mediap );
-static void Media_indir( Media_t *Mediap );
-static void Media_atnondir( Media_t *Mediap );
-static rv_t Media_mfile_next( Media_t *Mediap,
+static Media_t *Media_create(ix_t thrdix);
+static void Media_indir(Media_t *Mediap);
+static void Media_indir(Media_t *Mediap);
+static void Media_atnondir(Media_t *Mediap);
+static rv_t Media_mfile_next(Media_t *Mediap,
 			      purp_t purp,
 			      sync_t *donesyncp,
 			      dh_t  *filehp,
@@ -705,160 +705,160 @@
 			      content_hdr_t **crhdrpp,
 			      content_inode_hdr_t **scrhdrpp,
 			      drive_t **drivepp,
-			      filehdr_t *fhdr );
-static void Media_end( Media_t *Mediap );
-static bool_t Media_prompt_change( drive_t *drivep,
+			      filehdr_t *fhdr);
+static void Media_end(Media_t *Mediap);
+static bool_t Media_prompt_change(drive_t *drivep,
 				   purp_t purp,
 				   bag_t *bagp,
 				   bool_t knownholespr,
-				   bool_t maybeholespr );
+				   bool_t maybeholespr);
 
-static bool_t Inv_validate_cmdline( void );
-static bool_t dumpcompat( bool_t resumepr,
+static bool_t Inv_validate_cmdline(void);
+static bool_t dumpcompat(bool_t resumepr,
 			  ix_t level,
 			  uuid_t baseid,
-			  bool_t logpr );
-static bool_t promptdumpmatch( ix_t thrdix,
+			  bool_t logpr);
+static bool_t promptdumpmatch(ix_t thrdix,
 			       global_hdr_t *grhdrp,
 			       media_hdr_t *mrhdrp,
 			       content_hdr_t *crhdrp,
-			       content_inode_hdr_t *scrhdrp );
+			       content_inode_hdr_t *scrhdrp);
 
-static void pi_checkpoint( dh_t fileh,
+static void pi_checkpoint(dh_t fileh,
 			   drive_mark_t *drivemarkp,
 			   xfs_ino_t ino,
-			   off64_t off );
-static bool_t pi_transcribe( inv_session_t *sessp );
-static dh_t pi_addfile( Media_t *Mediap,
+			   off64_t off);
+static bool_t pi_transcribe(inv_session_t *sessp);
+static dh_t pi_addfile(Media_t *Mediap,
 			global_hdr_t *grhdrp,
 			drive_hdr_t *drhdrp,
 			media_hdr_t *mrhdrp,
 			content_inode_hdr_t *scrhdrp,
-			drive_t * drivep );
-static void pi_seestrmend( ix_t strmix );
-static void pi_seeobjstrmend( ix_t strmix, ix_t mediaix );
-static xfs_ino_t pi_scanfileendino( dh_t fileh );
-static bool_t pi_alldone( void );
-static bag_t * pi_neededobjs_dir_alloc( bool_t *knownholesprp,
-				        bool_t *maybeholesprp );
-static bag_t * pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
+			drive_t * drivep);
+static void pi_seestrmend(ix_t strmix);
+static void pi_seeobjstrmend(ix_t strmix, ix_t mediaix);
+static xfs_ino_t pi_scanfileendino(dh_t fileh);
+static bool_t pi_alldone(void);
+static bag_t * pi_neededobjs_dir_alloc(bool_t *knownholesprp,
+				        bool_t *maybeholesprp);
+static bag_t * pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 					   bool_t *maybeholesprp,
 					   bool_t showobjindrivepr,
-					   bool_t markskippr );
-static void pi_neededobjs_free( bag_t *bagp );
-static void pi_bracketneededegrps( dh_t thisfileh,
+					   bool_t markskippr);
+static void pi_neededobjs_free(bag_t *bagp);
+static void pi_bracketneededegrps(dh_t thisfileh,
 				   egrp_t *first_egrp,
-				   egrp_t *next_egrp );
-static void pi_update_stats( off64_t sz );
-static void pi_hiteod( ix_t strmix, ix_t objix );
-static void pi_hiteom( ix_t strmix, ix_t objix );
-static void pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix );
-static bool_t pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix );
-static bool_t pi_know_no_more_beyond_on_object( purp_t purp,
+				   egrp_t *next_egrp);
+static void pi_update_stats(off64_t sz);
+static void pi_hiteod(ix_t strmix, ix_t objix);
+static void pi_hiteom(ix_t strmix, ix_t objix);
+static void pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix);
+static bool_t pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix);
+static bool_t pi_know_no_more_beyond_on_object(purp_t purp,
 					        ix_t strmix,
 					        ix_t objix,
-					        ix_t fileix );
-static void pi_preclean( void );
-static void pi_driveempty( ix_t driveix );
-static void pi_note_indrive( ix_t driveix, uuid_t mediaid );
-static void pi_note_underhead( dh_t thisobjh, dh_t thisfileh );
-static void pi_lock( void );
-static void pi_unlock( void );
+					        ix_t fileix);
+static void pi_preclean(void);
+static void pi_driveempty(ix_t driveix);
+static void pi_note_indrive(ix_t driveix, uuid_t mediaid);
+static void pi_note_underhead(dh_t thisobjh, dh_t thisfileh);
+static void pi_lock(void);
+static void pi_unlock(void);
 
-static rv_t applydirdump( drive_t *drivep,
+static rv_t applydirdump(drive_t *drivep,
 			  dh_t fileh,
 			  content_inode_hdr_t *scrhdrp,
-			  filehdr_t *fhdrp );
-static rv_t treepost( char *path1, char *path2 );
-static rv_t applynondirdump( drive_t *drivep,
+			  filehdr_t *fhdrp);
+static rv_t treepost(char *path1, char *path2);
+static rv_t applynondirdump(drive_t *drivep,
 			     dh_t fileh,
 			     content_inode_hdr_t *scrhdrp,
 			     char *path1,
 			     char *path2,
-			     filehdr_t *fhdrp );
-static rv_t finalize( char *path1, char *path2 );
-static void wipepersstate( void );
+			     filehdr_t *fhdrp);
+static rv_t finalize(char *path1, char *path2);
+static void wipepersstate(void);
 
-static rv_t read_filehdr( drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs );
-static rv_t restore_file( drive_t *drivep,
+static rv_t read_filehdr(drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs);
+static rv_t restore_file(drive_t *drivep,
 			  filehdr_t *fhdrp,
 			  bool_t ehcs,
 			  bool_t ahcs,
 			  char *path1,
-			  char *path2 );
-static bool_t restore_reg( drive_t *drivep,
+			  char *path2);
+static bool_t restore_reg(drive_t *drivep,
 			   filehdr_t *fhdrp,
 			   rv_t *rvp,
-			   char *path );
-static bool_t restore_extent_group( drive_t *drivep,
+			   char *path);
+static bool_t restore_extent_group(drive_t *drivep,
 				    filehdr_t *fhdrp,
 				    char *path,
 				    int fd,
 				    bool_t ehcs,
 				    rv_t *rvp);
-static bool_t restore_complete_reg( stream_context_t* );
-static bool_t restore_spec( filehdr_t *fhdrp, rv_t *rvp, char *path );
-static bool_t restore_symlink( drive_t *drivep,
+static bool_t restore_complete_reg(stream_context_t*);
+static bool_t restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path);
+static bool_t restore_symlink(drive_t *drivep,
 			       filehdr_t *fhdrp,
 			       rv_t *rvp,
 			       char *path,
 			       char *scratchpath,
-			       bool_t ehcs );
-static rv_t read_extenthdr( drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs );
-static rv_t read_dirent( drive_t *drivep,
+			       bool_t ehcs);
+static rv_t read_extenthdr(drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs);
+static rv_t read_dirent(drive_t *drivep,
 			 direnthdr_t *dhdrp,
 			 size_t direntbufsz,
-			 bool_t dhcs );
-static rv_t discard_padding( size_t sz, drive_t *drivep );
-static rv_t restore_extent( filehdr_t *fhdrp,
+			 bool_t dhcs);
+static rv_t discard_padding(size_t sz, drive_t *drivep);
+static rv_t restore_extent(filehdr_t *fhdrp,
 			    extenthdr_t *ehdrp,
 			    int fd,
 			    char *path,
 			    drive_t *drivep,
-			    off64_t *bytesreadp );
-static bool_t askinvforbaseof( uuid_t baseid, inv_session_t *sessp );
-static void addobj( bag_t *bagp,
+			    off64_t *bytesreadp);
+static bool_t askinvforbaseof(uuid_t baseid, inv_session_t *sessp);
+static void addobj(bag_t *bagp,
 		    uuid_t *objidp,
 		    label_t objlabel,
 		    bool_t indrivepr,
-		    ix_t indriveix );
-static size_t cntobj( bag_t *bagp );
-static bool_t gapneeded( egrp_t *firstegrpp, egrp_t *lastegrpp );
-static char * ehdr_typestr( int32_t type );
-static int egrpcmp( egrp_t *egrpap, egrp_t *egrpbp );
-static void display_dump_label( bool_t lockpr,
+		    ix_t indriveix);
+static size_t cntobj(bag_t *bagp);
+static bool_t gapneeded(egrp_t *firstegrpp, egrp_t *lastegrpp);
+static char * ehdr_typestr(int32_t type);
+static int egrpcmp(egrp_t *egrpap, egrp_t *egrpbp);
+static void display_dump_label(bool_t lockpr,
 				int mllevel,
 				char *introstr,
 				global_hdr_t *grhdrp,
 				media_hdr_t *mrhdrp,
 				content_hdr_t *crhdrp,
-				content_inode_hdr_t *scrhdrp );
-static void display_needed_objects( purp_t purp,
+				content_inode_hdr_t *scrhdrp);
+static void display_needed_objects(purp_t purp,
 				    bag_t *bagp,
 				    bool_t knownholespr,
-				    bool_t maybeholespr );
-static void set_mcflag( ix_t thrdix );
-static void clr_mcflag( ix_t thrdix );
-static void pi_show( char *introstring );
-static void pi_show_nomloglock( void );
+				    bool_t maybeholespr);
+static void set_mcflag(ix_t thrdix);
+static void clr_mcflag(ix_t thrdix);
+static void pi_show(char *introstring);
+static void pi_show_nomloglock(void);
 
-static bool_t extattr_init( size_t drivecnt );
-static char * get_extattrbuf( ix_t which );
-static rv_t restore_extattr( drive_t *drivep,
+static bool_t extattr_init(size_t drivecnt);
+static char * get_extattrbuf(ix_t which);
+static rv_t restore_extattr(drive_t *drivep,
 			     filehdr_t *fhdrp,
 			     char *path,
 			     bool_t ahcs,
 			     bool_t isdirpr,
 			     bool_t onlydoreadpr,
-			     dah_t dah );
-static bool_t restore_dir_extattr_cb( char *path, dah_t dah );
-static bool_t restore_dir_extattr_cb_cb( extattrhdr_t *ahdrp, void *ctxp );
-static void setextattr( char *path, extattrhdr_t *ahdrp );
+			     dah_t dah);
+static bool_t restore_dir_extattr_cb(char *path, dah_t dah);
+static bool_t restore_dir_extattr_cb_cb(extattrhdr_t *ahdrp, void *ctxp);
+static void setextattr(char *path, extattrhdr_t *ahdrp);
 static void partial_reg(ix_t d_index, xfs_ino_t ino, off64_t fsize,
                         off64_t offset, off64_t sz);
 static bool_t partial_check (xfs_ino_t ino, off64_t fsize);
 static bool_t partial_check2 (partial_rest_t *isptr, off64_t fsize);
-static int do_fssetdm_by_handle( char *path, fsdmidata_t *fdmp);
+static int do_fssetdm_by_handle(char *path, fsdmidata_t *fdmp);
 static int quotafilecheck(char *type, char *dstdir, char *quotafile);
 
 /* definition of locally defined global variables ****************************/
@@ -877,13 +877,13 @@
 static char *hkdirname = "xfsrestorehousekeepingdir";
 static char *persname = "state";
 static char *perspath = 0;
-static bool_t mcflag[ STREAM_SIMMAX ]; /* media change flag */
+static bool_t mcflag[STREAM_SIMMAX]; /* media change flag */
 
 
 /* definition of locally defined global functions ****************************/
 
 bool_t
-content_init( int argc, char *argv[ ], size64_t vmsz )
+content_init(int argc, char *argv[], size64_t vmsz)
 {
 	char *dstdir;	/* abs. path to destination dir */
 	bool_t cumpr;	/* cmd line cumulative restore specification */
@@ -913,32 +913,32 @@
 
 	/* Calculate the size needed for the persistent inventory
 	 */
-	for ( perssz = pgsz; perssz < sizeof(pers_t); perssz += pgsz )
+	for (perssz = pgsz; perssz < sizeof(pers_t); perssz += pgsz)
 		;
 
 	/* sanity checks
 	 */
-	assert( sizeof( pers_desc_t ) <= PERS_DESCSZ );
-	assert( PERS_DESCSZ <= pgsz );
-	assert( ! ( pgsz % PERS_DESCSZ ));
-	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
+	assert(sizeof(pers_desc_t) <= PERS_DESCSZ);
+	assert(PERS_DESCSZ <= pgsz);
+	assert(! (pgsz % PERS_DESCSZ));
+	assert(sizeof(extattrhdr_t) == EXTATTRHDR_SZ);
 
-	assert( ! ( perssz % pgsz ));
+	assert(! (perssz % pgsz));
 
-	assert( SYNC_INIT == 0 );
+	assert(SYNC_INIT == 0);
 
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "sizeof( pers_desc_t ) == %d, pgsz == %d, perssz == %d \n",
-	      sizeof( pers_desc_t ), pgsz, perssz );
+	      sizeof(pers_desc_t), pgsz, perssz);
 
 	/* allocate transient state
 	 */
-	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	assert( tranp );
+	tranp = (tran_t *)calloc(1, sizeof(tran_t));
+	assert(tranp);
 
 	/* allocate a qlock for establishing pi critical regions
 	 */
-	tranp->t_pilockh = qlock_alloc( QLOCK_ORD_PI );
+	tranp->t_pilockh = qlock_alloc(QLOCK_ORD_PI);
 
 	/* record vmsz; will be used later to init tree abstraction
 	 */
@@ -946,7 +946,7 @@
 
 	/* record the start time for stats display
 	 */
-	tranp->t_starttime = time( 0 );
+	tranp->t_starttime = time(0);
 
 	/* get command line options
 	 */
@@ -966,8 +966,8 @@
 	restore_rootdir_permissions = BOOL_FALSE;
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_TOC:
 			tranp->t_toconlypr = BOOL_TRUE;
 			break;
@@ -981,20 +981,20 @@
 			existpr = BOOL_TRUE;
 			break;
 		case GETOPT_NEWER:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( stat( optarg, &statbuf )) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (stat(optarg, &statbuf)) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "unable to get status of -%c argument %s:"
 				      " %s\n"),
 				      c,
 				      optarg,
-				      strerror( errno ));
+				      strerror(errno));
 				return BOOL_FALSE;
 			}
 			newerpr = BOOL_TRUE;
@@ -1007,153 +1007,153 @@
 			ownerpr = BOOL_TRUE;
 			break;
 		case GETOPT_WORKSPACE:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( optarg[ 0 ] != '/' ) {
-				tranp->t_hkdir = path_reltoabs( optarg,
-								homedir );
-				if ( ! tranp->t_hkdir ) {
-					mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (optarg[0] != '/') {
+				tranp->t_hkdir = path_reltoabs(optarg,
+								homedir);
+				if (! tranp->t_hkdir) {
+					mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					      "-%c argument %s is an "
 					      "invalid pathname\n"),
 					      c,
-					      optarg );
-					usage( );
+					      optarg);
+					usage();
 					return BOOL_FALSE;
 				}
-				mlog( MLOG_DEBUG,
+				mlog(MLOG_DEBUG,
 				      "alternate workspace path converted "
 				      "from %s to %s\n",
 				      optarg,
-				      tranp->t_hkdir );
+				      tranp->t_hkdir);
 			} else {
 				tranp->t_hkdir = optarg;
 			}
-			rval = stat( tranp->t_hkdir, &statbuf );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			rval = stat(tranp->t_hkdir, &statbuf);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot stat -%c argument %s (%s): %s\n"),
 				      c,
 				      optarg,
 				      tranp->t_hkdir,
-				      strerror( errno ));
-				usage( );
+				      strerror(errno));
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( ( statbuf.st_mode & S_IFMT ) != S_IFDIR ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument %s (%s) "
 				      "is not a directory\n"),
 				      c,
 				      optarg,
-				      tranp->t_hkdir );
-				usage( );
+				      tranp->t_hkdir);
+				usage();
 				return BOOL_FALSE;
 			}
 
 			break;
 		case GETOPT_DUMPLABEL:
-			if ( tranp->t_reqdumplabvalpr ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (tranp->t_reqdumplabvalpr) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "too many -%c arguments: "
 				      "\"-%c %s\" already given\n"),
 				      c,
 				      c,
-				      tranp->t_reqdumplab );
-				usage( );
+				      tranp->t_reqdumplab);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( strlen( optarg )
+			if (strlen(optarg)
 			     >
-			     sizeofmember( pers_t, s.dumplab )) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			     sizeofmember(pers_t, s.dumplab)) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument %s too long: max is %d\n"),
 				      c,
 				      optarg,
-				      sizeofmember( pers_t, s.dumplab ));
-				usage( );
+				      sizeofmember(pers_t, s.dumplab));
+				usage();
 				return BOOL_FALSE;
 			}
 			tranp->t_reqdumplab = optarg;
 			tranp->t_reqdumplabvalpr = BOOL_TRUE;
 			break;
 		case GETOPT_SESSIONID:
-			if ( tranp->t_reqdumpidvalpr ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (tranp->t_reqdumpidvalpr) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "too many -%c arguments\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if (uuid_parse( optarg, tranp->t_reqdumpid ) < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (uuid_parse(optarg, tranp->t_reqdumpid) < 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument not a valid uuid\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			tranp->t_reqdumpidvalpr = BOOL_TRUE;
 			break;
 		case GETOPT_SUBTREE:
 		case GETOPT_NOSUBTREE:
-			if ( ! optarg
+			if (! optarg
 			     ||
-			     optarg[ 0 ] == 0
+			     optarg[0] == 0
 			     ||
-			     optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL, _(
+			     optarg[0] == '-') {
+				mlog(MLOG_NORMAL, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( optarg[ 0 ] == '/' ) {
-				mlog( MLOG_NORMAL, _(
+			if (optarg[0] == '/') {
+				mlog(MLOG_NORMAL, _(
 				      "-%c argument must be relative\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			stcnt++;
-			if ( ! firststsenseprvalpr ) {
-				if ( c == GETOPT_SUBTREE ) {
+			if (! firststsenseprvalpr) {
+				if (c == GETOPT_SUBTREE) {
 					firststsensepr = BOOL_TRUE;
 				} else {
 					firststsensepr = BOOL_FALSE;
 				}
 				firststsenseprvalpr = BOOL_TRUE;
 			}
-			stsz += sizeof( stdesc_t )
+			stsz += sizeof(stdesc_t)
 				+
-				strlen( optarg )
+				strlen(optarg)
 				+
-				( STDESCALIGN - 1 );
-			stsz &= ~( STDESCALIGN - 1 );
+				(STDESCALIGN - 1);
+			stsz &= ~(STDESCALIGN - 1);
 			break;
 		case GETOPT_INTERACTIVE:
-			if ( ! dlog_allowed( )) {
-				mlog( MLOG_NORMAL, _(
+			if (! dlog_allowed()) {
+				mlog(MLOG_NORMAL, _(
 				      "-%c unavailable: no /dev/tty\n"),
-				      GETOPT_INTERACTIVE );
+				      GETOPT_INTERACTIVE);
 				return BOOL_FALSE;
 			}
 			interpr = BOOL_TRUE;
@@ -1165,11 +1165,11 @@
 			restoredmpr = BOOL_TRUE;
 			break;
 		case GETOPT_ALERTPROG:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					"-%c argument missing\n"),
-					c );
-				usage( );
+					c);
+				usage();
 				return BOOL_FALSE;
 			}
 			media_change_alert_program = optarg;
@@ -1194,35 +1194,35 @@
 
 	/* command line option error checking
 	 */
-	if ( cumpr && tranp->t_toconlypr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (cumpr && tranp->t_toconlypr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "-%c and -%c option cannot be used together\n"),
 		      GETOPT_TOC,
-		      GETOPT_CUMULATIVE );
-		usage( );
+		      GETOPT_CUMULATIVE);
+		usage();
 		return BOOL_FALSE;
 	}
-	if ( resumepr && tranp->t_toconlypr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (resumepr && tranp->t_toconlypr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "-%c and -%c option cannot be used together\n"),
 		      GETOPT_TOC,
-		      GETOPT_RESUME );
-		usage( );
+		      GETOPT_RESUME);
+		usage();
 		return BOOL_FALSE;
 	}
 
 	/* assume all streams contain a directory dump. streams will remove
 	 * themselves from this bitset if they do not contain a directory dump.
 	 */
-	assert( drivecnt <= sizeof(tranp->t_dirdumps) * NBBY );
-	tranp->t_dirdumps = ( 1ULL << drivecnt ) - 1;
+	assert(drivecnt <= sizeof(tranp->t_dirdumps) * NBBY);
+	tranp->t_dirdumps = (1ULL << drivecnt) - 1;
 
 	/* the user may specify stdin as the restore source stream,
 	 * by a single dash ('-') with no option letter. This must
 	 * appear between the last lettered argument and the destination
 	 * directory pathname.
 	 */
-	if ( optind < argc && ! strcmp( argv[ optind ], "-" )) {
+	if (optind < argc && ! strcmp(argv[optind ], "-")) {
 		optind++;
 	}
 
@@ -1230,55 +1230,55 @@
 	 * required if table-of-contents display, or if a resumed restore
 	 * or a delta restore.
 	 */
-	if ( ! tranp->t_toconlypr ) {
-		if ( optind >= argc ) {
+	if (! tranp->t_toconlypr) {
+		if (optind >= argc) {
 			dstdir = 0;
 		} else {
-			if ( argv[ optind ][ 0 ] != '/' ) {
-				dstdir = path_reltoabs( argv[ optind ],
-							homedir );
-				if ( ! dstdir ) {
-					mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (argv[optind][0] != '/') {
+				dstdir = path_reltoabs(argv[optind],
+							homedir);
+				if (! dstdir) {
+					mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					      "destination directory %s "
 					      "invalid pathname\n"),
-					      argv[ optind ] );
-					usage( );
+					      argv[optind]);
+					usage();
 					return BOOL_FALSE;
 				}
-				mlog( MLOG_DEBUG,
+				mlog(MLOG_DEBUG,
 				      "restore destination path converted "
 				      "from %s to %s\n",
-				      argv[ optind ],
-				      dstdir );
+				      argv[optind],
+				      dstdir);
 			} else {
-				dstdir = argv[ optind ];
+				dstdir = argv[optind];
 			}
-			rval = stat( dstdir, &statbuf );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			rval = stat(dstdir, &statbuf);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot stat destination directory %s: "
 				      "%s\n"),
 				      dstdir,
-				      strerror( errno ));
-				usage( );
+				      strerror(errno));
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( ( statbuf.st_mode & S_IFMT ) != S_IFDIR ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "specified destination %s "
 				      "is not a directory\n"),
-				      dstdir );
-				usage( );
+				      dstdir);
+				usage();
 				return BOOL_FALSE;
 			}
 		}
 	} else {
-		if ( optind < argc ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (optind < argc) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "do not specify destination directory if "
 			      "contents only restore invoked (-%c option)\n"),
-			      GETOPT_TOC );
-			usage( );
+			      GETOPT_TOC);
+			usage();
 			return BOOL_FALSE;
 		}
 		dstdir = ".";
@@ -1292,62 +1292,62 @@
 	 * if this is toconly, modify the housekeeping dir's name with
 	 * the pid.
 	 */
-	if ( ! tranp->t_hkdir ) {
-		if ( tranp->t_toconlypr ) {
+	if (! tranp->t_hkdir) {
+		if (tranp->t_toconlypr) {
 			tranp->t_hkdir = homedir;
 		} else {
-			if ( ! dstdir ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! dstdir) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "destination directory "
-				      "not specified\n") );
-				usage( );
+				      "not specified\n"));
+				usage();
 				return BOOL_FALSE;
 			} else {
 				tranp->t_hkdir = dstdir;
 			}
 		}
 	}
-	if ( tranp->t_toconlypr ) {
-		pid = getpid( );
+	if (tranp->t_toconlypr) {
+		pid = getpid();
 	} else {
 		pid = 0;
 	}
-	tranp->t_hkdir = open_pathalloc( tranp->t_hkdir, hkdirname, pid );
+	tranp->t_hkdir = open_pathalloc(tranp->t_hkdir, hkdirname, pid);
 
 	/* if this is a table-of-contents only restore, register an
 	 * exit handler to get rid of the housekeeping directory and
 	 * its contents. NOTE: needs several tran fields initialized!
 	 */
-	if ( tranp->t_toconlypr ) {
-		atexit( toconly_cleanup );
+	if (tranp->t_toconlypr) {
+		atexit(toconly_cleanup);
 	}
 
 	/* create housekeeping dir if not present
 	 */
-	rval = mkdir( tranp->t_hkdir, S_IRWXU );
-	if ( rval && errno != EEXIST ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	rval = mkdir(tranp->t_hkdir, S_IRWXU);
+	if (rval && errno != EEXIST) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to create %s: %s\n"),
 		      tranp->t_hkdir,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* build a full pathname to pers. state file
 	 */
-	assert( ! perspath );
-	perspath = open_pathalloc( tranp->t_hkdir, persname, 0 );
+	assert(! perspath);
+	perspath = open_pathalloc(tranp->t_hkdir, persname, 0);
 
 	/* open, creating if non-existent
 	 */
-	tranp->t_persfd = open( perspath,
+	tranp->t_persfd = open(perspath,
 				O_CREAT | O_RDWR,
-				S_IRUSR | S_IWUSR );
-	if ( tranp->t_persfd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				S_IRUSR | S_IWUSR);
+	if (tranp->t_persfd < 0) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "could not open/create persistent state file %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -1355,19 +1355,19 @@
 	 * arguments. three cases: no dumps applied so far, or one or more
 	 * dumps applied completely, or restore session was interrupted
 	 */
-	persp = ( pers_t * ) mmap_autogrow(perssz, tranp->t_persfd, 0);
+	persp = (pers_t *) mmap_autogrow(perssz, tranp->t_persfd, 0);
 
-	if ( persp == ( pers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (persp == (pers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "could not map persistent state file hdr %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* but first setup or verify the on-disk format information
 	 */
-	if ( ! persp->a.valpr ) {
+	if (! persp->a.valpr) {
 		/* this is the first restore session
 		 */
 		persp->v.housekeeping_magic = HOUSEKEEPING_MAGIC;
@@ -1377,254 +1377,254 @@
 	} else {
 		/* cumulative or resuming a restore, verify the header
 		 */
-		if ( persp->v.housekeeping_magic != HOUSEKEEPING_MAGIC ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (persp->v.housekeeping_magic != HOUSEKEEPING_MAGIC) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "%s format corrupt or wrong endianness "
 			      "(0x%x, expected 0x%x)\n"),
 			      hkdirname,
 			      persp->v.housekeeping_magic,
-			      HOUSEKEEPING_MAGIC );
+			      HOUSEKEEPING_MAGIC);
 			return BOOL_FALSE;
 		}
-		if ( persp->v.housekeeping_version != HOUSEKEEPING_VERSION ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (persp->v.housekeeping_version != HOUSEKEEPING_VERSION) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "%s format version differs from previous "
 			      "restore (%u, expected %u)\n"),
 			      hkdirname,
 			      persp->v.housekeeping_version,
-			      HOUSEKEEPING_VERSION );
+			      HOUSEKEEPING_VERSION);
 			return BOOL_FALSE;
 		}
-		if ( persp->v.pagesize != pgsz ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (persp->v.pagesize != pgsz) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "%s format differs from previous "
 			      "restore due to page size change "
 			      "(was %lu, now %lu)\n"),
 			      hkdirname,
 			      persp->v.pagesize,
-			      pgsz );
+			      pgsz);
 			return BOOL_FALSE;
 		}
 	}
 
-	if ( ! persp->a.valpr ) {
-		if ( ! dstdir ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
-			      "destination directory not specified\n") );
-			usage( );
+	if (! persp->a.valpr) {
+		if (! dstdir) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
+			      "destination directory not specified\n"));
+			usage();
 			return BOOL_FALSE;
 		}
-		if ( strlen( dstdir ) >= sizeofmember( pers_t, a.dstdir )) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (strlen(dstdir) >= sizeofmember(pers_t, a.dstdir)) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "destination directory pathname too long: "
 			      "max is %d characters\n"),
-			      sizeofmember( pers_t, a.dstdir ) - 1 );
-			usage( );
+			      sizeofmember(pers_t, a.dstdir) - 1);
+			usage();
 			return BOOL_FALSE;
 		}
-		if ( resumepr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (resumepr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c option invalid: there is no "
 			      "interrupted restore to resume\n"),
-			      GETOPT_RESUME );
-			usage( );
+			      GETOPT_RESUME);
+			usage();
 			return BOOL_FALSE;
 		}
-		if ( sesscpltpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (sesscpltpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c option invalid: there is no "
 			      "interrupted restore to force completion of\n"),
-			      GETOPT_SESSCPLT );
-			usage( );
+			      GETOPT_SESSCPLT);
+			usage();
 			return BOOL_FALSE;
 		}
-	} else if ( ! persp->s.valpr ) {
-		if ( ! cumpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	} else if (! persp->s.valpr) {
+		if (! cumpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "must rm -rf %s prior to noncumulative restore\n"),
-			      tranp->t_hkdir );
+			      tranp->t_hkdir);
 			return BOOL_FALSE;
 		}
-		if ( resumepr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (resumepr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c option invalid: there is no "
 			      "interrupted restore to resume\n"),
-			      GETOPT_RESUME );
-			usage( );
+			      GETOPT_RESUME);
+			usage();
 			return BOOL_FALSE;
 		}
-		if ( sesscpltpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (sesscpltpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c option invalid: there is no "
 			      "interrupted restore to force completion of\n"),
-			      GETOPT_SESSCPLT );
-			usage( );
+			      GETOPT_SESSCPLT);
+			usage();
 			return BOOL_FALSE;
 		}
-		if ( existpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (existpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating "
 			      "cumulative restore\n"),
-			      GETOPT_EXISTING );
+			      GETOPT_EXISTING);
 			return BOOL_FALSE;
 		}
-		if ( newerpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (newerpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating "
 			      "cumulative restore\n"),
-			      GETOPT_NEWER );
+			      GETOPT_NEWER);
 			return BOOL_FALSE;
 		}
-		if ( changepr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (changepr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating "
 			      "cumulative restore\n"),
-			      GETOPT_CHANGED );
+			      GETOPT_CHANGED);
 			return BOOL_FALSE;
 		}
-		if ( ownerpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (ownerpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating "
 			      "cumulative restore\n"),
-			      GETOPT_OWNER );
+			      GETOPT_OWNER);
 			return BOOL_FALSE;
 		}
-		if ( stcnt ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (stcnt) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c and -%c valid only when initiating "
 			      "cumulative restore\n"),
 			      GETOPT_SUBTREE,
-			      GETOPT_NOSUBTREE );
+			      GETOPT_NOSUBTREE);
 			return BOOL_FALSE;
 		}
-		if ( tranp->t_truncategenpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (tranp->t_truncategenpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating "
 			      "cumulative restore\n"),
-			      GETOPT_FMT2COMPAT );
+			      GETOPT_FMT2COMPAT);
 			return BOOL_FALSE;
 		}
 	} else {
-		if ( ! resumepr && ! sesscpltpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (! resumepr && ! sesscpltpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c option required to resume "
 			      "or "
 			      "-%c option required to force completion of "
 			      "previously "
 			      "interrupted restore session\n"),
 			      GETOPT_RESUME,
-			      GETOPT_SESSCPLT );
+			      GETOPT_SESSCPLT);
 			return BOOL_FALSE;
 		}
-		if ( tranp->t_reqdumplabvalpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (tranp->t_reqdumplabvalpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_DUMPLABEL );
+			      GETOPT_DUMPLABEL);
 			return BOOL_FALSE;
 		}
-		if ( tranp->t_reqdumpidvalpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (tranp->t_reqdumpidvalpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_SESSIONID );
+			      GETOPT_SESSIONID);
 			return BOOL_FALSE;
 		}
-		if ( existpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (existpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_EXISTING );
+			      GETOPT_EXISTING);
 			return BOOL_FALSE;
 		}
-		if ( newerpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (newerpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_NEWER );
+			      GETOPT_NEWER);
 			return BOOL_FALSE;
 		}
-		if ( changepr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (changepr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_CHANGED );
+			      GETOPT_CHANGED);
 			return BOOL_FALSE;
 		}
-		if ( ownerpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (ownerpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_OWNER );
+			      GETOPT_OWNER);
 			return BOOL_FALSE;
 		}
-		if ( interpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (interpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_INTERACTIVE );
+			      GETOPT_INTERACTIVE);
 			return BOOL_FALSE;
 		}
-		if ( stcnt ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (stcnt) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			     "-%c and -%c valid only when initiating restore\n"),
 			      GETOPT_SUBTREE,
-			      GETOPT_NOSUBTREE );
+			      GETOPT_NOSUBTREE);
 			return BOOL_FALSE;
 		}
-		if ( tranp->t_truncategenpr ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (tranp->t_truncategenpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "-%c valid only when initiating restore\n"),
-			      GETOPT_FMT2COMPAT );
+			      GETOPT_FMT2COMPAT);
 			return BOOL_FALSE;
 		}
 	}
 
-	if ( persp->a.valpr ) {
-		if ( restoredmpr && persp->a.restoredmpr != restoredmpr) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (persp->a.valpr) {
+		if (restoredmpr && persp->a.restoredmpr != restoredmpr) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			     "-%c cannot reset flag from previous restore\n"),
-			      GETOPT_SETDM );
+			      GETOPT_SETDM);
 			return BOOL_FALSE;
 		}
-		if ( ! restoreextattrpr &&
+		if (! restoreextattrpr &&
 		       persp->a.restoreextattrpr != restoreextattrpr) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			     "-%c cannot reset flag from previous restore\n"),
-			      GETOPT_NOEXTATTR );
+			      GETOPT_NOEXTATTR);
 			return BOOL_FALSE;
 		}
 	}
 
 	/* force owner option if root
 	 */
-	ownerpr = ( geteuid( ) == 0 ) ? BOOL_TRUE : ownerpr;
+	ownerpr = (geteuid() == 0) ? BOOL_TRUE : ownerpr;
 
 	/* force completion of interrupted restore if asked to do so
 	 */
-	if ( sesscpltpr ) {
+	if (sesscpltpr) {
 		char *path1;
 		char *path2;
 		rv_t rv;
 		int rval;
 
-		path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-		assert( path1 );
-		path2 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-		assert( path2 );
-		assert( persp->a.valpr );
-		assert( persp->s.valpr );
-		rval = chdir( persp->a.dstdir );
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _(
+		path1 = (char *)calloc(1, 2 * MAXPATHLEN);
+		assert(path1);
+		path2 = (char *)calloc(1, 2 * MAXPATHLEN);
+		assert(path2);
+		assert(persp->a.valpr);
+		assert(persp->s.valpr);
+		rval = chdir(persp->a.dstdir);
+		if (rval) {
+			mlog(MLOG_NORMAL, _(
 			      "chdir %s failed: %s\n"),
 			      persp->a.dstdir,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
-		ok = dirattr_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
-		if ( ! ok ) {
+		ok = dirattr_init(tranp->t_hkdir, BOOL_TRUE, (uint64_t)0);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
-		ok = namreg_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
-		if ( ! ok ) {
+		ok = namreg_init(tranp->t_hkdir, BOOL_TRUE, (uint64_t)0);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
-		ok = inomap_sync_pers( tranp->t_hkdir );
-		if ( ! ok ) {
+		ok = inomap_sync_pers(tranp->t_hkdir);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 
@@ -1637,18 +1637,18 @@
 			fullpr = BOOL_FALSE;
 		}
 
-		ok = tree_sync( tranp->t_hkdir,
+		ok = tree_sync(tranp->t_hkdir,
 				persp->a.dstdir,
 				tranp->t_toconlypr,
 				fullpr,
-				persp->a.dstdirisxfspr );
-		if ( ! ok ) {
+				persp->a.dstdirisxfspr);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
-		rv = finalize( path1, path2 );
-		free( ( void * )path1 );
-		free( ( void * )path2 );
-		switch ( rv ) {
+		rv = finalize(path1, path2);
+		free((void *)path1);
+		free((void *)path2);
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_ERROR:
@@ -1664,78 +1664,78 @@
 	/* for the three cases, calculate old and new mapping params
 	 * and wipe partial state
 	 */
-	if ( ! persp->a.valpr ) {
+	if (! persp->a.valpr) {
 		stpgcnt = 0;
-		newstpgcnt = ( stsz + pgmask ) / pgsz;
+		newstpgcnt = (stsz + pgmask) / pgsz;
 		descpgcnt = 0;
-		memset( ( void * )&persp->a, 0,
-			sizeof( pers_t ) - offsetofmember( pers_t, a ));
-	} else if ( ! persp->s.valpr ) {
+		memset((void *)&persp->a, 0,
+			sizeof(pers_t) - offsetofmember(pers_t, a));
+	} else if (! persp->s.valpr) {
 		stpgcnt = persp->a.stpgcnt;
 		newstpgcnt = stpgcnt;
 		descpgcnt = 0;
-		memset( ( void * )&persp->s, 0, sizeofmember( pers_t, s ));
+		memset((void *)&persp->s, 0, sizeofmember(pers_t, s));
 	} else {
 		stpgcnt = persp->a.stpgcnt;
 		newstpgcnt = stpgcnt;
 		descpgcnt = persp->s.descpgcnt;
-		assert( resumepr );
-		mlog( MLOG_VERBOSE, _(
+		assert(resumepr);
+		mlog(MLOG_VERBOSE, _(
 		      "resuming restore previously begun %s\n"),
-		      ctimennl( &persp->s.begintime ));
-		persp->s.begintime = time( 0 );
+		      ctimennl(&persp->s.begintime));
+		persp->s.begintime = time(0);
 	}
 
 	/* unmap temp mapping of hdr, truncate, and remap hdr/subtrees
 	 */
-	rval = munmap( ( void * )persp, perssz );
-	assert( ! rval );
-	rval = ftruncate( tranp->t_persfd, ( off_t )perssz
+	rval = munmap((void *)persp, perssz);
+	assert(! rval);
+	rval = ftruncate(tranp->t_persfd, (off_t)perssz
 					   +
-					   ( off_t )( stpgcnt + descpgcnt )
+					   (off_t)(stpgcnt + descpgcnt)
 					   *
-					   ( off_t )pgsz );
-	assert( ! rval );
+					   (off_t)pgsz);
+	assert(! rval);
 	stpgcnt = newstpgcnt;
-	persp = ( pers_t * ) mmap_autogrow( perssz + stpgcnt * pgsz,
+	persp = (pers_t *) mmap_autogrow(perssz + stpgcnt * pgsz,
 				   tranp->t_persfd, 0);
-	if ( persp == ( pers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (persp == (pers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "could not map persistent state file %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* if first restore session, record cmd line args and subtrees
 	 * and start time.
 	 */
-	if ( ! persp->a.valpr ) {
+	if (! persp->a.valpr) {
 		stdesc_t *stdescp;
 
-		strcpy( persp->a.dstdir, dstdir );
-		persp->a.dstdirisxfspr = platform_test_xfs_path( dstdir );
-		if ( cumpr ) {
+		strcpy(persp->a.dstdir, dstdir);
+		persp->a.dstdirisxfspr = platform_test_xfs_path(dstdir);
+		if (cumpr) {
 			persp->a.cumpr = cumpr;
 		}
-		if ( interpr ) {
+		if (interpr) {
 			persp->a.interpr = interpr;
 		}
-		if ( existpr ) {
+		if (existpr) {
 			persp->a.existpr = existpr;
 		}
-		if ( changepr ) {
+		if (changepr) {
 			persp->a.changepr = changepr;
 		}
-		if ( ownerpr ) {
+		if (ownerpr) {
 			persp->a.ownerpr = ownerpr;
 		}
-		if ( newerpr ) {
+		if (newerpr) {
 			persp->a.newerpr = newerpr;
 			persp->a.newertime = newertime;
 		}
 		persp->a.restoredmpr = restoredmpr;
-		if ( ! persp->a.dstdirisxfspr ) {
+		if (! persp->a.dstdirisxfspr) {
 			restoreextattrpr = BOOL_FALSE;
 		}
 		persp->a.restoreextattrpr = restoreextattrpr;
@@ -1745,40 +1745,40 @@
 		persp->a.stpgcnt = stpgcnt;
 		optind = 1;
 		opterr = 0;
-		stdescp = ( stdesc_t * )( ( char * )persp + perssz );
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
+		stdescp = (stdesc_t *)((char *)persp + perssz);
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 			size_t stdsz;
-			switch ( c ) {
+			switch (c) {
 			case GETOPT_SUBTREE:
 			case GETOPT_NOSUBTREE:
-				stdescp->std_sensepr = ( c == GETOPT_SUBTREE )
+				stdescp->std_sensepr = (c == GETOPT_SUBTREE)
 						       ?
 						       BOOL_TRUE
 						       :
 						       BOOL_FALSE;
-				stdsz = sizeof( stdesc_t )
+				stdsz = sizeof(stdesc_t)
 					+
-					strlen( optarg )
+					strlen(optarg)
 					+
-					( STDESCALIGN - 1 );
-				stdsz &= ~( STDESCALIGN - 1 );
-				assert( stdsz <= ( size_t )OFFMAX );
-				stdescp->std_nextoff = ( off_t )stdsz;
-				strcpy( stdescp->std_path, optarg );
-				stdescp = ( stdesc_t * )
-					  ( ( char * )stdescp + stdsz );
+					(STDESCALIGN - 1);
+				stdsz &= ~(STDESCALIGN - 1);
+				assert(stdsz <= (size_t)OFFMAX);
+				stdescp->std_nextoff = (off_t)stdsz;
+				strcpy(stdescp->std_path, optarg);
+				stdescp = (stdesc_t *)
+					  ((char *)stdescp + stdsz);
 				stcnt--;
 				break;
 			}
 		}
-		assert( stcnt == 0 );
+		assert(stcnt == 0);
 	}
 
 	/* initialize the local extattr abstraction. must be done even if
 	 * we don't intend to restore extended attributes
 	 */
-	ok = extattr_init( drivecnt );
-	if ( ! ok ) {
+	ok = extattr_init(drivecnt);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
@@ -1787,16 +1787,16 @@
 	 * before any open_by_handle() calls (and possibly other
 	 * libhandle calls).
 	 */
-	if ( persp->a.dstdirisxfspr ) {
+	if (persp->a.dstdirisxfspr) {
 		void	*fshanp;
 		size_t	fshlen=0;
 
 		if(path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) {
-			mlog( MLOG_NORMAL,
+			mlog(MLOG_NORMAL,
 				_("unable to construct a file "
 				  "system handle for %s: %s\n"),
 				persp->a.dstdir,
-				strerror( errno ));
+				strerror(errno));
 			return BOOL_FALSE;
 		}
 		/* libhandle has it cached, release this copy */
@@ -1807,32 +1807,32 @@
 	 * referenced ONLY via the macros provided; the descriptors will be
 	 * occasionally remapped, causing the ptr to change.
 	 */
-	assert( ! descp );
-	if ( descpgcnt ) {
-		descp = ( pers_desc_t * ) mmap_autogrow( descpgcnt * pgsz,
+	assert(! descp);
+	if (descpgcnt) {
+		descp = (pers_desc_t *) mmap_autogrow(descpgcnt * pgsz,
 						tranp->t_persfd,
-						( off_t )perssz
+						(off_t)perssz
 						+
-						( off_t )( stpgcnt * pgsz ));
-		if ( descp == ( pers_desc_t * )-1 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+						(off_t)(stpgcnt * pgsz));
+		if (descp == (pers_desc_t *)-1) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not map persistent state file inv %s: "
 			      "%s (%d)\n"),
 			      perspath,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			descp = 0;
 			return BOOL_FALSE;
 		}
-		pi_preclean( );
+		pi_preclean();
 	}
 
 	/* if resuming an interrupted restore, indicate we know the id
 	 * of the dump session being restored. otherwise, it will be determined
 	 * during coordination of per-drive threads.
 	 */
-	if ( persp->a.valpr && persp->s.valpr ) {
-		persp->s.begintime = time( 0 );
+	if (persp->a.valpr && persp->s.valpr) {
+		persp->s.begintime = time(0);
 		tranp->t_dumpidknwnpr = BOOL_TRUE;
 	}
 
@@ -1840,9 +1840,9 @@
 	 * starts fresh with each dump session restored.
 	 * determine if full init needed instead.
 	 */
-	if ( persp->a.valpr && persp->s.valpr ) {
-		ok = dirattr_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
-		if ( ! ok ) {
+	if (persp->a.valpr && persp->s.valpr) {
+		ok = dirattr_init(tranp->t_hkdir, BOOL_TRUE, (uint64_t)0);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 		tranp->t_dirattrinitdonepr = BOOL_TRUE;
@@ -1852,9 +1852,9 @@
 	 * first session, retained by subsequent sessions.
 	 * determine if full init needed instead.
 	 */
-	if ( persp->a.valpr ) {
-		ok = namreg_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
-		if ( ! ok ) {
+	if (persp->a.valpr) {
+		ok = namreg_init(tranp->t_hkdir, BOOL_TRUE, (uint64_t)0);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 		tranp->t_namreginitdonepr = BOOL_TRUE;
@@ -1864,17 +1864,17 @@
 	 * restore session, but persistent after tree updated with dirdump.
 	 * determine if full init needed instead.
 	 */
-	ok = inomap_sync_pers( tranp->t_hkdir );
-	if ( ! ok ) {
+	ok = inomap_sync_pers(tranp->t_hkdir);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
 	/* sync up with the tree abstraction. created by the
 	 * first session, retained by subsequent sessions.
-	 * don't call tree_init( ) from here; can only be called
+	 * don't call tree_init() from here; can only be called
 	 * when a valid media file header is at hand.
 	 */
-	if ( persp->a.valpr ) {
+	if (persp->a.valpr) {
 		/* This is only a full restore if we're doing a level
 		 * 0 restore.
 		 */
@@ -1884,12 +1884,12 @@
 			fullpr = BOOL_FALSE;
 		}
 
-		ok = tree_sync( tranp->t_hkdir,
+		ok = tree_sync(tranp->t_hkdir,
 				persp->a.dstdir,
 				tranp->t_toconlypr,
 				fullpr,
-				persp->a.dstdirisxfspr );
-		if ( ! ok ) {
+				persp->a.dstdirisxfspr);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 		tranp->t_treeinitdonepr = BOOL_TRUE;
@@ -1899,23 +1899,23 @@
 	 */
 	{
 		ix_t ix;
-		ix_t endix = sizeof( mcflag )
+		ix_t endix = sizeof(mcflag)
 			     /
-			     sizeof( mcflag[ 0 ] );
-		for ( ix = 0 ; ix < endix ; ix++ ) {
-			mcflag[ ix ] = BOOL_FALSE;
+			     sizeof(mcflag[0]);
+		for (ix = 0 ; ix < endix ; ix++) {
+			mcflag[ix] = BOOL_FALSE;
 		}
 	}
 	content_media_change_needed = BOOL_FALSE;
 
-	pi_show( " at initialization" );
+	pi_show(" at initialization");
 	return BOOL_TRUE;
 }
 
 /* stream thread entry point - returns exit code
  */
 int
-content_stream_restore( ix_t thrdix )
+content_stream_restore(ix_t thrdix)
 {
 	dh_t fileh;
 	Media_t *Mediap; /* local media abstraction */
@@ -1937,42 +1937,42 @@
 
 	/* allocate two path buffers
 	 */
-	path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-	assert( path1 );
-	path2 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-	assert( path2 );
+	path1 = (char *)calloc(1, 2 * MAXPATHLEN);
+	assert(path1);
+	path2 = (char *)calloc(1, 2 * MAXPATHLEN);
+	assert(path2);
 
 	/* set the current directory to dstdir. the tree abstraction
 	 * depends on the current directory being the root of the
 	 * destination file system.
 	 */
-	rval = chdir( persp->a.dstdir );
-	if ( rval ) {
-		mlog( MLOG_NORMAL, _(
+	rval = chdir(persp->a.dstdir);
+	if (rval) {
+		mlog(MLOG_NORMAL, _(
 		      "chdir %s failed: %s\n"),
 		      persp->a.dstdir,
-		      strerror( errno ));
+		      strerror(errno));
 		return mlog_exit(EXIT_ERROR, RV_ERROR);
 	}
 
 	/* set my file creation mask to zero, to avoid modifying the
 	 * dumped mode bits
 	 */
-	( void )umask( 0 );
+	(void)umask(0);
 
 	/* initialize the Media abstraction
 	 */
-	Mediap = Media_create( thrdix );
+	Mediap = Media_create(thrdix);
 
 	/*
 	 * initialize the stream context
 	 */
 	strctxp = (stream_context_t *)calloc(1, sizeof(stream_context_t));
 	if (!strctxp) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
+		mlog(MLOG_NORMAL | MLOG_ERROR,
 		      _("malloc of stream context failed (%d bytes): %s\n"),
 		      sizeof(stream_context_t),
-		      strerror( errno ));
+		      strerror(errno));
 		return mlog_exit(EXIT_ERROR, RV_ERROR);
 	}
 	strctxp->sc_fd = -1;
@@ -1985,32 +1985,32 @@
 	 * side-effect of validation is to incorporate the online
 	 * inventory into the persistent state.
 	 */
-	if ( tranp->t_dumpidknwnpr ) {
+	if (tranp->t_dumpidknwnpr) {
 		tranp->t_sync1 = SYNC_DONE;
 	}
-	while ( tranp->t_sync1 != SYNC_DONE ) {
-		lock( );
-		if ( tranp->t_sync1 == SYNC_BUSY ) {
-			unlock( );
-			sleep( 1 );
-			if ( cldmgr_stop_requested( )) {
+	while (tranp->t_sync1 != SYNC_DONE) {
+		lock();
+		if (tranp->t_sync1 == SYNC_BUSY) {
+			unlock();
+			sleep(1);
+			if (cldmgr_stop_requested()) {
 				return mlog_exit(EXIT_NORMAL, RV_INTR);
 			}
 			continue;
 		}
-		if ( tranp->t_sync1 == SYNC_DONE ) {
-			unlock( );
+		if (tranp->t_sync1 == SYNC_DONE) {
+			unlock();
 			continue;
 		}
 		tranp->t_sync1 = SYNC_BUSY;
-		unlock( );
-		mlog( MLOG_DEBUG,
-		      "checking and validating command line dump id/label\n" );
-		ok = Inv_validate_cmdline( );
+		unlock();
+		mlog(MLOG_DEBUG,
+		      "checking and validating command line dump id/label\n");
+		ok = Inv_validate_cmdline();
 		    /* side-effect - searches for and incorporates online inv
 		     * into pi, and makes persp->s.dumpid valid.
 		     */
-		if ( ok == BOOL_ERROR ) {
+		if (ok == BOOL_ERROR) {
 			return mlog_exit(EXIT_ERROR, RV_OPT);
 		}
 		tranp->t_dumpidknwnpr = ok;
@@ -2022,22 +2022,22 @@
 	 * until the operator selects a media file from the desired
 	 * dump.
 	 */
-	if ( tranp->t_dumpidknwnpr ) {
+	if (tranp->t_dumpidknwnpr) {
 		tranp->t_sync2 = SYNC_DONE;
 	}
 	uuid_clear(lastdumprejectedid);
-	if ( tranp->t_sync2 != SYNC_DONE ) {
-		mlog( MLOG_VERBOSE, _(
-		      "searching media for dump\n") );
+	if (tranp->t_sync2 != SYNC_DONE) {
+		mlog(MLOG_VERBOSE, _(
+		      "searching media for dump\n"));
 	}
-	while ( tranp->t_sync2 != SYNC_DONE ) {
+	while (tranp->t_sync2 != SYNC_DONE) {
 		bool_t matchpr;
 		inv_session_t *sessp;
 		bool_t resumepr;
 		ix_t level;
 		uuid_t *baseidp;
 
-		rv = Media_mfile_next( Mediap,
+		rv = Media_mfile_next(Mediap,
 				       PURP_SEARCH,
 				       &tranp->t_sync2,
 				       0,
@@ -2047,8 +2047,8 @@
 				       &crhdrp,
 				       &scrhdrp,
 				       &drivep,
-				       &fhdr );
-		switch ( rv ) {
+				       &fhdr);
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_DONE:
@@ -2057,158 +2057,158 @@
 		case RV_INTR:
 		case RV_QUIT:
 		case RV_DRIVE:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_NORMAL, rv);
 		case RV_CORE:
 		default:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 		dcaps = drivep->d_capabilities;
 
-		lock( );
-		while ( tranp->t_sync2 == SYNC_BUSY ) {
-			unlock( );
-			sleep( 1 );
-			if ( cldmgr_stop_requested( )) {
-				Media_end( Mediap );
+		lock();
+		while (tranp->t_sync2 == SYNC_BUSY) {
+			unlock();
+			sleep(1);
+			if (cldmgr_stop_requested()) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_NORMAL, RV_INTR);
 			}
-			lock( );
+			lock();
 		}
-		if ( tranp->t_sync2 == SYNC_DONE ) {
-			unlock( );
+		if (tranp->t_sync2 == SYNC_DONE) {
+			unlock();
 			continue;
 		}
 		tranp->t_sync2 = SYNC_BUSY;
 
-		unlock( );
-		mlog( MLOG_DEBUG,
-		      "dump found: checking\n" );
+		unlock();
+		mlog(MLOG_DEBUG,
+		      "dump found: checking\n");
 		matchpr = BOOL_FALSE;
-		resumepr = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_RESUME );
-		assert( scrhdrp->cih_level >= 0 );
-		level = ( ix_t )scrhdrp->cih_level;
+		resumepr = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_RESUME);
+		assert(scrhdrp->cih_level >= 0);
+		level = (ix_t)scrhdrp->cih_level;
 		baseidp = resumepr
 			  ?
 			  &scrhdrp->cih_resume_id
 			  :
 			  &scrhdrp->cih_last_id;
-		if ( tranp->t_reqdumpidvalpr ) {
-			if ( uuid_compare( tranp->t_reqdumpid,
+		if (tranp->t_reqdumpidvalpr) {
+			if (uuid_compare(tranp->t_reqdumpid,
 					 grhdrp->gh_dumpid) == 0) {
 				matchpr = BOOL_TRUE;
-				display_dump_label( BOOL_TRUE, /* lock */
+				display_dump_label(BOOL_TRUE, /* lock */
 						    MLOG_VERBOSE, _(
 						    "found dump matching "
 						    "specified id:\n"),
 						    grhdrp,
 						    mrhdrp,
 						    crhdrp,
-						    scrhdrp );
+						    scrhdrp);
 			}
-		} else if ( tranp->t_reqdumplabvalpr ) {
-			if ( ! strncmp( tranp->t_reqdumplab,
+		} else if (tranp->t_reqdumplabvalpr) {
+			if (! strncmp(tranp->t_reqdumplab,
 					grhdrp->gh_dumplabel,
-					sizeof( grhdrp->gh_dumplabel ))) {
+					sizeof(grhdrp->gh_dumplabel))) {
 				matchpr = BOOL_TRUE;
-				display_dump_label( BOOL_TRUE, /* lock */
+				display_dump_label(BOOL_TRUE, /* lock */
 						    MLOG_VERBOSE,  _(
 						    "found dump matching "
 						    "specified label:\n"),
 						    grhdrp,
 						    mrhdrp,
 						    crhdrp,
-						    scrhdrp );
+						    scrhdrp);
 			}
-		} else if ( dumpcompat( resumepr,
+		} else if (dumpcompat(resumepr,
 					level,
 					*baseidp,
-					BOOL_FALSE )) {
-			if ( uuid_compare( lastdumprejectedid,
+					BOOL_FALSE)) {
+			if (uuid_compare(lastdumprejectedid,
 					 grhdrp->gh_dumpid) == 0) {
 				matchpr = BOOL_FALSE;
 			} else {
-				if ( dlog_allowed( )
+				if (dlog_allowed()
 				     &&
-				     ( ( dcaps & DRIVE_CAP_FILES )
+				     ((dcaps & DRIVE_CAP_FILES)
 				       ||
-				       ( dcaps & DRIVE_CAP_REMOVABLE )
+				       (dcaps & DRIVE_CAP_REMOVABLE)
 				       ||
-				       drivecnt > 1 )) {
-					matchpr = promptdumpmatch( thrdix,
+				       drivecnt > 1)) {
+					matchpr = promptdumpmatch(thrdix,
 								   grhdrp,
 								   mrhdrp,
 								   crhdrp,
-								   scrhdrp );
+								   scrhdrp);
 				} else {
 					matchpr = BOOL_TRUE;
-					display_dump_label( BOOL_TRUE,/* lock */
+					display_dump_label(BOOL_TRUE,/* lock */
 							    MLOG_VERBOSE, _(
 							    "dump "
 							    "description: \n"),
 							    grhdrp,
 							    mrhdrp,
 							    crhdrp,
-							    scrhdrp );
+							    scrhdrp);
 				}
 			}
 		}
-		if ( cldmgr_stop_requested( )) {
-			Media_end( Mediap );
+		if (cldmgr_stop_requested()) {
+			Media_end(Mediap);
 			return mlog_exit(EXIT_NORMAL, RV_INTR);
 		}
-		if ( ! matchpr ) {
-			Media_end( Mediap );
+		if (! matchpr) {
+			Media_end(Mediap);
 			uuid_copy(lastdumprejectedid, grhdrp->gh_dumpid);
 			tranp->t_sync2 = SYNC_INIT;
-			if ( ! dlog_allowed( )
+			if (! dlog_allowed()
 			     ||
-			     ( ! ( dcaps & DRIVE_CAP_FILES )
+			     (! (dcaps & DRIVE_CAP_FILES)
 			       &&
-			       ! ( dcaps & DRIVE_CAP_REMOVABLE ))) {
+			       ! (dcaps & DRIVE_CAP_REMOVABLE))) {
 				return mlog_exit(EXIT_NORMAL, RV_QUIT);
 			}
 			continue;
 		}
-		if ( ! dumpcompat( resumepr, level, *baseidp, BOOL_TRUE )) {
-			Media_end( Mediap );
+		if (! dumpcompat(resumepr, level, *baseidp, BOOL_TRUE)) {
+			Media_end(Mediap);
 			return mlog_exit(EXIT_ERROR, RV_COMPAT);
 		}
-		strncpyterm( persp->s.dumplab,
+		strncpyterm(persp->s.dumplab,
 			     grhdrp->gh_dumplabel,
-			     sizeof( persp->s.dumplab ));
+			     sizeof(persp->s.dumplab));
 		sessp = 0;
 
 		/* don't look at the online inventory if the input is piped
 		 */
-		if ( ! drivep->d_isnamedpipepr
+		if (! drivep->d_isnamedpipepr
 		     &&
-		     ! drivep->d_isunnamedpipepr ) {
+		     ! drivep->d_isunnamedpipepr) {
 			ok = inv_get_session_byuuid(NULL,
 						    &grhdrp->gh_dumpid,
 						    &sessp);
-			if ( ok && sessp ) {
-				mlog( MLOG_VERBOSE, _(
-				      "using online session inventory\n") );
-				persp->s.fullinvpr = pi_transcribe( sessp );
-				inv_free_session( &sessp );
+			if (ok && sessp) {
+				mlog(MLOG_VERBOSE, _(
+				      "using online session inventory\n"));
+				persp->s.fullinvpr = pi_transcribe(sessp);
+				inv_free_session(&sessp);
 			}
 		}
-		fileh = pi_addfile( Mediap,
+		fileh = pi_addfile(Mediap,
 				    grhdrp,
 				    drhdrp,
 				    mrhdrp,
 				    scrhdrp,
-				    drivep );
+				    drivep);
 			/* done here because Media_mfile_next doesn't know
 			 * if this is a match
 			 */
-		if ( fileh == DH_NULL ) {
+		if (fileh == DH_NULL) {
 			return mlog_exit(EXIT_FAULT, RV_ERROR);
 		}
 		uuid_copy(persp->s.dumpid,grhdrp->gh_dumpid);
-		persp->s.begintime = time( 0 );
+		persp->s.begintime = time(0);
 		tranp->t_dumpidknwnpr = BOOL_TRUE;
 		tranp->t_sync2 = SYNC_DONE;
 	}
@@ -2216,15 +2216,15 @@
 	/* all drives coordinate in attempt to apply session dir dump.
 	 * only one actually completes.
 	 */
-	if ( persp->s.dirdonepr ) {
+	if (persp->s.dirdonepr) {
 		tranp->t_sync3 = SYNC_DONE;
 	}
-	if ( tranp->t_sync3 != SYNC_DONE ) {
-		mlog( MLOG_VERBOSE, _(
-		      "searching media for directory dump\n") );
+	if (tranp->t_sync3 != SYNC_DONE) {
+		mlog(MLOG_VERBOSE, _(
+		      "searching media for directory dump\n"));
 	}
-	while ( tranp->t_sync3 != SYNC_DONE ) {
-		rv = Media_mfile_next( Mediap,
+	while (tranp->t_sync3 != SYNC_DONE) {
+		rv = Media_mfile_next(Mediap,
 				       PURP_DIR,
 				       &tranp->t_sync3,
 				       &fileh,
@@ -2234,8 +2234,8 @@
 				       &crhdrp,
 				       &scrhdrp,
 				       &drivep,
-				       &fhdr );
-		switch ( rv ) {
+				       &fhdr);
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_DONE:
@@ -2244,117 +2244,117 @@
 		case RV_INTR:
 		case RV_QUIT:
 		case RV_DRIVE:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_NORMAL, rv);
 		case RV_CORE:
 		default:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 		dcaps = drivep->d_capabilities;
-		assert( fileh != DH_NULL );
-		lock( );
-		if ( tranp->t_sync3 == SYNC_BUSY ) {
-			unlock( );
-			mlog( MLOG_TRACE,
-			      "waiting for directories to be restored\n" );
-			lock( );
+		assert(fileh != DH_NULL);
+		lock();
+		if (tranp->t_sync3 == SYNC_BUSY) {
+			unlock();
+			mlog(MLOG_TRACE,
+			      "waiting for directories to be restored\n");
+			lock();
 		}
-		while ( tranp->t_sync3 == SYNC_BUSY ) {
-			unlock( );
+		while (tranp->t_sync3 == SYNC_BUSY) {
+			unlock();
 #if DEBUG_DUMPSTREAMS
 			{
 			    static int count[STREAM_MAX] = {0};
-			    int streamix = stream_getix( pthread_self() );
+			    int streamix = stream_getix(pthread_self());
 			    if (++(count[streamix]) == 30) {
-				mlog( MLOG_TRACE,
+				mlog(MLOG_TRACE,
 					"still waiting for dirs to be restored\n");
 				count[streamix] = 0;
 			    }
 			}
 #endif
-			sleep( 1 );
-			if ( cldmgr_stop_requested( )) {
-				Media_end( Mediap );
+			sleep(1);
+			if (cldmgr_stop_requested()) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_NORMAL, RV_INTR);
 			}
-			lock( );
+			lock();
 		}
-		if ( tranp->t_sync3 == SYNC_DONE ) {
-			unlock( );
+		if (tranp->t_sync3 == SYNC_DONE) {
+			unlock();
 			continue;
 		}
-		if ( !(scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP) ) {
+		if (!(scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP)) {
 			/* if no streams have a directory dump, issue a
 			 * message and exit. first set SYNC_BUSY to prevent
 			 * other threads from coming through here and issuing
 			 * the same message.
 			 */
 			tranp->t_dirdumps &= ~(1ULL << thrdix);
-			if ( !tranp->t_dirdumps ) {
+			if (!tranp->t_dirdumps) {
 				tranp->t_sync3 = SYNC_BUSY;
 			}
-			unlock( );
-			if ( !tranp->t_dirdumps ) {
-				mlog( MLOG_VERBOSE | MLOG_ERROR, _(
-					"no directory dump found\n") );
-				Media_end( Mediap );
+			unlock();
+			if (!tranp->t_dirdumps) {
+				mlog(MLOG_VERBOSE | MLOG_ERROR, _(
+					"no directory dump found\n"));
+				Media_end(Mediap);
 				return mlog_exit(EXIT_NORMAL, RV_ERROR);
 			}
-			sleep( 1 );
-			if ( cldmgr_stop_requested( )) {
-				Media_end( Mediap );
+			sleep(1);
+			if (cldmgr_stop_requested()) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_NORMAL, RV_INTR);
 			}
 			continue;
 		}
 		tranp->t_sync3 = SYNC_BUSY;
-		unlock( );
-		if ( ! tranp->t_dirattrinitdonepr ) {
-			mlog( MLOG_TRACE,
-			      "initializing directory attributes registry\n" );
-			mlog( MLOG_NITTY,
+		unlock();
+		if (! tranp->t_dirattrinitdonepr) {
+			mlog(MLOG_TRACE,
+			      "initializing directory attributes registry\n");
+			mlog(MLOG_NITTY,
 			      "content_stream_restore: dircnt %llu\n",
-			      scrhdrp->cih_inomap_dircnt );
-			ok = dirattr_init( tranp->t_hkdir,
+			      scrhdrp->cih_inomap_dircnt);
+			ok = dirattr_init(tranp->t_hkdir,
 					   BOOL_FALSE,
-					   scrhdrp->cih_inomap_dircnt );
-			if ( ! ok ) {
-				Media_end( Mediap );
+					   scrhdrp->cih_inomap_dircnt);
+			if (! ok) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_ERROR, RV_ERROR);
 			}
 			tranp->t_dirattrinitdonepr = BOOL_TRUE;
 		}
 
-		if ( ! tranp->t_namreginitdonepr ) {
-			mlog( MLOG_TRACE,
-			      "initializing directory entry name registry\n" );
-			ok = namreg_init( tranp->t_hkdir,
+		if (! tranp->t_namreginitdonepr) {
+			mlog(MLOG_TRACE,
+			      "initializing directory entry name registry\n");
+			ok = namreg_init(tranp->t_hkdir,
 					  BOOL_FALSE,
 					  scrhdrp->cih_inomap_dircnt
 					  +
-					  scrhdrp->cih_inomap_nondircnt );
-			if ( ! ok ) {
-				Media_end( Mediap );
+					  scrhdrp->cih_inomap_nondircnt);
+			if (! ok) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_ERROR, RV_ERROR);
 			}
 			tranp->t_namreginitdonepr = BOOL_TRUE;
 		}
 
-		if ( ! tranp->t_treeinitdonepr ) {
+		if (! tranp->t_treeinitdonepr) {
 			bool_t fullpr;
 
-			fullpr = ( scrhdrp->cih_level
+			fullpr = (scrhdrp->cih_level
 				   ==
-				   0 )
+				   0)
 				 &&
-				 ! ( scrhdrp->cih_dumpattr
+				 ! (scrhdrp->cih_dumpattr
 				    &
-				    CIH_DUMPATTR_RESUME );
+				    CIH_DUMPATTR_RESUME);
 
-			mlog( MLOG_TRACE,
-			      "initializing directory hierarchy image\n" );
-			ok = tree_init( tranp->t_hkdir,
+			mlog(MLOG_TRACE,
+			      "initializing directory hierarchy image\n");
+			ok = tree_init(tranp->t_hkdir,
 					persp->a.dstdir,
 					tranp->t_toconlypr,
 					persp->a.ownerpr,
@@ -2368,17 +2368,17 @@
 					persp->a.restoredmpr,
 					persp->a.dstdirisxfspr,
 					grhdrp->gh_version,
-					tranp->t_truncategenpr );
-			if ( ! ok ) {
-				Media_end( Mediap );
+					tranp->t_truncategenpr);
+			if (! ok) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_ERROR, RV_ERROR);
 			}
 			tranp->t_treeinitdonepr = BOOL_TRUE;
 
 		} else {
-			ok = tree_check_dump_format( grhdrp->gh_version );
-			if ( ! ok ) {
-				Media_end( Mediap );
+			ok = tree_check_dump_format(grhdrp->gh_version);
+			if (! ok) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_ERROR, RV_ERROR);
 			}
 		}
@@ -2388,31 +2388,31 @@
 		persp->s.valpr = BOOL_TRUE;
 		persp->a.valpr = BOOL_TRUE;
 
-		mlog( MLOG_VERBOSE, _(
-		      "reading directories\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "reading directories\n"));
 		win_locks_off(); /* we are single threaded here */
-		rv = applydirdump( drivep, fileh, scrhdrp, &fhdr );
+		rv = applydirdump(drivep, fileh, scrhdrp, &fhdr);
 		win_locks_on();
-		mlog( MLOG_TRACE,
+		mlog(MLOG_TRACE,
 		      "number of mmap calls for windows = %lu\n", win_getnum_mmaps());
-		switch ( rv ) {
+		switch (rv) {
 		case RV_OK:
-			DH2F( fileh )->f_dirtriedpr = BOOL_TRUE;
-			Media_atnondir( Mediap );
+			DH2F(fileh)->f_dirtriedpr = BOOL_TRUE;
+			Media_atnondir(Mediap);
 			tranp->t_sync3 = SYNC_DONE;
 			break;
 		case RV_CORRUPT:
-			Media_indir( Mediap );
-			DH2F( fileh )->f_dirtriedpr = BOOL_TRUE;
+			Media_indir(Mediap);
+			DH2F(fileh)->f_dirtriedpr = BOOL_TRUE;
 			tranp->t_sync3 = SYNC_INIT;
 			break;
 		case RV_INTR:
 		case RV_DRIVE:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_NORMAL, rv);
 		case RV_CORE:
 		default:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 	}
@@ -2420,61 +2420,61 @@
 	/* now let one thread do all tree post-processing prior to
 	 * non-dir restore
 	 */
-	if ( persp->s.treepostdonepr ) {
+	if (persp->s.treepostdonepr) {
 		tranp->t_sync4 = SYNC_DONE;
 	}
-	while ( tranp->t_sync4 != SYNC_DONE ) {
-		lock( );
-		if ( tranp->t_sync4 == SYNC_BUSY ) {
-			unlock( );
-			mlog( MLOG_TRACE,
+	while (tranp->t_sync4 != SYNC_DONE) {
+		lock();
+		if (tranp->t_sync4 == SYNC_BUSY) {
+			unlock();
+			mlog(MLOG_TRACE,
 			      "waiting for directory post-processing "
-			      "to complete\n" );
-			lock( );
+			      "to complete\n");
+			lock();
 		}
-		while ( tranp->t_sync4 == SYNC_BUSY ) {
-			unlock( );
+		while (tranp->t_sync4 == SYNC_BUSY) {
+			unlock();
 #if DEBUG_DUMPSTREAMS
 			{
 			static int count[STREAM_MAX] = {0};
-			int streamix = stream_getix( pthread_self() );
+			int streamix = stream_getix(pthread_self());
 			    if (++(count[streamix]) == 30) {
-				mlog( MLOG_NORMAL,
+				mlog(MLOG_NORMAL,
 				      "still waiting for dirs post-processing\n");
 				count[streamix] = 0;
 			    }
 			}
 #endif
-			sleep( 1 );
-			if ( cldmgr_stop_requested( )) {
-				Media_end( Mediap );
+			sleep(1);
+			if (cldmgr_stop_requested()) {
+				Media_end(Mediap);
 				return mlog_exit(EXIT_NORMAL, RV_INTR);
 			}
-			lock( );
+			lock();
 		}
-		if ( tranp->t_sync4 == SYNC_DONE ) {
-			unlock( );
+		if (tranp->t_sync4 == SYNC_DONE) {
+			unlock();
 			continue;
 		}
 		tranp->t_sync4 = SYNC_BUSY;
-		unlock( );
-		mlog( MLOG_VERBOSE, _(
-		      "directory post-processing\n") );
+		unlock();
+		mlog(MLOG_VERBOSE, _(
+		      "directory post-processing\n"));
 		win_locks_off(); /* we are single threaded here */
-		rv = treepost( path1, path2 );
+		rv = treepost(path1, path2);
 		win_locks_on();
-		switch ( rv ) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_ERROR:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_ERROR, RV_ERROR);
 		case RV_INTR:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_INTERRUPT, RV_INTR);
 		case RV_CORE:
 		default:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
@@ -2486,12 +2486,12 @@
 		{
 		bool_t dummyknownholespr;
 		bool_t dummymaybeholespr;
-		bag_t *bagp = pi_neededobjs_nondir_alloc( &dummyknownholespr,
+		bag_t *bagp = pi_neededobjs_nondir_alloc(&dummyknownholespr,
 							  &dummymaybeholespr,
 							  BOOL_FALSE,
-							  BOOL_TRUE );
-		if ( bagp ) {
-			pi_neededobjs_free( bagp );
+							  BOOL_TRUE);
+		if (bagp) {
+			pi_neededobjs_free(bagp);
 			bagp = 0;
 		}
 		}
@@ -2505,9 +2505,9 @@
 	 * apply media files until there are no more, or we are interrupted
 	 */
 	for (;;) {
-		mlog( MLOG_DEBUG,
-		      "getting next media file for non-dir restore\n" );
-		rv = Media_mfile_next( Mediap,
+		mlog(MLOG_DEBUG,
+		      "getting next media file for non-dir restore\n");
+		rv = Media_mfile_next(Mediap,
 				       PURP_NONDIR,
 				       0,
 				       &fileh,
@@ -2517,64 +2517,64 @@
 				       &crhdrp,
 				       &scrhdrp,
 				       &drivep,
-				       &fhdr );
-		if ( rv == RV_NOMORE ) {
+				       &fhdr);
+		if (rv == RV_NOMORE) {
 			break;
 		}
-		switch ( rv ) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_INTR:
 		case RV_QUIT:
 		case RV_DRIVE:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_NORMAL, rv);
 		case RV_CORE:
 		default:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 		dcaps = drivep->d_capabilities;
-		assert( fileh > DH_NULL );
-		if ( tranp->t_toconlypr ) {
-			mlog( MLOG_VERBOSE, _(
-			      "reading non-directory files\n") );
+		assert(fileh > DH_NULL);
+		if (tranp->t_toconlypr) {
+			mlog(MLOG_VERBOSE, _(
+			      "reading non-directory files\n"));
 		} else {
-			mlog( MLOG_VERBOSE, _(
-			      "restoring non-directory files\n") );
+			mlog(MLOG_VERBOSE, _(
+			      "restoring non-directory files\n"));
 		}
-		mlog( MLOG_TRACE,
+		mlog(MLOG_TRACE,
 		      "media file %u in "
 		      "object %u "
 		      "of stream %u\n",
 		      mrhdrp->mh_mediafileix,
 		      mrhdrp->mh_mediaix,
-		      drhdrp->dh_driveix );
-		mlog( MLOG_DEBUG,
+		      drhdrp->dh_driveix);
+		mlog(MLOG_DEBUG,
 		      "file %u in stream, "
 		      "file %u in dump %u on object\n",
 		      mrhdrp->mh_dumpfileix,
 		      mrhdrp->mh_dumpmediafileix,
-		      mrhdrp->mh_dumpmediaix );
-		rv = applynondirdump( drivep,
+		      mrhdrp->mh_dumpmediaix);
+		rv = applynondirdump(drivep,
 				      fileh,
 				      scrhdrp,
 				      path1,
 				      path2,
-				      &fhdr );
-		switch ( rv ) {
+				      &fhdr);
+		switch (rv) {
 		case RV_OK:
-			DH2F( fileh )->f_nondirdonepr = BOOL_TRUE;
-			Media_end( Mediap );
+			DH2F(fileh)->f_nondirdonepr = BOOL_TRUE;
+			Media_end(Mediap);
 			break;
 		case RV_INTR:
 		case RV_DRIVE:
 		case RV_INCOMPLETE:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_NORMAL, rv);
 		case RV_CORE:
 		default:
-			Media_end( Mediap );
+			Media_end(Mediap);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 	}
@@ -2583,24 +2583,24 @@
 	 * and cleanup. the winner waits, the losers all exit.
 	 * once the losers exit, the winner can perform cleanup.
 	 */
-	lock( );
-	if ( tranp->t_sync5 == SYNC_BUSY ) {
-		unlock( );
+	lock();
+	if (tranp->t_sync5 == SYNC_BUSY) {
+		unlock();
 		return mlog_exit(EXIT_NORMAL, RV_DONE);
 	}
 	tranp->t_sync5 = SYNC_BUSY;
-	unlock( );
-	if ( drivecnt > 1 ) {
-		mlog( MLOG_TRACE,
-		      "waiting for other streams to exit\n" );
+	unlock();
+	if (drivecnt > 1) {
+		mlog(MLOG_TRACE,
+		      "waiting for other streams to exit\n");
 	}
-	while ( cldmgr_otherstreamsremain( thrdix )) {
-		sleep( 1 );
+	while (cldmgr_otherstreamsremain(thrdix)) {
+		sleep(1);
 	}
 
-	mlog( MLOG_DEBUG,
-	      "tree finalize\n" );
-	rv = finalize( path1, path2 );
+	mlog(MLOG_DEBUG,
+	      "tree finalize\n");
+	rv = finalize(path1, path2);
 	if (rv == RV_OK || rv == RV_INTR) {
 		rval = EXIT_NORMAL;
 	} else if (rv == RV_ERROR) {
@@ -2616,33 +2616,33 @@
  * if interrupted or not.
  */
 bool_t
-content_complete( void )
+content_complete(void)
 {
 	bool_t completepr;
 	time_t elapsed;
 
-	if ( ! persp ) {
+	if (! persp) {
 		completepr = BOOL_TRUE;
-	} else if ( ! persp->a.valpr ) {
+	} else if (! persp->a.valpr) {
 		completepr =  BOOL_TRUE;
-	} else if ( ! persp->s.valpr ) {
+	} else if (! persp->s.valpr) {
 		completepr =  BOOL_TRUE;
 	} else {
 		completepr = BOOL_FALSE;
 	}
 
-	elapsed = time( 0 ) - tranp->t_starttime;
-	if ( persp ) {
+	elapsed = time(0) - tranp->t_starttime;
+	if (persp) {
 		elapsed += persp->s.accumtime;
 	}
 
-	if ( completepr ) {
-		if ( tranp->t_toconlypr ) {
-			mlog( MLOG_VERBOSE, _(
+	if (completepr) {
+		if (tranp->t_toconlypr) {
+			mlog(MLOG_VERBOSE, _(
 			      "table of contents display complete"
 			      ": %ld seconds elapsed"
 			      "\n"),
-			      elapsed );
+			      elapsed);
 		} else {
 			int found;
 
@@ -2657,39 +2657,39 @@
 						CONTENT_GQUOTAFILE);
 
 			if (found)
-				mlog( MLOG_NORMAL,
-				      _("use \'xfs_quota\' to restore quotas\n") );
+				mlog(MLOG_NORMAL,
+				      _("use \'xfs_quota\' to restore quotas\n"));
 
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "restore complete"
 			      ": %ld seconds elapsed"
 			      "\n"),
-			      elapsed );
+			      elapsed);
 		}
-	} else if ( tranp->t_toconlypr ) {
-		mlog( MLOG_VERBOSE | MLOG_NOTE, _(
+	} else if (tranp->t_toconlypr) {
+		mlog(MLOG_VERBOSE | MLOG_NOTE, _(
 		      "table of contents display interrupted"
 		      ": %ld seconds elapsed"
 		      "\n"),
-		      elapsed );
+		      elapsed);
 	} else {
-		mlog( MLOG_VERBOSE | MLOG_NOTE, _(
+		mlog(MLOG_VERBOSE | MLOG_NOTE, _(
 		      "restore interrupted"
 		      ": %ld seconds elapsed"
 		      ": may resume later using -%c option"
 		      "\n"),
 		      elapsed,
-		      GETOPT_RESUME );
+		      GETOPT_RESUME);
 	}
 
 	/* accumulate total elapsed time
 	 */
-	if ( persp ) {
+	if (persp) {
 		persp->s.accumtime = elapsed;
 	}
 
-	if ( ! persp->a.valpr ) {
-		wipepersstate( );
+	if (! persp->a.valpr) {
+		wipepersstate();
 		persp = 0;
 	}
 
@@ -2699,10 +2699,10 @@
 #define STATLINESZ	160
 
 size_t
-content_statline( char **linespp[ ] )
+content_statline(char **linespp[])
 {
-	static char statlinebuf[ 1 ][ STATLINESZ ];
-	static char *statline[ 1 ];
+	static char statlinebuf[1][STATLINESZ];
+	static char *statline[1];
 	size64_t inodone;
 	off64_t datadone;
 	size64_t inocnt;
@@ -2715,12 +2715,12 @@
 
 	/* build and supply the line array
 	 */
-	for ( i = 0 ; i < 1 ; i++ ) {
-		statline[ i ] = &statlinebuf[ i ][ 0 ];
+	for (i = 0 ; i < 1 ; i++) {
+		statline[i] = &statlinebuf[i][0];
 	}
 	*linespp = statline;
 
-	if ( ! persp->s.stat_valpr ) {
+	if (! persp->s.stat_valpr) {
 		return 0;
 	}
 
@@ -2728,23 +2728,23 @@
 	 */
 	elapsed = persp->s.accumtime
 		  +
-		  ( time( 0 ) - tranp->t_starttime );
+		  (time(0) - tranp->t_starttime);
 
 	/* get local time
 	 */
-	now = time( 0 );
-	tmp = localtime( &now );
+	now = time(0);
+	tmp = localtime(&now);
 
-	if ( ! persp->s.dirdonepr ) {
-		if ( ! tranp->t_dircnt ) {
+	if (! persp->s.dirdonepr) {
+		if (! tranp->t_dircnt) {
 			return 0;
 		}
 
-		percent = ( double )tranp->t_dirdonecnt
+		percent = (double)tranp->t_dirdonecnt
 			  /
-			  ( double )tranp->t_dircnt;
+			  (double)tranp->t_dircnt;
 		percent *= 100.0;
-		sprintf( statline[ 0 ], _(
+		sprintf(statline[0], _(
 			 "status at %02d:%02d:%02d: "
 			 "%llu/%llu directories reconstructed, "
 			 "%.1f%%%% complete, "
@@ -2757,8 +2757,8 @@
 			 (unsigned long long)tranp->t_dircnt,
 			 percent,
 			 (unsigned long long)tranp->t_direntcnt,
-			 elapsed );
-		assert( strlen( statline[ 0 ] ) < STATLINESZ );
+			 elapsed);
+		assert(strlen(statline[0]) < STATLINESZ);
 
 		return 1;
 	}
@@ -2773,21 +2773,21 @@
 
 	/* calculate percentage of data dumped
 	 */
-	if ( datacnt ) {
-		percent = ( double )datadone
+	if (datacnt) {
+		percent = (double)datadone
 			  /
-			  ( double )datacnt;
+			  (double)datacnt;
 		percent *= 100.0;
 	} else {
 		percent = 100.0;
 	}
-	if ( percent > 100.0 ) {
+	if (percent > 100.0) {
 		percent = 100.0;
 	}
 
 	/* format the status line in a local static buffer (non-re-entrant!)
 	 */
-	sprintf( statline[ 0 ], _(
+	sprintf(statline[0], _(
 		 "status at %02d:%02d:%02d: %llu/%llu files restored, "
 		 "%.1f%%%% complete, "
 		 "%ld seconds elapsed\n"),
@@ -2797,8 +2797,8 @@
 		 (unsigned long long)inodone,
 		 (unsigned long long)inocnt,
 		 percent,
-		 elapsed );
-	assert( strlen( statline[ 0 ] ) < STATLINESZ );
+		 elapsed);
+	assert(strlen(statline[0]) < STATLINESZ);
 
 	/* return buffer to caller
 	 */
@@ -2806,28 +2806,28 @@
 }
 
 void
-content_showinv( void )
+content_showinv(void)
 {
-	pi_show_nomloglock( );
+	pi_show_nomloglock();
 }
 
 void
-content_showremainingobjects( void )
+content_showremainingobjects(void)
 {
 	bool_t knownholespr = BOOL_FALSE;
 	bool_t maybeholespr = BOOL_FALSE;
 	bag_t *bagp;
 
-	bagp = pi_neededobjs_nondir_alloc( &knownholespr,
+	bagp = pi_neededobjs_nondir_alloc(&knownholespr,
 					   &maybeholespr,
 					   BOOL_TRUE,
-					   BOOL_FALSE );
-	display_needed_objects( PURP_NONDIR,
+					   BOOL_FALSE);
+	display_needed_objects(PURP_NONDIR,
 				bagp,
 				knownholespr,
-				maybeholespr );
-	if ( bagp ) {
-		pi_neededobjs_free( bagp );
+				maybeholespr);
+	if (bagp) {
+		pi_neededobjs_free(bagp);
 		bagp = 0;
 	}
 }
@@ -2845,17 +2845,17 @@
 #define DLOG_TIMEOUT_MEDIA	3600
 
 #define CHOICESTRSZ	10
-typedef struct { ix_t thrdix; char choicestr[ CHOICESTRSZ ]; } cttm_t;
+typedef struct { ix_t thrdix; char choicestr[CHOICESTRSZ]; } cttm_t;
 
 char *
-content_mediachange_query( void )
+content_mediachange_query(void)
 {
-	cttm_t choicetothrdmap[ STREAM_SIMMAX ];
-	char *querystr[ QUERYMAX ];
+	cttm_t choicetothrdmap[STREAM_SIMMAX];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
 	size_t maxdrvchoiceix;
 	size_t infoix;
@@ -2864,30 +2864,30 @@
 	ix_t thrdix;
 
 	infoix = querycnt = 0;
-	querystr[ querycnt++ ] =
+	querystr[querycnt++] =
 		_("select a drive to acknowledge media change\n");
 	choicecnt = 0;
 	maxdrvchoiceix = 0;
-	for ( thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++ ) {
-		if ( mcflag[ thrdix ] ) {
-			choicetothrdmap[ choicecnt ].thrdix = thrdix;
-			sprintf( choicetothrdmap[ choicecnt ].choicestr,
+	for (thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++) {
+		if (mcflag[thrdix]) {
+			choicetothrdmap[choicecnt].thrdix = thrdix;
+			sprintf(choicetothrdmap[choicecnt].choicestr,
 				 _("drive %u"),
-				 (unsigned int)thrdix );
-			choicestr[ choicecnt ] =
-					choicetothrdmap[ choicecnt ].choicestr;
+				 (unsigned int)thrdix);
+			choicestr[choicecnt] =
+					choicetothrdmap[choicecnt].choicestr;
 			maxdrvchoiceix = choicecnt;
 			choicecnt++;
 		}
 	}
-	if ( persp->s.valpr ) {
+	if (persp->s.valpr) {
 		infoix = choicecnt;
-		choicestr[ choicecnt++ ] = _("display needed media objects");
+		choicestr[choicecnt++ ] = _("display needed media objects");
 	}
 	nochangeix = choicecnt;
-	choicestr[ choicecnt++ ] = _("continue");
-	assert( choicecnt <= CHOICEMAX );
-	responseix = dlog_multi_query( querystr,
+	choicestr[choicecnt++ ] = _("continue");
+	assert(choicecnt <= CHOICEMAX);
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -2900,34 +2900,34 @@
 				       nochangeix, /* sigint ix */
 				       nochangeix, /* sighup ix */
 				       nochangeix);/* sigquit ix */
-	if ( responseix <= maxdrvchoiceix ) {
-		clr_mcflag( choicetothrdmap[ responseix ].thrdix );
+	if (responseix <= maxdrvchoiceix) {
+		clr_mcflag(choicetothrdmap[responseix].thrdix);
 		return _("media change acknowledged\n");
 	}
-	if ( responseix == infoix ) {
+	if (responseix == infoix) {
 		bool_t knownholespr = BOOL_FALSE;
 		bool_t maybeholespr = BOOL_FALSE;
-		bag_t *bagp = pi_neededobjs_nondir_alloc( &knownholespr,
+		bag_t *bagp = pi_neededobjs_nondir_alloc(&knownholespr,
 							  &maybeholespr,
 							  BOOL_FALSE,
-							  BOOL_FALSE );
-		display_needed_objects( PURP_NONDIR,
+							  BOOL_FALSE);
+		display_needed_objects(PURP_NONDIR,
 					bagp,
 					knownholespr,
-					maybeholespr );
-		if ( bagp ) {
-			pi_neededobjs_free( bagp );
+					maybeholespr);
+		if (bagp) {
+			pi_neededobjs_free(bagp);
 			bagp = 0;
 		}
 		ackcnt = 0;
-		dlog_multi_ack( ackstr,
-				ackcnt );
+		dlog_multi_ack(ackstr,
+				ackcnt);
 		querycnt = 0;
 		choicecnt = 0;
 		nochangeix = choicecnt;
-		choicestr[ choicecnt++ ] = _("continue");
-		assert( choicecnt <= CHOICEMAX );
-		responseix = dlog_multi_query( querystr,
+		choicestr[choicecnt++ ] = _("continue");
+		assert(choicecnt <= CHOICEMAX);
+		responseix = dlog_multi_query(querystr,
 					       querycnt,
 					       choicestr,
 					       choicecnt,
@@ -2942,7 +2942,7 @@
 					       nochangeix);/* sigquit ix */
 		return _("continuing\n");
 	}
-	assert( responseix == nochangeix );
+	assert(responseix == nochangeix);
 	return _("continuing\n");
 }
 
@@ -2954,60 +2954,60 @@
  */
 /* ARGSUSED */
 static rv_t
-applydirdump( drive_t *drivep,
+applydirdump(drive_t *drivep,
 	      dh_t fileh,
 	      content_inode_hdr_t *scrhdrp,
-	      filehdr_t *fhdrp )
+	      filehdr_t *fhdrp)
 {
 	bool_t fhcs;
 	bool_t dhcs;
 	bool_t ahcs;
 
-	fhcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM )
+	fhcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
-	dhcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRENTHDR_CHECKSUM )
+	dhcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRENTHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
-	ahcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTATTRHDR_CHECKSUM )
+	ahcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTATTRHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
 
-	if ( ! persp->s.marknorefdonepr ) {
-		tree_marknoref( );
+	if (! persp->s.marknorefdonepr) {
+		tree_marknoref();
 		persp->s.marknorefdonepr = BOOL_TRUE;
 	}
 
-	if ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_NOTSELFCONTAINED ) {
-		mlog( MLOG_NORMAL | MLOG_NOTE, _(
+	if (scrhdrp->cih_dumpattr & CIH_DUMPATTR_NOTSELFCONTAINED) {
+		mlog(MLOG_NORMAL | MLOG_NOTE, _(
 		      "dump is not self-contained, "
 		      "orphaned files expected if base dump(s) "
-		      "was not applied\n") );
+		      "was not applied\n"));
 	}
 
-	if ( ! persp->s.dirdonepr ) {
+	if (! persp->s.dirdonepr) {
 		rv_t rv;
 		dah_t dah;
 
-		char _direntbuf[ sizeof( direnthdr_t )
+		char _direntbuf[sizeof(direnthdr_t)
 				+
 				NAME_MAX + 1
 				+
-				DIRENTHDR_ALIGN ];
+				DIRENTHDR_ALIGN];
 		char *direntbuf = ALIGN_PTR(_direntbuf, DIRENTHDR_ALIGN);
 		size_t direntbufsz =
 			sizeof(_direntbuf) - (direntbuf - _direntbuf);
 
-		mlog( MLOG_TRACE,
-		      "reading the ino map\n" );
-		rv = inomap_restore_pers( drivep, scrhdrp, tranp->t_hkdir );
-		if ( rv != RV_OK ) {
+		mlog(MLOG_TRACE,
+		      "reading the ino map\n");
+		rv = inomap_restore_pers(drivep, scrhdrp, tranp->t_hkdir);
+		if (rv != RV_OK) {
 			return rv;
 		}
 
@@ -3015,8 +3015,8 @@
 		tranp->t_dirdonecnt = 0;
 		tranp->t_direntcnt = 0;
 
-		mlog( MLOG_TRACE,
-		      "reading the directories \n" );
+		mlog(MLOG_TRACE,
+		      "reading the directories \n");
 
 		dah = DAH_NULL;
 		for (;;) {
@@ -3024,8 +3024,8 @@
 
 			/* read the file header
 			 */
-			rv = read_filehdr( drivep, fhdrp, fhcs );
-			if ( rv ) {
+			rv = read_filehdr(drivep, fhdrp, fhcs);
+			if (rv) {
 				return rv;
 			}
 
@@ -3033,44 +3033,44 @@
 			 * reading dirs, and there are no nondirs.
 			 * done.
 			 */
-			if ( fhdrp->fh_flags & FILEHDR_FLAGS_NULL ) {
+			if (fhdrp->fh_flags & FILEHDR_FLAGS_NULL) {
 				break;
 			}
 
 			/* if its not a directory, must be the
 			 * first non-dir file. done.
 			 */
-			if ( ( fhdrp->fh_stat.bs_mode & S_IFMT ) != S_IFDIR ) {
+			if ((fhdrp->fh_stat.bs_mode & S_IFMT) != S_IFDIR) {
 				break;
 			}
 
 			/* if stop requested bail out gracefully
 			 */
-			if ( cldmgr_stop_requested( )) {
+			if (cldmgr_stop_requested()) {
 				return RV_INTR;
 			}
 
-			/* if in a pipeline , call preemptchk( ) to
+			/* if in a pipeline , call preemptchk() to
 			 * print status reports
 			 */
-			if ( pipeline )
+			if (pipeline)
 			{
-				mlog( MLOG_DEBUG ,
+				mlog(MLOG_DEBUG ,
 					"preemptchk( )\n");
-				preemptchk( );
+				preemptchk();
 			}
 
 			/* may be an extended attributes file hdr
 			 */
-			if ( fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR ) {
-				rv = restore_extattr( drivep,
+			if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
+				rv = restore_extattr(drivep,
 						      fhdrp,
 						      0,
 						      ahcs,
 						      BOOL_TRUE, /* isdirpr */
 						      BOOL_FALSE, /* onlydoreadpr */
-						      dah );
-				if ( rv != RV_OK ) {
+						      dah);
+				if (rv != RV_OK) {
 					return rv;
 				}
 				continue;
@@ -3083,7 +3083,7 @@
 			 * with that dir.
 			 */
 			dah = DAH_NULL;
-			dirh = tree_begindir( fhdrp, &dah );
+			dirh = tree_begindir(fhdrp, &dah);
 			if (dirh == NH_NULL)
 			    return RV_ERROR;
 
@@ -3091,16 +3091,16 @@
 			 * tree with them. we can tell when we are done
 			 * by looking for a null dirent.
 			 */
-			for ( ; ; ) {
+			for (; ;) {
 				register direnthdr_t *dhdrp =
-						    ( direnthdr_t * )direntbuf;
+						    (direnthdr_t *)direntbuf;
 				register size_t namelen;
 
-				rv = read_dirent( drivep,
+				rv = read_dirent(drivep,
 						  dhdrp,
 						  direntbufsz,
-						  dhcs );
-				if ( rv != RV_OK ) {
+						  dhcs);
+				if (rv != RV_OK) {
 					return rv;
 				}
 
@@ -3108,26 +3108,26 @@
 				 * break out of this inner loop and
 				 * move on th the next dir.
 				 */
-				if ( dhdrp->dh_ino == 0 ) {
+				if (dhdrp->dh_ino == 0) {
 					break;
 				}
-				namelen = strlen( dhdrp->dh_name );
-				assert( namelen <= NAME_MAX );
+				namelen = strlen(dhdrp->dh_name);
+				assert(namelen <= NAME_MAX);
 
 				/* add this dirent to the tree.
 				 */
-				rv = tree_addent( dirh,
+				rv = tree_addent(dirh,
 					     dhdrp->dh_ino,
 					     dhdrp->dh_gen,
 					     dhdrp->dh_name,
-					     namelen );
-				if ( rv != RV_OK ) {
+					     namelen);
+				if (rv != RV_OK) {
 					return rv;
 				}
 				tranp->t_direntcnt++;
 			}
 
-			tree_enddir( dirh );
+			tree_enddir(dirh);
 
 			tranp->t_dirdonecnt++;
 		}
@@ -3143,7 +3143,7 @@
 		persp->s.dirdonepr = BOOL_TRUE;
 	}
 
-	mlog( MLOG_VERBOSE, _("%llu directories and %llu entries processed\n"),
+	mlog(MLOG_VERBOSE, _("%llu directories and %llu entries processed\n"),
 		tranp->t_dirdonecnt, tranp->t_direntcnt);
 
 	return RV_OK;
@@ -3155,54 +3155,54 @@
  */
 /* ARGSUSED */
 rv_t
-eatdirdump( drive_t *drivep,
+eatdirdump(drive_t *drivep,
 	    dh_t fileh,
 	    content_inode_hdr_t *scrhdrp,
-	    filehdr_t *fhdrp )
+	    filehdr_t *fhdrp)
 {
 	bool_t fhcs;
 	bool_t dhcs;
 	bool_t ahcs;
 
-	char _direntbuf[ sizeof( direnthdr_t )
+	char _direntbuf[sizeof(direnthdr_t)
 			+
 			NAME_MAX + 1
 			+
-			DIRENTHDR_ALIGN ];
+			DIRENTHDR_ALIGN];
 	char *direntbuf = ALIGN_PTR(_direntbuf, DIRENTHDR_ALIGN);
 	size_t direntbufsz = sizeof(_direntbuf) - (direntbuf - _direntbuf);
 	rv_t rv;
 
-	fhcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM )
+	fhcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
-	dhcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRENTHDR_CHECKSUM )
+	dhcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRENTHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
-	ahcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTATTRHDR_CHECKSUM )
+	ahcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTATTRHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
 
-	mlog( MLOG_DEBUG,
-	      "discarding ino map\n" );
-	rv = inomap_discard( drivep, scrhdrp );
-	if ( rv != RV_OK ) {
+	mlog(MLOG_DEBUG,
+	      "discarding ino map\n");
+	rv = inomap_discard(drivep, scrhdrp);
+	if (rv != RV_OK) {
 		return rv;
 	}
 
-	mlog( MLOG_DEBUG,
-	      "discarding directories \n" );
+	mlog(MLOG_DEBUG,
+	      "discarding directories \n");
 	for (;;) {
 		/* read the file header
 		 */
-		rv = read_filehdr( drivep, fhdrp, fhcs );
-		if ( rv ) {
+		rv = read_filehdr(drivep, fhdrp, fhcs);
+		if (rv) {
 			return rv;
 		}
 
@@ -3210,34 +3210,34 @@
 		 * reading dirs, and there are no nondirs.
 		 * done.
 		 */
-		if ( fhdrp->fh_flags & FILEHDR_FLAGS_NULL ) {
+		if (fhdrp->fh_flags & FILEHDR_FLAGS_NULL) {
 			break;
 		}
 
 		/* if its not a directory, must be the
 		 * first non-dir file. done.
 		 */
-		if ( ( fhdrp->fh_stat.bs_mode & S_IFMT ) != S_IFDIR ) {
+		if ((fhdrp->fh_stat.bs_mode & S_IFMT) != S_IFDIR) {
 			break;
 		}
 
 		/* if stop requested bail out gracefully
 		 */
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
 		/* may be an extended attributes file hdr
 		 */
-		if ( fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR ) {
-			rv = restore_extattr( drivep,
+		if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
+			rv = restore_extattr(drivep,
 					      fhdrp,
 					      0,
 					      ahcs,
 					      BOOL_TRUE, /* isdirpr */
 					      BOOL_TRUE, /* onlydoreadpr */
-					      DAH_NULL );
-			if ( rv != RV_OK ) {
+					      DAH_NULL);
+			if (rv != RV_OK) {
 				return rv;
 			}
 			continue;
@@ -3247,17 +3247,17 @@
 		 * we can tell when we are done
 		 * by looking for a null dirent.
 		 */
-		for ( ; ; ) {
+		for (; ;) {
 			register direnthdr_t *dhdrp =
-					    ( direnthdr_t * )direntbuf;
+					    (direnthdr_t *)direntbuf;
 			/* REFERENCED */
 			register size_t namelen;
 
-			rv = read_dirent( drivep,
+			rv = read_dirent(drivep,
 					  dhdrp,
 					  direntbufsz,
-					  dhcs );
-			if ( rv ) {
+					  dhcs);
+			if (rv) {
 				return rv;
 			}
 
@@ -3265,11 +3265,11 @@
 			 * break out of this inner loop and
 			 * move on th the next dir.
 			 */
-			if ( dhdrp->dh_ino == 0 ) {
+			if (dhdrp->dh_ino == 0) {
 				break;
 			}
-			namelen = strlen( dhdrp->dh_name );
-			assert( namelen <= NAME_MAX );
+			namelen = strlen(dhdrp->dh_name);
+			assert(namelen <= NAME_MAX);
 		}
 	}
 
@@ -3282,27 +3282,27 @@
  * until no point in doing so.
  */
 static rv_t
-treepost( char *path1, char *path2 )
+treepost(char *path1, char *path2)
 {
 	bool_t ok;
 
 #ifdef TREE_CHK
 	/* first scan the tree for corruption
 	 */
-	mlog( MLOG_DEBUG | MLOG_TREE,
-	      "checking tree for consistency\n" );
-	if ( ! tree_chk( )) {
+	mlog(MLOG_DEBUG | MLOG_TREE,
+	      "checking tree for consistency\n");
+	if (! tree_chk()) {
 		return RV_CORE;
 	}
 #endif /* TREE_CHK */
 
 	/* adjust ref flags based on what dirs were dumped
 	 */
-	if ( ! persp->s.adjrefdonepr ) {
-		mlog( MLOG_DEBUG | MLOG_TREE,
-		      "adjusting dirent ref flags\n" );
-		ok = tree_adjref( );
-		if ( ! ok ) {
+	if (! persp->s.adjrefdonepr) {
+		mlog(MLOG_DEBUG | MLOG_TREE,
+		      "adjusting dirent ref flags\n");
+		ok = tree_adjref();
+		if (! ok) {
 			return RV_INTR;
 		}
 		persp->s.adjrefdonepr = BOOL_TRUE;
@@ -3312,61 +3312,61 @@
 	 * so only inos selected by subtree or interactive cmds will
 	 * be present in inomap.
 	 */
-	if ( ! persp->s.inomapsanitizedonepr ) {
-		if ( persp->a.interpr
+	if (! persp->s.inomapsanitizedonepr) {
+		if (persp->a.interpr
 		     ||
-		     ( persp->a.firststsenseprvalpr
+		     (persp->a.firststsenseprvalpr
 		       &&
-		       persp->a.firststsensepr )) {
-			inomap_sanitize( );
+		       persp->a.firststsensepr)) {
+			inomap_sanitize();
 		}
 		persp->s.inomapsanitizedonepr = BOOL_TRUE;
 	}
 
 	/* apply subtree selections
 	 */
-	if ( ! persp->s.stdonepr ) {
+	if (! persp->s.stdonepr) {
 		ix_t stix;
 		stdesc_t *stdescp;
 
-		mlog( MLOG_DEBUG | MLOG_TREE,
-		      "applying subtree selections\n" );
+		mlog(MLOG_DEBUG | MLOG_TREE,
+		      "applying subtree selections\n");
 
 		/* if first subtree selection is inclusive in sense,
 		 * first mark the entire tree as unselected. otherwise,
 		 * select all (no subtree selections or first was excluding).
 		 */
-		if ( ( persp->a.interpr
+		if ((persp->a.interpr
 		       &&
-		       ( ! persp->a.firststsenseprvalpr
+		       (! persp->a.firststsenseprvalpr
 		         ||
-		         persp->a.firststsensepr ))
+		         persp->a.firststsensepr))
 		     ||
-		     ( persp->a.firststsenseprvalpr
+		     (persp->a.firststsenseprvalpr
 		       &&
-		       persp->a.firststsensepr )) {
-			tree_markallsubtree( BOOL_FALSE );
+		       persp->a.firststsensepr)) {
+			tree_markallsubtree(BOOL_FALSE);
 		} else {
-			tree_markallsubtree( BOOL_TRUE );
+			tree_markallsubtree(BOOL_TRUE);
 		}
 
 		/* now apply all subtree commands from command line
 		 */
-		for ( stix = 0,
-		      stdescp = ( stdesc_t * )( ( char * )persp + perssz )
+		for (stix = 0,
+		      stdescp = (stdesc_t *)((char *)persp + perssz)
 		      ;
 		      stix < persp->a.stcnt
 		      ;
 		      stix++,
-		      stdescp = ( stdesc_t * )( ( char * )stdescp
+		      stdescp = (stdesc_t *)((char *)stdescp
 						+
-						stdescp->std_nextoff )) {
-			ok = tree_subtree_parse( stdescp->std_sensepr,
-						 stdescp->std_path );
-			if ( ! ok ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+						stdescp->std_nextoff)) {
+			ok = tree_subtree_parse(stdescp->std_sensepr,
+						 stdescp->std_path);
+			if (! ok) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "subtree argument %s invalid\n"),
-				      stdescp->std_path );
+				      stdescp->std_path);
 				return RV_ERROR;
 			}
 		}
@@ -3375,24 +3375,24 @@
 
 	/* next engage interactive subtree selection
 	 */
-	if ( ! persp->s.interdonepr ) {
-		if ( persp->a.interpr ) {
-			ok = tree_subtree_inter( );
-			if ( ! ok ) {
+	if (! persp->s.interdonepr) {
+		if (persp->a.interpr) {
+			ok = tree_subtree_inter();
+			if (! ok) {
 				return RV_INTR;
 			}
 		}
 		persp->s.interdonepr = BOOL_TRUE;
 	}
 
-	ok = tree_post( path1, path2 );
+	ok = tree_post(path1, path2);
 
-	if ( ! ok ) {
+	if (! ok) {
 		return RV_INTR;
 	}
 
-	ok = tree_extattr( restore_dir_extattr_cb, path1 );
-	if ( ! ok ) {
+	ok = tree_extattr(restore_dir_extattr_cb, path1);
+	if (! ok) {
 		return RV_INTR;
 	}
 
@@ -3402,12 +3402,12 @@
 }
 
 static rv_t
-applynondirdump( drive_t *drivep,
+applynondirdump(drive_t *drivep,
 		 dh_t fileh,
 		 content_inode_hdr_t *scrhdrp,
 		 char *path1,
 		 char *path2,
-		 filehdr_t *fhdrp )
+		 filehdr_t *fhdrp)
 {
 	rv_t rv = RV_UNKNOWN;
 	bool_t fhcs;
@@ -3419,17 +3419,17 @@
 
 	/* determine if file header and/or extent heade checksums present
 	 */
-	fhcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM )
+	fhcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
-	ehcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTENTHDR_CHECKSUM )
+	ehcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTENTHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
 	       BOOL_FALSE;
-	ahcs = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTATTRHDR_CHECKSUM )
+	ahcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_EXTATTRHDR_CHECKSUM)
 	       ?
 	       BOOL_TRUE
 	       :
@@ -3438,7 +3438,7 @@
 	/* determine the first and next egrps needed from this media file.
 	 * used to decide if stats should be updated
 	 */
-	pi_bracketneededegrps( fileh, &first_egrp, &next_egrp );
+	pi_bracketneededegrps(fileh, &first_egrp, &next_egrp);
 
 	/* initialize the stream context
 	 */
@@ -3448,7 +3448,7 @@
 	strctxp->sc_ownerset = BOOL_FALSE;
 
 
-	for ( ; ; ) {
+	for (; ;) {
 		drive_ops_t *dop = drivep->d_opsp;
 		drive_mark_t drivemark;
 		bstat_t *bstatp = &fhdrp->fh_stat;
@@ -3457,7 +3457,7 @@
 
 		/* if a null file header, break
 		 */
-		if ( fhdrp->fh_flags & FILEHDR_FLAGS_NULL ) {
+		if (fhdrp->fh_flags & FILEHDR_FLAGS_NULL) {
 			rv = RV_OK;
 			goto applynondirdump_out;
 		}
@@ -3465,7 +3465,7 @@
 		/* if working on a different file than we were previously,
 		 * complete the old one and begin the new one.
 		 */
-		if ( bstatp->bs_ino != strctxp->sc_bstat.bs_ino ) {
+		if (bstatp->bs_ino != strctxp->sc_bstat.bs_ino) {
 
 			restore_complete_reg(strctxp);
 
@@ -3475,39 +3475,39 @@
 			strctxp->sc_fd = -1;
 			strctxp->sc_ownerset = BOOL_FALSE;
 
-			rv = restore_file( drivep, fhdrp, ehcs, ahcs, path1, path2 );
+			rv = restore_file(drivep, fhdrp, ehcs, ahcs, path1, path2);
 
-		} else if ( fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR ) {
-			rv = restore_extattr( drivep,
+		} else if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
+			rv = restore_extattr(drivep,
 					      fhdrp,
 					      strctxp->sc_path,
 					      ahcs,
 					      BOOL_FALSE, /* isdirpr */
 					      BOOL_FALSE, /* onlydoreadpr */
-					      DAH_NULL );
+					      DAH_NULL);
 		} else {
 			/* Must be another extent group for the current file */
-			restore_extent_group( drivep,
+			restore_extent_group(drivep,
 					      fhdrp,
 					      strctxp->sc_path,
 					      strctxp->sc_fd,
 					      ehcs,
-					      &rv );
+					      &rv);
 		}
 
-		switch( rv ) {
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_EOD:
 			rv = RV_OK;
 			goto applynondirdump_out;
 		case RV_CORRUPT:
-			rval = ( * dop->do_next_mark )( drivep );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			rval = (* dop->do_next_mark)(drivep);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "unable to resync media file: "
 				      "some portion of dump will NOT "
-				      "be restored\n") );
+				      "be restored\n"));
 				rv = RV_OK;  /* treat as EOD */
 				goto applynondirdump_out;
 			}
@@ -3519,25 +3519,25 @@
 
 		/* update stats if appropriate
 		 */
-		if ( ( ( bstatp->bs_mode & S_IFMT ) == S_IFREG )
+		if (((bstatp->bs_mode & S_IFMT) == S_IFREG)
 		     &&
-		     ! ( fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR )
+		     ! (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR)
 		     &&
-		     fhdrp->fh_offset == 0 ) {
+		     fhdrp->fh_offset == 0) {
 			egrp_t cur_egrp;
 			cur_egrp.eg_ino = fhdrp->fh_stat.bs_ino;
 			cur_egrp.eg_off = fhdrp->fh_offset;
-			if (cur_egrp.eg_ino > first_egrp.eg_ino ) {
-				if ( cur_egrp.eg_ino < next_egrp.eg_ino
+			if (cur_egrp.eg_ino > first_egrp.eg_ino) {
+				if (cur_egrp.eg_ino < next_egrp.eg_ino
 				     ||
-				     next_egrp.eg_off > 0 ) {
-					assert( cur_egrp.eg_ino
+				     next_egrp.eg_off > 0) {
+					assert(cur_egrp.eg_ino
 						<=
-						next_egrp.eg_ino );
-					pi_update_stats( bstatp->bs_blocks
+						next_egrp.eg_ino);
+					pi_update_stats(bstatp->bs_blocks
 							 *
-							 ( off64_t )
-							 bstatp->bs_blksize );
+							 (off64_t)
+							 bstatp->bs_blksize);
 				}
 			}
 		}
@@ -3545,24 +3545,24 @@
 		do {
 			/* get a mark for the next read, in case we restart here
 			 */
-			( * dop->do_get_mark )( drivep, &drivemark );
+			(* dop->do_get_mark)(drivep, &drivemark);
 
 			/* read the file header.
 			 */
-			rv = read_filehdr( drivep, fhdrp, fhcs );
-			switch( rv ) {
+			rv = read_filehdr(drivep, fhdrp, fhcs);
+			switch(rv) {
 			case RV_OK:
 				break;
 			case RV_EOD:
 				rv = RV_OK;
 				goto applynondirdump_out;
 			case RV_CORRUPT:
-				rval = ( * dop->do_next_mark )( drivep );
-				if ( rval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				rval = (* dop->do_next_mark)(drivep);
+				if (rval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "unable to resync media file: "
 					      "some portion of dump will NOT "
-					      "be restored\n") );
+					      "be restored\n"));
 					rv = RV_OK;  /* treat as EOD */
 					goto applynondirdump_out;
 				}
@@ -3571,33 +3571,33 @@
 				goto applynondirdump_out;
 			}
 
-			if ( resyncpr && rv == RV_OK ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (resyncpr && rv == RV_OK) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "resynchronization achieved at "
 				      "ino %llu offset %lld\n"),
 				      fhdrp->fh_stat.bs_ino,
-				      fhdrp->fh_offset );
+				      fhdrp->fh_offset);
 				resyncpr = BOOL_FALSE;
 			}
-		} while ( resyncpr );
+		} while (resyncpr);
 
 		/* checkpoint into persistent state if not a null file hdr
 		 */
-		if ( ! ( fhdrp->fh_flags & FILEHDR_FLAGS_NULL )) {
-			pi_checkpoint( fileh,
+		if (! (fhdrp->fh_flags & FILEHDR_FLAGS_NULL)) {
+			pi_checkpoint(fileh,
 				       &drivemark,
 				       fhdrp->fh_stat.bs_ino,
-				       fhdrp->fh_offset );
+				       fhdrp->fh_offset);
 		}
 
-		/* if in a pipeline , call preemptchk( ) to
+		/* if in a pipeline , call preemptchk() to
 		 * print status reports
 		 */
-		if ( pipeline )
+		if (pipeline)
 		{
-			mlog( MLOG_DEBUG ,
+			mlog(MLOG_DEBUG ,
 				"preemptchk( )\n");
-			preemptchk( );
+			preemptchk();
 		}
 	}
 
@@ -3614,17 +3614,17 @@
 
 /* ARGSUSED */
 static rv_t
-finalize( char *path1, char *path2 )
+finalize(char *path1, char *path2)
 {
 	bool_t ok;
 
-	if ( ! tranp->t_toconlypr ) {
+	if (! tranp->t_toconlypr) {
 
 		/* restore directory attributes
 		 */
-		if ( ! persp->s.dirattrdonepr ) {;
-			ok = tree_setattr( path1 );
-			if ( ! ok ) {
+		if (! persp->s.dirattrdonepr) {;
+			ok = tree_setattr(path1);
+			if (! ok) {
 				return RV_INTR;
 			}
 			persp->s.dirattrdonepr = BOOL_TRUE;
@@ -3632,9 +3632,9 @@
 
 		/* remove orphanage if empty
 		 */
-		if ( ! persp->s.orphdeltriedpr ) {;
-			ok = tree_delorph( );
-			if ( ! ok ) {
+		if (! persp->s.orphdeltriedpr) {;
+			ok = tree_delorph();
+			if (! ok) {
 				return RV_INTR;
 			}
 			persp->s.orphdeltriedpr = BOOL_TRUE;
@@ -3642,8 +3642,8 @@
 
 		/* delete the persistent ino map
 		 */
-		if ( ! persp->s.inomapdelpr ) {
-			inomap_del_pers( tranp->t_hkdir );
+		if (! persp->s.inomapdelpr) {
+			inomap_del_pers(tranp->t_hkdir);
 			persp->s.inomapdelpr = BOOL_TRUE;
 		}
 	}
@@ -3653,12 +3653,12 @@
 	 * invalidate the pers session state. otherwise, invalidate the
 	 * persistent state. content_complete will remove housekeeping dir.
 	 */
-	if ( persp->a.cumpr ) {
+	if (persp->a.cumpr) {
 		/* following must be atomic!
 		 */
 		persp->a.dumpcnt++;
 		uuid_copy(persp->a.lastdumpid, persp->s.dumpid);
-		strcpy( persp->a.lastdumplab, persp->s.dumplab );
+		strcpy(persp->a.lastdumplab, persp->s.dumplab);
 		persp->s.valpr = BOOL_FALSE;
 	} else {
 		persp->a.valpr = BOOL_FALSE;
@@ -3667,63 +3667,63 @@
 }
 
 static void
-toconly_cleanup( void )
+toconly_cleanup(void)
 {
-	if ( ! tranp ) {
+	if (! tranp) {
 		return;
 	}
 
-	if ( ! tranp->t_toconlypr ) {
+	if (! tranp->t_toconlypr) {
 		return;
 	}
 
-	if ( ! tranp->t_hkdir ) {
+	if (! tranp->t_hkdir) {
 		return;
 	}
 
-	if ( ! strlen( tranp->t_hkdir )) {
+	if (! strlen(tranp->t_hkdir)) {
 		return;
 	}
 
-	wipepersstate( );
+	wipepersstate();
 }
 
 static void
-wipepersstate( void )
+wipepersstate(void)
 {
 	DIR *dirp;
 	struct dirent64 *direntp;
-	char pathname[ MAXPATHLEN ];
-	dirp = opendir( tranp->t_hkdir );
-	if ( ! dirp ) {
+	char pathname[MAXPATHLEN];
+	dirp = opendir(tranp->t_hkdir);
+	if (! dirp) {
 		return;
 	}
 
-	while ( ( direntp = readdir64( dirp )) != 0 ) {
+	while ((direntp = readdir64(dirp)) != 0) {
 		/* REFERENCED */
 		int len;
-		if ( ! strcmp( direntp->d_name, "." )) {
+		if (! strcmp(direntp->d_name, ".")) {
 			continue;
 		}
-		if ( ! strcmp( direntp->d_name, ".." )) {
+		if (! strcmp(direntp->d_name, "..")) {
 			continue;
 		}
-		len = sprintf( pathname,
+		len = sprintf(pathname,
 			       "%s/%s",
 			       tranp->t_hkdir,
-			       direntp->d_name );
-		assert( len > 0 );
-		assert( len < MAXPATHLEN );
-		( void )unlink( pathname );
-		closedir( dirp );
-		dirp = opendir( tranp->t_hkdir );
-		if ( ! dirp ) {
+			       direntp->d_name);
+		assert(len > 0);
+		assert(len < MAXPATHLEN);
+		(void)unlink(pathname);
+		closedir(dirp);
+		dirp = opendir(tranp->t_hkdir);
+		if (! dirp) {
 			return;
 		}
 	}
-	closedir( dirp );
+	closedir(dirp);
 
-	rmdir( tranp->t_hkdir );
+	rmdir(tranp->t_hkdir);
 }
 
 /* Inv abstraction ***********************************************************/
@@ -3732,46 +3732,46 @@
  * sets pers id/label and pers idvalpr etc as side-effect (does NOT set valpr!)
  */
 static bool_t
-Inv_validate_cmdline( void )
+Inv_validate_cmdline(void)
 {
 	inv_session_t *sessp;
 	bool_t ok;
 	bool_t rok;
 
-	assert( ! persp->s.valpr );
+	assert(! persp->s.valpr);
 
 	ok = BOOL_FALSE;
 	sessp = 0;
-	if ( tranp->t_reqdumpidvalpr ) {
+	if (tranp->t_reqdumpidvalpr) {
 		ok = inv_get_session_byuuid(NULL, &tranp->t_reqdumpid, &sessp);
-	} else if ( tranp->t_reqdumplabvalpr ) {
+	} else if (tranp->t_reqdumplabvalpr) {
 		ok = inv_get_session_bylabel(NULL, tranp->t_reqdumplab, &sessp);
 	}
 	rok = BOOL_FALSE;
-	if ( ok && sessp ) {
+	if (ok && sessp) {
 		uuid_t baseid;
 
 		uuid_clear(baseid);
-                askinvforbaseof( baseid, sessp );
-		if ( ! dumpcompat( sessp->s_isresumed,
-				   ( ix_t )( sessp->s_level ),
+                askinvforbaseof(baseid, sessp);
+		if (! dumpcompat(sessp->s_isresumed,
+				   (ix_t)(sessp->s_level),
 				   baseid,
-				   BOOL_TRUE )) {
-			inv_free_session( &sessp );
+				   BOOL_TRUE)) {
+			inv_free_session(&sessp);
 			return BOOL_ERROR;
 		}
 
-		mlog( MLOG_VERBOSE, _(
-		      "using online session inventory\n") );
-		persp->s.fullinvpr = pi_transcribe( sessp );
-		if ( persp->s.fullinvpr ) {
-			strncpyterm( persp->s.dumplab,
+		mlog(MLOG_VERBOSE, _(
+		      "using online session inventory\n"));
+		persp->s.fullinvpr = pi_transcribe(sessp);
+		if (persp->s.fullinvpr) {
+			strncpyterm(persp->s.dumplab,
 				     sessp->s_label,
-				     sizeof( persp->s.dumplab ));
+				     sizeof(persp->s.dumplab));
 			uuid_copy(persp->s.dumpid, sessp->s_sesid);
 			rok = BOOL_TRUE;
 		}
-		inv_free_session( &sessp );
+		inv_free_session(&sessp);
 	}
 	return rok;
 }
@@ -3781,29 +3781,29 @@
 
 
 static Media_t *
-Media_create( ix_t thrdix )
+Media_create(ix_t thrdix)
 {
-	drive_t *drivep = drivepp[ thrdix ];
+	drive_t *drivep = drivepp[thrdix];
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t *drhdrp = drivep->d_readhdrp;
-	media_hdr_t *mrhdrp = ( media_hdr_t * )drhdrp->dh_upper;
-	content_hdr_t *crhdrp = ( content_hdr_t * )mrhdrp->mh_upper;
+	media_hdr_t *mrhdrp = (media_hdr_t *)drhdrp->dh_upper;
+	content_hdr_t *crhdrp = (content_hdr_t *)mrhdrp->mh_upper;
 	content_inode_hdr_t *scrhdrp =
-				( content_inode_hdr_t * )crhdrp->ch_specific;
+				(content_inode_hdr_t *)crhdrp->ch_specific;
 	Media_t *Mediap;
 
 
-	mlog( MLOG_DEBUG,
-	      "Media_create\n" );
+	mlog(MLOG_DEBUG,
+	      "Media_create\n");
 
-	Mediap = ( Media_t * )calloc( 1, sizeof( Media_t ));
+	Mediap = (Media_t *)calloc(1, sizeof(Media_t));
 	Mediap->M_drivep = drivep;
 	Mediap->M_grhdrp = grhdrp;
 	Mediap->M_drhdrp = drhdrp;
 	Mediap->M_mrhdrp = mrhdrp;
 	Mediap->M_crhdrp = crhdrp;
 	Mediap->M_scrhdrp = scrhdrp;
-	assert( POS_UNKN == 0 );
+	assert(POS_UNKN == 0);
 
 	return Mediap;
 }
@@ -3812,19 +3812,19 @@
  * within the current media file
  */
 static void
-Media_indir( Media_t *Mediap )
+Media_indir(Media_t *Mediap)
 {
-	mlog( MLOG_DEBUG,
-	      "Media_indir\n" );
+	mlog(MLOG_DEBUG,
+	      "Media_indir\n");
 
 	Mediap->M_pos = POS_INDIR;
 }
 
 static void
-Media_atnondir( Media_t *Mediap )
+Media_atnondir(Media_t *Mediap)
 {
-	mlog( MLOG_DEBUG,
-	      "Media_atnondir\n" );
+	mlog(MLOG_DEBUG,
+	      "Media_atnondir\n");
 
 	Mediap->M_pos = POS_ATNONDIR;
 }
@@ -3850,7 +3850,7 @@
  * It takes on values like RV_OK, RV_EOF.
  */
 static rv_t
-Media_mfile_next( Media_t *Mediap,
+Media_mfile_next(Media_t *Mediap,
 		  purp_t purp,
 		  sync_t *donesyncp,
 		  dh_t  *filehp,
@@ -3860,7 +3860,7 @@
 		  content_hdr_t **crhdrpp,
 		  content_inode_hdr_t **scrhdrpp,
 		  drive_t **drivepp,
-		  filehdr_t *fhdrp ) /*caller-supplied buf if NONDIR purp*/
+		  filehdr_t *fhdrp) /*caller-supplied buf if NONDIR purp*/
 {
 	drive_t *drivep = Mediap->M_drivep;
 	drive_ops_t *dop = drivep->d_opsp;
@@ -3875,10 +3875,10 @@
 	bool_t ok;
 	uuid_t prevmfiledumpid;
 
-	mlog( MLOG_DEBUG | MLOG_MEDIA,
+	mlog(MLOG_DEBUG | MLOG_MEDIA,
 	      "Media_mfile_next: purp==%d pos==%d\n",
 	      purp,
-	      Mediap->M_pos );
+	      Mediap->M_pos);
 
 	/* pass back hdr and drive ptrs
 	 */
@@ -3891,7 +3891,7 @@
 
 	/* if ref return for pers mfile desc supplied, pre-zero
 	 */
-	if ( filehp ) {
+	if (filehp) {
 		*filehp = DH_NULL;
 	}
 
@@ -3901,8 +3901,8 @@
 
 	/* if purpose has changed, invalidate first, last, and previous indices
 	 */
-	if ( Mediap->M_flmfixvalpr ) {
-		if ( purp != Mediap->M_mfixpurp ) {
+	if (Mediap->M_flmfixvalpr) {
+		if (purp != Mediap->M_mfixpurp) {
 			Mediap->M_flmfixvalpr = BOOL_FALSE;
 			Mediap->M_pmfixvalpr = BOOL_FALSE;
 		}
@@ -3918,15 +3918,15 @@
 	/* if restore is complete, return indication. be sure to end read
 	 * if active.
 	 */
-	if ( purp == PURP_NONDIR
+	if (purp == PURP_NONDIR
 	     &&
-	     pi_alldone( )) {
-		if ( Mediap->M_pos == POS_ATHDR
+	     pi_alldone()) {
+		if (Mediap->M_pos == POS_ATHDR
 		     ||
 		     Mediap->M_pos == POS_INDIR
 		     ||
-		     Mediap->M_pos == POS_ATNONDIR ) {
-			( * dop->do_end_read )( drivep );
+		     Mediap->M_pos == POS_ATNONDIR) {
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 		}
@@ -3936,7 +3936,7 @@
 	/* loop searching for an acceptable media file.
 	 * change media as necessary.
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		bool_t emptypr; /* begin_read says drive empty */
 		bool_t partofdumppr;
 		bool_t hassomepr;
@@ -3956,23 +3956,23 @@
 
 		/* check if no point in going on
 		 */
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
-		if ( donesyncp && *donesyncp == SYNC_DONE ) {
+		if (donesyncp && *donesyncp == SYNC_DONE) {
 			return RV_DONE;
 		}
-		if ( purp == PURP_NONDIR
+		if (purp == PURP_NONDIR
 		     &&
-		     pi_alldone( )) {
+		     pi_alldone()) {
 			return RV_NOMORE;
 		}
 
 		/* if we have a useless media object, get another one
 		 */
-		if ( Mediap->M_pos == POS_USELESS
+		if (Mediap->M_pos == POS_USELESS
 		     ||
-		     Mediap->M_pos == POS_BLANK ) {
+		     Mediap->M_pos == POS_BLANK) {
 			goto newmedia;
 		}
 
@@ -3980,41 +3980,41 @@
 		 * a media file, that media file has already been
 		 * searched, so set pos to cause another begin read
 		 */
-		if ( purp == PURP_SEARCH ) {
-			if ( Mediap->M_pos == POS_ATHDR
+		if (purp == PURP_SEARCH) {
+			if (Mediap->M_pos == POS_ATHDR
 			     ||
 			     Mediap->M_pos == POS_INDIR
 			     ||
-			     Mediap->M_pos == POS_ATNONDIR ) {
+			     Mediap->M_pos == POS_ATNONDIR) {
 				Mediap->M_pos = POS_UNKN;
 			}
 		}
 
 		/* if already have a media file, skip the begin_read
 		 */
-		if ( Mediap->M_pos == POS_ATHDR
+		if (Mediap->M_pos == POS_ATHDR
 		     ||
 		     Mediap->M_pos == POS_INDIR
 		     ||
-		     Mediap->M_pos == POS_ATNONDIR ) {
+		     Mediap->M_pos == POS_ATNONDIR) {
 			goto validate;
 		}
 
 		/* see if the indices say we've seen all there is to see
 		 */
-		if ( Mediap->M_flmfixvalpr ) {
-			if ( Mediap->M_pos == POS_UNKN ) {
-				if ( Mediap->M_lmfix + 1 == Mediap->M_fmfix ) {
+		if (Mediap->M_flmfixvalpr) {
+			if (Mediap->M_pos == POS_UNKN) {
+				if (Mediap->M_lmfix + 1 == Mediap->M_fmfix) {
 					goto newmedia;
 				}
 			}
-			if ( Mediap->M_pos == POS_END ) {
-				if ( Mediap->M_fmfix == 0 ) {
+			if (Mediap->M_pos == POS_END) {
+				if (Mediap->M_fmfix == 0) {
 					goto newmedia;
 				}
-				if ( Mediap->M_fsfixvalpr
+				if (Mediap->M_fsfixvalpr
 				     &&
-				     Mediap->M_fmfix <= Mediap->M_fsfix ) {
+				     Mediap->M_fmfix <= Mediap->M_fsfix) {
 					goto newmedia;
 				}
 			}
@@ -4025,23 +4025,23 @@
 		 * afterwards check for interrupt or if someone else
 		 * has finished the job.
 		 */
-		if ( Mediap->M_pos == POS_END ) {
-			if ( ! ( dcaps & DRIVE_CAP_REWIND )) {
+		if (Mediap->M_pos == POS_END) {
+			if (! (dcaps & DRIVE_CAP_REWIND)) {
 				goto newmedia;
 			}
-			mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-			      "rewinding\n") );
-			( * drivep->d_opsp->do_rewind )( drivep );
+			mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+			      "rewinding\n"));
+			(* drivep->d_opsp->do_rewind)(drivep);
 			Mediap->M_pos = POS_UNKN;
-			if ( cldmgr_stop_requested( )) {
+			if (cldmgr_stop_requested()) {
 				return RV_INTR;
 			}
-			if ( donesyncp && *donesyncp == SYNC_DONE ) {
+			if (donesyncp && *donesyncp == SYNC_DONE) {
 				return RV_DONE;
 			}
-			if ( purp == PURP_NONDIR
+			if (purp == PURP_NONDIR
 			     &&
-			     pi_alldone( )) {
+			     pi_alldone()) {
 				return RV_NOMORE;
 			}
 		}
@@ -4050,52 +4050,52 @@
 		 * bail if catastrophic. also, tell pi about EOD/EOM
 		 * if appropriate.
 		 */
-		rval = ( * drivep->d_opsp->do_begin_read )( drivep );
-		switch ( rval ) {
+		rval = (* drivep->d_opsp->do_begin_read)(drivep);
+		switch (rval) {
 		case 0:
-			mlog_lock( );
-			mlog( MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
+			mlog_lock();
+			mlog(MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
 			      "examining media file %u\n"),
-			      mrhdrp->mh_mediafileix );
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			      mrhdrp->mh_mediafileix);
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "file %u in "
 			      "object %u "
 			      "of stream %u\n",
 			      mrhdrp->mh_mediafileix,
 			      mrhdrp->mh_mediaix,
-			      drhdrp->dh_driveix );
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			      drhdrp->dh_driveix);
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "file %u in stream, "
 			      "file %u of dump %u on object\n",
 			      mrhdrp->mh_dumpfileix,
 			      mrhdrp->mh_dumpmediafileix,
-			      mrhdrp->mh_dumpmediaix );
-			mlog_unlock( );
+			      mrhdrp->mh_dumpmediaix);
+			mlog_unlock();
 
 			Mediap->M_pos = POS_ATHDR;
-			if ( Mediap->M_flmfixvalpr ) {
+			if (Mediap->M_flmfixvalpr) {
 				Mediap->M_pmfix = Mediap->M_lmfix;
 				Mediap->M_pmfixvalpr = BOOL_TRUE;
 			}
 
-			pi_note_indrive( drhdrp->dh_driveix,
-					 mrhdrp->mh_mediaid );
+			pi_note_indrive(drhdrp->dh_driveix,
+					 mrhdrp->mh_mediaid);
 
 			break;
 		case DRIVE_ERROR_EOD:
 			Mediap->M_pos = POS_END;
-			if ( Mediap->M_fsfixvalpr ) {
-				assert( purp != PURP_SEARCH );
-				pi_hiteod( Mediap->M_fssix,
-					   Mediap->M_fsoix );
+			if (Mediap->M_fsfixvalpr) {
+				assert(purp != PURP_SEARCH);
+				pi_hiteod(Mediap->M_fssix,
+					   Mediap->M_fsoix);
 			}
 			break;
 		case DRIVE_ERROR_EOM:
 			Mediap->M_pos = POS_END;
-			if ( Mediap->M_fsfixvalpr ) {
-				assert( purp != PURP_SEARCH );
-				pi_hiteom( Mediap->M_fssix,
-					   Mediap->M_fsoix );
+			if (Mediap->M_fsfixvalpr) {
+				assert(purp != PURP_SEARCH);
+				pi_hiteom(Mediap->M_fssix,
+					   Mediap->M_fsoix);
 			}
 			break;
 		case DRIVE_ERROR_MEDIA:
@@ -4133,12 +4133,12 @@
 validate:
 		/* update the positional indices
 		 */
-		if ( Mediap->M_pos == POS_ATHDR
+		if (Mediap->M_pos == POS_ATHDR
 		     ||
 		     Mediap->M_pos == POS_INDIR
 		     ||
-		     Mediap->M_pos == POS_ATNONDIR ) {
-			if ( ! Mediap->M_flmfixvalpr ) {
+		     Mediap->M_pos == POS_ATNONDIR) {
+			if (! Mediap->M_flmfixvalpr) {
 				Mediap->M_fmfix = mrhdrp->mh_mediafileix;
 				Mediap->M_mfixpurp = purp;
 				Mediap->M_flmfixvalpr = BOOL_TRUE;
@@ -4148,13 +4148,13 @@
 
 		/* check for interrupt. be sure to end_read if necessary
 		 */
-		if ( cldmgr_stop_requested( )) {
-			if ( Mediap->M_pos == POS_ATHDR
+		if (cldmgr_stop_requested()) {
+			if (Mediap->M_pos == POS_ATHDR
 			     ||
 			     Mediap->M_pos == POS_INDIR
 			     ||
-			     Mediap->M_pos == POS_ATNONDIR ) {
-				( * dop->do_end_read )( drivep );
+			     Mediap->M_pos == POS_ATNONDIR) {
+				(* dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 			}
@@ -4164,24 +4164,24 @@
 		/* check if another thread has finished job (for this purpose).
 		 * don't end_read, we will be back.
 		 */
-		if ( donesyncp && *donesyncp == SYNC_DONE ) {
+		if (donesyncp && *donesyncp == SYNC_DONE) {
 			return RV_DONE;
 		}
 
 		/* we may be done due to the actions of other threads.
 		 * if so, return indicating so
 		 */
-		if ( purp == PURP_NONDIR
+		if (purp == PURP_NONDIR
 		     &&
-		     pi_alldone( )) {
+		     pi_alldone()) {
 			return RV_NOMORE;
 		}
 
 		/* if the media object is useless, go get more
 		 */
-		if ( Mediap->M_pos == POS_USELESS
+		if (Mediap->M_pos == POS_USELESS
 		     ||
-		     Mediap->M_pos == POS_BLANK ) {
+		     Mediap->M_pos == POS_BLANK) {
 			goto newmedia;
 		}
 
@@ -4190,71 +4190,71 @@
 		 * ask the inventory if there is any point in examining
 		 * the beginning of the object.
 		 */
-		if ( Mediap->M_pos == POS_END
+		if (Mediap->M_pos == POS_END
 		     &&
 		     purp != PURP_SEARCH
 		     &&
 		     Mediap->M_fsfixvalpr
 		     &&
-		     pi_know_no_more_on_object( purp,
+		     pi_know_no_more_on_object(purp,
 						Mediap->M_fssix,
-						Mediap->M_fsoix )) {
+						Mediap->M_fsoix)) {
 			goto newmedia;
 		}
 
 		/* if we hit the end, go back to the top, where
 		 * we will decide if we should rewind or get new media.
 		 */
-		if ( Mediap->M_pos == POS_END ) {
+		if (Mediap->M_pos == POS_END) {
 			continue;
 		}
 
 		/* if the purpose is to search, return this media file
 		 */
-		if ( purp == PURP_SEARCH ) {
-			assert( Mediap->M_pos == POS_ATHDR );
+		if (purp == PURP_SEARCH) {
+			assert(Mediap->M_pos == POS_ATHDR);
 			return RV_OK;
 		}
 
 		/* see if this media file is part of the desired dump session
 		 */
-		partofdumppr = ( bool_t )(uuid_compare( persp->s.dumpid,
+		partofdumppr = (bool_t)(uuid_compare(persp->s.dumpid,
 						     grhdrp->gh_dumpid) == 0);
 		if (!partofdumppr) {
 		    char gh_string_uuid[UUID_STR_LEN + 1];
 		    char inv_string_uuid[UUID_STR_LEN + 1];
 
-		    uuid_unparse( grhdrp->gh_dumpid, gh_string_uuid);
-		    uuid_unparse( persp->s.dumpid, inv_string_uuid);
-		    mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+		    uuid_unparse(grhdrp->gh_dumpid, gh_string_uuid);
+		    uuid_unparse(persp->s.dumpid, inv_string_uuid);
+		    mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 		          "inventory session uuid (%s) does not match "
 		          "the media header's session uuid (%s)\n"),
-			  inv_string_uuid, gh_string_uuid );
+			  inv_string_uuid, gh_string_uuid);
 		}
 
 		/* if media file dump id is different from the preceeding
 		 * media file, print something useful at TRACE verbosity.
 		 */
-		if ( uuid_compare( prevmfiledumpid,
+		if (uuid_compare(prevmfiledumpid,
 				   grhdrp->gh_dumpid) != 0) {
 
 			char string_uuid[UUID_STR_LEN + 1];
 
-			mlog_lock( );
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			mlog_lock();
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "dump session label: \"%s\"\n",
-			      grhdrp->gh_dumplabel );
+			      grhdrp->gh_dumplabel);
 
-			uuid_unparse( grhdrp->gh_dumpid, string_uuid);
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			uuid_unparse(grhdrp->gh_dumpid, string_uuid);
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "dump session id: %s\n",
-			      string_uuid );
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			      string_uuid);
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "stream %u, object %u, file %u\n",
 			      drhdrp->dh_driveix,
 			      mrhdrp->mh_mediaix,
-			      mrhdrp->mh_dumpmediafileix );
-			mlog_unlock( );
+			      mrhdrp->mh_dumpmediafileix);
+			mlog_unlock();
 			uuid_copy(prevmfiledumpid, grhdrp->gh_dumpid);
 		}
 
@@ -4263,14 +4263,14 @@
 		 * dump, we know we have hit the end of the stream. tell the
 		 * persistent inventory.
 		 */
-		 if ( ! partofdumppr
+		 if (! partofdumppr
 		      &&
 		      Mediap->M_fsfixvalpr
 		      &&
-		      Mediap->M_lmfix > Mediap->M_fsfix ) {
-			pi_hitnextdump( Mediap->M_fssix,
+		      Mediap->M_lmfix > Mediap->M_fsfix) {
+			pi_hitnextdump(Mediap->M_fssix,
 					Mediap->M_fsoix,
-					Mediap->M_lmfix );
+					Mediap->M_lmfix);
 		}
 
 		/* if this media file is not part of the desired dump session,
@@ -4278,15 +4278,15 @@
 		 * object was part of the dump, we know we have hit the end of
 		 * the stream. check if we are done.
 		 */
-		 if ( ! partofdumppr
+		 if (! partofdumppr
 		      &&
 		      purp == PURP_NONDIR
 		      &&
 		      Mediap->M_fsfixvalpr
 		      &&
-		      Mediap->M_lmfix > Mediap->M_fsfix ) {
-			if ( pi_alldone( )) {
-				( * dop->do_end_read )( drivep );
+		      Mediap->M_lmfix > Mediap->M_fsfix) {
+			if (pi_alldone()) {
+				(* dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 				return RV_NOMORE;
@@ -4297,18 +4297,18 @@
 		 * and preceeding media files on this object were, decide if
 		 * we need to rewind and look at the beginning of the object.
 		 */
-		if ( ! partofdumppr
+		if (! partofdumppr
 		     &&
 		     Mediap->M_fsfixvalpr
 		     &&
-		     Mediap->M_fmfix <= Mediap->M_fsfix ) {
-			( * dop->do_end_read )( drivep );
+		     Mediap->M_fmfix <= Mediap->M_fsfix) {
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
-			if ( dcaps & DRIVE_CAP_REWIND ) {
-				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-				  "rewinding\n") );
-				( * drivep->d_opsp->do_rewind )( drivep );
+			if (dcaps & DRIVE_CAP_REWIND) {
+				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+				  "rewinding\n"));
+				(* drivep->d_opsp->do_rewind)(drivep);
 				continue;
 			} else {
 				goto newmedia;
@@ -4318,8 +4318,8 @@
 		/* if this media file is not part of the desired dump session,
 		 * and the above conditions were not met, then keep looking
 		 */
-		if ( ! partofdumppr ) {
-			( * dop->do_end_read )( drivep );
+		if (! partofdumppr) {
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 			continue;
@@ -4328,7 +4328,7 @@
 		/* record the index within this media object of the first
 		 * media file in the dump stream
 		 */
-		if ( ! Mediap->M_fsfixvalpr ) {
+		if (! Mediap->M_fsfixvalpr) {
 			Mediap->M_fsfix =
 				     mrhdrp->mh_mediafileix
 				     -
@@ -4341,52 +4341,52 @@
 		/* this media file is part of the dump. add it to the
 		 * persistent inventory and get a file handle.
 		 */
-		fileh = pi_addfile( Mediap,
+		fileh = pi_addfile(Mediap,
 				    grhdrp,
 				    drhdrp,
 				    mrhdrp,
 				    scrhdrp,
-				    drivep );
+				    drivep);
 
-		if ( fileh == DH_NULL ) {
+		if (fileh == DH_NULL) {
 			return RV_CORE;
 		}
 
-		pi_lock( );
-		objh = DH2F( fileh )->f_parh;
-		DH2O( objh )->o_indriveix = drivep->d_index;
-		DH2O( objh )->o_indrivepr = BOOL_TRUE;
-		pi_unlock( );
+		pi_lock();
+		objh = DH2F(fileh)->f_parh;
+		DH2O(objh)->o_indriveix = drivep->d_index;
+		DH2O(objh)->o_indrivepr = BOOL_TRUE;
+		pi_unlock();
 
-		pi_note_underhead( objh, fileh );
+		pi_note_underhead(objh, fileh);
 
 		/* if purp is nondir, we may be done.
 		 */
-		if ( purp == PURP_NONDIR && pi_alldone( )) {
-			( * dop->do_end_read )( drivep );
+		if (purp == PURP_NONDIR && pi_alldone()) {
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			return RV_NOMORE;
 		}
 
 		/* check for a wraparound
 		 */
-		if ( Mediap->M_flmfixvalpr ) {
-			if ( Mediap->M_fsfixvalpr
+		if (Mediap->M_flmfixvalpr) {
+			if (Mediap->M_fsfixvalpr
 			     &&
 			     Mediap->M_fmfix <= Mediap->M_fsfix
 			     &&
-			     Mediap->M_lmfix < Mediap->M_fmfix ) {
-				( * dop->do_end_read )( drivep );
+			     Mediap->M_lmfix < Mediap->M_fmfix) {
+				(* dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 				goto newmedia;
 			}
-			if ( Mediap->M_pmfixvalpr
+			if (Mediap->M_pmfixvalpr
 			     &&
 			     Mediap->M_pmfix < Mediap->M_fmfix
 			     &&
-			     Mediap->M_lmfix > Mediap->M_fmfix ) {
-				( * dop->do_end_read )( drivep );
+			     Mediap->M_lmfix > Mediap->M_fmfix) {
+				(* dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 				goto newmedia;
@@ -4399,26 +4399,26 @@
 		 * decide if any preceeding media files are useful and if so
 		 * go get them. otherwise get another media object.
 		 */
-		if ( MEDIA_TERMINATOR_CHK( mrhdrp )
+		if (MEDIA_TERMINATOR_CHK(mrhdrp)
 		     ||
 		     scrhdrp->cih_mediafiletype
 		     ==
-		     CIH_MEDIAFILETYPE_INVENTORY ) {
-			( * dop->do_end_read )( drivep );
+		     CIH_MEDIAFILETYPE_INVENTORY) {
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
-			if ( pi_know_no_more_on_object( purp,
+			if (pi_know_no_more_on_object(purp,
 							Mediap->M_fssix,
-							Mediap->M_fsoix )) {
+							Mediap->M_fsoix)) {
 				goto newmedia;
 			}
-			if ( Mediap->M_fmfix > Mediap->M_fsfix
+			if (Mediap->M_fmfix > Mediap->M_fsfix
 			     &&
-			     ( dcaps & DRIVE_CAP_REWIND )) {
-				pi_note_underhead( objh, DH_NULL );
-				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-					"rewinding\n") );
-				( * drivep->d_opsp->do_rewind )( drivep );
+			     (dcaps & DRIVE_CAP_REWIND)) {
+				pi_note_underhead(objh, DH_NULL);
+				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+					"rewinding\n"));
+				(* drivep->d_opsp->do_rewind)(drivep);
 				continue;
 			}
 			goto newmedia;
@@ -4428,30 +4428,30 @@
 		 * at the hdr or has already been tried, get another one.
 		 * use the persistent inventory to do this intelligently.
 		 */
-		if ( purp == PURP_DIR
+		if (purp == PURP_DIR
 		     &&
-		     ( Mediap->M_pos != POS_ATHDR
+		     (Mediap->M_pos != POS_ATHDR
 		       ||
-		       DH2F( fileh )->f_dirtriedpr )) {
-			( * dop->do_end_read )( drivep );
+		       DH2F(fileh)->f_dirtriedpr)) {
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
-			if ( pi_know_no_more_beyond_on_object( purp,
+			if (pi_know_no_more_beyond_on_object(purp,
 							       Mediap->M_fssix,
 							       Mediap->M_fsoix,
-						mrhdrp->mh_dumpmediafileix )) {
-				if ( pi_know_no_more_on_object( purp,
+						mrhdrp->mh_dumpmediafileix)) {
+				if (pi_know_no_more_on_object(purp,
 								Mediap->M_fssix,
-							    Mediap->M_fsoix )) {
+							    Mediap->M_fsoix)) {
 					goto newmedia;
 				}
-				if ( Mediap->M_fmfix > Mediap->M_fsfix
+				if (Mediap->M_fmfix > Mediap->M_fsfix
 				     &&
-				     ( dcaps & DRIVE_CAP_REWIND )) {
-					pi_note_underhead( objh, DH_NULL );
-					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-						"rewinding\n") );
-					( * drivep->d_opsp->do_rewind )(drivep);
+				     (dcaps & DRIVE_CAP_REWIND)) {
+					pi_note_underhead(objh, DH_NULL);
+					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+						"rewinding\n"));
+					(* drivep->d_opsp->do_rewind)(drivep);
 					continue;
 				}
 				goto newmedia;
@@ -4462,10 +4462,10 @@
 
 		/* if the purpose is dir, give it to the caller
 		 */
-		if ( purp == PURP_DIR ) {
-			assert( Mediap->M_pos == POS_ATHDR );
-			if ( filehp ) {
-				assert( fileh != DH_NULL );
+		if (purp == PURP_DIR) {
+			assert(Mediap->M_pos == POS_ATHDR);
+			if (filehp) {
+				assert(fileh != DH_NULL);
 				*filehp = fileh;
 			}
 			return RV_OK;
@@ -4477,46 +4477,46 @@
 
 		/* see if this media file contains any inodes not yet restored
 		 */
-		assert( fileh != DH_NULL );
-		pi_lock( );
-		assert( DH2F( fileh )->f_valpr );
-		begino = DH2F( fileh )->f_curegrp.eg_ino;
-		endino = pi_scanfileendino( fileh );
-		hassomepr = inomap_rst_needed( begino, endino );
+		assert(fileh != DH_NULL);
+		pi_lock();
+		assert(DH2F(fileh)->f_valpr);
+		begino = DH2F(fileh)->f_curegrp.eg_ino;
+		endino = pi_scanfileendino(fileh);
+		hassomepr = inomap_rst_needed(begino, endino);
 
 		/* if we have already given up on this media file or
 		 * it doesn't contains anything not yet restored,
 		 * or it can be skipped, move on. force the done flag on,
 		 * so we don't check it again.
 		 */
-		if ( DH2F( fileh )->f_nondirdonepr
+		if (DH2F(fileh)->f_nondirdonepr
 		     ||
-		     DH2F( fileh )->f_nondirskippr
+		     DH2F(fileh)->f_nondirskippr
 		     ||
-		     ! hassomepr ) {
-			if ( ! DH2F( fileh )->f_nondirskippr ) {
-				DH2F( fileh )->f_nondirdonepr = BOOL_TRUE;
+		     ! hassomepr) {
+			if (! DH2F(fileh)->f_nondirskippr) {
+				DH2F(fileh)->f_nondirdonepr = BOOL_TRUE;
 			}
-			pi_unlock( );
-			( * dop->do_end_read )( drivep );
+			pi_unlock();
+			(* dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
-			if ( pi_know_no_more_beyond_on_object( purp,
+			if (pi_know_no_more_beyond_on_object(purp,
 							       Mediap->M_fssix,
 							       Mediap->M_fsoix,
-						mrhdrp->mh_dumpmediafileix )) {
-				if ( pi_know_no_more_on_object( purp,
+						mrhdrp->mh_dumpmediafileix)) {
+				if (pi_know_no_more_on_object(purp,
 								Mediap->M_fssix,
-							    Mediap->M_fsoix )) {
+							    Mediap->M_fsoix)) {
 					goto newmedia;
 				}
-				if ( Mediap->M_fmfix > Mediap->M_fsfix
+				if (Mediap->M_fmfix > Mediap->M_fsfix
 				     &&
-				     ( dcaps & DRIVE_CAP_REWIND )) {
-					pi_note_underhead( objh, DH_NULL );
-					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-						"rewinding\n") );
-					( * drivep->d_opsp->do_rewind )(drivep);
+				     (dcaps & DRIVE_CAP_REWIND)) {
+					pi_note_underhead(objh, DH_NULL);
+					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+						"rewinding\n"));
+					(* drivep->d_opsp->do_rewind)(drivep);
 					continue;
 				}
 				goto newmedia;
@@ -4538,81 +4538,81 @@
 		 * and no check point, can still get there
 		 * by doing dummy read of dirdump.
 		 */
-		assert( fileh != DH_NULL );
-		assert( DH2F( fileh )->f_valpr );
-		resumepr = ( ( DH2F( fileh )->f_firstegrp.eg_ino
+		assert(fileh != DH_NULL);
+		assert(DH2F(fileh)->f_valpr);
+		resumepr = ((DH2F(fileh)->f_firstegrp.eg_ino
 			       !=
-			       DH2F( fileh )->f_curegrp.eg_ino )
+			       DH2F(fileh)->f_curegrp.eg_ino)
 			     ||
-			     ( DH2F( fileh )->f_firstegrp.eg_off
+			     (DH2F(fileh)->f_firstegrp.eg_off
 			       !=
-			       DH2F( fileh )->f_curegrp.eg_off ));
-		chkpnt = DH2F( fileh )->f_curmark;
-		pi_unlock( );
-		fhcs = ( scrhdrp->cih_dumpattr
+			       DH2F(fileh)->f_curegrp.eg_off));
+		chkpnt = DH2F(fileh)->f_curmark;
+		pi_unlock();
+		fhcs = (scrhdrp->cih_dumpattr
 			 &
-			 CIH_DUMPATTR_FILEHDR_CHECKSUM )
+			 CIH_DUMPATTR_FILEHDR_CHECKSUM)
 		       ?
 		       BOOL_TRUE
 		       :
 		       BOOL_FALSE;
 		canseeknextpr = dcaps & DRIVE_CAP_NEXTMARK;
-		switch( Mediap->M_pos ) {
+		switch(Mediap->M_pos) {
 		case POS_ATHDR:
 		case POS_INDIR:
-			if ( resumepr ) {
-			    mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+			if (resumepr) {
+			    mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 				  "seeking past portion of media file "
-				  "already restored\n") );
-			    rval = ( * dop->do_seek_mark )( drivep,
-							    &chkpnt );
-			    if ( ! rval ) {
+				  "already restored\n"));
+			    rval = (* dop->do_seek_mark)(drivep,
+							    &chkpnt);
+			    if (! rval) {
 				    rv_t rv;
-				    rv = read_filehdr( drivep,
+				    rv = read_filehdr(drivep,
 						       fhdrp,
-						       fhcs );
-				    if ( rv != RV_OK ) {
+						       fhcs);
+				    if (rv != RV_OK) {
 					    rval = 1;
 				    } else {
-					    mlog( MLOG_TRACE | MLOG_MEDIA,
+					    mlog(MLOG_TRACE | MLOG_MEDIA,
 						  "positioned at unrestored "
-						  "portion of media file\n" );
+						  "portion of media file\n");
 				    }
 			    }
-			} else if ( canseeknextpr ) {
-			    mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+			} else if (canseeknextpr) {
+			    mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 				  "seeking past media file "
-				  "directory dump\n") );
-			    rval = ( * dop->do_next_mark )( drivep);
-			    if ( ! rval ) {
+				  "directory dump\n"));
+			    rval = (* dop->do_next_mark)(drivep);
+			    if (! rval) {
 				    rv_t rv;
-				    rv = read_filehdr( drivep,
+				    rv = read_filehdr(drivep,
 						       fhdrp,
-						       fhcs );
-				    if ( rv != RV_OK ) {
+						       fhcs);
+				    if (rv != RV_OK) {
 					    rval = 1;
 				    } else {
-					    mlog( MLOG_TRACE | MLOG_MEDIA,
+					    mlog(MLOG_TRACE | MLOG_MEDIA,
 						  "positioned at "
 						  "media file "
-						  "non-directory dump\n" );
+						  "non-directory dump\n");
 				    }
 			    }
-			} else if ( Mediap->M_pos == POS_ATHDR ) {
-			    mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+			} else if (Mediap->M_pos == POS_ATHDR) {
+			    mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 				  "seeking past media file "
-				  "directory dump\n") );
-			    rv = eatdirdump( drivep,
+				  "directory dump\n"));
+			    rv = eatdirdump(drivep,
 					     fileh,
 					     scrhdrp,
-					     fhdrp );
-			    if ( rv != RV_OK ) {
+					     fhdrp);
+			    if (rv != RV_OK) {
 				    rval = 1;
 			    } else {
-				    mlog( MLOG_TRACE | MLOG_MEDIA,
+				    mlog(MLOG_TRACE | MLOG_MEDIA,
 					  "positioned at "
 					  "media file "
-					  "non-directory dump\n" );
+					  "non-directory dump\n");
 			    }
 			} else {
 			    rval = 1;
@@ -4622,7 +4622,7 @@
 			rval = 0;
 			break;
 		default:
-		    assert( 0 );
+		    assert(0);
 		    rval = 1;
 		    break;
 		}
@@ -4630,17 +4630,17 @@
 		/* if error encountered during fine positioning,
 		 * mark file so we won't try it again
 		 */
-		if ( rval ) {
-			DH2F( fileh )->f_nondirdonepr = BOOL_TRUE;
+		if (rval) {
+			DH2F(fileh)->f_nondirdonepr = BOOL_TRUE;
 		} else {
 			Mediap->M_pos = POS_ATNONDIR;
 		}
 
 		/* if no error during fine positioning, return.
 		 */
-		if ( ! rval ) {
-			if ( filehp ) {
-				assert( fileh != DH_NULL );
+		if (! rval) {
+			if (filehp) {
+				assert(fileh != DH_NULL);
 				*filehp = fileh;
 			}
 			return RV_OK;
@@ -4650,26 +4650,26 @@
 		 * media files on this object? if so, continue; if not, get
 		 * more media.
 		 */
-		( * dop->do_end_read )( drivep );
+		(* dop->do_end_read)(drivep);
 		Mediap->M_pos = POS_UNKN;
 		fileh = DH_NULL;
-		assert( purp == PURP_NONDIR );
-		if ( pi_know_no_more_beyond_on_object( purp,
+		assert(purp == PURP_NONDIR);
+		if (pi_know_no_more_beyond_on_object(purp,
 						       Mediap->M_fssix,
 						       Mediap->M_fsoix,
-					mrhdrp->mh_dumpmediafileix )) {
-			if ( pi_know_no_more_on_object( purp,
+					mrhdrp->mh_dumpmediafileix)) {
+			if (pi_know_no_more_on_object(purp,
 							Mediap->M_fssix,
-							Mediap->M_fsoix )) {
+							Mediap->M_fsoix)) {
 				goto newmedia;
 			}
-			if ( Mediap->M_fmfix > Mediap->M_fsfix
+			if (Mediap->M_fmfix > Mediap->M_fsfix
 			     &&
-			     ( dcaps & DRIVE_CAP_REWIND )) {
-				pi_note_underhead( objh, DH_NULL );
-				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-					"rewinding\n") );
-				( * drivep->d_opsp->do_rewind )(drivep);
+			     (dcaps & DRIVE_CAP_REWIND)) {
+				pi_note_underhead(objh, DH_NULL);
+				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+					"rewinding\n"));
+				(* drivep->d_opsp->do_rewind)(drivep);
 				continue;
 			}
 			goto newmedia;
@@ -4687,7 +4687,7 @@
 		/* if we are searching and some other thread completed
 		 * the search, don't pop the media unless it is useless
 		 */
-		if ( purp == PURP_SEARCH
+		if (purp == PURP_SEARCH
 		     &&
 		     Mediap->M_pos != POS_USELESS
 		     &&
@@ -4695,15 +4695,15 @@
 		     &&
 		     donesyncp
 		     &&
-		     *donesyncp == SYNC_DONE ) {
+		     *donesyncp == SYNC_DONE) {
 			return RV_DONE;
 		}
 
 		/* if media not removable, just return
 		 */
-		if ( ( * dop->do_get_device_class )( drivep )
+		if ((* dop->do_get_device_class)(drivep)
 		     ==
-		     DEVICE_NONREMOVABLE )
+		     DEVICE_NONREMOVABLE)
 		{
 		    /* if no error has already been detected then don't log
 		       a failure */
@@ -4714,13 +4714,13 @@
 
 		/* check for an interrupt
 		 */
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
 		/* check if we are done.
 		 */
-		switch( purp ) {
+		switch(purp) {
 		case PURP_SEARCH:
 			knownholespr = BOOL_TRUE;
 			maybeholespr = BOOL_FALSE;
@@ -4729,54 +4729,54 @@
 		case PURP_DIR:
 			knownholespr = BOOL_FALSE;
 			maybeholespr = BOOL_FALSE;
-			bagp = pi_neededobjs_dir_alloc( &knownholespr,
-							&maybeholespr );
+			bagp = pi_neededobjs_dir_alloc(&knownholespr,
+							&maybeholespr);
 			break;
 		case PURP_NONDIR:
 			knownholespr = BOOL_FALSE;
 			maybeholespr = BOOL_FALSE;
-			bagp = pi_neededobjs_nondir_alloc( &knownholespr,
+			bagp = pi_neededobjs_nondir_alloc(&knownholespr,
 							   &maybeholespr,
 							   BOOL_FALSE,
-							   BOOL_FALSE );
+							   BOOL_FALSE);
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 		}
 
-		if ( ! bagp && ! knownholespr && ! maybeholespr ) {
+		if (! bagp && ! knownholespr && ! maybeholespr) {
 			/* if PURP_DIR, this may be a problem
 			 */
-			if ( purp == PURP_NONDIR ) {
+			if (purp == PURP_NONDIR) {
 				return RV_NOMORE;
 			}
 		}
 
 		/* eject media if drive not already empty
 		 */
-		if ( ! emptypr ) {
+		if (! emptypr) {
 			int dcaps = drivep->d_capabilities;
-			if ( purp == PURP_SEARCH ) {
-				if ( Mediap->M_pos == POS_USELESS ) {
-					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-					      "media object not useful\n") );
-				} else if ( Mediap->M_pos == POS_BLANK ) {
-					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-					      "media object empty\n") );
+			if (purp == PURP_SEARCH) {
+				if (Mediap->M_pos == POS_USELESS) {
+					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+					      "media object not useful\n"));
+				} else if (Mediap->M_pos == POS_BLANK) {
+					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+					      "media object empty\n"));
 				} else {
-					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 					      "all media files examined, "
-					      "none selected for restoral\n") );
+					      "none selected for restoral\n"));
 				}
 			}
-			if ( dcaps & DRIVE_CAP_EJECT ) {
-				( * dop->do_eject_media )( drivep );
+			if (dcaps & DRIVE_CAP_EJECT) {
+				(* dop->do_eject_media)(drivep);
 			}
 		}
 
 		/* tell the persistent inventory this drive is now empty
 		 */
-		pi_driveempty( drivep->d_index );
+		pi_driveempty(drivep->d_index);
 
 		/* invalidate all positional descriptors
 		 */
@@ -4790,80 +4790,80 @@
 		/* ask for a media change: supply a list of media objects
 		 * which may contain useful media files
 		 */
-		if ( dlog_allowed( )) {
+		if (dlog_allowed()) {
 			/* If an alert program has been specified , run it.
 			 */
 			if (media_change_alert_program != NULL)
 				system(media_change_alert_program);
 
-			if ( drivecnt > 1 && ! stdoutpiped ) {
+			if (drivecnt > 1 && ! stdoutpiped) {
 				ix_t thrdix = drivep->d_index;
-				if ( bagp ) {
-					pi_neededobjs_free( bagp );
+				if (bagp) {
+					pi_neededobjs_free(bagp);
 					bagp = 0;
 				}
-				assert( sistr );
-				mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
+				assert(sistr);
+				mlog(MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
 				      "please change media: "
 				      "type %s to confirm media change\n"),
-				      sistr );
-				set_mcflag( thrdix );
-				while ( mcflag[ thrdix ] ) {
-					sleep( 2 );
-					if ( cldmgr_stop_requested( )) {
-						clr_mcflag( thrdix );
+				      sistr);
+				set_mcflag(thrdix);
+				while (mcflag[thrdix]) {
+					sleep(2);
+					if (cldmgr_stop_requested()) {
+						clr_mcflag(thrdix);
 						return RV_INTR;
 					}
-					if ( purp == PURP_NONDIR
+					if (purp == PURP_NONDIR
 					     &&
-					     pi_alldone( )) {
-						clr_mcflag( thrdix );
+					     pi_alldone()) {
+						clr_mcflag(thrdix);
 						return RV_NOMORE;
 					}
 				}
 				ok = BOOL_TRUE;
 			} else {
-				ok = Media_prompt_change( drivep,
+				ok = Media_prompt_change(drivep,
 							  purp,
 							  bagp,
 							  knownholespr,
-							  maybeholespr );
+							  maybeholespr);
 			}
 		} else {
 			ok = BOOL_FALSE;
 		}
-		if ( bagp ) {
-			pi_neededobjs_free( bagp );
+		if (bagp) {
+			pi_neededobjs_free(bagp);
 			bagp = 0;
 		}
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
-		if ( ! ok ) {
+		if (! ok) {
 			return RV_QUIT;
 		}
 	}
 	/* NOTREACHED */
 }
 
-/* figures out and calls if needed do_end_read( ).
+/* figures out and calls if needed do_end_read().
  */
 static void
-Media_end( Media_t *Mediap )
+Media_end(Media_t *Mediap)
 {
 	drive_t *drivep = Mediap->M_drivep;
 	drive_ops_t *dop = drivep->d_opsp;
 
-	mlog( MLOG_DEBUG | MLOG_MEDIA,
+	mlog(MLOG_DEBUG | MLOG_MEDIA,
 	      "Media_end: pos==%d\n",
-	      Mediap->M_pos );
+	      Mediap->M_pos);
 
-	if ( Mediap->M_pos == POS_ATHDR
+	if (Mediap->M_pos == POS_ATHDR
 	     ||
 	     Mediap->M_pos == POS_INDIR
 	     ||
-	     Mediap->M_pos == POS_ATNONDIR ) {
-		( * dop->do_end_read )( drivep );
+	     Mediap->M_pos == POS_ATNONDIR) {
+		(* dop->do_end_read)(drivep);
 		Mediap->M_pos = POS_UNKN;
 	}
 }
@@ -4892,37 +4892,37 @@
  * terminators and inventories.
  */
 static void
-pi_lock( void )
+pi_lock(void)
 {
-	qlock_lock( tranp->t_pilockh );
+	qlock_lock(tranp->t_pilockh);
 }
 
 static void
-pi_unlock( void )
+pi_unlock(void)
 {
-	qlock_unlock( tranp->t_pilockh );
+	qlock_unlock(tranp->t_pilockh);
 }
 
 /* sets check point in media file descriptor
  */
 static void
-pi_checkpoint( dh_t fileh, drive_mark_t *drivemarkp, xfs_ino_t ino, off64_t off )
+pi_checkpoint(dh_t fileh, drive_mark_t *drivemarkp, xfs_ino_t ino, off64_t off)
 {
-	pi_lock( );
-	DH2F( fileh )->f_curmark = *drivemarkp;
-	DH2F( fileh )->f_curegrp.eg_ino = ino;
-	DH2F( fileh )->f_curegrp.eg_off = off;
-	pi_unlock( );
+	pi_lock();
+	DH2F(fileh)->f_curmark = *drivemarkp;
+	DH2F(fileh)->f_curegrp.eg_ino = ino;
+	DH2F(fileh)->f_curegrp.eg_off = off;
+	pi_unlock();
 }
 
 /* lock must be held by caller
  */
 static bool_t
-pi_allocdesc( dh_t *deschp )
+pi_allocdesc(dh_t *deschp)
 {
 	dh_t desch;
 
-	if ( persp->s.descfreeh == DH_NULL ) {
+	if (persp->s.descfreeh == DH_NULL) {
 		ix_t stpgcnt = persp->a.stpgcnt;
 		ix_t olddescpgcnt = persp->s.descpgcnt;
 		ix_t newdescpgcnt = olddescpgcnt + DAU;
@@ -4933,53 +4933,53 @@
 
 		/* first unmap if any existing descriptors
 		 */
-		if ( descp ) {
-			assert( olddescpgcnt > 0 );
-			rval = munmap( ( void * )descp,
-				       olddescpgcnt * pgsz );
-			assert( ! rval );
+		if (descp) {
+			assert(olddescpgcnt > 0);
+			rval = munmap((void *)descp,
+				       olddescpgcnt * pgsz);
+			assert(! rval);
 			descp = 0;
 		} else {
-			assert( olddescpgcnt == 0 );
+			assert(olddescpgcnt == 0);
 		}
 
 		/* remap with DAU more pages of descriptors
 		 */
-		assert( stpgcnt <= ( ix_t )INTGENMAX );
-		assert( newdescpgcnt > 0 );
-		descp = ( pers_desc_t * ) mmap_autogrow( newdescpgcnt * pgsz,
+		assert(stpgcnt <= (ix_t)INTGENMAX);
+		assert(newdescpgcnt > 0);
+		descp = (pers_desc_t *) mmap_autogrow(newdescpgcnt * pgsz,
 						tranp->t_persfd,
-						( off_t )perssz
+						(off_t)perssz
 						+
-						( off_t )( stpgcnt * pgsz ));
-		if ( descp == ( pers_desc_t * )( -1 )) {
-			pi_unlock( );
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+						(off_t)(stpgcnt * pgsz));
+		if (descp == (pers_desc_t *)(-1)) {
+			pi_unlock();
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 			      "could not remap persistent state file "
 			      "inv %s: %d (%s)\n"),
 			      perspath,
 			      errno,
-			      strerror( errno ));
-			pi_lock( );
+			      strerror(errno));
+			pi_lock();
 			descp = 0;
 			return BOOL_FALSE;
 		}
-		persp->s.descfreeh = ( dh_t )( olddescpgcnt * pgsz + 1 );
-		for ( descix = 0, desch = persp->s.descfreeh
+		persp->s.descfreeh = (dh_t)(olddescpgcnt * pgsz + 1);
+		for (descix = 0, desch = persp->s.descfreeh
 		      ;
-		      descix < ( DAU * descppg ) - 1
+		      descix < (DAU * descppg) - 1
 		      ;
-		      descix++, desch += PERS_DESCSZ ) {
-			DH2D( desch )->d_nexth = desch + PERS_DESCSZ;
+		      descix++, desch += PERS_DESCSZ) {
+			DH2D(desch)->d_nexth = desch + PERS_DESCSZ;
 		}
-		DH2D( desch )->d_nexth = DH_NULL;
+		DH2D(desch)->d_nexth = DH_NULL;
 		persp->s.descpgcnt = newdescpgcnt;
 	}
 
 	desch = persp->s.descfreeh;
-	persp->s.descfreeh = DH2D( desch )->d_nexth;
-	memset( ( void * )DH2D( desch ), 0, sizeof( pers_desc_t ));
-	assert( desch != DH_NULL );
+	persp->s.descfreeh = DH2D(desch)->d_nexth;
+	memset((void *)DH2D(desch), 0, sizeof(pers_desc_t));
+	assert(desch != DH_NULL);
 	*deschp = desch;
 	return BOOL_TRUE;
 }
@@ -4989,7 +4989,7 @@
  * adds objects.
  */
 static dh_t
-pi_insertfile( ix_t drivecnt,
+pi_insertfile(ix_t drivecnt,
 	       ix_t driveix,
 	       ix_t mediaix,
 	       bool_t idlabvalpr,
@@ -5009,7 +5009,7 @@
 	       off64_t startoffset,
 	       int flags,
 	       bool_t fileszvalpr,
-	       off64_t filesz )
+	       off64_t filesz)
 {
 	ix_t strmix;
 	dh_t strmh;
@@ -5021,100 +5021,100 @@
 	dh_t prevfileh;
 	bool_t ok;
 
-	pi_lock( );
+	pi_lock();
 
 	/* first alloc stream descriptors if needed
 	 */
-	if ( persp->s.strmheadh == DH_NULL ) {
-		for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-			ok = pi_allocdesc( &strmh );
-			if ( ! ok ) {
-				pi_unlock( );
+	if (persp->s.strmheadh == DH_NULL) {
+		for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+			ok = pi_allocdesc(&strmh);
+			if (! ok) {
+				pi_unlock();
 				return DH_NULL;
 			}
-			DH2S( strmh )->s_nexth = persp->s.strmheadh;
+			DH2S(strmh)->s_nexth = persp->s.strmheadh;
 			persp->s.strmheadh = strmh;
 		}
 	}
 
 	/* get handle to this stream
 	 */
-	for ( strmix = 0,
+	for (strmix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmix < driveix
 	      ;
 	      strmix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
-	assert( strmh != DH_NULL );
+	assert(strmh != DH_NULL);
 
 	/* get handle to this object by walking/constructing this stream's
 	 * object list, up to the desired object
 	 */
 	objh = prevobjh = DH_NULL;
-	for ( objix = 0 ; objix <= mediaix ; objix++ ) {
+	for (objix = 0 ; objix <= mediaix ; objix++) {
 		prevobjh = objh;
-		if ( objix == 0 ) {
-			objh = DH2S( strmh )->s_cldh;
+		if (objix == 0) {
+			objh = DH2S(strmh)->s_cldh;
 		} else {
-			objh = DH2O( prevobjh )->o_nexth;
+			objh = DH2O(prevobjh)->o_nexth;
 		}
-		if ( objh == DH_NULL ) {
-			ok = pi_allocdesc( &objh );
-			if ( ! ok ) {
-				pi_unlock( );
+		if (objh == DH_NULL) {
+			ok = pi_allocdesc(&objh);
+			if (! ok) {
+				pi_unlock();
 				return DH_NULL;
 			}
-			DH2O( objh )->o_parh = strmh;
-			if ( objix == 0 ) {
-				DH2S( strmh )->s_cldh = objh;
+			DH2O(objh)->o_parh = strmh;
+			if (objix == 0) {
+				DH2S(strmh)->s_cldh = objh;
 			} else {
-				DH2O( prevobjh )->o_nexth = objh;
+				DH2O(prevobjh)->o_nexth = objh;
 			}
 		}
 	}
 
 	/* update the object fields if not yet valid
 	 */
-	if ( idlabvalpr
+	if (idlabvalpr
 	     &&
-	     ! DH2O( objh )->o_idlabvalpr ) {
-		uuid_copy(DH2O( objh )->o_id, *mediaidp);
-		strncpy( DH2O( objh )->o_lab,
+	     ! DH2O(objh)->o_idlabvalpr) {
+		uuid_copy(DH2O(objh)->o_id, *mediaidp);
+		strncpy(DH2O(objh)->o_lab,
 			 medialabel,
-			 sizeof( DH2O( objh )->o_lab ));
-		DH2O( objh )->o_idlabvalpr = BOOL_TRUE;
+			 sizeof(DH2O(objh)->o_lab));
+		DH2O(objh)->o_idlabvalpr = BOOL_TRUE;
 	}
-	if ( mfixvalpr
+	if (mfixvalpr
 	     &&
 	     dmfixvalpr
 	     &&
-	     ! DH2O( objh )->o_fmfmixvalpr ) {
-		DH2O( objh )->o_fmfmix = mediafileix - dumpmediafileix;
-		DH2O( objh )->o_fmfmixvalpr = BOOL_TRUE;
+	     ! DH2O(objh)->o_fmfmixvalpr) {
+		DH2O(objh)->o_fmfmix = mediafileix - dumpmediafileix;
+		DH2O(objh)->o_fmfmixvalpr = BOOL_TRUE;
 	}
-	if ( dfixvalpr
+	if (dfixvalpr
 	     &&
 	     dmfixvalpr
 	     &&
-	     ! DH2O( objh )->o_fmfsixvalpr ) {
-		DH2O( objh )->o_fmfsix = dumpfileix - dumpmediafileix;
-		DH2O( objh )->o_fmfsixvalpr = BOOL_TRUE;
+	     ! DH2O(objh)->o_fmfsixvalpr) {
+		DH2O(objh)->o_fmfsix = dumpfileix - dumpmediafileix;
+		DH2O(objh)->o_fmfsixvalpr = BOOL_TRUE;
 	}
 
 	/* record the previous object's id and label if not yet valid
 	 */
-	if ( prevobjh != DH_NULL
+	if (prevobjh != DH_NULL
 	     &&
 	     previdlabvalpr
 	     &&
-	     ! DH2O( prevobjh )->o_idlabvalpr ) {
-		uuid_copy(DH2O( prevobjh )->o_id, *prevmediaidp);
-		strncpy( DH2O( prevobjh )->o_lab,
+	     ! DH2O(prevobjh)->o_idlabvalpr) {
+		uuid_copy(DH2O(prevobjh)->o_id, *prevmediaidp);
+		strncpy(DH2O(prevobjh)->o_lab,
 			       prevmedialabel,
-			       sizeof( DH2O( prevobjh )->o_lab ));
-		DH2O( prevobjh )->o_idlabvalpr = BOOL_TRUE;
+			       sizeof(DH2O(prevobjh)->o_lab));
+		DH2O(prevobjh)->o_idlabvalpr = BOOL_TRUE;
 	}
 
 	/* if the dump file and dump media file indices are valid,
@@ -5122,19 +5122,19 @@
 	 * dump file index valid, can infer the index of the last media
 	 * file on the previous dump object.
 	 */
-	if ( DH2O( objh )->o_fmfsixvalpr
+	if (DH2O(objh)->o_fmfsixvalpr
 	     &&
 	     prevobjh != DH_NULL
 	     &&
-	     DH2O( prevobjh )->o_fmfsixvalpr
+	     DH2O(prevobjh)->o_fmfsixvalpr
 	     &&
-	     ! DH2O( prevobjh )->o_lmfknwnpr ) {
+	     ! DH2O(prevobjh)->o_lmfknwnpr) {
 		size_t prevmfcnt;
-		assert( DH2O( objh )->o_fmfsix > DH2O( prevobjh )->o_fmfsix );
-		prevmfcnt = DH2O( objh )->o_fmfsix - DH2O( prevobjh )->o_fmfsix;
-		pi_unlock( );
-		assert( mediaix > 0 );
-		( void )pi_insertfile( drivecnt,
+		assert(DH2O(objh)->o_fmfsix > DH2O(prevobjh)->o_fmfsix);
+		prevmfcnt = DH2O(objh)->o_fmfsix - DH2O(prevobjh)->o_fmfsix;
+		pi_unlock();
+		assert(mediaix > 0);
+		(void)pi_insertfile(drivecnt,
 				       driveix,
 				       mediaix - 1,
 				       BOOL_FALSE,
@@ -5148,22 +5148,22 @@
 				       BOOL_TRUE,
 				       prevmfcnt - 1,
 				       BOOL_TRUE,
-				       DH2O( objh )->o_fmfsix - 1,
+				       DH2O(objh)->o_fmfsix - 1,
 				       0,
 				       0,
 				       0,
 				       0,
 				       BOOL_FALSE,
-				       ( off64_t )0 );
-		pi_seeobjstrmend( strmix, mediaix - 1 );
-		pi_lock( );
+				       (off64_t)0);
+		pi_seeobjstrmend(strmix, mediaix - 1);
+		pi_lock();
 	}
 
 	/* if don't know dump stream media file index, can't add any media files
 	 */
-	if ( ! dmfixvalpr ) {
-		pi_unlock( );
-		pi_show( " after pi_insertfile no media file ix" );
+	if (! dmfixvalpr) {
+		pi_unlock();
+		pi_show(" after pi_insertfile no media file ix");
 		return DH_NULL;
 	}
 
@@ -5171,53 +5171,53 @@
 	 * file list, up to the desired file
 	 */
 	fileh = DH_NULL;
-	for ( fileix = 0 ; fileix <= dumpmediafileix ; fileix++ ) {
+	for (fileix = 0 ; fileix <= dumpmediafileix ; fileix++) {
 		prevfileh = fileh;
-		if ( fileix == 0 ) {
-			fileh = DH2O( objh )->o_cldh;
+		if (fileix == 0) {
+			fileh = DH2O(objh)->o_cldh;
 		} else {
-			fileh = DH2F( prevfileh )->f_nexth;
+			fileh = DH2F(prevfileh)->f_nexth;
 		}
-		if ( fileh == DH_NULL ) {
-			ok = pi_allocdesc( &fileh );
-			if ( ! ok ) {
-				pi_unlock( );
+		if (fileh == DH_NULL) {
+			ok = pi_allocdesc(&fileh);
+			if (! ok) {
+				pi_unlock();
 				return DH_NULL;
 			}
-			DH2F( fileh )->f_parh = objh;
-			if ( fileix == 0 ) {
-				DH2O( objh )->o_cldh = fileh;
+			DH2F(fileh)->f_parh = objh;
+			if (fileix == 0) {
+				DH2O(objh)->o_cldh = fileh;
 			} else {
-				DH2F( prevfileh )->f_nexth = fileh;
+				DH2F(prevfileh)->f_nexth = fileh;
 			}
 		}
 	}
 
 	/* update the media file fields not yet valid
 	 */
-	if ( egrpvalpr && ! DH2F( fileh )->f_valpr ) {
-		assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
-		assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
-		DH2F( fileh )->f_firstegrp.eg_ino = startino;
-		DH2F( fileh )->f_firstegrp.eg_off = startoffset;
-		DH2F( fileh )->f_curegrp = DH2F( fileh )->f_firstegrp;
-		DH2F( fileh )->f_valpr = BOOL_TRUE;
+	if (egrpvalpr && ! DH2F(fileh)->f_valpr) {
+		assert(! (DH2F(fileh)->f_flags & PF_INV));
+		assert(! (DH2F(fileh)->f_flags & PF_TERM));
+		DH2F(fileh)->f_firstegrp.eg_ino = startino;
+		DH2F(fileh)->f_firstegrp.eg_off = startoffset;
+		DH2F(fileh)->f_curegrp = DH2F(fileh)->f_firstegrp;
+		DH2F(fileh)->f_valpr = BOOL_TRUE;
 	}
 
 	/* set flags
 	 */
-	DH2F( fileh )->f_flags = flags;
+	DH2F(fileh)->f_flags = flags;
 
 	/* if we know the file size,
 	 * update it
 	 */
-	if ( fileszvalpr ) {
-		DH2F( fileh )->f_sz = filesz;
-		DH2F( fileh )->f_szvalpr = BOOL_TRUE;
+	if (fileszvalpr) {
+		DH2F(fileh)->f_sz = filesz;
+		DH2F(fileh)->f_szvalpr = BOOL_TRUE;
 	}
 
-	pi_unlock( );
-	pi_show( " after pi_insertfile" );
+	pi_unlock();
+	pi_show(" after pi_insertfile");
 	return fileh;
 }
 
@@ -5227,20 +5227,20 @@
  */
 /* ARGSUSED */
 static dh_t
-pi_addfile( Media_t *Mediap,
+pi_addfile(Media_t *Mediap,
 	    global_hdr_t *grhdrp,
 	    drive_hdr_t *drhdrp,
 	    media_hdr_t *mrhdrp,
 	    content_inode_hdr_t *scrhdrp,
-	    drive_t * drivep )
+	    drive_t * drivep)
 {
 	dh_t fileh;
 
-	if ( ! persp->s.stat_valpr ) {
+	if (! persp->s.stat_valpr) {
 		persp->s.stat_inocnt = scrhdrp->cih_inomap_nondircnt;
 		persp->s.stat_inodone = 0;
-		assert( scrhdrp->cih_inomap_datasz <= OFF64MAX );
-		persp->s.stat_datacnt = ( off64_t )scrhdrp->cih_inomap_datasz;
+		assert(scrhdrp->cih_inomap_datasz <= OFF64MAX);
+		persp->s.stat_datacnt = (off64_t)scrhdrp->cih_inomap_datasz;
 		persp->s.stat_datadone = 0;
 		persp->s.stat_valpr = BOOL_TRUE;
 	}
@@ -5248,8 +5248,8 @@
 	/* if we see a terminator, we know we have seen the end of
 	 * a stream.
 	 */
-	if ( MEDIA_TERMINATOR_CHK( mrhdrp )) {
-		fileh = pi_insertfile( drhdrp->dh_drivecnt,
+	if (MEDIA_TERMINATOR_CHK(mrhdrp)) {
+		fileh = pi_insertfile(drhdrp->dh_drivecnt,
 				       drhdrp->dh_driveix,
 				       mrhdrp->mh_mediaix,
 				       BOOL_TRUE,
@@ -5265,25 +5265,25 @@
 				       BOOL_TRUE,
 				       mrhdrp->mh_dumpfileix,
 				       BOOL_FALSE,
-				       ( xfs_ino_t )0,
-				       ( off64_t )0,
+				       (xfs_ino_t)0,
+				       (off64_t)0,
 				       PF_TERM,
 				       BOOL_FALSE,
-				       ( off64_t )0 );
-		if ( fileh == DH_NULL ) {
+				       (off64_t)0);
+		if (fileh == DH_NULL) {
 			return DH_NULL;
 		}
-		pi_seestrmend( drhdrp->dh_driveix );
-		pi_seeobjstrmend( drhdrp->dh_driveix, mrhdrp->mh_mediaix );
+		pi_seestrmend(drhdrp->dh_driveix);
+		pi_seeobjstrmend(drhdrp->dh_driveix, mrhdrp->mh_mediaix);
 		return fileh;
 	}
 
 	/* data file
 	 */
-	if ( scrhdrp->cih_mediafiletype == CIH_MEDIAFILETYPE_DATA ) {
+	if (scrhdrp->cih_mediafiletype == CIH_MEDIAFILETYPE_DATA) {
 		/* tell the inventory about this media file
 		 */
-		fileh = pi_insertfile( drhdrp->dh_drivecnt,
+		fileh = pi_insertfile(drhdrp->dh_drivecnt,
 				       drhdrp->dh_driveix,
 				       mrhdrp->mh_mediaix,
 				       BOOL_TRUE,
@@ -5303,17 +5303,17 @@
 				       scrhdrp->cih_startpt.sp_offset,
 				       0,
 				       BOOL_FALSE,
-				       ( off64_t )0 );
-		if ( fileh == DH_NULL ) {
+				       (off64_t)0);
+		if (fileh == DH_NULL) {
 			return DH_NULL;
 		}
-		assert( drhdrp->dh_drivecnt > 0 );
-		if ( drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1 ) {
+		assert(drhdrp->dh_drivecnt > 0);
+		if (drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1) {
 			/* if this is not in the last stream, we know
 			 * there is at least one other media file in
 			 * the following stream, and we know its start pt
 			 */
-			( void )pi_insertfile( drhdrp->dh_drivecnt,
+			(void)pi_insertfile(drhdrp->dh_drivecnt,
 					       drhdrp->dh_driveix + 1,
 					       0,
 					       BOOL_FALSE,
@@ -5333,14 +5333,14 @@
 					       scrhdrp->cih_endpt.sp_offset,
 					       0,
 					       BOOL_FALSE,
-					       ( off64_t )0 );
+					       (off64_t)0);
 		}
-		if ( ! ( drivep->d_capabilities & DRIVE_CAP_FILES )) {
+		if (! (drivep->d_capabilities & DRIVE_CAP_FILES)) {
 			/* if drive does not support multiple files,
 			 * we know this is end of object and stream
 			 */
-			pi_seestrmend( drhdrp->dh_driveix );
-			pi_seeobjstrmend( drhdrp->dh_driveix, mrhdrp->mh_mediaix );
+			pi_seestrmend(drhdrp->dh_driveix);
+			pi_seeobjstrmend(drhdrp->dh_driveix, mrhdrp->mh_mediaix);
 		}
 
 		return fileh;
@@ -5348,8 +5348,8 @@
 
 	/* inventory file
 	 */
-	if ( scrhdrp->cih_mediafiletype == CIH_MEDIAFILETYPE_INVENTORY ) {
-		fileh = pi_insertfile( drhdrp->dh_drivecnt,
+	if (scrhdrp->cih_mediafiletype == CIH_MEDIAFILETYPE_INVENTORY) {
+		fileh = pi_insertfile(drhdrp->dh_drivecnt,
 				       drhdrp->dh_driveix,
 				       mrhdrp->mh_mediaix,
 				       BOOL_TRUE,
@@ -5365,19 +5365,19 @@
 				       BOOL_TRUE,
 				       mrhdrp->mh_dumpfileix,
 				       BOOL_FALSE,
-				       ( xfs_ino_t )0,
-				       ( off64_t )0,
+				       (xfs_ino_t)0,
+				       (off64_t)0,
 					PF_INV,
 					BOOL_FALSE,
-					( off64_t )0 );
-		if ( fileh == DH_NULL ) {
+					(off64_t)0);
+		if (fileh == DH_NULL) {
 			return DH_NULL;
 		}
-		pi_seestrmend( drhdrp->dh_driveix );
-		pi_seeobjstrmend( drhdrp->dh_driveix,
-				  mrhdrp->mh_mediaix );
-		if ( drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1 ) {
-			( void )pi_insertfile( drhdrp->dh_drivecnt,
+		pi_seestrmend(drhdrp->dh_driveix);
+		pi_seeobjstrmend(drhdrp->dh_driveix,
+				  mrhdrp->mh_mediaix);
+		if (drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1) {
+			(void)pi_insertfile(drhdrp->dh_drivecnt,
 					       drhdrp->dh_driveix + 1,
 					       0,
 					       BOOL_FALSE,
@@ -5397,11 +5397,11 @@
 					       scrhdrp->cih_endpt.sp_offset,
 					       0,
 					       BOOL_FALSE,
-					       ( off64_t )0 );
+					       (off64_t)0);
 		}
-		if ( ! persp->s.fullinvpr
+		if (! persp->s.fullinvpr
 		     &&
-		     Mediap->M_pos == POS_ATHDR ) {
+		     Mediap->M_pos == POS_ATHDR) {
 			size_t bufszincr;
 			size_t bufsz;
 			size_t buflen;
@@ -5419,7 +5419,7 @@
 				 */
 			bufsz = bufszincr;
 			buflen = 0;
-			bufp = ( char * )malloc( bufsz );
+			bufp = (char *)malloc(bufsz);
 
 			/* need to read until we hit EOF/EOD. that's the only
 			 * way to know how big the inventory is. mark the Media
@@ -5427,32 +5427,32 @@
 			 */
 			Mediap->M_pos = POS_ATNONDIR;
 			donepr = BOOL_FALSE;
-			while ( ! donepr ) {
+			while (! donepr) {
 				int nread;
 				drive_ops_t *dop = drivep->d_opsp;
 				int rval = 0;
-				nread = read_buf( bufp + buflen,
+				nread = read_buf(bufp + buflen,
 						  bufszincr,
-						  ( void * )drivep,
-						  ( rfp_t )dop->do_read,
-					    ( rrbfp_t )dop->do_return_read_buf,
-						  &rval );
-				switch( rval ) {
+						  (void *)drivep,
+						  (rfp_t)dop->do_read,
+					    (rrbfp_t)dop->do_return_read_buf,
+						  &rval);
+				switch(rval) {
 				case 0:
-					assert( nread == ( int )bufszincr );
-					buflen += ( size_t )nread;
+					assert(nread == (int)bufszincr);
+					buflen += (size_t)nread;
 					bufsz += bufszincr;
-					bufp = ( char * )realloc(( void * )bufp,
-								 bufsz );
-					assert( bufp );
+					bufp = (char *)realloc((void *)bufp,
+								 bufsz);
+					assert(bufp);
 					continue;
 				case DRIVE_ERROR_EOD:
 				case DRIVE_ERROR_EOF:
-					buflen += ( size_t )nread;
+					buflen += (size_t)nread;
 					donepr = BOOL_TRUE;
 					break;
 				default:
-					free( ( void * )bufp );
+					free((void *)bufp);
 					return fileh;
 				}
 			}
@@ -5461,62 +5461,62 @@
 			 * desc.
 			 */
 			sessp = 0;
-			if ( ! buflen ) {
+			if (! buflen) {
 				ok = BOOL_FALSE;
 			} else {
 			    /* extract the session information from the buffer */
-			    if ( stobj_unpack_sessinfo( bufp, buflen, &sessinfo )<0 ) {
+			    if (stobj_unpack_sessinfo(bufp, buflen, &sessinfo)<0) {
 				ok = BOOL_FALSE;
 			    } else {
 				stobj_convert_sessinfo(&sessp, &sessinfo);
 				ok = BOOL_TRUE;
 			    }
 			}
-			if ( ! ok || ! sessp ) {
-				mlog( MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
+			if (! ok || ! sessp) {
+				mlog(MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
 				      "on-media session "
-				      "inventory corrupt\n") );
+				      "inventory corrupt\n"));
 			} else {
 				/* if root, update online inventory.
 				 */
-				if ( ! geteuid( )
+				if (! geteuid()
 				     &&
-				     ! tranp->t_noinvupdatepr ) {
-					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+				     ! tranp->t_noinvupdatepr) {
+					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 					      "incorporating on-media session "
 					      "inventory into online "
-					      "inventory\n") );
-					inv_put_sessioninfo( &sessinfo );
+					      "inventory\n"));
+					inv_put_sessioninfo(&sessinfo);
 				}
 
 				/* convert into pi format
 				 */
-				mlog( MLOG_VERBOSE | MLOG_MEDIA,
-				      "using on-media session inventory\n" );
-				persp->s.fullinvpr = pi_transcribe( sessp );
-				inv_free_session( &sessp );
+				mlog(MLOG_VERBOSE | MLOG_MEDIA,
+				      "using on-media session inventory\n");
+				persp->s.fullinvpr = pi_transcribe(sessp);
+				inv_free_session(&sessp);
 			}
-			free( ( void * )bufp );
+			free((void *)bufp);
 		}
 		return fileh;
 	}
 
-	assert( 0 );
+	assert(0);
 	return DH_NULL;
 }
 
 /* translate a session inventory into a pi
  */
 static bool_t
-pi_transcribe( inv_session_t *sessp )
+pi_transcribe(inv_session_t *sessp)
 {
 	ix_t strmcnt;
 	ix_t strmix;
 
 	/* traverse inventory, transcribing into pers inv.
 	 */
-	strmcnt =  ( size_t )sessp->s_nstreams;
-	for ( strmix = 0 ; strmix < strmcnt ; strmix++ ) {
+	strmcnt =  (size_t)sessp->s_nstreams;
+	for (strmix = 0 ; strmix < strmcnt ; strmix++) {
 		inv_stream_t *strmp;
 		size_t fileix;
 		size_t filecnt;
@@ -5525,33 +5525,33 @@
 		ix_t mediaix;
 		size_t dumpmediafileix;
 
-		strmp = &sessp->s_streams[ strmix ];
+		strmp = &sessp->s_streams[strmix];
 		filecnt = strmp->st_nmediafiles;
                 uuid_clear(lastobjid);
-		lastobjlabel[ 0 ] = 0;
+		lastobjlabel[0] = 0;
 		mediaix = 0;
 		dumpmediafileix = 0;
 
 		/* insert all media files from this stream. note that
 		 * the media object representation is inverted
 		 */
-		for ( fileix = 0 ; fileix < filecnt ; fileix++ ) {
+		for (fileix = 0 ; fileix < filecnt ; fileix++) {
 			inv_mediafile_t *filep;
 			bool_t fileszvalpr;
 
-			filep = &strmp->st_mediafiles[ fileix ];
-			if ( uuid_compare( filep->m_moid,
-					   lastobjid ) != 0) {
+			filep = &strmp->st_mediafiles[fileix];
+			if (uuid_compare(filep->m_moid,
+					   lastobjid) != 0) {
 				dumpmediafileix = 0;
-				if ( fileix != 0 ) {
-					pi_seeobjstrmend( strmix, mediaix );
+				if (fileix != 0) {
+					pi_seeobjstrmend(strmix, mediaix);
 					mediaix++;
 				}
 			}
 
 			fileszvalpr = BOOL_TRUE;
 
-			( void )pi_insertfile( strmcnt,
+			(void)pi_insertfile(strmcnt,
 					       strmix,
 					       mediaix,
 					       BOOL_TRUE,
@@ -5579,15 +5579,15 @@
 					       :
 					       0,
 					       fileszvalpr,
-					       filep->m_size );
+					       filep->m_size);
 			uuid_copy(lastobjid, filep->m_moid);
-			strncpy( lastobjlabel,
+			strncpy(lastobjlabel,
 				 filep->m_label,
-				 sizeof( lastobjlabel ));
+				 sizeof(lastobjlabel));
 			dumpmediafileix++;
 		}
-		pi_seestrmend( strmix );
-		pi_seeobjstrmend( strmix, mediaix );
+		pi_seestrmend(strmix);
+		pi_seeobjstrmend(strmix, mediaix);
 	}
 
 	return BOOL_TRUE;
@@ -5597,29 +5597,29 @@
  * be set from previously interrupted invocation.
  */
 static void
-pi_preclean( void )
+pi_preclean(void)
 {
 	dh_t strmh;
 	dh_t objh;
 	dh_t fileh;
 
-	for ( strmh = persp->s.strmheadh
+	for (strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL
 	      ;
-	      strmh = DH2S( strmh )->s_nexth ) {
-		for ( objh = DH2S( strmh )->s_cldh
+	      strmh = DH2S(strmh)->s_nexth) {
+		for (objh = DH2S(strmh)->s_cldh
 		      ;
 		      objh != DH_NULL
 		      ;
-		      objh = DH2O( objh )->o_nexth ) {
-			DH2O( objh )->o_indrivepr = BOOL_FALSE;
-			for ( fileh = DH2O( objh )->o_cldh
+		      objh = DH2O(objh)->o_nexth) {
+			DH2O(objh)->o_indrivepr = BOOL_FALSE;
+			for (fileh = DH2O(objh)->o_cldh
 			      ;
 			      fileh != DH_NULL
 			      ;
-			      fileh = DH2F( fileh )->f_nexth ) {
-				DH2F( fileh )->f_underheadpr = BOOL_FALSE;
+			      fileh = DH2F(fileh)->f_nexth) {
+				DH2F(fileh)->f_underheadpr = BOOL_FALSE;
 			}
 		}
 	}
@@ -5628,201 +5628,201 @@
 /* tell pi no media objects are in this drive
  */
 static void
-pi_driveempty( ix_t driveix )
+pi_driveempty(ix_t driveix)
 {
 	dh_t strmh;
 	dh_t objh;
 	dh_t fileh;
 
-	pi_lock( );
+	pi_lock();
 
-	for ( strmh = persp->s.strmheadh
+	for (strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL
 	      ;
-	      strmh = DH2S( strmh )->s_nexth ) {
-		for ( objh = DH2S( strmh )->s_cldh
+	      strmh = DH2S(strmh)->s_nexth) {
+		for (objh = DH2S(strmh)->s_cldh
 		      ;
 		      objh != DH_NULL
 		      ;
-		      objh = DH2O( objh )->o_nexth ) {
-			if ( DH2O( objh )->o_indrivepr
+		      objh = DH2O(objh)->o_nexth) {
+			if (DH2O(objh)->o_indrivepr
 			     &&
-			     DH2O( objh )->o_indriveix == driveix ) {
-				DH2O( objh )->o_indrivepr = BOOL_FALSE;
-				for ( fileh = DH2O( objh )->o_cldh
+			     DH2O(objh)->o_indriveix == driveix) {
+				DH2O(objh)->o_indrivepr = BOOL_FALSE;
+				for (fileh = DH2O(objh)->o_cldh
 				      ;
 				      fileh != DH_NULL
 				      ;
-				      fileh = DH2F( fileh )->f_nexth ) {
-					DH2F( fileh )->f_underheadpr =
+				      fileh = DH2F(fileh)->f_nexth) {
+					DH2F(fileh)->f_underheadpr =
 								    BOOL_FALSE;
 				}
 			}
 		}
 	}
 
-	pi_unlock( );
+	pi_unlock();
 }
 
 /* tell pi this media object is in the drive
  */
 static void
-pi_note_indrive( ix_t driveix, uuid_t media_id )
+pi_note_indrive(ix_t driveix, uuid_t media_id)
 {
 	dh_t strmh;
 	dh_t objh;
 
-	pi_lock( );
+	pi_lock();
 
-	for ( strmh = persp->s.strmheadh
+	for (strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL
 	      ;
-	      strmh = DH2S( strmh )->s_nexth ) {
-		for ( objh = DH2S( strmh )->s_cldh
+	      strmh = DH2S(strmh)->s_nexth) {
+		for (objh = DH2S(strmh)->s_cldh
 		      ;
 		      objh != DH_NULL
 		      ;
-		      objh = DH2O( objh )->o_nexth ) {
-			if ( DH2O( objh )->o_idlabvalpr
+		      objh = DH2O(objh)->o_nexth) {
+			if (DH2O(objh)->o_idlabvalpr
 			     &&
-			     uuid_compare( DH2O( objh )->o_id, media_id) == 0) {
-				DH2O( objh )->o_indrivepr = BOOL_TRUE;
-				DH2O( objh )->o_indriveix = driveix;
+			     uuid_compare(DH2O(objh)->o_id, media_id) == 0) {
+				DH2O(objh)->o_indrivepr = BOOL_TRUE;
+				DH2O(objh)->o_indriveix = driveix;
 				goto done;
 			}
 		}
 	}
 
 done:
-	pi_unlock( );
+	pi_unlock();
 }
 
 /* tell pi this media file is under the head of the drive containing the object
  */
 static void
-pi_note_underhead( dh_t thisobjh, dh_t thisfileh )
+pi_note_underhead(dh_t thisobjh, dh_t thisfileh)
 {
 	dh_t fileh;
 
-	if ( thisobjh == DH_NULL ) {
+	if (thisobjh == DH_NULL) {
 		return;
 	}
 
-	pi_lock( );
+	pi_lock();
 
-	if ( thisfileh != DH_NULL ) {
-		DH2F( thisfileh )->f_underheadpr = BOOL_TRUE;
+	if (thisfileh != DH_NULL) {
+		DH2F(thisfileh)->f_underheadpr = BOOL_TRUE;
 	}
 
-	for ( fileh = DH2O( thisobjh )->o_cldh
+	for (fileh = DH2O(thisobjh)->o_cldh
 	      ;
 	      fileh != DH_NULL
 	      ;
-	      fileh = DH2F( fileh )->f_nexth ) {
-		if ( fileh != thisfileh ) {
-			DH2F( fileh )->f_underheadpr = BOOL_FALSE;
+	      fileh = DH2F(fileh)->f_nexth) {
+		if (fileh != thisfileh) {
+			DH2F(fileh)->f_underheadpr = BOOL_FALSE;
 		}
 	}
 
-	pi_unlock( );
+	pi_unlock();
 }
 
 /* mark the pi stream indicating all objects in that stream are known.
  */
 static void
-pi_seestrmend( ix_t strmix )
+pi_seestrmend(ix_t strmix)
 {
 	ix_t ix;
 	dh_t strmh;
 
-	pi_lock( );
+	pi_lock();
 
 	/* get handle to the indexed stream
 	 */
-	for ( ix = 0,
+	for (ix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL && ix < strmix
 	      ;
 	      ix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
 
 	/* if an empty stream (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
-	if ( strmh == DH_NULL ) {
-		pi_unlock( );
+	if (strmh == DH_NULL) {
+		pi_unlock();
 		return;
 	}
 
 	/* set stream flag and object and file counts
 	 */
-	DH2S( strmh )->s_lastobjknwnpr = BOOL_TRUE;
+	DH2S(strmh)->s_lastobjknwnpr = BOOL_TRUE;
 
-	pi_unlock( );
-	pi_show( " after pi_seestrmend" );
+	pi_unlock();
+	pi_show(" after pi_seestrmend");
 }
 
 /* mark pi indicating all media files in object are known
  */
 static void
-pi_seeobjstrmend( ix_t strmix, ix_t mediaix )
+pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 {
 	ix_t ix;
 	dh_t strmh;
 	dh_t objh;
 
-	pi_lock( );
+	pi_lock();
 
 	/* get handle to the indexed stream
 	 */
-	for ( ix = 0,
+	for (ix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL && ix < strmix
 	      ;
 	      ix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
 
 	/* if an empty stream (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
-	if ( strmh == DH_NULL ) {
-		pi_unlock( );
+	if (strmh == DH_NULL) {
+		pi_unlock();
 		return;
 	}
 
 
 	/* get handle to indexed object in stream
 	 */
-	for ( ix = 0,
-	      objh = DH2S( strmh )->s_cldh
+	for (ix = 0,
+	      objh = DH2S(strmh)->s_cldh
 	      ;
 	      objh != DH_NULL && ix < mediaix
 	      ;
 	      ix++,
-	      objh = DH2O( objh )->o_nexth )
+	      objh = DH2O(objh)->o_nexth)
 		;
 
 	/* if an empty object (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
-	if ( objh == DH_NULL ) {
-		pi_unlock( );
+	if (objh == DH_NULL) {
+		pi_unlock();
 		return;
 	}
 
 
 	/* set object flag
 	 */
-	DH2O( objh )->o_lmfknwnpr = BOOL_TRUE;
+	DH2O(objh)->o_lmfknwnpr = BOOL_TRUE;
 
-	pi_unlock( );
-	pi_show( " after pi_seeobjstrmend" );
+	pi_unlock();
+	pi_show(" after pi_seeobjstrmend");
 }
 
 /* scans pi to determine ino of last file wholly or partially contained on
@@ -5830,53 +5830,53 @@
  * NOTE: assumes caller locks pi!
  */
 static xfs_ino_t
-pi_scanfileendino( dh_t fileh )
+pi_scanfileendino(dh_t fileh)
 {
 	dh_t strmh;
 	ix_t mode = 0;
 
-	assert( fileh != DH_NULL );
+	assert(fileh != DH_NULL);
 
 	/* traverse the pi tree, looking for the next media file after
 	 */
-	for ( strmh = persp->s.strmheadh
+	for (strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL
 	      ;
-	      strmh = DH2S( strmh )->s_nexth ) {
+	      strmh = DH2S(strmh)->s_nexth) {
 	    dh_t objh;
 
-	    for ( objh = DH2S( strmh )->s_cldh
+	    for (objh = DH2S(strmh)->s_cldh
 		  ;
 		  objh != DH_NULL
 		  ;
-		  objh = DH2O( objh )->o_nexth ) {
+		  objh = DH2O(objh)->o_nexth) {
 		dh_t nexth;
 
-		for ( nexth = DH2O( objh )->o_cldh
+		for (nexth = DH2O(objh)->o_cldh
 		      ;
 		      nexth != DH_NULL
 		      ;
-		      nexth = DH2F( nexth )->f_nexth ) {
+		      nexth = DH2F(nexth)->f_nexth) {
 
-		    switch( mode ) {
+		    switch(mode) {
 		    case 0:
-			if ( nexth == fileh ) {
+			if (nexth == fileh) {
 				mode = 1;
 			}
 			break;
 		    default:
-			if ( DH2F( nexth )->f_valpr ) {
+			if (DH2F(nexth)->f_valpr) {
 			    xfs_ino_t ino;
 
-			    assert( ! ( DH2F( nexth )->f_flags & PF_INV ));
-			    assert( ! ( DH2F( nexth )->f_flags & PF_TERM ));
-			    if ( DH2F( nexth )->f_firstegrp.eg_off ) {
-				ino =  DH2F( nexth )->f_firstegrp.eg_ino;
+			    assert(! (DH2F(nexth)->f_flags & PF_INV));
+			    assert(! (DH2F(nexth)->f_flags & PF_TERM));
+			    if (DH2F(nexth)->f_firstegrp.eg_off) {
+				ino =  DH2F(nexth)->f_firstegrp.eg_ino;
 				return ino;
 			    } else {
-				assert( DH2F( nexth )->f_firstegrp.eg_ino > 0 );
-				ino =  DH2F( nexth )->f_firstegrp.eg_ino - 1;
+				assert(DH2F(nexth)->f_firstegrp.eg_ino > 0);
+				ino =  DH2F(nexth)->f_firstegrp.eg_ino - 1;
 				return ino;
 			    }
 			}
@@ -5892,7 +5892,7 @@
  * from media file. *--o
  */
 static void
-pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
+pi_bracketneededegrps(dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp)
 {
 	dh_t strmh;
 	bool_t thisfoundpr = BOOL_FALSE;
@@ -5900,44 +5900,44 @@
 	dh_t follh = DH_NULL;
 
 
-	assert( thisfileh != DH_NULL );
+	assert(thisfileh != DH_NULL);
 
 	/* traverse the pi tree, looking for fileh
 	 */
-	pi_lock( );
-	assert( DH2F( thisfileh )->f_valpr );
+	pi_lock();
+	assert(DH2F(thisfileh)->f_valpr);
 
-	for ( strmh = persp->s.strmheadh
+	for (strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL
 	      ;
-	      strmh = DH2S( strmh )->s_nexth ) {
+	      strmh = DH2S(strmh)->s_nexth) {
 	    dh_t objh;
 
-	    for ( objh = DH2S( strmh )->s_cldh
+	    for (objh = DH2S(strmh)->s_cldh
 		  ;
 		  objh != DH_NULL
 		  ;
-		  objh = DH2O( objh )->o_nexth ) {
+		  objh = DH2O(objh)->o_nexth) {
 		dh_t fileh;
 
-		for ( fileh = DH2O( objh )->o_cldh
+		for (fileh = DH2O(objh)->o_cldh
 		      ;
 		      fileh != DH_NULL
 		      ;
-		      fileh = DH2F( fileh )->f_nexth ) {
-		    if ( ! thisfoundpr ) {
-			if ( fileh == thisfileh ) {
+		      fileh = DH2F(fileh)->f_nexth) {
+		    if (! thisfoundpr) {
+			if (fileh == thisfileh) {
 			    thisfoundpr = BOOL_TRUE;
-			} else if ( DH2F( fileh )->f_valpr ) {
-			    assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
-			    assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
+			} else if (DH2F(fileh)->f_valpr) {
+			    assert(! (DH2F(fileh)->f_flags & PF_INV));
+			    assert(! (DH2F(fileh)->f_flags & PF_TERM));
 			    prech = fileh;
 			}
-		    } else if ( DH2F( fileh )->f_valpr ) {
-			assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
-			assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
-			assert( follh == DH_NULL );
+		    } else if (DH2F(fileh)->f_valpr) {
+			assert(! (DH2F(fileh)->f_flags & PF_INV));
+			assert(! (DH2F(fileh)->f_flags & PF_TERM));
+			assert(follh == DH_NULL);
 			follh = fileh;
 			goto done;
 		    }
@@ -5946,21 +5946,21 @@
 	}
 done:
 
-	assert( thisfoundpr );
+	assert(thisfoundpr);
 
 	/* initially the lower bracket is this file descriptor's
 	 * current egrp. this catches the case where a previous restore
 	 * session was interrupted while restoring this media file.
 	 */
-	*first_egrp = DH2F( thisfileh )->f_curegrp;
+	*first_egrp = DH2F(thisfileh)->f_curegrp;
 
 	/* if the closest valid preceeding media file's current egrp is
 	 * greater, use it as the lower bracket
 	 */
-	if ( prech != DH_NULL
+	if (prech != DH_NULL
 	     &&
-	     egrpcmp( &DH2F( prech )->f_curegrp, first_egrp ) > 0 ) {
-		*first_egrp = DH2F( prech )->f_curegrp;
+	     egrpcmp(&DH2F(prech)->f_curegrp, first_egrp) > 0) {
+		*first_egrp = DH2F(prech)->f_curegrp;
 	}
 
 	/* the upper bracket is initially the end of the world.
@@ -5970,25 +5970,25 @@
 	 */
 	next_egrp->eg_ino = INO64MAX;
 	next_egrp->eg_off = OFF64MAX;
-	if ( follh != DH_NULL
+	if (follh != DH_NULL
 	     &&
-	     egrpcmp( &DH2F( follh )->f_curegrp, &DH2F( follh )->f_firstegrp )
+	     egrpcmp(&DH2F(follh)->f_curegrp, &DH2F(follh)->f_firstegrp)
 	     >
-	     0 ) {
-		*next_egrp = DH2F( follh )->f_firstegrp;
+	     0) {
+		*next_egrp = DH2F(follh)->f_firstegrp;
 	}
 
-	pi_unlock( );
+	pi_unlock();
 }
 
 static void
-pi_update_stats( off64_t sz )
+pi_update_stats(off64_t sz)
 {
-	pi_lock( );
-	assert( persp->s.stat_valpr );
+	pi_lock();
+	assert(persp->s.stat_valpr);
 	persp->s.stat_inodone++;
 	persp->s.stat_datadone += sz;
-	pi_unlock( );
+	pi_unlock();
 }
 
 /* pi_iterator - each invocation of the iterator advances to the next media file
@@ -6012,92 +6012,92 @@
 typedef struct pi_iter pi_iter_t;
 
 static pi_iter_t *
-pi_iter_alloc( void )
+pi_iter_alloc(void)
 {
 	pi_iter_t *iterp;
 
-	iterp = ( pi_iter_t * )calloc( 1, sizeof( pi_iter_t ));
-	assert( iterp );
+	iterp = (pi_iter_t *)calloc(1, sizeof(pi_iter_t));
+	assert(iterp);
 	return iterp;
 }
 
 static void
-pi_iter_free( pi_iter_t *iterp )
+pi_iter_free(pi_iter_t *iterp)
 {
-	free( ( void * )iterp );
+	free((void *)iterp);
 }
 
 static dh_t
-pi_iter_nextfileh( pi_iter_t *iterp,
+pi_iter_nextfileh(pi_iter_t *iterp,
 		   bool_t *objmissingprp,
-		   bool_t *filemissingprp )
+		   bool_t *filemissingprp)
 {
-	assert( ! iterp->donepr );
+	assert(! iterp->donepr);
 
-	if ( persp->s.strmheadh == DH_NULL ) {
+	if (persp->s.strmheadh == DH_NULL) {
 		iterp->donepr = BOOL_TRUE;
 		return DH_NULL;
 	}
 
-	if ( ! iterp->initializedpr ) {
-		assert( persp->s.strmheadh != DH_NULL );
+	if (! iterp->initializedpr) {
+		assert(persp->s.strmheadh != DH_NULL);
 		iterp->strmh = persp->s.strmheadh;
-		iterp->objh = DH2S( iterp->strmh )->s_cldh;
-		if ( iterp->objh == DH_NULL ) {
-			if ( ! DH2S( iterp->strmh )->s_lastobjknwnpr ) {
+		iterp->objh = DH2S(iterp->strmh)->s_cldh;
+		if (iterp->objh == DH_NULL) {
+			if (! DH2S(iterp->strmh)->s_lastobjknwnpr) {
 				*objmissingprp = BOOL_TRUE;
 			}
 		} else {
-			iterp->fileh = DH2O( iterp->objh )->o_cldh;
-			if ( iterp->fileh == DH_NULL ) {
-				if ( ! DH2O( iterp->objh )->o_lmfknwnpr ) {
+			iterp->fileh = DH2O(iterp->objh)->o_cldh;
+			if (iterp->fileh == DH_NULL) {
+				if (! DH2O(iterp->objh)->o_lmfknwnpr) {
 					*filemissingprp = BOOL_TRUE;
 				}
 			}
 		}
 
-		while ( iterp->fileh == DH_NULL ) {
-			while ( iterp->objh == DH_NULL ) {
-				if ( ! DH2S( iterp->strmh )->s_lastobjknwnpr ) {
+		while (iterp->fileh == DH_NULL) {
+			while (iterp->objh == DH_NULL) {
+				if (! DH2S(iterp->strmh)->s_lastobjknwnpr) {
 					*objmissingprp = BOOL_TRUE;
 				}
-				iterp->strmh = DH2S( iterp->strmh )->s_nexth;
-				if ( iterp->strmh == DH_NULL ) {
+				iterp->strmh = DH2S(iterp->strmh)->s_nexth;
+				if (iterp->strmh == DH_NULL) {
 					iterp->donepr = BOOL_TRUE;
 					return DH_NULL;
 				}
-				iterp->objh = DH2S( iterp->strmh )->s_cldh;
+				iterp->objh = DH2S(iterp->strmh)->s_cldh;
 			}
-			iterp->fileh = DH2O( iterp->objh )->o_cldh;
-			if ( iterp->fileh == DH_NULL ) {
-				if ( ! DH2O( iterp->objh )->o_lmfknwnpr ) {
+			iterp->fileh = DH2O(iterp->objh)->o_cldh;
+			if (iterp->fileh == DH_NULL) {
+				if (! DH2O(iterp->objh)->o_lmfknwnpr) {
 					*filemissingprp = BOOL_TRUE;
 				}
-				iterp->objh = DH2O( iterp->objh )->o_nexth;
+				iterp->objh = DH2O(iterp->objh)->o_nexth;
 			}
 		}
 		iterp->initializedpr = BOOL_TRUE;
 		return iterp->fileh;
 	}
 
-	iterp->fileh = DH2F( iterp->fileh )->f_nexth;
-	while ( iterp->fileh == DH_NULL ) {
-		if ( ! DH2O( iterp->objh )->o_lmfknwnpr ) {
+	iterp->fileh = DH2F(iterp->fileh)->f_nexth;
+	while (iterp->fileh == DH_NULL) {
+		if (! DH2O(iterp->objh)->o_lmfknwnpr) {
 			*filemissingprp = BOOL_TRUE;
 		}
-		iterp->objh = DH2O( iterp->objh )->o_nexth;
-		while ( iterp->objh == DH_NULL ) {
-			if ( ! DH2S( iterp->strmh )->s_lastobjknwnpr ) {
+		iterp->objh = DH2O(iterp->objh)->o_nexth;
+		while (iterp->objh == DH_NULL) {
+			if (! DH2S(iterp->strmh)->s_lastobjknwnpr) {
 				*objmissingprp = BOOL_TRUE;
 			}
-			iterp->strmh = DH2S( iterp->strmh )->s_nexth;
-			if ( iterp->strmh == DH_NULL ) {
+			iterp->strmh = DH2S(iterp->strmh)->s_nexth;
+			if (iterp->strmh == DH_NULL) {
 				iterp->donepr = BOOL_TRUE;
 				return DH_NULL;
 			}
-			iterp->objh = DH2S( iterp->strmh )->s_cldh;
+			iterp->objh = DH2S(iterp->strmh)->s_cldh;
 		}
-		iterp->fileh = DH2O( iterp->objh )->o_cldh;
+		iterp->fileh = DH2O(iterp->objh)->o_cldh;
 	}
 
 	return iterp->fileh;
@@ -6121,10 +6121,10 @@
 typedef struct bagobj bagobj_t;
 
 static bag_t *
-pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
+pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 			    bool_t *maybeholesprp,
 			    bool_t showobjindrivepr,
-			    bool_t markskippr )
+			    bool_t markskippr)
 {
 	bag_t *bagp;
 	pi_iter_t *headiterp;
@@ -6140,21 +6140,21 @@
 
 	/* no point in proceeding if pi not begun
 	 */
-	if ( persp->s.strmheadh == DH_NULL ) {
+	if (persp->s.strmheadh == DH_NULL) {
 		*knownholesprp = BOOL_TRUE;
 		*maybeholesprp = BOOL_FALSE;
 		return 0;
 	}
 
 	/* to hold a list of media object handles: caller must free
-	 * using pi_neededobjs_free( ).
+	 * using pi_neededobjs_free().
 	 */
-	bagp = bag_alloc( );
+	bagp = bag_alloc();
 
 	/* allocate two iterators to scan pi
 	 */
-	tailiterp = pi_iter_alloc( );
-	headiterp = pi_iter_alloc( );
+	tailiterp = pi_iter_alloc();
+	headiterp = pi_iter_alloc();
 
 	/* set the handle to the last file added to the list to NULL.
 	 * this will be updated each time we add an object to the list,
@@ -6185,7 +6185,7 @@
 
 	/* lock up the inventory during the scan
 	 */
-	pi_lock( );
+	pi_lock();
 
 	do {
 		egrp_t headegrp;
@@ -6197,23 +6197,23 @@
 		do {
 			bool_t dummyobjmissingpr;
 			bool_t dummyfilemissingpr;
-			headh = pi_iter_nextfileh( headiterp,
+			headh = pi_iter_nextfileh(headiterp,
 						   &dummyobjmissingpr,
-						   &dummyfilemissingpr );
-		} while ( headh != DH_NULL && ! DH2F( headh )->f_valpr );
-		if ( headh == DH_NULL ) {
+						   &dummyfilemissingpr);
+		} while (headh != DH_NULL && ! DH2F(headh)->f_valpr);
+		if (headh == DH_NULL) {
 			headegrp.eg_ino = INO64MAX;
 			headegrp.eg_off = OFF64MAX;
 		} else {
-			assert( ! ( DH2F( headh )->f_flags & PF_INV ));
-			assert( ! ( DH2F( headh )->f_flags & PF_TERM ));
-			headegrp = DH2F( headh )->f_firstegrp;
+			assert(! (DH2F(headh)->f_flags & PF_INV));
+			assert(! (DH2F(headh)->f_flags & PF_TERM));
+			headegrp = DH2F(headh)->f_firstegrp;
 		}
 
 		/* see if the range of egrps from head up to but not including
 		 * tail needed according to ino map
 		 */
-		if ( gapneeded( &tailegrp, &headegrp )) {
+		if (gapneeded(&tailegrp, &headegrp)) {
 			foundgappr = BOOL_TRUE;
 		} else {
 			foundgappr = BOOL_FALSE;
@@ -6226,46 +6226,46 @@
 		do {
 		    /* if requested, mark media files not needed
 		     */
-		    if ( markskippr
+		    if (markskippr
 			 &&
 			 ! foundgappr
 			 &&
 			 tailh != DH_NULL
 			 &&
-			 ! ( DH2F( tailh )->f_flags & PF_INV )
+			 ! (DH2F(tailh)->f_flags & PF_INV)
 			 &&
-			 ! ( DH2F( tailh )->f_flags & PF_TERM )
+			 ! (DH2F(tailh)->f_flags & PF_TERM)
 			 &&
-			 ! DH2F( tailh )->f_nondirskippr ) {
-			    DH2F( tailh )->f_nondirskippr = BOOL_TRUE;
+			 ! DH2F(tailh)->f_nondirskippr) {
+			    DH2F(tailh)->f_nondirskippr = BOOL_TRUE;
 		    }
 
 		    /* build up list of needed objects
 		     */
-		    if ( foundgappr
+		    if (foundgappr
 			 &&
 			 tailh != DH_NULL
 			 &&
-			 ! ( DH2F( tailh )->f_flags & PF_INV )
+			 ! (DH2F(tailh)->f_flags & PF_INV)
 			 &&
-			 ! ( DH2F( tailh )->f_flags & PF_TERM )
+			 ! (DH2F(tailh)->f_flags & PF_TERM)
 			 &&
-			 ! DH2F( tailh )->f_nondirdonepr
+			 ! DH2F(tailh)->f_nondirdonepr
 			 &&
-			 ! DH2F( tailh )->f_nondirskippr ) {
+			 ! DH2F(tailh)->f_nondirskippr) {
 
-			    dh_t objh = DH2F( tailh )->f_parh;
+			    dh_t objh = DH2F(tailh)->f_parh;
 
-			    if ( ! DH2O( objh )->o_indrivepr
+			    if (! DH2O(objh)->o_indrivepr
 				 ||
-				 showobjindrivepr ) {
-				if ( DH2O( objh )->o_idlabvalpr ) {
-					if ( objh != lastobjaddedh ) {
-					    addobj( bagp,
-						    &DH2O( objh )->o_id,
-						    DH2O( objh )->o_lab,
-						    DH2O( objh )->o_indrivepr,
-						    DH2O( objh )->o_indriveix );
+				 showobjindrivepr) {
+				if (DH2O(objh)->o_idlabvalpr) {
+					if (objh != lastobjaddedh) {
+					    addobj(bagp,
+						    &DH2O(objh)->o_id,
+						    DH2O(objh)->o_lab,
+						    DH2O(objh)->o_indrivepr,
+						    DH2O(objh)->o_indriveix);
 					    lastobjaddedh = objh;
 					    objlistlen++;
 					}
@@ -6277,36 +6277,36 @@
 
 		    /* pull the tail up to the next media file
 		     */
-		    tailh = pi_iter_nextfileh( tailiterp,
+		    tailh = pi_iter_nextfileh(tailiterp,
 					       &maybeobjmissingpr,
-					       &maybefilemissingpr );
-		} while ( tailh != headh );
+					       &maybefilemissingpr);
+		} while (tailh != headh);
 
 		tailegrp = headegrp;
 
-	} while ( headh != DH_NULL );
+	} while (headh != DH_NULL);
 
-	pi_unlock( );
+	pi_unlock();
 
 	/* free the iterators
 	 */
-	pi_iter_free( tailiterp );
-	pi_iter_free( headiterp );
+	pi_iter_free(tailiterp);
+	pi_iter_free(headiterp);
 
 	/* free the bag and return NULL if object list empty
 	 */
-	if ( objlistlen == 0 ) {
-		bag_free( bagp );
+	if (objlistlen == 0) {
+		bag_free(bagp);
 		bagp = 0;
 	}
 
-	*maybeholesprp = ( maybeobjmissingpr || maybefilemissingpr );
+	*maybeholesprp = (maybeobjmissingpr || maybefilemissingpr);
 	*knownholesprp = knownobjmissingpr;
 	return bagp;
 }
 
 static bag_t *
-pi_neededobjs_dir_alloc( bool_t *knownholesprp, bool_t *maybeholesprp )
+pi_neededobjs_dir_alloc(bool_t *knownholesprp, bool_t *maybeholesprp)
 {
 	bag_t *bagp;
 	dh_t fileh;
@@ -6317,8 +6317,8 @@
 	dh_t lastobjaddedh;
 	int objlistlen;
 
-	bagp = bag_alloc( );
-	iterp = pi_iter_alloc( );
+	bagp = bag_alloc();
+	iterp = pi_iter_alloc();
 
 	knownobjmissingpr = BOOL_FALSE;
 	maybeobjmissingpr = BOOL_FALSE;
@@ -6326,22 +6326,22 @@
 	lastobjaddedh = DH_NULL;
 	objlistlen = 0;
 
-	pi_lock( );
+	pi_lock();
 
-	while ( ( fileh = pi_iter_nextfileh( iterp,
+	while ((fileh = pi_iter_nextfileh(iterp,
 					     &maybeobjmissingpr,
-					     &maybefilemissingpr ))
-		!= DH_NULL ) {
-		if ( ! DH2F( fileh )->f_dirtriedpr ) {
-			dh_t objh = DH2F( fileh )->f_parh;
-			if ( ! DH2O( objh )->o_indrivepr ) {
-				if ( DH2O( objh )->o_idlabvalpr ) {
-					if ( objh != lastobjaddedh ) {
-						addobj( bagp,
-							&DH2O( objh )->o_id,
-							DH2O( objh )->o_lab,
-						    DH2O( objh )->o_indrivepr,
-						    DH2O( objh )->o_indriveix );
+					     &maybefilemissingpr))
+		!= DH_NULL) {
+		if (! DH2F(fileh)->f_dirtriedpr) {
+			dh_t objh = DH2F(fileh)->f_parh;
+			if (! DH2O(objh)->o_indrivepr) {
+				if (DH2O(objh)->o_idlabvalpr) {
+					if (objh != lastobjaddedh) {
+						addobj(bagp,
+							&DH2O(objh)->o_id,
+							DH2O(objh)->o_lab,
+						    DH2O(objh)->o_indrivepr,
+						    DH2O(objh)->o_indriveix);
 						lastobjaddedh = objh;
 						objlistlen++;
 					}
@@ -6352,22 +6352,22 @@
 		}
 	}
 
-	pi_unlock( );
+	pi_unlock();
 
-	pi_iter_free( iterp );
+	pi_iter_free(iterp);
 
-	if ( objlistlen == 0 ) {
-		bag_free( bagp );
+	if (objlistlen == 0) {
+		bag_free(bagp);
 		bagp = 0;
 	}
 
-	*maybeholesprp = ( maybeobjmissingpr || maybefilemissingpr );
+	*maybeholesprp = (maybeobjmissingpr || maybefilemissingpr);
 	*knownholesprp = knownobjmissingpr;
 	return bagp;
 }
 
 static void
-pi_neededobjs_free( bag_t *bagp )
+pi_neededobjs_free(bag_t *bagp)
 {
 	bagiter_t bagiter;
 	bagobj_t *bagobjp;
@@ -6375,27 +6375,27 @@
 	size64_t dummykey;
 	void *dummypayloadp;
 
-	assert( bagp );
+	assert(bagp);
 
-	bagiter_init( bagp, &bagiter );
+	bagiter_init(bagp, &bagiter);
 
 	bagobjp = 0;
-	while (( bagelemp = bagiter_next( &bagiter, ( void ** )&bagobjp ) )) {
-		bag_remove( bagp, bagelemp, &dummykey, &dummypayloadp );
-		assert( bagobjp );
-		assert( bagobjp == ( bagobj_t * )dummypayloadp );
-		free( ( void * )bagobjp );
+	while ((bagelemp = bagiter_next(&bagiter, (void **)&bagobjp))) {
+		bag_remove(bagp, bagelemp, &dummykey, &dummypayloadp);
+		assert(bagobjp);
+		assert(bagobjp == (bagobj_t *)dummypayloadp);
+		free((void *)bagobjp);
 		bagobjp = 0;
 	}
 
-	bag_free( bagp );
+	bag_free(bagp);
 }
 
 /* a macro predicate to indicate if we know we are done. if we are not
  * done or don't know, returns FALSE.
  */
 static bool_t
-pi_alldone( void )
+pi_alldone(void)
 {
 	bag_t *bagp;
 	bool_t knownholespr;
@@ -6404,18 +6404,18 @@
 
 	knownholespr = BOOL_FALSE;
 	maybeholespr = BOOL_FALSE;
-	bagp = pi_neededobjs_nondir_alloc( &knownholespr,
+	bagp = pi_neededobjs_nondir_alloc(&knownholespr,
 					   &maybeholespr,
 					   BOOL_TRUE,
-					   BOOL_FALSE );
-	if ( bagp ) {
-		cnt = cntobj( bagp );
-		pi_neededobjs_free( bagp );
+					   BOOL_FALSE);
+	if (bagp) {
+		cnt = cntobj(bagp);
+		pi_neededobjs_free(bagp);
 	} else {
 		cnt = 0;
 	}
 
-	if ( cnt || knownholespr || maybeholespr ) {
+	if (cnt || knownholespr || maybeholespr) {
 		return BOOL_FALSE;
 	} else {
 		return BOOL_TRUE;
@@ -6427,7 +6427,7 @@
  * of the stream as well as the end of the object.
  */
 static void
-pi_hiteod( ix_t strmix, ix_t objix )
+pi_hiteod(ix_t strmix, ix_t objix)
 {
 	ix_t ix;
 	dh_t strmh;
@@ -6435,48 +6435,48 @@
 	size_t objcnt;
 	ix_t lastobjix;
 
-	pi_lock( );
+	pi_lock();
 
 	/* get handle to the indexed stream
 	 */
-	for ( ix = 0,
+	for (ix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL && ix < strmix
 	      ;
 	      ix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
-	assert( strmh != DH_NULL );
+	assert(strmh != DH_NULL);
 
 	/* get index to last object in stream
 	 */
-	for ( objcnt = 0, objh = DH2S( strmh )->s_cldh
+	for (objcnt = 0, objh = DH2S(strmh)->s_cldh
 	      ;
 	      objh != DH_NULL
 	      ;
-	      objh = DH2O( objh )->o_nexth, objcnt++ )
+	      objh = DH2O(objh)->o_nexth, objcnt++)
 		;
-	assert( objcnt != 0 );
+	assert(objcnt != 0);
 	lastobjix = objcnt - 1;
 
-	pi_unlock( );
+	pi_unlock();
 
 	/* can't possibly happen, but check for case where pi indicates
 	 * other media objects beyond this one.
 	 */
-	if ( objix != lastobjix ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+	if (objix != lastobjix) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 		      "hit EOD at stream %u object %u, "
 		      "yet inventory indicates last object index is %u\n"),
 		      strmix,
 		      objix,
-		      lastobjix );
+		      lastobjix);
 	} else {
-		pi_seestrmend( strmix );
+		pi_seestrmend(strmix);
 	}
 
-	pi_seeobjstrmend( strmix, lastobjix );
+	pi_seeobjstrmend(strmix, lastobjix);
 }
 
 /* tells the persistent inventory we hit end-of-media while examining the
@@ -6484,13 +6484,13 @@
  * of the object.
  */
 static void
-pi_hiteom( ix_t strmix, ix_t objix )
+pi_hiteom(ix_t strmix, ix_t objix)
 {
-	pi_seeobjstrmend( strmix, objix );
+	pi_seeobjstrmend(strmix, objix);
 }
 
 static void
-pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
+pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 {
 	ix_t ix;
 	dh_t strmh;
@@ -6498,49 +6498,49 @@
 	size_t objcnt;
 	ix_t lastobjix;
 
-	pi_lock( );
+	pi_lock();
 
 	/* get handle to the indexed stream
 	 */
-	for ( ix = 0,
+	for (ix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL && ix < strmix
 	      ;
 	      ix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
-	assert( strmh != DH_NULL );
+	assert(strmh != DH_NULL);
 
 	/* get index to last object in stream
 	 */
-	for ( objcnt = 0, objh = DH2S( strmh )->s_cldh
+	for (objcnt = 0, objh = DH2S(strmh)->s_cldh
 	      ;
 	      objh != DH_NULL
 	      ;
-	      objh = DH2O( objh )->o_nexth, objcnt++ )
+	      objh = DH2O(objh)->o_nexth, objcnt++)
 		;
-	assert( objcnt != 0 );
+	assert(objcnt != 0);
 	lastobjix = objcnt - 1;
 
-	pi_unlock( );
+	pi_unlock();
 
 	/* can't possibly happen, but check for case where pi indicates
 	 * other media objects beyond this one.
 	 */
-	if ( objix != lastobjix ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+	if (objix != lastobjix) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 		      "hit next dump at stream %u object %u file %u, "
 		      "yet inventory indicates last object index is %u\n"),
 		      strmix,
 		      objix,
 		      lastfileix,
-		      lastobjix );
+		      lastobjix);
 	} else {
-		pi_seestrmend( strmix );
+		pi_seestrmend(strmix);
 	}
 
-	pi_seeobjstrmend( strmix, lastobjix );
+	pi_seeobjstrmend(strmix, lastobjix);
 }
 
 /* returns TRUE if pi is certain no more useful media files remaining
@@ -6548,161 +6548,161 @@
  * the object, returns FALSE.
  */
 static bool_t
-pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
+pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 {
 	ix_t ix;
 	dh_t strmh;
 	dh_t objh;
 	dh_t fileh;
 
-	assert( purp == PURP_DIR || purp == PURP_NONDIR );
+	assert(purp == PURP_DIR || purp == PURP_NONDIR);
 
-	pi_lock( );
+	pi_lock();
 
 	/* get handle to the indexed stream
 	 */
-	for ( ix = 0,
+	for (ix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL && ix < strmix
 	      ;
 	      ix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
-	assert( strmh != DH_NULL );
+	assert(strmh != DH_NULL);
 
 	/* get handle to indexed object
 	 */
-	for ( ix = 0, objh = DH2S( strmh )->s_cldh
+	for (ix = 0, objh = DH2S(strmh)->s_cldh
 	      ;
 	      objh != DH_NULL && ix < objix
 	      ;
 	      ix++,
-	      objh = DH2O( objh )->o_nexth )
+	      objh = DH2O(objh)->o_nexth)
 		;
-	assert( objh != DH_NULL );
+	assert(objh != DH_NULL);
 
 	/* if don't know last media file on object, return FALSE
 	 */
-	if ( ! DH2O( objh )->o_lmfknwnpr ) {
-		pi_unlock( );
+	if (! DH2O(objh)->o_lmfknwnpr) {
+		pi_unlock();
 		return BOOL_FALSE;
 	}
 
 	/* check all media files on object. if any are not marked done,
 	 * return FALSE.
 	 */
-	for ( fileh = DH2O( objh )->o_cldh
+	for (fileh = DH2O(objh)->o_cldh
 	      ;
 	      fileh != DH_NULL
 	      ;
-	      fileh = DH2F( fileh )->f_nexth ) {
-		if ( DH2F( fileh )->f_flags & PF_INV ) {
+	      fileh = DH2F(fileh)->f_nexth) {
+		if (DH2F(fileh)->f_flags & PF_INV) {
 			continue;
 		}
-		if ( DH2F( fileh )->f_flags & PF_TERM ) {
+		if (DH2F(fileh)->f_flags & PF_TERM) {
 			continue;
 		}
-		if ( purp == PURP_DIR ) {
-			if ( ! DH2F( fileh )->f_dirtriedpr ) {
-				pi_unlock( );
+		if (purp == PURP_DIR) {
+			if (! DH2F(fileh)->f_dirtriedpr) {
+				pi_unlock();
 				return BOOL_FALSE;
 			}
 		} else {
-			if ( ! DH2F( fileh )->f_nondirskippr
+			if (! DH2F(fileh)->f_nondirskippr
 			     &&
-			     ! DH2F( fileh )->f_nondirdonepr ) {
-				pi_unlock( );
+			     ! DH2F(fileh)->f_nondirdonepr) {
+				pi_unlock();
 				return BOOL_FALSE;
 			}
 		}
 	}
 
-	pi_unlock( );
+	pi_unlock();
 	return BOOL_TRUE;
 }
 
 static bool_t
-pi_know_no_more_beyond_on_object( purp_t purp,
+pi_know_no_more_beyond_on_object(purp_t purp,
 				  ix_t strmix,
 				  ix_t objix,
-				  ix_t fileix )
+				  ix_t fileix)
 {
 	ix_t ix;
 	dh_t strmh;
 	dh_t objh;
 	dh_t fileh;
 
-	assert( purp == PURP_DIR || purp == PURP_NONDIR );
+	assert(purp == PURP_DIR || purp == PURP_NONDIR);
 
-	pi_lock( );
+	pi_lock();
 
 	/* get handle to the indexed stream
 	 */
-	for ( ix = 0,
+	for (ix = 0,
 	      strmh = persp->s.strmheadh
 	      ;
 	      strmh != DH_NULL && ix < strmix
 	      ;
 	      ix++,
-	      strmh = DH2S( strmh )->s_nexth )
+	      strmh = DH2S(strmh)->s_nexth)
 		;
-	assert( strmh != DH_NULL );
+	assert(strmh != DH_NULL);
 
 	/* get handle to indexed object
 	 */
-	for ( ix = 0,
-	      objh = DH2S( strmh )->s_cldh
+	for (ix = 0,
+	      objh = DH2S(strmh)->s_cldh
 	      ;
 	      objh != DH_NULL && ix < objix
 	      ;
 	      ix++,
-	      objh = DH2O( objh )->o_nexth )
+	      objh = DH2O(objh)->o_nexth)
 		;
-	assert( objh != DH_NULL );
+	assert(objh != DH_NULL);
 
 	/* if don't know last media file on object, return FALSE
 	 */
-	if ( ! DH2O( objh )->o_lmfknwnpr ) {
-		pi_unlock( );
+	if (! DH2O(objh)->o_lmfknwnpr) {
+		pi_unlock();
 		return BOOL_FALSE;
 	}
 
 	/* check all files on object after indexed file. if any are not marked
 	 * done, return FALSE. skip inventory and terminator files.
 	 */
-	for ( ix = 0,
-	      fileh = DH2O( objh )->o_cldh
+	for (ix = 0,
+	      fileh = DH2O(objh)->o_cldh
 	      ;
 	      fileh != DH_NULL
 	      ;
 	      ix++,
-	      fileh = DH2F( fileh )->f_nexth ) {
-		if ( ix <= fileix ) {
+	      fileh = DH2F(fileh)->f_nexth) {
+		if (ix <= fileix) {
 			continue;
 		}
-		if ( DH2F( fileh )->f_flags & PF_INV ) {
+		if (DH2F(fileh)->f_flags & PF_INV) {
 			continue;
 		}
-		if ( DH2F( fileh )->f_flags & PF_TERM ) {
+		if (DH2F(fileh)->f_flags & PF_TERM) {
 			continue;
 		}
-		if ( purp == PURP_DIR ) {
-			if ( ! DH2F( fileh )->f_dirtriedpr ) {
-				pi_unlock( );
+		if (purp == PURP_DIR) {
+			if (! DH2F(fileh)->f_dirtriedpr) {
+				pi_unlock();
 				return BOOL_FALSE;
 			}
 		} else {
-			if ( ! DH2F( fileh )->f_nondirdonepr
+			if (! DH2F(fileh)->f_nondirdonepr
 			     &&
-			     ! DH2F( fileh )->f_nondirskippr ) {
-				pi_unlock( );
+			     ! DH2F(fileh)->f_nondirskippr) {
+				pi_unlock();
 				return BOOL_FALSE;
 			}
 		}
 	}
 
-	pi_unlock( );
+	pi_unlock();
 	return BOOL_TRUE;
 }
 
@@ -6710,27 +6710,27 @@
  * ino map. *---o (endpoint not inclusive)
  */
 static bool_t
-gapneeded( egrp_t *firstegrpp, egrp_t *lastegrpp )
+gapneeded(egrp_t *firstegrpp, egrp_t *lastegrpp)
 {
 	xfs_ino_t endino;
 
-	if ( firstegrpp->eg_ino > lastegrpp->eg_ino ) {
+	if (firstegrpp->eg_ino > lastegrpp->eg_ino) {
 		return BOOL_FALSE;
 	}
 
-	if ( firstegrpp->eg_ino == lastegrpp->eg_ino
+	if (firstegrpp->eg_ino == lastegrpp->eg_ino
 	     &&
-	     firstegrpp->eg_off > lastegrpp->eg_off ) {
+	     firstegrpp->eg_off > lastegrpp->eg_off) {
 		return BOOL_FALSE;
 	}
 
-	if ( lastegrpp->eg_off > 0 || lastegrpp->eg_ino == 0 ) {
+	if (lastegrpp->eg_off > 0 || lastegrpp->eg_ino == 0) {
 		endino = lastegrpp->eg_ino;
 	} else {
 		endino = lastegrpp->eg_ino - 1;
 	}
 
-	if ( ! inomap_rst_needed( firstegrpp->eg_ino, endino )) {
+	if (! inomap_rst_needed(firstegrpp->eg_ino, endino)) {
 		return BOOL_FALSE;
 	}
 
@@ -6738,41 +6738,41 @@
 }
 
 static void
-addobj( bag_t *bagp,
+addobj(bag_t *bagp,
 	uuid_t *idp,
 	label_t label,
 	bool_t indrivepr,
-	ix_t indriveix )
+	ix_t indriveix)
 {
 	bagobj_t *bagobjp;
 
-	bagobjp = ( bagobj_t * )calloc( 1, sizeof( bagobj_t ));
-	assert( bagobjp );
+	bagobjp = (bagobj_t *)calloc(1, sizeof(bagobj_t));
+	assert(bagobjp);
 	uuid_copy(bagobjp->id, *idp);
-	strncpy( bagobjp->label,
+	strncpy(bagobjp->label,
 		 label,
-		 sizeof( bagobjp->label ));
+		 sizeof(bagobjp->label));
 	bagobjp->indrivepr = indrivepr;
 	bagobjp->indriveix = indriveix;
-	bag_insert( bagp,
+	bag_insert(bagp,
 		    &bagobjp->bagelem,
-		    ( size64_t )0,
-		    ( void * )bagobjp );
+		    (size64_t)0,
+		    (void *)bagobjp);
 }
 
 static size_t
-cntobj( bag_t *bagp )
+cntobj(bag_t *bagp)
 {
 	bagiter_t bagiter;
 	bagobj_t *bagobjp;
 	size_t cnt;
 
-	assert( bagp );
+	assert(bagp);
 
-	bagiter_init( bagp, &bagiter );
+	bagiter_init(bagp, &bagiter);
 	cnt = 0;
 	bagobjp = 0; /* keep lint happy */
-	while ( bagiter_next( &bagiter, ( void ** )&bagobjp )) {
+	while (bagiter_next(&bagiter, (void **)&bagobjp)) {
 		cnt++;
 		bagobjp = 0; /* keep lint happy */
 	}
@@ -6788,7 +6788,7 @@
  * must be last dump of a lesser level
  */
 static bool_t
-askinvforbaseof( uuid_t baseid, inv_session_t *sessp )
+askinvforbaseof(uuid_t baseid, inv_session_t *sessp)
 {
 	ix_t level;
 	bool_t resumedpr;
@@ -6796,29 +6796,29 @@
 	inv_session_t *basesessp;
 	bool_t ok;
 
-	level = ( ix_t )sessp->s_level;
+	level = (ix_t)sessp->s_level;
 	resumedpr = sessp->s_isresumed;
 
 	/* don't look for base if level 0 and not resumed
 	 */
-	if ( level == 0 && ! resumedpr ) {
+	if (level == 0 && ! resumedpr) {
 		return BOOL_TRUE;
 	}
 
 	/* open the inventory for this file system
 	 */
-	invtok = inv_open( INV_BY_UUID,
+	invtok = inv_open(INV_BY_UUID,
 			   INV_SEARCH_ONLY,
-			   ( void * )&sessp->s_fsid );
-	if ( invtok == INV_TOKEN_NULL ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-		      "unable to open inventory to validate dump\n") );
+			   (void *)&sessp->s_fsid);
+	if (invtok == INV_TOKEN_NULL) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+		      "unable to open inventory to validate dump\n"));
 		return BOOL_FALSE;
 	}
 
 	/* get the base session
 	 */
-	if ( resumedpr ) {
+	if (resumedpr) {
 		ok = inv_lastsession_level_equalto(&sessp->s_fsid,
 						    invtok,
 						    (u_char_t)level,
@@ -6829,17 +6829,17 @@
 						     (u_char_t)level,
 						     &basesessp);
 	}
-	if ( ! ok ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+	if (! ok) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 		      "unable to find base dump in inventory "
-		      "to validate dump\n") );
+		      "to validate dump\n"));
 		return BOOL_FALSE;
 	}
 
 	/* close the inventory
 	 */
-	ok = inv_close( invtok );
-	assert( ok );
+	ok = inv_close(invtok);
+	assert(ok);
 
 	/* return id of base session
 	 */
@@ -6847,39 +6847,39 @@
 
 	/* free the base session descriptor
 	 */
-	inv_free_session( &basesessp );
+	inv_free_session(&basesessp);
 
 	return BOOL_TRUE;
 }
 
 static bool_t
-dumpcompat( bool_t resumepr, ix_t level, uuid_t baseid, bool_t logpr )
+dumpcompat(bool_t resumepr, ix_t level, uuid_t baseid, bool_t logpr)
 {
-	if ( persp->a.cumpr ) {
-		if ( persp->a.dumpcnt == 0 ) {
-			if ( resumepr ) {
-				if ( logpr ) {
-				    mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (persp->a.cumpr) {
+		if (persp->a.dumpcnt == 0) {
+			if (resumepr) {
+				if (logpr) {
+				    mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					  "cumulative restores must begin with "
 					  "an initial (not resumed) "
-					  "level 0 dump\n") );
+					  "level 0 dump\n"));
 				}
 				return BOOL_FALSE;
 			}
-			if ( level > 0 ) {
-				if ( logpr ) {
-				    mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (level > 0) {
+				if (logpr) {
+				    mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					  "cumulative restores must begin with "
-					  "a level 0 dump\n") );
+					  "a level 0 dump\n"));
 				}
 				return BOOL_FALSE;
 			}
 		} else {
-			if ( resumepr ) {
-				if ( uuid_compare( persp->a.lastdumpid,
+			if (resumepr) {
+				if (uuid_compare(persp->a.lastdumpid,
 						   baseid) != 0) {
-					if ( logpr ) {
-					    mlog( MLOG_NORMAL | MLOG_ERROR, _(
+					if (logpr) {
+					    mlog(MLOG_NORMAL | MLOG_ERROR, _(
 						  "selected resumed dump "
 						  "not a resumption of "
 						  "previously applied dump\n"));
@@ -6887,10 +6887,10 @@
 					return BOOL_FALSE;
 				}
 			} else {
-				if ( uuid_compare( persp->a.lastdumpid,
+				if (uuid_compare(persp->a.lastdumpid,
 						   baseid) != 0) {
-					if ( logpr ) {
-					    mlog( MLOG_NORMAL | MLOG_ERROR, _(
+					if (logpr) {
+					    mlog(MLOG_NORMAL | MLOG_ERROR, _(
 						  "selected dump not based on "
 						  "previously applied dump\n"));
 					}
@@ -6908,23 +6908,23 @@
  * still needed/available
  */
 static bool_t
-Media_prompt_change( drive_t *drivep,
+Media_prompt_change(drive_t *drivep,
 		     purp_t purp,
 		     bag_t *bagp,
 		     bool_t knownholespr,
-		     bool_t maybeholespr )
+		     bool_t maybeholespr)
 {
 	fold_t fold;
-	char question[ 100 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char question[100];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -6934,47 +6934,47 @@
 	ix_t sigintix;
 
 retry:
-	fold_init( fold, _("change media dialog"), '=' );
+	fold_init(fold, _("change media dialog"), '=');
 	preamblecnt = 0;
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* query: ask if media changed or declined
 	 */
-	if ( drivecnt > 1 ) {
-		sprintf( question, _(
+	if (drivecnt > 1) {
+		sprintf(question, _(
 			 "please change media in "
 			 "drive %u\n"),
-			 (unsigned int)drivep->d_index );
+			 (unsigned int)drivep->d_index);
 	} else {
-		sprintf( question, _(
+		sprintf(question, _(
 			 "please change media in "
-			 "drive\n") );
+			 "drive\n"));
 	}
 	querycnt = 0;
-	querystr[ querycnt++ ] = question;
-	assert( querycnt <= QUERYMAX );
+	querystr[querycnt++] = question;
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = _("media change declined");
-	if ( purp != PURP_SEARCH ) {
+	choicestr[choicecnt++ ] = _("media change declined");
+	if (purp != PURP_SEARCH) {
 		invstatix = choicecnt;
-		choicestr[ choicecnt++ ] = _("display media inventory status");
+		choicestr[choicecnt++ ] = _("display media inventory status");
 		neededix = choicecnt;
-		choicestr[ choicecnt++ ] = _("list needed media objects");
+		choicestr[choicecnt++ ] = _("list needed media objects");
 	} else {
 		invstatix = IXMAX;
 		neededix = IXMAX;
 	}
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = _("media changed");
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++ ] = _("media changed");
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -6986,76 +6986,76 @@
 				       dontix,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = _("examining new media\n");
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = _("media change aborted\n");
-	} else if ( responseix == invstatix ) {
-		ackstr[ ackcnt++ ] = "\n";
-		assert( ackcnt <= ACKMAX );
-		dlog_multi_ack( ackstr,
-				ackcnt );
-		pi_show_nomloglock( );
+	if (responseix == doix) {
+		ackstr[ackcnt++ ] = _("examining new media\n");
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++ ] = _("media change aborted\n");
+	} else if (responseix == invstatix) {
+		ackstr[ackcnt++ ] = "\n";
+		assert(ackcnt <= ACKMAX);
+		dlog_multi_ack(ackstr,
+				ackcnt);
+		pi_show_nomloglock();
 		postamblecnt = 0;
-		fold_init( fold, _("end dialog"), '-' );
-		postamblestr[ postamblecnt++ ] = "\n";
-		postamblestr[ postamblecnt++ ] = fold;
-		postamblestr[ postamblecnt++ ] = "\n\n";
-		assert( postamblecnt <= POSTAMBLEMAX );
-		dlog_end( postamblestr,
-			  postamblecnt );
+		fold_init(fold, _("end dialog"), '-');
+		postamblestr[postamblecnt++ ] = "\n";
+		postamblestr[postamblecnt++] = fold;
+		postamblestr[postamblecnt++ ] = "\n\n";
+		assert(postamblecnt <= POSTAMBLEMAX);
+		dlog_end(postamblestr,
+			  postamblecnt);
 		goto retry;
-	} else if ( responseix == neededix ) {
-		ackstr[ ackcnt++ ] = "\n";
-		assert( ackcnt <= ACKMAX );
-		dlog_multi_ack( ackstr,
-				ackcnt );
-		display_needed_objects( purp,
+	} else if (responseix == neededix) {
+		ackstr[ackcnt++ ] = "\n";
+		assert(ackcnt <= ACKMAX);
+		dlog_multi_ack(ackstr,
+				ackcnt);
+		display_needed_objects(purp,
 					bagp,
 					knownholespr,
-					maybeholespr );
+					maybeholespr);
 		postamblecnt = 0;
-		fold_init( fold, "end dialog", '-' );
-		postamblestr[ postamblecnt++ ] = "\n";
-		postamblestr[ postamblecnt++ ] = fold;
-		postamblestr[ postamblecnt++ ] = "\n\n";
-		assert( postamblecnt <= POSTAMBLEMAX );
-		dlog_end( postamblestr,
-			  postamblecnt );
+		fold_init(fold, "end dialog", '-');
+		postamblestr[postamblecnt++ ] = "\n";
+		postamblestr[postamblecnt++] = fold;
+		postamblestr[postamblecnt++ ] = "\n\n";
+		assert(postamblecnt <= POSTAMBLEMAX);
+		dlog_end(postamblestr,
+			  postamblecnt);
 		goto retry;
 	} else {
-		assert( responseix == sigintix );
-		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
+		assert(responseix == sigintix);
+		ackstr[ackcnt++ ] = _("keyboard interrupt\n");
 	}
 
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, _("end dialog"), '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, _("end dialog"), '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	if (responseix == sigintix) {
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying media change dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media change dialog\n");
 		goto retry;
 	}
 
@@ -7066,23 +7066,23 @@
  * the dump to be restored
  */
 static bool_t
-promptdumpmatch( ix_t thrdix,
+promptdumpmatch(ix_t thrdix,
 		 global_hdr_t *grhdrp,
 		 media_hdr_t *mrhdrp,
 		 content_hdr_t *crhdrp,
-		 content_inode_hdr_t *scrhdrp )
+		 content_inode_hdr_t *scrhdrp)
 {
 	fold_t fold;
-	char introstring[ 80 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char introstring[80];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -7091,54 +7091,54 @@
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, _("dump selection dialog"), '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, _("dump selection dialog"), '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* display vital stats and ask if this one should be restored
 	 */
-	if ( drivecnt > 0 ) {
-		sprintf( introstring, _(
+	if (drivecnt > 0) {
+		sprintf(introstring, _(
 			 "the following dump has been found"
 			 " on drive %u"
 			 "\n\n"),
-			 (unsigned int)thrdix );
+			 (unsigned int)thrdix);
 	} else {
-		sprintf( introstring, _(
+		sprintf(introstring, _(
 			 "the following dump has been found"
-			 "\n\n") );
+			 "\n\n"));
 	}
-	assert( strlen( introstring ) < sizeof( introstring ));
-	display_dump_label( BOOL_FALSE,
+	assert(strlen(introstring) < sizeof(introstring));
+	display_dump_label(BOOL_FALSE,
 			    MLOG_NORMAL | MLOG_BARE,
 			    introstring,
 			    grhdrp,
 			    mrhdrp,
 			    crhdrp,
-			    scrhdrp );
+			    scrhdrp);
 
 	querycnt = 0;
-	if ( tranp->t_toconlypr ) {
-		querystr[ querycnt++ ] = _("\nexamine this dump?\n");
+	if (tranp->t_toconlypr) {
+		querystr[querycnt++ ] = _("\nexamine this dump?\n");
 	} else {
-		querystr[ querycnt++ ] = (persp->a.interpr) ?
+		querystr[querycnt++] = (persp->a.interpr) ?
 			_("\ninteractively restore from this dump?\n")
 				: _("\nrestore this dump?\n");
 	}
-	assert( querycnt <= QUERYMAX );
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = _("skip");
+	choicestr[choicecnt++ ] = _("skip");
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = (persp->a.interpr) ?
+	choicestr[choicecnt++] = (persp->a.interpr) ?
 				_("interactively restore\n") : _("restore\n");
-	assert( choicecnt <= CHOICEMAX );
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -7150,45 +7150,45 @@
 				       IXMAX,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = (persp->a.interpr) ?
+	if (responseix == doix) {
+		ackstr[ackcnt++] = (persp->a.interpr) ?
 			_("this dump selected for interactive restoral\n")
 			      : _("this dump selected for restoral\n");
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = _("dump skipped\n");
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++ ] = _("dump skipped\n");
 	} else {
-		assert( responseix == sigintix );
-		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
+		assert(responseix == sigintix);
+		ackstr[ackcnt++ ] = _("keyboard interrupt\n");
 	}
 
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
+	fold_init(fold, "end dialog", '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr,
+		  postamblecnt);
 
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	if (responseix == sigintix) {
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying dump selection dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying dump selection dialog\n");
 		goto retry;
 	}
 
@@ -7212,15 +7212,15 @@
 
 typedef struct cb_context cb_context_t;
 
-static bool_t restore_file_cb( void *, bool_t, char *, char * );
+static bool_t restore_file_cb(void *, bool_t, char *, char *);
 
 static rv_t
-restore_file( drive_t *drivep,
+restore_file(drive_t *drivep,
 	      filehdr_t *fhdrp,
 	      bool_t ehcs,
 	      bool_t ahcs,
 	      char *path1,
-	      char *path2 )
+	      char *path2)
 {
 	rv_t rv;
 	bstat_t *bstatp = &fhdrp->fh_stat;
@@ -7237,14 +7237,14 @@
 	context.cb_ahcs = ahcs;
 	context.cb_path1 = path1;
 	context.cb_path2 = path2;
-	rv = tree_cb_links( bstatp->bs_ino,
+	rv = tree_cb_links(bstatp->bs_ino,
 		       bstatp->bs_gen,
 		       bstatp->bs_ctime.tv_sec,
 		       bstatp->bs_mtime.tv_sec,
 		       restore_file_cb,
 		       &context,
 		       path1,
-		       path2 );
+		       path2);
 	if (context.cb_rv) /* context error result has precedence */
 	    return context.cb_rv; /* this would be set by callback */
 	else
@@ -7259,9 +7259,9 @@
  * if this func returns FALSE, will cause tree_cb_links to abort
  */
 static bool_t
-restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
+restore_file_cb(void *cp, bool_t linkpr, char *path1, char *path2)
 {
-	cb_context_t *contextp = ( cb_context_t * )cp;
+	cb_context_t *contextp = (cb_context_t *)cp;
 	drive_t *drivep = contextp->cb_drivep;
 	filehdr_t *fhdrp = contextp->cb_fhdrp;
 	bstat_t *bstatp = &fhdrp->fh_stat;
@@ -7273,12 +7273,12 @@
 	int rval;
 	bool_t ok;
 
-	if ( cldmgr_stop_requested( )) {
+	if (cldmgr_stop_requested()) {
 		*rvp = RV_INTR;
 		return BOOL_FALSE;
 	}
 
-	if ( ! linkpr ) {
+	if (! linkpr) {
 		if (path1) {
 			/* cache the path for use in restoring attributes
 			 * and extended attributes
@@ -7288,26 +7288,26 @@
 
 		/* call type-specific function to create the file
 		 */
-		switch( bstatp->bs_mode & S_IFMT ) {
+		switch(bstatp->bs_mode & S_IFMT) {
 		case S_IFREG:
-			ok = restore_reg( drivep, fhdrp, rvp, path1 );
+			ok = restore_reg(drivep, fhdrp, rvp, path1);
 			if (!ok)
 				return ok;
-			if ( fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR ) {
-				*rvp = restore_extattr( drivep,
+			if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
+				*rvp = restore_extattr(drivep,
 							fhdrp,
 							path1,
 							ahcs,
 							BOOL_FALSE, /* isdirpr */
 							BOOL_FALSE, /* onlydoreadpr */
-							DAH_NULL );
+							DAH_NULL);
 			} else {
-				ok = restore_extent_group( drivep,
+				ok = restore_extent_group(drivep,
 							   fhdrp,
 							   path1,
 							   strctxp->sc_fd,
 							   ehcs,
-							   rvp );
+							   rvp);
 			}
 			return ok;
 		case S_IFBLK:
@@ -7317,57 +7317,57 @@
 		case S_IFNAM:
 #endif
 		case S_IFSOCK:
-			ok = restore_spec( fhdrp, rvp, path1 );
+			ok = restore_spec(fhdrp, rvp, path1);
 			return ok;
 		case S_IFLNK:
-			ok = restore_symlink( drivep,
+			ok = restore_symlink(drivep,
 					      fhdrp,
 					      rvp,
 					      path1,
 					      path2,
-					      ehcs );
+					      ehcs);
 			return ok;
 		default:
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "ino %llu: unknown file type: %08x\n"),
 			      bstatp->bs_ino,
-			      bstatp->bs_mode );
+			      bstatp->bs_mode);
 			return BOOL_FALSE;
 		}
-	} else if ( ! tranp->t_toconlypr ) {
-		assert( path1 );
-		assert( path2 );
-		mlog( MLOG_TRACE,
+	} else if (! tranp->t_toconlypr) {
+		assert(path1);
+		assert(path2);
+		mlog(MLOG_TRACE,
 		      "linking %s to %s\n",
 		      path1,
-		      path2 );
-		rval = unlink( path2 );
-		if ( rval && errno != ENOENT ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		      path2);
+		rval = unlink(path2);
+		if (rval && errno != ENOENT) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "unable to unlink "
 			      "current file prior to linking "
 			      "%s to %s:"
 			      " %s\n"),
 			      path1,
 			      path2,
-			      strerror( errno ));
+			      strerror(errno));
 		} else {
-			rval = link( path1, path2 );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			rval = link(path1, path2);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "attempt to "
 				      "link %s to %s failed:"
 				      " %s\n"),
 				      path1,
 				      path2,
-				      strerror( errno ));
+				      strerror(errno));
 			}
 		}
 		return BOOL_TRUE;
 	} else {
-		mlog( MLOG_NORMAL | MLOG_BARE,
+		mlog(MLOG_NORMAL | MLOG_BARE,
 		      "%s\n",
-		      path2 );
+		      path2);
 		return BOOL_TRUE;
 	}
 }
@@ -7387,7 +7387,7 @@
 	mode_t		mode = (mode_t)bstatp->bs_mode;
 	int		rval;
 
-	rval = fchown(*fdp, (uid_t)bstatp->bs_uid, (gid_t)bstatp->bs_gid );
+	rval = fchown(*fdp, (uid_t)bstatp->bs_uid, (gid_t)bstatp->bs_gid);
 	if (!rval)
 		goto done;
 
@@ -7434,10 +7434,10 @@
  * this iteration.
  */
 static bool_t
-restore_reg( drive_t *drivep,
+restore_reg(drive_t *drivep,
 	     filehdr_t *fhdrp,
 	     rv_t *rvp,
-	     char *path )
+	     char *path)
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	stream_context_t *strctxp = (stream_context_t *)drivep->d_strmcontextp;
@@ -7447,73 +7447,73 @@
 	struct stat64 stat;
 	int oflags;
 
-	if ( !path )
+	if (!path)
 		return BOOL_TRUE;
 
-	if ( fhdrp->fh_offset ) {
-		if ( ! tranp->t_toconlypr ) {
-			mlog( MLOG_TRACE,
+	if (fhdrp->fh_offset) {
+		if (! tranp->t_toconlypr) {
+			mlog(MLOG_TRACE,
 			      "restoring regular file ino %llu %s"
 			      " (offset %lld)\n",
 			      bstatp->bs_ino,
 			      path,
-			      fhdrp->fh_offset );
+			      fhdrp->fh_offset);
 		} else {
-			mlog( MLOG_NORMAL | MLOG_BARE,
+			mlog(MLOG_NORMAL | MLOG_BARE,
 			      _("%s (offset %lld)\n"),
 			      path,
-			      fhdrp->fh_offset );
+			      fhdrp->fh_offset);
 		}
 	} else {
-		if ( ! tranp->t_toconlypr ) {
-			mlog( MLOG_TRACE,
+		if (! tranp->t_toconlypr) {
+			mlog(MLOG_TRACE,
 			      "restoring regular file ino %llu %s\n",
 			      bstatp->bs_ino,
-			      path );
+			      path);
 		} else {
-			mlog( MLOG_NORMAL | MLOG_BARE,
+			mlog(MLOG_NORMAL | MLOG_BARE,
 			      "%s\n",
-			      path );
+			      path);
 		}
 	}
 
-	if ( tranp->t_toconlypr )
+	if (tranp->t_toconlypr)
 		return BOOL_TRUE;
 
 	oflags = O_CREAT | O_RDWR;
 	if (persp->a.dstdirisxfspr && bstatp->bs_xflags & XFS_XFLAG_REALTIME)
 		oflags |= O_DIRECT;
 
-	*fdp = open( path, oflags, S_IRUSR | S_IWUSR );
-	if ( *fdp < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING,
+	*fdp = open(path, oflags, S_IRUSR | S_IWUSR);
+	if (*fdp < 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING,
 		      _("open of %s failed: %s: discarding ino %llu\n"),
 		      path,
-		      strerror( errno ),
-		      bstatp->bs_ino );
+		      strerror(errno),
+		      bstatp->bs_ino);
 		return BOOL_TRUE;
 	}
 
-	rval = fstat64( *fdp, &stat );
-	if ( rval != 0 ) {
-		mlog( MLOG_VERBOSE | MLOG_WARNING,
+	rval = fstat64(*fdp, &stat);
+	if (rval != 0) {
+		mlog(MLOG_VERBOSE | MLOG_WARNING,
 		      _("attempt to stat %s failed: %s\n"),
 		      path,
-		      strerror( errno ));
+		      strerror(errno));
 	} else {
-		if ( stat.st_size != bstatp->bs_size ) {
-			mlog( MLOG_TRACE,
+		if (stat.st_size != bstatp->bs_size) {
+			mlog(MLOG_TRACE,
 			      "truncating %s from %lld to %lld\n",
 			      path,
 			      stat.st_size,
-			      bstatp->bs_size );
+			      bstatp->bs_size);
 
-			rval = ftruncate64( *fdp, bstatp->bs_size );
-			if ( rval != 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING,
+			rval = ftruncate64(*fdp, bstatp->bs_size);
+			if (rval != 0) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING,
 				      _("attempt to truncate %s failed: %s\n"),
 				      path,
-				      strerror( errno ));
+				      strerror(errno));
 			}
 		}
 	}
@@ -7524,20 +7524,20 @@
 			return BOOL_TRUE;
 	}
 
-	if ( persp->a.dstdirisxfspr ) {
+	if (persp->a.dstdirisxfspr) {
 
 		/* set the extended inode flags, except those which must
 		 * be set only after all data has been restored.
 		 */
-		assert( bstatp->bs_extsize >= 0 );
-		memset((void *)&fsxattr, 0, sizeof( fsxattr ));
+		assert(bstatp->bs_extsize >= 0);
+		memset((void *)&fsxattr, 0, sizeof(fsxattr));
 		fsxattr.fsx_xflags = bstatp->bs_xflags & ~POST_DATA_XFLAGS;
 		fsxattr.fsx_extsize = (uint32_t) bstatp->bs_extsize;
 		fsxattr.fsx_projid = bstat_projid(bstatp);
 
-		rval = ioctl( *fdp, XFS_IOC_FSSETXATTR, (void *)&fsxattr);
-		if ( rval < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING,
+		rval = ioctl(*fdp, XFS_IOC_FSSETXATTR, (void *)&fsxattr);
+		if (rval < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING,
 			      _("attempt to set extended attributes "
 				"(xflags 0x%x, extsize = 0x%x, projid = 0x%x) "
 				"of %s failed: %s\n"),
@@ -7549,10 +7549,10 @@
 		}
 	}
 
-	if ( persp->a.dstdirisxfspr && persp->a.restoredmpr ) {
-		HsmBeginRestoreFile( bstatp,
+	if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
+		HsmBeginRestoreFile(bstatp,
 				     *fdp,
-				     &strctxp->sc_hsmflags );
+				     &strctxp->sc_hsmflags);
 	}
 
 	return BOOL_TRUE;
@@ -7564,12 +7564,12 @@
  * drive errors. returns FALSE if should abort this iteration.
  */
 static bool_t
-restore_extent_group( drive_t *drivep,
+restore_extent_group(drive_t *drivep,
 		      filehdr_t *fhdrp,
 		      char *path,
 		      int fd,
 		      bool_t ehcs,
-		      rv_t *rvp )
+		      rv_t *rvp)
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	off64_t restoredsz = 0;
@@ -7579,25 +7579,25 @@
 
 	/* copy data extents from media to the file
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		/* read the extent header
 		 */
-		rv = read_extenthdr( drivep, &ehdr, ehcs );
-		if ( rv != RV_OK ) {
+		rv = read_extenthdr(drivep, &ehdr, ehcs);
+		if (rv != RV_OK) {
 			*rvp = rv;
 			return BOOL_FALSE;
 		}
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "read extent hdr type %s offset %lld sz %lld flags %x\n",
-		      ehdr_typestr( ehdr.eh_type ),
+		      ehdr_typestr(ehdr.eh_type),
 		      ehdr.eh_offset,
 		      ehdr.eh_sz,
-		      ehdr.eh_flags );
+		      ehdr.eh_flags);
 
 		/* if we see the specially marked last extent hdr,
 		 * we are done.
 		 */
-		if ( ehdr.eh_type == EXTENTHDR_TYPE_LAST ) {
+		if (ehdr.eh_type == EXTENTHDR_TYPE_LAST) {
 			/* For a wholly sparse file, there is no HOLE
 			 * record; advance restoredsz to EOF.
 			 */
@@ -7608,12 +7608,12 @@
 
 		/* if its an ALIGNment extent, discard the extent.
 		 */
-		if ( ehdr.eh_type == EXTENTHDR_TYPE_ALIGN ) {
+		if (ehdr.eh_type == EXTENTHDR_TYPE_ALIGN) {
 			size_t sz;
-			assert( ehdr.eh_sz <= INTGENMAX );
-			sz = ( size_t )ehdr.eh_sz;
-			rv = discard_padding( sz, drivep );
-			if ( rv != RV_OK ) {
+			assert(ehdr.eh_sz <= INTGENMAX);
+			sz = (size_t)ehdr.eh_sz;
+			rv = discard_padding(sz, drivep);
+			if (rv != RV_OK) {
 				*rvp = rv;
 				return BOOL_FALSE;
 			}
@@ -7628,26 +7628,26 @@
 		/* Holes do not need to be restored since we now
 		 * unlink the file at the start of the restore.
 		 */
-		if ( ehdr.eh_type == EXTENTHDR_TYPE_HOLE ) {
+		if (ehdr.eh_type == EXTENTHDR_TYPE_HOLE) {
 			continue;
 		}
 
 		/* real data
 		 */
-		assert( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
+		assert(ehdr.eh_type == EXTENTHDR_TYPE_DATA);
 		bytesread = 0;
-		rv = restore_extent( fhdrp,
+		rv = restore_extent(fhdrp,
 				     &ehdr,
 				     fd,
 				     path,
 				     drivep,
-				     &bytesread );
-		if ( rv != RV_OK ) {
+				     &bytesread);
+		if (rv != RV_OK) {
 			*rvp = rv;
 			return BOOL_FALSE;
 		}
 
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			*rvp = RV_INTR;
 			return BOOL_FALSE;
 		}
@@ -7697,15 +7697,15 @@
 
 	/* set the access and modification times
 	 */
-	utimbuf.actime = ( time32_t )bstatp->bs_atime.tv_sec;
-	utimbuf.modtime = ( time32_t )bstatp->bs_mtime.tv_sec;
-	rval = utime( path, &utimbuf );
-	if ( rval ) {
-		mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+	utimbuf.actime = (time32_t)bstatp->bs_atime.tv_sec;
+	utimbuf.modtime = (time32_t)bstatp->bs_mtime.tv_sec;
+	rval = utime(path, &utimbuf);
+	if (rval) {
+		mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 		      "unable to set access and modification "
 		      "times of %s: %s\n"),
 		      path,
-		      strerror( errno ));
+		      strerror(errno));
 	}
 
 	/* set the owner and group (if enabled)
@@ -7718,15 +7718,15 @@
 
 	/* set the permissions/mode
 	 */
-	rval = fchmod( fd, ( mode_t )bstatp->bs_mode );
-	if ( rval ) {
-		mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+	rval = fchmod(fd, (mode_t)bstatp->bs_mode);
+	if (rval) {
+		mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 		      "unable to set mode of %s: %s\n"),
 		      path,
-		      strerror( errno ));
+		      strerror(errno));
 	}
 
-	if ( persp->a.dstdirisxfspr && persp->a.restoredmpr ) {
+	if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
 		fsdmidata_t fssetdm;
 
 		/* Set the DMAPI Fields. */
@@ -7734,30 +7734,30 @@
 		fssetdm.fsd_padding = 0;
 		fssetdm.fsd_dmstate = bstatp->bs_dmstate;
 
-		rval = ioctl( fd, XFS_IOC_FSSETDM, ( void * )&fssetdm );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING,
+		rval = ioctl(fd, XFS_IOC_FSSETDM, (void *)&fssetdm);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING,
 			      _("attempt to set DMI attributes of %s "
 			      "failed: %s\n"),
 			      path,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 
-		HsmEndRestoreFile( path, fd, &strcxtp->sc_hsmflags );
+		HsmEndRestoreFile(path, fd, &strcxtp->sc_hsmflags);
 	}
 
 	/* set any extended inode flags that couldn't be set
 	 * prior to restoring the data.
 	 */
-	if ( persp->a.dstdirisxfspr && bstatp->bs_xflags & POST_DATA_XFLAGS ) {
+	if (persp->a.dstdirisxfspr && bstatp->bs_xflags & POST_DATA_XFLAGS) {
 		struct fsxattr fsxattr;
-		memset((void *)&fsxattr, 0, sizeof( fsxattr ));
+		memset((void *)&fsxattr, 0, sizeof(fsxattr));
 		fsxattr.fsx_xflags = bstatp->bs_xflags;
 		fsxattr.fsx_extsize = (uint32_t)bstatp->bs_extsize;
 		fsxattr.fsx_projid = bstat_projid(bstatp);
 
-		rval = ioctl( fd, XFS_IOC_FSSETXATTR, (void *)&fsxattr );
-		if ( rval < 0 ) {
+		rval = ioctl(fd, XFS_IOC_FSSETXATTR, (void *)&fsxattr);
+		if (rval < 0) {
 			mlog(MLOG_NORMAL | MLOG_WARNING,
 			     _("attempt to set extended attributes "
 			     "(xflags 0x%x, extsize = 0x%x, projid = 0x%x) "
@@ -7776,18 +7776,18 @@
 
 /* ARGSUSED */
 static bool_t
-restore_spec( filehdr_t *fhdrp, rv_t *rvp, char *path )
+restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path)
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	struct utimbuf utimbuf;
 	char *printstr;
 	int rval;
 
-	if ( ! path ) {
+	if (! path) {
 		return BOOL_TRUE;
 	}
 
-	switch ( bstatp->bs_mode & S_IFMT ) {
+	switch (bstatp->bs_mode & S_IFMT) {
 	case S_IFBLK:
 		printstr = _("block special file");
 		break;
@@ -7806,131 +7806,131 @@
 		printstr = _("UNIX domain socket");
 		break;
 	default:
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "%s: unknown file type: mode 0x%x ino %llu\n"),
 		      path,
 		      bstatp->bs_mode,
-		      fhdrp->fh_stat.bs_ino );
+		      fhdrp->fh_stat.bs_ino);
 		return BOOL_TRUE;
 	}
 
-	if ( ! tranp->t_toconlypr ) {
-		mlog( MLOG_TRACE,
+	if (! tranp->t_toconlypr) {
+		mlog(MLOG_TRACE,
 		      "restoring %s ino %llu %s\n",
 		      printstr,
 		      fhdrp->fh_stat.bs_ino,
-		      path );
+		      path);
 	} else {
-		mlog( MLOG_NORMAL | MLOG_BARE,
+		mlog(MLOG_NORMAL | MLOG_BARE,
 		      "%s\n",
-		      path );
+		      path);
 	}
 
-	if ( ! tranp->t_toconlypr ) {
-		if ( ( bstatp->bs_mode & S_IFMT ) == S_IFSOCK ) {
+	if (! tranp->t_toconlypr) {
+		if ((bstatp->bs_mode & S_IFMT) == S_IFSOCK) {
 			int sockfd;
 			struct sockaddr_un addr;
 			size_t addrlen;
 
-			sockfd = socket( AF_UNIX, SOCK_STREAM, 0 );
-			if ( sockfd < 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
+			if (sockfd < 0) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 				      "unable to create "
 				      "%s ino %llu %s: %s: discarding\n"),
 				      printstr,
 				      fhdrp->fh_stat.bs_ino,
 				      path,
-				      strerror( errno ));
+				      strerror(errno));
 				return BOOL_TRUE;
 			}
-			memset( ( void * )&addr, 0, sizeof( addr ));
+			memset((void *)&addr, 0, sizeof(addr));
 			addr.sun_family = AF_UNIX;
-			if ( strlen( path ) >= sizeof( addr.sun_path )) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			if (strlen(path) >= sizeof(addr.sun_path)) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 				      "pathname too long for bind of "
 				      "%s ino %llu %s: discarding\n"),
 				      printstr,
 				      fhdrp->fh_stat.bs_ino,
-				      path );
-				( void )close( sockfd );
+				      path);
+				(void)close(sockfd);
 				return BOOL_TRUE;
 			}
-			strcpy( addr.sun_path, path );
-			addrlen = strlen( addr.sun_path )
+			strcpy(addr.sun_path, path);
+			addrlen = strlen(addr.sun_path)
 				  +
-				  sizeof( addr.sun_family );
-			rval = bind( sockfd,
-				     ( struct sockaddr * )&addr,
-				     ( int )addrlen );
-			if ( rval < 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+				  sizeof(addr.sun_family);
+			rval = bind(sockfd,
+				     (struct sockaddr *)&addr,
+				     (int)addrlen);
+			if (rval < 0) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 				      "unable to bind "
 				      "%s ino %llu %s: %s: discarding\n"),
 				      printstr,
 				      fhdrp->fh_stat.bs_ino,
 				      path,
-				      strerror( errno ));
-				( void )close( sockfd );
+				      strerror(errno));
+				(void)close(sockfd);
 				return BOOL_TRUE;
 			}
-			( void )close( sockfd );
+			(void)close(sockfd);
 
 		} else {
 			/* create the node
 			*/
-			rval = mknod( path,
-				      ( mode_t )bstatp->bs_mode,
-				      ( dev_t )IRIX_DEV_TO_KDEVT(bstatp->bs_rdev));
-			if ( rval && rval != EEXIST ) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			rval = mknod(path,
+				      (mode_t)bstatp->bs_mode,
+				      (dev_t)IRIX_DEV_TO_KDEVT(bstatp->bs_rdev));
+			if (rval && rval != EEXIST) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 				      "unable to create %s "
 				      "ino %llu %s: %s: discarding\n"),
 				      printstr,
 				      fhdrp->fh_stat.bs_ino,
 				      path,
-				      strerror( errno ));
+				      strerror(errno));
 				return BOOL_TRUE;
 			}
 		}
 
 		/* set the owner and group (if enabled)
 		 */
-		if ( persp->a.ownerpr ) {
-			rval = chown( path,
-				      ( uid_t )bstatp->bs_uid,
-				      ( gid_t )bstatp->bs_gid );
-			if ( rval ) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING,
+		if (persp->a.ownerpr) {
+			rval = chown(path,
+				      (uid_t)bstatp->bs_uid,
+				      (gid_t)bstatp->bs_gid);
+			if (rval) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING,
 				      _("chown (uid=%u, gid=%u) %s "
 				      "failed: %s\n"),
 				      bstatp->bs_uid,
 				      bstatp->bs_gid,
 				      path,
-				      strerror( errno ));
+				      strerror(errno));
 			}
 		}
 
 		/* set the permissions/mode
 		 */
-		rval = chmod( path, ( mode_t )fhdrp->fh_stat.bs_mode );
-		if ( rval ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		rval = chmod(path, (mode_t)fhdrp->fh_stat.bs_mode);
+		if (rval) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "unable to set mode of %s: %s\n"),
 			      path,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 
 		/* set the access and modification times
 		 */
-		utimbuf.actime = ( time32_t )bstatp->bs_atime.tv_sec;
-		utimbuf.modtime = ( time32_t )bstatp->bs_mtime.tv_sec;
-		rval = utime( path, &utimbuf );
-		if ( rval ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		utimbuf.actime = (time32_t)bstatp->bs_atime.tv_sec;
+		utimbuf.modtime = (time32_t)bstatp->bs_mtime.tv_sec;
+		rval = utime(path, &utimbuf);
+		if (rval) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "unable to set access and modification "
 			      "times of %s: %s\n"),
 			      path,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 	}
 
@@ -7938,12 +7938,12 @@
 }
 
 static bool_t
-restore_symlink( drive_t *drivep,
+restore_symlink(drive_t *drivep,
 		 filehdr_t *fhdrp,
 		 rv_t *rvp,
 		 char *path,
 		 char *scratchpath,
-		 bool_t ehcs )
+		 bool_t ehcs)
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	drive_ops_t *dop = drivep->d_opsp;
@@ -7954,46 +7954,46 @@
 	rv_t rv;
 	mode_t oldumask;
 
-	if ( path ) {
-		if ( ! tranp->t_toconlypr ) {
-			mlog( MLOG_TRACE,
+	if (path) {
+		if (! tranp->t_toconlypr) {
+			mlog(MLOG_TRACE,
 			      "restoring symbolic link ino %llu %s\n",
 			      bstatp->bs_ino,
-			      path );
+			      path);
 		} else {
-			mlog( MLOG_NORMAL | MLOG_BARE,
+			mlog(MLOG_NORMAL | MLOG_BARE,
 			      "%s\n",
-			      path );
+			      path);
 		}
 	}
 
 	/* read the extent header
 	 */
-	rv = read_extenthdr( drivep, &ehdr, ehcs );
-	if ( rv != RV_OK ) {
+	rv = read_extenthdr(drivep, &ehdr, ehcs);
+	if (rv != RV_OK) {
 		*rvp = rv;
 		return BOOL_FALSE;
 	}
 
 	/* symlinks always have one extent
 	 */
-	assert( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
+	assert(ehdr.eh_type == EXTENTHDR_TYPE_DATA);
 
 	/* read the link path extent
 	 */
-	if ( ehdr.eh_sz < ( off64_t )( 2 * MAXPATHLEN )) {
+	if (ehdr.eh_sz < (off64_t)(2 * MAXPATHLEN)) {
 		scratch = scratchpath;
 	} else {
 		scratch = 0;
 	}
-	nread = read_buf( scratch,
-			  ( size_t )ehdr.eh_sz,
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
-	if ( rval ) {
-		switch( rval ) {
+	nread = read_buf(scratch,
+			  (size_t)ehdr.eh_sz,
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
+	if (rval) {
+		switch(rval) {
 		case DRIVE_ERROR_EOF:
 		case DRIVE_ERROR_EOD:
 		case DRIVE_ERROR_EOM:
@@ -8012,19 +8012,19 @@
 		}
 		return BOOL_FALSE;
 	}
-	assert( ( off64_t )nread == ehdr.eh_sz );
-	if ( ! scratch ) {
-		if ( path ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+	assert((off64_t)nread == ehdr.eh_sz);
+	if (! scratch) {
+		if (path) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "unable to create symlink ino %llu "
 			      "%s: src too long: discarding\n"),
 			      bstatp->bs_ino,
-			      path );
+			      path);
 		}
 		return BOOL_TRUE;
 	}
-	scratchpath[ nread ] = 0;
-	if ( ! tranp->t_toconlypr && path ) {
+	scratchpath[nread] = 0;
+	if (! tranp->t_toconlypr && path) {
 		/* create the symbolic link
 		 */
 		/* NOTE: There is no direct way to set mode for
@@ -8032,40 +8032,40 @@
 		 * No way of setting times for sym links.
 		 */
 
-		oldumask = umask( (( mode_t )(~bstatp->bs_mode)) & 0777 );
+		oldumask = umask(((mode_t)(~bstatp->bs_mode)) & 0777);
 
-		rval = symlink( scratchpath, path );
+		rval = symlink(scratchpath, path);
 
-		umask( oldumask );
+		umask(oldumask);
 
-		if ( rval ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		if (rval) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "unable to create "
 			      "symlink ino %llu %s: %s: discarding\n"),
 			      bstatp->bs_ino,
 			      path,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_TRUE;
 		}
 
 		/* set the owner and group (if enabled)
 		 */
-		if ( persp->a.ownerpr ) {
-			rval = lchown( path,
-				       ( uid_t )bstatp->bs_uid,
-				       ( gid_t )bstatp->bs_gid );
-			if ( rval ) {
-				mlog( MLOG_VERBOSE | MLOG_WARNING,
+		if (persp->a.ownerpr) {
+			rval = lchown(path,
+				       (uid_t)bstatp->bs_uid,
+				       (gid_t)bstatp->bs_gid);
+			if (rval) {
+				mlog(MLOG_VERBOSE | MLOG_WARNING,
 				      _("chown (uid=%u, gid=%u) %s "
 				      "failed: %s\n"),
 				      bstatp->bs_uid,
 				      bstatp->bs_gid,
 				      path,
-				      strerror( errno ));
+				      strerror(errno));
 			}
 		}
 
-		if ( persp->a.restoredmpr) {
+		if (persp->a.restoredmpr) {
 		fsdmidata_t fssetdm;
 
 		/*	Restore DMAPI fields. */
@@ -8082,7 +8082,7 @@
 
 /* ARGSUSED */
 static rv_t
-read_filehdr( drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs )
+read_filehdr(drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs)
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	drive_ops_t *dop = drivep->d_opsp;
@@ -8091,15 +8091,15 @@
 	int rval;
 	filehdr_t tmpfh;
 
-	nread = read_buf( ( char * )&tmpfh,
-			  sizeof( *fhdrp ),
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
+	nread = read_buf((char *)&tmpfh,
+			  sizeof(*fhdrp),
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
 	xlate_filehdr(&tmpfh, fhdrp, 1);
 
-	switch( rval ) {
+	switch(rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8115,24 +8115,24 @@
 	default:
 		return RV_CORE;
 	}
-	assert( ( size_t )nread == sizeof( *fhdrp ));
+	assert((size_t)nread == sizeof(*fhdrp));
 
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "read file hdr off %lld flags 0x%x ino %llu mode 0x%08x\n",
 	      fhdrp->fh_offset,
 	      fhdrp->fh_flags,
 	      bstatp->bs_ino,
-	      bstatp->bs_mode );
+	      bstatp->bs_mode);
 
-	if ( fhcs ) {
-		if ( ! ( fhdrp->fh_flags & FILEHDR_FLAGS_CHECKSUM )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-			      "corrupt file header\n") );
+	if (fhcs) {
+		if (! (fhdrp->fh_flags & FILEHDR_FLAGS_CHECKSUM)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+			      "corrupt file header\n"));
 			return RV_CORRUPT;
 		}
-		if ( !is_checksum_valid( fhdrp, FILEHDR_SZ )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-			      "bad file header checksum\n") );
+		if (!is_checksum_valid(fhdrp, FILEHDR_SZ)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+			      "bad file header checksum\n"));
 			return RV_CORRUPT;
 		}
 	}
@@ -8142,7 +8142,7 @@
 
 /* ARGSUSED */
 static rv_t
-read_extenthdr( drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs )
+read_extenthdr(drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
@@ -8150,15 +8150,15 @@
 	int rval;
 	extenthdr_t tmpeh;
 
-	nread = read_buf( ( char * )&tmpeh,
-			  sizeof( *ehdrp ),
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
+	nread = read_buf((char *)&tmpeh,
+			  sizeof(*ehdrp),
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
 	xlate_extenthdr(&tmpeh, ehdrp, 1);
 
-	switch( rval ) {
+	switch(rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8174,24 +8174,24 @@
 	default:
 		return RV_CORE;
 	}
-	assert( ( size_t )nread == sizeof( *ehdrp ));
+	assert((size_t)nread == sizeof(*ehdrp));
 
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "read extent hdr size %lld offset %lld type %d flags %08x\n",
 	      ehdrp->eh_sz,
 	      ehdrp->eh_offset,
 	      ehdrp->eh_type,
-	      ehdrp->eh_flags );
+	      ehdrp->eh_flags);
 
-	if ( ehcs ) {
-		if ( ! ( ehdrp->eh_flags & EXTENTHDR_FLAGS_CHECKSUM )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-			      "corrupt extent header\n") );
+	if (ehcs) {
+		if (! (ehdrp->eh_flags & EXTENTHDR_FLAGS_CHECKSUM)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+			      "corrupt extent header\n"));
 			return RV_CORRUPT;
 		}
-		if ( !is_checksum_valid( ehdrp, EXTENTHDR_SZ )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-			      "bad extent header checksum\n") );
+		if (!is_checksum_valid(ehdrp, EXTENTHDR_SZ)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+			      "bad extent header checksum\n"));
 			return RV_CORRUPT;
 		}
 	}
@@ -8201,10 +8201,10 @@
 
 /* ARGSUSED */
 static rv_t
-read_dirent( drive_t *drivep,
+read_dirent(drive_t *drivep,
 	     direnthdr_t *dhdrp,
 	     size_t direntbufsz,
-	     bool_t dhcs )
+	     bool_t dhcs)
 {
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	drive_ops_t *dop = drivep->d_opsp;
@@ -8214,19 +8214,19 @@
 	direnthdr_t tmpdh;
 	char *namep;    // beginning of name following the direnthdr_t
 
-	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
-	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
+	assert(sizeof(direnthdr_t) == DIRENTHDR_SZ);
+	assert(sizeof(direnthdr_v1_t) == DIRENTHDR_SZ);
 
 	/* read the head of the dirent
 	 */
-	nread = read_buf( ( char * )&tmpdh,
+	nread = read_buf((char *)&tmpdh,
 			  DIRENTHDR_SZ,
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)
 			  dop->do_return_read_buf,
-			  &rval );
-	switch( rval ) {
+			  &rval);
+	switch(rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8242,15 +8242,15 @@
 	default:
 		return RV_CORE;
 	}
-	assert( ( size_t )nread == DIRENTHDR_SZ );
+	assert((size_t)nread == DIRENTHDR_SZ);
 
-	if ( grhdrp->gh_version >= GLOBAL_HDR_VERSION_3 ) {
+	if (grhdrp->gh_version >= GLOBAL_HDR_VERSION_3) {
 		xlate_direnthdr(&tmpdh, dhdrp, 1);
 		namep = dhdrp->dh_name + sizeof(dhdrp->dh_name);
 
-		if ( dhcs && !is_checksum_valid( dhdrp, DIRENTHDR_SZ )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-				"bad directory entry header checksum\n") );
+		if (dhcs && !is_checksum_valid(dhdrp, DIRENTHDR_SZ)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+				"bad directory entry header checksum\n"));
 			return RV_CORRUPT;
 		}
 	} else {
@@ -8263,47 +8263,47 @@
 		memcpy(dhdrp->dh_name, dhdr_v1.dh_name, sizeof(dhdr_v1.dh_name));
 		namep = dhdrp->dh_name + sizeof(dhdr_v1.dh_name);
 
-		if ( dhcs && !is_checksum_valid( &dhdr_v1, DIRENTHDR_SZ )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-				"bad directory entry header checksum\n") );
+		if (dhcs && !is_checksum_valid(&dhdr_v1, DIRENTHDR_SZ)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+				"bad directory entry header checksum\n"));
 			return RV_CORRUPT;
 		}
 	}
 
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "read dirent hdr ino %llu gen %u size %u\n",
 	      dhdrp->dh_ino,
-	      ( size_t )dhdrp->dh_gen,
-	      ( size_t )dhdrp->dh_sz );
+	      (size_t)dhdrp->dh_gen,
+	      (size_t)dhdrp->dh_sz);
 
-	if ( dhdrp->dh_sz == 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
-			"corrupt directory entry header\n") );
+	if (dhdrp->dh_sz == 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
+			"corrupt directory entry header\n"));
 		return RV_CORRUPT;
 	}
 
 	/* if null, return
 	 */
-	if ( dhdrp->dh_ino == 0 ) {
-		assert( ( size_t )dhdrp->dh_sz == sizeof( direnthdr_t ));
+	if (dhdrp->dh_ino == 0) {
+		assert((size_t)dhdrp->dh_sz == sizeof(direnthdr_t));
 		return RV_OK;
 	}
 
 	/* read the remainder of the dirent.
 	 */
-	assert( ( size_t )dhdrp->dh_sz <= direntbufsz );
-	assert( ( size_t )dhdrp->dh_sz >= sizeof( direnthdr_t ));
-	assert( ! ( ( size_t )dhdrp->dh_sz & ( DIRENTHDR_ALIGN - 1 )));
-	if ( ( size_t )dhdrp->dh_sz > sizeof( direnthdr_t )) {
-		size_t remsz = ( size_t )dhdrp->dh_sz - sizeof( direnthdr_t );
-		nread = read_buf( namep,
+	assert((size_t)dhdrp->dh_sz <= direntbufsz);
+	assert((size_t)dhdrp->dh_sz >= sizeof(direnthdr_t));
+	assert(! ((size_t)dhdrp->dh_sz & (DIRENTHDR_ALIGN - 1)));
+	if ((size_t)dhdrp->dh_sz > sizeof(direnthdr_t)) {
+		size_t remsz = (size_t)dhdrp->dh_sz - sizeof(direnthdr_t);
+		nread = read_buf(namep,
 				  remsz,
-				  ( void * )drivep,
-				  ( rfp_t )dop->do_read,
-				  ( rrbfp_t )
+				  (void *)drivep,
+				  (rfp_t)dop->do_read,
+				  (rrbfp_t)
 				  dop->do_return_read_buf,
-				  &rval );
-		switch( rval ) {
+				  &rval);
+		switch(rval) {
 		case 0:
 			break;
 		case DRIVE_ERROR_EOD:
@@ -8319,7 +8319,7 @@
 		default:
 			return RV_CORE;
 		}
-		assert( ( size_t ) nread == remsz );
+		assert((size_t) nread == remsz);
 	}
 
 	return RV_OK;
@@ -8327,7 +8327,7 @@
 
 /* ARGSUSED */
 static rv_t
-read_extattrhdr( drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs )
+read_extattrhdr(drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
@@ -8335,15 +8335,15 @@
 	int rval;
 	extattrhdr_t tmpah;
 
-	nread = read_buf( ( char * )&tmpah,
-			  sizeof( *ahdrp ),
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
+	nread = read_buf((char *)&tmpah,
+			  sizeof(*ahdrp),
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
 	xlate_extattrhdr(&tmpah, ahdrp, 1);
 
-	switch( rval ) {
+	switch(rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8359,38 +8359,38 @@
 	default:
 		return RV_CORE;
 	}
-	assert( ( size_t )nread == sizeof( *ahdrp ));
+	assert((size_t)nread == sizeof(*ahdrp));
 
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "read extattr hdr sz %u valoff %u flags 0x%x valsz %u cs 0x%x\n",
 	      ahdrp->ah_sz,
-	      ( uint )ahdrp->ah_valoff,
-	      ( uint )ahdrp->ah_flags,
+	      (uint)ahdrp->ah_valoff,
+	      (uint)ahdrp->ah_flags,
 	      ahdrp->ah_valsz,
-	      ahdrp->ah_checksum );
+	      ahdrp->ah_checksum);
 
-	if ( ahcs ) {
-		if ( ahdrp->ah_flags & EXTATTRHDR_FLAGS_CHECKSUM ) {
-			if ( !is_checksum_valid( ahdrp, EXTATTRHDR_SZ )) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
-					"bad extattr header checksum\n") );
+	if (ahcs) {
+		if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_CHECKSUM) {
+			if (!is_checksum_valid(ahdrp, EXTATTRHDR_SZ)) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
+					"bad extattr header checksum\n"));
 				return RV_CORRUPT;
 			}
-		} else if ( ahdrp->ah_flags & EXTATTRHDR_FLAGS_OLD_CHECKSUM ) {
+		} else if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_OLD_CHECKSUM) {
 			/* possibly a corrupt header, but most likely an old
 			 * header, which cannot be verified due to a bug in how
 			 * its checksum was calculated.
 			 */
 			static bool_t warned = BOOL_FALSE;
-			if ( !warned ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (!warned) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					"ignoring old-style extattr "
-					"header checksums\n") );
+					"header checksums\n"));
 				warned = BOOL_TRUE;
 			}
 		} else {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
-			      "corrupt extattr header\n") );
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
+			      "corrupt extattr header\n"));
 			return RV_CORRUPT;
 		}
 	}
@@ -8399,22 +8399,22 @@
 }
 
 static rv_t
-discard_padding( size_t sz, drive_t *drivep )
+discard_padding(size_t sz, drive_t *drivep)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
 	int nread;
 	int rval;
 
-	nread = read_buf( 0,
+	nread = read_buf(0,
 			  sz,
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
-	switch( rval ) {
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
+	switch(rval) {
 	case 0:
-		assert( ( size_t )nread == sz );
+		assert((size_t)nread == sz);
 		return RV_OK;
 	case DRIVE_ERROR_EOF:
 	case DRIVE_ERROR_EOD:
@@ -8432,12 +8432,12 @@
 }
 
 static rv_t
-restore_extent( filehdr_t *fhdrp,
+restore_extent(filehdr_t *fhdrp,
 		extenthdr_t *ehdrp,
 		int fd,
 		char *path,
 		drive_t *drivep,
-		off64_t *bytesreadp )
+		off64_t *bytesreadp)
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	drive_ops_t *dop = drivep->d_opsp;
@@ -8449,35 +8449,35 @@
 
 	*bytesreadp = 0;
 
-	if ( fd != -1 ) {
-		assert( path );
+	if (fd != -1) {
+		assert(path);
 		/* seek to the beginning of the extent.
 		 * must be on a basic fs blksz boundary.
 		 */
-		assert( ( off & ( off64_t )( BBSIZE - 1 )) == 0 );
-		new_off = lseek64(  fd, off, SEEK_SET );
-		if ( new_off < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		assert((off & (off64_t)(BBSIZE - 1)) == 0);
+		new_off = lseek64(fd, off, SEEK_SET);
+		if (new_off < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "attempt to seek %s to %lld failed: %s: "
 			      "not restoring extent off %lld sz %lld\n"),
 			      path,
 			      off,
-			      strerror( errno ),
+			      strerror(errno),
 			      off,
-			      sz );
+			      sz);
 			fd = -1;
 			new_off = off;
 		}
-		assert( new_off == off );
+		assert(new_off == off);
 	}
-	if ( (fd != -1) && (bstatp->bs_xflags & XFS_XFLAG_REALTIME) ) {
-		if ( (ioctl(fd, XFS_IOC_DIOINFO, &da) < 0) ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if ((fd != -1) && (bstatp->bs_xflags & XFS_XFLAG_REALTIME)) {
+		if ((ioctl(fd, XFS_IOC_DIOINFO, &da) < 0)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "dioinfo %s failed: "
 			      "%s: discarding ino %llu\n"),
 			      path,
-			      strerror( errno ),
-			      fhdrp->fh_stat.bs_ino );
+			      strerror(errno),
+			      fhdrp->fh_stat.bs_ino);
 			fd = -1;
 		} else
 			isrealtime = BOOL_TRUE;
@@ -8485,7 +8485,7 @@
 
 	/* move from media to fs.
 	 */
-	while ( sz ) {
+	while (sz) {
 		char *bufp;
 		size_t req_bufsz;	/* requested bufsz */
 		size_t sup_bufsz;	/* supplied bufsz */
@@ -8493,12 +8493,12 @@
 		int rval;
 		size_t ntowrite;
 
-		req_bufsz = ( size_t )min( ( off64_t )INTGENMAX, sz );
-		bufp = ( * dop->do_read )(drivep, req_bufsz, &sup_bufsz, &rval);
-		if ( rval ) {
+		req_bufsz = (size_t)min((off64_t)INTGENMAX, sz);
+		bufp = (* dop->do_read)(drivep, req_bufsz, &sup_bufsz, &rval);
+		if (rval) {
 			rv_t rv;
 			char *reasonstr;
-			switch( rval ) {
+			switch(rval) {
 			case DRIVE_ERROR_EOF:
 				rv = RV_EOD;
 				reasonstr = _("end of media file");
@@ -8529,56 +8529,56 @@
 				reasonstr = _("dumping core");
 				break;
 			}
-			mlog( MLOG_NORMAL, _(
+			mlog(MLOG_NORMAL, _(
 			      "attempt to read %u bytes failed: %s\n"),
 			      req_bufsz,
-			      reasonstr );
+			      reasonstr);
 			return rv;
 		}
-		if ( off >= bstatp->bs_size ) {
-			assert( off == bstatp->bs_size );
+		if (off >= bstatp->bs_size) {
+			assert(off == bstatp->bs_size);
 			ntowrite = 0;
-		} else if ((off64_t)sup_bufsz > bstatp->bs_size - off ) {
-			ntowrite = ( size_t )( bstatp->bs_size - off );
+		} else if ((off64_t)sup_bufsz > bstatp->bs_size - off) {
+			ntowrite = (size_t)(bstatp->bs_size - off);
 		} else {
 			ntowrite = sup_bufsz;
 		}
-		assert( ntowrite <= ( size_t )INTGENMAX );
-		if ( ntowrite > 0 ) {
-			*bytesreadp += ( off64_t )ntowrite;
-			if ( fd != -1 ) {
+		assert(ntowrite <= (size_t)INTGENMAX);
+		if (ntowrite > 0) {
+			*bytesreadp += (off64_t)ntowrite;
+			if (fd != -1) {
 				size_t tries;
 				size_t remaining;
 				int rval;
 				off64_t tmp_off;
 
 				rval = 0; /* for lint */
-				for ( nwritten = 0,
+				for (nwritten = 0,
 				      tries = 0,
 				      remaining = ntowrite,
 				      tmp_off = off
 				      ;
-				      nwritten < ( int )ntowrite
+				      nwritten < (int)ntowrite
 				      &&
 				      tries < WRITE_TRIES_MAX
 				      ;
 				      nwritten += rval,
 				      tries++,
-				      remaining -= ( size_t )rval,
-				      tmp_off += ( off64_t )rval ) {
+				      remaining -= (size_t)rval,
+				      tmp_off += (off64_t)rval) {
 					int rttrunc = 0;
 					int trycnt = 0;
-					assert( remaining
+					assert(remaining
 						<=
-						( size_t )INTGENMAX );
+						(size_t)INTGENMAX);
 					/*
 					 * Realtime files must be written
 					 * to the end of the block even if
 					 * it has been truncated back.
 					 */
-					if ( isrealtime &&
+					if (isrealtime &&
 					    (remaining % da.d_miniosz != 0 ||
-					     remaining < da.d_miniosz) ) {
+					     remaining < da.d_miniosz)) {
 						/*
 						 * Since the ring and static
 						 * buffers from the different
@@ -8603,20 +8603,20 @@
 					 * if ENOSPC still occurs.
 					 */
 					for (trycnt = 0; trycnt < 3; trycnt++) {
-						rval = write( fd, bufp, remaining );
+						rval = write(fd, bufp, remaining);
 						if (rval >= 0 || errno != ENOSPC)
 							break;
 
-						( trycnt == 0 ) ?
+						(trycnt == 0) ?
 							fdatasync(fd) : sync();
 					}
-					if ( rval < 0 ) {
+					if (rval < 0) {
 						nwritten = rval;
 						break;
 					}
-					assert( ( size_t )rval <= remaining );
-					if ( rval < remaining ) {
-						mlog( MLOG_NORMAL | MLOG_WARNING,
+					assert((size_t)rval <= remaining);
+					if (rval < remaining) {
+						mlog(MLOG_NORMAL | MLOG_WARNING,
 						      _("attempt to "
 						      "write %u bytes to %s at "
 						      "offset %lld failed: "
@@ -8624,7 +8624,7 @@
 						      remaining,
 						      path,
 						      tmp_off,
-						      rval );
+						      rval);
 					}
 					if (rttrunc) {
 						/* truncate and re-set rval */
@@ -8634,40 +8634,40 @@
 					}
 				}
 			} else {
-				nwritten = ( int )ntowrite;
+				nwritten = (int)ntowrite;
 			}
 		} else {
 			nwritten = 0;
 		}
-		( * dop->do_return_read_buf )( drivep, bufp, sup_bufsz );
-		if ( ( size_t )nwritten != ntowrite ) {
-			if ( nwritten < 0 ) {
-				mlog( MLOG_NORMAL, _(
+		(* dop->do_return_read_buf)(drivep, bufp, sup_bufsz);
+		if ((size_t)nwritten != ntowrite) {
+			if (nwritten < 0) {
+				mlog(MLOG_NORMAL, _(
 				      "attempt to write %u bytes to %s "
 				      "at offset %lld failed: %s\n"),
 				      ntowrite,
 				      path,
 				      off,
-				      strerror( errno ));
+				      strerror(errno));
 			} else {
-				assert( ( size_t )nwritten < ntowrite );
-				mlog( MLOG_NORMAL, _(
+				assert((size_t)nwritten < ntowrite);
+				mlog(MLOG_NORMAL, _(
 				      "attempt to write %u bytes to %s at "
 				      "offset %lld failed: only %d bytes "
 				      "written\n"),
 				      ntowrite,
 				      path,
 				      off,
-				      nwritten );
+				      nwritten);
 			}
 			/* stop attempting to write, but complete reads
 			 */
 			fd = -1;
-			assert( ntowrite <= ( size_t )INTGENMAX );
-			nwritten = ( int )ntowrite;
+			assert(ntowrite <= (size_t)INTGENMAX);
+			nwritten = (int)ntowrite;
 		}
-		sz -= ( off64_t )sup_bufsz;
-		off += ( off64_t )nwritten;
+		sz -= (off64_t)sup_bufsz;
+		off += (off64_t)nwritten;
 	}
 
 	return RV_OK;
@@ -8677,9 +8677,9 @@
 static size_t extattrbufsz = 0; /* size of each extattr buffer */
 
 static bool_t
-extattr_init( size_t drivecnt )
+extattr_init(size_t drivecnt)
 {
-	assert( ! extattrbufp );
+	assert(! extattrbufp);
 	extattrbufsz = EXTATTRHDR_SZ		/* dump hdr */
 		       +
 		       NAME_MAX			/* attribute name */
@@ -8689,10 +8689,10 @@
 		       ATTR_MAX_VALUELEN;	/* attribute value */
 	extattrbufsz = roundup(extattrbufsz, EXTATTRHDR_ALIGN);
 
-	extattrbufp = memalign( EXTATTRHDR_ALIGN, extattrbufsz * drivecnt );
+	extattrbufp = memalign(EXTATTRHDR_ALIGN, extattrbufsz * drivecnt);
 	if (extattrbufp == NULL) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
-		      "Failed to allocate extended attribute buffer\n") );
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
+		      "Failed to allocate extended attribute buffer\n"));
 		return BOOL_FALSE;
 	}
 
@@ -8700,7 +8700,7 @@
 }
 
 static char *
-get_extattrbuf( ix_t which )
+get_extattrbuf(ix_t which)
 {
         return extattrbufp + (extattrbufsz * which);
 }
@@ -8713,53 +8713,53 @@
 typedef struct extattr_cb_ctx extattr_cb_ctx_t;
 
 static rv_t
-restore_extattr( drive_t *drivep,
+restore_extattr(drive_t *drivep,
 		 filehdr_t *fhdrp,
 		 char *path,
 		 bool_t ahcs,
 		 bool_t isdirpr,
 		 bool_t onlydoreadpr,
-		 dah_t dah )
+		 dah_t dah)
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	extattrhdr_t *ahdrp = ( extattrhdr_t * )get_extattrbuf( drivep->d_index );
+	extattrhdr_t *ahdrp = (extattrhdr_t *)get_extattrbuf(drivep->d_index);
 	stream_context_t *strctxp = (stream_context_t *)drivep->d_strmcontextp;
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	bool_t isfilerestored = BOOL_FALSE;
 
-	assert( extattrbufp );
+	assert(extattrbufp);
 
-	if ( ! isdirpr )
+	if (! isdirpr)
 		isfilerestored = partial_check(bstatp->bs_ino,  bstatp->bs_size);
 
 	/* peel off extattrs until null hdr hit
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		size_t recsz;
 		/* REFERENCED */
 		int nread;
 		int rval;
 		rv_t rv;
 
-		rv = read_extattrhdr( drivep, ahdrp, ahcs );
-		if ( rv != RV_OK ) {
+		rv = read_extattrhdr(drivep, ahdrp, ahcs);
+		if (rv != RV_OK) {
 			return rv;
 		}
 
-		if ( ahdrp->ah_flags & EXTATTRHDR_FLAGS_NULL ) {
+		if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_NULL) {
 			return RV_OK;
 		}
 
-		recsz = ( size_t )ahdrp->ah_sz;
-		assert( recsz <= extattrbufsz );
-		assert( recsz >= EXTATTRHDR_SZ );
-		nread = read_buf( ( char * )&ahdrp[ 1 ],
+		recsz = (size_t)ahdrp->ah_sz;
+		assert(recsz <= extattrbufsz);
+		assert(recsz >= EXTATTRHDR_SZ);
+		nread = read_buf((char *)&ahdrp[1],
 				  recsz - EXTATTRHDR_SZ,
-				  ( void * )drivep,
-				  ( rfp_t )dop->do_read,
-				  ( rrbfp_t )dop->do_return_read_buf,
-				  &rval );
-		switch( rval ) {
+				  (void *)drivep,
+				  (rfp_t)dop->do_read,
+				  (rrbfp_t)dop->do_return_read_buf,
+				  &rval);
+		switch(rval) {
 		case 0:
 			break;
 		case DRIVE_ERROR_EOD:
@@ -8775,13 +8775,13 @@
 		default:
 			return RV_CORE;
 		}
-		assert( nread == ( int )( recsz - EXTATTRHDR_SZ ));
+		assert(nread == (int)(recsz - EXTATTRHDR_SZ));
 
-		if ( ! persp->a.restoreextattrpr && ! persp->a.restoredmpr ) {
+		if (! persp->a.restoreextattrpr && ! persp->a.restoredmpr) {
 			continue;
 		}
 
-		if ( onlydoreadpr || tranp->t_toconlypr )
+		if (onlydoreadpr || tranp->t_toconlypr)
 			continue;
 
 		/* NOTE: In the cases below, if we get errors then we issue warnings
@@ -8789,15 +8789,15 @@
 		 * We can still restore the file possibly without the
 		 * extended attributes.
 		 */
-		if ( isdirpr ) {
-			assert( ! path );
-			if ( dah != DAH_NULL ) {
-				dirattr_addextattr( dah, ahdrp );
+		if (isdirpr) {
+			assert(! path);
+			if (dah != DAH_NULL) {
+				dirattr_addextattr(dah, ahdrp);
 			}
-		} else if ( isfilerestored && path[0] != '\0' ) {
-			setextattr( path, ahdrp );
+		} else if (isfilerestored && path[0] != '\0') {
+			setextattr(path, ahdrp);
 
-			if ( persp->a.dstdirisxfspr && persp->a.restoredmpr ) {
+			if (persp->a.dstdirisxfspr && persp->a.restoredmpr) {
 				int flag = 0;
 				char *attrname = (char *)&ahdrp[1];
 				if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_ROOT)
@@ -8805,9 +8805,9 @@
 				else if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_SECURE)
 					flag = ATTR_SECURE;
 
-				HsmRestoreAttribute( flag,
+				HsmRestoreAttribute(flag,
 						     attrname,
-						     &strctxp->sc_hsmflags );
+						     &strctxp->sc_hsmflags);
 			}
 		}
 	}
@@ -8815,38 +8815,38 @@
 }
 
 static bool_t
-restore_dir_extattr_cb( char *path, dah_t dah )
+restore_dir_extattr_cb(char *path, dah_t dah)
 {
         /*
          * directory extattr's are built during the directory phase
          * by 1 thread so we only need one extattr buffer
          * -> we pick the 0th one
          */
-	extattrhdr_t *ahdrp = ( extattrhdr_t * )get_extattrbuf( 0 );
+	extattrhdr_t *ahdrp = (extattrhdr_t *)get_extattrbuf(0);
 	bool_t ok;
 
 	/* ask the dirattr abstraction to call me back for each
 	 * extended dirattr associated with this dah.
 	 */
-	ok = dirattr_cb_extattr( dah,
+	ok = dirattr_cb_extattr(dah,
 				 restore_dir_extattr_cb_cb,
 				 ahdrp,
-				 ( void * )path );
+				 (void *)path);
 	return ok;
 }
 
 static bool_t
-restore_dir_extattr_cb_cb( extattrhdr_t *ahdrp, void *ctxp )
+restore_dir_extattr_cb_cb(extattrhdr_t *ahdrp, void *ctxp)
 {
-	char *path = ( char * )ctxp;
+	char *path = (char *)ctxp;
 
-	setextattr( path, ahdrp );
+	setextattr(path, ahdrp);
 
 	return BOOL_TRUE;
 }
 
 static void
-setextattr( char *path, extattrhdr_t *ahdrp )
+setextattr(char *path, extattrhdr_t *ahdrp)
 {
 	static	char dmiattr[] = "SGI_DMI_";
 	bool_t isrootpr = ahdrp->ah_flags & EXTATTRHDR_FLAGS_ROOT;
@@ -8855,45 +8855,45 @@
 	int attr_namespace;
 	int rval;
 
-	isdmpr = ( isrootpr &&
-		   !strncmp((char *)(&ahdrp[1]), dmiattr, sizeof(dmiattr)-1) );
+	isdmpr = (isrootpr &&
+		   !strncmp((char *)(&ahdrp[1]), dmiattr, sizeof(dmiattr)-1));
 
 	/* If restoreextattrpr not set, then we are here because -D was
 	 * specified. So return unless it looks like a root DMAPI attribute.
 	 */
-	if ( !persp->a.restoreextattrpr && !isdmpr )
+	if (!persp->a.restoreextattrpr && !isdmpr)
 		return;
 
-	if ( isrootpr ) {
+	if (isrootpr) {
 		attr_namespace = ATTR_ROOT;
-	} else if ( issecurepr ) {
+	} else if (issecurepr) {
 		attr_namespace = ATTR_SECURE;
 	} else {
 		attr_namespace = 0;
 	}
 
-	rval = attr_set( path,
-			 ( char * )( &ahdrp[ 1 ] ),
-			 ( ( char * )ahdrp ) + ( u_long_t )ahdrp->ah_valoff,
-			 ( int )ahdrp->ah_valsz,
-			 attr_namespace | ATTR_DONTFOLLOW );
-	if ( rval ) {
+	rval = attr_set(path,
+			 (char *)(&ahdrp[1]),
+			 ((char *)ahdrp) + (u_long_t)ahdrp->ah_valoff,
+			 (int)ahdrp->ah_valsz,
+			 attr_namespace | ATTR_DONTFOLLOW);
+	if (rval) {
 		char *namespace;
-		if ( isrootpr ) {
+		if (isrootpr) {
 			namespace = _("root");
-		} else if ( issecurepr ) {
+		} else if (issecurepr) {
 			namespace = _("secure");
 		} else {
 			namespace = _("non-root");
 		}
 
-		mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 		      "unable to set %s extended attribute for %s: "
 		      "%s (%d)\n"),
 		      namespace,
 		      path,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 	}
 }
 
@@ -8911,7 +8911,7 @@
 	pi_lock();
 	printf("\npartial_reg: count=%d\n", (int)persp->a.parrestcnt);
 	if (persp->a.parrestcnt > 0) {
-		for (i=0; i < partialmax; i++ ) {
+		for (i=0; i < partialmax; i++) {
 			if (persp->a.parrest[i].is_ino > 0) {
 				int j;
 
@@ -8928,7 +8928,7 @@
 						   (long long)bsptr->endoffset);
 					}
 				}
-				printf( "\n");
+				printf("\n");
 			}
 		}
 	}
@@ -8959,7 +8959,7 @@
 
 	pi_lock();
 	if (persp->a.parrestcnt > 0) {
-		for (i=0; i < partialmax; i++ ) {
+		for (i=0; i < partialmax; i++) {
 			if (persp->a.parrest[i].is_ino > 0) {
 				int j;
 
@@ -8972,7 +8972,7 @@
 					    num_partials[j]++;
 					    if (num_partials[j] > 2) {
 						pi_unlock();
-						mlog( MLOG_NORMAL | MLOG_WARNING,
+						mlog(MLOG_NORMAL | MLOG_WARNING,
 		  "partial_reg: Too many partials (>2) for drive: %d\n", j);
 						dump_partials();
 						exit(EXIT_ERROR);
@@ -9000,7 +9000,7 @@
  * should only be set after all data for a file has been restored.
  */
 static void
-partial_reg( ix_t d_index,
+partial_reg(ix_t d_index,
 	     xfs_ino_t ino,
 	     off64_t fsize,
 	     off64_t offset,
@@ -9017,7 +9017,7 @@
 
 	endoffset = offset + sz;
 
-	if ( partialmax == 0 )
+	if (partialmax == 0)
 		return;
 
 	pi_lock();
@@ -9025,7 +9025,7 @@
 	/* Search for a matching inode.  Gaps can exist so we must search
 	 * all entries.
 	 */
-	for (i=0; i < partialmax; i++ ) {
+	for (i=0; i < partialmax; i++) {
 		if (persp->a.parrest[i].is_ino == ino) {
 			isptr = &persp->a.parrest[i];
 			break;
@@ -9033,11 +9033,11 @@
 	}
 
 	/* If not found, find a free one, fill it in and return */
-	if ( ! isptr ) {
+	if (! isptr) {
 		mlog(MLOG_NITTY | MLOG_NOLOCK,
 			"partial_reg: no entry found for %llu\n", ino);
 		/* find a free one */
-		for (i=0; i < partialmax; i++ ) {
+		for (i=0; i < partialmax; i++) {
 			if (persp->a.parrest[i].is_ino == 0) {
 				int j;
 
@@ -9060,7 +9060,7 @@
 
 		/* Should never get here. */
 		pi_unlock();
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		  "partial_reg: Out of records. Extend attrs applied early.\n"));
 #ifdef DEBUGPARTIALS
 		dump_partials();
@@ -9114,7 +9114,7 @@
 	bool_t ret;
 	int i;
 
-	if ( partialmax == 0 )
+	if (partialmax == 0)
 		return BOOL_TRUE;
 
 	pi_lock();
@@ -9128,7 +9128,7 @@
 	/* Search for the inode.  Gaps can exist so we must search
 	 * all entries.
 	 */
-	for (i=0; i < partialmax; i++ ) {
+	for (i=0; i < partialmax; i++) {
 		if (persp->a.parrest[i].is_ino == ino) {
 			isptr = &persp->a.parrest[i];
 			break;
@@ -9136,7 +9136,7 @@
 	}
 
 	/* If not found, return okay */
-	if ( ! isptr ) {
+	if (! isptr) {
 		pi_unlock();
 		return BOOL_TRUE;
 	}
@@ -9191,9 +9191,9 @@
 }
 
 static char *
-ehdr_typestr( int32_t type )
+ehdr_typestr(int32_t type)
 {
-	switch ( type ) {
+	switch (type) {
 	case EXTENTHDR_TYPE_LAST:
 		return "LAST";
 	case EXTENTHDR_TYPE_ALIGN:
@@ -9209,11 +9209,11 @@
 
 /* ARGSUSED */
 bool_t
-content_overwrite_ok( char *path,
+content_overwrite_ok(char *path,
 		      int32_t ctime,
 		      int32_t mtime,
 		      char **reasonstrp,
-		      bool_t *exists )
+		      bool_t *exists)
 {
 	struct stat statbuf;
 
@@ -9222,9 +9222,9 @@
 	/* if file doesn't exist, allow
 	 */
 
-	if ( lstat( path, &statbuf )) {
+	if (lstat(path, &statbuf)) {
 		*reasonstrp = 0;
-		if ( errno == ENOENT ) {
+		if (errno == ENOENT) {
 			*exists = BOOL_FALSE;
 		}
 		return BOOL_TRUE;
@@ -9232,15 +9232,15 @@
 
 	/* if overwrites absolutely inhibited, disallow
 	 */
-	if ( persp->a.existpr ) {
+	if (persp->a.existpr) {
 		*reasonstrp = _("overwrites inhibited");
 		return BOOL_FALSE;
 	}
 
 	/* if newer time specified, compare
 	 */
-	if ( persp->a.newerpr ) {
-		if ( ( time32_t )ctime < persp->a.newertime ) {
+	if (persp->a.newerpr) {
+		if ((time32_t)ctime < persp->a.newertime) {
 			*reasonstrp = _("too old");
 			return BOOL_FALSE;
 		}
@@ -9248,8 +9248,8 @@
 
 	/* don't overwrite changed files
 	 */
-	if ( persp->a.changepr ) {
-		if ( statbuf.st_ctime >= ( time32_t )ctime ) {
+	if (persp->a.changepr) {
+		if (statbuf.st_ctime >= (time32_t)ctime) {
 			*reasonstrp = _("existing version is newer");
 			return BOOL_FALSE;
 		}
@@ -9261,66 +9261,66 @@
 
 
 static void
-set_mcflag( ix_t thrdix )
+set_mcflag(ix_t thrdix)
 {
-	lock( );
-	mcflag[ thrdix ] = BOOL_TRUE;
+	lock();
+	mcflag[thrdix] = BOOL_TRUE;
 	content_media_change_needed = BOOL_TRUE;
-	unlock( );
+	unlock();
 }
 
 static void
-clr_mcflag( ix_t thrdix )
+clr_mcflag(ix_t thrdix)
 {
-	lock( );
-	mcflag[ thrdix ] = BOOL_FALSE;
-	for ( thrdix = 0 ; thrdix < drivecnt ; thrdix++ ) {
-		if ( mcflag[ thrdix ] ) {
-			unlock( );
+	lock();
+	mcflag[thrdix] = BOOL_FALSE;
+	for (thrdix = 0 ; thrdix < drivecnt ; thrdix++) {
+		if (mcflag[thrdix]) {
+			unlock();
 			return;
 		}
 	}
 	content_media_change_needed = BOOL_FALSE;
-	unlock( );
+	unlock();
 }
 
 /* debug functions ***********************************************************/
 
 static void
-pi_show( char *introstring )
+pi_show(char *introstring)
 {
-	char strbuf[ 100 ];
+	char strbuf[100];
 	/* REFERENCED */
 	int strbuflen;
 	fold_t fold;
 
-	if ( mlog_level_ss[ MLOG_SS_MEDIA ] < MLOG_NITTY + 1 ) {
+	if (mlog_level_ss[MLOG_SS_MEDIA] < MLOG_NITTY + 1) {
 		return;
 	}
 
-	mlog_lock( );
+	mlog_lock();
 
-	strbuflen = sprintf( strbuf,
+	strbuflen = sprintf(strbuf,
 			     "persistent inventory media file tree%s",
-			     introstring );
-	assert( ( size_t )strbuflen < sizeof( strbuf ));
-	fold_init( fold, strbuf, ':' );
-	mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+			     introstring);
+	assert((size_t)strbuflen < sizeof(strbuf));
+	fold_init(fold, strbuf, ':');
+	mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 	      "\n%s\n\n",
-	      fold );
+	      fold);
 
-	pi_show_nomloglock( );
+	pi_show_nomloglock();
 
-	fold_init( fold, "end persistent inventory display", '.'  );
-	mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+	fold_init(fold, "end persistent inventory display", '.');
+	mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 	      "\n%s\n\n",
-	      fold );
+	      fold);
 
-	mlog_unlock( );
+	mlog_unlock();
 }
 
 static void
-pi_show_nomloglock( void )
+pi_show_nomloglock(void)
 {
 	dh_t strmh;
 	int strmix;
@@ -9328,191 +9328,191 @@
 
 	/* no point in proceeding if pi not begun
 	 */
-	if ( persp->s.strmheadh == DH_NULL ) {
-		mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA, _(
-		      "session inventory unknown\n") );
+	if (persp->s.strmheadh == DH_NULL) {
+		mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA, _(
+		      "session inventory unknown\n"));
 		return;
 	}
 
-	mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA, _(
-	      "session inventory display\n") );
+	mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA, _(
+	      "session inventory display\n"));
 
 	/* iterate over all streams
 	 */
-	for ( strmh = persp->s.strmheadh, strmix = 0
+	for (strmh = persp->s.strmheadh, strmix = 0
 	      ;
 	      strmh != DH_NULL
 	      ;
-	      strmh = DH2S( strmh )->s_nexth, strmix++ ) {
+	      strmh = DH2S(strmh)->s_nexth, strmix++) {
 		dh_t objh;
 		int objix;
 
-		mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+		mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 		      _("\nmedia stream %u:\n"),
-		      strmix );
-		if ( DH2S( strmh )->s_cldh == DH_NULL ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-			      _("\n    media objects not yet identified\n") );
+		      strmix);
+		if (DH2S(strmh)->s_cldh == DH_NULL) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			      _("\n    media objects not yet identified\n"));
 			continue;
 		}
 		/* iterate over all objects
 		 */
-		for ( objh = DH2S( strmh )->s_cldh, objix = 0
+		for (objh = DH2S(strmh)->s_cldh, objix = 0
 		      ;
 		      objh != DH_NULL
 		      ;
-		      objh = DH2O( objh )->o_nexth, objix++ ) {
+		      objh = DH2O(objh)->o_nexth, objix++) {
 			dh_t fileh;
 			ix_t fileix;
 
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 			      _("\n    media object %u:\n\n"),
-			      objix );
-			if ( DH2O( objh )->o_idlabvalpr ) {
-				if ( strlen( DH2O( objh )->o_lab )) {
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-				      _("    label: ") );
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			      objix);
+			if (DH2O(objh)->o_idlabvalpr) {
+				if (strlen(DH2O(objh)->o_lab)) {
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+				      _("    label: "));
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					"\"%s\"\n",
-				      DH2O( objh )->o_lab );
+				      DH2O(objh)->o_lab);
 				} else {
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-				      _("    label is blank\n") );
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+				      _("    label is blank\n"));
 				}
-				if ( ! uuid_is_null( DH2O( objh )->o_id)) {
+				if (! uuid_is_null(DH2O(objh)->o_id)) {
 				    char media_string_uuid[UUID_STR_LEN + 1];
-				    uuid_unparse( DH2O( objh )->o_id,
+				    uuid_unparse(DH2O(objh)->o_id,
 						    media_string_uuid);
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					  _("    id: %s\n"),
-					  media_string_uuid );
+					  media_string_uuid);
 				}
 			} else {
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-				      _("    label not identified\n") );
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+				      _("    label not identified\n"));
 			}
-			if ( DH2O( objh )->o_fmfmixvalpr ) {
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			if (DH2O(objh)->o_fmfmixvalpr) {
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 				      _("    index within object "
 				      "of first media file: %u\n"),
-				      DH2O( objh )->o_fmfmix );
+				      DH2O(objh)->o_fmfmix);
 			}
-			if ( DH2O( objh )->o_fmfsixvalpr ) {
-				mlog( MLOG_DEBUG | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			if (DH2O(objh)->o_fmfsixvalpr) {
+				mlog(MLOG_DEBUG | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 				      _("    index within stream "
 				      "of first media file: %u\n"),
-				      DH2O( objh )->o_fmfsix );
+				      DH2O(objh)->o_fmfsix);
 			}
 
-			if ( DH2O( objh )->o_indrivepr ) {
-				if ( drivecnt > 1 ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			if (DH2O(objh)->o_indrivepr) {
+				if (drivecnt > 1) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					  _("    now in drive %u\n"),
-					  DH2O( objh )->o_indriveix );
+					  DH2O(objh)->o_indriveix);
 				} else {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-					  _("    now in drive\n") );
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					  _("    now in drive\n"));
 				}
 			}
 
-			if ( DH2O( objh )->o_cldh == DH_NULL ) {
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			if (DH2O(objh)->o_cldh == DH_NULL) {
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 				      _("        media files not yet "
-				      "identified\n") );
+				      "identified\n"));
 				continue;
 			}
 
 			/* iterate over all files
 			 */
-			for ( fileh = DH2O( objh )->o_cldh, fileix = 0
+			for (fileh = DH2O(objh)->o_cldh, fileix = 0
 			      ;
 			      fileh != DH_NULL
 			      ;
-			      fileh = DH2F( fileh )->f_nexth, fileix++ ) {
-			    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			      fileh = DH2F(fileh)->f_nexth, fileix++) {
+			    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 				  _("\n        media file %u"),
-				  fileix );
-			    if ( DH2O( objh )->o_fmfmixvalpr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+				  fileix);
+			    if (DH2O(objh)->o_fmfmixvalpr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					  " (%u):\n",
-					  DH2O( objh )->o_fmfmix + fileix );
+					  DH2O(objh)->o_fmfmix + fileix);
 			    } else {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-					  ":\n" );
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					  ":\n");
 			    }
-			    if ( DH2F( fileh )->f_szvalpr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			    if (DH2F(fileh)->f_szvalpr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					 _("        size: "
 					 "%lld bytes\n"),
-					 DH2F( fileh )->f_sz );
+					 DH2F(fileh)->f_sz);
 			    }
-			    if ( DH2F( fileh )->f_dirtriedpr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			    if (DH2F(fileh)->f_dirtriedpr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					 _("        used for directory "
-					 "restoral\n") );
+					 "restoral\n"));
 			    }
-			    if ( DH2F( fileh )->f_valpr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			    if (DH2F(fileh)->f_valpr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					 _("        first extent contained: "
 					 "ino %llu off %lld\n"),
-					 DH2F( fileh )->f_firstegrp.eg_ino,
-					 DH2F( fileh )->f_firstegrp.eg_off );
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					 DH2F(fileh)->f_firstegrp.eg_ino,
+					 DH2F(fileh)->f_firstegrp.eg_off);
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					 _("        next extent to restore: "
 					 "ino %llu off %lld\n"),
-					 DH2F( fileh )->f_curegrp.eg_ino,
-					 DH2F( fileh )->f_curegrp.eg_off );
-				    mlog( MLOG_DEBUG | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					 DH2F(fileh)->f_curegrp.eg_ino,
+					 DH2F(fileh)->f_curegrp.eg_off);
+				    mlog(MLOG_DEBUG | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					 _("        rollback mark %lld\n"),
-					 DH2F( fileh )->f_curmark );
+					 DH2F(fileh)->f_curmark);
 			    }
-			    if ( DH2F( fileh )->f_nondirskippr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			    if (DH2F(fileh)->f_nondirskippr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					  _("        contains no selected "
-					  "non-directories\n") );
+					  "non-directories\n"));
 			    }
-			    if ( DH2F( fileh )->f_nondirdonepr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-					  _("        non-directories done\n") );
+			    if (DH2F(fileh)->f_nondirdonepr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					  _("        non-directories done\n"));
 			    }
-			    if ( DH2F( fileh )->f_flags & PF_INV ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			    if (DH2F(fileh)->f_flags & PF_INV) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 					  _("        contains session "
-					  "inventory\n") );
+					  "inventory\n"));
 			    }
-			    if ( DH2F( fileh )->f_flags & PF_TERM ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-					  _("        is stream terminator\n") );
+			    if (DH2F(fileh)->f_flags & PF_TERM) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					  _("        is stream terminator\n"));
 			    }
-			    if ( DH2F( fileh )->f_underheadpr ) {
-				    mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
-					  _("        now reading\n") );
+			    if (DH2F(fileh)->f_underheadpr) {
+				    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+					  _("        now reading\n"));
 			    }
 			}
-			if ( ! DH2O( objh )->o_lmfknwnpr ) {
-				mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+			if (! DH2O(objh)->o_lmfknwnpr) {
+				mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 				      _("\n        may be additional "
-				      "unidentified media files\n") );
+				      "unidentified media files\n"));
 			}
 		}
-		if ( ! DH2S( strmh )->s_lastobjknwnpr ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
+		if (! DH2S(strmh)->s_lastobjknwnpr) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 			      _("\n    may be "
-			      "additional unidentified media objects\n\n") );
+			      "additional unidentified media objects\n\n"));
 		}
 	}
 }
 
 static int
-egrpcmp( egrp_t *egrpap, egrp_t *egrpbp )
+egrpcmp(egrp_t *egrpap, egrp_t *egrpbp)
 {
-	if ( egrpap->eg_ino < egrpbp->eg_ino ) {
+	if (egrpap->eg_ino < egrpbp->eg_ino) {
 		return -1;
-	} else if ( egrpap->eg_ino > egrpbp->eg_ino ) {
+	} else if (egrpap->eg_ino > egrpbp->eg_ino) {
 		return 1;
-	} else if ( egrpap->eg_off < egrpbp->eg_off ) {
+	} else if (egrpap->eg_off < egrpbp->eg_off) {
 		return -1;
-	} else if ( egrpap->eg_off > egrpbp->eg_off ) {
+	} else if (egrpap->eg_off > egrpbp->eg_off) {
 		return 1;
 	} else {
 		return 0;
@@ -9520,147 +9520,147 @@
 }
 
 static void
-display_dump_label( bool_t lockpr,
+display_dump_label(bool_t lockpr,
 		    int mllevel,
 		    char *introstr,
 		    global_hdr_t *grhdrp,
 		    media_hdr_t *mrhdrp,
 		    content_hdr_t *crhdrp,
-		    content_inode_hdr_t *scrhdrp )
+		    content_inode_hdr_t *scrhdrp)
 {
-	char dateline[ 28 ];
-	char level_string[ 2 ];
+	char dateline[28];
+	char level_string[2];
 	char dump_string_uuid[UUID_STR_LEN + 1];
 	char media_string_uuid[UUID_STR_LEN + 1];
 	char fs_string_uuid[UUID_STR_LEN + 1];
 
-	assert( scrhdrp->cih_level >= 0 );
-	assert( scrhdrp->cih_level < 10 );
-	level_string[ 0 ] = ( char )( '0' + ( u_char_t )scrhdrp->cih_level );
-	level_string[ 1 ] = 0;
+	assert(scrhdrp->cih_level >= 0);
+	assert(scrhdrp->cih_level < 10);
+	level_string[0] = (char)('0' + (u_char_t)scrhdrp->cih_level);
+	level_string[1] = 0;
 
 	uuid_unparse(grhdrp->gh_dumpid, dump_string_uuid);
 	uuid_unparse(mrhdrp->mh_mediaid, media_string_uuid);
 	uuid_unparse(crhdrp->ch_fsid, fs_string_uuid);
 
-	if ( lockpr ) {
-		mlog_lock( );
+	if (lockpr) {
+		mlog_lock();
 	}
 
-	mlog( mllevel | MLOG_NOLOCK,
+	mlog(mllevel | MLOG_NOLOCK,
 	      "%s",
-	      introstr );
-	mlog( mllevel | MLOG_NOLOCK,
+	      introstr);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("hostname: %s\n"),
-	      grhdrp->gh_hostname );
-	mlog( mllevel | MLOG_NOLOCK,
+	      grhdrp->gh_hostname);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("mount point: %s\n"),
-	      crhdrp->ch_mntpnt );
-	mlog( mllevel | MLOG_NOLOCK,
+	      crhdrp->ch_mntpnt);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("volume: %s\n"),
-	      crhdrp->ch_fsdevice );
-	mlog( mllevel | MLOG_NOLOCK,
+	      crhdrp->ch_fsdevice);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("session time: %s"),
-	      ctime32_r( &grhdrp->gh_timestamp, dateline ));
-	mlog( mllevel | MLOG_NOLOCK,
+	      ctime32_r(&grhdrp->gh_timestamp, dateline));
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("level: %s%s\n"),
 	      level_string,
-	      ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_RESUME )
+	      (scrhdrp->cih_dumpattr & CIH_DUMPATTR_RESUME)
 	      ?
 	      _(" resumed")
 	      :
-	      "" );
-	mlog( mllevel | MLOG_NOLOCK,
-	      _("session label: ") );
-	mlog( mllevel | MLOG_NOLOCK | MLOG_BARE,
+	      "");
+	mlog(mllevel | MLOG_NOLOCK,
+	      _("session label: "));
+	mlog(mllevel | MLOG_NOLOCK | MLOG_BARE,
 	      "\"%s\"\n",
-	      grhdrp->gh_dumplabel );
-	mlog( mllevel | MLOG_NOLOCK,
-	      _("media label: ") );
-	mlog( mllevel | MLOG_NOLOCK | MLOG_BARE,
+	      grhdrp->gh_dumplabel);
+	mlog(mllevel | MLOG_NOLOCK,
+	      _("media label: "));
+	mlog(mllevel | MLOG_NOLOCK | MLOG_BARE,
 	      "\"%s\"\n",
-	      mrhdrp->mh_medialabel );
-	mlog( mllevel | MLOG_NOLOCK,
+	      mrhdrp->mh_medialabel);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("file system id: %s\n"),
-	      fs_string_uuid );
-	mlog( mllevel | MLOG_NOLOCK,
+	      fs_string_uuid);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("session id: %s\n"),
-	      dump_string_uuid );
-	mlog( mllevel | MLOG_NOLOCK,
+	      dump_string_uuid);
+	mlog(mllevel | MLOG_NOLOCK,
 	      _("media id: %s\n"),
-	      media_string_uuid );
+	      media_string_uuid);
 
-	if ( lockpr ) {
-		mlog_unlock( );
+	if (lockpr) {
+		mlog_unlock();
 	}
 }
 
 static void
-display_needed_objects( purp_t purp,
+display_needed_objects(purp_t purp,
 			bag_t *bagp,
 			bool_t knownholespr,
-			bool_t maybeholespr )
+			bool_t maybeholespr)
 {
-	if ( bagp ) {
+	if (bagp) {
 		ix_t ix;
 		bagiter_t iter;
 		bagobj_t *bagobjp;
-		if ( purp == PURP_DIR ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK, _(
+		if (purp == PURP_DIR) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK, _(
 			      "the following media objects "
 			      "contain media files not yet tried "
-			      "for directory hierarchy restoral:\n") );
+			      "for directory hierarchy restoral:\n"));
 		}
-		if ( purp == PURP_NONDIR ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK, _(
+		if (purp == PURP_NONDIR) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK, _(
 			      "the following media objects "
-			      "are needed:\n") );
+			      "are needed:\n"));
 		}
-		bagiter_init( bagp, &iter );
+		bagiter_init(bagp, &iter);
 		bagobjp = 0; /* keep lint happy */
 		ix = 0;
-		while ( bagiter_next( &iter,
-				      ( void ** )&bagobjp )) {
+		while (bagiter_next(&iter,
+				      (void **)&bagobjp)) {
 			char uuidstr[UUID_STR_LEN + 1];
-			uuid_unparse( bagobjp->id, uuidstr);
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
-			      "\n" );
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+			uuid_unparse(bagobjp->id, uuidstr);
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+			      "\n");
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      _("%2u. label: "),
-			      ix );
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+			      ix);
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      "\"%s\"\n",
-			      bagobjp->label );
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
-			      _("    id: ") );
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+			      bagobjp->label);
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+			      _("    id: "));
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      "\"%s\"\n",
-			      uuidstr );
-			if ( bagobjp->indrivepr ) {
-				if ( drivecnt > 1 ) {
-					mlog( MLOG_NORMAL
+			      uuidstr);
+			if (bagobjp->indrivepr) {
+				if (drivecnt > 1) {
+					mlog(MLOG_NORMAL
 					      |
 					      MLOG_BARE
 					      |
 					      MLOG_NOLOCK,
 					      _("    now in drive %u\n"),
-					      bagobjp->indriveix );
+					      bagobjp->indriveix);
 				} else {
-					mlog( MLOG_NORMAL
+					mlog(MLOG_NORMAL
 					      |
 					      MLOG_BARE
 					      |
 					      MLOG_NOLOCK,
-					      _("    now in drive\n") );
+					      _("    now in drive\n"));
 				}
 			}
 			ix++;
 			bagobjp = 0; /* keep lint happy */
 		}
 	}
-	if ( knownholespr ) {
-		if ( purp == PURP_DIR ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+	if (knownholespr) {
+		if (purp == PURP_DIR) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      bagp ?
 			      _("\nthere are additional unidentified media "
 			      "objects containing media files not yet tried "
@@ -9668,20 +9668,20 @@
 				:
 			      _("\nthere are unidentified media "
 			      "objects containing media files not yet tried "
-			      "for directory hierarchy restoral:\n") );
+			      "for directory hierarchy restoral:\n"));
 		}
-		if ( purp == PURP_NONDIR ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+		if (purp == PURP_NONDIR) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      bagp ?
 			      _("\nthere are additional unidentified media "
 			      "objects not yet fully restored\n")
 				:
 			      _("\nthere are unidentified media objects "
-			      "not yet fully restored\n") );
+			      "not yet fully restored\n"));
 		}
-	} else if ( maybeholespr ) {
-		if ( purp == PURP_DIR ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+	} else if (maybeholespr) {
+		if (purp == PURP_DIR) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      bagp ?
 			      _("\nthere may be additional unidentified media "
 			      "objects containing media files not yet tried "
@@ -9689,23 +9689,23 @@
 				:
 			      _("\nthere may be unidentified media "
 			      "objects containing media files not yet tried "
-			      "for directory hierarchy restoral:\n") );
+			      "for directory hierarchy restoral:\n"));
 
 		}
-		if ( purp == PURP_NONDIR ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+		if (purp == PURP_NONDIR) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 			      bagp ?
 			      _("\nthere may be additional unidentified media "
 			      "objects not yet fully restored\n")
 				:
 			      _("\there may be unidentified media "
-			      "objects not yet fully restored\n") );
+			      "objects not yet fully restored\n"));
 		}
 	}
 
-	if ( ! bagp && ! knownholespr && ! maybeholespr ) {
-		mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
-		      _("no additional media objects needed\n") );
+	if (! bagp && ! knownholespr && ! maybeholespr) {
+		mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
+		      _("no additional media objects needed\n"));
 	}
 }
 
@@ -9719,18 +9719,18 @@
 	int		rc;
 
 	if (path_to_handle(path, &hanp, &hlen)) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			"path_to_handle of %s failed:%s\n"),
-			path, strerror( errno ));
+			path, strerror(errno));
 		return -1;
 	}
 
 	rc = fssetdm_by_handle(hanp, hlen, fdmp);
 	free_handle(hanp, hlen);
 	if (rc) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			"fssetdm_by_handle of %s failed %s\n"),
-			path, strerror( errno ));
+			path, strerror(errno));
 	}
 	return rc;
 }
@@ -9741,16 +9741,16 @@
 	struct stat s;
 	char buf[MAXPATHLEN];
 
-	sprintf( buf,
+	sprintf(buf,
 		 "%s/%s",
 		 dstdir,
-		 quotafile );
+		 quotafile);
 
-	if ( stat (buf, &s ) >= 0 && S_ISREG(s.st_mode)) {
-		mlog( MLOG_NORMAL, _(
+	if (stat (buf, &s) >= 0 && S_ISREG(s.st_mode)) {
+		mlog(MLOG_NORMAL, _(
 		      "%s quota information written to '%s'\n"),
 		      type,
-		      buf );
+		      buf);
 		return 1;
 	}
 
diff --git a/restore/dirattr.c b/restore/dirattr.c
index f057b78..5368664 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -66,22 +66,22 @@
  * with a handle checksum.
  */
 #define HDLSUMCNT		4
-#define	HDLSUMSHIFT		( NBBY * sizeof ( dah_t ) - HDLSUMCNT )
-#define	HDLSUMLOMASK		( ( 1 << HDLSUMCNT ) - 1 )
-#define	HDLSUMMASK		( HDLSUMLOMASK << HDLSUMSHIFT )
+#define	HDLSUMSHIFT		(NBBY * sizeof (dah_t) - HDLSUMCNT)
+#define	HDLSUMLOMASK		((1 << HDLSUMCNT) - 1)
+#define	HDLSUMMASK		(HDLSUMLOMASK << HDLSUMSHIFT)
 #define HDLDIXCNT		HDLSUMSHIFT
-#define HDLDIXMASK		( ( 1 << HDLDIXCNT ) - 1 )
-#define HDLGETSUM( h )		( ( uint16_t )				\
-				  ( ( ( int )h >> HDLSUMSHIFT )		\
+#define HDLDIXMASK		((1 << HDLDIXCNT) - 1)
+#define HDLGETSUM(h)		((uint16_t)				\
+				  (((int)h >> HDLSUMSHIFT)		\
 				    &					\
-				    HDLSUMLOMASK ))
-#define HDLGETDIX( h )		( ( dix_t )( ( int )h & HDLDIXMASK ))
-#define HDLMKHDL( s, d )	( ( dah_t )( ( ( ( int )s << HDLSUMSHIFT )\
+				    HDLSUMLOMASK))
+#define HDLGETDIX(h)		((dix_t)((int)h & HDLDIXMASK))
+#define HDLMKHDL(s, d)	((dah_t)((((int)s << HDLSUMSHIFT)\
 					       &			\
-					       HDLSUMMASK )		\
+					       HDLSUMMASK)		\
 					  |				\
-					  ( ( int )d & HDLDIXMASK )))
-#define DIX_MAX			( ( off64_t )HDLDIXMASK )
+					  ((int)d & HDLDIXMASK)))
+#define DIX_MAX			((off64_t)HDLDIXMASK)
 
 /* each dirattr will hold two check fields: a handle checksum, and unique
  * pattern, to differentiate a valid dirattr from random file contents.
@@ -90,13 +90,13 @@
 
 #else /* DIRATTRCHK */
 
-#define DIX_MAX			( ( ( off64_t )1			\
+#define DIX_MAX			(((off64_t)1			\
 				    <<					\
-				    ( ( off64_t )NBBY			\
+				    ((off64_t)NBBY			\
 				      *					\
-				      ( off64_t )sizeof( dah_t )))	\
+				      (off64_t)sizeof(dah_t)))	\
 				  -					\
-				  ( off64_t )2 ) /* 2 to avoid DAH_NULL */
+				  (off64_t)2) /* 2 to avoid DAH_NULL */
 
 #endif /* DIRATTRCHK */
 
@@ -123,7 +123,7 @@
 
 typedef struct dirattr dirattr_t;
 
-#define DIRATTR_EXTATTROFFNULL	( ( off64_t )OFF64MAX )
+#define DIRATTR_EXTATTROFFNULL	((off64_t)OFF64MAX)
 
 /* dirattr persistent context definition
  */
@@ -164,12 +164,12 @@
  * in the lseek64 system call.
  */
 typedef off64_t dix_t;
-#define DIX2OFF( dix )	( ( off64_t )( dix * ( off64_t )sizeof( dirattr_t )   \
+#define DIX2OFF(dix)	((off64_t)(dix * (off64_t)sizeof(dirattr_t)   \
 				       +				      \
-				       ( off64_t )DIRATTR_PERS_SZ ))
-#define OFF2DIX( doff )	( ( dix_t )( ( doff - ( off64_t )DIRATTR_PERS_SZ )    \
+				       (off64_t)DIRATTR_PERS_SZ))
+#define OFF2DIX(doff)	((dix_t)((doff - (off64_t)DIRATTR_PERS_SZ)    \
 				     /					      \
-				     ( off64_t )sizeof( dirattr_t )))
+				     (off64_t)sizeof(dirattr_t)))
 
 
 /* declarations of externally defined global symbols *************************/
@@ -178,10 +178,10 @@
 
 /* forward declarations of locally defined static functions ******************/
 
-static void dirattr_get( dah_t );
-static void dirattr_cacheflush( void );
+static void dirattr_get(dah_t);
+static void dirattr_cacheflush(void);
 #ifdef DIRATTRCHK
-static uint16_t calcdixcum( dix_t dix );
+static uint16_t calcdixcum(dix_t dix);
 #endif /* DIRATTRCHK */
 
 
@@ -199,58 +199,58 @@
 /* definition of locally defined global functions ****************************/
 
 bool_t
-dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
+dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 {
-	if ( dtp ) {
+	if (dtp) {
 		return BOOL_TRUE;
 	}
 
 	/* sanity checks
 	 */
-	assert( sizeof( dirattr_pers_t ) <= DIRATTR_PERS_SZ );
-	assert( ! dtp );
-	assert( ! dpp );
+	assert(sizeof(dirattr_pers_t) <= DIRATTR_PERS_SZ);
+	assert(! dtp);
+	assert(! dpp);
 
 	/* allocate and initialize context
 	 */
-	dtp = ( dirattr_tran_t * )calloc( 1, sizeof( dirattr_tran_t ));
-	assert( dtp );
+	dtp = (dirattr_tran_t *)calloc(1, sizeof(dirattr_tran_t));
+	assert(dtp);
 	dtp->dt_cachedh = DAH_NULL;
 	dtp->dt_fd = -1;
 	dtp->dt_extattrfd = -1;
 
 	/* generate a string containing the pathname of the dirattr file
 	 */
-	dtp->dt_pathname = open_pathalloc( hkdir, dirattrfile, 0 );
+	dtp->dt_pathname = open_pathalloc(hkdir, dirattrfile, 0);
 
 	/* open the dirattr file
 	 */
-	if ( resume ) {
+	if (resume) {
 		/* open existing file
 		 */
-		dtp->dt_fd = open( dtp->dt_pathname, O_RDWR );
-		if ( dtp->dt_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		dtp->dt_fd = open(dtp->dt_pathname, O_RDWR);
+		if (dtp->dt_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not find directory attributes file %s: "
 			      "%s\n"),
 			      dtp->dt_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 	} else {
 		/* create the dirattr file, first unlinking any older version
 		 * laying around
 		 */
-		( void )unlink( dtp->dt_pathname );
-		dtp->dt_fd = open( dtp->dt_pathname,
+		(void)unlink(dtp->dt_pathname);
+		dtp->dt_fd = open(dtp->dt_pathname,
 				   O_RDWR | O_CREAT | O_EXCL,
-				   S_IRUSR | S_IWUSR );
-		if ( dtp->dt_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				   S_IRUSR | S_IWUSR);
+		if (dtp->dt_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not create directory attributes file %s: "
 			      "%s\n"),
 			      dtp->dt_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 
@@ -264,7 +264,7 @@
 		int loglevel;
 		size_t trycnt;
 
-		for ( trycnt = 0,
+		for (trycnt = 0,
 		      successpr = BOOL_FALSE,
 		      ioctlcmd = XFS_IOC_RESVSP64,
 		      loglevel = MLOG_VERBOSE
@@ -273,25 +273,25 @@
 		      ;
 		      trycnt++,
 		      ioctlcmd = XFS_IOC_ALLOCSP64,
-		      loglevel = max( MLOG_NORMAL, loglevel - 1 )) {
+		      loglevel = max(MLOG_NORMAL, loglevel - 1)) {
 			off64_t initsz;
 			struct flock64 flock64;
 			int rval;
 
-			if ( ! ioctlcmd ) {
+			if (! ioctlcmd) {
 				continue;
 			}
 
-			initsz = ( off64_t )DIRATTR_PERS_SZ
+			initsz = (off64_t)DIRATTR_PERS_SZ
 				 +
-				 ( ( off64_t )dircnt * sizeof( dirattr_t ));
+				 ((off64_t)dircnt * sizeof(dirattr_t));
 			flock64.l_whence = 0;
 			flock64.l_start = 0;
 			flock64.l_len = initsz;
-			rval = ioctl( dtp->dt_fd, ioctlcmd, &flock64 );
-			if ( rval ) {
-				if ( errno != ENOTTY ) {
-					mlog( loglevel | MLOG_NOTE, _(
+			rval = ioctl(dtp->dt_fd, ioctlcmd, &flock64);
+			if (rval) {
+				if (errno != ENOTTY) {
+					mlog(loglevel | MLOG_NOTE, _(
 					      "attempt to reserve %lld bytes for %s "
 					      "using %s "
 					      "failed: %s (%d)\n"),
@@ -302,8 +302,8 @@
 					      "XFS_IOC_RESVSP64"
 					      :
 					      "XFS_IOC_ALLOCSP64",
-					      strerror( errno ),
-					      errno );
+					      strerror(errno),
+					      errno);
 				}
 			} else {
 				successpr = BOOL_TRUE;
@@ -314,23 +314,23 @@
 
 	/* mmap the persistent descriptor
 	 */
-	assert( ! ( DIRATTR_PERS_SZ % pgsz ));
-	dpp = ( dirattr_pers_t * )mmap_autogrow( DIRATTR_PERS_SZ,
+	assert(! (DIRATTR_PERS_SZ % pgsz));
+	dpp = (dirattr_pers_t *)mmap_autogrow(DIRATTR_PERS_SZ,
 				        dtp->dt_fd,
-				        ( off_t )0 );
-	assert( dpp );
-	if ( dpp == ( dirattr_pers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				        (off_t)0);
+	assert(dpp);
+	if (dpp == (dirattr_pers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map %s: %s\n"),
 		      dtp->dt_pathname,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* initialize persistent state
 	 */
-	if ( ! resume ) {
-		dpp->dp_appendoff = ( off64_t )DIRATTR_PERS_SZ;
+	if (! resume) {
+		dpp->dp_appendoff = (off64_t)DIRATTR_PERS_SZ;
 	}
 
 	/* initialize transient state
@@ -340,53 +340,53 @@
 	/* calculate the dir extattr pathname, and set the fd to -1.
 	 * file will be created on demand.
 	 */
-	dtp->dt_extattrpathname = open_pathalloc( hkdir, dirextattrfile, 0 );
+	dtp->dt_extattrpathname = open_pathalloc(hkdir, dirextattrfile, 0);
 	dtp->dt_extattrfd = -1;
 	dtp->dt_extattrfdbadpr = BOOL_FALSE;
-	if ( resume ) {
-		( void )unlink( dtp->dt_extattrpathname );
+	if (resume) {
+		(void)unlink(dtp->dt_extattrpathname);
 	}
 
 	return BOOL_TRUE;
 }
 
 void
-dirattr_cleanup( void )
+dirattr_cleanup(void)
 {
 	/* REFERENCED */
 	int rval;
 
-	if ( ! dtp ) {
+	if (! dtp) {
 		return;
 	}
-	if ( dpp ) {
-		rval = munmap( ( void * )dpp, DIRATTR_PERS_SZ );
-		assert( ! rval );
+	if (dpp) {
+		rval = munmap((void *)dpp, DIRATTR_PERS_SZ);
+		assert(! rval);
 		dpp = 0;
 	}
-	if ( dtp->dt_fd >= 0 ) {
-		( void )close( dtp->dt_fd );
+	if (dtp->dt_fd >= 0) {
+		(void)close(dtp->dt_fd);
 		dtp->dt_fd = -1;
 	}
-	if ( dtp->dt_pathname ) {
-		( void )unlink( dtp->dt_pathname );
-		free( ( void * )dtp->dt_pathname );
+	if (dtp->dt_pathname) {
+		(void)unlink(dtp->dt_pathname);
+		free((void *)dtp->dt_pathname);
 	}
-	if ( dtp->dt_extattrfd >= 0 ) {
-		( void )close( dtp->dt_extattrfd );
+	if (dtp->dt_extattrfd >= 0) {
+		(void)close(dtp->dt_extattrfd);
 		dtp->dt_extattrfd = -1;
 	}
-	if ( dtp->dt_extattrpathname ) {
-		( void )unlink( dtp->dt_extattrpathname );
-		free( ( void * )dtp->dt_extattrpathname );
+	if (dtp->dt_extattrpathname) {
+		(void)unlink(dtp->dt_extattrpathname);
+		free((void *)dtp->dt_extattrpathname);
 	}
 
-	free( ( void * )dtp );
+	free((void *)dtp);
 	dtp = 0;
 }
 
 dah_t
-dirattr_add( filehdr_t *fhdrp )
+dirattr_add(filehdr_t *fhdrp)
 {
 	dirattr_t dirattr;
 	off64_t oldoff;
@@ -398,21 +398,21 @@
 
 	/* sanity checks
 	 */
-	assert( dtp );
-	assert( dpp );
+	assert(dtp);
+	assert(dpp);
 
 	/* make sure file pointer is positioned to write at end of file
 	 */
-	if ( ! dtp->dt_at_endpr ) {
+	if (! dtp->dt_at_endpr) {
 		off64_t newoff;
-		newoff = lseek64( dtp->dt_fd, dpp->dp_appendoff, SEEK_SET );
-		if ( newoff == ( off64_t )-1 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		newoff = lseek64(dtp->dt_fd, dpp->dp_appendoff, SEEK_SET);
+		if (newoff == (off64_t)-1) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "lseek of dirattr failed: %s\n"),
-			      strerror( errno ));
+			      strerror(errno));
 			return DAH_NULL;
 		}
-		assert( dpp->dp_appendoff == newoff );
+		assert(dpp->dp_appendoff == newoff);
 		dtp->dt_at_endpr = BOOL_TRUE;
 	}
 
@@ -425,25 +425,25 @@
 	/* calculate the index of this dirattr
 	 */
 	oldoff = dpp->dp_appendoff;
-	dix = OFF2DIX( oldoff );
-	assert( dix <= DIX_MAX );
+	dix = OFF2DIX(oldoff);
+	assert(dix <= DIX_MAX);
 
 	/* populate a dirattr
 	 */
-	dirattr.d_mode = ( mode_t )fhdrp->fh_stat.bs_mode;
-	dirattr.d_uid = ( uid_t )fhdrp->fh_stat.bs_uid;
-	dirattr.d_gid = ( gid_t )fhdrp->fh_stat.bs_gid;
-	dirattr.d_atime = ( time32_t )fhdrp->fh_stat.bs_atime.tv_sec;
-	dirattr.d_mtime = ( time32_t )fhdrp->fh_stat.bs_mtime.tv_sec;
-	dirattr.d_ctime = ( time32_t )fhdrp->fh_stat.bs_ctime.tv_sec;
+	dirattr.d_mode = (mode_t)fhdrp->fh_stat.bs_mode;
+	dirattr.d_uid = (uid_t)fhdrp->fh_stat.bs_uid;
+	dirattr.d_gid = (gid_t)fhdrp->fh_stat.bs_gid;
+	dirattr.d_atime = (time32_t)fhdrp->fh_stat.bs_atime.tv_sec;
+	dirattr.d_mtime = (time32_t)fhdrp->fh_stat.bs_mtime.tv_sec;
+	dirattr.d_ctime = (time32_t)fhdrp->fh_stat.bs_ctime.tv_sec;
 	dirattr.d_xflags = fhdrp->fh_stat.bs_xflags;
-	dirattr.d_extsize = ( uint32_t )fhdrp->fh_stat.bs_extsize;
+	dirattr.d_extsize = (uint32_t)fhdrp->fh_stat.bs_extsize;
 	dirattr.d_projid = bstat_projid(&(fhdrp->fh_stat));
 	dirattr.d_dmevmask = fhdrp->fh_stat.bs_dmevmask;
-	dirattr.d_dmstate = ( uint32_t )fhdrp->fh_stat.bs_dmstate;
+	dirattr.d_dmstate = (uint32_t)fhdrp->fh_stat.bs_dmstate;
 #ifdef DIRATTRCHK
 	dirattr.d_unq = DIRATTRUNQ;
-	sum = calcdixcum( dix );
+	sum = calcdixcum(dix);
 	dirattr.d_sum = sum;
 #endif /* DIRATTRCHK */
 	dirattr.d_extattroff = DIRATTR_EXTATTROFFNULL;
@@ -455,20 +455,20 @@
 
 	/* update the next write offset
 	 */
-	assert( dpp->dp_appendoff <= OFF64MAX - ( off64_t )sizeof(dirattr_t) );
-	dpp->dp_appendoff += ( off64_t )sizeof(dirattr_t);
+	assert(dpp->dp_appendoff <= OFF64MAX - (off64_t)sizeof(dirattr_t));
+	dpp->dp_appendoff += (off64_t)sizeof(dirattr_t);
 
 #ifdef DIRATTRCHK
-	dah = HDLMKHDL( sum, dix );
+	dah = HDLMKHDL(sum, dix);
 #else /* DIRATTRCHK */
-	dah = ( dah_t )dix;
+	dah = (dah_t)dix;
 #endif /* DIRATTRCHK */
 
 	return dah;
 }
 
 void
-dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
+dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp)
 {
 	off64_t oldoff;
 	off64_t off;
@@ -479,25 +479,25 @@
 
 	/* pull the selected dir attributes into the cache
 	 */
-	dirattr_get( dah );
+	dirattr_get(dah);
 
 	/* open/create extended attributes file if not yet done
 	 */
-	if ( dtp->dt_extattrfd < 0 ) {
-		if ( dtp->dt_extattrfdbadpr ) {
+	if (dtp->dt_extattrfd < 0) {
+		if (dtp->dt_extattrfdbadpr) {
 			return;
 		}
-		dtp->dt_extattrfd = open( dtp->dt_extattrpathname,
+		dtp->dt_extattrfd = open(dtp->dt_extattrpathname,
 					  O_RDWR | O_CREAT,
-					  S_IRUSR | S_IWUSR );
-		if ( dtp->dt_extattrfd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					  S_IRUSR | S_IWUSR);
+		if (dtp->dt_extattrfd < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not open/create directory "
 			      "extended attributes file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
@@ -507,34 +507,34 @@
 	 */
 	off = dtp->dt_cached_dirattr.d_extattroff;
 	oldoff = DIRATTR_EXTATTROFFNULL;
-	while ( off != DIRATTR_EXTATTROFFNULL ) {
-		seekoff = lseek64( dtp->dt_extattrfd, off, SEEK_SET );
-		if ( seekoff < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	while (off != DIRATTR_EXTATTROFFNULL) {
+		seekoff = lseek64(dtp->dt_extattrfd, off, SEEK_SET);
+		if (seekoff < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not seek to into extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
-		assert( seekoff == off );
+		assert(seekoff == off);
 
 		oldoff = off;
 
-		nread = read( dtp->dt_extattrfd,
-			      ( void * )&off,
-			      sizeof( off ));
-		if ( nread != ( int )sizeof( off )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		nread = read(dtp->dt_extattrfd,
+			      (void *)&off,
+			      sizeof(off));
+		if (nread != (int)sizeof(off)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
@@ -542,42 +542,42 @@
 
 	/* append the extended attributes
 	 */
-	off = lseek64( dtp->dt_extattrfd, 0, SEEK_END );
-	if ( off < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	off = lseek64(dtp->dt_extattrfd, 0, SEEK_END);
+	if (off < 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not seek to end of extended attributes "
 		      "file %s: "
 		      "%s (%d)\n"),
 		      dtp->dt_extattrpathname,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		dtp->dt_extattrfdbadpr = BOOL_TRUE;
 		return;
 	}
 	nulloff = DIRATTR_EXTATTROFFNULL;
-	nwritten = write( dtp->dt_extattrfd,
-			  ( void * )&nulloff,
-			  sizeof( nulloff ));
-	if ( nwritten != ( int )sizeof( nulloff )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	nwritten = write(dtp->dt_extattrfd,
+			  (void *)&nulloff,
+			  sizeof(nulloff));
+	if (nwritten != (int)sizeof(nulloff)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not write extended attributes "
 		      "file %s: "
 		      "%s (%d)\n"),
 		      dtp->dt_extattrpathname,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		dtp->dt_extattrfdbadpr = BOOL_TRUE;
 		return;
 	}
-	nwritten = write( dtp->dt_extattrfd, ( void * )ahdrp, ahdrp->ah_sz );
-	if ( nwritten != ( int )( ahdrp->ah_sz )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	nwritten = write(dtp->dt_extattrfd, (void *)ahdrp, ahdrp->ah_sz);
+	if (nwritten != (int)(ahdrp->ah_sz)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not write at end of extended attributes "
 		      "file %s: "
 		      "%s (%d)\n"),
 		      dtp->dt_extattrpathname,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		dtp->dt_extattrfdbadpr = BOOL_TRUE;
 		return;
 	}
@@ -585,34 +585,34 @@
 	/* fill in the offset of the extended attributes into the
 	 * linked list
 	 */
-	if ( oldoff == DIRATTR_EXTATTROFFNULL ) {
+	if (oldoff == DIRATTR_EXTATTROFFNULL) {
 		dtp->dt_cached_dirattr.d_extattroff = off;
-		dirattr_cacheflush( );
+		dirattr_cacheflush();
 	} else {
-		seekoff = lseek64( dtp->dt_extattrfd, oldoff, SEEK_SET );
-		if ( seekoff < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		seekoff = lseek64(dtp->dt_extattrfd, oldoff, SEEK_SET);
+		if (seekoff < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not seek to into extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
-		assert( seekoff == oldoff );
-		nwritten = write( dtp->dt_extattrfd,
-				  ( void * )&off,
-				  sizeof( off ));
-		if ( nwritten != ( int )sizeof( off )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		assert(seekoff == oldoff);
+		nwritten = write(dtp->dt_extattrfd,
+				  (void *)&off,
+				  sizeof(off));
+		if (nwritten != (int)sizeof(off)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not write extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
@@ -620,35 +620,35 @@
 }
 
 bool_t
-dirattr_cb_extattr( dah_t dah,
-		    bool_t ( * cbfunc )( extattrhdr_t *ahdrp,
-				         void *ctxp ),
+dirattr_cb_extattr(dah_t dah,
+		    bool_t (* cbfunc)(extattrhdr_t *ahdrp,
+				         void *ctxp),
 		    extattrhdr_t *ahdrp,
-		    void *ctxp )
+		    void *ctxp)
 {
 	off64_t off;
 
 	/* pull the selected dir attributes into the cache
 	 */
-	dirattr_get( dah );
+	dirattr_get(dah);
 
 	/* open/create extended attributes file if not yet done
 	 */
-	if ( dtp->dt_extattrfd < 0 ) {
-		if ( dtp->dt_extattrfdbadpr ) {
+	if (dtp->dt_extattrfd < 0) {
+		if (dtp->dt_extattrfdbadpr) {
 			return BOOL_TRUE;
 		}
-		dtp->dt_extattrfd = open( dtp->dt_extattrpathname,
+		dtp->dt_extattrfd = open(dtp->dt_extattrpathname,
 					  O_RDWR | O_CREAT,
-					  S_IRUSR | S_IWUSR );
-		if ( dtp->dt_extattrfd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					  S_IRUSR | S_IWUSR);
+		if (dtp->dt_extattrfd < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not open/create directory "
 			      "extended attributes file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return BOOL_TRUE;
 		}
@@ -657,7 +657,7 @@
 	/* walk through the dirattr list for this dah
 	 */
 	off = dtp->dt_cached_dirattr.d_extattroff;
-	while ( off != DIRATTR_EXTATTROFFNULL ) {
+	while (off != DIRATTR_EXTATTROFFNULL) {
 		off64_t seekoff;
 		int nread;
 		off64_t nextoff;
@@ -666,77 +666,77 @@
 
 		/* seek to the extattr
 		 */
-		seekoff = lseek64( dtp->dt_extattrfd, off, SEEK_SET );
-		if ( seekoff < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		seekoff = lseek64(dtp->dt_extattrfd, off, SEEK_SET);
+		if (seekoff < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not seek to into extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return BOOL_TRUE;
 		}
-		assert( seekoff == off );
+		assert(seekoff == off);
 
 		/* peel off the next offset
 		 */
-		nread = read( dtp->dt_extattrfd,
-			      ( void * )&nextoff,
-			      sizeof( nextoff ));
-		if ( nread != ( int )sizeof( nextoff )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		nread = read(dtp->dt_extattrfd,
+			      (void *)&nextoff,
+			      sizeof(nextoff));
+		if (nread != (int)sizeof(nextoff)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return BOOL_TRUE;
 		}
 
 		/* read the extattr hdr
 		 */
-		nread = read( dtp->dt_extattrfd,
-			      ( void * )ahdrp,
-			      EXTATTRHDR_SZ );
-		if ( nread != EXTATTRHDR_SZ ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		nread = read(dtp->dt_extattrfd,
+			      (void *)ahdrp,
+			      EXTATTRHDR_SZ);
+		if (nread != EXTATTRHDR_SZ) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return BOOL_TRUE;
 		}
 
 		/* read the remainder of the extattr
 		 */
-		recsz = ( size_t )ahdrp->ah_sz;
-		assert( recsz >= EXTATTRHDR_SZ );
-		nread = read( dtp->dt_extattrfd,
-			      ( void * )&ahdrp[ 1 ],
-			      recsz - EXTATTRHDR_SZ );
-		if ( nread != ( int )( recsz - EXTATTRHDR_SZ )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		recsz = (size_t)ahdrp->ah_sz;
+		assert(recsz >= EXTATTRHDR_SZ);
+		nread = read(dtp->dt_extattrfd,
+			      (void *)&ahdrp[1],
+			      recsz - EXTATTRHDR_SZ);
+		if (nread != (int)(recsz - EXTATTRHDR_SZ)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
 			      "%s (%d)\n"),
 			      dtp->dt_extattrpathname,
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return BOOL_TRUE;
 		}
 
 		/* call the callback func
 		 */
-		ok = ( * cbfunc )( ahdrp, ctxp );
-		if ( ! ok ) {
+		ok = (* cbfunc)(ahdrp, ctxp);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 
@@ -749,7 +749,7 @@
 }
 
 void
-dirattr_update( dah_t dah, filehdr_t *fhdrp )
+dirattr_update(dah_t dah, filehdr_t *fhdrp)
 {
 	dix_t dix;
 #ifdef DIRATTRCHK
@@ -762,73 +762,73 @@
 
 	/* sanity checks
 	 */
-	assert( dtp );
-	assert( dpp );
+	assert(dtp);
+	assert(dpp);
 
-	assert( dah != DAH_NULL );
+	assert(dah != DAH_NULL);
 
 #ifdef DIRATTRCHK
-	sum = HDLGETSUM( dah );
-	dix = HDLGETDIX( dah );
+	sum = HDLGETSUM(dah);
+	dix = HDLGETDIX(dah);
 #else /* DIRATTRCHK */
-	dix = ( dix_t )dah;
+	dix = (dix_t)dah;
 #endif /* DIRATTRCHK */
 
-	assert( dix >= 0 );
-	assert( dix <= DIX_MAX );
+	assert(dix >= 0);
+	assert(dix <= DIX_MAX);
 
-	argoff = DIX2OFF( dix );
-	assert( argoff >= 0 );
-	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
-	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
+	argoff = DIX2OFF(dix);
+	assert(argoff >= 0);
+	assert(argoff >= (off64_t)DIRATTR_PERS_SZ);
+	assert(argoff <= dpp->dp_appendoff - (off64_t)sizeof(dirattr_t));
 
 #ifdef DIRATTRCHK
-	dirattr_get( dah );
-	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
-	assert( dtp->dt_cached_dirattr.d_sum == sum );
+	dirattr_get(dah);
+	assert(dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ);
+	assert(dtp->dt_cached_dirattr.d_sum == sum);
 #endif /* DIRATTRCHK */
 
-	if ( dtp->dt_at_endpr && dtp->dt_off ) {
+	if (dtp->dt_at_endpr && dtp->dt_off) {
 		if (dirattr_flush() != RV_OK) {
-			assert( 0 );
+			assert(0);
 			return;
 		}
 	}
 
 	/* seek to the dirattr
 	 */
-	newoff = lseek64( dtp->dt_fd, argoff, SEEK_SET );
-	if ( newoff == ( off64_t )-1 ) {
-		mlog( MLOG_NORMAL, _(
+	newoff = lseek64(dtp->dt_fd, argoff, SEEK_SET);
+	if (newoff == (off64_t)-1) {
+		mlog(MLOG_NORMAL, _(
 		      "lseek of dirattr failed: %s\n"),
-		      strerror( errno ));
-		assert( 0 );
+		      strerror(errno));
+		assert(0);
 	}
-	assert( newoff == argoff );
+	assert(newoff == argoff);
 
 	/* populate a dirattr
 	 */
-	dirattr.d_mode = ( mode_t )fhdrp->fh_stat.bs_mode;
-	dirattr.d_uid = ( uid_t )fhdrp->fh_stat.bs_uid;
-	dirattr.d_gid = ( gid_t )fhdrp->fh_stat.bs_gid;
-	dirattr.d_atime = ( time32_t )fhdrp->fh_stat.bs_atime.tv_sec;
-	dirattr.d_mtime = ( time32_t )fhdrp->fh_stat.bs_mtime.tv_sec;
-	dirattr.d_ctime = ( time32_t )fhdrp->fh_stat.bs_ctime.tv_sec;
+	dirattr.d_mode = (mode_t)fhdrp->fh_stat.bs_mode;
+	dirattr.d_uid = (uid_t)fhdrp->fh_stat.bs_uid;
+	dirattr.d_gid = (gid_t)fhdrp->fh_stat.bs_gid;
+	dirattr.d_atime = (time32_t)fhdrp->fh_stat.bs_atime.tv_sec;
+	dirattr.d_mtime = (time32_t)fhdrp->fh_stat.bs_mtime.tv_sec;
+	dirattr.d_ctime = (time32_t)fhdrp->fh_stat.bs_ctime.tv_sec;
 	dirattr.d_xflags = fhdrp->fh_stat.bs_xflags;
-	dirattr.d_extsize = ( uint32_t )fhdrp->fh_stat.bs_extsize;
+	dirattr.d_extsize = (uint32_t)fhdrp->fh_stat.bs_extsize;
 	dirattr.d_projid = bstat_projid(&(fhdrp->fh_stat));
 	dirattr.d_dmevmask = fhdrp->fh_stat.bs_dmevmask;
-	dirattr.d_dmstate = ( uint32_t )fhdrp->fh_stat.bs_dmstate;
+	dirattr.d_dmstate = (uint32_t)fhdrp->fh_stat.bs_dmstate;
 	dirattr.d_extattroff = DIRATTR_EXTATTROFFNULL;
 
 	/* write the dirattr
 	 */
-	nwritten = write( dtp->dt_fd, ( void * )&dirattr, sizeof( dirattr ));
-	if ( ( size_t )nwritten != sizeof( dirattr )) {
-		mlog( MLOG_NORMAL, _(
+	nwritten = write(dtp->dt_fd, (void *)&dirattr, sizeof(dirattr));
+	if ((size_t)nwritten != sizeof(dirattr)) {
+		mlog(MLOG_NORMAL, _(
 		      "update of dirattr failed: %s\n"),
-		      strerror( errno ));
-		assert( 0 );
+		      strerror(errno));
+		assert(0);
 	}
 
 	dtp->dt_at_endpr = BOOL_FALSE;
@@ -837,84 +837,84 @@
 
 /* ARGSUSED */
 void
-dirattr_del( dah_t dah )
+dirattr_del(dah_t dah)
 {
 }
 
 mode_t
-dirattr_get_mode( dah_t dah )
+dirattr_get_mode(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_mode;
 }
 
 uid_t
-dirattr_get_uid( dah_t dah )
+dirattr_get_uid(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_uid;
 }
 
 uid_t
-dirattr_get_gid( dah_t dah )
+dirattr_get_gid(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_gid;
 }
 
 time32_t
-dirattr_get_atime( dah_t dah )
+dirattr_get_atime(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_atime;
 }
 
 time32_t
-dirattr_get_mtime( dah_t dah )
+dirattr_get_mtime(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_mtime;
 }
 
 time32_t
-dirattr_get_ctime( dah_t dah )
+dirattr_get_ctime(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_ctime;
 }
 
 uint32_t
-dirattr_get_xflags( dah_t dah )
+dirattr_get_xflags(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_xflags;
 }
 
 uint32_t
-dirattr_get_extsize( dah_t dah )
+dirattr_get_extsize(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_extsize;
 }
 
 uint32_t
-dirattr_get_projid( dah_t dah )
+dirattr_get_projid(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_projid;
 }
 
 uint32_t
-dirattr_get_dmevmask( dah_t dah )
+dirattr_get_dmevmask(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_dmevmask;
 }
 
 uint32_t
-dirattr_get_dmstate( dah_t dah )
+dirattr_get_dmstate(dah_t dah)
 {
-	dirattr_get( dah );
+	dirattr_get(dah);
 	return dtp->dt_cached_dirattr.d_dmstate;
 }
 
@@ -925,24 +925,24 @@
 
 	/* sanity checks
 	*/
-	assert ( dtp );
+	assert (dtp);
 
 	if (dtp->dt_off) {
 		/* write the accumulated dirattr entries
 		*/
-		nwritten = write( dtp->dt_fd, ( void * )dtp->dt_buf, dtp->dt_off);
-		if ( nwritten != dtp->dt_off ) {
-			if ( nwritten < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR,
+		nwritten = write(dtp->dt_fd, (void *)dtp->dt_buf, dtp->dt_off);
+		if (nwritten != dtp->dt_off) {
+			if (nwritten < 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR,
 					_("write of dirattr buffer failed: %s\n"),
-					strerror( errno ));
+					strerror(errno));
 			} else {
-				mlog( MLOG_NORMAL | MLOG_ERROR,
+				mlog(MLOG_NORMAL | MLOG_ERROR,
 					_("write of dirattr buffer failed: "
 					"expected to write %ld, actually "
 					"wrote %ld\n"), dtp->dt_off, nwritten);
 			}
-			assert( 0 );
+			assert(0);
 			return RV_UNKNOWN;
 		}
 		dtp->dt_off = 0;
@@ -953,7 +953,7 @@
 /* definition of locally defined static functions ****************************/
 
 static void
-dirattr_get( dah_t dah )
+dirattr_get(dah_t dah)
 {
 	dix_t dix;
 	off64_t argoff;
@@ -965,65 +965,65 @@
 
 	/* sanity checks
 	 */
-	assert( dtp );
-	assert( dpp );
+	assert(dtp);
+	assert(dpp);
 
-	assert( dah != DAH_NULL );
+	assert(dah != DAH_NULL);
 
 	/* if we are already holding this dirattr in cache,
 	 * just return
 	 */
-	if ( dtp->dt_cachedh == dah ) {
+	if (dtp->dt_cachedh == dah) {
 		return;
 	}
 
 #ifdef DIRATTRCHK
-	sum = HDLGETSUM( dah );
-	dix = HDLGETDIX( dah );
+	sum = HDLGETSUM(dah);
+	dix = HDLGETDIX(dah);
 #else /* DIRATTRCHK */
-	dix = ( dix_t )dah;
+	dix = (dix_t)dah;
 #endif /* DIRATTRCHK */
-	assert( dix >= 0 );
-	assert( dix <= DIX_MAX );
+	assert(dix >= 0);
+	assert(dix <= DIX_MAX);
 
-	argoff = DIX2OFF( dix );
-	assert( argoff >= 0 );
-	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
-	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
+	argoff = DIX2OFF(dix);
+	assert(argoff >= 0);
+	assert(argoff >= (off64_t)DIRATTR_PERS_SZ);
+	assert(argoff <= dpp->dp_appendoff - (off64_t)sizeof(dirattr_t));
 
-	if ( dtp->dt_at_endpr && dtp->dt_off ) {
+	if (dtp->dt_at_endpr && dtp->dt_off) {
 		if (dirattr_flush() != RV_OK) {
-			assert( 0 );
+			assert(0);
 			return;
 		}
 	}
 
 	/* seek to the dirattr
 	 */
-	newoff = lseek64( dtp->dt_fd, argoff, SEEK_SET );
-	if ( newoff == ( off64_t )-1 ) {
-		mlog( MLOG_NORMAL, _(
+	newoff = lseek64(dtp->dt_fd, argoff, SEEK_SET);
+	if (newoff == (off64_t)-1) {
+		mlog(MLOG_NORMAL, _(
 		      "lseek of dirattr failed: %s\n"),
-		      strerror( errno ));
-		assert( 0 );
+		      strerror(errno));
+		assert(0);
 	}
-	assert( newoff == argoff );
+	assert(newoff == argoff);
 
 	/* read the dirattr
 	 */
-	nread = read( dtp->dt_fd,
-		      ( void * )&dtp->dt_cached_dirattr,
-		      sizeof( dtp->dt_cached_dirattr ));
-	if ( ( size_t )nread != sizeof( dtp->dt_cached_dirattr )) {
-		mlog( MLOG_NORMAL, _(
+	nread = read(dtp->dt_fd,
+		      (void *)&dtp->dt_cached_dirattr,
+		      sizeof(dtp->dt_cached_dirattr));
+	if ((size_t)nread != sizeof(dtp->dt_cached_dirattr)) {
+		mlog(MLOG_NORMAL, _(
 		      "read of dirattr failed: %s\n"),
-		      strerror( errno ));
-		assert( 0 );
+		      strerror(errno));
+		assert(0);
 	}
 
 #ifdef DIRATTRCHK
-	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
-	assert( dtp->dt_cached_dirattr.d_sum == sum );
+	assert(dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ);
+	assert(dtp->dt_cached_dirattr.d_sum == sum);
 #endif /* DIRATTRCHK */
 
 	dtp->dt_at_endpr = BOOL_FALSE;
@@ -1031,7 +1031,7 @@
 }
 
 static void
-dirattr_cacheflush( void )
+dirattr_cacheflush(void)
 {
 	dah_t dah;
 	dix_t dix;
@@ -1044,58 +1044,58 @@
 
 	/* sanity checks
 	 */
-	assert( dtp );
-	assert( dpp );
+	assert(dtp);
+	assert(dpp);
 
 	/* if nothing in the cache, ignore
 	 */
 	dah = dtp->dt_cachedh;
-	assert( dah != DAH_NULL );
-	if ( dah == DAH_NULL ) {
+	assert(dah != DAH_NULL);
+	if (dah == DAH_NULL) {
 		return;
 	}
 
 #ifdef DIRATTRCHK
-	sum = HDLGETSUM( dah );
-	dix = HDLGETDIX( dah );
+	sum = HDLGETSUM(dah);
+	dix = HDLGETDIX(dah);
 #else /* DIRATTRCHK */
-	dix = ( dix_t )dah;
+	dix = (dix_t)dah;
 #endif /* DIRATTRCHK */
 
 #ifdef DIRATTRCHK
-	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
-	assert( dtp->dt_cached_dirattr.d_sum == sum );
+	assert(dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ);
+	assert(dtp->dt_cached_dirattr.d_sum == sum);
 #endif /* DIRATTRCHK */
 
-	assert( dix >= 0 );
-	assert( dix <= DIX_MAX );
+	assert(dix >= 0);
+	assert(dix <= DIX_MAX);
 
-	argoff = DIX2OFF( dix );
-	assert( argoff >= 0 );
-	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
-	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
+	argoff = DIX2OFF(dix);
+	assert(argoff >= 0);
+	assert(argoff >= (off64_t)DIRATTR_PERS_SZ);
+	assert(argoff <= dpp->dp_appendoff - (off64_t)sizeof(dirattr_t));
 
 	/* seek to the dirattr
 	 */
-	newoff = lseek64( dtp->dt_fd, argoff, SEEK_SET );
-	if ( newoff == ( off64_t )-1 ) {
-		mlog( MLOG_NORMAL, _(
+	newoff = lseek64(dtp->dt_fd, argoff, SEEK_SET);
+	if (newoff == (off64_t)-1) {
+		mlog(MLOG_NORMAL, _(
 		      "lseek of dirattr failed: %s\n"),
-		      strerror( errno ));
-		assert( 0 );
+		      strerror(errno));
+		assert(0);
 	}
-	assert( newoff == argoff );
+	assert(newoff == argoff);
 
 	/* write the dirattr
 	 */
-	nwritten = write( dtp->dt_fd,
-			  ( void * )&dtp->dt_cached_dirattr,
-			  sizeof( dtp->dt_cached_dirattr ));
-	if ( ( size_t )nwritten != sizeof( dtp->dt_cached_dirattr )) {
-		mlog( MLOG_NORMAL, _(
+	nwritten = write(dtp->dt_fd,
+			  (void *)&dtp->dt_cached_dirattr,
+			  sizeof(dtp->dt_cached_dirattr));
+	if ((size_t)nwritten != sizeof(dtp->dt_cached_dirattr)) {
+		mlog(MLOG_NORMAL, _(
 		      "flush of dirattr failed: %s\n"),
-		      strerror( errno ));
-		assert( 0 );
+		      strerror(errno));
+		assert(0);
 	}
 
 	dtp->dt_at_endpr = BOOL_FALSE;
@@ -1104,21 +1104,21 @@
 #ifdef DIRATTRCHK
 
 static uint16_t
-calcdixcum( dix_t dix )
+calcdixcum(dix_t dix)
 {
 	uint16_t sum;
 	ix_t nibcnt;
 	ix_t nibix;
 
-	assert( ( sizeof( dah_t ) / HDLSUMCNT ) * HDLSUMCNT == sizeof( dah_t ));
+	assert((sizeof(dah_t) / HDLSUMCNT) * HDLSUMCNT == sizeof(dah_t));
 
-	nibcnt = ( sizeof( dah_t ) / HDLSUMCNT ) - 1;
+	nibcnt = (sizeof(dah_t) / HDLSUMCNT) - 1;
 	sum = 0;
-	for ( nibix = 0 ; nibix < nibcnt ; nibix++ ) {
-		sum += ( uint16_t )( dix & HDLSUMLOMASK );
+	for (nibix = 0 ; nibix < nibcnt ; nibix++) {
+		sum += (uint16_t)(dix & HDLSUMLOMASK);
 		dix >>= HDLSUMCNT;
 	}
-	sum = ( uint16_t )( ( ~sum + 1 ) & HDLSUMLOMASK );
+	sum = (uint16_t)((~sum + 1) & HDLSUMLOMASK);
 
 	return sum;
 }
diff --git a/restore/dirattr.h b/restore/dirattr.h
index aaf276d..dd37a98 100644
--- a/restore/dirattr.h
+++ b/restore/dirattr.h
@@ -31,61 +31,61 @@
  * returns FALSE if an error encountered. if NOT resync,
  * dircnt hints at number of directories to expect.
  */
-extern bool_t dirattr_init( char *housekeepingdir,
+extern bool_t dirattr_init(char *housekeepingdir,
 			    bool_t resync,
-			    uint64_t dircnt );
+			    uint64_t dircnt);
 
 
 /* dirattr_cleanup - removes all traces
  */
-extern void dirattr_cleanup( void );
+extern void dirattr_cleanup(void);
 
 
 /* dirattr_add - registers a directory's attributes. knows how to interpret
  * the filehdr. returns handle for use with dirattr_get_...().
  */
-extern dah_t dirattr_add( filehdr_t *fhdrp );
+extern dah_t dirattr_add(filehdr_t *fhdrp);
 
 /* dirattr_update - modifies existing registered attributes
  */
-extern void dirattr_update( dah_t dah, filehdr_t *fhdrp );
+extern void dirattr_update(dah_t dah, filehdr_t *fhdrp);
 
 /* dirattr_del - frees dirattr no longer needed
  */
-extern void dirattr_del( dah_t dah );
+extern void dirattr_del(dah_t dah);
 
 /* dirattr_get_... - retrieve various attributes
  */
-mode_t dirattr_get_mode( dah_t dah );
-uid_t dirattr_get_uid( dah_t dah );
-gid_t dirattr_get_gid( dah_t dah );
-time32_t dirattr_get_atime( dah_t dah );
-time32_t dirattr_get_mtime( dah_t dah );
-time32_t dirattr_get_ctime( dah_t dah );
-uint32_t dirattr_get_xflags( dah_t dah );
-uint32_t dirattr_get_extsize( dah_t dah );
-uint32_t dirattr_get_projid( dah_t dah );
-uint32_t dirattr_get_dmevmask( dah_t dah );
-uint32_t dirattr_get_dmstate( dah_t dah );
+mode_t dirattr_get_mode(dah_t dah);
+uid_t dirattr_get_uid(dah_t dah);
+gid_t dirattr_get_gid(dah_t dah);
+time32_t dirattr_get_atime(dah_t dah);
+time32_t dirattr_get_mtime(dah_t dah);
+time32_t dirattr_get_ctime(dah_t dah);
+uint32_t dirattr_get_xflags(dah_t dah);
+uint32_t dirattr_get_extsize(dah_t dah);
+uint32_t dirattr_get_projid(dah_t dah);
+uint32_t dirattr_get_dmevmask(dah_t dah);
+uint32_t dirattr_get_dmstate(dah_t dah);
 
 /* dirattr_flush - flush dirattr I/O buffer.  Returns 0 if successful.
  */
-extern rv_t dirattr_flush( void );
+extern rv_t dirattr_flush(void);
 
 /* dirattr_addextattr - record an extended attribute. second argument is
  * ptr to extattrhdr_t, with extattr name and value appended as
  * described by hdr.
  */
-extern void dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp );
+extern void dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp);
 
 /* dirattr_cb_extattr - calls back for every extended attribute associated with
  * the given dah. stops iteration and returnd FALSE if cbfunc returns FALSE,
  * else returns TRUE.
  */
-extern bool_t dirattr_cb_extattr( dah_t dah,
-				  bool_t ( * cbfunc )( extattrhdr_t *ahdrp,
-						       void *ctxp ),
+extern bool_t dirattr_cb_extattr(dah_t dah,
+				  bool_t (* cbfunc)(extattrhdr_t *ahdrp,
+						       void *ctxp),
 				  extattrhdr_t *ahdrp,
-				  void *ctxp );
+				  void *ctxp);
 
 #endif /* DIRATTR_H */
diff --git a/restore/getopt.h b/restore/getopt.h
index 361bc61..b5bc004 100644
--- a/restore/getopt.h
+++ b/restore/getopt.h
@@ -49,7 +49,7 @@
 #define	GETOPT_SUBTREE		's'	/* subtree restore (content.c) */
 #define	GETOPT_TOC		't'	/* display contents only (content.c) */
 /*				'u' */
-#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4 ) */
+#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4) */
 #define	GETOPT_SMALLWINDOW	'w'	/* use a small window for dir entries */
 /*				'x' */
 /*				'y' */
diff --git a/restore/inomap.c b/restore/inomap.c
index 5f81897..1b03779 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -77,9 +77,9 @@
 
 /* inomap primitives
  */
-static int map_getset( xfs_ino_t, int, bool_t );
-static int map_set( xfs_ino_t ino, int );
-static seg_t * map_getsegment( xfs_ino_t ino );
+static int map_getset(xfs_ino_t, int, bool_t);
+static int map_set(xfs_ino_t ino, int);
+static seg_t * map_getsegment(xfs_ino_t ino);
 
 /* definition of locally defined global variables ****************************/
 
@@ -103,15 +103,15 @@
  */
 
 static inline void
-SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
+SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 {
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	register uint64_t clrmask;
 	relino = ino - segp->base;
-	mask = ( uint64_t )1 << relino;
+	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
-	switch( state ) {
+	switch(state) {
 	case 0:
 		segp->lobits &= clrmask;
 		segp->mebits &= clrmask;
@@ -156,22 +156,22 @@
 }
 
 static inline int
-SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
+SEG_GET_BITS(seg_t *segp, xfs_ino_t ino)
 {
 	int state;
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	relino = ino - segp->base;
-	mask = ( uint64_t )1 << relino;
-	if ( segp->lobits & mask ) {
+	mask = (uint64_t)1 << relino;
+	if (segp->lobits & mask) {
 		state = 1;
 	} else {
 		state = 0;
 	}
-	if ( segp->mebits & mask ) {
+	if (segp->mebits & mask) {
 		state |= 2;
 	}
-	if ( segp->hibits & mask ) {
+	if (segp->hibits & mask) {
 		state |= 4;
 	}
 
@@ -181,9 +181,9 @@
 /* definition of locally defined global functions ****************************/
 
 rv_t
-inomap_restore_pers( drive_t *drivep,
+inomap_restore_pers(drive_t *drivep,
 		     content_inode_hdr_t *scrhdrp,
-		     char *hkdir )
+		     char *hkdir)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	char *perspath;
@@ -201,9 +201,9 @@
 
 	/* sanity checks
 	 */
-	assert( INOPERSEG == ( sizeof( (( seg_t * )0 )->lobits ) * NBBY ));
-	assert( sizeof( hnk_t ) == HNKSZ );
-	assert( sizeof( pers_t ) <= PERSSZ );
+	assert(INOPERSEG == (sizeof(((seg_t *)0)->lobits) * NBBY));
+	assert(sizeof(hnk_t) == HNKSZ);
+	assert(sizeof(pers_t) <= PERSSZ);
 
 	/* get inomap info from media hdr
 	 */
@@ -213,32 +213,32 @@
 
 	/* truncate and open the backing store
 	 */
-	perspath = open_pathalloc( hkdir, PERS_NAME, 0 );
-	( void )unlink( perspath );
-	fd = open( perspath,
+	perspath = open_pathalloc(hkdir, PERS_NAME, 0);
+	(void)unlink(perspath);
+	fd = open(perspath,
 		   O_RDWR | O_CREAT,
-		   S_IRUSR | S_IWUSR );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		   S_IRUSR | S_IWUSR);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "could not open %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return RV_ERROR;
 	}
 
 	/* mmap the persistent hdr and space for the map
 	 */
-	persp = ( pers_t * ) mmap_autogrow(
+	persp = (pers_t *) mmap_autogrow(
 				     PERSSZ
 				     +
-				     sizeof( hnk_t ) * ( size_t )hnkcnt,
+				     sizeof(hnk_t) * (size_t)hnkcnt,
 				     fd,
-				     ( off64_t )0 );
-	if ( persp == ( pers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				     (off64_t)0);
+	if (persp == (pers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return RV_ERROR;
 	}
 
@@ -248,17 +248,17 @@
 	persp->segcnt = segcnt;
 	persp->last_ino_added = last_ino_added;
 
-	tmphnkp = ( hnk_t * )calloc( ( size_t )hnkcnt, sizeof( hnk_t ));
-	assert( tmphnkp );
+	tmphnkp = (hnk_t *)calloc((size_t)hnkcnt, sizeof(hnk_t));
+	assert(tmphnkp);
 
 	/* read the map in from media
 	 */
-	nread = read_buf( ( char * )tmphnkp,
-			  sizeof( hnk_t ) * ( size_t )hnkcnt,
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
+	nread = read_buf((char *)tmphnkp,
+			  sizeof(hnk_t) * (size_t)hnkcnt,
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
 
 	pershnkp = (hnk_t *)((char *)persp + PERSSZ);
 	for(i = 0; i < hnkcnt; i++) {
@@ -270,23 +270,23 @@
 
 	/* close up
 	 */
-	rval1 = munmap( ( void * )persp,
+	rval1 = munmap((void *)persp,
 		        PERSSZ
 		        +
-		        sizeof( hnk_t ) * ( size_t )hnkcnt );
-	assert( ! rval1 );
-	( void )close( fd );
-	free( ( void * )perspath );
+		        sizeof(hnk_t) * (size_t)hnkcnt);
+	assert(! rval1);
+	(void)close(fd);
+	free((void *)perspath);
 
 	mlog(MLOG_NITTY, "inomap_restore_pers: post-munmap\n");
 
 	/* check the return code from read
 	 */
-	switch( rval ) {
+	switch(rval) {
 	case 0:
-		assert( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
-		ok = inomap_sync_pers( hkdir );
-		if ( ! ok ) {
+		assert((size_t)nread == sizeof(hnk_t) * (size_t)hnkcnt);
+		ok = inomap_sync_pers(hkdir);
+		if (! ok) {
 			return RV_ERROR;
 		}
 		return RV_OK;
@@ -307,7 +307,7 @@
 /* peels inomap from media
  */
 rv_t
-inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp )
+inomap_discard(drive_t *drivep, content_inode_hdr_t *scrhdrp)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	uint64_t tmphnkcnt;
@@ -321,17 +321,17 @@
 
 	/* read the map in from media
 	 */
-	nread = read_buf( 0,
-			  sizeof( hnk_t ) * ( size_t )tmphnkcnt,
-			  ( void * )drivep,
-			  ( rfp_t )dop->do_read,
-			  ( rrbfp_t )dop->do_return_read_buf,
-			  &rval );
+	nread = read_buf(0,
+			  sizeof(hnk_t) * (size_t)tmphnkcnt,
+			  (void *)drivep,
+			  (rfp_t)dop->do_read,
+			  (rrbfp_t)dop->do_return_read_buf,
+			  &rval);
 	/* check the return code from read
 	 */
-	switch( rval ) {
+	switch(rval) {
 	case 0:
-		assert( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
+		assert((size_t)nread == sizeof(hnk_t) * (size_t)hnkcnt);
 		return RV_OK;
 	case DRIVE_ERROR_EOD:
 	case DRIVE_ERROR_EOF:
@@ -348,7 +348,7 @@
 }
 
 bool_t
-inomap_sync_pers( char *hkdir )
+inomap_sync_pers(char *hkdir)
 {
 	char *perspath;
 	pers_t *persp;
@@ -356,33 +356,33 @@
 
 	/* sanity checks
 	 */
-	assert( sizeof( hnk_t ) == HNKSZ );
+	assert(sizeof(hnk_t) == HNKSZ);
 
 	/* only needed once per session
 	 */
-	if ( pers_fd >= 0 ) {
+	if (pers_fd >= 0) {
 		return BOOL_TRUE;
 	}
 
 	/* open the backing store. if not present, ok, hasn't been created yet
 	 */
-	perspath = open_pathalloc( hkdir, PERS_NAME, 0 );
-	pers_fd = open( perspath, O_RDWR );
-	if ( pers_fd < 0 ) {
+	perspath = open_pathalloc(hkdir, PERS_NAME, 0);
+	pers_fd = open(perspath, O_RDWR);
+	if (pers_fd < 0) {
 		return BOOL_TRUE;
 	}
 
 	/* mmap the persistent hdr
 	 */
-	persp = ( pers_t * ) mmap_autogrow(
+	persp = (pers_t *) mmap_autogrow(
 				     PERSSZ,
 				     pers_fd,
-				     ( off64_t )0 );
-	if ( persp == ( pers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				     (off64_t)0);
+	if (persp == (pers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map %s hdr: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -394,26 +394,26 @@
 
 	/* mmap the pers inomap
 	 */
-	assert( hnkcnt * sizeof( hnk_t ) <= ( size64_t )INT32MAX );
-	roothnkp = ( hnk_t * ) mmap_autogrow(
-				       sizeof( hnk_t ) * ( size_t )hnkcnt,
+	assert(hnkcnt * sizeof(hnk_t) <= (size64_t)INT32MAX);
+	roothnkp = (hnk_t *) mmap_autogrow(
+				       sizeof(hnk_t) * (size_t)hnkcnt,
 				       pers_fd,
-				       ( off64_t )PERSSZ );
-	if ( roothnkp == ( hnk_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				       (off64_t)PERSSZ);
+	if (roothnkp == (hnk_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* correct the next pointers
 	 */
-	for ( hnkp = roothnkp
+	for (hnkp = roothnkp
 	      ;
-	      hnkp < roothnkp + ( int )hnkcnt - 1
+	      hnkp < roothnkp + (int)hnkcnt - 1
 	      ;
-	      hnkp++ ) {
+	      hnkp++) {
 		hnkp->nextp = hnkp + 1;
 	}
 	hnkp->nextp = 0;
@@ -421,12 +421,12 @@
 	/* calculate the tail pointers
 	 */
 	tailhnkp = hnkp;
-	assert( hnkcnt > 0 );
-	lastsegp = &tailhnkp->seg[ ( int )( segcnt
+	assert(hnkcnt > 0);
+	lastsegp = &tailhnkp->seg[(int)(segcnt
 						 -
-						 SEGPERHNK * ( hnkcnt - 1 )
+						 SEGPERHNK * (hnkcnt - 1)
 						 -
-						 1 ) ];
+						 1)];
 
 	/* now all inomap operators will work
 	 */
@@ -436,50 +436,50 @@
 /* de-allocate the persistent inomap
  */
 void
-inomap_del_pers( char *hkdir )
+inomap_del_pers(char *hkdir)
 {
-	char *perspath = open_pathalloc( hkdir, PERS_NAME, 0 );
-	( void )unlink( perspath );
-	free( ( void * )perspath );
+	char *perspath = open_pathalloc(hkdir, PERS_NAME, 0);
+	(void)unlink(perspath);
+	free((void *)perspath);
 }
 
 /* mark all included non-dirs as MAP_NDR_NOREST
  */
 void
-inomap_sanitize( void )
+inomap_sanitize(void)
 {
 	hnk_t *hnkp;
 	seg_t *segp;
 
 	/* step through all hunks, segs, and inos
 	 */
-	for ( hnkp = roothnkp
+	for (hnkp = roothnkp
 	      ;
 	      hnkp != 0
 	      ;
-	      hnkp = hnkp->nextp ) {
-		for ( segp = hnkp->seg
+	      hnkp = hnkp->nextp) {
+		for (segp = hnkp->seg
 		      ;
 		      segp < hnkp->seg + SEGPERHNK
 		      ;
-		      segp++ ) {
+		      segp++) {
 			xfs_ino_t ino;
-			if ( hnkp == tailhnkp && segp > lastsegp ) {
+			if (hnkp == tailhnkp && segp > lastsegp) {
 				return;
 			}
-			for ( ino = segp->base
+			for (ino = segp->base
 			      ;
 			      ino < segp->base + INOPERSEG
 			      ;
-			      ino++ ) {
+			      ino++) {
 				int state;
-				if ( ino > last_ino_added ) {
+				if (ino > last_ino_added) {
 					return;
 				}
-				state = SEG_GET_BITS( segp, ino );
-				if ( state == MAP_NDR_CHANGE ) {
+				state = SEG_GET_BITS(segp, ino);
+				if (state == MAP_NDR_CHANGE) {
 					state = MAP_NDR_NOREST;
-					SEG_SET_BITS( segp, ino, state );
+					SEG_SET_BITS(segp, ino, state);
 				}
 			}
 		}
@@ -489,53 +489,53 @@
 /* called to mark a non-dir ino as TO be restored
  */
 void
-inomap_rst_add( xfs_ino_t ino )
+inomap_rst_add(xfs_ino_t ino)
 {
-		assert( pers_fd >= 0 );
-		( void )map_set( ino, MAP_NDR_CHANGE );
+		assert(pers_fd >= 0);
+		(void)map_set(ino, MAP_NDR_CHANGE);
 }
 
 /* called to mark a non-dir ino as NOT to be restored
  */
 void
-inomap_rst_del( xfs_ino_t ino )
+inomap_rst_del(xfs_ino_t ino)
 {
-		assert( pers_fd >= 0 );
-		( void )map_set( ino, MAP_NDR_NOREST );
+		assert(pers_fd >= 0);
+		(void)map_set(ino, MAP_NDR_NOREST);
 }
 
 /* called to ask if any inos in the given range need to be restored.
  * range is inclusive
  */
 bool_t
-inomap_rst_needed( xfs_ino_t firstino, xfs_ino_t lastino )
+inomap_rst_needed(xfs_ino_t firstino, xfs_ino_t lastino)
 {
 	hnk_t *hnkp;
 	seg_t *segp;
 
 	/* if inomap not restored/resynced, just say yes
 	 */
-	if ( ! roothnkp ) {
+	if (! roothnkp) {
 		return BOOL_TRUE;
 	}
 
 	/* may be completely out of range
 	 */
-	if ( firstino > last_ino_added ) {
+	if (firstino > last_ino_added) {
 		return BOOL_FALSE;
 	}
 
 	/* find the hunk/seg containing first ino or any ino beyond
 	 */
-	for ( hnkp = roothnkp ; hnkp != 0 ; hnkp = hnkp->nextp ) {
-		if ( firstino > hnkp->maxino ) {
+	for (hnkp = roothnkp ; hnkp != 0 ; hnkp = hnkp->nextp) {
+		if (firstino > hnkp->maxino) {
 			continue;
 		}
-		for ( segp = hnkp->seg; segp < hnkp->seg + SEGPERHNK ; segp++ ){
-			if ( hnkp == tailhnkp && segp > lastsegp ) {
+		for (segp = hnkp->seg; segp < hnkp->seg + SEGPERHNK ; segp++){
+			if (hnkp == tailhnkp && segp > lastsegp) {
 				return BOOL_FALSE;
 			}
-			if ( firstino < segp->base + INOPERSEG ) {
+			if (firstino < segp->base + INOPERSEG) {
 				goto begin;
 			}
 		}
@@ -545,32 +545,32 @@
 begin:
 	/* search until at least one ino is needed or until beyond last ino
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		xfs_ino_t ino;
 
-		if ( segp->base > lastino ) {
+		if (segp->base > lastino) {
 			return BOOL_FALSE;
 		}
-		for ( ino = segp->base ; ino < segp->base + INOPERSEG ; ino++ ){
+		for (ino = segp->base ; ino < segp->base + INOPERSEG ; ino++){
 			int state;
-			if ( ino < firstino ) {
+			if (ino < firstino) {
 				continue;
 			}
-			if ( ino > lastino ) {
+			if (ino > lastino) {
 				return BOOL_FALSE;
 			}
-			state = SEG_GET_BITS( segp, ino );
-			if ( state == MAP_NDR_CHANGE ) {
+			state = SEG_GET_BITS(segp, ino);
+			if (state == MAP_NDR_CHANGE) {
 				return BOOL_TRUE;
 			}
 		}
 		segp++;
-		if ( hnkp == tailhnkp && segp > lastsegp ) {
+		if (hnkp == tailhnkp && segp > lastsegp) {
 			return BOOL_FALSE;
 		}
-		if ( segp >= hnkp->seg + SEGPERHNK ) {
+		if (segp >= hnkp->seg + SEGPERHNK) {
 			hnkp = hnkp->nextp;
-			if ( ! hnkp ) {
+			if (! hnkp) {
 				return BOOL_FALSE;
 			}
 			segp = hnkp->seg;
@@ -584,43 +584,43 @@
  * returns FALSE.
  */
 void
-inomap_cbiter( int statemask,
-	       bool_t ( * cbfunc )( void *ctxp, xfs_ino_t ino ),
-	       void *ctxp )
+inomap_cbiter(int statemask,
+	       bool_t (* cbfunc)(void *ctxp, xfs_ino_t ino),
+	       void *ctxp)
 {
 	hnk_t *hnkp;
 	seg_t *segp;
 
 	/* step through all hunks, segs, and inos
 	 */
-	for ( hnkp = roothnkp
+	for (hnkp = roothnkp
 	      ;
 	      hnkp != 0
 	      ;
-	      hnkp = hnkp->nextp ) {
-		for ( segp = hnkp->seg
+	      hnkp = hnkp->nextp) {
+		for (segp = hnkp->seg
 		      ;
 		      segp < hnkp->seg + SEGPERHNK
 		      ;
-		      segp++ ) {
+		      segp++) {
 			xfs_ino_t ino;
-			if ( hnkp == tailhnkp && segp > lastsegp ) {
+			if (hnkp == tailhnkp && segp > lastsegp) {
 				return;
 			}
-			for ( ino = segp->base
+			for (ino = segp->base
 			      ;
 			      ino < segp->base + INOPERSEG
 			      ;
-			      ino++ ) {
+			      ino++) {
 				int state;
-				if ( ino > last_ino_added ) {
+				if (ino > last_ino_added) {
 					return;
 				}
-				state = SEG_GET_BITS( segp, ino );
-				if ( statemask & ( 1 << state )) {
+				state = SEG_GET_BITS(segp, ino);
+				if (statemask & (1 << state)) {
 					bool_t ok;
-					ok = ( cbfunc )( ctxp, ino );
-					if ( ! ok ) {
+					ok = (cbfunc)(ctxp, ino);
+					if (! ok) {
 						return;
 					}
 				}
@@ -635,24 +635,24 @@
  * and optionally sets the state to a new value.
  */
 static int
-map_getset( xfs_ino_t ino, int newstate, bool_t setflag )
+map_getset(xfs_ino_t ino, int newstate, bool_t setflag)
 {
 	int state;
 	seg_t *segp;
 
-	if ((segp = map_getsegment( ino )) == NULL) {
+	if ((segp = map_getsegment(ino)) == NULL) {
 		return MAP_INO_UNUSED;
 	}
 
-	state = SEG_GET_BITS( segp, ino );
-	if ( setflag ) {
-		SEG_SET_BITS( segp, ino, newstate );
+	state = SEG_GET_BITS(segp, ino);
+	if (setflag) {
+		SEG_SET_BITS(segp, ino, newstate);
 	}
 	return state;
 }
 
 static seg_t *
-map_getsegment( xfs_ino_t ino )
+map_getsegment(xfs_ino_t ino)
 {
 	uint64_t min;
 	uint64_t max;
@@ -690,7 +690,7 @@
 
 	min = 0;
 	if (hnk == hnkcnt - 1) {
-		max = segcnt - SEGPERHNK * ( hnkcnt - 1 ) - 1;
+		max = segcnt - SEGPERHNK * (hnkcnt - 1) - 1;
 	} else {
 		max = SEGPERHNK - 1;
 	}
@@ -710,10 +710,10 @@
 }
 
 static int
-map_set( xfs_ino_t ino, int state )
+map_set(xfs_ino_t ino, int state)
 {
 	int oldstate;
 
- 	oldstate = map_getset( ino, state, BOOL_TRUE );
+ 	oldstate = map_getset(ino, state, BOOL_TRUE);
 	return oldstate;
 }
diff --git a/restore/inomap.h b/restore/inomap.h
index 03facdb..93f982c 100644
--- a/restore/inomap.h
+++ b/restore/inomap.h
@@ -55,32 +55,32 @@
 
 typedef struct seg seg_t;
 
-#define INOPERSEG	( sizeofmember( seg_t, lobits ) * NBBY )
+#define INOPERSEG	(sizeofmember(seg_t, lobits) * NBBY)
 
-#define HNKSZ		( 4 * PGSZ )
-#define SEGPERHNK	( ( HNKSZ / sizeof( seg_t )) - 1 )
+#define HNKSZ		(4 * PGSZ)
+#define SEGPERHNK	((HNKSZ / sizeof(seg_t)) - 1)
 
 struct hnk {
-	seg_t seg[ SEGPERHNK ];
+	seg_t seg[SEGPERHNK];
 	xfs_ino_t maxino;
 	struct hnk *nextp;
-	char pad[sizeof( seg_t ) - sizeof( xfs_ino_t ) - sizeof( struct hnk * )];
+	char pad[sizeof(seg_t) - sizeof(xfs_ino_t) - sizeof(struct hnk *)];
 };
 
 typedef struct hnk hnk_t;
 
-extern bool_t inomap_sync_pers( char *hkdir );
-extern rv_t inomap_restore_pers( drive_t *drivep,
+extern bool_t inomap_sync_pers(char *hkdir);
+extern rv_t inomap_restore_pers(drive_t *drivep,
 				 content_inode_hdr_t *scrhdrp,
-				 char *hkdir );
-extern void inomap_del_pers( char *hkdir );
-extern void inomap_sanitize( void );
-extern bool_t inomap_rst_needed( xfs_ino_t begino, xfs_ino_t endino );
-extern void inomap_rst_add( xfs_ino_t ino );
-extern void inomap_rst_del( xfs_ino_t ino );
-extern rv_t inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp );
-extern void inomap_cbiter( int mapstatemask,
-			   bool_t ( * cbfunc )( void *ctxp, xfs_ino_t ino ),
-			   void *ctxp );
+				 char *hkdir);
+extern void inomap_del_pers(char *hkdir);
+extern void inomap_sanitize(void);
+extern bool_t inomap_rst_needed(xfs_ino_t begino, xfs_ino_t endino);
+extern void inomap_rst_add(xfs_ino_t ino);
+extern void inomap_rst_del(xfs_ino_t ino);
+extern rv_t inomap_discard(drive_t *drivep, content_inode_hdr_t *scrhdrp);
+extern void inomap_cbiter(int mapstatemask,
+			   bool_t (* cbfunc)(void *ctxp, xfs_ino_t ino),
+			   void *ctxp);
 
 #endif /* INOMAP_H */
diff --git a/restore/mmap.c b/restore/mmap.c
index 29dd3d7..0407740 100644
--- a/restore/mmap.c
+++ b/restore/mmap.c
@@ -41,5 +41,5 @@
 	(void)write(fd, nul_buffer, 1);
     }
 
-    return mmap( 0, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset );
+    return mmap(0, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset);
 }
diff --git a/restore/namreg.c b/restore/namreg.c
index 8e7ff76..89fa5ef 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -76,21 +76,21 @@
  * checking is enabled.
  */
 #define CHKBITCNT		2
-#define	CHKBITSHIFT		( NBBY * sizeof( nrh_t ) - CHKBITCNT )
-#define	CHKBITLOMASK		( ( 1ULL << CHKBITCNT ) - 1 )
-#define	CHKBITMASK		( CHKBITLOMASK << CHKBITSHIFT )
+#define	CHKBITSHIFT		(NBBY * sizeof(nrh_t) - CHKBITCNT)
+#define	CHKBITLOMASK		((1ULL << CHKBITCNT) - 1)
+#define	CHKBITMASK		(CHKBITLOMASK << CHKBITSHIFT)
 #define CHKHDLCNT		CHKBITSHIFT
-#define CHKHDLMASK		( ( 1ULL << CHKHDLCNT ) - 1 )
-#define CHKGETBIT( h )		( ( (h) >> CHKBITSHIFT ) & CHKBITLOMASK )
-#define CHKGETHDL( h )		( (h) & CHKHDLMASK )
-#define CHKMKHDL( c, h )	( ( ( (c) << CHKBITSHIFT ) & CHKBITMASK )	\
+#define CHKHDLMASK		((1ULL << CHKHDLCNT) - 1)
+#define CHKGETBIT(h)		(((h) >> CHKBITSHIFT) & CHKBITLOMASK)
+#define CHKGETHDL(h)		((h) & CHKHDLMASK)
+#define CHKMKHDL(c, h)	((((c) << CHKBITSHIFT) & CHKBITMASK)	\
 				  |					\
-				  ( (h) & CHKHDLMASK ))
-#define HDLMAX			( ( off64_t )CHKHDLMASK )
+				  ((h) & CHKHDLMASK))
+#define HDLMAX			((off64_t)CHKHDLMASK)
 
 #else /* NAMREGCHK */
 
-#define HDLMAX			( NRH_NULL - 1 )
+#define HDLMAX			(NRH_NULL - 1)
 
 #endif /* NAMREGCHK */
 
@@ -101,7 +101,7 @@
 
 /* forward declarations of locally defined static functions ******************/
 
-static rv_t namreg_flush( void );
+static rv_t namreg_flush(void);
 
 /* definition of locally defined global variables ****************************/
 
@@ -116,56 +116,56 @@
 /* definition of locally defined global functions ****************************/
 
 bool_t
-namreg_init( char *hkdir, bool_t resume, uint64_t inocnt )
+namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 {
-	if ( ntp ) {
+	if (ntp) {
 		return BOOL_TRUE;
 	}
 
 	/* sanity checks
 	 */
-	assert( ! ntp );
-	assert( ! npp );
+	assert(! ntp);
+	assert(! npp);
 
-	assert( sizeof( namreg_pers_t ) <= NAMREG_PERS_SZ );
+	assert(sizeof(namreg_pers_t) <= NAMREG_PERS_SZ);
 
 	/* allocate and initialize context
 	 */
-	ntp = ( namreg_tran_t * )calloc( 1, sizeof( namreg_tran_t ));
-	assert( ntp );
+	ntp = (namreg_tran_t *)calloc(1, sizeof(namreg_tran_t));
+	assert(ntp);
 
 	/* generate a string containing the pathname of the namreg file
 	 */
-	ntp->nt_pathname = open_pathalloc( hkdir, namregfile, 0 );
+	ntp->nt_pathname = open_pathalloc(hkdir, namregfile, 0);
 
 	/* open the namreg file
 	 */
-	if ( resume ) {
+	if (resume) {
 		/* open existing file
 		 */
-		ntp->nt_fd = open( ntp->nt_pathname, O_RDWR );
-		if ( ntp->nt_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		ntp->nt_fd = open(ntp->nt_pathname, O_RDWR);
+		if (ntp->nt_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not find name registry file %s: "
 			      "%s\n"),
 			      ntp->nt_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 	} else {
 		/* create the namreg file, first unlinking any older version
 		 * laying around
 		 */
-		( void )unlink( ntp->nt_pathname );
-		ntp->nt_fd = open( ntp->nt_pathname,
+		(void)unlink(ntp->nt_pathname);
+		ntp->nt_fd = open(ntp->nt_pathname,
 				   O_RDWR | O_CREAT | O_EXCL,
-				   S_IRUSR | S_IWUSR );
-		if ( ntp->nt_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				   S_IRUSR | S_IWUSR);
+		if (ntp->nt_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not create name registry file %s: "
 			      "%s\n"),
 			      ntp->nt_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 
@@ -179,7 +179,7 @@
 		int loglevel;
 		size_t trycnt;
 
-		for ( trycnt = 0,
+		for (trycnt = 0,
 		      successpr = BOOL_FALSE,
 		      ioctlcmd = XFS_IOC_RESVSP64,
 		      loglevel = MLOG_VERBOSE
@@ -188,25 +188,25 @@
 		      ;
 		      trycnt++,
 		      ioctlcmd = XFS_IOC_ALLOCSP64,
-		      loglevel = max( MLOG_NORMAL, loglevel - 1 )) {
+		      loglevel = max(MLOG_NORMAL, loglevel - 1)) {
 			off64_t initsz;
 			struct flock64 flock64;
 			int rval;
 
-			if ( ! ioctlcmd ) {
+			if (! ioctlcmd) {
 				continue;
 			}
 
-			initsz = ( off64_t )NAMREG_PERS_SZ
+			initsz = (off64_t)NAMREG_PERS_SZ
 				 +
-				 ( ( off64_t )inocnt * NAMREG_AVGLEN );
+				 ((off64_t)inocnt * NAMREG_AVGLEN);
 			flock64.l_whence = 0;
 			flock64.l_start = 0;
 			flock64.l_len = initsz;
-			rval = ioctl( ntp->nt_fd, ioctlcmd, &flock64 );
-			if ( rval ) {
-				if ( errno != ENOTTY ) {
-					mlog( loglevel | MLOG_NOTE, _(
+			rval = ioctl(ntp->nt_fd, ioctlcmd, &flock64);
+			if (rval) {
+				if (errno != ENOTTY) {
+					mlog(loglevel | MLOG_NOTE, _(
 					      "attempt to reserve %lld bytes for %s "
 					      "using %s "
 					      "failed: %s (%d)\n"),
@@ -217,8 +217,8 @@
 					      "XFS_IOC_RESVSP64"
 					      :
 					      "XFS_IOC_ALLOCSP64",
-					      strerror( errno ),
-					      errno );
+					      strerror(errno),
+					      errno);
 				}
 			} else {
 				successpr = BOOL_TRUE;
@@ -229,23 +229,23 @@
 
 	/* mmap the persistent descriptor
 	 */
-	assert( ! ( NAMREG_PERS_SZ % pgsz ));
-	npp = ( namreg_pers_t * ) mmap_autogrow(
+	assert(! (NAMREG_PERS_SZ % pgsz));
+	npp = (namreg_pers_t *) mmap_autogrow(
 				        NAMREG_PERS_SZ,
 				        ntp->nt_fd,
-				        ( off_t )0 );
-	if ( npp == ( namreg_pers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+				        (off_t)0);
+	if (npp == (namreg_pers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map %s: %s\n"),
 		      ntp->nt_pathname,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* initialize persistent state
 	 */
-	if ( ! resume ) {
-		npp->np_appendoff = ( off64_t )NAMREG_PERS_SZ;
+	if (! resume) {
+		npp->np_appendoff = (off64_t)NAMREG_PERS_SZ;
 	}
 
 	/* initialize transient state
@@ -256,7 +256,7 @@
 }
 
 nrh_t
-namreg_add( char *name, size_t namelen )
+namreg_add(char *name, size_t namelen)
 {
 	off64_t oldoff;
 	unsigned char c;
@@ -264,23 +264,23 @@
 
 	/* sanity checks
 	 */
-	assert( ntp );
-	assert( npp );
-	assert( !ntp->nt_map );
+	assert(ntp);
+	assert(npp);
+	assert(!ntp->nt_map);
 
 	/* make sure file pointer is positioned to append
 	 */
-	if ( ! ntp->nt_at_endpr ) {
+	if (! ntp->nt_at_endpr) {
 		off64_t newoff;
-		newoff = lseek64( ntp->nt_fd, npp->np_appendoff, SEEK_SET );
-		if ( newoff == ( off64_t )-1 ) {
-			mlog( MLOG_NORMAL, _(
+		newoff = lseek64(ntp->nt_fd, npp->np_appendoff, SEEK_SET);
+		if (newoff == (off64_t)-1) {
+			mlog(MLOG_NORMAL, _(
 			      "lseek of namreg failed: %s\n"),
-			      strerror( errno ));
-			assert( 0 );
+			      strerror(errno));
+			assert(0);
 			return NRH_NULL;
 		}
-		assert( npp->np_appendoff == newoff );
+		assert(npp->np_appendoff == newoff);
 		ntp->nt_at_endpr = BOOL_TRUE;
 	}
 
@@ -296,8 +296,8 @@
 
 	/* write a one byte unsigned string length into the buffer.
 	 */
-	assert( namelen < 256 );
-	c = ( unsigned char )( namelen & 0xff );
+	assert(namelen < 256);
+	c = (unsigned char)(namelen & 0xff);
 	ntp->nt_buf[ntp->nt_off++] = c;
 
 	/* write the name string into the buffer.
@@ -305,18 +305,18 @@
 	memcpy(ntp->nt_buf + ntp->nt_off, name, namelen);
 	ntp->nt_off += namelen;
 
-	npp->np_appendoff += ( off64_t )( 1 + namelen );
-	assert( oldoff <= HDLMAX );
+	npp->np_appendoff += (off64_t)(1 + namelen);
+	assert(oldoff <= HDLMAX);
 
 #ifdef NAMREGCHK
 
 	/* encode the lsb of the len plus the first character into the handle.
 	 */
-	nrh = CHKMKHDL( ( nrh_t )namelen + ( nrh_t )*name, ( nrh_t )oldoff );
+	nrh = CHKMKHDL((nrh_t)namelen + (nrh_t)*name, (nrh_t)oldoff);
 
 #else /* NAMREGCHK */
 
-	nrh = ( nrh_t )oldoff;
+	nrh = (nrh_t)oldoff;
 
 #endif /* NAMREGCHK */
 
@@ -325,38 +325,38 @@
 
 /* ARGSUSED */
 void
-namreg_del( nrh_t nrh )
+namreg_del(nrh_t nrh)
 {
 	/* currently not implemented - grows, never shrinks
 	 */
 }
 
 static rv_t
-namreg_flush( void )
+namreg_flush(void)
 {
 	ssize_t nwritten;
 
 	/* sanity checks
 	*/
-	assert( ntp );
+	assert(ntp);
 
 	if (ntp->nt_off) {
 
 		/* write the accumulated name strings.
 		*/
-		nwritten = write( ntp->nt_fd, ( void * )ntp->nt_buf, ntp->nt_off );
-		if ( nwritten != ntp->nt_off ) {
-			if ( nwritten < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR,
+		nwritten = write(ntp->nt_fd, (void *)ntp->nt_buf, ntp->nt_off);
+		if (nwritten != ntp->nt_off) {
+			if (nwritten < 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR,
 					_("write of namreg buffer failed: %s\n"),
-					strerror( errno ));
+					strerror(errno));
 			} else {
-				mlog( MLOG_NORMAL | MLOG_ERROR,
+				mlog(MLOG_NORMAL | MLOG_ERROR,
 					_("write of namreg buffer failed: "
 					"expected to write %ld, actually "
 					"wrote %ld\n"), ntp->nt_off, nwritten);
 			}
-			assert( 0 );
+			assert(0);
 			return RV_UNKNOWN;
 		}
 		ntp->nt_off = 0;
@@ -365,9 +365,9 @@
 }
 
 int
-namreg_get( nrh_t nrh,
+namreg_get(nrh_t nrh,
 	    char *bufp,
-	    size_t bufsz )
+	    size_t bufsz)
 {
 	off64_t newoff;
 	int nread;
@@ -381,55 +381,55 @@
 
 	/* sanity checks
 	 */
-	assert( ntp );
-	assert( npp );
+	assert(ntp);
+	assert(npp);
 
 	/* make sure we aren't being given a NULL handle
 	 */
-	assert( nrh != NRH_NULL );
+	assert(nrh != NRH_NULL);
 
 	/* convert the handle into the offset
 	 */
 #ifdef NAMREGCHK
 
-	newoff = ( off64_t )( size64_t )CHKGETHDL( nrh );
-	chkbit = CHKGETBIT( nrh );
+	newoff = (off64_t)(size64_t)CHKGETHDL(nrh);
+	chkbit = CHKGETBIT(nrh);
 
 #else /* NAMREGCHK */
 
-	newoff = ( off64_t )( size64_t )nrh;
+	newoff = (off64_t)(size64_t)nrh;
 
 #endif /* NAMREGCHK */
 
 	/* do sanity check on offset
 	 */
-	assert( newoff <= HDLMAX );
-	assert( newoff < npp->np_appendoff );
-	assert( newoff >= ( off64_t )NAMREG_PERS_SZ );
+	assert(newoff <= HDLMAX);
+	assert(newoff < npp->np_appendoff);
+	assert(newoff >= (off64_t)NAMREG_PERS_SZ);
 
-	lock( );
+	lock();
 
-	if ( ntp->nt_map ) {
+	if (ntp->nt_map) {
 
 		in_bufp = ntp->nt_map + newoff - NAMREG_PERS_SZ;
 
 	} else {
 
-		if ( ntp->nt_at_endpr && ntp->nt_off ) {
+		if (ntp->nt_at_endpr && ntp->nt_off) {
 			if (namreg_flush() != RV_OK) {
-				unlock( );
+				unlock();
 				return -3;
 			}
 		}
 
 		/* seek to the name
 		*/
-		newoff = lseek64( ntp->nt_fd, newoff, SEEK_SET );
-		if ( newoff == ( off64_t )-1 ) {
-			unlock( );
-			mlog( MLOG_NORMAL, _(
+		newoff = lseek64(ntp->nt_fd, newoff, SEEK_SET);
+		if (newoff == (off64_t)-1) {
+			unlock();
+			mlog(MLOG_NORMAL, _(
 				"lseek of namreg failed: %s\n"),
-				strerror( errno ));
+				strerror(errno));
 			return -3;
 		}
 		ntp->nt_at_endpr = BOOL_FALSE;
@@ -438,13 +438,13 @@
 		 * NOTE: assumes read_buf is big enough for the longest
 		 * allowed name (255 chars) plus one byte for length.
 		 */
-		nread = read( ntp->nt_fd, ( void * )read_buf, sizeof(read_buf) );
-		if ( nread <= 0 ) {
-			unlock( );
-			mlog( MLOG_NORMAL, _(
+		nread = read(ntp->nt_fd, (void *)read_buf, sizeof(read_buf));
+		if (nread <= 0) {
+			unlock();
+			mlog(MLOG_NORMAL, _(
 				"read of namreg failed: %s (nread = %d)\n"),
-				strerror( errno ),
-				nread );
+				strerror(errno),
+				nread);
 			return -3;
 		}
 
@@ -453,9 +453,9 @@
 
 	/* deal with a short caller-supplied buffer
 	 */
-	len = ( size_t )in_bufp[0];
-	if ( bufsz < len + 1 ) {
-		unlock( );
+	len = (size_t)in_bufp[0];
+	if (bufsz < len + 1) {
+		unlock();
 		return -1;
 	}
 
@@ -467,42 +467,42 @@
 
 	/* validate the checkbit
 	 */
-	assert( chkbit
+	assert(chkbit
 		==
-		( ( ( nrh_t )len + ( nrh_t )bufp[ 0 ] ) & CHKBITLOMASK ));
+		(((nrh_t)len + (nrh_t)bufp[0]) & CHKBITLOMASK));
 
 #endif /* NAMREGCHK */
 
 	/* null-terminate the string if room
 	 */
-	bufp[ len ] = 0;
+	bufp[len] = 0;
 
-	unlock( );
+	unlock();
 
-	return ( int )len;
+	return (int)len;
 }
 
 rv_t
-namreg_map( void )
+namreg_map(void)
 {
 	rv_t rv;
 
 	/* ensure all entries have been written */
-	if ( (rv = namreg_flush()) != RV_OK ) {
+	if ((rv = namreg_flush()) != RV_OK) {
 		return rv;
 	}
 
-	ntp->nt_map = ( char * ) mmap_autogrow(
+	ntp->nt_map = (char *) mmap_autogrow(
 					npp->np_appendoff - NAMREG_PERS_SZ,
 					ntp->nt_fd,
-					NAMREG_PERS_SZ );
+					NAMREG_PERS_SZ);
 
 	/* it's okay if this fails, just fall back to (the much slower)
 	 * seek-and-read lookups.
 	 */
-	if ( ntp->nt_map == ( char * )-1 ) {
-		mlog( MLOG_DEBUG, "failed to map namreg: %s\n",
-			strerror( errno ) );
+	if (ntp->nt_map == (char *)-1) {
+		mlog(MLOG_DEBUG, "failed to map namreg: %s\n",
+			strerror(errno));
 		ntp->nt_map = NULL;
 	}
 
diff --git a/restore/namreg.h b/restore/namreg.h
index 859ccd7..bd014e2 100644
--- a/restore/namreg.h
+++ b/restore/namreg.h
@@ -34,26 +34,26 @@
  * registry should already exist, and we are resynchronizing.
  * if NOT resync, inocnt hints at how many names will be held
  */
-extern bool_t namreg_init( char *housekeepingdir,
+extern bool_t namreg_init(char *housekeepingdir,
 			   bool_t resync,
-			   uint64_t inocnt );
+			   uint64_t inocnt);
 
 
 /* namreg_add - registers a name. name does not need to be null-terminated.
  * returns handle for use with namreg_get().
  */
-extern nrh_t namreg_add( char *name, size_t namelen );
+extern nrh_t namreg_add(char *name, size_t namelen);
 
 
 /* namreg_del - remove a name from the registry
  */
-extern void namreg_del( nrh_t nrh );
+extern void namreg_del(nrh_t nrh);
 
 /* namreg_map - mmap the name registry, allowing for much
  * faster namreg_get() lookups. once called, additional
  * entries cannot be added.
  */
-extern rv_t namreg_map( void );
+extern rv_t namreg_map(void);
 
 /* namreg_get - retrieves the name identified by the index.
  * fills the buffer with the null-terminated name from the registry.
@@ -61,6 +61,6 @@
  * small to fit the null-terminated name. return -2 if the name
  * not in the registry. return -3 if a system call fails.
  */
-extern int namreg_get( nrh_t nrh, char *bufp, size_t bufsz );
+extern int namreg_get(nrh_t nrh, char *bufp, size_t bufsz);
 
 #endif /* NAMREG_H */
diff --git a/restore/node.c b/restore/node.c
index b6b6906..f720730 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -49,21 +49,21 @@
  * that xfsrestore can handle.
  */
 #define HDLGENCNT		4
-#define	HDLGENSHIFT		( NBBY * sizeof ( nh_t ) - HDLGENCNT )
-#define	HDLGENLOMASK		( ( 1 << HDLGENCNT ) - 1 )
-#define	HDLGENMASK		( HDLGENLOMASK << HDLGENSHIFT )
-#define HDLMASK			( ( 1 << HDLGENSHIFT ) - 1 )
-#define HDLGETGEN( h )		( ( u_char_t )				\
-				  ( ( ( int )h >> HDLGENSHIFT )		\
+#define	HDLGENSHIFT		(NBBY * sizeof (nh_t) - HDLGENCNT)
+#define	HDLGENLOMASK		((1 << HDLGENCNT) - 1)
+#define	HDLGENMASK		(HDLGENLOMASK << HDLGENSHIFT)
+#define HDLMASK			((1 << HDLGENSHIFT) - 1)
+#define HDLGETGEN(h)		((u_char_t)				\
+				  (((int)h >> HDLGENSHIFT)		\
 				    &					\
-				    HDLGENLOMASK ))
-#define HDLGETNHDL( h )		( ( nh_t )( ( int )h & HDLMASK ))
-#define HDLMKHDL( g, n )	( ( nh_t )( ( ( ( int )g << HDLGENSHIFT )\
+				    HDLGENLOMASK))
+#define HDLGETNHDL(h)		((nh_t)((int)h & HDLMASK))
+#define HDLMKHDL(g, n)	((nh_t)((((int)g << HDLGENSHIFT)\
 					      &				\
-					      HDLGENMASK )		\
+					      HDLGENMASK)		\
 					  |				\
-					  ( ( int )n & HDLMASK )))
-#define NH_MAX			( HDLMASK )
+					  ((int)n & HDLMASK)))
+#define NH_MAX			(HDLMASK)
 
 /* the housekeeping byte of each node will hold two check fields:
  * a gen count, initialized to 0 and incremented each time a node
@@ -74,22 +74,22 @@
  * be freed.
  */
 #define HKPGENCNT		HDLGENCNT
-#define HKPGENSHIFT		( NBBY - HKPGENCNT )
-#define HKPGENLOMASK		( ( 1 << HKPGENCNT ) - 1 )
-#define HKPGENMASK		( HKPGENLOMASK << HKPGENSHIFT )
-#define HKPUNQCNT		( NBBY - HKPGENCNT )
-#define HKPUNQMASK		( ( 1 << HKPUNQCNT ) - 1 )
-#define HKPGETGEN( b )		( ( u_char_t )				\
-				  ( ( ( int )b >> HKPGENSHIFT )		\
+#define HKPGENSHIFT		(NBBY - HKPGENCNT)
+#define HKPGENLOMASK		((1 << HKPGENCNT) - 1)
+#define HKPGENMASK		(HKPGENLOMASK << HKPGENSHIFT)
+#define HKPUNQCNT		(NBBY - HKPGENCNT)
+#define HKPUNQMASK		((1 << HKPUNQCNT) - 1)
+#define HKPGETGEN(b)		((u_char_t)				\
+				  (((int)b >> HKPGENSHIFT)		\
 				    &					\
-				    HKPGENLOMASK ))
-#define HKPGETUNQ( b )		( ( u_char_t )( ( int )b & HKPUNQMASK ))
-#define HKPMKHKP( g, u )	( ( u_char_t )				\
-				  ( ( ( ( int )g << HKPGENSHIFT )	\
+				    HKPGENLOMASK))
+#define HKPGETUNQ(b)		((u_char_t)((int)b & HKPUNQMASK))
+#define HKPMKHKP(g, u)	((u_char_t)				\
+				  ((((int)g << HKPGENSHIFT)	\
 				      &					\
-				      HKPGENMASK )			\
+				      HKPGENMASK)			\
 				    |					\
-				    ( ( int )u & HKPUNQMASK )))
+				    ((int)u & HKPUNQMASK)))
 
 /* simple patterns for detecting a node
  */
@@ -98,7 +98,7 @@
 
 #else /* NODECHK */
 
-#define NH_MAX			( NH_NULL - 1 )
+#define NH_MAX			(NH_NULL - 1)
 
 #endif /* NODECHK */
 
@@ -159,32 +159,32 @@
 static int node_fd;
 
 static inline segix_t
-nh2segix( nh_t nh )
+nh2segix(nh_t nh)
 {
 	return nh >> node_hdrp->nh_segixshift;
 }
 
 static inline relnix_t
-nh2relnix( nh_t nh )
+nh2relnix(nh_t nh)
 {
 	return nh & node_hdrp->nh_relnixmask;
 }
 
 static inline void
-node_map_internal( nh_t nh, void **pp )
+node_map_internal(nh_t nh, void **pp)
 {
-	win_map( nh2segix( nh ), pp );
-	if ( *pp != NULL ) {
-		relnix_t relnix = nh2relnix( nh );
-		*pp = ( void * )( ( char * )( *pp ) +
-				( ( off64_t )relnix *
-				  node_hdrp->nh_nodesz ) );
+	win_map(nh2segix(nh), pp);
+	if (*pp != NULL) {
+		relnix_t relnix = nh2relnix(nh);
+		*pp = (void *)((char *)(*pp) +
+				((off64_t)relnix *
+				  node_hdrp->nh_nodesz));
 	}
 }
 
 /* ARGSUSED */
 static inline void
-node_unmap_internal( nh_t nh, void **pp, bool_t freepr )
+node_unmap_internal(nh_t nh, void **pp, bool_t freepr)
 {
 #ifdef NODECHK
 	register u_char_t hkp;
@@ -193,47 +193,47 @@
 	register u_char_t nodeunq;
 #endif /* NODECHK */
 
-	assert( pp );
-	assert( *pp );
-	assert( nh != NH_NULL );
+	assert(pp);
+	assert(*pp);
+	assert(nh != NH_NULL);
 
 	/* convert the handle into an index
 	 */
 #ifdef NODECHK
-	hdlgen = HDLGETGEN( nh );
-	nh = HDLGETNHDL( nh );
+	hdlgen = HDLGETGEN(nh);
+	nh = HDLGETNHDL(nh);
 #endif /* NODECHK */
 
-	assert( nh <= NH_MAX );
+	assert(nh <= NH_MAX);
 
 #ifdef NODECHK
-	hkp = *( *( u_char_t ** )pp + node_hdrp->nh_nodehkix );
-	nodegen = HKPGETGEN( hkp );
-	assert( nodegen == hdlgen );
-	nodeunq = HKPGETUNQ( hkp );
-	if ( ! freepr ) {
-		assert( nodeunq != NODEUNQFREE );
-		assert( nodeunq == NODEUNQALCD );
+	hkp = *(*(u_char_t **)pp + node_hdrp->nh_nodehkix);
+	nodegen = HKPGETGEN(hkp);
+	assert(nodegen == hdlgen);
+	nodeunq = HKPGETUNQ(hkp);
+	if (! freepr) {
+		assert(nodeunq != NODEUNQFREE);
+		assert(nodeunq == NODEUNQALCD);
 	} else {
-		assert( nodeunq != NODEUNQALCD );
-		assert( nodeunq == NODEUNQFREE );
+		assert(nodeunq != NODEUNQALCD);
+		assert(nodeunq == NODEUNQFREE);
 	}
 #endif /* NODECHK */
 
 	/* unmap the window containing the node
 	 */
-	win_unmap( nh2segix( nh ), pp ); /* zeros *pp */
+	win_unmap(nh2segix(nh), pp); /* zeros *pp */
 }
 
 /* ARGSUSED */
 bool_t
-node_init( int fd,
+node_init(int fd,
 	   off64_t off,
 	   size_t usrnodesz,
 	   ix_t nodehkix,
 	   size_t nodealignsz,
 	   size64_t vmsz,
-	   size64_t dirs_nondirs_cnt )
+	   size64_t dirs_nondirs_cnt)
 {
 	size_t nodesz;
 	size64_t segsz;
@@ -245,23 +245,23 @@
 
 	/* sanity checks
 	 */
-	assert( sizeof( node_hdr_t ) <= NODE_HDRSZ );
-	assert( sizeof( nh_t ) < sizeof( off64_t ));
-	assert( sizeof( nh_t ) <= sizeof( segix_t ));
-	assert( sizeof( nh_t ) <= sizeof( relnix_t ));
-	assert( nodehkix < usrnodesz );
-	assert( usrnodesz >= sizeof( char * ) + 1 );
+	assert(sizeof(node_hdr_t) <= NODE_HDRSZ);
+	assert(sizeof(nh_t) < sizeof(off64_t));
+	assert(sizeof(nh_t) <= sizeof(segix_t));
+	assert(sizeof(nh_t) <= sizeof(relnix_t));
+	assert(nodehkix < usrnodesz);
+	assert(usrnodesz >= sizeof(char *) + 1);
 		/* so node is at least big enough to hold
 		 * the free list linkage and the housekeeping byte
 		 */
-	assert( nodehkix > sizeof( char * ));
+	assert(nodehkix > sizeof(char *));
 		/* since beginning of each node is used to
 		 * link it in the free list.
 		 */
 
 	/* adjust the user's node size to meet user's alignment constraint
 	*/
-	nodesz = ( usrnodesz + nodealignsz - 1 ) & ~( nodealignsz - 1 );
+	nodesz = (usrnodesz + nodealignsz - 1) & ~(nodealignsz - 1);
 
 	/* Calculate the node table params based on the number of inodes in the
 	 * dump, since that's all we know. Ideally we'd base this on the number
@@ -288,13 +288,13 @@
 	 * reasonable cap on the max number of segments.
 	 */
 
-	assert( NODESPERSEG_MIN >= pgsz );
+	assert(NODESPERSEG_MIN >= pgsz);
 
-	if ( vmsz < WINMAP_MIN * NODESPERSEG_MIN * nodesz ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (vmsz < WINMAP_MIN * NODESPERSEG_MIN * nodesz) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		  "not enough virtual memory for node abstraction: "
 		  "remaining-vsmz=%llu need=%llu\n"),
-		  vmsz, WINMAP_MIN * NODESPERSEG_MIN * nodesz );
+		  vmsz, WINMAP_MIN * NODESPERSEG_MIN * nodesz);
 		return BOOL_FALSE;
 	}
 
@@ -302,53 +302,53 @@
 	 * dirs_nondirs_cnt may be less than the number of nodes/dirents).
 	 * Checking this here prevents potential overflow in the logic below.
 	 */
-	if ( dirs_nondirs_cnt > NH_MAX ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (dirs_nondirs_cnt > NH_MAX) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		  "dump contains %llu inodes, restore can only handle %u\n"),
-		  dirs_nondirs_cnt, NH_MAX );
+		  dirs_nondirs_cnt, NH_MAX);
 		return BOOL_FALSE;
 	}
 
-	for ( winmapmax = 0, segcount = 1; winmapmax < WINMAP_MIN; segcount <<= 1 ) {
+	for (winmapmax = 0, segcount = 1; winmapmax < WINMAP_MIN; segcount <<= 1) {
 
-		nodesperseg = max( dirs_nondirs_cnt / segcount, NODESPERSEG_MIN );
+		nodesperseg = max(dirs_nondirs_cnt / segcount, NODESPERSEG_MIN);
 
 		/* nodesperseg must be a power of 2 */
-		for ( segixshift = 0;
-		      ( 1ULL << segixshift ) < nodesperseg;
-		      segixshift++ );
+		for (segixshift = 0;
+		      (1ULL << segixshift) < nodesperseg;
+		      segixshift++);
 
 		/* rounding up to a power of 2 may have caused overflow */
-		if ( ( 1ULL << segixshift ) > NH_MAX )
+		if ((1ULL << segixshift) > NH_MAX)
 			segixshift--;
 
 		nodesperseg = 1UL << segixshift;
 
-		max_segments = 1UL << ( NBBY * sizeof(nh_t) - segixshift );
+		max_segments = 1UL << (NBBY * sizeof(nh_t) - segixshift);
 
 		segsz = nodesperseg * nodesz;
 
 		/* max number of segments that will fit in virtual memory,
 		 * capped at the max possible number of segments
 		 */
-		winmapmax = min( vmsz / segsz, max_segments );
+		winmapmax = min(vmsz / segsz, max_segments);
 	}
 
 	/* map the abstraction header
 	 */
-	assert( ( NODE_HDRSZ & pgmask ) == 0 );
-	assert( ! ( NODE_HDRSZ % pgsz ));
-	assert( off <= OFF64MAX );
-	assert( ! ( off % ( off64_t )pgsz ));
-	node_hdrp = ( node_hdr_t * )mmap_autogrow(
+	assert((NODE_HDRSZ & pgmask) == 0);
+	assert(! (NODE_HDRSZ % pgsz));
+	assert(off <= OFF64MAX);
+	assert(! (off % (off64_t)pgsz));
+	node_hdrp = (node_hdr_t *)mmap_autogrow(
 					    NODE_HDRSZ,
 					    fd,
-					    off );
-	if ( node_hdrp == (node_hdr_t *)-1 ) {
-	    mlog( MLOG_NORMAL | MLOG_ERROR, _(
+					    off);
+	if (node_hdrp == (node_hdr_t *)-1) {
+	    mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		  "unable to map node hdr of size %d: %s\n"),
 		  NODE_HDRSZ,
-		  strerror( errno ));
+		  strerror(errno));
 	    return BOOL_FALSE;
 	}
 
@@ -361,7 +361,7 @@
 	node_hdrp->nh_nodesperseg = nodesperseg;
 	node_hdrp->nh_nodealignsz = nodealignsz;
 	node_hdrp->nh_freenh = NH_NULL;
-	node_hdrp->nh_firstsegoff = off + ( off64_t )NODE_HDRSZ;
+	node_hdrp->nh_firstsegoff = off + (off64_t)NODE_HDRSZ;
 	node_hdrp->nh_virgnh = 0;
 	node_hdrp->nh_segixshift = segixshift;
 	node_hdrp->nh_relnixmask = nodesperseg - 1;
@@ -372,14 +372,14 @@
 
 	/* initialize the window abstraction
 	 */
-	win_init( fd,
+	win_init(fd,
 		  node_hdrp->nh_firstsegoff,
 		  segsz,
-		  winmapmax );
+		  winmapmax);
 
 	/* announce the results
 	 */
-	mlog( MLOG_DEBUG | MLOG_TREE,
+	mlog(MLOG_DEBUG | MLOG_TREE,
 	      "node_init:"
 	      " vmsz = %llu (0x%llx)"
 	      " segsz = %llu (0x%llx)"
@@ -389,32 +389,32 @@
 	      vmsz, vmsz,
 	      segsz, segsz,
 	      nodesperseg, nodesperseg,
-	      winmapmax, winmapmax );
+	      winmapmax, winmapmax);
 
 	return BOOL_TRUE;
 }
 
 bool_t
-node_sync( int fd, off64_t off )
+node_sync(int fd, off64_t off)
 {
 	/* sanity checks
 	 */
-	assert( sizeof( node_hdr_t ) <= NODE_HDRSZ );
+	assert(sizeof(node_hdr_t) <= NODE_HDRSZ);
 
 	/* map the abstraction header
 	 */
-	assert( ( NODE_HDRSZ & pgmask ) == 0 );
-	assert( off <= ( off64_t )OFF64MAX );
-	assert( ! ( off % ( off64_t )pgsz ));
-	node_hdrp = ( node_hdr_t * )mmap_autogrow(
+	assert((NODE_HDRSZ & pgmask) == 0);
+	assert(off <= (off64_t)OFF64MAX);
+	assert(! (off % (off64_t)pgsz));
+	node_hdrp = (node_hdr_t *)mmap_autogrow(
 					    NODE_HDRSZ,
 					    fd,
-					    off );
-	if ( node_hdrp == (node_hdr_t *)-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+					    off);
+	if (node_hdrp == (node_hdr_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map node hdr of size %d: %s\n"),
 		      NODE_HDRSZ,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -424,16 +424,16 @@
 
 	/* initialize the window abstraction
 	 */
-	win_init( fd,
+	win_init(fd,
 		  node_hdrp->nh_firstsegoff,
 		  node_hdrp->nh_segsz,
-		  node_hdrp->nh_winmapmax );
+		  node_hdrp->nh_winmapmax);
 
 	return BOOL_TRUE;
 }
 
 nh_t
-node_alloc( void )
+node_alloc(void)
 {
 	u_char_t *p;
 	nh_t nh;
@@ -447,56 +447,56 @@
 	 * otherwise get the next one from the current virgin segment,
 	 * or allocate a new virgin segment if the current one is depleted.
 	 */
-	if ( node_hdrp->nh_freenh != NH_NULL ) {
+	if (node_hdrp->nh_freenh != NH_NULL) {
 		nh_t *linkagep;
 
 		nh = node_hdrp->nh_freenh;
 
-		node_map_internal( nh, ( void ** )&p );
+		node_map_internal(nh, (void **)&p);
 		if (p == NULL)
 			return NH_NULL;
 #ifdef NODECHK
 		hkpp = p + node_hdrp->nh_nodehkix;
-		gen = ( u_char_t )( HKPGETGEN( *p ) + ( u_char_t )1 );
-		unq = HKPGETUNQ( *hkpp );
-		assert( unq != NODEUNQALCD );
-		assert( unq == NODEUNQFREE );
+		gen = (u_char_t)(HKPGETGEN(*p) + (u_char_t)1);
+		unq = HKPGETUNQ(*hkpp);
+		assert(unq != NODEUNQALCD);
+		assert(unq == NODEUNQFREE);
 #endif /* NODECHK */
 
 		/* adjust the free list */
-		linkagep = ( nh_t * )p;
+		linkagep = (nh_t *)p;
 		node_hdrp->nh_freenh = *linkagep;
 
-		node_unmap_internal( nh, ( void ** )&p, BOOL_TRUE );
+		node_unmap_internal(nh, (void **)&p, BOOL_TRUE);
 
 	} else {
-		if ( nh2relnix( node_hdrp->nh_virgnh ) == 0 ) {
+		if (nh2relnix(node_hdrp->nh_virgnh) == 0) {
 			/* need to start a new virgin segment */
 			int rval;
 			off64_t new_seg_off =
 				node_hdrp->nh_firstsegoff +
-				( off64_t )nh2segix( node_hdrp->nh_virgnh ) *
-				( off64_t )node_hdrp->nh_segsz;
+				(off64_t)nh2segix(node_hdrp->nh_virgnh) *
+				(off64_t)node_hdrp->nh_segsz;
 
-			assert( new_seg_off
+			assert(new_seg_off
 				<=
-				OFF64MAX - ( off64_t )node_hdrp->nh_segsz );
-			mlog( MLOG_DEBUG,
+				OFF64MAX - (off64_t)node_hdrp->nh_segsz);
+			mlog(MLOG_DEBUG,
 			      "pre-growing new node array segment at %lld "
 			      "size %lld\n",
 			      new_seg_off,
-			      ( off64_t )node_hdrp->nh_segsz );
-			rval = ftruncate64( node_fd,
+			      (off64_t)node_hdrp->nh_segsz);
+			rval = ftruncate64(node_fd,
 					    new_seg_off
 					    +
-					    ( off64_t )node_hdrp->nh_segsz );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+					    (off64_t)node_hdrp->nh_segsz);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 				      "unable to autogrow node segment %u: "
 				      "%s (%d)\n"),
-				      nh2segix( node_hdrp->nh_virgnh ),
-				      strerror( errno ),
-				      errno );
+				      nh2segix(node_hdrp->nh_virgnh),
+				      strerror(errno),
+				      errno);
 			}
 		}
 
@@ -505,28 +505,28 @@
 
 	/* build a handle for node
 	 */
-	if ( nh > NH_MAX ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (nh > NH_MAX) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		  "dump contains too many dirents, "
 		  "restore can only handle %llu\n"),
-		  NH_MAX );
+		  NH_MAX);
 		return NH_NULL;
 	}
 #ifdef NODECHK
-	node_map_internal( nh , ( void ** )&p );
+	node_map_internal(nh , (void **)&p);
 	if (p == NULL)
 		abort();
-	hkpp = p + ( int )node_hdrp->nh_nodehkix;
-	nh = HDLMKHDL( gen, nh );
-	*hkpp = HKPMKHKP( gen, NODEUNQALCD );
-	node_unmap_internal( nh, ( void ** )&p, BOOL_FALSE );
+	hkpp = p + (int)node_hdrp->nh_nodehkix;
+	nh = HDLMKHDL(gen, nh);
+	*hkpp = HKPMKHKP(gen, NODEUNQALCD);
+	node_unmap_internal(nh, (void **)&p, BOOL_FALSE);
 #endif /* NODECHK */
 
 	return nh;
 }
 
 void *
-node_map( nh_t nh )
+node_map(nh_t nh)
 {
 	u_char_t *p;
 #ifdef NODECHK
@@ -536,44 +536,44 @@
 	register u_char_t nodeunq;
 #endif /* NODECHK */
 
-	assert( nh != NH_NULL );
+	assert(nh != NH_NULL);
 
 	/* convert the handle into an index
 	 */
 #ifdef NODECHK
-	hdlgen = HDLGETGEN( nh );
-	nh = HDLGETNHDL( nh );
+	hdlgen = HDLGETGEN(nh);
+	nh = HDLGETNHDL(nh);
 #endif /* NODECHK */
 
-	assert( nh <= NH_MAX );
+	assert(nh <= NH_MAX);
 
 	/* map in
 	 */
 	p = 0; /* keep lint happy */
-	node_map_internal( nh, ( void ** )&p );
+	node_map_internal(nh, (void **)&p);
 	if (p == NULL)
 	    return NULL;
 
 #ifdef NODECHK
-	hkp = *( p + node_hdrp->nh_nodehkix );
-	nodegen = HKPGETGEN( hkp );
-	nodeunq = HKPGETUNQ( hkp );
-	assert( nodegen == hdlgen );
-	assert( nodeunq != NODEUNQFREE );
-	assert( nodeunq == NODEUNQALCD );
+	hkp = *(p + node_hdrp->nh_nodehkix);
+	nodegen = HKPGETGEN(hkp);
+	nodeunq = HKPGETUNQ(hkp);
+	assert(nodegen == hdlgen);
+	assert(nodeunq != NODEUNQFREE);
+	assert(nodeunq == NODEUNQALCD);
 #endif /* NODECHK */
 
-	return ( void * )p;
+	return (void *)p;
 }
 
 void
-node_unmap( nh_t nh, void **pp )
+node_unmap(nh_t nh, void **pp)
 {
-	node_unmap_internal( nh, pp, BOOL_FALSE );
+	node_unmap_internal(nh, pp, BOOL_FALSE);
 }
 
 void
-node_free( nh_t *nhp )
+node_free(nh_t *nhp)
 {
 	nh_t nh;
 	u_char_t *p;
@@ -585,22 +585,22 @@
 	register u_char_t nodeunq;
 #endif /* NODECHK */
 
-	assert( nhp );
+	assert(nhp);
 	nh = *nhp;
-	assert( nh != NH_NULL );
+	assert(nh != NH_NULL);
 
 	/* convert the handle into an index
 	 */
 #ifdef NODECHK
-	hdlgen = HDLGETGEN( nh );
-	nh = HDLGETNHDL( nh );
+	hdlgen = HDLGETGEN(nh);
+	nh = HDLGETNHDL(nh);
 #endif /* NODECHK */
 
-	assert( nh <= NH_MAX );
+	assert(nh <= NH_MAX);
 
 	/* map in
 	 */
-	p = ( u_char_t * )node_map( nh );
+	p = (u_char_t *)node_map(nh);
 	if (p == NULL){
 	    *nhp = NH_NULL;
 	    return;
@@ -610,23 +610,23 @@
 	/* fix up unique field
 	 */
 	hkpp = p + node_hdrp->nh_nodehkix;
-	nodegen = HKPGETGEN( *hkpp );
-	nodeunq = HKPGETUNQ( *hkpp );
-	assert( nodegen == hdlgen );
-	assert( nodeunq != NODEUNQFREE );
-	assert( nodeunq == NODEUNQALCD );
-	*hkpp = HKPMKHKP( nodegen, NODEUNQFREE );
+	nodegen = HKPGETGEN(*hkpp);
+	nodeunq = HKPGETUNQ(*hkpp);
+	assert(nodegen == hdlgen);
+	assert(nodeunq != NODEUNQFREE);
+	assert(nodeunq == NODEUNQALCD);
+	*hkpp = HKPMKHKP(nodegen, NODEUNQFREE);
 #endif /* NODECHK */
 
 	/* put node on free list
 	 */
-	linkagep = ( nh_t * )p;
+	linkagep = (nh_t *)p;
 	*linkagep = node_hdrp->nh_freenh;
 	node_hdrp->nh_freenh = nh;
 
 	/* map out
 	 */
-	node_unmap_internal( nh, ( void ** )&p, BOOL_TRUE );
+	node_unmap_internal(nh, (void **)&p, BOOL_TRUE);
 
 	/* invalidate caller's handle
 	 */
diff --git a/restore/node.h b/restore/node.h
index 25fdaad..5b5efda 100644
--- a/restore/node.h
+++ b/restore/node.h
@@ -29,7 +29,7 @@
 /* node_init - creates a new node abstraction.
  * user reserves one byte per node for use by the node abstraction
  */
-extern bool_t node_init( int fd,		/* backing store */
+extern bool_t node_init(int fd,		/* backing store */
 		         off64_t off,		/* offset into backing store */
 		         size_t nodesz,		/* node size */
 		         ix_t nodehkix,		/* my housekeeping byte */
@@ -39,26 +39,26 @@
 
 /* node_sync - syncs up with existing node abstraction persistent state
  */
-extern bool_t node_sync( int fd, off64_t off );
+extern bool_t node_sync(int fd, off64_t off);
 
 /* node_alloc - allocates a node, returning a handle.
  * returns NULL handle if no space left.
  */
-extern nh_t node_alloc( void );
+extern nh_t node_alloc(void);
 
 /* node_map - returns a pointer to the node identified by the node handle.
  * pointer remains valid until node_unmap called.
  */
-extern void *node_map( nh_t node_handle );
+extern void *node_map(nh_t node_handle);
 
 /* node_unmap - unmaps the node.
  * SIDE-EFFECT: sets *nodepp to 0.
  */
-extern void node_unmap( nh_t node_handle, void **nodepp );
+extern void node_unmap(nh_t node_handle, void **nodepp);
 
 /* node_free - frees a previously allocated node.
  * SIDE-EFFECT: sets *node_handlep to NODE_HANDLE_NULL.
  */
-extern void node_free( nh_t *node_handlep );
+extern void node_free(nh_t *node_handlep);
 
 #endif /* NODE_H */
diff --git a/restore/tree.c b/restore/tree.c
index bc948fc..3f3084e 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -127,9 +127,9 @@
 #define INTER_ARGMAX	10	/* max number of args to interactive cmds */
 struct inter {
 	size_t i_argc;
-	char *i_argv[ INTER_ARGMAX ];
+	char *i_argv[INTER_ARGMAX];
 	nh_t i_cwdh;
-	char i_name[ NAME_MAX + 1 ];
+	char i_name[NAME_MAX + 1];
 };
 
 typedef struct inter inter_t;
@@ -163,7 +163,7 @@
 	nh_t *t_hashp;
 		/* pointer to mapped hash array (private to hash abstraction)
 		 */
-	char t_namebuf[ NAME_MAX + 1 ];
+	char t_namebuf[NAME_MAX + 1];
 		/* to hold names temporarily retrieved from name registry
 		 */
 	inter_t t_inter;
@@ -196,14 +196,14 @@
 
 typedef struct node node_t;
 
-#define NF_REAL		( 1 << 0 )
+#define NF_REAL		(1 << 0)
 	/* set when the corresponding file/dir has been created in
 	 * the restore destination.
 	 */
-#define NF_SUBTREE	( 1 << 1 )
+#define NF_SUBTREE	(1 << 1)
 	/* marks nodes in the selected subtrees.
 	 */
-#define NF_REFED	( 1 << 2 )
+#define NF_REFED	(1 << 2)
 	/* indicates node is still referenced according to incremental/resumed
 	 * dump. used to detect dirents no longer used. prior to restoring
 	 * a dump session, this flag is cleared in all nodes. during the dirent
@@ -211,15 +211,15 @@
 	 * for referenced but undumped directories. NOTE: nodes in the
 	 * orphanage NEVER have this flag set.
 	 */
-#define NF_WRITTEN	( 1 << 3 )
+#define NF_WRITTEN	(1 << 3)
 	/* set as soon as a non-dir node restore is begun. allows
 	 * overwrite inhibit options to work with segmented files
 	 */
-#define NF_ISDIR	( 1 << 4 )
+#define NF_ISDIR	(1 << 4)
 	/* indicates this node is a directory. set when a directory is taken
 	 * from the dirdump.
 	 */
-#define NF_DUMPEDDIR	( 1 << 5 )
+#define NF_DUMPEDDIR	(1 << 5)
 	/* indicates this node is a directory present in the current dirdump.
 	 * at beginning of session, this flag is cleared in all nodes.
 	 * then as each directory dump is read from media, the flag
@@ -229,7 +229,7 @@
 	 * it exists, in which case if it is not dumped then all of its entries
 	 * are referenced as well.
 	 */
-#define NF_NEWORPH	( 1 << 6 )
+#define NF_NEWORPH	(1 << 6)
 	/* cleared from all nodes in the orphanage before a dump is applied.
 	 * set if a dir is seen in the dirdump but no node exists for it.
 	 * cleared if that dir is adopted subsequently during the dirdump.
@@ -261,64 +261,64 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
+extern void usage(void);
 extern size_t pgsz;
 extern size_t pgmask;
 extern bool_t restore_rootdir_permissions;
 
 /* forward declarations of locally defined static functions ******************/
 
-static nh_t Node_alloc( xfs_ino_t ino,
+static nh_t Node_alloc(xfs_ino_t ino,
 			gen_t gen,
 			nrh_t nrh,
 			dah_t dah,
-			size_t flags );
-static void Node_free( nh_t *nhp );
-static node_t * Node_map( nh_t nh );
-static void Node_unmap( nh_t nh, node_t **npp );
-static int Node2path_recurse( nh_t nh, char *buf,
-				   int bufsz, int level );
-static void adopt( nh_t parh, nh_t cldh, nrh_t nrh );
-static nrh_t disown( nh_t cldh );
-static void selsubtree( nh_t nh, bool_t sensepr );
-static void selsubtree_recurse_down( nh_t nh, bool_t sensepr );
-static nh_t link_hardh( xfs_ino_t ino, gen_t gen );
-static nh_t link_nexth( nh_t nh );
-static nh_t link_matchh( nh_t hardh, nh_t parh, char *name );
-static void link_in( nh_t nh );
-static void link_out( nh_t nh );
-static void link_headiter( bool_t ( * cbfp )( void *contextp, nh_t hardh ),
-			   void *contextp );
-static void link_iter_init( link_iter_context_t *link_iter_contextp,
-			    nh_t hardheadh );
-static nh_t link_iter_next( link_iter_context_t *link_iter_contextp );
-void link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh );
-static bool_t hash_init( size64_t vmsz,
+			size_t flags);
+static void Node_free(nh_t *nhp);
+static node_t * Node_map(nh_t nh);
+static void Node_unmap(nh_t nh, node_t **npp);
+static int Node2path_recurse(nh_t nh, char *buf,
+				   int bufsz, int level);
+static void adopt(nh_t parh, nh_t cldh, nrh_t nrh);
+static nrh_t disown(nh_t cldh);
+static void selsubtree(nh_t nh, bool_t sensepr);
+static void selsubtree_recurse_down(nh_t nh, bool_t sensepr);
+static nh_t link_hardh(xfs_ino_t ino, gen_t gen);
+static nh_t link_nexth(nh_t nh);
+static nh_t link_matchh(nh_t hardh, nh_t parh, char *name);
+static void link_in(nh_t nh);
+static void link_out(nh_t nh);
+static void link_headiter(bool_t (* cbfp)(void *contextp, nh_t hardh),
+			   void *contextp);
+static void link_iter_init(link_iter_context_t *link_iter_contextp,
+			    nh_t hardheadh);
+static nh_t link_iter_next(link_iter_context_t *link_iter_contextp);
+void link_iter_unlink(link_iter_context_t *link_iter_contextp, nh_t nh);
+static bool_t hash_init(size64_t vmsz,
 			 size64_t dircnt,
 			 size64_t nondircnt,
-			 char *perspath );
-static bool_t hash_sync( char *perspath );
+			 char *perspath);
+static bool_t hash_sync(char *perspath);
 static inline size_t hash_val(xfs_ino_t ino, size_t hashmask);
-static void hash_in( nh_t nh );
-static void hash_out( nh_t nh );
-static nh_t hash_find( xfs_ino_t ino, gen_t gen );
-static void hash_iter( bool_t ( * cbfp )( void *contextp, nh_t hashh ),
-		       void *contextp );
-static void setdirattr( dah_t dah, char *path );
-static bool_t tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
+static void hash_in(nh_t nh);
+static void hash_out(nh_t nh);
+static nh_t hash_find(xfs_ino_t ino, gen_t gen);
+static void hash_iter(bool_t (* cbfp)(void *contextp, nh_t hashh),
+		       void *contextp);
+static void setdirattr(dah_t dah, char *path);
+static bool_t tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			    dlog_pcbp_t pcb, void *pctxp,
 			    nh_t *namedhp, nh_t *parhp, nh_t *cldhp,
-			    xfs_ino_t *inop, bool_t *isdirprp, bool_t *isselpr );
-static bool_t Node2path( nh_t nh, char *path, char *errmsg );
-static bool_t tree_setattr_recurse( nh_t parh, char *path );
-static void tsi_cmd_pwd_recurse( void *ctxp,
+			    xfs_ino_t *inop, bool_t *isdirprp, bool_t *isselpr);
+static bool_t Node2path(nh_t nh, char *path, char *errmsg);
+static bool_t tree_setattr_recurse(nh_t parh, char *path);
+static void tsi_cmd_pwd_recurse(void *ctxp,
 				 dlog_pcbp_t pcb,
 				 void *pctxp,
-				 nh_t nh );
+				 nh_t nh);
 static int mkdir_r(char *path);
 #ifdef TREE_CHK
-static bool_t Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp );
-static bool_t tree_chk2( void );
+static bool_t Node_chk(nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp);
+static bool_t tree_chk2(void);
 #endif /* TREE_CHK */
 
 /* definition of locally defined global variables ****************************/
@@ -337,7 +337,7 @@
 
 /* ARGSUSED */
 bool_t
-tree_init( char *hkdir,
+tree_init(char *hkdir,
 	   char *dstdir,
 	   bool_t toconlypr,
 	   bool_t ownerpr,
@@ -351,7 +351,7 @@
 	   bool_t restoredmpr,
 	   bool_t dstdirisxfspr,
 	   uint32_t dumpformat,
-	   bool_t truncategenpr )
+	   bool_t truncategenpr)
 {
 	off64_t nodeoff;
 	char *perspath;
@@ -360,16 +360,16 @@
 
 	/* sanity checks
 	 */
-	assert( ! ( PERSSZ % pgsz ));
-	assert( sizeof( persp ) <= PERSSZ );
-	assert( sizeof( node_t ) <= NODESZ );
-	assert( ! persp );
-	assert( ! tranp );
+	assert(! (PERSSZ % pgsz));
+	assert(sizeof(persp) <= PERSSZ);
+	assert(sizeof(node_t) <= NODESZ);
+	assert(! persp);
+	assert(! tranp);
 
 	/* allocate transient state
 	 */
-	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	assert( tranp );
+	tranp = (tran_t *)calloc(1, sizeof(tran_t));
+	assert(tranp);
 
 	tranp->t_toconlypr = toconlypr;
 	tranp->t_hkdir = hkdir;
@@ -379,16 +379,16 @@
 	/* allocate a char string buffer to hold the abs. pathname
 	 * of the orphanage directory file. load it with the pathname.
 	 */
-	tranp->t_orphdir = open_pathalloc( tranp->t_dstdir,
+	tranp->t_orphdir = open_pathalloc(tranp->t_dstdir,
 					   orphname,
-					   0 );
+					   0);
 
 	/* determine if housekeeping dir is within the destination.
 	 * generate a relative path containing the difference,
 	 * else null. will not restore into there.
 	 */
-	if ( strcmp( dstdir, "." )) {
-		tranp->t_hksubtree = path_diff( hkdir, dstdir );
+	if (strcmp(dstdir, ".")) {
+		tranp->t_hksubtree = path_diff(hkdir, dstdir);
 	} else {
 		tranp->t_hksubtree = 0;
 	}
@@ -396,19 +396,19 @@
 	/* create an orphanage, if it already exists, complain.
 	 * not needed if just a table-of-contents restore.
 	 */
-	if ( ! tranp->t_toconlypr ) {
-		rval = mkdir( tranp->t_orphdir, S_IRWXU );
-		if ( rval ) {
-			if ( errno == EEXIST ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+	if (! tranp->t_toconlypr) {
+		rval = mkdir(tranp->t_orphdir, S_IRWXU);
+		if (rval) {
+			if (errno == EEXIST) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 				      "%s already exists: "
 				      "rm -rf prior to initating restore\n"),
-				      tranp->t_orphdir );
+				      tranp->t_orphdir);
 			} else {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 				      "unable to create %s: %s\n"),
 				      tranp->t_orphdir,
-				      strerror( errno ));
+				      strerror(errno));
 			}
 			return BOOL_FALSE;
 		}
@@ -416,42 +416,42 @@
 
 	/* build a full pathname to pers. state file
 	 */
-	perspath = open_pathalloc( tranp->t_hkdir, persname, 0 );
+	perspath = open_pathalloc(tranp->t_hkdir, persname, 0);
 
 	/* create the persistent state file
 	 */
-	( void )unlink( perspath );
-	tranp->t_persfd = open( perspath,
+	(void)unlink(perspath);
+	tranp->t_persfd = open(perspath,
 				O_RDWR | O_CREAT,
-				S_IRUSR | S_IWUSR );
-	if ( tranp->t_persfd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+				S_IRUSR | S_IWUSR);
+	if (tranp->t_persfd < 0) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "could not open %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* mmap the persistent state
 	 */
-	assert( ! ( PERSSZ % pgsz ));
-	persp = ( treepers_t * ) mmap_autogrow(
+	assert(! (PERSSZ % pgsz));
+	persp = (treepers_t *) mmap_autogrow(
 				     PERSSZ,
 				     tranp->t_persfd,
-				     ( off64_t )0 );
-	if ( persp == ( treepers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+				     (off64_t)0);
+	if (persp == (treepers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "unable to map %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* create the hash abstraction. it will map more of the
 	 * persistent state file.
 	 */
-	ok = hash_init( vmsz / HASHSZ_PERVM, dircnt, nondircnt, perspath );
-	if ( ! ok ) {
+	ok = hash_init(vmsz / HASHSZ_PERVM, dircnt, nondircnt, perspath);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
@@ -459,17 +459,17 @@
 	 * begin immediately after the hash abstraction. give it the remainder
 	 * of vm.
 	 */
-	assert( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
-	nodeoff = ( off64_t )PERSSZ + ( off64_t )persp->p_hashsz;
-	assert( vmsz > ( size64_t )nodeoff );
-	ok = node_init( tranp->t_persfd,
+	assert(persp->p_hashsz <= (size64_t)(OFF64MAX - (off64_t)PERSSZ));
+	nodeoff = (off64_t)PERSSZ + (off64_t)persp->p_hashsz;
+	assert(vmsz > (size64_t)nodeoff);
+	ok = node_init(tranp->t_persfd,
 		        nodeoff,
 		        NODESZ,
-			 ( ix_t )offsetofmember( node_t, n_nodehkbyte ),
-		        sizeof( size64_t ), /* node alignment */
-		        vmsz - ( size64_t )nodeoff,
-			dircnt + nondircnt );
-	if ( ! ok ) {
+			 (ix_t)offsetofmember(node_t, n_nodehkbyte),
+		        sizeof(size64_t), /* node alignment */
+		        vmsz - (size64_t)nodeoff,
+			dircnt + nondircnt);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
@@ -482,23 +482,23 @@
 	 * has a generation count of zero - which is true.
 	 */
 	persp->p_rootino = rootino;
-	persp->p_rooth = Node_alloc( rootino,
+	persp->p_rooth = Node_alloc(rootino,
 				     0, /* gen cnt */
 				     NRH_NULL,
 				     DAH_NULL,
-				     NF_ISDIR | NF_REAL );
+				     NF_ISDIR | NF_REAL);
 	if (persp->p_rooth == NH_NULL)
 		return BOOL_FALSE;
-	link_in( persp->p_rooth );
-	persp->p_orphh = Node_alloc( orphino,
+	link_in(persp->p_rooth);
+	persp->p_orphh = Node_alloc(orphino,
 				     0, /* gen cnt */
-				     namreg_add( orphname, strlen( orphname )),
+				     namreg_add(orphname, strlen(orphname)),
 				     DAH_NULL,
-				     NF_ISDIR | NF_REAL );
+				     NF_ISDIR | NF_REAL);
 	if (persp->p_orphh == NH_NULL)
 		return BOOL_FALSE;
-	link_in( persp->p_orphh );
-	adopt( persp->p_rooth, persp->p_orphh, NRH_NULL );
+	link_in(persp->p_orphh);
+	adopt(persp->p_rooth, persp->p_orphh, NRH_NULL);
 
 	/* record if we should attempt to restore original owner/group
 	 */
@@ -514,14 +514,14 @@
 
 	/* record if truncated generation numbers are required
 	 */
-	if ( dumpformat < GLOBAL_HDR_VERSION_3 ) {
+	if (dumpformat < GLOBAL_HDR_VERSION_3) {
 		persp->p_truncategenpr = BOOL_TRUE;
-		mlog( MLOG_NORMAL | MLOG_DEBUG | MLOG_TREE, _(
+		mlog(MLOG_NORMAL | MLOG_DEBUG | MLOG_TREE, _(
 		      "dump format version %u used truncated inode generation numbers\n"),
-			dumpformat );
-	} else if ( truncategenpr ) {
+			dumpformat);
+	} else if (truncategenpr) {
 		persp->p_truncategenpr = BOOL_TRUE;
-		mlog( MLOG_NORMAL | MLOG_DEBUG | MLOG_TREE, _(
+		mlog(MLOG_NORMAL | MLOG_DEBUG | MLOG_TREE, _(
 		      "forcing use of truncated inode generation numbers\n"));
 	} else {
 		persp->p_truncategenpr = BOOL_FALSE;
@@ -531,33 +531,33 @@
 }
 
 bool_t
-tree_sync( char *hkdir,
+tree_sync(char *hkdir,
 	   char *dstdir,
 	   bool_t toconlypr,
 	   bool_t fullpr,
-	   bool_t dstdirisxfspr )
+	   bool_t dstdirisxfspr)
 {
 	off64_t nodeoff;
 	char *perspath;
 	bool_t ok;
 	int rval;
 
-	if ( persp ) {
+	if (persp) {
 		return BOOL_TRUE;
 	}
 
 	/* sanity checks
 	 */
-	assert( ! ( PERSSZ % pgsz ));
-	assert( sizeof( persp ) <= PERSSZ );
-	assert( sizeof( node_t ) <= NODESZ );
-	assert( ! persp );
-	assert( ! tranp );
+	assert(! (PERSSZ % pgsz));
+	assert(sizeof(persp) <= PERSSZ);
+	assert(sizeof(node_t) <= NODESZ);
+	assert(! persp);
+	assert(! tranp);
 
 	/* allocate transient state
 	 */
-	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	assert( tranp );
+	tranp = (tran_t *)calloc(1, sizeof(tran_t));
+	assert(tranp);
 
 	tranp->t_toconlypr = toconlypr;
 	tranp->t_hkdir = hkdir;
@@ -567,58 +567,58 @@
 	/* allocate a char string buffer to hold the abs. pathname
 	 * of the orphanage directory file. load it with the pathname.
 	 */
-	tranp->t_orphdir = open_pathalloc( tranp->t_dstdir,
+	tranp->t_orphdir = open_pathalloc(tranp->t_dstdir,
 					   orphname,
-					   0 );
+					   0);
 
 	/* determine if housekeeping dir is within the destination.
 	 * generate a relative path containing the difference,
 	 * else null. will not restore into there.
 	 */
-	if ( strcmp( dstdir, "." )) {
-		tranp->t_hksubtree = path_diff( hkdir, dstdir );
+	if (strcmp(dstdir, ".")) {
+		tranp->t_hksubtree = path_diff(hkdir, dstdir);
 	} else {
 		tranp->t_hksubtree = 0;
 	}
 
 	/* re-create the orphanage (in case someone rmdir'ed it)
 	 */
-	rval = mkdir( tranp->t_orphdir, S_IRWXU );
-	if ( rval && errno != EEXIST ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+	rval = mkdir(tranp->t_orphdir, S_IRWXU);
+	if (rval && errno != EEXIST) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "unable to recreate %s: %s\n"),
 		      tranp->t_orphdir,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* build a full pathname to pers. state file
 	 */
-	perspath = open_pathalloc( tranp->t_hkdir, persname, 0 );
+	perspath = open_pathalloc(tranp->t_hkdir, persname, 0);
 
 	/* re-open the persistent state file
 	 */
-	tranp->t_persfd = open( perspath, O_RDWR );
-	if ( tranp->t_persfd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+	tranp->t_persfd = open(perspath, O_RDWR);
+	if (tranp->t_persfd < 0) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "could not open %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* mmap the persistent state
 	 */
-	assert( ! ( PERSSZ % pgsz ));
-	persp = ( treepers_t * ) mmap_autogrow(
+	assert(! (PERSSZ % pgsz));
+	persp = (treepers_t *) mmap_autogrow(
 				     PERSSZ,
 				     tranp->t_persfd,
-				     ( off64_t )0 );
-	if ( persp == ( treepers_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+				     (off64_t)0);
+	if (persp == (treepers_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "unable to map %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -630,26 +630,26 @@
 	/* regardless of the format of this dump, if the previously applied
 	 * dump used truncated generation numbers, then we need to as well.
 	 */
-	if ( persp->p_truncategenpr ) {
-		mlog( MLOG_NORMAL | MLOG_DEBUG | MLOG_TREE, _(
+	if (persp->p_truncategenpr) {
+		mlog(MLOG_NORMAL | MLOG_DEBUG | MLOG_TREE, _(
 		      "using truncated inode generation numbers for "
-		      "compatibility with previously applied restore\n") );
+		      "compatibility with previously applied restore\n"));
 	}
 
 	/* rsynchronize with the hash abstraction. it will map more of the
 	 * persistent state file.
 	 */
-	ok = hash_sync( perspath );
-	if ( ! ok ) {
+	ok = hash_sync(perspath);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
 	/* synchronize with the node abstraction.
 	 */
-	assert( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
-	nodeoff = ( off64_t )PERSSZ + ( off64_t )persp->p_hashsz;
-	ok = node_sync( tranp->t_persfd, nodeoff );
-	if ( ! ok ) {
+	assert(persp->p_hashsz <= (size64_t)(OFF64MAX - (off64_t)PERSSZ));
+	nodeoff = (off64_t)PERSSZ + (off64_t)persp->p_hashsz;
+	ok = node_sync(tranp->t_persfd, nodeoff);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
@@ -662,17 +662,17 @@
 }
 
 bool_t
-tree_check_dump_format( uint32_t dumpformat )
+tree_check_dump_format(uint32_t dumpformat)
 {
-	if ( dumpformat < GLOBAL_HDR_VERSION_3 && !persp->p_truncategenpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+	if (dumpformat < GLOBAL_HDR_VERSION_3 && !persp->p_truncategenpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "encountered dump format %d after a "
 		      "restore of format %d or newer\n"),
-			dumpformat, GLOBAL_HDR_VERSION_3 );
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+			dumpformat, GLOBAL_HDR_VERSION_3);
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "to restore this series of dumps, use the -%c "
 		      "option on the first restore\n"),
-			GETOPT_FMT2COMPAT );
+			GETOPT_FMT2COMPAT);
 		return BOOL_FALSE;
 	}
 
@@ -685,142 +685,142 @@
  * referenced during ref adj. also null dirattr handles, since they are
  * not retained across dump session restores.
  */
-static void tree_marknoref_recurse( nh_t parh );
+static void tree_marknoref_recurse(nh_t parh);
 
 void
-tree_marknoref( void )
+tree_marknoref(void)
 {
-	tree_marknoref_recurse( persp->p_rooth );
+	tree_marknoref_recurse(persp->p_rooth);
 
 	{
 		node_t *orphp;
-		orphp = Node_map( persp->p_orphh );
-		orphp->n_flags |= ( NF_REFED | NF_DUMPEDDIR );
-		assert( orphp->n_dah == DAH_NULL );
-		Node_unmap( persp->p_orphh, &orphp );
+		orphp = Node_map(persp->p_orphh);
+		orphp->n_flags |= (NF_REFED | NF_DUMPEDDIR);
+		assert(orphp->n_dah == DAH_NULL);
+		Node_unmap(persp->p_orphh, &orphp);
 	}
 }
 
 static void
-tree_marknoref_recurse( nh_t parh )
+tree_marknoref_recurse(nh_t parh)
 {
 	nh_t cldh;
 
 	{
 		node_t *parp;
-		parp = Node_map( parh );
-		parp->n_flags &= ~( NF_REFED | NF_DUMPEDDIR | NF_NEWORPH );
+		parp = Node_map(parh);
+		parp->n_flags &= ~(NF_REFED | NF_DUMPEDDIR | NF_NEWORPH);
 
 		parp->n_dah = DAH_NULL;
 		cldh = parp->n_cldh;
-		Node_unmap( parh, &parp  );
+		Node_unmap(parh, &parp);
 	}
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		nh_t nextcldh;
-		tree_marknoref_recurse( cldh ); /* RECURSION */
-		cldp = Node_map( cldh );
+		tree_marknoref_recurse(cldh); /* RECURSION */
+		cldp = Node_map(cldh);
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp  );
+		Node_unmap(cldh, &cldp);
 		cldh = nextcldh;
 	}
 }
 
 void
-tree_markallsubtree( bool_t sensepr )
+tree_markallsubtree(bool_t sensepr)
 {
-	if ( ! sensepr ) {
+	if (! sensepr) {
 		persp->p_ignoreorphpr = BOOL_TRUE;
 	}
-	selsubtree( persp->p_rooth, sensepr );
+	selsubtree(persp->p_rooth, sensepr);
 }
 
 nh_t
-tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
+tree_begindir(filehdr_t *fhdrp, dah_t *dahp)
 {
 	nh_t hardh;
 	xfs_ino_t ino = fhdrp->fh_stat.bs_ino;
 	gen_t gen = fhdrp->fh_stat.bs_gen;
 	dah_t dah;
 
-	if ( persp->p_truncategenpr ) {
-		gen = BIGGEN2GEN( gen );
+	if (persp->p_truncategenpr) {
+		gen = BIGGEN2GEN(gen);
 	}
 
 	/* sanity check - orphino is supposed to be an unused ino!
 	 */
-	assert( ino != orphino );
+	assert(ino != orphino);
 
 	/* lookup head of hardlink list
 	 */
-	hardh = link_hardh( ino, gen );
-	assert( ino != persp->p_rootino || hardh == persp->p_rooth );
+	hardh = link_hardh(ino, gen);
+	assert(ino != persp->p_rootino || hardh == persp->p_rooth);
 
 	/* already present
 	 */
-	if ( hardh != NH_NULL ) {
+	if (hardh != NH_NULL) {
 		node_t *hardp;
-		hardp = Node_map( hardh );
-		if ( ! ( hardp->n_flags & NF_ISDIR )) {
+		hardp = Node_map(hardh);
+		if (! (hardp->n_flags & NF_ISDIR)) {
 			/* case 1: previously seen as dirent, now know is dir
 			 */
-			mlog( MLOG_TRACE | MLOG_TREE,
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "directory %llu %u (%u): "
 			      "upgrading to dir\n",
 			      ino,
 			      gen,
-			      fhdrp->fh_stat.bs_gen );
-			if ( ! tranp->t_toconlypr ) {
-				assert( hardp->n_dah == DAH_NULL );
-				hardp->n_dah = dirattr_add( fhdrp );
+			      fhdrp->fh_stat.bs_gen);
+			if (! tranp->t_toconlypr) {
+				assert(hardp->n_dah == DAH_NULL);
+				hardp->n_dah = dirattr_add(fhdrp);
 			}
-		} else if ( ! tranp->t_toconlypr && hardp->n_dah == DAH_NULL ) {
+		} else if (! tranp->t_toconlypr && hardp->n_dah == DAH_NULL) {
 			/* case 2: node is a dir, but had thrown away dirattr
 			 */
-			mlog( MLOG_TRACE | MLOG_TREE,
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "directory %llu %u (%u): "
 			      "updating\n",
 			      ino,
 			      gen,
-			      fhdrp->fh_stat.bs_gen );
-			hardp->n_dah = dirattr_add( fhdrp );
+			      fhdrp->fh_stat.bs_gen);
+			hardp->n_dah = dirattr_add(fhdrp);
 		} else {
 			/* case 3: already has dirattr; must be restart
 			 */
-			mlog( MLOG_TRACE | MLOG_TREE,
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "directory %llu %u (%u): "
 			      "retaining\n",
 			      ino,
 			      gen,
-			      fhdrp->fh_stat.bs_gen );
+			      fhdrp->fh_stat.bs_gen);
 		}
 		hardp->n_flags |= NF_ISDIR;
 		hardp->n_flags |= NF_DUMPEDDIR;
 		*dahp = hardp->n_dah;
-		Node_unmap( hardh, &hardp );
+		Node_unmap(hardh, &hardp);
 	} else {
 		/* case 4: first time seen
 		 */
-		mlog( MLOG_TRACE | MLOG_TREE,
+		mlog(MLOG_TRACE | MLOG_TREE,
 		      "directory %llu %u (%u): "
 		      "new\n",
 		      ino,
 		      gen,
-		      fhdrp->fh_stat.bs_gen );
-		if ( ! tranp->t_toconlypr ) {
-			dah = dirattr_add( fhdrp );
+		      fhdrp->fh_stat.bs_gen);
+		if (! tranp->t_toconlypr) {
+			dah = dirattr_add(fhdrp);
 		} else {
 			dah = DAH_NULL;
 		}
-		hardh = Node_alloc( ino,
+		hardh = Node_alloc(ino,
 				    gen,
 				    NRH_NULL,
 				    dah,
-				    NF_ISDIR | NF_NEWORPH );
+				    NF_ISDIR | NF_NEWORPH);
 		if (hardh == NH_NULL)
 			return NH_NULL;
-		link_in( hardh );
-		adopt( persp->p_orphh, hardh, NRH_NULL );
+		link_in(hardh);
+		adopt(persp->p_orphh, hardh, NRH_NULL);
 		*dahp = dah;
 	}
 
@@ -828,103 +828,103 @@
 }
 
 rv_t
-tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
+tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 {
 	nh_t hardh;
 
-	if ( persp->p_truncategenpr ) {
-		gen = BIGGEN2GEN( gen );
+	if (persp->p_truncategenpr) {
+		gen = BIGGEN2GEN(gen);
 	}
 
 	/* sanity check - orphino is supposed to be an unused ino!
 	 */
-	assert( ino != orphino );
+	assert(ino != orphino);
 
 	/* don't allow entries named "orphanage" under root to be added
 	 */
-	if ( parh == persp->p_rooth && !strcmp( name, orphname )) {
-		mlog( MLOG_DEBUG | MLOG_TREE,
+	if (parh == persp->p_rooth && !strcmp(name, orphname)) {
+		mlog(MLOG_DEBUG | MLOG_TREE,
 		      "dirent %s %llu %u: "
 		      "skipping (reserved)\n",
 		      name,
 		      ino,
-		      gen );
+		      gen);
 		return RV_OK;
 	}
 
 	/* if the parent is null, just ignore
 	 */
-	if ( parh == NH_NULL ) {
-		mlog( MLOG_DEBUG | MLOG_TREE,
+	if (parh == NH_NULL) {
+		mlog(MLOG_DEBUG | MLOG_TREE,
 		      "dirent %s %llu %u: "
 		      "skipping (null parent)\n",
 		      name,
 		      ino,
-		      gen );
+		      gen);
 		return RV_OK;
 	}
 
 	/* see if one or more links to this ino already exist.
 	 */
-	hardh = link_hardh( ino, gen );
+	hardh = link_hardh(ino, gen);
 
-	if ( hardh != NH_NULL ) {
+	if (hardh != NH_NULL) {
 		node_t *hardp;
-		hardp = Node_map( hardh );
-		if ( hardp->n_flags & NF_ISDIR ) {
+		hardp = Node_map(hardh);
+		if (hardp->n_flags & NF_ISDIR) {
 			nh_t renameh;
 			node_t *renamep;
 			/* REFERENCED */
 			int namebuflen;
 
 			hardp->n_flags |= NF_REFED;
-			if ( hardp->n_parh == persp->p_orphh ) {
+			if (hardp->n_parh == persp->p_orphh) {
 				/* dir now seen as entry
 				 * if in orph but REAL, must be pending rename
 				 */
-				if ( ( hardp->n_flags & NF_REAL )
+				if ((hardp->n_flags & NF_REAL)
 				     &&
-				     hardp->n_lnkh == NH_NULL ) {
-					hardp->n_lnkh = Node_alloc( ino,
+				     hardp->n_lnkh == NH_NULL) {
+					hardp->n_lnkh = Node_alloc(ino,
 								    gen,
 								    NRH_NULL,
 								    DAH_NULL,
-								    0 );
+								    0);
 					if (hardp->n_lnkh == NH_NULL)
 						return RV_ERROR;
 				}
-				if ( hardp->n_lnkh != NH_NULL ) {
-					assert( hardp->n_flags & NF_REAL );
+				if (hardp->n_lnkh != NH_NULL) {
+					assert(hardp->n_flags & NF_REAL);
 					renameh = hardp->n_lnkh;
-					renamep = Node_map( renameh );
-					if ( renamep->n_parh == NH_NULL ) {
-						mlog( MLOG_DEBUG | MLOG_TREE,
+					renamep = Node_map(renameh);
+					if (renamep->n_parh == NH_NULL) {
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "adopting (dir par)\n",
 						      name,
 						      ino,
-						      gen );
+						      gen);
 						renamep->n_parh = parh;
 					}
-					if ( renamep->n_parh != parh ) {
-						mlog( MLOG_DEBUG | MLOG_TREE,
+					if (renamep->n_parh != parh) {
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "re-adopting (dir par)\n",
 						      name,
 						      ino,
-						      gen );
+						      gen);
 						renamep->n_parh = parh;
 					}
-					if ( renamep->n_nrh != NRH_NULL ) {
+					if (renamep->n_nrh != NRH_NULL) {
 						namebuflen
 						=
-						namreg_get( renamep->n_nrh,
+						namreg_get(renamep->n_nrh,
 							    tranp->t_namebuf,
-						    sizeof( tranp->t_namebuf ));
-						assert( namebuflen > 0 );
-						if ( strcmp( name,
-							   tranp->t_namebuf )) {
-							mlog( MLOG_DEBUG
+						    sizeof(tranp->t_namebuf));
+						assert(namebuflen > 0);
+						if (strcmp(name,
+							   tranp->t_namebuf)) {
+							mlog(MLOG_DEBUG
 							      |
 							      MLOG_TREE,
 							      "dirent %s "
@@ -935,200 +935,200 @@
 							      name,
 							      ino,
 							      gen,
-							     tranp->t_namebuf );
+							     tranp->t_namebuf);
 							namreg_del(
-							       renamep->n_nrh );
+							       renamep->n_nrh);
 							renamep->n_nrh =
 								       NRH_NULL;
 						}
 					}
-					if ( renamep->n_nrh == NRH_NULL ) {
+					if (renamep->n_nrh == NRH_NULL) {
 						renamep->n_nrh
 						=
-						namreg_add( name, namelen );
+						namreg_add(name, namelen);
 						renamep->n_parh = parh;
 					}
-					Node_unmap( renameh, &renamep );
+					Node_unmap(renameh, &renamep);
 				} else {
 					nrh_t nrh;
 
 					hardp->n_flags &= ~NF_NEWORPH;
-					assert( hardp->n_nrh == NRH_NULL );
-					assert( hardp->n_parh != NH_NULL );
-					nrh = disown( hardh );
-					assert( nrh == NRH_NULL );
-					nrh = namreg_add( name, namelen );
-					adopt( parh, hardh, nrh );
-					mlog( MLOG_DEBUG | MLOG_TREE,
+					assert(hardp->n_nrh == NRH_NULL);
+					assert(hardp->n_parh != NH_NULL);
+					nrh = disown(hardh);
+					assert(nrh == NRH_NULL);
+					nrh = namreg_add(name, namelen);
+					adopt(parh, hardh, nrh);
+					mlog(MLOG_DEBUG | MLOG_TREE,
 					      "dirent %s %llu %u: "
 					      "updating (dir)\n",
 					      name,
 					      ino,
-					      gen );
+					      gen);
 				}
 			} else {
-				assert( hardp->n_nrh != NRH_NULL );
+				assert(hardp->n_nrh != NRH_NULL);
 				namebuflen
 				=
-				namreg_get( hardp->n_nrh,
+				namreg_get(hardp->n_nrh,
 					    tranp->t_namebuf,
-					    sizeof( tranp->t_namebuf ));
-				assert( namebuflen > 0 );
-				if ( hardp->n_parh == parh
+					    sizeof(tranp->t_namebuf));
+				assert(namebuflen > 0);
+				if (hardp->n_parh == parh
 				     &&
-				     ! strcmp( tranp->t_namebuf, name )) {
+				     ! strcmp(tranp->t_namebuf, name)) {
 					/* dir seen as entry again
 					 */
-					if ( hardp->n_lnkh != NH_NULL ) {
+					if (hardp->n_lnkh != NH_NULL) {
 						/* rescind rename
 						 */
-						mlog( MLOG_DEBUG | MLOG_TREE,
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "rescind rename (dir)\n",
 						      name,
 						      ino,
-						      gen );
-						Node_free( &hardp->n_lnkh );
+						      gen);
+						Node_free(&hardp->n_lnkh);
 					} else {
-						mlog( MLOG_DEBUG | MLOG_TREE,
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "retaining (dir)\n",
 						      name,
 						      ino,
-						      gen );
+						      gen);
 					}
 				} else {
 					/* dir rename
 					 */
 					nh_t renameh;
 					node_t *renamep;
-					if ( hardp->n_lnkh == NH_NULL ) {
-						renameh = Node_alloc( ino,
+					if (hardp->n_lnkh == NH_NULL) {
+						renameh = Node_alloc(ino,
 								      gen,
 								      NRH_NULL,
 								      DAH_NULL,
-								      0 );
+								      0);
 						if (renameh == NH_NULL)
 							return RV_ERROR;
 						hardp->n_lnkh = renameh;
 					} else {
-						mlog( MLOG_DEBUG | MLOG_TREE,
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "re-renaming\n",
 						      name,
 						      ino,
-						      gen );
+						      gen);
 						renameh = hardp->n_lnkh;
-						renamep = Node_map( renameh );
+						renamep = Node_map(renameh);
 						renamep->n_parh = NH_NULL;
-						if ( renamep->n_nrh
+						if (renamep->n_nrh
 						     !=
-						     NRH_NULL ) {
-						   namreg_del( renamep->n_nrh );
+						     NRH_NULL) {
+						   namreg_del(renamep->n_nrh);
 						}
 						renamep->n_nrh = NRH_NULL;
-						Node_unmap( renameh, &renamep );
+						Node_unmap(renameh, &renamep);
 					}
-					renamep = Node_map( renameh );
-					assert( hardp->n_parh != NH_NULL );
-					if ( hardp->n_parh != parh ) {
+					renamep = Node_map(renameh);
+					assert(hardp->n_parh != NH_NULL);
+					if (hardp->n_parh != parh) {
 						/* different parent
 						 */
 						renamep->n_parh = parh;
-						mlog( MLOG_DEBUG | MLOG_TREE,
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "renaming (parent)\n",
 						      name,
 						      ino,
-						      gen );
+						      gen);
 					}
-					if ( strcmp( tranp->t_namebuf, name )) {
+					if (strcmp(tranp->t_namebuf, name)) {
 						/* different name
 						 */
 						renamep->n_nrh =
-						    namreg_add( name, namelen );
-						mlog( MLOG_DEBUG | MLOG_TREE,
+						    namreg_add(name, namelen);
+						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
 						      "renaming (name)\n",
 						      name,
 						      ino,
-						      gen );
+						      gen);
 					}
-					Node_unmap( renameh, &renamep );
+					Node_unmap(renameh, &renamep);
 				}
 			}
 		} else {
 			nh_t matchh;
-			matchh = link_matchh( hardh, parh, name );
-			if ( matchh != NH_NULL ) {
+			matchh = link_matchh(hardh, parh, name);
+			if (matchh != NH_NULL) {
 				/* entry already exists
 				 */
 				node_t *matchp;
-				matchp = Node_map( matchh );
+				matchp = Node_map(matchh);
 				matchp->n_flags |= NF_REFED;
-				Node_unmap( matchh, &matchp );
-				mlog( MLOG_DEBUG | MLOG_TREE,
+				Node_unmap(matchh, &matchp);
+				mlog(MLOG_DEBUG | MLOG_TREE,
 				      "dirent %s %llu %u: "
 				      "retaining (nondir)\n",
 				      name,
 				      ino,
-				      gen );
+				      gen);
 			} else {
 				/* case 5: new hard link
 				 */
 				nrh_t nrh;
 				nh_t linkh;
-				nrh = namreg_add( name, namelen );
-				linkh = Node_alloc( ino,
+				nrh = namreg_add(name, namelen);
+				linkh = Node_alloc(ino,
 						    gen,
 						    NRH_NULL,
 						    DAH_NULL,
-						    NF_REFED );
+						    NF_REFED);
 				if (linkh == NH_NULL)
 					return RV_ERROR;
-				link_in( linkh );
-				adopt( parh, linkh, nrh );
-				mlog( MLOG_DEBUG | MLOG_TREE,
+				link_in(linkh);
+				adopt(parh, linkh, nrh);
+				mlog(MLOG_DEBUG | MLOG_TREE,
 				      "dirent %s %llu %u: "
 				      "adding (link)\n",
 				      name,
 				      ino,
-				      gen );
+				      gen);
 			}
 		}
-		Node_unmap( hardh, &hardp );
+		Node_unmap(hardh, &hardp);
 	} else {
 		/* case 6: new entry
 		 */
 		nrh_t nrh;
-		nrh = namreg_add( name, namelen );
-		hardh = Node_alloc( ino,
+		nrh = namreg_add(name, namelen);
+		hardh = Node_alloc(ino,
 				    gen,
 				    NRH_NULL,
 				    DAH_NULL,
-				    NF_REFED );
+				    NF_REFED);
 		if (hardh == NH_NULL)
 			return RV_ERROR;
-		link_in( hardh );
-		adopt( parh, hardh, nrh );
-		mlog( MLOG_DEBUG | MLOG_TREE,
+		link_in(hardh);
+		adopt(parh, hardh, nrh);
+		mlog(MLOG_DEBUG | MLOG_TREE,
 		      "dirent %s %llu %u: "
 		      "adding (new)\n",
 		      name,
 		      ino,
-		      gen );
+		      gen);
 	}
 	return RV_OK;
 }
 
 /* ARGSUSED */
 void
-tree_enddir( nh_t dirh )
+tree_enddir(nh_t dirh)
 {
 }
 
 bool_t
-tree_subtree_parse( bool_t sensepr, char *path )
+tree_subtree_parse(bool_t sensepr, char *path)
 {
 	nh_t namedh;
 	nh_t parh;
@@ -1140,7 +1140,7 @@
 
 	/* walk the tree down this relative pathname from the root.
 	 */
-	ok = tsi_walkpath( path,
+	ok = tsi_walkpath(path,
 			   NH_NULL,
 			   persp->p_rooth,
 			   0,
@@ -1150,15 +1150,15 @@
 			   &cldh,
 			   &ino,
 			   &isdirpr,
-			   &isselpr );
-	if ( ! ok ) {
+			   &isselpr);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
 	/* set or clear flag in this node and all of its children,
 	 * and ajust parentage flags.
 	 */
-	selsubtree( namedh, sensepr );
+	selsubtree(namedh, sensepr);
 
 	return BOOL_TRUE;
 }
@@ -1173,25 +1173,25 @@
  * somewhere else in the tree. next, make new directories. then rename
  * directories. finally, create hardlinks from orphanage.
  */
-static bool_t noref_elim_recurse( nh_t parh,
+static bool_t noref_elim_recurse(nh_t parh,
 				  nh_t cldh,
 				  bool_t parrefpr,
 				  char *path1,
-				  char *path2 );
+				  char *path2);
 
-static bool_t mkdirs_recurse( nh_t parh,
+static bool_t mkdirs_recurse(nh_t parh,
 			      nh_t cldh,
-			      char *path );
+			      char *path);
 
-static bool_t rename_dirs( nh_t cldh,
+static bool_t rename_dirs(nh_t cldh,
 			   char *path1,
-			   char *path2 );
+			   char *path2);
 
-static bool_t proc_hardlinks( char *path1,
-			      char *path2 );
+static bool_t proc_hardlinks(char *path1,
+			      char *path2);
 
 bool_t
-tree_post( char *path1, char *path2 )
+tree_post(char *path1, char *path2)
 {
 	node_t *rootp;
 	node_t *orphp;
@@ -1200,63 +1200,63 @@
 
 	/* eliminate unreferenced dirents
 	 */
-	if ( ! persp->p_fullpr ) {
-		mlog( MLOG_DEBUG | MLOG_TREE,
-		      "eliminating unreferenced directory entries\n" );
-		rootp = Node_map( persp->p_rooth );
+	if (! persp->p_fullpr) {
+		mlog(MLOG_DEBUG | MLOG_TREE,
+		      "eliminating unreferenced directory entries\n");
+		rootp = Node_map(persp->p_rooth);
 		cldh = rootp->n_cldh;
-		Node_unmap( persp->p_rooth, &rootp );
-		ok = noref_elim_recurse( persp->p_rooth,
+		Node_unmap(persp->p_rooth, &rootp);
+		ok = noref_elim_recurse(persp->p_rooth,
 					 cldh,
 					 BOOL_TRUE,
 					 path1,
-					 path2 );
-		if ( ! ok ) {
+					 path2);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
 
 	/* make new directories
 	 */
-	mlog( MLOG_DEBUG | MLOG_TREE,
-	      "making new directories\n" );
-	rootp = Node_map( persp->p_rooth );
+	mlog(MLOG_DEBUG | MLOG_TREE,
+	      "making new directories\n");
+	rootp = Node_map(persp->p_rooth);
 	cldh = rootp->n_cldh;
-	Node_unmap( persp->p_rooth, &rootp );
-	ok = mkdirs_recurse( persp->p_rooth, cldh, path1 );
-	if ( ! ok ) {
+	Node_unmap(persp->p_rooth, &rootp);
+	ok = mkdirs_recurse(persp->p_rooth, cldh, path1);
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
 #ifdef TREE_CHK
-	assert( tree_chk( ));
+	assert(tree_chk());
 #endif /* TREE_CHK */
 
 	/* rename directories
 	 */
-	if ( ! persp->p_fullpr ) {
-		mlog( MLOG_DEBUG | MLOG_TREE,
-		      "performing directory renames\n" );
-		orphp = Node_map( persp->p_orphh );
+	if (! persp->p_fullpr) {
+		mlog(MLOG_DEBUG | MLOG_TREE,
+		      "performing directory renames\n");
+		orphp = Node_map(persp->p_orphh);
 		cldh = orphp->n_cldh;
-		Node_unmap( persp->p_orphh, &orphp );
-		ok = rename_dirs( cldh, path1, path2 );
-		if ( ! ok ) {
+		Node_unmap(persp->p_orphh, &orphp);
+		ok = rename_dirs(cldh, path1, path2);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
 
 #ifdef TREE_CHK
-	assert( tree_chk( ));
+	assert(tree_chk());
 #endif /* TREE_CHK */
 
 	/* process hard links
 	 */
-	if ( ! persp->p_fullpr ) {
-		mlog( MLOG_DEBUG | MLOG_TREE,
-		      "processing hard links\n" );
-		ok = proc_hardlinks( path1, path2 );
-		if ( ! ok ) {
+	if (! persp->p_fullpr) {
+		mlog(MLOG_DEBUG | MLOG_TREE,
+		      "processing hard links\n");
+		ok = proc_hardlinks(path1, path2);
+		if (! ok) {
 			return BOOL_FALSE;
 		}
 	}
@@ -1266,13 +1266,13 @@
 
 /* ARGSUSED */
 static bool_t
-noref_elim_recurse( nh_t parh,
+noref_elim_recurse(nh_t parh,
 		    nh_t cldh,
 		    bool_t parrefpr,
 		    char *path1,
-		    char *path2 )
+		    char *path2)
 {
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		xfs_ino_t ino;
 		gen_t gen;
@@ -1287,141 +1287,141 @@
 		int rval;
 		bool_t ok;
 
-		cldp = Node_map( cldh );
+		cldp = Node_map(cldh);
 		ino = cldp->n_ino;
 		gen = cldp->n_gen;
 		inorphanagepr = cldp->n_parh == persp->p_orphh;
-		isdirpr = ( cldp->n_flags & NF_ISDIR );
-		isrealpr = ( cldp->n_flags & NF_REAL );
-		isrefpr = ( cldp->n_flags & NF_REFED );
-		isrenamepr = ( isdirpr && cldp->n_lnkh != NH_NULL );
+		isdirpr = (cldp->n_flags & NF_ISDIR);
+		isrealpr = (cldp->n_flags & NF_REAL);
+		isrefpr = (cldp->n_flags & NF_REFED);
+		isrenamepr = (isdirpr && cldp->n_lnkh != NH_NULL);
 		renameh = cldp->n_lnkh;
 		grandcldh = cldp->n_cldh;
 		nextcldh = cldp->n_sibh;
 
 #ifdef TREE_DEBUG
-		ok = Node2path( cldh, path1, _("noref debug") );
-		mlog( MLOG_TRACE | MLOG_TREE,
+		ok = Node2path(cldh, path1, _("noref debug"));
+		mlog(MLOG_TRACE | MLOG_TREE,
 		      "noref: %s: isdir = %d, isreal = %d, isref = %d, "
 		      "isrenamedir = %d\n",
-		      path1, isdirpr, isrealpr, isrefpr, isrenamepr );
+		      path1, isdirpr, isrealpr, isrefpr, isrenamepr);
 #endif
 
-		Node_unmap( cldh, &cldp );
+		Node_unmap(cldh, &cldp);
 
-		if ( isdirpr ) {
+		if (isdirpr) {
 			bool_t ok;
 
-			ok = noref_elim_recurse( cldh,
+			ok = noref_elim_recurse(cldh,
 						 grandcldh,
 						 isrefpr,
 						 path1,
-						 path2 );
+						 path2);
 						/* RECURSION */
-			if ( ! ok ) {
+			if (! ok) {
 				return BOOL_FALSE;
 			}
 
-			if ( inorphanagepr ) {
+			if (inorphanagepr) {
 				cldh = nextcldh;
 				continue;
 			}
 
-			if ( ! isrefpr ) {
+			if (! isrefpr) {
 				nrh_t nrh;
 
-				assert( ! isrenamepr );
-				if ( isrealpr ) {
-					ok = Node2path( cldh, path1, _("rmdir") );
-					if ( ! ok ) {
+				assert(! isrenamepr);
+				if (isrealpr) {
+					ok = Node2path(cldh, path1, _("rmdir"));
+					if (! ok) {
 						cldh = nextcldh;
 						continue;
 					}
-					mlog( MLOG_TRACE | MLOG_TREE,
+					mlog(MLOG_TRACE | MLOG_TREE,
 					      "rmdir %s\n",
-					      path1 );
-					rval = rmdir( path1 );
-					if ( rval ) {
-						mlog( MLOG_NORMAL
+					      path1);
+					rval = rmdir(path1);
+					if (rval) {
+						mlog(MLOG_NORMAL
 						      |
 						      MLOG_WARNING
 						      |
 						      MLOG_TREE, _(
 						    "unable to rmdir %s: %s\n"),
 						     path1,
-						     strerror( errno ));
+						     strerror(errno));
 						cldh = nextcldh;
 						continue;
 					}
 				}
-				nrh = disown( cldh );
-				assert( nrh != NRH_NULL );
-				namreg_del( nrh );
-				link_out( cldh );
-				Node_free( &cldh );
+				nrh = disown(cldh);
+				assert(nrh != NRH_NULL);
+				namreg_del(nrh);
+				link_out(cldh);
+				Node_free(&cldh);
 			}
 
-			if ( isrenamepr ) {
+			if (isrenamepr) {
 				nrh_t nrh;
 				node_t *renamep;
 
-				assert( isrefpr );
-				assert( isrealpr );
-				ok = Node2path( cldh,
+				assert(isrefpr);
+				assert(isrealpr);
+				ok = Node2path(cldh,
 						path1,
-						_("tmp dir rename src") );
-				if ( ! ok ) {
+						_("tmp dir rename src"));
+				if (! ok) {
 					cldh = nextcldh;
 					continue;
 				}
-				nrh = disown( cldh );
-				assert( nrh != NRH_NULL );
-				adopt( persp->p_orphh, cldh, NRH_NULL );
-				ok = Node2path( cldh,
+				nrh = disown(cldh);
+				assert(nrh != NRH_NULL);
+				adopt(persp->p_orphh, cldh, NRH_NULL);
+				ok = Node2path(cldh,
 						path2,
-						_("tmp dir rename dst") );
-				if ( ! ok ) {
+						_("tmp dir rename dst"));
+				if (! ok) {
 					/* REFERENCED */
 					nrh_t dummynrh;
-					dummynrh = disown( cldh );
-					assert( dummynrh == NRH_NULL );
-					adopt( parh, cldh, nrh );
+					dummynrh = disown(cldh);
+					assert(dummynrh == NRH_NULL);
+					adopt(parh, cldh, nrh);
 					cldh = nextcldh;
 					continue;
 				}
-				mlog( MLOG_TRACE | MLOG_TREE,
+				mlog(MLOG_TRACE | MLOG_TREE,
 				      "rename dir %s to %s\n",
 				      path1,
-				      path2 );
-				rval = rename( path1, path2 );
-				if ( rval ) {
+				      path2);
+				rval = rename(path1, path2);
+				if (rval) {
 					/* REFERENCED */
 					nrh_t dummynrh;
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "unable to rename dir %s "
 					      "to dir %s: %s\n"),
 					      path1,
 					      path2,
-					      strerror( errno ));
-					dummynrh = disown( cldh );
-					assert( dummynrh == NRH_NULL );
-					adopt( parh, cldh, nrh );
+					      strerror(errno));
+					dummynrh = disown(cldh);
+					assert(dummynrh == NRH_NULL);
+					adopt(parh, cldh, nrh);
 					cldh = nextcldh;
 					continue;
 				}
-				cldp = Node_map( cldh );
-				renamep = Node_map( renameh );
-				if ( renamep->n_nrh == NRH_NULL ) {
+				cldp = Node_map(cldh);
+				renamep = Node_map(renameh);
+				if (renamep->n_nrh == NRH_NULL) {
 					renamep->n_nrh = nrh;
 				} else {
-					namreg_del( nrh );
+					namreg_del(nrh);
 				}
-				if ( renamep->n_parh == NH_NULL ) {
+				if (renamep->n_parh == NH_NULL) {
 					renamep->n_parh = parh;
 				}
 				cldp->n_flags |= NF_NEWORPH;
-				Node_unmap( renameh, &renamep );
-				Node_unmap( cldh, &cldp );
+				Node_unmap(renameh, &renamep);
+				Node_unmap(cldh, &cldp);
 			}
 		} else  {
 			/* determine if we can unlink this node.
@@ -1434,18 +1434,18 @@
 			bool_t mustorphpr;
 			bool_t canunlinkpr;
 
-			if ( inorphanagepr ) {
+			if (inorphanagepr) {
 				cldh = nextcldh;
 				continue;
 			}
 
 			mustorphpr = BOOL_FALSE;
 			canunlinkpr = ! isrefpr && ! isrealpr;
-			if ( ! isrefpr && isrealpr ) {
+			if (! isrefpr && isrealpr) {
 				nh_t hardh;
 				bool_t neededpr;
-				hardh = link_hardh( ino, gen );
-				assert( hardh != NH_NULL );
+				hardh = link_hardh(ino, gen);
+				assert(hardh != NH_NULL);
 				canunlinkpr = BOOL_FALSE;
 				neededpr = BOOL_FALSE;
 				/* tes@sgi.com:
@@ -1454,26 +1454,26 @@
 				 * so that we will break out first
 				 * if we find a REAL file.
 				 */
-				while ( hardh != NH_NULL ) {
+				while (hardh != NH_NULL) {
 					node_t *hardp;
 					bool_t hardisrefpr;
 					bool_t hardisrealpr;
 					nh_t nexthardh;
 
-					hardp = Node_map( hardh );
+					hardp = Node_map(hardh);
 					hardisrefpr = hardp->n_flags & NF_REFED;
 					hardisrealpr = hardp->n_flags & NF_REAL;
 					nexthardh = hardp->n_lnkh;
-					Node_unmap( hardh, &hardp );
-					if ( hardh != cldh && hardisrealpr ) {
+					Node_unmap(hardh, &hardp);
+					if (hardh != cldh && hardisrealpr) {
 						break;
 					}
-					if ( hardisrefpr && ! hardisrealpr ) {
+					if (hardisrefpr && ! hardisrealpr) {
 						neededpr = BOOL_TRUE;
 					}
 					hardh = nexthardh;
 				}
-				if ( neededpr ) {
+				if (neededpr) {
 					mustorphpr = BOOL_TRUE;
 				}
 				else {
@@ -1481,74 +1481,74 @@
 				}
 			}
 
-			if ( mustorphpr ) {
+			if (mustorphpr) {
 				/* rename file to orphanage */
 				nrh_t nrh;
-				assert( ! canunlinkpr );
-				ok = Node2path( cldh,
+				assert(! canunlinkpr);
+				ok = Node2path(cldh,
 						path1,
-						_("tmp nondir rename src") );
-				if ( ! ok ) {
+						_("tmp nondir rename src"));
+				if (! ok) {
 					cldh = nextcldh;
 					continue;
 				}
-				nrh = disown( cldh );
-				assert( nrh != NRH_NULL );
-				adopt( persp->p_orphh, cldh, NRH_NULL );
-				ok = Node2path( cldh,
+				nrh = disown(cldh);
+				assert(nrh != NRH_NULL);
+				adopt(persp->p_orphh, cldh, NRH_NULL);
+				ok = Node2path(cldh,
 						path2,
-						_("tmp nondir rename dst") );
-				if ( ! ok ) {
+						_("tmp nondir rename dst"));
+				if (! ok) {
 					/* REFERENCED */
 					nrh_t dummynrh;
-					dummynrh = disown( cldh );
-					assert( dummynrh == NRH_NULL );
-					adopt( parh, cldh, nrh );
+					dummynrh = disown(cldh);
+					assert(dummynrh == NRH_NULL);
+					adopt(parh, cldh, nrh);
 					cldh = nextcldh;
 					continue;
 				}
-				mlog( MLOG_TRACE | MLOG_TREE,
+				mlog(MLOG_TRACE | MLOG_TREE,
 				      "rename nondir %s to %s\n",
 				      path1,
-				      path2 );
-				rval = rename( path1, path2 );
-				if ( rval ) {
+				      path2);
+				rval = rename(path1, path2);
+				if (rval) {
 					/* REFERENCED */
 					nrh_t dummynrh;
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "unable to rename nondir %s "
 					      "to nondir %s: %s\n"),
 					      path1,
 					      path2,
-					      strerror( errno ));
-					dummynrh = disown( cldh );
-					assert( dummynrh == NRH_NULL );
-					adopt( parh, cldh, nrh );
+					      strerror(errno));
+					dummynrh = disown(cldh);
+					assert(dummynrh == NRH_NULL);
+					adopt(parh, cldh, nrh);
 					cldh = nextcldh;
 					continue;
 				}
-				namreg_del( nrh );
-				cldp = Node_map( cldh );
+				namreg_del(nrh);
+				cldp = Node_map(cldh);
 				cldp->n_flags |= NF_NEWORPH;
-				Node_unmap( cldh, &cldp );
+				Node_unmap(cldh, &cldp);
 			}
-			if ( canunlinkpr ) {
+			if (canunlinkpr) {
 				/* REFERENCED */
 				nrh_t nrh;
 
-				assert( ! mustorphpr );
-				if ( isrealpr ) {
-					ok = Node2path( cldh, path1, _("rmdir") );
-					if ( ! ok ) {
+				assert(! mustorphpr);
+				if (isrealpr) {
+					ok = Node2path(cldh, path1, _("rmdir"));
+					if (! ok) {
 						cldh = nextcldh;
 						continue;
 					}
-					mlog( MLOG_TRACE | MLOG_TREE,
+					mlog(MLOG_TRACE | MLOG_TREE,
 					      "unlink %s\n",
-					      path1 );
-					rval = unlink( path1 );
-					if ( rval ) {
-						mlog( MLOG_NORMAL
+					      path1);
+					rval = unlink(path1);
+					if (rval) {
+						mlog(MLOG_NORMAL
 						      |
 						      MLOG_WARNING
 						      |
@@ -1556,15 +1556,15 @@
 						     "unable to unlink nondir "
 						     "%s: %s\n"),
 						     path1,
-						     strerror( errno ));
+						     strerror(errno));
 						cldh = nextcldh;
 						continue;
 					}
 				}
-				nrh = disown( cldh );
-				assert( nrh != NRH_NULL );
-				link_out( cldh );
-				Node_free( &cldh );
+				nrh = disown(cldh);
+				assert(nrh != NRH_NULL);
+				link_out(cldh);
+				Node_free(&cldh);
 			}
 		}
 
@@ -1578,9 +1578,9 @@
 
 /* ARGSUSED */
 static bool_t
-mkdirs_recurse( nh_t parh, nh_t cldh, char *path )
+mkdirs_recurse(nh_t parh, nh_t cldh, char *path)
 {
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		bool_t isdirpr;
 		bool_t isselpr;
@@ -1589,53 +1589,53 @@
 		nh_t grandcldh;
 		nh_t nextcldh;
 
-		cldp = Node_map( cldh );
-		isdirpr = ( cldp->n_flags & NF_ISDIR );
-		isrealpr = ( cldp->n_flags & NF_REAL );
-		isrefpr = ( cldp->n_flags & NF_REFED );
-		isselpr = ( cldp->n_flags & NF_SUBTREE );
+		cldp = Node_map(cldh);
+		isdirpr = (cldp->n_flags & NF_ISDIR);
+		isrealpr = (cldp->n_flags & NF_REAL);
+		isrefpr = (cldp->n_flags & NF_REFED);
+		isselpr = (cldp->n_flags & NF_SUBTREE);
 		grandcldh = cldp->n_cldh;
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp );
+		Node_unmap(cldh, &cldp);
 
 		/* if needed, create a directory and update real flag
 		 */
-		if ( isdirpr && ! isrealpr && isrefpr && isselpr ) {
+		if (isdirpr && ! isrealpr && isrefpr && isselpr) {
 			int rval;
 
-			if ( ! Node2path( cldh, path, _("makedir") )) {
+			if (! Node2path(cldh, path, _("makedir"))) {
 				cldh = nextcldh;
 				continue;
 			}
-			if ( tranp->t_toconlypr ) {
+			if (tranp->t_toconlypr) {
 				rval = 0;
 			} else {
-				mlog( MLOG_TRACE | MLOG_TREE,
+				mlog(MLOG_TRACE | MLOG_TREE,
 				      "mkdir %s\n",
-				      path );
-				rval = mkdir( path, S_IRWXU );
+				      path);
+				rval = mkdir(path, S_IRWXU);
 			}
-			if ( rval && errno != EEXIST ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+			if (rval && errno != EEXIST) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 				      "mkdir %s failed: %s\n"),
 				      path,
-				      strerror( errno ));
+				      strerror(errno));
 
 			} else {
-				cldp = Node_map( cldh );
+				cldp = Node_map(cldh);
 				cldp->n_flags |= NF_REAL;
-				Node_unmap( cldh, &cldp );
+				Node_unmap(cldh, &cldp);
 				isrealpr = BOOL_TRUE;
 			}
 		}
 
 		/* if a real selected directory, recurse
 		 */
-		if ( isdirpr && isrealpr && isselpr ) {
+		if (isdirpr && isrealpr && isselpr) {
 			bool_t ok;
-			ok = mkdirs_recurse( cldh, grandcldh, path );
+			ok = mkdirs_recurse(cldh, grandcldh, path);
 							/* RECURSION */
-			if ( ! ok ) {
+			if (! ok) {
 				return BOOL_FALSE;
 			}
 		}
@@ -1649,11 +1649,11 @@
 }
 
 static bool_t
-rename_dirs( nh_t cldh,
+rename_dirs(nh_t cldh,
 	     char *path1,
-	     char *path2 )
+	     char *path2)
 {
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		/* REFERENCED */
 		nh_t parh;
@@ -1664,68 +1664,68 @@
 		nh_t newparh;
 		nh_t newnrh;
 
-		cldp = Node_map( cldh );
+		cldp = Node_map(cldh);
 		parh = cldp->n_parh;
 		isdirpr = cldp->n_flags & NF_ISDIR;
 		renameh = cldp->n_lnkh;
 		isrenamepr = isdirpr && renameh != NH_NULL;
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp );
-		assert( parh == persp->p_orphh );
+		Node_unmap(cldh, &cldp);
+		assert(parh == persp->p_orphh);
 
-		if ( isrenamepr ) {
+		if (isrenamepr) {
 			node_t *renamep;
 			int rval;
 			/* REFERENCED */
 			nrh_t dummynrh;
 			bool_t ok;
 
-			renamep = Node_map( renameh );
+			renamep = Node_map(renameh);
 			newparh = renamep->n_parh;
 			newnrh = renamep->n_nrh;
-			Node_unmap( renameh, &renamep );
-			ok = Node2path( cldh, path1, _("rename dir") );
-			if ( ! ok ) {
+			Node_unmap(renameh, &renamep);
+			ok = Node2path(cldh, path1, _("rename dir"));
+			if (! ok) {
 				cldh = nextcldh;
 				continue;
 			}
-			dummynrh = disown( cldh );
-			assert( dummynrh == NRH_NULL );
-			adopt( newparh, cldh, newnrh );
-			ok = Node2path( cldh, path2, _("rename dir") );
-			if ( ! ok ) {
-				dummynrh = disown( cldh );
-				assert( dummynrh == newnrh );
-				adopt( persp->p_orphh, cldh, NRH_NULL );
-				cldp = Node_map( cldh );
+			dummynrh = disown(cldh);
+			assert(dummynrh == NRH_NULL);
+			adopt(newparh, cldh, newnrh);
+			ok = Node2path(cldh, path2, _("rename dir"));
+			if (! ok) {
+				dummynrh = disown(cldh);
+				assert(dummynrh == newnrh);
+				adopt(persp->p_orphh, cldh, NRH_NULL);
+				cldp = Node_map(cldh);
 				cldp->n_nrh = NRH_NULL;
-				Node_unmap( cldh, &cldp );
+				Node_unmap(cldh, &cldp);
 				cldh = nextcldh;
 				continue;
 			}
-			mlog( MLOG_TRACE | MLOG_TREE,
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "rename dir %s to %s\n",
 			      path1,
-			      path2 );
-			rval = rename( path1, path2 );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			      path2);
+			rval = rename(path1, path2);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "unable to rename dir %s "
 				      "to dir %s: %s\n"),
 				      path1,
 				      path2,
-				      strerror( errno ));
-				dummynrh = disown( cldh );
-				assert( dummynrh == newnrh );
-				adopt( persp->p_orphh, cldh, NRH_NULL );
+				      strerror(errno));
+				dummynrh = disown(cldh);
+				assert(dummynrh == newnrh);
+				adopt(persp->p_orphh, cldh, NRH_NULL);
 				cldh = nextcldh;
 				continue;
 			}
-			cldp = Node_map( cldh );
+			cldp = Node_map(cldh);
 			cldp->n_flags &= ~NF_NEWORPH;
 			cldp->n_lnkh = NH_NULL;
-			Node_unmap( cldh, &cldp );
-			Node_free( &renameh );
+			Node_unmap(cldh, &cldp);
+			Node_free(&renameh);
 		}
 
 		/* next!
@@ -1740,17 +1740,17 @@
  * ever returns FALSE;
  */
 rv_t
-tree_cb_links( xfs_ino_t ino,
+tree_cb_links(xfs_ino_t ino,
 	       gen_t gen,
 	       int32_t ctime,
 	       int32_t mtime,
-	       bool_t ( * funcp )( void *contextp,
+	       bool_t (* funcp)(void *contextp,
 				   bool_t linkpr,
 				   char *path1,
-				   char *path2 ),
+				   char *path2),
 	       void *contextp,
 	       char *path1,
-	       char *path2 )
+	       char *path2)
 {
 	nh_t hardh;
 	nh_t nh;
@@ -1758,57 +1758,57 @@
 	bool_t ok;
 	int  rval;
 
-	if ( persp->p_truncategenpr ) {
-		gen = BIGGEN2GEN( gen );
+	if (persp->p_truncategenpr) {
+		gen = BIGGEN2GEN(gen);
 	}
 
 	/* find the hardhead
 	 */
-	hardh = link_hardh( ino, gen );
+	hardh = link_hardh(ino, gen);
 
 	/* loop through all hard links, attempting to restore/link
 	 */
 	path = path1;
-	for ( nh = hardh ; nh != NH_NULL ; nh = link_nexth( nh )) {
+	for (nh = hardh ; nh != NH_NULL ; nh = link_nexth(nh)) {
 		node_t *np;
 		u_char_t flags;
 		char *reasonstr;
 
 		/* get the node flags
 		 */
-		np = Node_map( nh );
+		np = Node_map(nh);
 		flags = np->n_flags;
-		Node_unmap( nh, &np );
+		Node_unmap(nh, &np);
 
 		/* build a pathname
 		 */
-		ok = Node2path( nh, path, _("restore") );
-		if ( ! ok ) {
+		ok = Node2path(nh, path, _("restore"));
+		if (! ok) {
 			continue;
 		}
 
 		/* skip if not in selected subtree
 		 */
-		if ( ! ( flags & NF_SUBTREE )) {
-			mlog( (MLOG_NITTY + 1) | MLOG_TREE,
+		if (! (flags & NF_SUBTREE)) {
+			mlog((MLOG_NITTY + 1) | MLOG_TREE,
 			      "skipping %s (ino %llu gen %u): %s\n",
 			      path,
 			      ino,
 			      gen,
-			      "not in selected subtree" );
+			      "not in selected subtree");
 			continue;
 		}
 
 		/* don't restore into the housekeeping directory
 		 */
-		if ( path_beginswith( path, tranp->t_hkdir )) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+		if (path_beginswith(path, tranp->t_hkdir)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 			      "cannot restore %s (ino %llu gen %u): "
 			      "pathname contains %s\n"),
 			      path,
 			      ino,
 			      gen,
-			      tranp->t_hkdir );
+			      tranp->t_hkdir);
 			continue;
 		}
 
@@ -1817,24 +1817,24 @@
 		 * so we won't check again. in fact, can't check again
 		 * since restore changes the answer.
 		 */
-		if ( ! ( flags & NF_WRITTEN )) {
+		if (! (flags & NF_WRITTEN)) {
 			bool_t exists;
-			if ( ! content_overwrite_ok( path,
+			if (! content_overwrite_ok(path,
 						     ctime,
 						     mtime,
 						     &reasonstr,
-						     &exists )) {
-				mlog( MLOG_TRACE | MLOG_TREE,
+						     &exists)) {
+				mlog(MLOG_TRACE | MLOG_TREE,
 				      "skipping %s (ino %llu gen %u): %s\n",
 				      path,
 				      ino,
 				      gen,
-				      reasonstr );
+				      reasonstr);
 				continue;
 			} else {
-				np = Node_map( nh );
+				np = Node_map(nh);
 				np->n_flags |= NF_WRITTEN;
-				Node_unmap( nh, &np );
+				Node_unmap(nh, &np);
 
 				/*
 				 * We're the first stream to restore this file.
@@ -1842,17 +1842,17 @@
 				 * that may have been set since the dump was
 				 * taken.
 				 */
-				if ( ! tranp->t_toconlypr && exists ) {
-					rval = unlink( path );
-					if ( rval && errno != ENOENT ) {
-						mlog( MLOG_NORMAL |
+				if (! tranp->t_toconlypr && exists) {
+					rval = unlink(path);
+					if (rval && errno != ENOENT) {
+						mlog(MLOG_NORMAL |
 						      MLOG_WARNING, _(
 						      "unable to unlink "
 						      "current file prior to "
 						      "restore: "
 						      "%s: %s: discarding\n"),
 						      path,
-						      strerror( errno ));
+						      strerror(errno));
 						continue;
 					}
 				}
@@ -1862,30 +1862,30 @@
 		/* call callback to restore file / create hard link.
 		 * returns !ok if should abort.
 		 */
-		if ( path == path2 ) {
-			mlog( MLOG_TRACE | MLOG_TREE,
+		if (path == path2) {
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "link %s to %s (%llu %u)\n",
 			      path1,
 			      path2,
 			      ino,
-			      gen );
+			      gen);
 		} else {
-			mlog( MLOG_TRACE | MLOG_TREE,
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "restoring %s (%llu %u)\n",
 			      path1,
 			      ino,
-			      gen );
+			      gen);
 		}
-		ok = ( * funcp )( contextp, path == path2, path1, path2 );
-		if ( ! ok ) {
+		ok = (* funcp)(contextp, path == path2, path1, path2);
+		if (! ok) {
 			return RV_NOTOK;
 		}
 
 		/* set flag, indicating node is now real
 		 */
-		np = Node_map( nh );
+		np = Node_map(nh);
 		np->n_flags |= NF_REAL;
-		Node_unmap( nh, &np );
+		Node_unmap(nh, &np);
 
 		/* switch to second path buffer, for link paths
 		 */
@@ -1896,8 +1896,8 @@
 	/* if not yet peeled from tape, do so: place in orphanage if
 	 * no references found (i.e., hard link list empty).
 	 */
-	if ( path == path1 ) {
-		if ( hardh != NH_NULL || persp->p_ignoreorphpr ) {
+	if (path == path1) {
+		if (hardh != NH_NULL || persp->p_ignoreorphpr) {
 			/*
 			 * The file is referenced so the path is
 			 * valid.  This means that if path begins
@@ -1923,19 +1923,19 @@
 			 * make the whole tree of data
 			 * unreachable.  pv698761
 			 */
-			if ( persp->p_ignoreorphpr || (strncmp(ORPH_NAME, path,
+			if (persp->p_ignoreorphpr || (strncmp(ORPH_NAME, path,
 					    strlen(ORPH_NAME)) != 0)) {
-				mlog( MLOG_DEBUG | MLOG_TREE,
+				mlog(MLOG_DEBUG | MLOG_TREE,
 				      "discarding %llu %u\n",
 				      ino,
-				      gen );
-				ok = ( * funcp )( contextp, BOOL_FALSE, 0, 0 );
-				if ( ! ok ) {
+				      gen);
+				ok = (* funcp)(contextp, BOOL_FALSE, 0, 0);
+				if (! ok) {
 					return RV_NOTOK;
 				}
 			} else {
 
-				if ( ! tranp->t_toconlypr ) {
+				if (! tranp->t_toconlypr) {
 					char *dir;
 					char tmp[PATH_MAX];
 
@@ -1947,40 +1947,40 @@
 				mlog (MLOG_VERBOSE | MLOG_NOTE | MLOG_TREE, _(
 				      "ino %llu salvaging file,"
 				      " placing in %s\n"), ino, path1);
-				ok = ( * funcp )( contextp, path == path2,
-					path1, path2 );
-				if ( ! ok ) {
+				ok = (* funcp)(contextp, path == path2,
+					path1, path2);
+				if (! ok) {
 					return RV_NOTOK;
 				}
 			}
 		} else {
-			mlog( MLOG_VERBOSE | MLOG_NOTE | MLOG_TREE, _(
+			mlog(MLOG_VERBOSE | MLOG_NOTE | MLOG_TREE, _(
 			      "ino %llu gen %u not referenced: "
 			      "placing in orphanage\n"),
 			      ino,
-			      gen );
-			nh = Node_alloc( ino,
+			      gen);
+			nh = Node_alloc(ino,
 					 gen,
 					 NRH_NULL,
 					 DAH_NULL,
-					 NF_REAL | NF_NEWORPH );
+					 NF_REAL | NF_NEWORPH);
 			if (nh == NH_NULL) {
-				mlog( MLOG_ERROR | MLOG_TREE, _(
+				mlog(MLOG_ERROR | MLOG_TREE, _(
 				"node allocation failed when placing ino %llu"
 				" in orphanage\n"), ino);
 				return RV_ERROR; /* allocation failed */
 			}
-			link_in( nh );
-			adopt( persp->p_orphh, nh, NRH_NULL );
-			ok = Node2path( nh, path1, _("orphan") );
-			assert( ok );
-			( void )( * funcp )( contextp, BOOL_FALSE, path1,path2);
+			link_in(nh);
+			adopt(persp->p_orphh, nh, NRH_NULL);
+			ok = Node2path(nh, path1, _("orphan"));
+			assert(ok);
+			(void)(* funcp)(contextp, BOOL_FALSE, path1,path2);
 		}
 	}
 	return RV_OK;
 }
 
-/* uses flags cleared during directory restore (NF_DUMPEDDIR and NF_REFED )
+/* uses flags cleared during directory restore (NF_DUMPEDDIR and NF_REFED)
  * to determine what directory entries are no longer needed. this can
  * be done because whenever a directory chenges, it and all of its current
  * entries are dumped. so if an entry is dumped which is a dir, but that
@@ -1991,74 +1991,74 @@
  * clear the REFED flags.
  */
 
-static void tree_adjref_recurse( nh_t cldh,
+static void tree_adjref_recurse(nh_t cldh,
 				 bool_t pardumpedpr,
-				 bool_t parrefedpr );
+				 bool_t parrefedpr);
 
 bool_t
-tree_adjref( void )
+tree_adjref(void)
 {
-	tree_adjref_recurse( persp->p_rooth, BOOL_FALSE, BOOL_TRUE );
+	tree_adjref_recurse(persp->p_rooth, BOOL_FALSE, BOOL_TRUE);
 	return BOOL_TRUE;
 }
 
 static void
-tree_adjref_recurse( nh_t cldh,
+tree_adjref_recurse(nh_t cldh,
 		       bool_t pardumpedpr,
-		       bool_t parrefedpr )
+		       bool_t parrefedpr)
 {
 	nh_t grandcldh;
 	bool_t clddumpedpr;
 	bool_t cldrefedpr;
 	{
 		node_t *cldp;
-		cldp = Node_map( cldh );
-		if ( ! pardumpedpr && parrefedpr ) {
+		cldp = Node_map(cldh);
+		if (! pardumpedpr && parrefedpr) {
 			cldp->n_flags |= NF_REFED;
 		}
-		clddumpedpr = ( int )cldp->n_flags & NF_DUMPEDDIR;
-		cldrefedpr = ( int )cldp->n_flags & NF_REFED;
+		clddumpedpr = (int)cldp->n_flags & NF_DUMPEDDIR;
+		cldrefedpr = (int)cldp->n_flags & NF_REFED;
 		grandcldh = cldp->n_cldh;
-		Node_unmap( cldh, &cldp  );
+		Node_unmap(cldh, &cldp);
 	}
-	while ( grandcldh != NH_NULL ) {
+	while (grandcldh != NH_NULL) {
 		node_t *grandcldp;
 		nh_t nextgrandcldh;
-		tree_adjref_recurse( grandcldh, clddumpedpr, cldrefedpr );
+		tree_adjref_recurse(grandcldh, clddumpedpr, cldrefedpr);
 								/* RECURSION */
-		grandcldp = Node_map( grandcldh );
+		grandcldp = Node_map(grandcldh);
 		nextgrandcldh = grandcldp->n_sibh;
-		Node_unmap( grandcldh, &grandcldp  );
+		Node_unmap(grandcldh, &grandcldp);
 		grandcldh = nextgrandcldh;
 	}
 }
 
-static bool_t tree_extattr_recurse( nh_t parh,
+static bool_t tree_extattr_recurse(nh_t parh,
 				    nh_t cldh,
-				    bool_t ( * cbfunc )( char *path,
-							 dah_t dah ),
-				    char *path );
+				    bool_t (* cbfunc)(char *path,
+							 dah_t dah),
+				    char *path);
 
 bool_t
-tree_extattr( bool_t ( * cbfunc )( char *path, dah_t dah ), char *path )
+tree_extattr(bool_t (* cbfunc)(char *path, dah_t dah), char *path)
 {
 	node_t *rootp;
 	nh_t cldh;
 	bool_t ok;
 
-	rootp = Node_map( persp->p_rooth );
+	rootp = Node_map(persp->p_rooth);
 	cldh = rootp->n_cldh;
-	Node_unmap( persp->p_rooth, &rootp );
-	ok = tree_extattr_recurse( persp->p_rooth, cldh, cbfunc, path );
+	Node_unmap(persp->p_rooth, &rootp);
+	ok = tree_extattr_recurse(persp->p_rooth, cldh, cbfunc, path);
 
 	return ok;
 }
 
 static bool_t
-tree_extattr_recurse( nh_t parh,
+tree_extattr_recurse(nh_t parh,
 		      nh_t cldh,
-		      bool_t ( * cbfunc )( char *path, dah_t dah ),
-		      char *path )
+		      bool_t (* cbfunc)(char *path, dah_t dah),
+		      char *path)
 {
 	node_t *parp;
 	dah_t dah;
@@ -2066,7 +2066,7 @@
 
 	/* first update all children
 	 */
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		bool_t isdirpr;
 		bool_t isselpr;
@@ -2074,24 +2074,24 @@
 		nh_t grandcldh;
 		nh_t nextcldh;
 
-		cldp = Node_map( cldh );
-		isdirpr = ( cldp->n_flags & NF_ISDIR );
-		isrealpr = ( cldp->n_flags & NF_REAL );
-		isselpr = ( cldp->n_flags & NF_SUBTREE );
+		cldp = Node_map(cldh);
+		isdirpr = (cldp->n_flags & NF_ISDIR);
+		isrealpr = (cldp->n_flags & NF_REAL);
+		isselpr = (cldp->n_flags & NF_SUBTREE);
 		grandcldh = cldp->n_cldh;
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp );
+		Node_unmap(cldh, &cldp);
 
 		/* if a real selected directory, recurse
 		 */
-		if ( isdirpr && isrealpr && isselpr ) {
+		if (isdirpr && isrealpr && isselpr) {
 			bool_t ok;
-			ok = tree_extattr_recurse( cldh,
+			ok = tree_extattr_recurse(cldh,
 						   grandcldh,
 						   cbfunc,
-						   path );
+						   path);
 							/* RECURSION */
-			if ( ! ok ) {
+			if (! ok) {
 				return BOOL_FALSE;
 			}
 		}
@@ -2103,17 +2103,17 @@
 
 	/* now update self
 	 */
-	parp = Node_map( parh );
+	parp = Node_map(parh);
 	dah = parp->n_dah;
-	Node_unmap( parh, &parp );
-	if ( ! Node2path( parh, path, _("set dir extattr") )) {
+	Node_unmap(parh, &parp);
+	if (! Node2path(parh, path, _("set dir extattr"))) {
 		mlog (MLOG_NORMAL | MLOG_WARNING | MLOG_TREE,  _(
 		      "tree_extattr_recurse: Could not convert node to "
 		      "path for %s\n"), path);
 		return BOOL_TRUE;
 	}
-	if ( dah != DAH_NULL ) {
-		ok = ( * cbfunc )( path, dah );
+	if (dah != DAH_NULL) {
+		ok = (* cbfunc)(path, dah);
 	} else {
 		ok = BOOL_TRUE;
 	}
@@ -2129,10 +2129,10 @@
 
 typedef struct phcb phcb_t;
 
-static bool_t proc_hardlinks_cb( void *contextp, nh_t hardheadh );
+static bool_t proc_hardlinks_cb(void *contextp, nh_t hardheadh);
 
 static bool_t
-proc_hardlinks( char *path1, char *path2 )
+proc_hardlinks(char *path1, char *path2)
 {
 	phcb_t phcb;
 
@@ -2141,7 +2141,7 @@
 	phcb.path1 = path1;
 	phcb.path2 = path2;
 	phcb.ok = BOOL_TRUE;
-	link_headiter( proc_hardlinks_cb, ( void * )&phcb );
+	link_headiter(proc_hardlinks_cb, (void *)&phcb);
 	return phcb.ok;
 }
 
@@ -2165,9 +2165,9 @@
  * Thus, steps 2 and 3 are handled in noref_elim_recurse().
  */
 static bool_t
-proc_hardlinks_cb( void *contextp, nh_t hardheadh )
+proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 {
-	phcb_t *phcbp = ( phcb_t * )contextp;
+	phcb_t *phcbp = (phcb_t *)contextp;
 	node_t *hardheadp;
 	xfs_ino_t ino;
 	gen_t gen;
@@ -2182,19 +2182,19 @@
 
 	/* skip directories
 	 */
-	hardheadp = Node_map( hardheadh );
+	hardheadp = Node_map(hardheadh);
 	ino = hardheadp->n_ino;
 	gen = hardheadp->n_gen;
 	isdirpr = hardheadp->n_flags & NF_ISDIR;
-	Node_unmap( hardheadh, &hardheadp );
-	if ( isdirpr ) {
+	Node_unmap(hardheadh, &hardheadp);
+	if (isdirpr) {
 		return BOOL_TRUE;
 	}
 
-	mlog( MLOG_DEBUG | MLOG_TREE,
+	mlog(MLOG_DEBUG | MLOG_TREE,
 	      "processing hardlinks to %llu %u\n",
 	      ino,
-	      gen );
+	      gen);
 
 	/* first pass through hard link list: for each node, leave on
 	 * list, unlink and place on rename src list, unlink and place on
@@ -2204,61 +2204,61 @@
 	rnsrcheadh = NH_NULL;
 	rndstheadh = NH_NULL;
 	lnsrch = NH_NULL;
-	link_iter_init( &link_iter_context, hardheadh );
-	while ( ( nh = link_iter_next( &link_iter_context )) != NH_NULL ) {
+	link_iter_init(&link_iter_context, hardheadh);
+	while ((nh = link_iter_next(&link_iter_context)) != NH_NULL) {
 
-		node_t *np = Node_map( nh );
+		node_t *np = Node_map(nh);
 		bool_t isrealpr = np->n_flags & NF_REAL;
 		bool_t isrefpr = np->n_flags & NF_REFED;
 		bool_t isselpr = np->n_flags & NF_SUBTREE;
 
 		/* if unrefed, unreal, free node etc. (sel doesn't matter)
 		 */
-		if ( ! isrealpr && ! isrefpr ) {
-			mlog( MLOG_NITTY | MLOG_TREE,
+		if (! isrealpr && ! isrefpr) {
+			mlog(MLOG_NITTY | MLOG_TREE,
 			      "freeing node %x: not real, not referenced\n",
-			      nh );
-			link_iter_unlink( &link_iter_context, nh );
-			Node_unmap( nh, &np );
-			( void )disown( nh );
-			Node_free( &nh );
+			      nh);
+			link_iter_unlink(&link_iter_context, nh);
+			Node_unmap(nh, &np);
+			(void)disown(nh);
+			Node_free(&nh);
 			continue;
 		}
 
 		/* not real, refed, but not selected, can't help
 		 */
-		if ( ! isrealpr &&   isrefpr && ! isselpr ) {
-			mlog( MLOG_NITTY | MLOG_TREE,
+		if (! isrealpr &&   isrefpr && ! isselpr) {
+			mlog(MLOG_NITTY | MLOG_TREE,
 			      "skipping node %x: not selected\n",
-			      nh );
-			Node_unmap( nh, &np );
+			      nh);
+			Node_unmap(nh, &np);
 			continue;
 		}
 
 		/* if unreal, refed, sel, add to dst list,
 		 */
-		if ( ! isrealpr &&   isrefpr &&   isselpr ) {
-			mlog( MLOG_NITTY | MLOG_TREE,
+		if (! isrealpr &&   isrefpr &&   isselpr) {
+			mlog(MLOG_NITTY | MLOG_TREE,
 			      "making node %x dst: "
 			      "not real, refed, sel\n",
-			      nh );
-			link_iter_unlink( &link_iter_context, nh );
+			      nh);
+			link_iter_unlink(&link_iter_context, nh);
 			np->n_lnkh = rndstheadh;
 			rndstheadh = nh;
-			Node_unmap( nh, &np );
+			Node_unmap(nh, &np);
 			continue;
 		}
 
 		/* if real, unrefed, sel, add to src list
 		 */
-		if (   isrealpr && ! isrefpr &&   isselpr ) {
-			mlog( MLOG_NITTY | MLOG_TREE,
+		if (isrealpr && ! isrefpr &&   isselpr) {
+			mlog(MLOG_NITTY | MLOG_TREE,
 			      "making node %x src: real, not refed, sel\n",
-			      nh );
-			link_iter_unlink( &link_iter_context, nh );
+			      nh);
+			link_iter_unlink(&link_iter_context, nh);
 			np->n_lnkh = rnsrcheadh;
 			rnsrcheadh = nh;
-			Node_unmap( nh, &np );
+			Node_unmap(nh, &np);
 			continue;
 		}
 
@@ -2266,187 +2266,187 @@
 		 * real and referenced, leave alone (sel doesn't matter).
 		 * consider as a lnk src, since real and not going away.
 		 */
-		if (   isrealpr && ( isrefpr || !isselpr ) ) {
-			mlog( MLOG_NITTY | MLOG_TREE,
+		if (isrealpr && (isrefpr || !isselpr)) {
+			mlog(MLOG_NITTY | MLOG_TREE,
 			      "skipping node %x: %s\n",
 			      nh,
-			      isselpr ? "real and ref" : "real and not sel" );
-			Node_unmap( nh, &np );
-			if ( lnsrch == NH_NULL ) {
-				mlog( MLOG_NITTY | MLOG_TREE,
+			      isselpr ? "real and ref" : "real and not sel");
+			Node_unmap(nh, &np);
+			if (lnsrch == NH_NULL) {
+				mlog(MLOG_NITTY | MLOG_TREE,
 				      "node %x will be link src\n",
-				      nh );
+				      nh);
 				lnsrch = nh;
 			}
 			continue;
 		}
-		assert( 0 );
+		assert(0);
 	}
 
 	/* now pass through dst list, doing renames if src list not empty,
 	 * otherwise links if a lnk src available, otherwise put back in link
 	 * list
 	 */
-	while ( rndstheadh != NH_NULL ) {
+	while (rndstheadh != NH_NULL) {
 		nh_t dsth;
 		node_t *dstp;
 		bool_t successpr;
 
 		dsth = rndstheadh;
-		dstp = Node_map( dsth );
+		dstp = Node_map(dsth);
 		rndstheadh = dstp->n_lnkh;
 		dstp->n_lnkh = NH_NULL;
-		Node_unmap( dsth, &dstp );
+		Node_unmap(dsth, &dstp);
 
 		/* build pathname to dst
 		 */
-		ok = Node2path( dsth, phcbp->path2, _("rename to") );
-		if ( ! ok ) {
-			link_in( dsth );
+		ok = Node2path(dsth, phcbp->path2, _("rename to"));
+		if (! ok) {
+			link_in(dsth);
 			continue;
 		}
 
 		successpr = BOOL_FALSE;
-		while ( ! successpr && rnsrcheadh != NH_NULL ) {
+		while (! successpr && rnsrcheadh != NH_NULL) {
 			nh_t srch;
 			nrh_t nrh;
 			node_t *srcp;
 
 			srch = rnsrcheadh;
-			srcp = Node_map( srch );
+			srcp = Node_map(srch);
 			rnsrcheadh = srcp->n_lnkh;
 			srcp->n_lnkh = NH_NULL;
-			Node_unmap( srch, &srcp );
+			Node_unmap(srch, &srcp);
 
 			/* build a path to src
 			 */
-			ok = Node2path( srch, phcbp->path1, _("rename from") );
-			if ( ! ok ) {
-				link_in( srch );
+			ok = Node2path(srch, phcbp->path1, _("rename from"));
+			if (! ok) {
+				link_in(srch);
 				continue;
 			}
 
-			if ( tranp->t_toconlypr ) {
+			if (tranp->t_toconlypr) {
 				rval = 0;
 			} else {
-				mlog( MLOG_TRACE | MLOG_TREE,
+				mlog(MLOG_TRACE | MLOG_TREE,
 				      "rename nondir %s to %s\n",
 				      phcbp->path1,
-				      phcbp->path2 );
-				rval = rename( phcbp->path1,
-					       phcbp->path2 );
+				      phcbp->path2);
+				rval = rename(phcbp->path1,
+					       phcbp->path2);
 			}
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 				      "unable to rename nondir "
 				      "%s to %s: %s\n"),
 				      phcbp->path1,
 				      phcbp->path2,
-				      strerror( errno ));
-				link_in( srch );
+				      strerror(errno));
+				link_in(srch);
 				continue;
 			}
 
-			nrh = disown( srch );
-			if ( nrh != NRH_NULL ) {
-				namreg_del( nrh );
+			nrh = disown(srch);
+			if (nrh != NRH_NULL) {
+				namreg_del(nrh);
 			}
-			Node_free( &srch );
+			Node_free(&srch);
 
 			successpr = BOOL_TRUE;
 		}
 
 		/* tes@sgi.com: note: loop of one iteration only
 		 */
-		while ( ! successpr && lnsrch != NH_NULL ) {
-			ok = Node2path( lnsrch, phcbp->path1, _("link") );
+		while (! successpr && lnsrch != NH_NULL) {
+			ok = Node2path(lnsrch, phcbp->path1, _("link"));
 
-			if ( ! ok ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+			if (! ok) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 				      "unable to use %s "
 				      "as a hard link source\n"),
-				      phcbp->path1 );
+				      phcbp->path1);
 				lnsrch = NH_NULL;
 				continue;
 			}
 
-			if ( tranp->t_toconlypr ) {
+			if (tranp->t_toconlypr) {
 				rval = 0;
 			} else {
-				mlog( MLOG_TRACE | MLOG_TREE,
+				mlog(MLOG_TRACE | MLOG_TREE,
 				      "link nondir %s to %s\n",
 				      phcbp->path1,
-				      phcbp->path2 );
-				rval = link( phcbp->path1,
-					     phcbp->path2 );
+				      phcbp->path2);
+				rval = link(phcbp->path1,
+					     phcbp->path2);
 			}
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE,
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE,
 				      "unable to link nondir "
 				      "%s to %s: %s\n",
 				      phcbp->path1,
 				      phcbp->path2,
-				      strerror( errno ));
+				      strerror(errno));
 				break;
 			}
 			successpr = BOOL_TRUE;
 		}
 
-		if ( ! successpr ) {
-			mlog( MLOG_NITTY | MLOG_TREE,
+		if (! successpr) {
+			mlog(MLOG_NITTY | MLOG_TREE,
 			      "no link src for node %x\n",
-			      dsth );
+			      dsth);
 		} else {
-			dstp = Node_map( dsth );
+			dstp = Node_map(dsth);
 			dstp->n_flags |= NF_REAL;
-			Node_unmap( dsth, &dstp );
+			Node_unmap(dsth, &dstp);
 		}
 
-		link_in( dsth );
+		link_in(dsth);
 	}
 
 	/* finally, pass through remaining src list, unlinking/disowning.
 	 * tes@sgi.com: don't believe this will happen as this step
 	 * should now be done in noref_elim_recurse().
 	 */
-	while ( rnsrcheadh != NH_NULL ) {
+	while (rnsrcheadh != NH_NULL) {
 		nh_t srch;
 		node_t *srcp;
 		bool_t ok;
 
 		srch = rnsrcheadh;
-		srcp = Node_map( srch );
+		srcp = Node_map(srch);
 		rnsrcheadh = srcp->n_lnkh;
 		srcp->n_lnkh = NH_NULL;
-		Node_unmap( srch, &srcp );
+		Node_unmap(srch, &srcp);
 
-		ok = Node2path( srch, phcbp->path1, _("unlink") );
-		if ( ! ok ) {
-			link_in( srch );
+		ok = Node2path(srch, phcbp->path1, _("unlink"));
+		if (! ok) {
+			link_in(srch);
 			continue;
 		}
 
-		if ( tranp->t_toconlypr ) {
+		if (tranp->t_toconlypr) {
 			rval = 0;
 		} else {
-			mlog( MLOG_TRACE | MLOG_TREE,
+			mlog(MLOG_TRACE | MLOG_TREE,
 			      "unlink nondir %s\n",
-			      phcbp->path1 );
-			rval = unlink( phcbp->path1 );
+			      phcbp->path1);
+			rval = unlink(phcbp->path1);
 		}
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 			      "unable to unlink %s: %s\n"),
 			      phcbp->path1,
-			      strerror( errno ));
-			link_in( srch );
+			      strerror(errno));
+			link_in(srch);
 		} else {
 			nrh_t nrh;
-			nrh = disown( srch );
-			if ( nrh != NRH_NULL ) {
-				namreg_del( nrh );
+			nrh = disown(srch);
+			if (nrh != NRH_NULL) {
+				namreg_del(nrh);
 			}
-			Node_free( &srch );
+			Node_free(&srch);
 		}
 	}
 
@@ -2457,59 +2457,59 @@
  * if non-empty, move children to orphanage
  */
 bool_t
-tree_setattr( char *path )
+tree_setattr(char *path)
 {
 	bool_t ok;
 	node_t *rootp;
 
-	ok = tree_setattr_recurse( persp->p_rooth, path );
+	ok = tree_setattr_recurse(persp->p_rooth, path);
 
-	if ( restore_rootdir_permissions && ok ) {
-		rootp = Node_map( persp->p_rooth );
+	if (restore_rootdir_permissions && ok) {
+		rootp = Node_map(persp->p_rooth);
 		/* "." is cwd which is the destination dir */
-		setdirattr( rootp->n_dah, "." );
-		Node_unmap( persp->p_rooth, &rootp );
+		setdirattr(rootp->n_dah, ".");
+		Node_unmap(persp->p_rooth, &rootp);
 	}
 
 	return ok;
 }
 
 static bool_t
-tree_setattr_recurse( nh_t parh, char *path )
+tree_setattr_recurse(nh_t parh, char *path)
 {
-	node_t *parp = Node_map( parh );
+	node_t *parp = Node_map(parh);
 	nh_t cldh = parp->n_cldh;
-	Node_unmap( parh, &parp );
-	while ( cldh != NH_NULL ) {
+	Node_unmap(parh, &parp);
+	while (cldh != NH_NULL) {
 		nh_t nextcldh;
 
 		/* get the node attributes
 		 */
-		node_t *cldp = Node_map( cldh );
-		bool_t isdirpr = ( cldp->n_flags & NF_ISDIR );
-		bool_t isselpr = ( cldp->n_flags & NF_SUBTREE );
-		bool_t isrealpr = ( cldp->n_flags & NF_REAL );
+		node_t *cldp = Node_map(cldh);
+		bool_t isdirpr = (cldp->n_flags & NF_ISDIR);
+		bool_t isselpr = (cldp->n_flags & NF_SUBTREE);
+		bool_t isrealpr = (cldp->n_flags & NF_REAL);
 		dah_t dah = cldp->n_dah;
 
 		/* get next cld
 		 */
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp );
+		Node_unmap(cldh, &cldp);
 
 		/* if is a real selected dir, go ahead.
 		 */
-		if ( isdirpr && isselpr && isrealpr ) {
+		if (isdirpr && isselpr && isrealpr) {
 			bool_t ok;
-			ok = tree_setattr_recurse( cldh, path ); /* RECURSION */
-			if ( ! ok ) {
-				Node_unmap( cldh, &cldp );
+			ok = tree_setattr_recurse(cldh, path); /* RECURSION */
+			if (! ok) {
+				Node_unmap(cldh, &cldp);
 				return BOOL_FALSE;
 			}
-			if ( dah != DAH_NULL ) {
+			if (dah != DAH_NULL) {
 				bool_t ok;
-				ok = Node2path( cldh, path, _("set dirattr") );
-				if ( ok ) {
-					setdirattr( dah, path );
+				ok = Node2path(cldh, path, _("set dirattr"));
+				if (ok) {
+					setdirattr(dah, path);
 				}
 			}
 		}
@@ -2521,7 +2521,7 @@
 }
 
 static void
-setdirattr( dah_t dah, char *path )
+setdirattr(dah_t dah, char *path)
 {
 	mode_t mode;
 	struct utimbuf utimbuf;
@@ -2531,96 +2531,96 @@
 	void	*hanp;
 	int fd = -1;
 
-	if ( dah == DAH_NULL )
+	if (dah == DAH_NULL)
 		return;
 
-	if ( tranp->t_dstdirisxfspr ) {
+	if (tranp->t_dstdirisxfspr) {
 		if (path_to_handle(path, &hanp, &hlen)) {
-			mlog( MLOG_NORMAL | MLOG_WARNING,
+			mlog(MLOG_NORMAL | MLOG_WARNING,
 				_("path_to_handle of %s failed:%s\n"),
-				path, strerror( errno ));
+				path, strerror(errno));
 		} else {
 			fd = open_by_handle(hanp, hlen, O_RDONLY);
 			if (fd < 0) {
-				mlog( MLOG_NORMAL | MLOG_WARNING,
+				mlog(MLOG_NORMAL | MLOG_WARNING,
 					_("open_by_handle of %s failed:%s\n"),
-					path, strerror( errno ));
+					path, strerror(errno));
 			}
 			free_handle(hanp, hlen);
 		}
 	}
 
-	if ( tranp->t_dstdirisxfspr && persp->p_restoredmpr ) {
+	if (tranp->t_dstdirisxfspr && persp->p_restoredmpr) {
 		fsdmidata_t fssetdm;
 
-		fssetdm.fsd_dmevmask = dirattr_get_dmevmask( dah );
+		fssetdm.fsd_dmevmask = dirattr_get_dmevmask(dah);
 		fssetdm.fsd_padding = 0;	/* not used */
-		fssetdm.fsd_dmstate = ( uint16_t )dirattr_get_dmstate( dah );
+		fssetdm.fsd_dmstate = (uint16_t)dirattr_get_dmstate(dah);
 
 		/* restore DMAPI event settings etc.
 		 */
-		rval = ioctl( fd,
+		rval = ioctl(fd,
 			      XFS_IOC_FSSETDM,
-			      ( void * )&fssetdm );
-		if ( rval ) {
-			mlog( errno == EINVAL
+			      (void *)&fssetdm);
+		if (rval) {
+			mlog(errno == EINVAL
 			      ?
-			      ( MLOG_NITTY + 1 ) | MLOG_TREE
+			      (MLOG_NITTY + 1) | MLOG_TREE
 			      :
 			      MLOG_NITTY | MLOG_TREE,
 			      "set DMI attributes"
 			      " of %s failed: %s\n",
 			      path,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 	}
 
-	utimbuf.actime = dirattr_get_atime( dah );
-	utimbuf.modtime = dirattr_get_mtime( dah );
-	rval = utime( path, &utimbuf );
-	if ( rval ) {
-		mlog( MLOG_VERBOSE | MLOG_TREE, _(
+	utimbuf.actime = dirattr_get_atime(dah);
+	utimbuf.modtime = dirattr_get_mtime(dah);
+	rval = utime(path, &utimbuf);
+	if (rval) {
+		mlog(MLOG_VERBOSE | MLOG_TREE, _(
 		      "could not set access and modification times"
 		      " of %s: %s\n"),
 		      path,
-		      strerror( errno ));
+		      strerror(errno));
 	}
-	mode = dirattr_get_mode( dah );
-	if ( persp->p_ownerpr  ) {
-		rval = chown( path,
-			      dirattr_get_uid( dah ),
-			      dirattr_get_gid( dah ));
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_TREE, _(
+	mode = dirattr_get_mode(dah);
+	if (persp->p_ownerpr) {
+		rval = chown(path,
+			      dirattr_get_uid(dah),
+			      dirattr_get_gid(dah));
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_TREE, _(
 			      "chown (uid=%d, gid=%d) %s failed: %s\n"),
-			      dirattr_get_uid( dah ),
-			      dirattr_get_gid( dah ),
+			      dirattr_get_uid(dah),
+			      dirattr_get_gid(dah),
 			      path,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 	}
-	rval = chmod( path, mode );
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_TREE, _(
+	rval = chmod(path, mode);
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_TREE, _(
 		      "chmod %s failed: %s\n"),
 		      path,
-		      strerror( errno ));
+		      strerror(errno));
 	}
 
 	/* set the extended inode flags
 	 */
-	if ( !tranp->t_dstdirisxfspr )
+	if (!tranp->t_dstdirisxfspr)
 		return;
 
-	memset((void *)&fsxattr, 0, sizeof( fsxattr ));
-	fsxattr.fsx_xflags = dirattr_get_xflags( dah );
-	fsxattr.fsx_extsize = dirattr_get_extsize( dah );
-	fsxattr.fsx_projid = dirattr_get_projid( dah );
+	memset((void *)&fsxattr, 0, sizeof(fsxattr));
+	fsxattr.fsx_xflags = dirattr_get_xflags(dah);
+	fsxattr.fsx_extsize = dirattr_get_extsize(dah);
+	fsxattr.fsx_projid = dirattr_get_projid(dah);
 
-	rval = ioctl( fd,
+	rval = ioctl(fd,
 		      XFS_IOC_FSSETXATTR,
 		      (void *)&fsxattr);
-	if ( rval < 0 ) {
+	if (rval < 0) {
 		mlog(MLOG_NORMAL | MLOG_WARNING,
 		     _("attempt to set "
 		       "extended attributes "
@@ -2635,27 +2635,27 @@
 		     path,
 		     strerror(errno));
 	}
-	( void )close( fd );
+	(void)close(fd);
 }
 
 /* deletes orphanage if empty, else warns
  */
 bool_t
-tree_delorph( void )
+tree_delorph(void)
 {
 	int rval;
 
-	rval = rmdir( tranp->t_orphdir );
-	if ( rval ) {
-		if ( errno == EEXIST ) {
+	rval = rmdir(tranp->t_orphdir);
+	if (rval) {
+		if (errno == EEXIST) {
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 			     "unable to rmdir %s: not empty\n"),
-			     tranp->t_orphdir );
+			     tranp->t_orphdir);
 		} else {
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 			     "unable to rmdir %s: %s\n"),
 			     tranp->t_orphdir,
-			     strerror( errno ));
+			     strerror(errno));
 		}
 	}
 
@@ -2668,31 +2668,31 @@
 
 /* interactive subtree abstraction *******************************************/
 
-static void tsi_cmd_inst( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_pwd( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_ls( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_cd( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_add( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_delete( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_extract( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_quit( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_help( void *, dlog_pcbp_t, void * );
-static void tsi_cmd_parse( char * );
-static dlog_ucbp_t tsi_cmd_match( void );
+static void tsi_cmd_inst(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_pwd(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_ls(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_cd(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_add(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_delete(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_extract(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_quit(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_help(void *, dlog_pcbp_t, void *);
+static void tsi_cmd_parse(char *);
+static dlog_ucbp_t tsi_cmd_match(void);
 
 #define PREAMBLEMAX	3
 #define ACKMAX		3
 #define POSTAMBLEMAX	3
 
 bool_t
-tree_subtree_inter( void )
+tree_subtree_inter(void)
 {
 	fold_t fold;
-	char *preamblestr[ PREAMBLEMAX ];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 
 	dlog_ucbp_t cmdp;
@@ -2705,12 +2705,12 @@
 	/* begin the dialog
 	 */
 	preamblecnt = 0;
-	fold_init( fold, _("subtree selection dialog"), '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, _("subtree selection dialog"), '=');
+	preamblestr[preamblecnt++ ] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++ ] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* execute commands until time to extract or quit. always begin with
 	 * an implicit instructions command. if see SIGINT, give main thread
@@ -2718,7 +2718,7 @@
 	 */
 	cmdp = tsi_cmd_inst;
 	do {
-		char buf[ MAXPATHLEN ];
+		char buf[MAXPATHLEN];
 		const ix_t abortix = 1;
 		const ix_t sigintix = 2;
 		const ix_t okix = 3;
@@ -2726,128 +2726,128 @@
 
 		/* execute command and get response
 		 */
-		responseix = dlog_string_query( cmdp,
+		responseix = dlog_string_query(cmdp,
 					        0,
 					        buf,
-					        sizeof( buf ),
+					        sizeof(buf),
 					        0,
 					        IXMAX,    /* timeout ix */
 					        sigintix, /* sigint ix */
 					        abortix,  /* sighup ix */
 						abortix,  /* sigquit ix */
-						okix );   /* ok ix */
+						okix);   /* ok ix */
 
 		/* ack the response
 		 */
 		ackcnt = 0;
-		if ( responseix == sigintix ) {
-			ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
-		} else if ( responseix == abortix ) {
-			ackstr[ ackcnt++ ] = _("abort\n");
+		if (responseix == sigintix) {
+			ackstr[ackcnt++ ] = _("keyboard interrupt\n");
+		} else if (responseix == abortix) {
+			ackstr[ackcnt++ ] = _("abort\n");
 		} else {
-			assert( responseix == okix );
+			assert(responseix == okix);
 		}
-		assert( ackcnt <= ACKMAX );
-		dlog_string_ack( ackstr,
-				 ackcnt );
+		assert(ackcnt <= ACKMAX);
+		dlog_string_ack(ackstr,
+				 ackcnt);
 
 		/* exception handling
 		 */
-		if ( responseix != okix ) {
+		if (responseix != okix) {
 			/* if exception, end the dialog. may restart
 			 * if operator decidesd not to intr.
 			 */
 			postamblecnt = 0;
-			fold_init( fold, _("end dialog"), '-' );
-			postamblestr[ postamblecnt++ ] = "\n";
-			postamblestr[ postamblecnt++ ] = fold;
-			postamblestr[ postamblecnt++ ] = "\n\n";
-			assert( postamblecnt <= POSTAMBLEMAX );
-			dlog_end( postamblestr, postamblecnt );
+			fold_init(fold, _("end dialog"), '-');
+			postamblestr[postamblecnt++ ] = "\n";
+			postamblestr[postamblecnt++] = fold;
+			postamblestr[postamblecnt++ ] = "\n\n";
+			assert(postamblecnt <= POSTAMBLEMAX);
+			dlog_end(postamblestr, postamblecnt);
 
 			/* if sighup or sigquit, immediately quit
 			 */
-			if ( responseix == abortix ) {
+			if (responseix == abortix) {
 				return BOOL_FALSE;
 			}
 
 			/* if sigint, allow main thread to decide if
 			 * operator really wants to quit
 			 */
-			assert( responseix == sigintix );
-			if ( cldmgr_stop_requested( )) {
+			assert(responseix == sigintix);
+			if (cldmgr_stop_requested()) {
 				return BOOL_FALSE;
 			}
-			sleep( 1 ); /* to allow main thread to begin dialog */
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_TREE,
-			      "" ); /* block until main thread dialog done */
-			sleep( 1 ); /* let main thread ask children to die */
-			if ( cldmgr_stop_requested( )) {
+			sleep(1); /* to allow main thread to begin dialog */
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_TREE,
+			      ""); /* block until main thread dialog done */
+			sleep(1); /* let main thread ask children to die */
+			if (cldmgr_stop_requested()) {
 				return BOOL_FALSE;
 			}
-			mlog( MLOG_DEBUG | MLOG_TREE,
-			      "retrying interactive subtree selection dialog\n" );
+			mlog(MLOG_DEBUG | MLOG_TREE,
+			      "retrying interactive subtree selection dialog\n");
 			goto restart;
 		}
 
 
-		tsi_cmd_parse( buf );
-		cmdp = tsi_cmd_match( );
-		if ( ! cmdp ) {
+		tsi_cmd_parse(buf);
+		cmdp = tsi_cmd_match();
+		if (! cmdp) {
 			cmdp = tsi_cmd_help;
 		}
-	} while ( cmdp != tsi_cmd_quit && cmdp != tsi_cmd_extract );
+	} while (cmdp != tsi_cmd_quit && cmdp != tsi_cmd_extract);
 
 	postamblecnt = 0;
-	fold_init( fold, _("end dialog"), '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr, postamblecnt );
+	fold_init(fold, _("end dialog"), '-');
+	postamblestr[postamblecnt++ ] = "\n";
+	postamblestr[postamblecnt++] = fold;
+	postamblestr[postamblecnt++ ] = "\n\n";
+	assert(postamblecnt <= POSTAMBLEMAX);
+	dlog_end(postamblestr, postamblecnt);
 
 	/* pv 773569 - quit is not a reason to consider session
          * to be interrupted (we haven't started yet) so just unmark
          * any selected directories and return */
-	if ( cmdp == tsi_cmd_quit ) {
-		mlog( MLOG_NORMAL, _("Unmark and quit\n") );
-		selsubtree( persp->p_rooth , BOOL_FALSE );
+	if (cmdp == tsi_cmd_quit) {
+		mlog(MLOG_NORMAL, _("Unmark and quit\n"));
+		selsubtree(persp->p_rooth , BOOL_FALSE);
 	}
 
 	return BOOL_TRUE;
 }
 
 static void
-tsi_cmd_inst( void *ctxp,
+tsi_cmd_inst(void *ctxp,
 	      dlog_pcbp_t pcb,
-	      void *pctxp )
+	      void *pctxp)
 {
-	tsi_cmd_help( ctxp, pcb, pctxp );
+	tsi_cmd_help(ctxp, pcb, pctxp);
 }
 
 static void
-tsi_cmd_pwd( void *ctxp,
+tsi_cmd_pwd(void *ctxp,
 	     dlog_pcbp_t pcb,
-	     void *pctxp )
+	     void *pctxp)
 {
 	/* special case root
 	 */
-	if ( tranp->t_inter.i_cwdh == persp->p_rooth ) {
-		( * pcb )( pctxp, "cwd is fs root\n" );
+	if (tranp->t_inter.i_cwdh == persp->p_rooth) {
+		(* pcb )(pctxp, "cwd is fs root\n");
 		return;
 	}
 
 	/* ascend tree recursively, print path on way back
 	 */
-	tsi_cmd_pwd_recurse( ctxp, pcb, pctxp, tranp->t_inter.i_cwdh );
-	( * pcb )( pctxp, "\n" );
+	tsi_cmd_pwd_recurse(ctxp, pcb, pctxp, tranp->t_inter.i_cwdh);
+	(* pcb )(pctxp, "\n");
 }
 
 static void
-tsi_cmd_pwd_recurse( void *ctxp,
+tsi_cmd_pwd_recurse(void *ctxp,
 		     dlog_pcbp_t pcb,
 		     void *pctxp,
-		     nh_t nh )
+		     nh_t nh)
 {
 	node_t *np;
 	register nh_t parh;
@@ -2855,33 +2855,33 @@
 	register int namelen;
 	nrh_t nrh;
 
-	assert( nh != NH_NULL );
+	assert(nh != NH_NULL);
 
-	np = Node_map( nh );
+	np = Node_map(nh);
 	nrh = np->n_nrh;
 	parh = np->n_parh;
-	Node_unmap( nh, &np );
-	if ( parh != persp->p_rooth ) {
-		tsi_cmd_pwd_recurse( ctxp, pcb, pctxp, parh );
+	Node_unmap(nh, &np);
+	if (parh != persp->p_rooth) {
+		tsi_cmd_pwd_recurse(ctxp, pcb, pctxp, parh);
 			/* RECURSION */
-		( * pcb )( pctxp, "/" );
+		(* pcb )(pctxp, "/");
 	}
-	assert( nrh != NRH_NULL );
-	namelen = namreg_get( nrh,
+	assert(nrh != NRH_NULL);
+	namelen = namreg_get(nrh,
 			      tranp->t_inter.i_name,
-			      sizeof( tranp->t_inter.i_name ));
-	assert( namelen > 0 );
-	( * pcb )( pctxp, tranp->t_inter.i_name );
+			      sizeof(tranp->t_inter.i_name));
+	assert(namelen > 0);
+	(* pcb)(pctxp, tranp->t_inter.i_name);
 }
 
 /* ARGSUSED */
 static void
-tsi_cmd_ls( void *ctxp,
+tsi_cmd_ls(void *ctxp,
 	    dlog_pcbp_t pcb,
-	    void *pctxp )
+	    void *pctxp)
 {
 	size_t argc = tranp->t_inter.i_argc;
-	char *arg = ( argc > 1 ) ? tranp->t_inter.i_argv[ 1 ] : 0;
+	char *arg = (argc > 1) ? tranp->t_inter.i_argv[1] : 0;
 	bool_t ok;
 
 	nh_t cldh;
@@ -2894,7 +2894,7 @@
 	/* walk the tree according to the path argument, to get
 	 * the named node.
 	 */
-	ok = tsi_walkpath( arg,
+	ok = tsi_walkpath(arg,
 			   persp->p_rooth,
 			   tranp->t_inter.i_cwdh,
 			   pcb,
@@ -2904,20 +2904,20 @@
 			   &cldh,
 			   &ino,
 			   &isdirpr,
-			   &isselpr );
-	if ( ! ok ) {
+			   &isselpr);
+	if (! ok) {
 		return;
 	}
 
 	/* if named is not a dir, just display named
 	 */
-	if ( ! isdirpr ) {
-		( * pcb )( pctxp,
+	if (! isdirpr) {
+		(* pcb)(pctxp,
 			   "    %s %10llu %s%s\n",
 			   isselpr ? "*" : " ",
 			   ino,
 			   tranp->t_inter.i_name,
-			   isdirpr ? "/" : " " );
+			   isdirpr ? "/" : " ");
 
 		return;
 	}
@@ -2925,30 +2925,30 @@
 	/* iterate through the directory, printing all matching entries.
 	 * hide the orphanage.
 	 */
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		nrh_t nrh;
 		nh_t nextcldh;
-		cldp = Node_map( cldh );
+		cldp = Node_map(cldh);
 		nrh = cldp->n_nrh;
 		nextcldh = cldp->n_sibh;
-		isdirpr = ( cldp->n_flags & NF_ISDIR );
-		isselpr = ( cldp->n_flags & NF_SUBTREE );
+		isdirpr = (cldp->n_flags & NF_ISDIR);
+		isselpr = (cldp->n_flags & NF_SUBTREE);
 		ino = cldp->n_ino;
-		Node_unmap( cldh, &cldp );
-		if ( cldh != persp->p_orphh ) {
+		Node_unmap(cldh, &cldp);
+		if (cldh != persp->p_orphh) {
 			/* REFERENCED */
 			int namelen;
-			namelen = namreg_get( nrh,
+			namelen = namreg_get(nrh,
 					      tranp->t_inter.i_name,
-					      sizeof( tranp->t_inter.i_name ));
-			assert( namelen > 0 );
-			( * pcb )( pctxp,
+					      sizeof(tranp->t_inter.i_name));
+			assert(namelen > 0);
+			(* pcb)(pctxp,
 				   "    %s %10llu %s%s\n",
 				   isselpr ? "*" : " ",
 				   ino,
 				   tranp->t_inter.i_name,
-				   isdirpr ? "/" : " " );
+				   isdirpr ? "/" : " ");
 		}
 		cldh = nextcldh;
 	}
@@ -2956,12 +2956,12 @@
 
 /* ARGSUSED */
 static void
-tsi_cmd_cd( void *ctxp,
+tsi_cmd_cd(void *ctxp,
 	    dlog_pcbp_t pcb,
-	    void *pctxp )
+	    void *pctxp)
 {
 	size_t argc = tranp->t_inter.i_argc;
-	char *arg = ( argc > 1 ) ? tranp->t_inter.i_argv[ 1 ] : 0;
+	char *arg = (argc > 1) ? tranp->t_inter.i_argv[1] : 0;
 
 	nh_t cldh;
 	nh_t parh;
@@ -2974,7 +2974,7 @@
 	/* walk the tree according to the path argument, to get
 	 * the named node.
 	 */
-	ok = tsi_walkpath( arg,
+	ok = tsi_walkpath(arg,
 			   persp->p_rooth,
 			   tranp->t_inter.i_cwdh,
 			   pcb,
@@ -2984,18 +2984,18 @@
 			   &cldh,
 			   &ino,
 			   &isdirpr,
-			   &isselpr );
-	if ( ! ok ) {
+			   &isselpr);
+	if (! ok) {
 		return;
 	}
 
 	/* if named is not a dir, complain
 	 */
-	if ( ! isdirpr ) {
-		assert( arg );
-		( * pcb )( pctxp,
+	if (! isdirpr) {
+		assert(arg);
+		(* pcb)(pctxp,
 			   _("%s is not a directory\n"),
-			   arg );
+			   arg);
 
 		return;
 	}
@@ -3007,12 +3007,12 @@
 
 /* ARGSUSED */
 static void
-tsi_cmd_add( void *ctxp,
+tsi_cmd_add(void *ctxp,
 	     dlog_pcbp_t pcb,
-	     void *pctxp )
+	     void *pctxp)
 {
 	size_t argc = tranp->t_inter.i_argc;
-	char *arg = ( argc > 1 ) ? tranp->t_inter.i_argv[ 1 ] : 0;
+	char *arg = (argc > 1) ? tranp->t_inter.i_argv[1] : 0;
 
 	nh_t cldh;
 	nh_t parh;
@@ -3025,7 +3025,7 @@
 	/* walk the tree according to the path argument, to get
 	 * the named node.
 	 */
-	ok = tsi_walkpath( arg,
+	ok = tsi_walkpath(arg,
 			   persp->p_rooth,
 			   tranp->t_inter.i_cwdh,
 			   pcb,
@@ -3035,22 +3035,22 @@
 			   &cldh,
 			   &ino,
 			   &isdirpr,
-			   &isselpr );
-	if ( ! ok ) {
+			   &isselpr);
+	if (! ok) {
 		return;
 	}
 
-	selsubtree( namedh, BOOL_TRUE );
+	selsubtree(namedh, BOOL_TRUE);
 }
 
 /* ARGSUSED */
 static void
-tsi_cmd_delete( void *ctxp,
+tsi_cmd_delete(void *ctxp,
 		dlog_pcbp_t pcb,
-		void *pctxp )
+		void *pctxp)
 {
 	size_t argc = tranp->t_inter.i_argc;
-	char *arg = ( argc > 1 ) ? tranp->t_inter.i_argv[ 1 ] : 0;
+	char *arg = (argc > 1) ? tranp->t_inter.i_argv[1] : 0;
 
 	nh_t cldh;
 	nh_t parh;
@@ -3063,7 +3063,7 @@
 	/* walk the tree according to the path argument, to get
 	 * the named node.
 	 */
-	ok = tsi_walkpath( arg,
+	ok = tsi_walkpath(arg,
 			   persp->p_rooth,
 			   tranp->t_inter.i_cwdh,
 			   pcb,
@@ -3073,45 +3073,45 @@
 			   &cldh,
 			   &ino,
 			   &isdirpr,
-			   &isselpr );
-	if ( ! ok ) {
+			   &isselpr);
+	if (! ok) {
 		return;
 	}
 
-	selsubtree( namedh, BOOL_FALSE );
+	selsubtree(namedh, BOOL_FALSE);
 }
 
 /* ARGSUSED */
 static void
-tsi_cmd_extract( void *ctxp,
+tsi_cmd_extract(void *ctxp,
 		 dlog_pcbp_t pcb,
-		 void *pctxp )
+		 void *pctxp)
 {
 }
 
 /* ARGSUSED */
 static void
-tsi_cmd_quit( void *ctxp,
+tsi_cmd_quit(void *ctxp,
 	      dlog_pcbp_t pcb,
-	      void *pctxp )
+	      void *pctxp)
 {
 }
 
-static int parse( int slotcnt, char **slotbuf, char *string );
+static int parse(int slotcnt, char **slotbuf, char *string);
 
 static void
-tsi_cmd_parse( char *buf )
+tsi_cmd_parse(char *buf)
 {
 	int wordcnt;
 
-	if ( ! buf ) {
+	if (! buf) {
 		tranp->t_inter.i_argc = 0;
 		return;
 	}
 
-	wordcnt = parse( INTER_ARGMAX, tranp->t_inter.i_argv, buf );
+	wordcnt = parse(INTER_ARGMAX, tranp->t_inter.i_argv, buf);
 
-	tranp->t_inter.i_argc = ( size_t )min( max( 0, wordcnt ), INTER_ARGMAX );
+	tranp->t_inter.i_argc = (size_t)min(max(0, wordcnt), INTER_ARGMAX);
 }
 
 struct tsi_cmd_tbl {
@@ -3136,37 +3136,37 @@
 };
 
 static dlog_ucbp_t
-tsi_cmd_match( void )
+tsi_cmd_match(void)
 {
 	tsi_cmd_tbl_t *tblp = tsi_cmd_tbl;
 	tsi_cmd_tbl_t *tblendp = tsi_cmd_tbl
 				 +
-				 sizeof( tsi_cmd_tbl )
+				 sizeof(tsi_cmd_tbl)
 				 /
-				 sizeof( tsi_cmd_tbl[ 0 ] );
+				 sizeof(tsi_cmd_tbl[0]);
 
-	if ( tranp->t_inter.i_argc == 0 ) {
+	if (tranp->t_inter.i_argc == 0) {
 		return 0;
 	}
 
-	for ( ; tblp < tblendp ; tblp++ ) {
-		if ( ! strncmp( tranp->t_inter.i_argv[ 0 ],
+	for (; tblp < tblendp ; tblp++) {
+		if (! strncmp(tranp->t_inter.i_argv[0],
 				tblp->tct_pattern,
-				strlen( tranp->t_inter.i_argv[ 0 ] ))) {
+				strlen(tranp->t_inter.i_argv[0]))) {
 			break;
 		}
 	}
 
-	if ( tblp == tblendp ) {
+	if (tblp == tblendp) {
 		return 0;
 	}
 
-	assert( tblp->tct_argcmin != 0 );
-	if ( tranp->t_inter.i_argc < tblp->tct_argcmin ) {
+	assert(tblp->tct_argcmin != 0);
+	if (tranp->t_inter.i_argc < tblp->tct_argcmin) {
 		return 0;
 	}
 
-	if ( tranp->t_inter.i_argc > tblp->tct_argcmax ) {
+	if (tranp->t_inter.i_argc > tblp->tct_argcmax) {
 		return 0;
 	}
 
@@ -3175,23 +3175,23 @@
 
 /* ARGSUSED */
 static void
-tsi_cmd_help( void *ctxp,
+tsi_cmd_help(void *ctxp,
 	      dlog_pcbp_t pcb,
-	      void *pctxp )
+	      void *pctxp)
 {
 	tsi_cmd_tbl_t *tblp = tsi_cmd_tbl;
 	tsi_cmd_tbl_t *tblendp = tsi_cmd_tbl
 				 +
-				 sizeof( tsi_cmd_tbl )
+				 sizeof(tsi_cmd_tbl)
 				 /
-				 sizeof( tsi_cmd_tbl[ 0 ] );
+				 sizeof(tsi_cmd_tbl[0]);
 
-	( * pcb )( pctxp, _("the following commands are available:\n") );
-	for ( ; tblp < tblendp ; tblp++ ) {
-		( * pcb )( pctxp,
+	(* pcb )(pctxp, _("the following commands are available:\n"));
+	for (; tblp < tblendp ; tblp++) {
+		(* pcb)(pctxp,
 			   "\t%s %s\n",
 			   tblp->tct_pattern,
-			   tblp->tct_help );
+			   tblp->tct_help);
 	}
 }
 
@@ -3203,17 +3203,17 @@
  * optionally given a dlog print func and context, to be used for diag output.
  */
 static bool_t
-tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
+tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 	      dlog_pcbp_t pcb, void *pctxp,
 	      nh_t *namedhp, nh_t *parhp, nh_t *cldhp,
-	      xfs_ino_t *inop, bool_t *isdirprp, bool_t *isselprp )
+	      xfs_ino_t *inop, bool_t *isdirprp, bool_t *isselprp)
 {
 	nh_t namedh;
 	nh_t parh;
 	nh_t cldh;
 	node_t *namedp;
 	char *path;
-	char nbuf[ NAME_MAX + 1 ];
+	char nbuf[NAME_MAX + 1];
 	xfs_ino_t ino;
 	bool_t isdirpr;
 	bool_t isselpr;
@@ -3221,8 +3221,8 @@
 
 	/* correct arg if ends with slash (if arg is "/", ok)
 	 */
-	if ( arg && strlen( arg ) > 1 && arg[ strlen( arg ) - 1 ] == '/' ) {
-		arg[ strlen( arg ) - 1 ] = 0;
+	if (arg && strlen(arg) > 1 && arg[strlen(arg) - 1] == '/') {
+		arg[strlen(arg) - 1] = 0;
 	}
 
 	/* use path to walk down the path argument
@@ -3232,24 +3232,24 @@
 	/* walk the tree beginning either at the root node
 	 * or at the current working directory
 	 */
-	if ( path && *path == '/' ) {
-		assert( rooth != NH_NULL );
+	if (path && *path == '/') {
+		assert(rooth != NH_NULL);
 		namedh = rooth;
 		path++;
 	} else {
-		assert( cwdh != NH_NULL );
+		assert(cwdh != NH_NULL);
 		namedh = cwdh;
 	}
 
 	/* get the parent of the starting point, and its cld list
 	 */
-	namedp = Node_map( namedh );
+	namedp = Node_map(namedh);
 	parh = namedp->n_parh;
 	cldh = namedp->n_cldh;
 	ino = namedp->n_ino;
-	isselpr = ( namedp->n_flags & NF_SUBTREE );
-	assert( namedp->n_flags & NF_ISDIR );
-	Node_unmap( namedh, &namedp );
+	isselpr = (namedp->n_flags & NF_SUBTREE);
+	assert(namedp->n_flags & NF_ISDIR);
+	Node_unmap(namedh, &namedp);
 	isdirpr = BOOL_TRUE;
 
 	/* walk the tree from the starting point following the path arg.
@@ -3259,40 +3259,40 @@
 	 *	isdirpr - TRUE if named node is a directory;
 	 *	cldh - the first child in the named node's cld list.
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		size_t namelen;
 		char *strpatchp;
 		nh_t sibh;
 
 		/* if no path arg, break
 		 */
-		if ( ! path ) {
+		if (! path) {
 			break;
 		}
 
 		/* clean out leading slashes. these can occur if the
 		 * path arg is ".../////..." or "////..."
 		 */
-		while ( *path == '/' ) {
+		while (*path == '/') {
 			path++;
 		}
 
 		/* if empty path arg, break
 		 */
-		if ( ! strlen( path )) {
+		if (! strlen(path)) {
 			break;
 		}
 
 		/* copy the first name from the path, and advance
 		 * the path pointer.
 		 */
-		namelen = strcspn( path, "/" );
-		assert( namelen < sizeof( nbuf ));
-		strncpy( nbuf, path, namelen );
-		nbuf[ namelen ] = 0;
+		namelen = strcspn(path, "/");
+		assert(namelen < sizeof(nbuf));
+		strncpy(nbuf, path, namelen);
+		nbuf[namelen] = 0;
 		path += namelen;
-		if ( *path ) {
-			assert( *path == '/' );
+		if (*path) {
+			assert(*path == '/');
 			strpatchp = path;
 			*strpatchp = 0;
 			path++;
@@ -3302,19 +3302,19 @@
 
 		/* be sure the named node is a dir
 		 */
-		if ( ! isdirpr ) {
-			if ( pcb ) {
-				( * pcb )( pctxp, _(
+		if (! isdirpr) {
+			if (pcb) {
+				(* pcb)(pctxp, _(
 					   "parent of %s is not a directory\n"),
-					   arg );
+					   arg);
 			}
 			return BOOL_FALSE;
 		}
 
 		/* special case "."
 		 */
-		if ( ! strcmp( nbuf, "." )) {
-			if ( strpatchp ) {
+		if (! strcmp(nbuf, ".")) {
+			if (strpatchp) {
 				*strpatchp = '/';
 			}
 			continue;
@@ -3322,23 +3322,23 @@
 
 		/* special case ".."
 		 */
-		if ( ! strcmp( nbuf, ".." )) {
-			if ( parh == NH_NULL ) {
-				if ( pcb ) {
-					( * pcb )( pctxp, _(
+		if (! strcmp(nbuf, "..")) {
+			if (parh == NH_NULL) {
+				if (pcb) {
+					(* pcb)(pctxp, _(
 						   "%s above root\n"),
-						   arg );
+						   arg);
 				}
 				return BOOL_FALSE;
 			}
 			namedh = parh;
-			namedp = Node_map( namedh );
+			namedp = Node_map(namedh);
 			parh = namedp->n_parh;
 			cldh = namedp->n_cldh;
 			ino = namedp->n_ino;
-			isselpr = ( namedp->n_flags & NF_SUBTREE );
-			Node_unmap( namedh, &namedp );
-			if ( strpatchp ) {
+			isselpr = (namedp->n_flags & NF_SUBTREE);
+			Node_unmap(namedh, &namedp);
+			if (strpatchp) {
 				*strpatchp = '/';
 			}
 			continue;
@@ -3347,28 +3347,28 @@
 		/* look for child with right name
 		 */
 		sibh = cldh;
-		while ( sibh != NH_NULL ) {
+		while (sibh != NH_NULL) {
 			node_t *sibp;
 			nh_t nextsibh;
 			nrh_t nrh;
 			/* REFERENCED */
 			int siblen;
 
-			sibp = Node_map( sibh );
+			sibp = Node_map(sibh);
 			nrh = sibp->n_nrh;
 			nextsibh = sibp->n_sibh;
 			cldh = sibp->n_cldh;
 			ino = sibp->n_ino;
-			isselpr = ( sibp->n_flags & NF_SUBTREE );
-			isdirpr = ( sibp->n_flags & NF_ISDIR );
-			Node_unmap( sibh, &sibp );
-			assert( nrh != NRH_NULL || sibh == persp->p_orphh );
-			if ( nrh != NRH_NULL ) {
-				siblen = namreg_get( nrh,
+			isselpr = (sibp->n_flags & NF_SUBTREE);
+			isdirpr = (sibp->n_flags & NF_ISDIR);
+			Node_unmap(sibh, &sibp);
+			assert(nrh != NRH_NULL || sibh == persp->p_orphh);
+			if (nrh != NRH_NULL) {
+				siblen = namreg_get(nrh,
 						     tranp->t_inter.i_name,
-					       sizeof( tranp->t_inter.i_name ));
-				assert( siblen > 0 );
-				if ( ! strcmp( nbuf, tranp->t_inter.i_name )) {
+					       sizeof(tranp->t_inter.i_name));
+				assert(siblen > 0);
+				if (! strcmp(nbuf, tranp->t_inter.i_name)) {
 					break;
 				}
 			}
@@ -3377,11 +3377,11 @@
 
 		/* if no match, complain
 		 */
-		if ( sibh == NH_NULL ) {
-			if ( pcb ) {
-				( * pcb )( pctxp, _(
+		if (sibh == NH_NULL) {
+			if (pcb) {
+				(* pcb)(pctxp, _(
 					   "%s not found\n"),
-					   arg );
+					   arg);
 			}
 			return BOOL_FALSE;
 		}
@@ -3391,7 +3391,7 @@
 		 */
 		parh = namedh;
 		namedh = sibh;
-		if ( strpatchp ) {
+		if (strpatchp) {
 			*strpatchp = '/';
 		}
 	}
@@ -3408,15 +3408,15 @@
 /* Node abstraction *********************************************************/
 
 static nh_t
-Node_alloc( xfs_ino_t ino, gen_t gen, nrh_t nrh, dah_t dah, size_t flags )
+Node_alloc(xfs_ino_t ino, gen_t gen, nrh_t nrh, dah_t dah, size_t flags)
 {
 	nh_t nh;
 	node_t *np;
 
-	nh = node_alloc( );
+	nh = node_alloc();
 	if (nh == NH_NULL)
 	    return NH_NULL;
-	np = Node_map( nh );
+	np = Node_map(nh);
 	np->n_ino = ino;
 	np->n_nrh = nrh;
 	np->n_dah = dah;
@@ -3427,25 +3427,25 @@
 	np->n_cldh = NH_NULL;
 	np->n_lnkh = NH_NULL;
 	np->n_gen = gen;
-	np->n_flags = ( u_char_t )flags;
+	np->n_flags = (u_char_t)flags;
 	memset(np->n_pad, 0, sizeof(np->n_pad));
-	Node_unmap( nh, &np  );
+	Node_unmap(nh, &np);
 	return nh;
 }
 
 static void
-Node_free( nh_t *nhp )
+Node_free(nh_t *nhp)
 {
 	node_t *np;
-	np = Node_map( *nhp );
+	np = Node_map(*nhp);
 	np->n_ino = 0;
 	np->n_gen = 0;
-	if ( np->n_nrh != NRH_NULL ) {
-		namreg_del( np->n_nrh );
+	if (np->n_nrh != NRH_NULL) {
+		namreg_del(np->n_nrh);
 		np->n_nrh = NRH_NULL;
 	}
-	if ( np->n_dah != DAH_NULL ) {
-		dirattr_del( np->n_dah );
+	if (np->n_dah != DAH_NULL) {
+		dirattr_del(np->n_dah);
 		np->n_dah = DAH_NULL;
 	}
 	np->n_flags = 0;
@@ -3454,19 +3454,19 @@
 	np->n_sibprevh = NH_NULL;
 	np->n_cldh = NH_NULL;
 	np->n_lnkh = NH_NULL;
-	Node_unmap( *nhp, &np  );
-	node_free( nhp );
+	Node_unmap(*nhp, &np);
+	node_free(nhp);
 }
 
 /*
  * NOTE: Does error handling here and exits.
  */
 static node_t *
-Node_map( nh_t nh )
+Node_map(nh_t nh)
 {
-	node_t *n = ( node_t * )node_map( nh );
-	if ( n == NULL ) {
-		mlog( MLOG_ERROR | MLOG_TREE, _(
+	node_t *n = (node_t *)node_map(nh);
+	if (n == NULL) {
+		mlog(MLOG_ERROR | MLOG_TREE, _(
 			"failed to map in node (node handle: %u)\n"), nh);
 		exit(EXIT_ERROR);
 	}
@@ -3474,32 +3474,32 @@
 }
 
 static void
-Node_unmap( nh_t nh, node_t **npp )
+Node_unmap(nh_t nh, node_t **npp)
 {
-	node_unmap( nh, ( void ** )npp );
+	node_unmap(nh, (void **)npp);
 }
 
 /* builds a pathname for the specified node, relative to root
  * returns FALSE if pathname too long
  */
 static bool_t
-Node2path( nh_t nh, char *path, char *errmsg )
+Node2path(nh_t nh, char *path, char *errmsg)
 {
 	int remainingcnt;
 	strcpy(path, "."); /* in case root node passed in */
-	remainingcnt = Node2path_recurse( nh, path, MAXPATHLEN, 0 );
-	if ( remainingcnt <= 0 ) {
-		node_t *np = Node_map( nh );
+	remainingcnt = Node2path_recurse(nh, path, MAXPATHLEN, 0);
+	if (remainingcnt <= 0) {
+		node_t *np = Node_map(nh);
 		xfs_ino_t ino = np->n_ino;
 		gen_t gen = np->n_gen;
-		Node_unmap( nh, &np );
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+		Node_unmap(nh, &np);
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 		      "unable %s ino %llu gen %u: "
 		      "relative pathname too long (partial %s)\n"),
 		      errmsg,
 		      ino,
 		      gen,
-		      path );
+		      path);
 		return BOOL_FALSE;
 	} else {
 		return BOOL_TRUE;
@@ -3511,7 +3511,7 @@
  * works because the buffer size is secretly 2 * MAXPATHLEN.
  */
 static int
-Node2path_recurse( nh_t nh, char *buf, int bufsz, int level )
+Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 {
 	static __thread path_cache_t cache = { NH_NULL, 0, "" };
 	node_t *np;
@@ -3525,72 +3525,72 @@
 
 	/* recursion termination
 	 */
-	if ( nh == persp->p_rooth ) {
+	if (nh == persp->p_rooth) {
 		return bufsz;
 	}
 
 	/* if we have a cache hit, no need to recurse any further
 	 */
-	if ( nh == cache.nh ) {
-		assert( bufsz > cache.len );
-		strcpy( buf, cache.buf );
+	if (nh == cache.nh) {
+		assert(bufsz > cache.len);
+		strcpy(buf, cache.buf);
 		return bufsz - cache.len;
 	}
 
 	/* extract useful node members
 	 */
-	np = Node_map( nh );
+	np = Node_map(nh);
 	parh = np->n_parh;
 	ino = np->n_ino;
 	gen = np->n_gen;
 	nrh = np->n_nrh;
-	Node_unmap( nh, &np );
+	Node_unmap(nh, &np);
 
 	/* build path to parent
 	 */
 	oldbuf = buf;
 	oldbufsz = bufsz;
-	bufsz = Node2path_recurse( parh, buf, bufsz, level+1 ); /* RECURSION */
-	if ( bufsz <= 0 ) {
+	bufsz = Node2path_recurse(parh, buf, bufsz, level+1); /* RECURSION */
+	if (bufsz <= 0) {
 		return bufsz;
 	}
 	buf += oldbufsz - bufsz;
 
 	/* insert slash if parent not root
 	 */
-	if ( parh != persp->p_rooth ) {
-		assert( bufsz + MAXPATHLEN >= 2 );
+	if (parh != persp->p_rooth) {
+		assert(bufsz + MAXPATHLEN >= 2);
 		*buf++ = '/';
-		*( buf + 1 ) = 0;
+		*(buf + 1) = 0;
 		bufsz--;
-		if ( bufsz <= 0 ) {
+		if (bufsz <= 0) {
 			return bufsz;
 		}
 	}
 
 	/* append entry name: special case if in orphanage
 	 */
-	if ( parh == persp->p_orphh ) {
-		namelen = sprintf( buf, "%llu.%u", (unsigned long long)ino, gen );
-	} else if ( nh == persp->p_orphh ) {
-		namelen = sprintf( buf, "%s", orphname );
+	if (parh == persp->p_orphh) {
+		namelen = sprintf(buf, "%llu.%u", (unsigned long long)ino, gen);
+	} else if (nh == persp->p_orphh) {
+		namelen = sprintf(buf, "%s", orphname);
 	} else {
-		assert( nrh != NRH_NULL );
-		namelen = namreg_get( nrh, buf, ( size_t )bufsz + MAXPATHLEN );
-		assert( namelen > 0 );
+		assert(nrh != NRH_NULL);
+		namelen = namreg_get(nrh, buf, (size_t)bufsz + MAXPATHLEN);
+		assert(namelen > 0);
 	}
 
 	/* update remaining buffer size
 	 */
 	bufsz -= namelen;
-	assert( bufsz + MAXPATHLEN > 0 );
+	assert(bufsz + MAXPATHLEN > 0);
 
 	/* update the cache if we're the target's parent
 	 * (and the pathname is not too long)
 	 */
-	if ( level == 1 && bufsz > 0 ) {
+	if (level == 1 && bufsz > 0) {
 		cache.nh = nh;
-		strcpy( cache.buf, oldbuf );
+		strcpy(cache.buf, oldbuf);
 		cache.len = oldbufsz - bufsz;
 	}
 
@@ -3602,7 +3602,7 @@
 /* family abstraction *********************************************************/
 
 static void
-adopt( nh_t parh, nh_t cldh, nrh_t nrh )
+adopt(nh_t parh, nh_t cldh, nrh_t nrh)
 {
 	node_t *parp;
 	node_t *cldp;
@@ -3615,61 +3615,61 @@
 #endif
 
 	/* fix up our child - put at front of child list */
-	cldp = Node_map( cldh );
+	cldp = Node_map(cldh);
 	cldp->n_parh = parh;
 	cldp->n_nrh = nrh;
-	parp = Node_map( parh );
+	parp = Node_map(parh);
 	cldp->n_sibh = parp->n_cldh;
 	cldp->n_sibprevh = NH_NULL;
-	Node_unmap( cldh, &cldp  );
+	Node_unmap(cldh, &cldp);
 
 	/* fix up old first child i.e. child's new sibling */
-	if ( parp->n_cldh != NH_NULL ) { /* if parent has a child */
-	    sibp = Node_map( parp->n_cldh );
+	if (parp->n_cldh != NH_NULL) { /* if parent has a child */
+	    sibp = Node_map(parp->n_cldh);
 	    sibp->n_sibprevh = cldh;
-	    Node_unmap( parp->n_cldh, &sibp );
+	    Node_unmap(parp->n_cldh, &sibp);
 	}
 
         /* fix up parent */
 	parp->n_cldh = cldh;
-	Node_unmap( parh, &parp  );
+	Node_unmap(parh, &parp);
 }
 
 static nrh_t
-disown( nh_t cldh )
+disown(nh_t cldh)
 {
 	node_t *cldp;
 	nrh_t nrh;
 	nh_t parh;
 	node_t *parp;
 
-	cldp = Node_map( cldh );
+	cldp = Node_map(cldh);
 
 	nrh = cldp->n_nrh;
 
 	parh = cldp->n_parh;
-	assert( parh != NH_NULL );
-	if ( parh == NH_NULL ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+	assert(parh != NH_NULL);
+	if (parh == NH_NULL) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 		      "attempt to disown child "
-		      "which has no parent!\n") );
+		      "which has no parent!\n"));
 		return nrh;
 	}
-	parp = Node_map( parh );
-	assert( parp->n_cldh != NH_NULL );
-	if ( parp->n_cldh == NH_NULL ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+	parp = Node_map(parh);
+	assert(parp->n_cldh != NH_NULL);
+	if (parp->n_cldh == NH_NULL) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 		      "attempt to disown child "
-		      "when parent has no children!\n") );
+		      "when parent has no children!\n"));
 		return nrh;
 	}
-	if ( parp->n_cldh == cldh ) {
+	if (parp->n_cldh == cldh) {
 		/* child is the first one in the child list */
 		parp->n_cldh = cldp->n_sibh;
-		if ( cldp->n_sibh != NH_NULL ) {
-			node_t *sibp = Node_map( cldp->n_sibh );
+		if (cldp->n_sibh != NH_NULL) {
+			node_t *sibp = Node_map(cldp->n_sibh);
 			sibp->n_sibprevh = NH_NULL;
-			Node_unmap( cldp->n_sibh, &sibp );
+			Node_unmap(cldp->n_sibh, &sibp);
 		}
 	} else {
 		/* child is further down the child list */
@@ -3678,24 +3678,24 @@
 		node_t *prevcldp;
 
 		assert(prevcldh != NH_NULL); /* must be a previous */
-		prevcldp = Node_map( prevcldh );
+		prevcldp = Node_map(prevcldh);
 
 		/* fix up previous */
 		prevcldp->n_sibh = cldp->n_sibh;
-		Node_unmap( prevcldh, &prevcldp  );
+		Node_unmap(prevcldh, &prevcldp);
 
 		/* fix up next */
-		if ( cldp->n_sibh != NH_NULL ) {
-			node_t *sibp = Node_map( cldp->n_sibh );
+		if (cldp->n_sibh != NH_NULL) {
+			node_t *sibp = Node_map(cldp->n_sibh);
 			sibp->n_sibprevh = prevcldh;
-			Node_unmap( cldp->n_sibh, &sibp );
+			Node_unmap(cldp->n_sibh, &sibp);
 		}
 	}
-	Node_unmap( parh, &parp  );
+	Node_unmap(parh, &parp);
 	cldp->n_parh = NH_NULL;
 	cldp->n_sibh = NH_NULL;
 	cldp->n_sibprevh = NH_NULL;
-	Node_unmap( cldh, &cldp  );
+	Node_unmap(cldh, &cldp);
 
 	return nrh;
 }
@@ -3706,65 +3706,65 @@
  * any nondirs which might need to be restored.
  */
 static void
-selsubtree( nh_t nh, bool_t sensepr )
+selsubtree(nh_t nh, bool_t sensepr)
 {
 	node_t *np;
 	nh_t parh;
 
 	/* first mark the subtree
 	 */
-	selsubtree_recurse_down( nh, sensepr );
+	selsubtree_recurse_down(nh, sensepr);
 
 	/* get parent
 	 */
-	np = Node_map( nh );
+	np = Node_map(nh);
 	parh = np->n_parh;
-	Node_unmap( nh, &np );
+	Node_unmap(nh, &np);
 
 	/* next adjust ancestory
 	 */
-	while ( parh != NH_NULL ) {
+	while (parh != NH_NULL) {
 		node_t *parp;
 		nh_t newparh;
 
-		parp = Node_map( parh );
-		if ( sensepr ) {
+		parp = Node_map(parh);
+		if (sensepr) {
 			parp->n_flags |= NF_SUBTREE;
 		} else {
 			bool_t atleastonechildselpr = BOOL_FALSE;
 			nh_t cldh = parp->n_cldh;
-			while ( cldh != NH_NULL ) {
+			while (cldh != NH_NULL) {
 				node_t *cldp;
 				nh_t nextcldh;
 				bool_t cldsensepr;
-				cldp = Node_map( cldh );
-				cldsensepr = ( cldp->n_flags & NF_SUBTREE )
+				cldp = Node_map(cldh);
+				cldsensepr = (cldp->n_flags & NF_SUBTREE)
 					     ?
 					     BOOL_TRUE
 					     :
 					     BOOL_FALSE;
 				nextcldh = cldp->n_sibh;
-				Node_unmap( cldh, &cldp );
-				if ( cldsensepr ) {
+				Node_unmap(cldh, &cldp);
+				if (cldsensepr) {
 					atleastonechildselpr = BOOL_TRUE;
 					break;
 				}
 				cldh = nextcldh;
 			}
-			if ( ! atleastonechildselpr ) {
+			if (! atleastonechildselpr) {
 				parp->n_flags &= ~NF_SUBTREE;
 				/* DBG could break out here (remember to unmap!)
 				 */
 			}
 		}
 		newparh = parp->n_parh;
-		Node_unmap( parh, &parp );
+		Node_unmap(parh, &parp);
 		parh = newparh;
 	}
 }
 
 static void
-selsubtree_recurse_down( nh_t nh, bool_t sensepr )
+selsubtree_recurse_down(nh_t nh, bool_t sensepr)
 {
 	nh_t cldh;
 
@@ -3776,8 +3776,8 @@
 		xfs_ino_t ino;
 		gen_t gen;
 
-		np = Node_map( nh );
-		if ( sensepr ) {
+		np = Node_map(nh);
+		if (sensepr) {
 			np->n_flags |= NF_SUBTREE;
 		} else {
 			np->n_flags &= ~NF_SUBTREE;
@@ -3785,33 +3785,33 @@
 		cldh = np->n_cldh;
 		ino = np->n_ino;
 		gen = np->n_gen;
-		isdirpr = ( np->n_flags & NF_ISDIR );
-		Node_unmap( nh, &np  );
-		if ( ! isdirpr ) {
-			if ( sensepr ) {
-				inomap_rst_add( ino );
+		isdirpr = (np->n_flags & NF_ISDIR);
+		Node_unmap(nh, &np);
+		if (! isdirpr) {
+			if (sensepr) {
+				inomap_rst_add(ino);
 			} else {
 				/* check hardlist: don't del unless none needed
 				 */
 				nh_t nh;
 				bool_t neededpr = BOOL_FALSE;
-				for ( nh = link_hardh( ino, gen )
+				for (nh = link_hardh(ino, gen)
 				      ;
 				      nh != NH_NULL
 				      ;
-				      nh = link_nexth( nh )) {
+				      nh = link_nexth(nh)) {
 					node_t *np;
 					u_char_t flags;
-					np = Node_map( nh );
+					np = Node_map(nh);
 					flags = np->n_flags;
-					Node_unmap( nh, &np  );
-					if ( flags & NF_SUBTREE ) {
+					Node_unmap(nh, &np);
+					if (flags & NF_SUBTREE) {
 						neededpr = BOOL_TRUE;
 						break;
 					}
 				}
-				if ( ! neededpr ) {
-					inomap_rst_del( ino );
+				if (! neededpr) {
+					inomap_rst_del(ino);
 				}
 			}
 		}
@@ -3819,16 +3819,16 @@
 
 	/* then mark all of its children. be sure to skip the orphanage!!!
 	 */
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		nh_t nextcldh;
 
-		if ( cldh != persp->p_orphh ) {
-			selsubtree_recurse_down( cldh, sensepr );
+		if (cldh != persp->p_orphh) {
+			selsubtree_recurse_down(cldh, sensepr);
 		}
-		cldp = Node_map( cldh );
+		cldp = Node_map(cldh);
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp  );
+		Node_unmap(cldh, &cldp);
 		cldh = nextcldh;
 	}
 }
@@ -3839,22 +3839,22 @@
 /* returns handle to head of hard link list
  */
 static nh_t
-link_hardh( xfs_ino_t ino, gen_t gen )
+link_hardh(xfs_ino_t ino, gen_t gen)
 {
-	return hash_find( ino, gen );
+	return hash_find(ino, gen);
 }
 
 /* returns following node in hard link list
  */
 static nh_t
-link_nexth( nh_t nh )
+link_nexth(nh_t nh)
 {
 	node_t *np;
 	nh_t nexth;
 
-	np = Node_map( nh );
+	np = Node_map(nh);
 	nexth = np->n_lnkh;
-	Node_unmap( nh, &np );
+	Node_unmap(nh, &np);
 	return nexth;
 }
 
@@ -3862,33 +3862,33 @@
  * returns hard link list head
  */
 static nh_t
-link_matchh( nh_t hardh, nh_t parh, char *name )
+link_matchh(nh_t hardh, nh_t parh, char *name)
 {
-	while ( hardh != NH_NULL ) {
+	while (hardh != NH_NULL) {
 		node_t *np;
 		nh_t nexth;
-		np = Node_map( hardh );
-		if ( np->n_parh == parh ) {
+		np = Node_map(hardh);
+		if (np->n_parh == parh) {
 			/* REFERENCED */
 			int namelen;
-			namelen = namreg_get( np->n_nrh,
+			namelen = namreg_get(np->n_nrh,
 					      tranp->t_namebuf,
-					      sizeof( tranp->t_namebuf ));
-			assert( namelen > 0 );
-			if ( ! strcmp( name, tranp->t_namebuf )) {
-				Node_unmap( hardh, &np );
+					      sizeof(tranp->t_namebuf));
+			assert(namelen > 0);
+			if (! strcmp(name, tranp->t_namebuf)) {
+				Node_unmap(hardh, &np);
 				break;
 			}
 		}
 		nexth = np->n_lnkh;
-		Node_unmap( hardh, &np );
+		Node_unmap(hardh, &np);
 		hardh = nexth;
 	}
 	return hardh;
 }
 
 static void
-link_in( nh_t nh )
+link_in(nh_t nh)
 {
 	node_t *np;
 	xfs_ino_t ino;
@@ -3902,45 +3902,45 @@
 
 	/* map in the node to read ino and gen
 	 */
-	np = Node_map( nh );
+	np = Node_map(nh);
 	ino = np->n_ino;
 	gen = np->n_gen;
 
 	/* see if one or more links already hashed.
 	 */
-	hardh = hash_find( ino, gen );
+	hardh = hash_find(ino, gen);
 
 	/* if not hashed, just hash it. otherwise put at end
 	 * of hard link (lnk) list.
 	 */
-	if ( hardh == NH_NULL ) {
+	if (hardh == NH_NULL) {
 #ifdef TREE_DEBUG
 		mlog(MLOG_DEBUG | MLOG_TREE,
 		    "link_in(): hash node in for ino %llu\n", ino);
 #endif
-		hash_in( nh );
+		hash_in(nh);
 	} else {
 		nh_t prevh = hardh;
-		node_t *prevp = Node_map( prevh );
+		node_t *prevp = Node_map(prevh);
 #ifdef TREE_DEBUG
 		mlog(MLOG_DEBUG | MLOG_TREE,
 		    "link_in(): put at end of hash list\n");
 #endif
-		while ( prevp->n_lnkh != NH_NULL ) {
+		while (prevp->n_lnkh != NH_NULL) {
 			nh_t nexth = prevp->n_lnkh;
-			Node_unmap( prevh, &prevp  );
+			Node_unmap(prevh, &prevp);
 			prevh = nexth;
-			prevp = Node_map( prevh );
+			prevp = Node_map(prevh);
 		}
 		prevp->n_lnkh = nh;
-		Node_unmap( prevh, &prevp  );
+		Node_unmap(prevh, &prevp);
 	}
 
 	/* since always put at end of hard link list, make node's
 	 * lnk member terminate list.
 	 */
 	np->n_lnkh = NH_NULL;
-	Node_unmap( nh, &np  );
+	Node_unmap(nh, &np);
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE,
 	    "link_in(%llu): UNmap in node\n", nh);
@@ -3948,7 +3948,7 @@
 }
 
 static void
-link_out( nh_t nh )
+link_out(nh_t nh)
 {
 	node_t *np;
 	xfs_ino_t ino;
@@ -3957,58 +3957,58 @@
 
 	/* map in the node to read ino and gen
 	 */
-	np = Node_map( nh );
+	np = Node_map(nh);
 	ino = np->n_ino;
 	gen = np->n_gen;
 
 	/* get head of hard link list
 	 */
-	hardh = hash_find( ino, gen );
-	assert( hardh != NH_NULL );
+	hardh = hash_find(ino, gen);
+	assert(hardh != NH_NULL);
 
 	/* if node is at head of hard link list, hash it out and
 	 * hash in the following node in link list, if there is one.
 	 * otherwise, unlink from hardlink list.
 	 */
-	if ( nh == hardh ) {
-		hash_out( nh );
-		if ( np->n_lnkh != NH_NULL ) {
-			hash_in( np->n_lnkh );
+	if (nh == hardh) {
+		hash_out(nh);
+		if (np->n_lnkh != NH_NULL) {
+			hash_in(np->n_lnkh);
 		}
 	} else {
 		nh_t prevh = hardh;
-		node_t *prevp = Node_map( prevh );
-		while ( prevp->n_lnkh != nh ) {
+		node_t *prevp = Node_map(prevh);
+		while (prevp->n_lnkh != nh) {
 			nh_t nexth = prevp->n_lnkh;
-			Node_unmap( prevh, &prevp  );
+			Node_unmap(prevh, &prevp);
 			prevh = nexth;
-			assert( prevh != NH_NULL );
-			prevp = Node_map( prevh );
+			assert(prevh != NH_NULL);
+			prevp = Node_map(prevh);
 		}
 		prevp->n_lnkh = np->n_lnkh;
-		Node_unmap( prevh, &prevp  );
+		Node_unmap(prevh, &prevp);
 	}
 	np->n_lnkh = NH_NULL;
 
 	/* release the mapping
 	 */
-	Node_unmap( nh, &np  );
+	Node_unmap(nh, &np);
 }
 
 /* invokes callback for all hardheads
  * iteration aborted if callback returns FALSE
  */
 static void
-link_headiter( bool_t ( * cbfp )( void *contextp, nh_t hardh ), void *contextp )
+link_headiter(bool_t (* cbfp)(void *contextp, nh_t hardh), void *contextp)
 {
-	hash_iter( cbfp, contextp );
+	hash_iter(cbfp, contextp);
 }
 
 /* iterator for a hard link list. allows deletion of the last node
  * returned.
  */
 static void
-link_iter_init( link_iter_context_t *link_iter_contextp, nh_t hardheadh )
+link_iter_init(link_iter_context_t *link_iter_contextp, nh_t hardheadh)
 {
 	link_iter_contextp->li_headh = hardheadh;
 	link_iter_contextp->li_prevh = NH_NULL;
@@ -4017,20 +4017,20 @@
 }
 
 static nh_t
-link_iter_next( link_iter_context_t *link_iter_contextp )
+link_iter_next(link_iter_context_t *link_iter_contextp)
 {
 	node_t *lastp;
 	nh_t tmplasth;
 
 	/* if already done, return
 	 */
-	if ( link_iter_contextp->li_donepr == BOOL_TRUE ) {
+	if (link_iter_contextp->li_donepr == BOOL_TRUE) {
 		return NH_NULL;
 	}
 
 	/* if no hardhead, done
 	 */
-	if ( link_iter_contextp->li_headh == NH_NULL ) {
+	if (link_iter_contextp->li_headh == NH_NULL) {
 		link_iter_contextp->li_donepr = BOOL_TRUE;
 		return NH_NULL;
 	}
@@ -4041,8 +4041,8 @@
 
 	/* if no last, must be first call
 	 */
-	if ( tmplasth == NH_NULL ) {
-		assert( link_iter_contextp->li_prevh == NH_NULL );
+	if (tmplasth == NH_NULL) {
+		assert(link_iter_contextp->li_prevh == NH_NULL);
 		link_iter_contextp->li_lasth = link_iter_contextp->li_headh;
 		return link_iter_contextp->li_lasth;
 	}
@@ -4050,13 +4050,13 @@
 	/* slide last into prev
 	 */
 	link_iter_contextp->li_prevh = tmplasth;
-	lastp = Node_map( tmplasth );
+	lastp = Node_map(tmplasth);
 	link_iter_contextp->li_lasth = lastp->n_lnkh;
-	Node_unmap( tmplasth, &lastp );
+	Node_unmap(tmplasth, &lastp);
 
 	/* if NULL, flag done
 	 */
-	if ( link_iter_contextp->li_lasth == NH_NULL ) {
+	if (link_iter_contextp->li_lasth == NH_NULL) {
 		link_iter_contextp->li_donepr = BOOL_TRUE;
 	}
 
@@ -4067,36 +4067,36 @@
 
 /* ARGSUSED */
 void
-link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
+link_iter_unlink(link_iter_context_t *link_iter_contextp, nh_t nh)
 {
 	node_t *lastp;
 	nh_t nexth;
 
 	/* sanity checks
 	 */
-	assert( link_iter_contextp->li_lasth != NH_NULL );
-	assert( nh == link_iter_contextp->li_lasth );
+	assert(link_iter_contextp->li_lasth != NH_NULL);
+	assert(nh == link_iter_contextp->li_lasth);
 
 	/* get the next node in list
 	 */
-	lastp = Node_map( link_iter_contextp->li_lasth );
+	lastp = Node_map(link_iter_contextp->li_lasth);
 	nexth = lastp->n_lnkh;
 	lastp->n_lnkh = NH_NULL;
-	Node_unmap( link_iter_contextp->li_lasth, &lastp );
+	Node_unmap(link_iter_contextp->li_lasth, &lastp);
 
-	if ( link_iter_contextp->li_lasth == link_iter_contextp->li_headh ) {
-		assert( link_iter_contextp->li_prevh == NH_NULL );
-		hash_out( link_iter_contextp->li_headh );
+	if (link_iter_contextp->li_lasth == link_iter_contextp->li_headh) {
+		assert(link_iter_contextp->li_prevh == NH_NULL);
+		hash_out(link_iter_contextp->li_headh);
 		link_iter_contextp->li_headh = nexth;
-		if ( nexth != NH_NULL ) {
-			hash_in( nexth );
+		if (nexth != NH_NULL) {
+			hash_in(nexth);
 		}
 	} else {
 		node_t *prevp;
-		assert( link_iter_contextp->li_prevh != NH_NULL );
-		prevp = Node_map( link_iter_contextp->li_prevh );
+		assert(link_iter_contextp->li_prevh != NH_NULL);
+		prevp = Node_map(link_iter_contextp->li_prevh);
 		prevp->n_lnkh = nexth;
-		Node_unmap( link_iter_contextp->li_prevh, &prevp );
+		Node_unmap(link_iter_contextp->li_prevh, &prevp);
 	}
 	link_iter_contextp->li_lasth = link_iter_contextp->li_prevh;
 	link_iter_contextp->li_prevh = NH_NULL;
@@ -4105,13 +4105,13 @@
 
 /* hash abstraction *********************************************************/
 
-#define HASHLEN_MIN	( pgsz / sizeof( nh_t ))
+#define HASHLEN_MIN	(pgsz / sizeof(nh_t))
 
 static bool_t
-hash_init( size64_t vmsz,
+hash_init(size64_t vmsz,
 	   size64_t dircnt,
 	   size64_t nondircnt,
-	   char *perspath )
+	   char *perspath)
 {
 	size64_t hashlen;
 	size64_t loghashlen;
@@ -4121,94 +4121,94 @@
 
 	/* sanity checks
 	 */
-	assert( pgsz % sizeof( nh_t ) == 0 );
+	assert(pgsz % sizeof(nh_t) == 0);
 
 	/* calculate the size of the hash array. must be a power of two,
 	 * and a multiple of the page size. don't use more than the available
 	 * vm. but enforce a minimum.
 	 */
-	vmlen = vmsz / sizeof( nh_t );
-	hashlenmax = min( vmlen, SIZEMAX );
-	hashlen = ( dircnt + nondircnt );
-	hashlen = max( hashlen, ( size64_t )HASHLEN_MIN );
-	hashlen = min( hashlen, hashlenmax );
+	vmlen = vmsz / sizeof(nh_t);
+	hashlenmax = min(vmlen, SIZEMAX);
+	hashlen = (dircnt + nondircnt);
+	hashlen = max(hashlen, (size64_t)HASHLEN_MIN);
+	hashlen = min(hashlen, hashlenmax);
 
-	for ( loghashlen = 0
+	for (loghashlen = 0
 	      ;
-	      ( ( size64_t )1 << loghashlen ) <= hashlen
+	      ((size64_t)1 << loghashlen) <= hashlen
 	      ;
-	      loghashlen++ )
+	      loghashlen++)
 		;
-	assert( loghashlen > 0 );
-	hashlen = ( size64_t )1 << loghashlen;
+	assert(loghashlen > 0);
+	hashlen = (size64_t)1 << loghashlen;
 	if (hashlen > hashlenmax)
 		hashlen >>= 1;
-	assert( hashlen <= hashlenmax );
+	assert(hashlen <= hashlenmax);
 
 	/* record hash size in persistent state
 	 */
-	persp->p_hashsz = hashlen * sizeof( nh_t );
+	persp->p_hashsz = hashlen * sizeof(nh_t);
 
 	/* map the hash array just after the persistent state header
 	 */
-	assert( persp->p_hashsz <= SIZEMAX );
-	assert( ! ( persp->p_hashsz % ( size64_t )pgsz ));
-	assert( ! ( PERSSZ % pgsz ));
-	tranp->t_hashp = ( nh_t * ) mmap_autogrow(
-					    ( size_t )persp->p_hashsz,
+	assert(persp->p_hashsz <= SIZEMAX);
+	assert(! (persp->p_hashsz % (size64_t)pgsz));
+	assert(! (PERSSZ % pgsz));
+	tranp->t_hashp = (nh_t *) mmap_autogrow(
+					    (size_t)persp->p_hashsz,
 					    tranp->t_persfd,
-					    ( off64_t )PERSSZ );
-	if ( tranp->t_hashp == ( nh_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_TREE, _(
+					    (off64_t)PERSSZ);
+	if (tranp->t_hashp == (nh_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_TREE, _(
 		      "unable to mmap hash array into %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
 	/* initialize the hash array to all NULL node handles
 	 */
-	for ( hix = 0 ; hix < ( ix_t )hashlen ; hix++ ) {
-		tranp->t_hashp[ hix ] = NH_NULL;
+	for (hix = 0 ; hix < (ix_t)hashlen ; hix++) {
+		tranp->t_hashp[hix] = NH_NULL;
 	}
 
 	/* build a hash mask. this works because hashlen is a power of two.
 	 * record in persistent state.
 	 */
-	assert( hashlen - 1 <= SIZEMAX );
-	persp->p_hashmask = ( size_t )( hashlen - 1 );
+	assert(hashlen - 1 <= SIZEMAX);
+	persp->p_hashmask = (size_t)(hashlen - 1);
 
 	return BOOL_TRUE;
 }
 
 static bool_t
-hash_sync( char *perspath )
+hash_sync(char *perspath)
 {
 	size64_t hashsz;
 
 	/* sanity checks
 	 */
-	assert( pgsz % sizeof( nh_t ) == 0 );
+	assert(pgsz % sizeof(nh_t) == 0);
 
 	/* retrieve the hash size from the persistent state
 	 */
 	hashsz = persp->p_hashsz;
-	assert( ! ( hashsz % sizeof( nh_t )));
+	assert(! (hashsz % sizeof(nh_t)));
 
 	/* map the hash array just after the persistent state header
 	 */
-	assert( hashsz <= SIZEMAX );
-	assert( ! ( hashsz % ( size64_t )pgsz ));
-	assert( ! ( PERSSZ % pgsz ));
-	tranp->t_hashp = ( nh_t * ) mmap_autogrow(
-					    ( size_t )hashsz,
+	assert(hashsz <= SIZEMAX);
+	assert(! (hashsz % (size64_t)pgsz));
+	assert(! (PERSSZ % pgsz));
+	tranp->t_hashp = (nh_t *) mmap_autogrow(
+					    (size_t)hashsz,
 					    tranp->t_persfd,
-					    ( off64_t )PERSSZ );
-	if ( tranp->t_hashp == ( nh_t * )-1 ) {
-		mlog( MLOG_NORMAL | MLOG_TREE, _(
+					    (off64_t)PERSSZ);
+	if (tranp->t_hashp == (nh_t *)-1) {
+		mlog(MLOG_NORMAL | MLOG_TREE, _(
 		      "unable to mmap hash array into %s: %s\n"),
 		      perspath,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -4228,7 +4228,7 @@
 }
 
 static void
-hash_in( nh_t nh )
+hash_in(nh_t nh)
 {
 	node_t *np;
 	xfs_ino_t ino;
@@ -4237,7 +4237,7 @@
 
 	/* get a mapping to the node
 	 */
-	np = Node_map( nh );
+	np = Node_map(nh);
 
 	/* get ino from node
 	 */
@@ -4245,7 +4245,7 @@
 
 	/* assert not already in
 	 */
-	assert( hash_find( np->n_ino, np->n_gen ) == NH_NULL );
+	assert(hash_find(np->n_ino, np->n_gen) == NH_NULL);
 
 	/* calculate the hash index
 	 */
@@ -4253,21 +4253,21 @@
 
 	/* get a pointer to the indexed hash array entry
 	 */
-	entryp = &tranp->t_hashp[ hix ];
+	entryp = &tranp->t_hashp[hix];
 
 	/* insert into the list, at the head
 	 */
-	assert( np->n_hashh == NH_NULL );
+	assert(np->n_hashh == NH_NULL);
 	np->n_hashh = *entryp;
 	*entryp = nh;
 
 	/* release the mapping
 	 */
-	Node_unmap( nh, &np  );
+	Node_unmap(nh, &np);
 }
 
 static void
-hash_out( nh_t nh )
+hash_out(nh_t nh)
 {
 	node_t *np;
 	xfs_ino_t ino;
@@ -4277,7 +4277,7 @@
 
 	/* get a mapping to the node
 	 */
-	np = Node_map( nh );
+	np = Node_map(nh);
 
 	/* get the ino
 	 */
@@ -4286,40 +4286,40 @@
 	/* get a pointer to the hash array entry
 	 */
 	hix = hash_val(ino, persp->p_hashmask);
-	entryp = &tranp->t_hashp[ hix ];
+	entryp = &tranp->t_hashp[hix];
 
 	/* get the handle of the first node in the appropriate hash array
 	 */
 	hashheadh = *entryp;
-	assert( hashheadh != NH_NULL );
+	assert(hashheadh != NH_NULL);
 
 	/* if node is first in list, replace entry with following node.
 	 * otherwise, walk the list until found.
 	 */
-	if ( hashheadh == nh ) {
+	if (hashheadh == nh) {
 		*entryp = np->n_hashh;
 	} else {
 		nh_t prevh = hashheadh;
-		node_t *prevp = Node_map( prevh );
-		while ( prevp->n_hashh != nh ) {
+		node_t *prevp = Node_map(prevh);
+		while (prevp->n_hashh != nh) {
 			nh_t nexth = prevp->n_hashh;
-			Node_unmap( prevh, &prevp  );
+			Node_unmap(prevh, &prevp);
 			prevh = nexth;
-			assert( prevh != NH_NULL );
-			prevp = Node_map( prevh );
+			assert(prevh != NH_NULL);
+			prevp = Node_map(prevh);
 		}
 		prevp->n_hashh = np->n_hashh;
-		Node_unmap( prevh, &prevp  );
+		Node_unmap(prevh, &prevp);
 	}
 	np->n_hashh = NH_NULL;
 
 	/* release the mapping
 	 */
-	Node_unmap( nh, &np  );
+	Node_unmap(nh, &np);
 }
 
 static nh_t
-hash_find( xfs_ino_t ino, gen_t gen )
+hash_find(xfs_ino_t ino, gen_t gen)
 {
 	nh_t nh;
 	node_t *np;
@@ -4328,11 +4328,11 @@
 	/* get handle to first node in appropriate hash array
 	 */
 	hix = hash_val(ino, persp->p_hashmask);
-	nh = tranp->t_hashp[ hix ];
+	nh = tranp->t_hashp[hix];
 
 	/* if list empty, return null handle
 	 */
-	if ( nh == NH_NULL ) {
+	if (nh == NH_NULL) {
 		return NH_NULL;
 	}
 
@@ -4344,17 +4344,17 @@
 
 	/* walk the list until found.
 	 */
-	np = Node_map( nh );
-	while ( np->n_ino != ino || np->n_gen != gen ) {
+	np = Node_map(nh);
+	while (np->n_ino != ino || np->n_gen != gen) {
 		nh_t nextnh = np->n_hashh;
-		Node_unmap( nh, &np  );
+		Node_unmap(nh, &np);
 		nh = nextnh;
-		if ( nh == NH_NULL ) {
+		if (nh == NH_NULL) {
 			return NH_NULL;
 		}
-		np = Node_map( nh );
+		np = Node_map(nh);
 	}
-	Node_unmap( nh, &np  );
+	Node_unmap(nh, &np);
 
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE,
@@ -4369,25 +4369,25 @@
  * must figure next node prior to calling callback.
  */
 static void
-hash_iter( bool_t ( * cbfp )( void *contextp, nh_t hashh ), void *contextp )
+hash_iter(bool_t (* cbfp)(void *contextp, nh_t hashh), void *contextp)
 {
 	ix_t hix;
-	size64_t hashlen = persp->p_hashsz / sizeof( nh_t );
+	size64_t hashlen = persp->p_hashsz / sizeof(nh_t);
 
-	for ( hix = 0 ; hix < ( ix_t )hashlen ; hix++ ) {
-		nh_t nh = tranp->t_hashp[ hix ];
+	for (hix = 0 ; hix < (ix_t)hashlen ; hix++) {
+		nh_t nh = tranp->t_hashp[hix];
 
-		while ( nh != NH_NULL ) {
+		while (nh != NH_NULL) {
 			node_t *np;
 			nh_t nexth;
 			bool_t ok;
 
-			np = Node_map( nh );
+			np = Node_map(nh);
 			nexth = np->n_hashh;
-			Node_unmap( nh, &np );
+			Node_unmap(nh, &np);
 
-			ok = ( * cbfp )( contextp, nh );
-			if ( ! ok ) {
+			ok = (* cbfp)(contextp, nh);
+			if (! ok) {
 				return;
 			}
 
@@ -4404,75 +4404,75 @@
  * and sibling handles.
  */
 static bool_t
-Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp )
+Node_chk(nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp)
 {
 	node_t *np;
 	node_t n;
-	char nambuf[ NAME_MAX + 1 ];
+	char nambuf[NAME_MAX + 1];
 	bool_t okaccum;
 
-	mlog( MLOG_NITTY + 1 | MLOG_TREE,
+	mlog(MLOG_NITTY + 1 | MLOG_TREE,
 	      "checking node nh == 0x%x\n",
-	      nh );
+	      nh);
 
 	okaccum = BOOL_TRUE;
 
-	if ( nexthashhp ) {
+	if (nexthashhp) {
 		*nexthashhp = NH_NULL;
 	}
 
-	assert( nextlnkhp );
+	assert(nextlnkhp);
 	*nextlnkhp = NH_NULL;
 
-	np = Node_map( nh );
-	assert( np );
+	np = Node_map(nh);
+	assert(np);
 	n = *np;
-	Node_unmap( nh, &np );
+	Node_unmap(nh, &np);
 
-	if ( ! nexthashhp && n.n_hashh != NH_NULL ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
+	if (! nexthashhp && n.n_hashh != NH_NULL) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
 		      "nh 0x%x np 0x%x hash link not null\n"),
 		      nh,
-		      np );
+		      np);
 		okaccum = BOOL_FALSE;
 	}
 
-	if ( n.n_hashh != NH_NULL ) {
-		np = Node_map( n.n_hashh );
-		Node_unmap( n.n_hashh, &np );
+	if (n.n_hashh != NH_NULL) {
+		np = Node_map(n.n_hashh);
+		Node_unmap(n.n_hashh, &np);
 	}
 
-	if ( n.n_lnkh != NH_NULL ) {
-		np = Node_map( n.n_lnkh );
-		Node_unmap( n.n_lnkh, &np );
+	if (n.n_lnkh != NH_NULL) {
+		np = Node_map(n.n_lnkh);
+		Node_unmap(n.n_lnkh, &np);
 	}
 
-	if ( n.n_parh != NH_NULL ) {
-		np = Node_map( n.n_parh );
-		Node_unmap( n.n_parh, &np );
+	if (n.n_parh != NH_NULL) {
+		np = Node_map(n.n_parh);
+		Node_unmap(n.n_parh, &np);
 	}
 
-	if ( n.n_cldh != NH_NULL ) {
-		np = Node_map( n.n_cldh );
-		Node_unmap( n.n_cldh, &np );
+	if (n.n_cldh != NH_NULL) {
+		np = Node_map(n.n_cldh);
+		Node_unmap(n.n_cldh, &np);
 	}
 
-	if ( n.n_sibh != NH_NULL ) {
-		np = Node_map( n.n_sibh );
-		Node_unmap( n.n_sibh, &np );
+	if (n.n_sibh != NH_NULL) {
+		np = Node_map(n.n_sibh);
+		Node_unmap(n.n_sibh, &np);
 	}
 
-	if ( n.n_nrh != NRH_NULL ) {
+	if (n.n_nrh != NRH_NULL) {
 		int rval;
-		rval = namreg_get( n.n_nrh, nambuf, sizeof( nambuf ));
-		assert( rval >= 0 );
+		rval = namreg_get(n.n_nrh, nambuf, sizeof(nambuf));
+		assert(rval >= 0);
 	}
 
-	if ( n.n_dah != DAH_NULL ) {
-		( void )dirattr_get_mode( n.n_dah );
+	if (n.n_dah != DAH_NULL) {
+		(void)dirattr_get_mode(n.n_dah);
 	}
 
-	if ( nexthashhp ) {
+	if (nexthashhp) {
 		*nexthashhp = n.n_hashh;
 	}
 
@@ -4482,75 +4482,75 @@
 }
 
 bool_t
-tree_chk( void )
+tree_chk(void)
 {
 	ix_t hix;
-	size64_t hashlen = persp->p_hashsz / sizeof( nh_t );
+	size64_t hashlen = persp->p_hashsz / sizeof(nh_t);
 	bool_t ok;
 	bool_t okaccum;
 
 	okaccum = BOOL_TRUE;
 
-	for ( hix = 0 ; hix < ( ix_t )hashlen ; hix++ ) {
-		nh_t hashh = tranp->t_hashp[ hix ];
+	for (hix = 0 ; hix < (ix_t)hashlen ; hix++) {
+		nh_t hashh = tranp->t_hashp[hix];
 
-		mlog( MLOG_NITTY + 1 | MLOG_TREE,
+		mlog(MLOG_NITTY + 1 | MLOG_TREE,
 		      "checking hix %u\n",
-		      hix );
-		while ( hashh != NH_NULL ) {
+		      hix);
+		while (hashh != NH_NULL) {
 			nh_t lnkh;
 
-			ok = Node_chk( hashh, &hashh, &lnkh );
-			if ( ! ok ) {
+			ok = Node_chk(hashh, &hashh, &lnkh);
+			if (! ok) {
 				okaccum = BOOL_FALSE;
 			}
 
-			while ( lnkh != NH_NULL ) {
-				ok = Node_chk( lnkh, 0, &lnkh );
-				if ( ! ok ) {
+			while (lnkh != NH_NULL) {
+				ok = Node_chk(lnkh, 0, &lnkh);
+				if (! ok) {
 					okaccum = BOOL_FALSE;
 				}
 			}
 		}
 	}
 
-	ok = tree_chk2( );
-	if ( ! ok ) {
+	ok = tree_chk2();
+	if (! ok) {
 		okaccum = BOOL_FALSE;
 	}
 
 	return okaccum;
 }
 
-static bool_t tree_chk2_recurse( nh_t cldh, nh_t parh );
+static bool_t tree_chk2_recurse(nh_t cldh, nh_t parh);
 
 static bool_t
-tree_chk2( void )
+tree_chk2(void)
 {
 	node_t *rootp;
 	nh_t cldh;
 	bool_t ok;
 
-	mlog( MLOG_DEBUG | MLOG_TREE,
-	      "tree hierarchy check\n" );
+	mlog(MLOG_DEBUG | MLOG_TREE,
+	      "tree hierarchy check\n");
 
-	rootp = Node_map( persp->p_rooth );
+	rootp = Node_map(persp->p_rooth);
 	cldh = rootp->n_cldh;
-	Node_unmap( persp->p_rooth, &rootp );
+	Node_unmap(persp->p_rooth, &rootp);
 
-	ok = tree_chk2_recurse( cldh, persp->p_rooth );
+	ok = tree_chk2_recurse(cldh, persp->p_rooth);
 
 	return ok;
 }
 
 static bool_t
-tree_chk2_recurse( nh_t cldh, nh_t parh )
+tree_chk2_recurse(nh_t cldh, nh_t parh)
 {
 	bool_t okaccum = BOOL_TRUE;
 
-	assert( parh != NH_NULL );
+	assert(parh != NH_NULL);
 
-	while ( cldh != NH_NULL ) {
+	while (cldh != NH_NULL) {
 		node_t *cldp;
 		xfs_ino_t ino;
 		gen_t gen;
@@ -4560,37 +4560,37 @@
 		nh_t nextcldh;
 		bool_t ok;
 
-		cldp = Node_map( cldh );
+		cldp = Node_map(cldh);
 		ino = cldp->n_ino;
 		gen = cldp->n_gen;
 		nodeparh = cldp->n_parh;
 		nrh = cldp->n_nrh;
 		grandcldh = cldp->n_cldh;
 		nextcldh = cldp->n_sibh;
-		Node_unmap( cldh, &cldp );
+		Node_unmap(cldh, &cldp);
 
-		if ( parh == persp->p_orphh ) {
-			sprintf( tranp->t_namebuf, "%llu.%u", ino, gen );
-		} else if ( cldh == persp->p_orphh ) {
-			sprintf( tranp->t_namebuf, "%llu.%u", ino, gen );
+		if (parh == persp->p_orphh) {
+			sprintf(tranp->t_namebuf, "%llu.%u", ino, gen);
+		} else if (cldh == persp->p_orphh) {
+			sprintf(tranp->t_namebuf, "%llu.%u", ino, gen);
 		} else {
 			int namelen;
-			namelen = namreg_get( nrh,
+			namelen = namreg_get(nrh,
 					      tranp->t_namebuf,
-					      sizeof( tranp->t_namebuf ));
-			assert( namelen >= 0 );
+					      sizeof(tranp->t_namebuf));
+			assert(namelen >= 0);
 		}
 
-		if ( nodeparh == NH_NULL ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+		if (nodeparh == NH_NULL) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 			      "node %x %s %llu %u parent NULL\n"),
 			      cldh,
 			      tranp->t_namebuf,
 			      ino,
-			      gen );
+			      gen);
 			return BOOL_FALSE;
-		} else if ( nodeparh != parh ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
+		} else if (nodeparh != parh) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 			      "node %x %s %llu %u parent mismatch: "
 			      "nodepar %x par %x\n"),
 			      cldh,
@@ -4598,19 +4598,19 @@
 			      ino,
 			      gen,
 			      nodeparh,
-			      parh );
+			      parh);
 			return BOOL_FALSE;
 		} else {
-			mlog( MLOG_DEBUG | MLOG_TREE,
+			mlog(MLOG_DEBUG | MLOG_TREE,
 			      "node %x %s %llu %u  parent %x\n",
 			      cldh,
 			      tranp->t_namebuf,
 			      ino,
 			      gen,
-			      parh );
+			      parh);
 		}
-		ok = tree_chk2_recurse( grandcldh, cldh );
-		if ( ! ok ) {
+		ok = tree_chk2_recurse(grandcldh, cldh);
+		if (! ok) {
 			okaccum = BOOL_FALSE;
 		}
 
@@ -4624,14 +4624,14 @@
 
 static char *whites = " \t\r\n\v\f";
 
-static int is_white( char c );
-static void fix_escape( char *string, char *liter );
-static void fix_quoted_span( char *string, char *liter );
-static void collapse_white( char *string, char *liter );
-static size_t distance_to_space( char *s, char *l );
+static int is_white(char c);
+static void fix_escape(char *string, char *liter);
+static void fix_quoted_span(char *string, char *liter);
+static void collapse_white(char *string, char *liter);
+static size_t distance_to_space(char *s, char *l);
 
 static int
-parse( int slotcnt, char **slotbuf, char *string )
+parse(int slotcnt, char **slotbuf, char *string)
 {
 	char *liter;
 	char *s;
@@ -4640,39 +4640,39 @@
 
 	/* sanity checkcs
 	 */
-	assert( slotcnt >= 0 );
+	assert(slotcnt >= 0);
 
 	/* allocate a companion to the input string for identifying
 	 * characters which are to be interpreted literally.
 	 */
-	liter = ( char * )calloc( 1, strlen( string ) + 1 );
-	if ( ! liter ) {
+	liter = (char *)calloc(1, strlen(string) + 1);
+	if (! liter) {
 		return -1;
 	}
 
 	/* pass 1: collapse escape sequences, identifying characters which
 	 * are to be interpreted literally
 	 */
-	for ( s = string, l = liter ; *s ; s++, l++ ) {
-		if ( *s == '\\' && ! *l ) {
-			fix_escape( s, l );
+	for (s = string, l = liter ; *s ; s++, l++) {
+		if (*s == '\\' && ! *l) {
+			fix_escape(s, l);
 		}
 	}
 
 	/* pass 2: collapse quoted spans, identifying characters which
 	 * are to be interpreted literally
 	 */
-	for ( s = string, l = liter ; *s ; s++, l++ ) {
-		if ( *s == '\"' && ! *l ) {
-			fix_quoted_span( s, l );
+	for (s = string, l = liter ; *s ; s++, l++) {
+		if (*s == '\"' && ! *l) {
+			fix_quoted_span(s, l);
 		}
 	}
 
 	/* pass 3: collapse white space spans into a single space
 	 */
-	for ( s = string, l = liter ; *s ; s++, l++ ) {
-		if ( is_white( *s ) && ! *l ) {
-			collapse_white( s, l );
+	for (s = string, l = liter ; *s ; s++, l++) {
+		if (is_white(*s) && ! *l) {
+			collapse_white(s, l);
 		}
 	}
 
@@ -4681,24 +4681,24 @@
 	wordcnt = 0;
 	s = string;
 	l = liter;
-	while ( *s ) {
+	while (*s) {
 		size_t d;
-		if ( wordcnt < ( size_t )slotcnt ) {
-			slotbuf[ wordcnt ] = s;
+		if (wordcnt < (size_t)slotcnt) {
+			slotbuf[wordcnt] = s;
 		}
 		wordcnt++;
-		d = distance_to_space( s, l );
+		d = distance_to_space(s, l);
 		s += d;
 		l += d;
-		if ( *s ) {
+		if (*s) {
 			*s = 0;
 			s++;
 			l++;
 		}
 	}
 
-	free( ( void * )liter );
-	return ( int )wordcnt;
+	free((void *)liter);
+	return (int)wordcnt;
 }
 
 struct escape_table {
@@ -4707,7 +4707,7 @@
 };
 typedef struct escape_table escape_table_t;
 
-static escape_table_t escape_table[ ] = {
+static escape_table_t escape_table[] = {
  {	'n',	'\n' },
  {	't',	'\t' },
  {	'v',	'\v' },
@@ -4719,14 +4719,14 @@
  {	'\\',	'\\' }
 };
 
-static void shrink( char *s, size_t cnt );
-static int is_hex( char c );
-static size_t hex_to_size( char c );
-static int is_octal( char c );
-static size_t octal_to_size( char c );
+static void shrink(char *s, size_t cnt);
+static int is_hex(char c);
+static size_t hex_to_size(char c);
+static int is_octal(char c);
+static size_t octal_to_size(char c);
 
 static void
-fix_escape( char *string, char *liter )
+fix_escape(char *string, char *liter)
 {
 	escape_table_t *ep;
 	escape_table_t *endep;
@@ -4734,129 +4734,129 @@
 	/* first look for special escapes described in table
 	 */
 	ep = escape_table;
-	endep = escape_table + ( sizeof( escape_table )
+	endep = escape_table + (sizeof(escape_table)
 			         /
-			         sizeof( escape_table[ 0 ] ));
-	for ( ; ep < endep ; ep++ ) {
-		if ( string[ 1 ] == ep->sequence ) {
-			string[ 0 ] = ep->substitute;
-			liter[ 0 ] = ( char )1;
-			shrink( &string[ 1 ], 1 );
-			shrink( &liter[ 1 ], 1 );
+			         sizeof(escape_table[0]));
+	for (; ep < endep ; ep++) {
+		if (string[1] == ep->sequence) {
+			string[0] = ep->substitute;
+			liter[0] = (char)1;
+			shrink(&string[1], 1);
+			shrink(&liter[1], 1);
 			return;
 		}
 	}
 
 	/* detect white space escapes
 	 */
-	if ( is_white( string[ 1 ] )) {
-		liter[ 0 ] = ( char )1;
-		shrink( &string[ 0 ], 1 );
-		shrink( &liter[ 1 ], 1 );
+	if (is_white(string[1])) {
+		liter[0] = (char)1;
+		shrink(&string[0], 1);
+		shrink(&liter[1], 1);
 		return;
 	}
 
 	/* detect hex escapes (don't allow null)
 	 */
-	if ( string[ 1 ] == 'x' ) {
+	if (string[1] == 'x') {
 		size_t hexlen;
 		size_t accum;
 		accum = 0;
-		for ( hexlen = 0
+		for (hexlen = 0
 		      ;
-		      hexlen < 2 && is_hex( string[ 2 + hexlen ] )
+		      hexlen < 2 && is_hex(string[2 + hexlen])
 		      ;
-		      hexlen++ ) {
+		      hexlen++) {
 			accum *= 16;
-			accum += hex_to_size( string[ 2 + hexlen ] );
+			accum += hex_to_size(string[2 + hexlen]);
 		}
-		if ( hexlen && accum ) {
-			string[ 0 ] = ( char )accum;
-			liter[ 0 ] = ( char )1;
-			shrink( &string[ 1 ], 1 + hexlen );
-			shrink( &liter[ 1 ], 1 + hexlen );
+		if (hexlen && accum) {
+			string[0] = (char)accum;
+			liter[0] = (char)1;
+			shrink(&string[1], 1 + hexlen);
+			shrink(&liter[1], 1 + hexlen);
 			return;
 		}
 	}
 
 	/* detect octal escapes (don't allow null)
 	 */
-	if ( is_octal( string[ 1 ] )) {
+	if (is_octal(string[1])) {
 		size_t octallen;
 		size_t accum;
-		accum = octal_to_size( string[ 1 ] );
-		for ( octallen = 1
+		accum = octal_to_size(string[1]);
+		for (octallen = 1
 		      ;
-		      octallen < 3 && is_octal( string[ 1 + octallen ] )
+		      octallen < 3 && is_octal(string[1 + octallen])
 		      ;
-		      octallen++ ) {
+		      octallen++) {
 			accum *= 8;
-			accum += octal_to_size( string[ 1 + octallen ] );
+			accum += octal_to_size(string[1 + octallen]);
 		}
-		if ( accum ) {
-			string[ 0 ] = ( char )accum;
-			liter[ 0 ] = ( char )1;
-			shrink( &string[ 1 ], octallen );
-			shrink( &liter[ 1 ], octallen );
+		if (accum) {
+			string[0] = (char)accum;
+			liter[0] = (char)1;
+			shrink(&string[1], octallen);
+			shrink(&liter[1], octallen);
 			return;
 		}
 	}
 
 	/* didn't match any escape sequences, so assume literal
 	 */
-	liter[ 0 ] = ( char )1;
+	liter[0] = (char)1;
 }
 
 static void
-fix_quoted_span( char *string, char *liter )
+fix_quoted_span(char *string, char *liter)
 {
 	char *s;
 	char *l;
 
 	/* first cover the leading quote
 	 */
-	shrink( string, 1 );
-	shrink( liter, 1 );
+	shrink(string, 1);
+	shrink(liter, 1);
 
 	/* scan for the next non-literal quote, marking all
 	 * characters in between as literal
 	 */
-	for ( s = string, l = liter ; *s && ( *s != '\"' || *l ) ; s++, l++ ) {
-		*l = ( char )1;
+	for (s = string, l = liter ; *s && (*s != '\"' || *l) ; s++, l++) {
+		*l = (char)1;
 	}
 
-	if ( *s ) {
-		shrink( s, 1 );
-		shrink( l, 1 );
+	if (*s) {
+		shrink(s, 1);
+		shrink(l, 1);
 	}
 }
 
 static void
-collapse_white( char *string, char *liter )
+collapse_white(char *string, char *liter)
 {
 	char *s;
 	char *l;
 	size_t cnt;
 
 	cnt = 0;
-	for ( s = string, l = liter ; is_white( *s ) && ! *l ; s++, l++ ) {
+	for (s = string, l = liter ; is_white(*s) && ! *l ; s++, l++) {
 		cnt++;
 	}
 
-	string[ 0 ] = ' ';
+	string[0] = ' ';
 
-	if ( cnt > 1 ) {
-		shrink( &string[ 1 ], cnt - 1 );
-		shrink( &liter[ 1 ], cnt - 1 );
+	if (cnt > 1) {
+		shrink(&string[1], cnt - 1);
+		shrink(&liter[1], cnt - 1);
 	}
 }
 
 static size_t
-distance_to_space( char *s, char *l )
+distance_to_space(char *s, char *l)
 {
 	size_t cnt;
 
-	for ( cnt = 0 ; *s && ( ! is_white( *s ) || *l ) ; s++, l++ ) {
+	for (cnt = 0 ; *s && (! is_white(*s) || *l) ; s++, l++) {
 		cnt++;
 	}
 
@@ -4864,15 +4864,15 @@
 }
 
 static void
-shrink( char *s, size_t cnt )
+shrink(char *s, size_t cnt)
 {
-	strcpy( s, s + cnt );
+	strcpy(s, s + cnt);
 }
 
 static int
-is_white( char c )
+is_white(char c)
 {
-	if ( c && strchr( whites, ( int )c )) {
+	if (c && strchr(whites, (int)c)) {
 		return 1;
 	} else {
 		return 0;
@@ -4880,17 +4880,17 @@
 }
 
 static int
-is_hex( char c )
+is_hex(char c)
 {
-	if ( c >= '0' && c <= '9' ) {
+	if (c >= '0' && c <= '9') {
 		return 1;
 	}
 
-	if ( c >= 'a' && c <= 'f' ) {
+	if (c >= 'a' && c <= 'f') {
 		return 1;
 	}
 
-	if ( c >= 'A' && c <= 'F' ) {
+	if (c >= 'A' && c <= 'F') {
 		return 1;
 	}
 
@@ -4898,27 +4898,27 @@
 }
 
 static size_t
-hex_to_size( char c )
+hex_to_size(char c)
 {
-	if ( c >= '0' && c <= '9' ) {
-		return ( size_t )( c - '0' );
+	if (c >= '0' && c <= '9') {
+		return (size_t)(c - '0');
 	}
 
-	if ( c >= 'a' && c <= 'f' ) {
-		return ( size_t )( c - 'a' ) + ( size_t )0xa;
+	if (c >= 'a' && c <= 'f') {
+		return (size_t)(c - 'a') + (size_t)0xa;
 	}
 
-	if ( c >= 'A' && c <= 'F' ) {
-		return ( size_t )( c - 'A' ) + ( size_t )0xa;
+	if (c >= 'A' && c <= 'F') {
+		return (size_t)(c - 'A') + (size_t)0xa;
 	}
 
 	return 0;
 }
 
 static int
-is_octal( char c )
+is_octal(char c)
 {
-	if ( c >= '0' && c <= '7' ) {
+	if (c >= '0' && c <= '7') {
 		return 1;
 	}
 
@@ -4926,10 +4926,10 @@
 }
 
 static size_t
-octal_to_size( char c )
+octal_to_size(char c)
 {
-	if ( c >= '0' && c <= '7' ) {
-		return ( size_t )( c - '0' );
+	if (c >= '0' && c <= '7') {
+		return (size_t)(c - '0');
 	}
 
 	return 0;
@@ -4946,7 +4946,7 @@
 		return mkdir(path, 0755);
 	}
 	else if ((sbuf.st_mode & S_IFDIR) == 0) {
-		mlog( MLOG_TRACE | MLOG_ERROR | MLOG_TREE, _(
+		mlog(MLOG_TRACE | MLOG_ERROR | MLOG_TREE, _(
 			"%s is not a directory\n"),
 			path);
 		mlog_exit(EXIT_ERROR, RV_EXISTS);
diff --git a/restore/tree.h b/restore/tree.h
index 47911c4..6c9551b 100644
--- a/restore/tree.h
+++ b/restore/tree.h
@@ -20,7 +20,7 @@
 
 /* tree_init - creates a new tree abstraction.
  */
-extern bool_t tree_init( char *hkdir,
+extern bool_t tree_init(char *hkdir,
 			 char *dstdir,
 			 bool_t toconlypr,
 			 bool_t ownerpr,
@@ -34,15 +34,15 @@
 			 bool_t restoredmpr,
 			 bool_t dstdirisxfspr,
 			 uint32_t dumpformat,
-			 bool_t truncategenpr );
+			 bool_t truncategenpr);
 
 /* tree_sync - synchronizes with an existing tree abstraction
  */
-extern bool_t tree_sync( char *hkdir,
+extern bool_t tree_sync(char *hkdir,
 			 char *dstdir,
 			 bool_t toconlypr,
 			 bool_t fullpr,
-			 bool_t dstdirisxfspr );
+			 bool_t dstdirisxfspr);
 
 /* tree_check_dump_format - detect the rare case where a
  * cumulative restore begins with a format 3 (or newer)
@@ -50,32 +50,32 @@
  * a format 2 dump. the restore will fail unless the
  * original restore was told to use format 2 gen numbers.
  */
-extern bool_t tree_check_dump_format( uint32_t dumpformat );
+extern bool_t tree_check_dump_format(uint32_t dumpformat);
 
 
 /* tree_begindir - begins application of dumped directory to tree.
  * returns handle to dir node. returns by reference the dirattr
  * handle if new. caller must pre-zero (DAH_NULL).
  */
-extern nh_t tree_begindir( filehdr_t *fhdrp, dah_t *dahp );
+extern nh_t tree_begindir(filehdr_t *fhdrp, dah_t *dahp);
 
 /* tree_addent - adds a directory entry; takes dirh from above call
  */
-extern rv_t tree_addent( nh_t dirh,
+extern rv_t tree_addent(nh_t dirh,
 			 xfs_ino_t ino,
 			 gen_t gen,
 			 char *name,
-			 size_t namelen );
+			 size_t namelen);
 
 /* ends application of dir
  */
-extern void tree_enddir( nh_t dirh );
+extern void tree_enddir(nh_t dirh);
 
 #ifdef TREE_CHK
 /* tree_chk - do a sanity check of the tree prior to post-processing and
  * non-dir restoral. returns FALSE if corruption detected.
  */
-extern bool_t tree_chk( void );
+extern bool_t tree_chk(void);
 #endif /* TREE_CHK */
 
 /* tree_marknoref - mark all nodes as no reference, not dumped dirs, and
@@ -83,40 +83,40 @@
  * of the restoral of a dump session, in order to detect directory entries
  * no longer needed.
  */
-extern void tree_marknoref( void );
+extern void tree_marknoref(void);
 
 /* mark all nodes in tree as either selected or unselected, depending on sense
  */
-extern void tree_markallsubtree( bool_t sensepr );
+extern void tree_markallsubtree(bool_t sensepr);
 
-extern bool_t tree_subtree_parse( bool_t sensepr, char *path );
+extern bool_t tree_subtree_parse(bool_t sensepr, char *path);
 
-extern bool_t tree_post( char *path1, char *path2 );
+extern bool_t tree_post(char *path1, char *path2);
 
-extern rv_t tree_cb_links( xfs_ino_t ino,
+extern rv_t tree_cb_links(xfs_ino_t ino,
 			   gen_t gen,
 			   int32_t ctime,
 			   int32_t mtime,
-			   bool_t ( * funcp )( void *contextp,
+			   bool_t (* funcp)(void *contextp,
 					       bool_t linkpr,
 					       char *path1,
-					       char *path2 ),
+					       char *path2),
 			   void *contextp,
 			   char *path1,
-			   char *path2 );
+			   char *path2);
 
 /* called after all dirs have been restored. adjusts the ref flags,
  * by noting that dirents not refed because their parents were not dumped
  * are virtually reffed if their parents are refed.
  */
-extern bool_t tree_adjref( void );
+extern bool_t tree_adjref(void);
 
-extern bool_t tree_setattr( char *path );
-extern bool_t tree_delorph( void );
-extern bool_t tree_subtree_inter( void );
+extern bool_t tree_setattr(char *path);
+extern bool_t tree_delorph(void);
+extern bool_t tree_subtree_inter(void);
 
-extern bool_t tree_extattr( bool_t ( * cbfunc )( char *path, dah_t dah ),
-			    char *path );
+extern bool_t tree_extattr(bool_t (* cbfunc)(char *path, dah_t dah),
+			    char *path);
 	/* does a depthwise bottom-up traversal of the tree, calling
 	 * the supplied callback for all directories with a non-NULL dirattr
 	 * handle. The callback will get called with the directory's pathname
diff --git a/restore/win.c b/restore/win.c
index e5bf708..53ca9b8 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -43,8 +43,8 @@
 /*
  * critical region
  */
-#define CRITICAL_BEGIN()  if (!locksoffpr) qlock_lock( tranp->t_qlockh )
-#define CRITICAL_END()    if (!locksoffpr) qlock_unlock( tranp->t_qlockh )
+#define CRITICAL_BEGIN()  if (!locksoffpr) qlock_lock(tranp->t_qlockh)
+#define CRITICAL_END()    if (!locksoffpr) qlock_unlock(tranp->t_qlockh)
 
 /* window descriptor
  */
@@ -70,7 +70,7 @@
 
 /* forward declarations
  */
-static void win_segmap_resize( segix_t segix );
+static void win_segmap_resize(segix_t segix);
 
 /* transient state
  */
@@ -79,7 +79,7 @@
 		/* file descriptor of backing store to be windowed
 		 */
 	off64_t t_firstoff;
-		/* offset of first seg within backing store (for mmap( ))
+		/* offset of first seg within backing store (for mmap())
 		 */
 	size64_t t_segsz;
 		/* backing store segment / window size
@@ -146,21 +146,21 @@
 }
 
 void
-win_init( int fd,
+win_init(int fd,
 	  off64_t firstoff,
 	  size64_t segsz,
-	  size_t winmax )
+	  size_t winmax)
 {
 	/* validate parameters
 	 */
-	assert( ( firstoff & ( off64_t )pgmask ) == 0 );
-	assert( ( segsz & pgmask ) == 0 );
+	assert((firstoff & (off64_t)pgmask) == 0);
+	assert((segsz & pgmask) == 0);
 
 	/* allocate and initialize transient state
 	 */
-	assert( tranp == 0 );
-	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	assert( tranp );
+	assert(tranp == 0);
+	tranp = (tran_t *)calloc(1, sizeof(tran_t));
+	assert(tranp);
 
 	tranp->t_fd = fd;
 	tranp->t_firstoff = firstoff;
@@ -169,16 +169,16 @@
 
 	tranp->t_segmaplen = SEGMAP_INCR;
 	tranp->t_segmap = (win_t **)
-	calloc( tranp->t_segmaplen, sizeof(win_t *) );
-	assert( tranp->t_segmap );
+	calloc(tranp->t_segmaplen, sizeof(win_t *));
+	assert(tranp->t_segmap);
 
 	/* initialize critical region enforcer
 	 */
-	tranp->t_qlockh = qlock_alloc( QLOCK_ORD_WIN );
+	tranp->t_qlockh = qlock_alloc(QLOCK_ORD_WIN);
 }
 
 void
-win_map( segix_t segix, void **pp )
+win_map(segix_t segix, void **pp)
 {
 	off64_t segoff;
 	win_t *winp;
@@ -190,23 +190,23 @@
 	     "win_map(segix=%u,addr=%p)\n", segix, pp);
 #endif
 	/* resize the array if necessary */
-	if ( segix >= tranp->t_segmaplen )
-		win_segmap_resize( segix );
+	if (segix >= tranp->t_segmaplen)
+		win_segmap_resize(segix);
 
 	/* see if segment already mapped. if ref cnt zero,
 	 * remove from LRU list.
 	 */
 	winp = tranp->t_segmap[segix];
-	if ( winp ) {
+	if (winp) {
 #ifdef TREE_DEBUG
 		mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 		     "win_map(): requested segment already mapped\n");
 #endif
-		if ( winp->w_refcnt == 0 ) {
-			assert( tranp->t_lruheadp );
-			assert( tranp->t_lrutailp );
-			if ( tranp->t_lruheadp == winp ) {
-				if ( tranp->t_lrutailp == winp ) {
+		if (winp->w_refcnt == 0) {
+			assert(tranp->t_lruheadp);
+			assert(tranp->t_lrutailp);
+			if (tranp->t_lruheadp == winp) {
+				if (tranp->t_lrutailp == winp) {
 					tranp->t_lruheadp = 0;
 					tranp->t_lrutailp = 0;
 				} else {
@@ -214,7 +214,7 @@
 					tranp->t_lruheadp->w_prevp = 0;
 				}
 			} else {
-				if ( tranp->t_lrutailp == winp ) {
+				if (tranp->t_lrutailp == winp) {
 					tranp->t_lrutailp = winp->w_prevp;
 					tranp->t_lrutailp->w_nextp = 0;
 				} else {
@@ -225,8 +225,8 @@
 			winp->w_prevp = 0;
 			winp->w_nextp = 0;
 		} else {
-			assert( ! winp->w_prevp );
-			assert( ! winp->w_nextp );
+			assert(! winp->w_prevp);
+			assert(! winp->w_nextp);
 		}
 		winp->w_refcnt++;
 		*pp = winp->w_p;
@@ -237,70 +237,70 @@
 	/* Allocate a new descriptor if we haven't yet hit the maximum,
 	 * otherwise reuse any descriptor on the LRU list.
 	 */
-	if ( tranp->t_wincnt < tranp->t_winmax ) {
+	if (tranp->t_wincnt < tranp->t_winmax) {
 #ifdef TREE_DEBUG
 		mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 		     "win_map(): create a new window\n");
 #endif
-		winp = ( win_t * )calloc( 1, sizeof( win_t ));
-		assert( winp );
+		winp = (win_t *)calloc(1, sizeof(win_t));
+		assert(winp);
 		tranp->t_wincnt++;
-	} else if ( tranp->t_lruheadp ) {
+	} else if (tranp->t_lruheadp) {
 		/* REFERENCED */
 		int rval;
 #ifdef TREE_DEBUG
 		mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 		     "win_map(): get head from lru freelist & unmap\n");
 #endif
-		assert( tranp->t_lrutailp );
+		assert(tranp->t_lrutailp);
 		winp = tranp->t_lruheadp;
 		tranp->t_lruheadp = winp->w_nextp;
-		if ( tranp->t_lruheadp ) {
+		if (tranp->t_lruheadp) {
 			tranp->t_lruheadp->w_prevp = 0;
 		} else {
 			tranp->t_lrutailp = 0;
 		}
 		tranp->t_segmap[winp->w_segix] = NULL;
-		rval = munmap( winp->w_p, tranp->t_segsz );
-		assert( ! rval );
-		memset( ( void * )winp, 0, sizeof( win_t ));
+		rval = munmap(winp->w_p, tranp->t_segsz);
+		assert(! rval);
+		memset((void *)winp, 0, sizeof(win_t));
 	} else {
-		assert( tranp->t_wincnt == tranp->t_winmax );
+		assert(tranp->t_wincnt == tranp->t_winmax);
 		*pp = NULL;
 		CRITICAL_END();
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "all map windows in use. Check virtual memory limits\n"));
 		return;
 	}
 
 	/* calculate offset of segment
 	 */
-	segoff = segix * ( off64_t )tranp->t_segsz;
+	segoff = segix * (off64_t)tranp->t_segsz;
 
 	/* map the window
 	 */
-	assert( tranp->t_segsz >= 1 );
-	assert( tranp->t_firstoff
+	assert(tranp->t_segsz >= 1);
+	assert(tranp->t_firstoff
 		<=
-		OFF64MAX - segoff - ( off64_t )tranp->t_segsz + 1ll );
-	assert( ! ( tranp->t_segsz % pgsz ));
-	assert( ! ( ( tranp->t_firstoff + segoff ) % ( off64_t )pgsz ));
+		OFF64MAX - segoff - (off64_t)tranp->t_segsz + 1ll);
+	assert(! (tranp->t_segsz % pgsz));
+	assert(! ((tranp->t_firstoff + segoff) % (off64_t)pgsz));
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 	     "win_map(): mmap segment at %lld, size = %llu\n",
-	    ( off64_t )( tranp->t_firstoff + segoff ), tranp->t_segsz);
+	    (off64_t)(tranp->t_firstoff + segoff), tranp->t_segsz);
 #endif
 	tranp->t_winmmaps++;
 	winp->w_p = mmap_autogrow(
 			    tranp->t_segsz,
 			    tranp->t_fd,
-			    ( off64_t )( tranp->t_firstoff + segoff ));
-	if ( winp->w_p == (void *)-1 ) {
+			    (off64_t)(tranp->t_firstoff + segoff));
+	if (winp->w_p == (void *)-1) {
 		int	error = errno;
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "win_map(): unable to map a node segment of size %d at %d: %s\n"),
 		      tranp->t_segsz, tranp->t_firstoff + segoff,
-		      strerror( error ));
+		      strerror(error));
 
 		tranp->t_wincnt--;
 		tranp->t_winmax--;
@@ -308,7 +308,7 @@
 		free(winp);
 
 		if (error == ENOMEM && tranp->t_lruheadp) {
-			mlog( MLOG_NORMAL | MLOG_ERROR,
+			mlog(MLOG_NORMAL | MLOG_ERROR,
 		      		_("win_map(): try to select a different win_t\n"));
 			win_map(segix, pp);
 			return;
@@ -317,7 +317,7 @@
 		return;
 	}
 	winp->w_segix  = segix;
-	assert( winp->w_refcnt == 0 );
+	assert(winp->w_refcnt == 0);
 	winp->w_refcnt++;
 	tranp->t_segmap[winp->w_segix] = winp;
 
@@ -327,7 +327,7 @@
 }
 
 void
-win_unmap( segix_t segix, void **pp )
+win_unmap(segix_t segix, void **pp)
 {
 	win_t *winp;
 
@@ -335,36 +335,36 @@
 
 	/* verify window mapped
 	 */
-	assert( segix < tranp->t_segmaplen );
+	assert(segix < tranp->t_segmaplen);
 	winp = tranp->t_segmap[segix];
-	assert( winp );
+	assert(winp);
 
 	/* validate p
 	 */
-	assert( pp );
-	assert( *pp );
-	assert( *pp >= winp->w_p );
-	assert( *pp < ( void * )( ( char * )( winp->w_p ) + tranp->t_segsz ));
+	assert(pp);
+	assert(*pp);
+	assert(*pp >= winp->w_p);
+	assert(*pp < (void *)((char *)(winp->w_p) + tranp->t_segsz));
 
 	/* decrement the reference count. if zero, place at tail of LRU list.
 	 */
-	assert( winp->w_refcnt > 0 );
+	assert(winp->w_refcnt > 0);
 	winp->w_refcnt--;
-	assert( ! winp->w_prevp );
-	assert( ! winp->w_nextp );
-	if ( winp->w_refcnt == 0 ) {
-		if ( tranp->t_lrutailp ) {
-			assert( tranp->t_lruheadp );
+	assert(! winp->w_prevp);
+	assert(! winp->w_nextp);
+	if (winp->w_refcnt == 0) {
+		if (tranp->t_lrutailp) {
+			assert(tranp->t_lruheadp);
 			winp->w_prevp = tranp->t_lrutailp;
 			tranp->t_lrutailp->w_nextp = winp;
 			tranp->t_lrutailp = winp;
 		} else {
-			assert( ! tranp->t_lruheadp );
-			assert( ! winp->w_prevp );
+			assert(! tranp->t_lruheadp);
+			assert(! winp->w_prevp);
 			tranp->t_lruheadp = winp;
 			tranp->t_lrutailp = winp;
 		}
-		assert( ! winp->w_nextp );
+		assert(! winp->w_nextp);
 	}
 
 	/* zero the caller's pointer
@@ -384,10 +384,10 @@
 
 	tranp->t_segmaplen = segix + SEGMAP_INCR;
 	tranp->t_segmap = (win_t **)
-		realloc( tranp->t_segmap, tranp->t_segmaplen * sizeof(win_t *) );
-	assert( tranp->t_segmap );
+		realloc(tranp->t_segmap, tranp->t_segmaplen * sizeof(win_t *));
+	assert(tranp->t_segmap);
 
 	/* clear the new portion of the array */
 	new_part = tranp->t_segmap + oldlen;
-	memset( new_part, 0, (tranp->t_segmaplen - oldlen) * sizeof(win_t *) );
+	memset(new_part, 0, (tranp->t_segmaplen - oldlen) * sizeof(win_t *));
 }
diff --git a/restore/win.h b/restore/win.h
index a6bd002..2d52b56 100644
--- a/restore/win.h
+++ b/restore/win.h
@@ -25,21 +25,21 @@
 
 /* initialize the window abstraction
  */
-void win_init( int fd,
+void win_init(int fd,
 	       off64_t rngoff,		/* offset into file of windowing */
 	       size64_t winsz,		/* window size */
-	       size_t wincntmax );	/* max number of windows to manage */
+	       size_t wincntmax);	/* max number of windows to manage */
 
 /* supply a pointer to the portion of the file identified by segix.
  */
-void win_map( segix_t segix,		/* segment index to be mapped */
-	      void **pp );		/* returns pointer by reference */
+void win_map(segix_t segix,		/* segment index to be mapped */
+	      void **pp);		/* returns pointer by reference */
 
 /* invalidate the pointer previously supplied. SIDE-EFFECT: zeros
  * by reference the caller's pointer.
  */
-void win_unmap( segix_t segix,		/* must match win_map param */
-	        void **pp );		/* ptr generated by win_map: ZEROED */
+void win_unmap(segix_t segix,		/* must match win_map param */
+	        void **pp);		/* ptr generated by win_map: ZEROED */
 
 /*
  * Functions used to disable the window locking from happening.