Skip to contentSkip to conversation

xfsdump: (style) remove spaces from parentheses

PATCH Applied Jan Tulak 2 participants 16 messages Jan 14, 2019 – Feb 20, 2019 Arm STM32 Page 2 of 2

lore
Share & tools
lore
author
#9 lore raw

PATCH 9/13 xfsdump: (9/13) (style) remove spaces from parentheses

In reply to Jan Tulak

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

*****

---
 inventory/inv_stobj.c | 746 +++++++++++++++++++++---------------------
 inventory/inventory.h |  28 +-
 inventory/testmain.c  | 236 ++++++-------
 invutil/cmenu.h       |  24 +-
 invutil/fstab.c       |  12 +-
 invutil/invidx.c      |  76 ++---
 invutil/invutil.c     | 246 +++++++-------
 invutil/invutil.h     |   6 +-
 invutil/stobj.c       |  32 +-
 librmt/rmtcommand.c   |   2 +-
 librmt/rmtfstat.c     |   6 +-
 librmt/rmtioctl.c     |  18 +-
 librmt/rmtopen.c      |   4 +-
 librmt/rmtstatus.c    |   8 +-
 librmt/rmtwrite.c     |   2 +-
 restore/bag.c         |  70 ++--
 restore/bag.h         |  20 +-
 17 files changed, 768 insertions(+), 768 deletions(-)
inventory/inv_stobj.c +373 -373
index 25df2fe..74893d3 100644
@@ -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 @@ stobj_insert_session( invt_idxinfo_t *idx,
 
 /* 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 @@ stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm )
 	   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 @@ 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)
 {
 	invt_seshdr_t 	*harr = NULL;
 	uint          	i, ix, ns = sescnt->ic_curnum;
@@ -172,22 +172,22 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	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 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	/* 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 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 		   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 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 
 /* 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 @@ stobj_delete_mfile( int fd, inv_stream_t *strm, invt_mediafile_t *mf,
 
 /* 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 @@ stobj_put_session(
 	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 @@ stobj_put_session(
 /*----------------------------------------------------------------------*/
 
 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 @@ stobj_sortheaders( int fd, uint num )
 /*----------------------------------------------------------------------*/
 
 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 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 /*----------------------------------------------------------------------*/
 
 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 @@ stobj_makefname( char *fname )
 
 /* 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 @@ stobj_create_session(
 	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 @@ stobj_create_session(
 /*----------------------------------------------------------------------*/
 
 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 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 	/* 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 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 	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 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 
 
 	/* 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 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 /*----------------------------------------------------------------------*/
 
 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 @@ stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr,
 /*----------------------------------------------------------------------*/
 
 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 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 	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 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 	 * 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 @@ stobj_getsession_byuuid(
 	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 @@ stobj_getsession_bylabel(
 	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 @@ bool_t
 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 @@ stobj_delete_mobj(int fd,
 	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 @@ stobj_delete_mobj(int fd,
 		   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 @@ bool_t
 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 @@ stobj_unpack_sessinfo(
 		 * 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 @@ stobj_unpack_sessinfo(
 	/* 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 @@ stobj_unpack_sessinfo(
 /*----------------------------------------------------------------------*/
 
 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 @@ void
 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 @@ stobj_convert_strm(inv_stream_t *expstrm, invt_stream_t *strm)
 		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 @@ stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 {
 	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 @@ stobj_copy_invsess(int fd,
 	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 @@ stobj_copy_invsess(int fd,
 		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 @@ stobj_copy_invsess(int fd,
 	}
 
 
-	free( strms );
+	free(strms);
 	*buf = ises;
 
 	return 1;
@@ -1297,21 +1297,21 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 	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 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 
 
 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 @@ stobj_hdrcmp( const void *h1, const void *h2 )
 
 
 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 @@ mobj_eql ( inv_mediafile_t *mfp, invt_mobjinfo_t *mobj )
 
 
 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 @@ check_for_mobj ( inv_session_t *ses, invt_mobjinfo_t *mobj )
 
 
 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 @@ DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 
        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 @@ DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 	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);
 		}
 	}
 }
inventory/inventory.h +14 -14
index 076b83e..ad27205 100644
@@ -189,12 +189,12 @@ extern inv_idbtoken_t
 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 @@ inv_writesession_open(
 	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 @@ extern bool_t
 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 */
inventory/testmain.c +118 -118

422 lines not on this page · raw message

invutil/cmenu.h +12 -12
index a9788f2..f3c205f 100644
@@ -44,18 +44,18 @@ typedef enum {
 } 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 {
invutil/fstab.c +6 -6
index a4333ad..3319a5c 100644
@@ -83,7 +83,7 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
 
 	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 @@ remmap_fstab(int fidx, int num)
 
     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 @@ open_fstab(char *fstabname)
     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 @@ close_fstab(int fidx)
 
     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(int fidx)
     close(fstab_file[fidx].fd);
 
     if (fstabentries == 0) {
-	unlink( fstab_file[fidx].name );
+	unlink(fstab_file[fidx].name);
     }
 
     free(fstab_file[fidx].name);
invutil/invidx.c +38 -38

204 lines not on this page · raw message

invutil/invutil.c +123 -123

627 lines not on this page · raw message

invutil/invutil.h +3 -3
index f1b1681..db5fc26 100644
@@ -46,8 +46,8 @@ char *	GetNameOfInvIndex (char *, uuid_t);
 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	read_n_bytes(int, void *, size_t, char *);
 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);
invutil/stobj.c +16 -16
index 582858f..2912e0c 100644
@@ -409,12 +409,12 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 	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 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 	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 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 	    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 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 	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 @@ open_stobj(char *StObjFileName)
     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 @@ close_stobj_file(int fidx, int unlink_ok)
     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 @@ close_all_stobj()
 	    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);
librmt/rmtcommand.c +1 -1
index 82c9032..b5726d9 100644
@@ -56,7 +56,7 @@ char *buf;
 
 	_rmt_abort(fildes);
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

librmt/rmtfstat.c +3 -3
index 92a49d7..8bfaea7 100644

Lines of this file are not shown. View the raw message.

librmt/rmtioctl.c +9 -9
index edcd611..84932a5 100644

Lines of this file are not shown. View the raw message.

librmt/rmtopen.c +2 -2
index 09ba3e4..a091c72 100644

Lines of this file are not shown. View the raw message.

librmt/rmtstatus.c +4 -4
index 21d909d..f141395 100644

Lines of this file are not shown. View the raw message.

librmt/rmtwrite.c +1 -1
index 9e5a1a3..9b4cc50 100644

Lines of this file are not shown. View the raw message.

restore/bag.c +35 -35

70 lines not on this page · raw message

restore/bag.h +10 -10
index 6bcb86f..c2aef2c 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.19.1

Part of the diff is not shown here. View the raw message.

author
#10 lore raw

PATCH 10/13 xfsdump: (10/13) (style) remove spaces from parentheses

In reply to Jan Tulak

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

*****

---
 restore/content.c | 2810 ++++++++++++++++++++++-----------------------
 1 file changed, 1405 insertions(+), 1405 deletions(-)
restore/content.c +1405 -1405
index 078c6b8..24f7e78 100644
@@ -94,7 +94,7 @@ typedef enum { SYNC_INIT, SYNC_BUSY, SYNC_DONE } sync_t;
 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 @@ typedef off_t dh_t;
 	 * 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 @@ struct pers_file {
 
 /* 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 @@ struct stdesc {
 	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 @@ struct pers {
 			 * 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 @@ struct pers {
 			 * 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 @@ typedef struct tran tran_t;
 
 /* 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 @@ extern size_t pgmask;
 
 /* 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 @@ static rv_t Media_mfile_next( Media_t *Mediap,
 			      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 );
-
-static rv_t applydirdump( drive_t *drivep,
+					        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,
 			  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 );
-
-static bool_t extattr_init( size_t drivecnt );
-static char * get_extattrbuf( ix_t which );
-static rv_t restore_extattr( drive_t *drivep,
+				    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,
 			     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 pers_desc_t *descp = 0;	/* mapped on the fly; don't use! (see macros) */
 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 
 	/* 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 
 	/* 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 
 	/* 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	} 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	/* 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 		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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * 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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			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 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 */
 	{
 		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 @@ content_stream_restore( ix_t thrdix )
 
 	/* 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 @@ content_stream_restore( ix_t thrdix )
 	 * 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 @@ content_stream_restore( ix_t thrdix )
 	 * 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 @@ content_stream_restore( ix_t thrdix )
 				       &crhdrp,
 				       &scrhdrp,
 				       &drivep,
-				       &fhdr );
-		switch ( rv ) {
+				       &fhdr);
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_DONE:
@@ -2057,158 +2057,158 @@ content_stream_restore( ix_t thrdix )
 		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 @@ content_stream_restore( ix_t thrdix )
 	/* 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 @@ content_stream_restore( ix_t thrdix )
 				       &crhdrp,
 				       &scrhdrp,
 				       &drivep,
-				       &fhdr );
-		switch ( rv ) {
+				       &fhdr);
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_DONE:
@@ -2244,117 +2244,117 @@ content_stream_restore( ix_t thrdix )
 		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( );
-		}
-		while ( tranp->t_sync3 == SYNC_BUSY ) {
-			unlock( );
+		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();
 #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 @@ content_stream_restore( ix_t thrdix )
 					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 @@ content_stream_restore( ix_t thrdix )
 		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 @@ content_stream_restore( ix_t thrdix )
 	/* 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 @@ content_stream_restore( ix_t thrdix )
 		{
 		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 @@ content_stream_restore( ix_t thrdix )
 	 * 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 @@ content_stream_restore( ix_t thrdix )
 				       &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 @@ content_stream_restore( ix_t thrdix )
 	 * 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 @@ content_stream_restore( ix_t thrdix )
  * 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_complete( void )
 						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 @@ content_complete( void )
 #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 @@ content_statline( char **linespp[ ] )
 
 	/* 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 @@ content_statline( char **linespp[ ] )
 	 */
 	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 @@ content_statline( char **linespp[ ] )
 			 (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 @@ content_statline( char **linespp[ ] )
 
 	/* 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 @@ content_statline( char **linespp[ ] )
 		 (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 @@ content_statline( char **linespp[ ] )
 }
 
 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 @@ content_showremainingobjects( void )
 #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 @@ content_mediachange_query( void )
 	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 @@ content_mediachange_query( void )
 				       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 @@ content_mediachange_query( void )
 					       nochangeix);/* sigquit ix */
 		return _("continuing\n");
 	}
-	assert( responseix == nochangeix );
+	assert(responseix == nochangeix);
 	return _("continuing\n");
 }
 
@@ -2954,60 +2954,60 @@ content_mediachange_query( void )
  */
 /* 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 @@ applydirdump( drive_t *drivep,
 		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 @@ applydirdump( drive_t *drivep,
 
 			/* 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 @@ applydirdump( drive_t *drivep,
 			 * 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 @@ applydirdump( drive_t *drivep,
 			 * 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 @@ applydirdump( drive_t *drivep,
 			 * 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;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.19.1

Part of the diff is not shown here. View the raw message.

author
#11 lore raw

PATCH 11/13 xfsdump: (11/13) (style) remove spaces from parentheses

In reply to Jan Tulak

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

*****

---
 restore/content.c | 2604 ++++++++++++++++++++++-----------------------
 1 file changed, 1302 insertions(+), 1302 deletions(-)
restore/content.c +1302 -1302
index 24f7e78..930a76c 100644
@@ -5148,22 +5148,22 @@ pi_insertfile(ix_t drivecnt,
 				       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 @@ pi_insertfile(ix_t drivecnt,
 	 * 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 @@ pi_insertfile(ix_t drivecnt,
  */
 /* 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 @@ pi_addfile( Media_t *Mediap,
 	/* 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 @@ pi_addfile( Media_t *Mediap,
 				       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 @@ pi_addfile( Media_t *Mediap,
 				       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 @@ pi_addfile( Media_t *Mediap,
 					       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 @@ pi_addfile( Media_t *Mediap,
 
 	/* 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 @@ pi_addfile( Media_t *Mediap,
 				       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 @@ pi_addfile( Media_t *Mediap,
 					       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 @@ pi_addfile( Media_t *Mediap,
 				 */
 			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 @@ pi_addfile( Media_t *Mediap,
 			 */
 			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 @@ pi_addfile( Media_t *Mediap,
 			 * 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 @@ pi_transcribe( inv_session_t *sessp )
 		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 @@ pi_transcribe( inv_session_t *sessp )
 					       :
 					       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 @@ pi_transcribe( inv_session_t *sessp )
  * 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 @@ pi_preclean( void )
 /* 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 @@ pi_seeobjstrmend( ix_t strmix, ix_t mediaix )
  * 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 @@ pi_scanfileendino( dh_t fileh )
  * 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 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
 	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 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
 	}
 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 @@ done:
 	 */
 	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 @@ struct pi_iter {
 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 @@ struct bagobj {
 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 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 
 	/* 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 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 
 	/* lock up the inventory during the scan
 	 */
-	pi_lock( );
+	pi_lock();
 
 	do {
 		egrp_t headegrp;
@@ -6197,23 +6197,23 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 		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 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 		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 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 
 		    /* 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 @@ pi_neededobjs_dir_alloc( bool_t *knownholesprp, bool_t *maybeholesprp )
 	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 @@ pi_neededobjs_dir_alloc( bool_t *knownholesprp, bool_t *maybeholesprp )
 	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_neededobjs_dir_alloc( bool_t *knownholesprp, bool_t *maybeholesprp )
 		}
 	}
 
-	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 @@ pi_neededobjs_free( bag_t *bagp )
 	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 @@ pi_alldone( void )
 
 	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 @@ pi_alldone( void )
  * 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 @@ pi_hiteod( ix_t strmix, ix_t objix )
 	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 @@ pi_hiteod( ix_t strmix, ix_t objix )
  * 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 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
 	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 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
  * 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 @@ pi_know_no_more_beyond_on_object( purp_t purp,
  * 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 @@ gapneeded( egrp_t *firstegrpp, egrp_t *lastegrpp )
 }
 
 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 @@ cntobj( bag_t *bagp )
  * 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 @@ askinvforbaseof( uuid_t baseid, inv_session_t *sessp )
 	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 @@ askinvforbaseof( uuid_t baseid, inv_session_t *sessp )
 						     (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 @@ askinvforbaseof( uuid_t baseid, inv_session_t *sessp )
 
 	/* 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 @@ dumpcompat( bool_t resumepr, ix_t level, uuid_t baseid, bool_t logpr )
 					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 @@ dumpcompat( bool_t resumepr, ix_t level, uuid_t baseid, bool_t logpr )
  * 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 @@ Media_prompt_change( drive_t *drivep,
 	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 @@ retry:
 				       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 );
-
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	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()) {
 			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 @@ retry:
  * 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 @@ promptdumpmatch( ix_t thrdix,
 
 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 @@ retry:
 				       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 );
-
-	if ( responseix == sigintix ) {
-		if ( cldmgr_stop_requested( )) {
+	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()) {
 			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 @@ struct cb_context {
 
 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 @@ restore_file( drive_t *drivep,
 	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 @@ restore_file( drive_t *drivep,
  * 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 @@ restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
 	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 @@ restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
 
 		/* 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 @@ restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
 		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 @@ set_file_owner(
 	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 @@ done:
  * 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 @@ restore_reg( drive_t *drivep,
 	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 @@ restore_reg( drive_t *drivep,
 			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 @@ restore_reg( drive_t *drivep,
 		}
 	}
 
-	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 @@ restore_reg( drive_t *drivep,
  * 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 @@ restore_extent_group( drive_t *drivep,
 
 	/* 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 @@ restore_extent_group( drive_t *drivep,
 
 		/* 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 @@ restore_extent_group( drive_t *drivep,
 		/* 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 @@ restore_complete_reg(stream_context_t *strcxtp)
 
 	/* 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 @@ restore_complete_reg(stream_context_t *strcxtp)
 
 	/* 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 @@ restore_complete_reg(stream_context_t *strcxtp)
 		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 @@ restore_complete_reg(stream_context_t *strcxtp)
 
 /* 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 @@ restore_spec( filehdr_t *fhdrp, rv_t *rvp, char *path )
 		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 );
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.19.1

Part of the diff is not shown here. View the raw message.

author
#12 lore raw

PATCH 12/13 xfsdump: (12/13) (style) remove spaces from parentheses

In reply to Jan Tulak

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

*****

---
 restore/dirattr.c | 682 +++++++++++++++++++++++-----------------------
 restore/dirattr.h |  46 ++--
 restore/getopt.h  |   2 +-
 restore/inomap.c  | 288 ++++++++++----------
 restore/inomap.h  |  34 +--
 restore/mmap.c    |   2 +-
 restore/namreg.c  | 234 ++++++++--------
 restore/namreg.h  |  12 +-
 restore/node.c    | 328 +++++++++++-----------
 restore/node.h    |  12 +-
 10 files changed, 820 insertions(+), 820 deletions(-)
restore/dirattr.c +341 -341
index f057b78..5368664 100644
@@ -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 @@ struct dirattr {
 
 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 @@ typedef struct dirattr_tran dirattr_tran_t;
  * 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 @@ extern size_t pgsz;
 
 /* 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 @@ static dirattr_pers_t *dpp = 0;
 /* 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 @@ dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
 		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 @@ dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
 		      ;
 		      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 @@ dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
 					      "XFS_IOC_RESVSP64"
 					      :
 					      "XFS_IOC_ALLOCSP64",
-					      strerror( errno ),
-					      errno );
+					      strerror(errno),
+					      errno);
 				}
 			} else {
 				successpr = BOOL_TRUE;
@@ -314,23 +314,23 @@ dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
 
 	/* 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 @@ dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
 	/* 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 @@ dirattr_add( filehdr_t *fhdrp )
 
 	/* 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 @@ dirattr_add( filehdr_t *fhdrp )
 	/* 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 @@ dirattr_add( filehdr_t *fhdrp )
 
 	/* 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 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 
 	/* 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 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 	 */
 	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 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 
 	/* 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 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 	/* 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 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 }
 
 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 @@ dirattr_cb_extattr( dah_t dah,
 	/* 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 @@ dirattr_cb_extattr( dah_t dah,
 
 		/* 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 @@ dirattr_cb_extattr( dah_t dah,
 }
 
 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 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 
 	/* 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 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 
 /* 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 @@ dirattr_flush()
 
 	/* 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 @@ dirattr_flush()
 /* 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 @@ dirattr_get( dah_t dah )
 
 	/* 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 @@ dirattr_get( dah_t dah )
 }
 
 static void
-dirattr_cacheflush( void )
+dirattr_cacheflush(void)
 {
 	dah_t dah;
 	dix_t dix;
@@ -1044,58 +1044,58 @@ dirattr_cacheflush( void )
 
 	/* 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 @@ dirattr_cacheflush( void )
 #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;
 }
restore/dirattr.h +23 -23

84 lines not on this page · raw message

restore/getopt.h +1 -1
index 361bc61..b5bc004 100644
@@ -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' */
restore/inomap.c +144 -144

601 lines not on this page · raw message

restore/inomap.h +17 -17
index 03facdb..93f982c 100644
@@ -55,32 +55,32 @@ struct seg {
 
 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 */
restore/mmap.c +1 -1
index 29dd3d7..0407740 100644
@@ -41,5 +41,5 @@ mmap_autogrow(size_t len, int fd, off_t offset)
 	(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);
 }
restore/namreg.c +117 -117

486 lines not on this page · raw message

restore/namreg.h +6 -6
index 859ccd7..bd014e2 100644
@@ -34,26 +34,26 @@ typedef size64_t nrh_t;
  * 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 @@ extern rv_t namreg_map( void );
  * 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 */
restore/node.c +164 -164

483 lines not on this page · raw message

restore/node.h +6 -6
index 25fdaad..5b5efda 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.19.1

Part of the diff is not shown here. View the raw message.

author
#13 lore raw

PATCH 13/13 xfsdump: (13/13) (style) remove spaces from parentheses

In reply to Jan Tulak

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

*****

---
 restore/tree.c | 2874 ++++++++++++++++++++++++------------------------
 restore/tree.h |   48 +-
 restore/win.c  |  138 +--
 restore/win.h  |   12 +-
 4 files changed, 1536 insertions(+), 1536 deletions(-)
restore/tree.c +1437 -1437
index bc948fc..3f3084e 100644
@@ -127,9 +127,9 @@ typedef struct treePersStorage treepers_t;
 #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 @@ struct tran {
 	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 @@ struct node {
 
 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 @@ typedef struct node node_t;
 	 * 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 @@ typedef struct node node_t;
 	 * 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 @@ typedef struct path_cache path_cache_t;
 
 /* 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 @@ static xfs_ino_t orphino = ORPH_INO;
 
 /* ARGSUSED */
 bool_t
-tree_init( char *hkdir,
+tree_init(char *hkdir,
 	   char *dstdir,
 	   bool_t toconlypr,
 	   bool_t ownerpr,
@@ -351,7 +351,7 @@ tree_init( char *hkdir,
 	   bool_t restoredmpr,
 	   bool_t dstdirisxfspr,
 	   uint32_t dumpformat,
-	   bool_t truncategenpr )
+	   bool_t truncategenpr)
 {
 	off64_t nodeoff;
 	char *perspath;
@@ -360,16 +360,16 @@ tree_init( char *hkdir,
 
 	/* 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 @@ tree_init( char *hkdir,
 	/* 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 @@ tree_init( char *hkdir,
 	/* 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 @@ tree_init( char *hkdir,
 
 	/* 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 @@ tree_init( char *hkdir,
 	 * 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 @@ tree_init( char *hkdir,
 	 * 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 @@ tree_init( char *hkdir,
 
 	/* 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 @@ tree_init( char *hkdir,
 }
 
 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 @@ tree_sync( char *hkdir,
 	/* 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 @@ tree_sync( char *hkdir,
 	/* 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 @@ tree_sync( char *hkdir,
 }
 
 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 @@ tree_check_dump_format( uint32_t dumpformat )
  * 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 @@ tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
 }
 
 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 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 							      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 @@ tree_subtree_parse( bool_t sensepr, char *path )
 
 	/* 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 @@ tree_subtree_parse( bool_t sensepr, char *path )
 			   &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 @@ tree_subtree_parse( bool_t sensepr, char *path )
  * 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 @@ tree_post( char *path1, char *path2 )
 
 	/* 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 @@ tree_post( char *path1, char *path2 )
 
 /* 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 @@ noref_elim_recurse( nh_t parh,
 		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 @@ noref_elim_recurse( nh_t parh,
 			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;
 				/* [email protected]:
@@ -1454,26 +1454,26 @@ noref_elim_recurse( nh_t parh,
 				 * 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 @@ noref_elim_recurse( nh_t parh,
 				}
 			}
 
-			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 @@ noref_elim_recurse( nh_t parh,
 						     "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 @@ noref_elim_recurse( nh_t parh,
 
 /* 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 @@ mkdirs_recurse( nh_t parh, nh_t cldh, char *path )
 		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 @@ mkdirs_recurse( nh_t parh, nh_t cldh, char *path )
 }
 
 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 @@ rename_dirs( nh_t cldh,
 		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 @@ rename_dirs( nh_t cldh,
  * 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 @@ tree_cb_links( xfs_ino_t ino,
 	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 @@ tree_cb_links( xfs_ino_t ino,
 		 * 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 @@ tree_cb_links( xfs_ino_t ino,
 				 * 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 @@ tree_cb_links( xfs_ino_t ino,
 		/* 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 @@ tree_cb_links( xfs_ino_t ino,
 	/* 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 @@ tree_cb_links( xfs_ino_t ino,
 			 * 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 @@ tree_cb_links( xfs_ino_t ino,
 				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 @@ tree_cb_links( xfs_ino_t ino,
  * 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 @@ tree_extattr_recurse( nh_t parh,
 
 	/* 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 @@ tree_extattr_recurse( nh_t parh,
 		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 @@ tree_extattr_recurse( nh_t parh,
 
 	/* 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 @@ struct phcb {
 
 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 @@ proc_hardlinks( char *path1, char *path2 )
 	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 @@ proc_hardlinks( char *path1, char *path2 )
  * 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 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 
 	/* 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 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 	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 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 		 * 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;
 		}
 
 		/* [email protected]: 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.
 	 * [email protected]: 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 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
  * 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 @@ tree_setattr_recurse( nh_t parh, char *path )
 }
 
 static void
-setdirattr( dah_t dah, char *path )
+setdirattr(dah_t dah, char *path)
 {
 	mode_t mode;
 	struct utimbuf utimbuf;
@@ -2531,96 +2531,96 @@ setdirattr( dah_t dah, char *path )
 	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 ));
-	}
-	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, _(
+		      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, _(
 			      "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 @@ setdirattr( dah_t dah, char *path )
 		     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));
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

restore/tree.h +24 -24

48 lines not on this page · raw message

restore/win.c +69 -69

138 lines not on this page · raw message

restore/win.h +6 -6
index a6bd002..2d52b56 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.19.1

Part of the diff is not shown here. View the raw message.

#14 lore raw
In reply to Jan Tulak
Quoted 10 lines · Jan Tulak

Hi guys

Another change to make xfsdump more eyes-friendly. I hope you prefer this slower, once-in-a-time approach more. :-)

First, why this patchset has the weird numbering: it should be just one patch, but because the mailing list throws away emails that are bigger than some 250 kB or so, I had to split it to multiple emails that all are 'small' enough to pass.

Quoted 4 lines

And as they all share the same name, it would be difficult to know which patch you are looking at once you apply them, so I added the numbers directly into the title. When merging, they can be squashed (and individual messages discarded, they are all the same).

I'll just combine them into one patch on merge, thanks.

Quoted 6 lines

All the patches do the same thing, transforming "( x, y )" to "(x, y)" (and dtto for []). Most of patches contain multiple files and directories, except 6, 7 and 10, 11. In these two pairs, I had to split a single file (dump/content.c and restore/content.c) into two patches as they would be still too big otherwise.

Quoted 8 lines

Some information that should help you with the review:
- I managed to tune the script to avoid all pittfals I could find, so the changes are reproducible.
- No strings should be changed.
- No real changes in gcc output: I made a diff of 'make' output before and after and the only differences are the removed spaces where gcc already complained.
- A sight decrease of long lines (>79 chars), from 217 to 206.

\o/

Quoted 4 lines

- Comparing objdumps won't work, a single space can change it. :-(

I don't think that it made any line particularly more difficult to read (or at least I didn't notice any).

Cool, thanks, I'll take a look.

-Eric

Quoted 118 lines

Jan Tulak (13):
xfsdump: (1/13) (style) remove spaces from parentheses
xfsdump: (2/13) (style) remove spaces from parentheses
xfsdump: (3/13) (style) remove spaces from parentheses
xfsdump: (4/13) (style) remove spaces from parentheses
xfsdump: (5/13) (style) remove spaces from parentheses
xfsdump: (6/13) (style) remove spaces from parentheses
xfsdump: (7/13) (style) remove spaces from parentheses
xfsdump: (8/13) (style) remove spaces from parentheses
xfsdump: (9/13) (style) remove spaces from parentheses
xfsdump: (10/13) (style) remove spaces from parentheses
xfsdump: (11/13) (style) remove spaces from parentheses
xfsdump: (12/13) (style) remove spaces from parentheses
xfsdump: (13/13) (style) remove spaces from parentheses

 common/arch_xlate.c     |    8 +-
 common/cldmgr.c         |  134 +-
 common/cldmgr.h         |   16 +-
 common/cleanup.c        |   66 +-
 common/cleanup.h        |   16 +-
 common/content.h        |   42 +-
 common/content_common.c |   94 +-
 common/content_common.h |    2 +-
 common/content_inode.h  |   88 +-
 common/dlog.c           |  284 +-
 common/dlog.h           |   32 +-
 common/drive.c          |  170 +-
 common/drive.h          |  126 +-
 common/drive_minrmt.c   | 2128 +++++++--------
 common/drive_scsitape.c | 2948 ++++++++++-----------
 common/drive_simple.c   |  732 +++---
 common/exit.h           |    4 +-
 common/fs.c             |  188 +-
 common/fs.h             |   12 +-
 common/global.c         |  206 +-
 common/global.h         |   28 +-
 common/hsmapi.c         |   22 +-
 common/inventory.c      |  302 +--
 common/inventory.h      |   36 +-
 common/lock.c           |   14 +-
 common/lock.h           |    6 +-
 common/main.c           | 1578 ++++++------
 common/media.c          |  126 +-
 common/media.h          |   20 +-
 common/media_rmvtape.h  |    6 +-
 common/mlog.c           |  328 +--
 common/mlog.h           |   58 +-
 common/openutil.c       |   72 +-
 common/openutil.h       |   22 +-
 common/path.c           |  190 +-
 common/path.h           |    8 +-
 common/qlock.c          |  116 +-
 common/qlock.h          |   18 +-
 common/rec_hdr.h        |    4 +-
 common/ring.c           |  228 +-
 common/ring.h           |   20 +-
 common/stream.c         |   96 +-
 common/stream.h         |   26 +-
 common/timeutil.c       |    8 +-
 common/timeutil.h       |    6 +-
 common/ts_mtio.h        |    2 +-
 common/types.h          |   58 +-
 common/util.c           |  260 +-
 common/util.h           |   56 +-
 dump/content.c          | 3644 +++++++++++++-------------
 dump/getopt.h           |    2 +-
 dump/inomap.c           |  768 +++---
 dump/inomap.h           |   32 +-
 dump/var.c              |   96 +-
 dump/var.h              |    4 +-
 include/swab.h          |   24 +-
 include/swap.h          |   10 +-
 inventory/getopt.h      |    2 +-
 inventory/inv_api.c     |  414 +--
 inventory/inv_core.c    |  106 +-
 inventory/inv_files.c   |   10 +-
 inventory/inv_fstab.c   |  152 +-
 inventory/inv_idx.c     |  274 +-
 inventory/inv_mgr.c     |  332 +--
 inventory/inv_oref.c    |   46 +-
 inventory/inv_oref.h    |    2 +-
 inventory/inv_priv.h    |  244 +-
 inventory/inv_stobj.c   |  746 +++---
 inventory/inventory.h   |   28 +-
 inventory/testmain.c    |  236 +-
 invutil/cmenu.h         |   24 +-
 invutil/fstab.c         |   12 +-
 invutil/invidx.c        |   76 +-
 invutil/invutil.c       |  246 +-
 invutil/invutil.h       |    6 +-
 invutil/stobj.c         |   32 +-
 librmt/rmtcommand.c     |    2 +-
 librmt/rmtfstat.c       |    6 +-
 librmt/rmtioctl.c       |   18 +-
 librmt/rmtopen.c        |    4 +-
 librmt/rmtstatus.c      |    8 +-
 librmt/rmtwrite.c       |    2 +-
 restore/bag.c           |   70 +-
 restore/bag.h           |   20 +-
 restore/content.c       | 5414 +++++++++++++++++++--------------------
 restore/dirattr.c       |  682 ++---
 restore/dirattr.h       |   46 +-
 restore/getopt.h        |    2 +-
 restore/inomap.c        |  288 +--
 restore/inomap.h        |   34 +-
 restore/mmap.c          |    2 +-
 restore/namreg.c        |  234 +-
 restore/namreg.h        |   12 +-
 restore/node.c          |  328 +--
 restore/node.h          |   12 +-
 restore/tree.c          | 2874 ++++++++++-----------
 restore/tree.h          |   48 +-
 restore/win.c           |  138 +-
 restore/win.h           |   12 +-
 99 files changed, 14417 insertions(+), 14417 deletions(-)
Applied
#15 lore raw
In reply to Jan Tulak
Quoted 4 lines · Jan Tulak

Hi guys

Another change to make xfsdump more eyes-friendly. I hope you prefer this slower, once-in-a-time approach more. :-)

I've applied all of these as one commit, thanks.

-Eric

Quoted 147 lines

First, why this patchset has the weird numbering: it should be just one patch, but because the mailing list throws away emails that are bigger than some 250 kB or so, I had to split it to multiple emails that all are 'small' enough to pass.

And as they all share the same name, it would be difficult to know which patch you are looking at once you apply them, so I added the numbers directly into the title. When merging, they can be squashed (and individual messages discarded, they are all the same).

All the patches do the same thing, transforming "( x, y )" to "(x, y)" (and dtto for []). Most of patches contain multiple files and directories, except 6, 7 and 10, 11. In these two pairs, I had to split a single file (dump/content.c and restore/content.c) into two patches as they would be still too big otherwise.

Some information that should help you with the review:
- I managed to tune the script to avoid all pittfals I could find, so the changes are reproducible.
- No strings should be changed.
- No real changes in gcc output: I made a diff of 'make' output before and after and the only differences are the removed spaces where gcc already complained.
- A sight decrease of long lines (>79 chars), from 217 to 206.
- Comparing objdumps won't work, a single space can change it. :-(

I don't think that it made any line particularly more difficult to read (or at least I didn't notice any).

Jan Tulak (13):
xfsdump: (1/13) (style) remove spaces from parentheses
xfsdump: (2/13) (style) remove spaces from parentheses
xfsdump: (3/13) (style) remove spaces from parentheses
xfsdump: (4/13) (style) remove spaces from parentheses
xfsdump: (5/13) (style) remove spaces from parentheses
xfsdump: (6/13) (style) remove spaces from parentheses
xfsdump: (7/13) (style) remove spaces from parentheses
xfsdump: (8/13) (style) remove spaces from parentheses
xfsdump: (9/13) (style) remove spaces from parentheses
xfsdump: (10/13) (style) remove spaces from parentheses
xfsdump: (11/13) (style) remove spaces from parentheses
xfsdump: (12/13) (style) remove spaces from parentheses
xfsdump: (13/13) (style) remove spaces from parentheses

 common/arch_xlate.c     |    8 +-
 common/cldmgr.c         |  134 +-
 common/cldmgr.h         |   16 +-
 common/cleanup.c        |   66 +-
 common/cleanup.h        |   16 +-
 common/content.h        |   42 +-
 common/content_common.c |   94 +-
 common/content_common.h |    2 +-
 common/content_inode.h  |   88 +-
 common/dlog.c           |  284 +-
 common/dlog.h           |   32 +-
 common/drive.c          |  170 +-
 common/drive.h          |  126 +-
 common/drive_minrmt.c   | 2128 +++++++--------
 common/drive_scsitape.c | 2948 ++++++++++-----------
 common/drive_simple.c   |  732 +++---
 common/exit.h           |    4 +-
 common/fs.c             |  188 +-
 common/fs.h             |   12 +-
 common/global.c         |  206 +-
 common/global.h         |   28 +-
 common/hsmapi.c         |   22 +-
 common/inventory.c      |  302 +--
 common/inventory.h      |   36 +-
 common/lock.c           |   14 +-
 common/lock.h           |    6 +-
 common/main.c           | 1578 ++++++------
 common/media.c          |  126 +-
 common/media.h          |   20 +-
 common/media_rmvtape.h  |    6 +-
 common/mlog.c           |  328 +--
 common/mlog.h           |   58 +-
 common/openutil.c       |   72 +-
 common/openutil.h       |   22 +-
 common/path.c           |  190 +-
 common/path.h           |    8 +-
 common/qlock.c          |  116 +-
 common/qlock.h          |   18 +-
 common/rec_hdr.h        |    4 +-
 common/ring.c           |  228 +-
 common/ring.h           |   20 +-
 common/stream.c         |   96 +-
 common/stream.h         |   26 +-
 common/timeutil.c       |    8 +-
 common/timeutil.h       |    6 +-
 common/ts_mtio.h        |    2 +-
 common/types.h          |   58 +-
 common/util.c           |  260 +-
 common/util.h           |   56 +-
 dump/content.c          | 3644 +++++++++++++-------------
 dump/getopt.h           |    2 +-
 dump/inomap.c           |  768 +++---
 dump/inomap.h           |   32 +-
 dump/var.c              |   96 +-
 dump/var.h              |    4 +-
 include/swab.h          |   24 +-
 include/swap.h          |   10 +-
 inventory/getopt.h      |    2 +-
 inventory/inv_api.c     |  414 +--
 inventory/inv_core.c    |  106 +-
 inventory/inv_files.c   |   10 +-
 inventory/inv_fstab.c   |  152 +-
 inventory/inv_idx.c     |  274 +-
 inventory/inv_mgr.c     |  332 +--
 inventory/inv_oref.c    |   46 +-
 inventory/inv_oref.h    |    2 +-
 inventory/inv_priv.h    |  244 +-
 inventory/inv_stobj.c   |  746 +++---
 inventory/inventory.h   |   28 +-
 inventory/testmain.c    |  236 +-
 invutil/cmenu.h         |   24 +-
 invutil/fstab.c         |   12 +-
 invutil/invidx.c        |   76 +-
 invutil/invutil.c       |  246 +-
 invutil/invutil.h       |    6 +-
 invutil/stobj.c         |   32 +-
 librmt/rmtcommand.c     |    2 +-
 librmt/rmtfstat.c       |    6 +-
 librmt/rmtioctl.c       |   18 +-
 librmt/rmtopen.c        |    4 +-
 librmt/rmtstatus.c      |    8 +-
 librmt/rmtwrite.c       |    2 +-
 restore/bag.c           |   70 +-
 restore/bag.h           |   20 +-
 restore/content.c       | 5414 +++++++++++++++++++--------------------
 restore/dirattr.c       |  682 ++---
 restore/dirattr.h       |   46 +-
 restore/getopt.h        |    2 +-
 restore/inomap.c        |  288 +--
 restore/inomap.h        |   34 +-
 restore/mmap.c          |    2 +-
 restore/namreg.c        |  234 +-
 restore/namreg.h        |   12 +-
 restore/node.c          |  328 +--
 restore/node.h          |   12 +-
 restore/tree.c          | 2874 ++++++++++-----------
 restore/tree.h          |   48 +-
 restore/win.c           |  138 +-
 restore/win.h           |   12 +-
 99 files changed, 14417 insertions(+), 14417 deletions(-)