linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/24] xfsdump: code style change
@ 2018-11-09 14:29 Jan Tulak
  2018-11-09 14:29 ` [PATCH 01/24] xfsdump: (style) remove trailing whitespaces Jan Tulak
                   ` (18 more replies)
  0 siblings, 19 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

This set is dealing with whitespaces only, no functional change, code
shuffling, etc. should be present (with one small exception in patch no. 2).
>From the previous set I split the changes into multiple patches, one type of
change at a time, and tried to make the code fully compliant with xfs style,
so the number of changes is way bigger than in the first set.

The only patch with code shuffling (but no behavioral change) is: "xfsdump: do
not split function call with ifdef." See the patch for details.

For patch 21 - xfsdump: (style) format intercharacter spaces, I think whether
it is still to much agregated and I should separate the changes. Some other
patches I had to split to multiple files as they are too big to pass through
to the mailing list - it is in their name. The largest one is 660K now, so I
will check if that passed through, or it is still too big.

The whole set is created mechanically from scratch. Scripts used for the
specific change are part of the commit message and I can easily put it all
together. So there is no need to worry about rebase conflicts, etc. when
pointing out issues.

The tools used to make these changes are sed and uncrustify.
http://uncrustify.sourceforge.net/

A git tree with these patches is also on Github:
https://github.com/jtulak/xfsdump/tree/style-nov-9th
or
git clone --single-branch -b style-nov-9th https://github.com/jtulak/xfsdump.git


Jan Tulak (24):
  xfsdump: (style) remove trailing whitespaces
  xfsdump: do not split function call with ifdef
  xfsdump: (1/4)(style) remove spaces from parentheses
  xfsdump: (2/4)(style) remove spaces from parentheses
  xfsdump: (3/4)(style) remove spaces from parentheses
  xfsdump: (4/4)(style) remove spaces from parentheses
  xfsdump: (style) remove a space in front of comma/semicolon
  xfsdump: (style) remove a space in ptr dereferences
  xfsdump: add a space after comma and semicolon where was none
  xfsdump: (style) insert a newline between type and fnt name in
    definitions
  xfsdump: (style) add a space after if, switch, for, do, while
  xfsdump: (1/4)(style) add first empty line for multiline comments
  xfsdump: (2/4)(style) add first empty line for multiline comments
  xfsdump: (3/4)(style) add first empty line for multiline comments
  xfsdump: (4/4)(style) add first empty line for multiline comments
  xfsdump: (style) curly brackets should wrap with one space
  xfsdump: (1/4)(style) indent and align the code
  xfsdump: (2/4)(style) indent and align the code
  xfsdump: (3/4)(style) indent and align the code
  xfsdump: (4/4)(style) indent and align the code
  xfsdump: (style) format intercharacter spaces
  xfsdump: (style) format newlines
  xfsdump: (style) add stars to multiline comments
  xfsdump: (style) remove parentheses after return

 common/arch_xlate.c     |    45 +-
 common/cldmgr.c         |   181 +-
 common/cldmgr.h         |    44 +-
 common/cleanup.c        |    95 +-
 common/cleanup.h        |    25 +-
 common/content.h        |   179 +-
 common/content_common.c |   135 +-
 common/content_common.h |     2 +-
 common/content_inode.h  |   505 +-
 common/dlog.c           |   485 +-
 common/dlog.h           |    92 +-
 common/drive.c          |   313 +-
 common/drive.h          |  1015 ++--
 common/drive_minrmt.c   |  3952 +++++++-------
 common/drive_scsitape.c |  5402 ++++++++++---------
 common/drive_simple.c   |  1441 ++---
 common/exit.h           |    15 +-
 common/fs.c             |   247 +-
 common/fs.h             |    52 +-
 common/getdents.c       |    51 +-
 common/getdents.h       |     2 +-
 common/global.c         |   353 +-
 common/global.h         |   115 +-
 common/hsmapi.c         |   408 +-
 common/hsmapi.h         |    88 +-
 common/inventory.c      |   504 +-
 common/inventory.h      |   179 +-
 common/lock.c           |    20 +-
 common/lock.h           |     6 +-
 common/main.c           |  2516 ++++-----
 common/media.c          |   218 +-
 common/media.h          |    82 +-
 common/media_rmvtape.h  |    30 +-
 common/mlog.c           |   599 +--
 common/mlog.h           |   148 +-
 common/openutil.c       |    98 +-
 common/openutil.h       |    40 +-
 common/path.c           |   238 +-
 common/path.h           |    11 +-
 common/qlock.c          |   248 +-
 common/qlock.h          |   112 +-
 common/rec_hdr.h        |    86 +-
 common/ring.c           |   407 +-
 common/ring.h           |   120 +-
 common/stream.c         |   159 +-
 common/stream.h         |    68 +-
 common/timeutil.c       |    14 +-
 common/timeutil.h       |    18 +-
 common/ts_mtio.h        |  1117 ++--
 common/types.h          |   173 +-
 common/util.c           |   465 +-
 common/util.h           |   167 +-
 dump/content.c          |  6940 ++++++++++++------------
 dump/getopt.h           |    81 +-
 dump/inomap.c           |  1486 +++---
 dump/inomap.h           |   125 +-
 dump/var.c              |   129 +-
 dump/var.h              |     4 +-
 include/swab.h          |   127 +-
 include/swap.h          |    42 +-
 inventory/getopt.h      |    19 +-
 inventory/inv_api.c     |   928 ++--
 inventory/inv_core.c    |   152 +-
 inventory/inv_files.c   |    32 +-
 inventory/inv_fstab.c   |   213 +-
 inventory/inv_idx.c     |   500 +-
 inventory/inv_mgr.c     |   593 ++-
 inventory/inv_oref.c    |   253 +-
 inventory/inv_oref.h    |   259 +-
 inventory/inv_priv.h    |   514 +-
 inventory/inv_stobj.c   |  1318 ++---
 inventory/inventory.h   |   262 +-
 inventory/testmain.c    |   429 +-
 invutil/cmenu.c         |   673 ++-
 invutil/cmenu.h         |   102 +-
 invutil/fstab.c         |   613 ++-
 invutil/getopt.h        |    22 +-
 invutil/invidx.c        |  1634 +++---
 invutil/invidx.h        |     6 +-
 invutil/invutil.c       |  1901 ++++---
 invutil/invutil.h       |    66 +-
 invutil/list.c          |   201 +-
 invutil/list.h          |    33 +-
 invutil/menu.c          |   463 +-
 invutil/screen.c        |    80 +-
 invutil/stobj.c         |   880 ++-
 librmt/isrmt.c          |     4 +-
 librmt/rmtabort.c       |     6 +-
 librmt/rmtaccess.c      |    15 +-
 librmt/rmtclose.c       |    26 +-
 librmt/rmtcommand.c     |    15 +-
 librmt/rmtcreat.c       |    19 +-
 librmt/rmtdev.c         |    14 +-
 librmt/rmtfstat.c       |    31 +-
 librmt/rmtioctl.c       |   385 +-
 librmt/rmtisatty.c      |    13 +-
 librmt/rmtlib.h         |    26 +-
 librmt/rmtlseek.c       |    23 +-
 librmt/rmtmsg.c         |    40 +-
 librmt/rmtopen.c        |   198 +-
 librmt/rmtread.c        |    29 +-
 librmt/rmtstatus.c      |    42 +-
 librmt/rmtwrite.c       |    28 +-
 restore/bag.c           |    97 +-
 restore/bag.h           |    71 +-
 restore/content.c       | 10886 ++++++++++++++++++++------------------
 restore/dirattr.c       |  1148 ++--
 restore/dirattr.h       |    82 +-
 restore/getopt.h        |    85 +-
 restore/inomap.c        |   538 +-
 restore/inomap.h        |    73 +-
 restore/mmap.c          |    24 +-
 restore/namreg.c        |   490 +-
 restore/namreg.h        |    37 +-
 restore/node.c          |   664 +--
 restore/node.h          |    47 +-
 restore/tree.c          |  4975 +++++++++--------
 restore/tree.h          |   151 +-
 restore/win.c           |   325 +-
 restore/win.h           |    28 +-
 120 files changed, 33644 insertions(+), 31156 deletions(-)

--
2.19.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 01/24] xfsdump: (style) remove trailing whitespaces
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 02/24] xfsdump: do not split function call with ifdef Jan Tulak
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

There were many trailing whitespaces through the whole code. As the rate
of changes in xfsdump is low, it should not cause trouble if we fix it
in all files at once and avoid issues (unintended changes) with sensibly
configured editors that automatically remove these on a file save.

Created by this script:

#!/usr/bin/env bash
# remove trailing whitespaces

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/\s*$//" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/arch_xlate.c     |  24 +--
 common/cleanup.c        |   2 +-
 common/cleanup.h        |   2 +-
 common/content.h        |   2 +-
 common/content_inode.h  |   4 +-
 common/dlog.c           |   2 +-
 common/drive.c          |  12 +-
 common/drive.h          |   8 +-
 common/drive_minrmt.c   |  60 +++----
 common/drive_scsitape.c |  70 ++++----
 common/drive_simple.c   |  10 +-
 common/global.c         |   6 +-
 common/global.h         |   4 +-
 common/hsmapi.c         |   2 +-
 common/inventory.c      | 120 +++++++-------
 common/inventory.h      |  46 +++---
 common/main.c           |  20 +--
 common/media.c          |   4 +-
 common/media_rmvtape.h  |   2 +-
 common/mlog.c           |  16 +-
 common/mlog.h           |   2 +-
 common/qlock.c          |  10 +-
 common/rec_hdr.h        |   2 +-
 common/ring.c           |   4 +-
 common/ring.h           |   2 +-
 common/stream.c         |   2 +-
 common/ts_mtio.h        |  60 +++----
 common/types.h          |   2 +-
 common/util.c           |   8 +-
 common/util.h           |   2 +-
 dump/content.c          |  84 +++++-----
 dump/inomap.c           |   6 +-
 inventory/inv_api.c     | 198 +++++++++++------------
 inventory/inv_core.c    |  30 ++--
 inventory/inv_fstab.c   |  58 +++----
 inventory/inv_idx.c     | 128 +++++++--------
 inventory/inv_mgr.c     | 114 ++++++-------
 inventory/inv_oref.c    |  96 +++++------
 inventory/inv_oref.h    |  12 +-
 inventory/inv_priv.h    |  64 ++++----
 inventory/inv_stobj.c   | 344 ++++++++++++++++++++--------------------
 inventory/inventory.h   |  64 ++++----
 inventory/testmain.c    |  80 +++++-----
 invutil/fstab.c         |   6 +-
 invutil/invidx.c        |  50 +++---
 invutil/invutil.c       |  56 +++----
 invutil/menu.c          |   8 +-
 invutil/screen.c        |   2 +-
 invutil/stobj.c         |   6 +-
 librmt/rmtioctl.c       |  34 ++--
 librmt/rmtlib.h         |   2 +-
 restore/bag.c           |   2 +-
 restore/content.c       | 110 ++++++-------
 restore/dirattr.c       |   4 +-
 restore/inomap.c        |   2 +-
 restore/namreg.c        |   4 +-
 restore/node.c          |   2 +-
 restore/tree.c          |  62 ++++----
 58 files changed, 1069 insertions(+), 1069 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index 1b8e687..4043a9d 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -135,12 +135,12 @@ xlate_drive_hdr(drive_hdr_t *dh1, drive_hdr_t *dh2, int dir)
 	     "\tdh_pad1 %s\n"
 	     "\tdh_specific %s\n"
 	     "\tdh_upper %s\n",
-	     ptr1->dh_drivecnt, 
+	     ptr1->dh_drivecnt,
 	     ptr1->dh_driveix,
 	     ptr1->dh_strategyid,
 	     ptr1->dh_pad1,
 	     ptr1->dh_specific,
-	     ptr1->dh_upper);	     
+	     ptr1->dh_upper);
 
 	mlog(MLOG_NITTY, "xlate_drive_hdr: post-xlate\n"
 	     "\tdh_drivecnt %u\n"
@@ -149,12 +149,12 @@ xlate_drive_hdr(drive_hdr_t *dh1, drive_hdr_t *dh2, int dir)
 	     "\tdh_pad1 %s\n"
 	     "\tdh_specific %s\n"
 	     "\tdh_upper %s\n",
-	     ptr2->dh_drivecnt, 
+	     ptr2->dh_drivecnt,
 	     ptr2->dh_driveix,
 	     ptr2->dh_strategyid,
 	     ptr2->dh_pad1,
 	     ptr2->dh_specific,
-	     ptr2->dh_upper);	     
+	     ptr2->dh_upper);
 }
 
 /*
@@ -416,7 +416,7 @@ xlate_extenthdr(extenthdr_t *eh1, extenthdr_t *eh2, int dir)
 {
 	extenthdr_t *ptr1 = eh1;
 	extenthdr_t *ptr2 = eh2;
-	
+
 	mlog(MLOG_NITTY, "xlate_extenthdr\n");
 
 	IXLATE(eh1, eh2, eh_sz);
@@ -522,7 +522,7 @@ xlate_direnthdr_v1(direnthdr_v1_t *dh1, direnthdr_v1_t *dh2, int dir)
 	     ptr2->dh_gen,
 	     ptr2->dh_sz,
 	     ptr2->dh_checksum,
-	     ptr2->dh_name );	     
+	     ptr2->dh_name );
 }
 
 /*
@@ -550,7 +550,7 @@ xlate_rec_hdr(rec_hdr_t *rh1, rec_hdr_t *rh2, int dir)
 	rec_hdr_t *ptr2 = rh2;
 
 	mlog(MLOG_NITTY, "xlate_rec_hdr\n");
-  
+
 	IXLATE(rh1, rh2, magic);
 	IXLATE(rh1, rh2, version);
 	IXLATE(rh1, rh2, blksize);
@@ -569,7 +569,7 @@ xlate_rec_hdr(rec_hdr_t *rh1, rec_hdr_t *rh2, int dir)
 
 	BXLATE(pad1);
 	BXLATE(dump_uuid);
-	BXLATE(pad2);	
+	BXLATE(pad2);
 
 	mlog(MLOG_NITTY, "xlate_rec_hdr: pre-xlate\n"
 	     "\tmagic %llu\n"
@@ -582,7 +582,7 @@ xlate_rec_hdr(rec_hdr_t *rh1, rec_hdr_t *rh2, int dir)
 	     "\trec_used %u\n"
 	     "\tchecksum %d\n"
 	     "\tischecksum %d\n",
-	     ptr1->magic, 
+	     ptr1->magic,
 	     ptr1->version,
 	     ptr1->blksize,
 	     ptr1->recsize,
@@ -604,7 +604,7 @@ xlate_rec_hdr(rec_hdr_t *rh1, rec_hdr_t *rh2, int dir)
 	     "\trec_used %u\n"
 	     "\tchecksum %d\n"
 	     "\tischecksum %d\n",
-	     ptr2->magic, 
+	     ptr2->magic,
 	     ptr2->version,
 	     ptr2->blksize,
 	     ptr2->recsize,
@@ -621,7 +621,7 @@ xlate_rec_hdr(rec_hdr_t *rh1, rec_hdr_t *rh2, int dir)
  */
 void
 xlate_invt_seshdr(invt_seshdr_t *ish1, invt_seshdr_t *ish2, int dir)
-{	
+{
 	invt_seshdr_t *ptr1 = ish1;
 	invt_seshdr_t *ptr2 = ish2;
 
@@ -705,7 +705,7 @@ xlate_invt_stream(invt_stream_t *ist1, invt_stream_t *ist2, int dir)
 		ptr1 = ist2;
 		ptr2 = ist1;
 	}
-	
+
 	BXLATE(st_cmdarg);
 	BXLATE(st_padding);
 
diff --git a/common/cleanup.c b/common/cleanup.c
index 523f164..45339c6 100644
--- a/common/cleanup.c
+++ b/common/cleanup.c
@@ -31,7 +31,7 @@ struct cu {
 
 /* Cleanup structure flags
  */
-#define CU_EARLY	0x00000001	
+#define CU_EARLY	0x00000001
 			/* call cleanup routine before calling killall */
 
 typedef struct cu cu_t;
diff --git a/common/cleanup.h b/common/cleanup.h
index a22a2db..a54f9db 100644
--- a/common/cleanup.h
+++ b/common/cleanup.h
@@ -30,7 +30,7 @@ extern cleanup_t *cleanup_register( void ( *funcp )( void *arg1, void *arg2 ),
 				    void *arg1,
 				    void *arg2 );
 
-extern cleanup_t *cleanup_register_early( 
+extern cleanup_t *cleanup_register_early(
 				    void ( *funcp )( void *arg1, void *arg2 ),
 				    void *arg1,
 				    void *arg2 );
diff --git a/common/content.h b/common/content.h
index 763c09f..c947474 100644
--- a/common/content.h
+++ b/common/content.h
@@ -59,7 +59,7 @@ struct content_hdr {
 		/* content strategy-specific info */
 };
 
-typedef struct content_hdr content_hdr_t;	
+typedef struct content_hdr content_hdr_t;
 
 #define CONTENT_QUOTAFILE	"xfsdump_quotas"
 #define CONTENT_PQUOTAFILE	"xfsdump_quotas_proj"
diff --git a/common/content_inode.h b/common/content_inode.h
index 6936e05..38ba2a3 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -151,7 +151,7 @@ typedef struct timestruct timestruct_t;
 /* bstat_t - bulk stat structure
  *
  * used in filehdr_t below. derived from xfs_bstat_t, to achieve independence
- * from changes to xfs_bstat_t. 
+ * from changes to xfs_bstat_t.
  */
 #define BSTAT_SZ	128
 #define MODE_SZ		4
@@ -209,7 +209,7 @@ bstat_projid(struct bstat *bs)
  *
  * each fs file placed on dump media begins with a FILEHDR_SZ-byte header.
  * following that are one or more variable-length content extents.
- * the content extents contain the actual data associated with the fs file. 
+ * the content extents contain the actual data associated with the fs file.
  */
 #define FILEHDR_SZ	256
 
diff --git a/common/dlog.c b/common/dlog.c
index 032e6f7..77364a3 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -480,7 +480,7 @@ promptinput( char *buf,
 	 */
 	pthread_sigmask( SIG_SETMASK, &orig_set, NULL );
 	sigemptyset( &dlog_registered_sigs );
-	
+
 	/* check for timeout or interrupt
 	 */
 	if ( nread < 0 ) {
diff --git a/common/drive.c b/common/drive.c
index 5fe6867..4b0825f 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -64,7 +64,7 @@ static void drive_allochdrs( drive_t *drivep,
 /* definition of locally defined global variables ****************************/
 
 drive_t **drivepp;
-size_t drivecnt; 
+size_t drivecnt;
 size_t partialmax;
 
 /* definition of locally defined static variables *****************************/
@@ -115,8 +115,8 @@ drive_init1( int argc, char *argv[ ] )
 
 	/* initialize the partialmax value.  Each drive can be completing a file
 	 * started in another drive (except for drive 0) and leave one file to
-	 * be completed by another drive.  This value is used to limit the 
-	 * search in the list of partially completed files shared between all 
+	 * be completed by another drive.  This value is used to limit the
+	 * search in the list of partially completed files shared between all
 	 * restore streams.  Note, if drivecnt is one, then partialmax is zero
 	 * to indicate no partial files can span streams.
 	 */
@@ -167,7 +167,7 @@ drive_init1( int argc, char *argv[ ] )
 
 		drivecnt = 1;
 
-		/* Adding this alloc to fix malloc corruption. 
+		/* Adding this alloc to fix malloc corruption.
 		 * Bug #393618 - prasadb 04/16/97
 		 * allocate an array to hold ptrs to drive descriptors
 		 */
@@ -177,7 +177,7 @@ drive_init1( int argc, char *argv[ ] )
 		drivepp[ 0 ] = drive_alloc( "stdio", 0 );
 
 #ifdef DUMP   /* ifdef added around dlog_desist() by prasadb to fix 435626 */
-		dlog_desist( ); 
+		dlog_desist( );
 #endif
 	}
 
@@ -347,7 +347,7 @@ drive_display_metrics( void )
 
 /* definition of locally defined static functions ****************************/
 
-/* drive_alloc - allocate and initialize the generic portions of a drive 
+/* drive_alloc - allocate and initialize the generic portions of a drive
  * descriptor. do NOT allocate hdr buffers.
  */
 static drive_t *
diff --git a/common/drive.h b/common/drive.h
index 89b143e..37258e0 100644
--- a/common/drive.h
+++ b/common/drive.h
@@ -194,7 +194,7 @@ typedef void ( * drive_mcbfp_t )( void *context_t,
  *
  * caller allocates and passes ptr to do_set_mark, along with a callback func.
  * callback returns the record, which must be freed by the original caller.
- * 
+ *
  */
 struct drive_markrec {
 	drive_mark_t dm_log;		/* identifies position within mfile */
@@ -534,7 +534,7 @@ struct drive_ops {
 				/* if d_capabilities has DRIVE_CAP_BSF set,
 				 * drive has the capability to backward space
 				 * count files. returns the number of actual
-				 * files backed to. 
+				 * files backed to.
 				 * can only be invoked when not reading or
 				 * writing (i.e., only after calling end_read
 				 * or end_write, or prior to calling begin_read
@@ -594,8 +594,8 @@ typedef struct drive_ops drive_ops_t;
  * valid after drive_init1() returns successfully
  */
 extern drive_t **drivepp;
-extern size_t drivecnt; 
-extern size_t partialmax; 
+extern size_t drivecnt;
+extern size_t partialmax;
 
 /* drive capabilities - bit positions in the capabilities mask
  * DO NOT CHANGE: used in dh_capabilities field of scsi drive hdr.
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 32dc404..59a40a7 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -328,12 +328,12 @@ static void calc_max_lost( drive_t *drivep );
 static void display_ring_metrics( drive_t *drivep, int mlog_flags );
 #ifdef CLRMTAUD
 static uint32_t rewind_and_verify( drive_t *drivep );
-static uint32_t erase_and_verify( drive_t *drivep ); 
+static uint32_t erase_and_verify( drive_t *drivep );
 static uint32_t bsf_and_verify( drive_t *drivep );
 static uint32_t fsf_and_verify( drive_t *drivep );
 #else /* CLRMTAUD */
 static short rewind_and_verify( drive_t *drivep );
-static short erase_and_verify( drive_t *drivep ); 
+static short erase_and_verify( drive_t *drivep );
 static short bsf_and_verify( drive_t *drivep );
 static short fsf_and_verify( drive_t *drivep );
 #endif /* CLRMTAUD */
@@ -421,7 +421,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 		return -10;
 	}
 
-	/* Check if the min rmt flag and block size have 
+	/* Check if the min rmt flag and block size have
 	 * been specified.
 	 * If so , this is a non-SGI drive and this is the right
 	 * strategy.
@@ -441,7 +441,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 			    cmdlineblksize = ( uint32_t )atoi( optarg );
 		            errno = 0;
 		            fd = open( drivep->d_pathname, O_RDONLY );
-		            if ( fd < 0 ) 
+		            if ( fd < 0 )
 			            return -10;
 		            close( fd );
 			    break;
@@ -454,12 +454,12 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 		if (minrmt == BOOL_TRUE) {
 			if (cmdlineblksize != 0)
 				return 20;
-		 	else 
+		 	else
 				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					_("Minimal rmt cannot be used without specifying blocksize. Use -%c\n"),
 					GETOPT_BLOCKSIZE );
 		}
-	} 
+	}
 	/* catch all */
 	return -10;
 }
@@ -1018,7 +1018,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		currentoffset += ( off64_t )recoff;
 	}
 	assert( wantedoffset >= currentoffset );
-	
+
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
 	 */
@@ -1087,7 +1087,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	     wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
-		
+
 		assert( ! contextp->dc_recp );
 		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
 		if ( contextp->dc_singlethreadedpr ) {
@@ -1701,7 +1701,7 @@ do_begin_write( drive_t *drivep )
 
 	/* intialize header in new record
 	 */
-	rechdrp = (rec_hdr_t*)contextp->dc_recp;	
+	rechdrp = (rec_hdr_t*)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
 	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
@@ -1895,7 +1895,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	 */
 	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 	rechdrp->rec_used = tape_recsz;
-	
+
 	/* write out the record buffer and get a new one.
 	 */
 	if ( contextp->dc_singlethreadedpr ) {
@@ -2418,7 +2418,7 @@ do_erase( drive_t *drivep )
 
 	/* use validating tape erase util func
 	 */
-	( void )erase_and_verify( drivep ); 
+	( void )erase_and_verify( drivep );
 
 	/* rewind again
 	 */
@@ -2568,7 +2568,7 @@ read_label( drive_t *drivep )
 	 */
 	if ( nread != ( int )tape_recsz ) {
 		assert( nread < ( int )tape_recsz );
-	} 
+	}
 
 	/* check for an unexpected errno
 	 */
@@ -2584,7 +2584,7 @@ read_label( drive_t *drivep )
 	 */
 	if (( nread == 0 )  /* takes care of sun */
 	      ||            /* now handle SGI */
-	      (nread < 0 && saved_errno == ENOSPC )) { 
+	      (nread < 0 && saved_errno == ENOSPC )) {
 		mlog( MLOG_NORMAL | MLOG_DRIVE,
 #ifdef DUMP
 		      _("encountered EOD : assuming blank media\n") );
@@ -2883,8 +2883,8 @@ determine_write_error( int nwritten, int saved_errno )
 
 		ret = DRIVE_ERROR_DEVICE;
 	} else if (
-			( saved_errno == ENOSPC ) 
-				|| 
+			( saved_errno == ENOSPC )
+				||
 			( saved_errno == EIO )
 				||
 			(( saved_errno == 0 ) && ( nwritten >= 0 ))  /* short
@@ -2895,7 +2895,7 @@ determine_write_error( int nwritten, int saved_errno )
 
 		mlog(MLOG_NORMAL,
 			_("no more data can be written to this tape\n") );
-		
+
 		ret = DRIVE_ERROR_EOM;
 	} else if ( saved_errno != 0 ) {
 		ret = DRIVE_ERROR_CORE;
@@ -3256,7 +3256,7 @@ prepare_drive( drive_t *drivep )
 			if (3 == try)
 				/* IRIX rmt returns ENOSPC for blank media */
 				/* It reads to the EOD */
-				return DRIVE_ERROR_BLANK; 
+				return DRIVE_ERROR_BLANK;
 			else
 				continue;
 #endif
@@ -3277,7 +3277,7 @@ prepare_drive( drive_t *drivep )
 			  "or foreign media\n" );
 			return DRIVE_ERROR_FOREIGN;
 		}
-			
+
 
 		/* if we fell through the seive, code is wrong.
 		 * display useful info and abort
@@ -3338,7 +3338,7 @@ checkhdr:
 					return DRIVE_ERROR_DEVICE;
 				}
 				return DRIVE_ERROR_FOREIGN;
-			} 
+			}
 		} else {
 			drive_hdr_t *drhdrp;
 			rec_hdr_t *tprhdrp;
@@ -3351,7 +3351,7 @@ checkhdr:
 
 largersize:
 		/* we end up here if we want to try a new larger record size
-		 * because the last one was not big enough for the tape block 
+		 * because the last one was not big enough for the tape block
 		 */
 		if ( changedblkszpr ) {
 			mlog( MLOG_NORMAL | MLOG_DRIVE,
@@ -3797,7 +3797,7 @@ Ring_get( ring_t *ringp )
 
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: get\n" );
-	
+
 	msgp = ring_get( ringp );
 	return msgp;
 }
@@ -3808,7 +3808,7 @@ Ring_put(  ring_t *ringp, ring_msg_t *msgp )
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: put %d\n",
 	      msgp->rm_op );
-	
+
 	ring_put( ringp, msgp );
 }
 
@@ -3817,7 +3817,7 @@ Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
 {
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: reset\n" );
-	
+
 	assert( ringp );
 
 	ring_reset( ringp, msgp );
@@ -3847,7 +3847,7 @@ display_ring_metrics( drive_t *drivep, int mlog_flags )
 	ring_t *ringp = contextp->dc_ringp;
 	char bufszbuf[ 16 ];
 	char *bufszsfxp;
-	
+
 	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
 		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
 		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
@@ -3899,7 +3899,7 @@ rewind_and_verify( drive_t *drivep )
 		if ( rval ) {
 			sleep( 1 );
 			rval = mt_op( contextp->dc_fd, MTREW, 0 );
-		} else 
+		} else
 			return 0;
 
 		if ( try >= MTOP_TRIES_MAX ) {
@@ -3915,7 +3915,7 @@ static uint32_t
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
-erase_and_verify( drive_t *drivep ) 
+erase_and_verify( drive_t *drivep )
 {
 	char *tempbufp;
 	int saved_errno;
@@ -3927,7 +3927,7 @@ erase_and_verify( drive_t *drivep )
 
 	/* Erase is not standard rmt. So we cannot use the line below.
 
-	( void )mt_op( contextp->dc_fd, MTERASE, 0 ); 
+	( void )mt_op( contextp->dc_fd, MTERASE, 0 );
 
 	 * So write a record of zeros to fake erase . Poor man's erase!
 	 * We put the ERASE_MAGIC string at the beginning so we can
@@ -3974,9 +3974,9 @@ set_best_blk_and_rec_sz( drive_t *drivep )
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 
 	if ( contextp->dc_isQICpr == BOOL_TRUE )
-		tape_recsz = STAPE_MIN_MAX_BLKSZ; 
+		tape_recsz = STAPE_MIN_MAX_BLKSZ;
 	else
-		tape_recsz = cmdlineblksize; 
+		tape_recsz = cmdlineblksize;
 
 	return BOOL_TRUE;
 }
@@ -4000,6 +4000,6 @@ isxfsdumperasetape( drive_t *drivep )
 {
 	if ( !strcmp( ( char * )drivep->d_greadhdrp, ERASE_MAGIC ) )
 		return BOOL_TRUE;
-	else 
+	else
 		return BOOL_FALSE;
 }
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 56b8c2d..c360f9c 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -459,7 +459,7 @@ is_scsi_driver(char *pathname)
 	int dev_major;
 
 	if (realpath(pathname, rp) == NULL) {
-		return BOOL_FALSE; 
+		return BOOL_FALSE;
 	}
 
 	if ( stat64( pathname, &statbuf ) == -1) {
@@ -497,7 +497,7 @@ is_scsi_driver(char *pathname)
 		return BOOL_TRUE;
 	}
 	else if (dev_major == get_driver_character_major("ts") ||
-	         dev_major == get_driver_character_major("tmf")) { 
+	         dev_major == get_driver_character_major("tmf")) {
 		TS_ISDRIVER = 1;
 		return BOOL_TRUE;
 	}
@@ -1131,7 +1131,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		currentoffset += ( off64_t )recoff;
 	}
 	assert( wantedoffset >= currentoffset );
-	
+
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
 	 */
@@ -1200,7 +1200,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	     wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
-		
+
 		assert( ! contextp->dc_recp );
 		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
 		if ( contextp->dc_singlethreadedpr ) {
@@ -1851,7 +1851,7 @@ do_begin_write( drive_t *drivep )
 
 	/* intialize header in new record
 	 */
-	rechdrp = (rec_hdr_t*)contextp->dc_recp;	
+	rechdrp = (rec_hdr_t*)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
 	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
@@ -2045,7 +2045,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	 */
 	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 	rechdrp->rec_used = tape_recsz;
-	
+
 	/* write out the record buffer and get a new one.
 	 */
 	if ( contextp->dc_singlethreadedpr ) {
@@ -2763,7 +2763,7 @@ do_quit( drive_t *drivep )
 	     &&
 	     ! contextp->dc_isQICpr
 	     &&
-	     contextp->dc_cansetblkszpr 
+	     contextp->dc_cansetblkszpr
 	     &&
 	     ( contextp->dc_origcurblksz != 0 ) ) {
 		( void )set_fixed_blksz( drivep, contextp->dc_origcurblksz );
@@ -2804,7 +2804,7 @@ percent64( off64_t num, off64_t denom )
  * in IRIX and Linux.
  * The 1st read() below is made prior to calling read_label().
  * The 2nd read() is the one made inside read_label().
- * Extraneous status flags, such as online, are not mentioned. 
+ * Extraneous status flags, such as online, are not mentioned.
  *
  * -----------------------------------------
  * Full tape (incomplete dump - over >1 tapes)
@@ -2818,16 +2818,16 @@ percent64( off64_t num, off64_t denom )
  *    read->-1 (ENOSPC) <eod, ew>
  * -----------------------------------------
  * Partial tape (complete dump - just 1 tape)
- * 
+ *
  * Linux
  *    read->0 <fmk>
  *    read->0 <eod>
- * 
+ *
  * IRIX
  *    read->0 <fmk>
  *    read->-1 (ENOSPC) <eod>
  * -----------------------------------------
- */  
+ */
 
 
 static int
@@ -3166,7 +3166,7 @@ set_fixed_blksz( drive_t *drivep, size_t blksz )
                 /* issue call to set block size
                  */
                 if ( mt_op( contextp->dc_fd,
-                            MTSETBLK,  
+                            MTSETBLK,
                             ( int )blksz ) ) {
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
 			      "MTSETBLK %u failed: %s (%d)\n",
@@ -3265,7 +3265,7 @@ Need to find equivalent in Linux.
 			}
 #endif
 		}
-	} 
+	}
 
 	set_recommended_sizes( drivep );
 
@@ -3317,7 +3317,7 @@ set_recommended_sizes( drive_t *drivep )
 /* mt_blkinfo
  *	In IRIX, issue MTIOGETBLKINFO ioctl operation to the tape device.
  *      There is no equivalent call in Linux at the moment.
- *      However, the minblks and maxblks are stored internally in 
+ *      However, the minblks and maxblks are stored internally in
  *      the scsi/st.c driver and may be exported in the future.
  *      The current blk size comes from the mt_dsreg field.
  *
@@ -3453,7 +3453,7 @@ mt_op(int fd, int sub_op, int param )
 
 static bool_t
 mt_get_fileno( drive_t *drivep, long *fileno)
-{ 
+{
 	struct mtget 	mt_stat;
 	drive_context_t *contextp;
 
@@ -3532,8 +3532,8 @@ mt_get_status( drive_t *drivep, long *status)
 	*status = mt_stat.mt_gstat;
 
 	/* print out symbolic form of tape status */
-	mlog( MLOG_DEBUG | MLOG_DRIVE, 
-		"tape status = %s%s%s%s%s%s%s\n", 
+	mlog( MLOG_DEBUG | MLOG_DRIVE,
+		"tape status = %s%s%s%s%s%s%s\n",
 		IS_BOT(*status)?   "bot ":"",
 		IS_FMK(*status)?   "fmk ":"",
 		IS_EOD(*status)?   "eod ":"",
@@ -4037,7 +4037,7 @@ retry:
 	 * and the record size we tried initially was not less than
 	 * the minmax block size, change the block size to minmax and
 	 * try to read a one block record again.
-	 * 
+	 *
 	 * **************
 	 * LINUX WARNING:
 	 * **************
@@ -4265,7 +4265,7 @@ retry:
 
 		if ( nread == 0
 		     &&
-		     ! contextp->dc_isvarpr 
+		     ! contextp->dc_isvarpr
 		     &&
 		     IS_EOD( mtstat )
 		     &&
@@ -4284,7 +4284,7 @@ retry:
 
 		if ( nread == 0
 		     &&
-		     ! contextp->dc_isvarpr 
+		     ! contextp->dc_isvarpr
 		     &&
 		     IS_EOD( mtstat )
 		     &&
@@ -4302,7 +4302,7 @@ retry:
 
 		if ( nread == 0
 		     &&
-		     ! contextp->dc_isvarpr 
+		     ! contextp->dc_isvarpr
 		     &&
 		     IS_EOT( mtstat )
 		     &&
@@ -4320,7 +4320,7 @@ retry:
 
 		if ( nread == 0
 		     &&
-		     ! contextp->dc_isvarpr 
+		     ! contextp->dc_isvarpr
 		     &&
 		     ! IS_EOD( mtstat )
 		     &&
@@ -4433,7 +4433,7 @@ retry:
 			  "indicates wrong blocksize\n" );
 			goto newsize;
 		}
-		
+
 		if ( nread == ( int )tape_recsz
 		     &&
 		     ! contextp->dc_isvarpr ) {
@@ -4485,7 +4485,7 @@ retry:
 		    mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_DRIVE,
 			_("either try using a smaller block size with "
 			"the -b option, or increase max_sg_segs for "
-			"the scsi tape driver\n")); 
+			"the scsi tape driver\n"));
 		}
 
 
@@ -4544,7 +4544,7 @@ checkhdr:
 			tape_recsz = ( size_t )tprhdrp->recsize;
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
 			      "tape record size set to header's "
-			      "record size = %d\n", tape_recsz); 
+			      "record size = %d\n", tape_recsz);
 			break;
 		}
 
@@ -4589,7 +4589,7 @@ newsize:
 
 largersize:
 		/* we end up here if we want to try a new larger record size
-		 * because the last one was not big enough for the tape block 
+		 * because the last one was not big enough for the tape block
 		 */
 		if ( changedblkszpr ) {
 			mlog( MLOG_NORMAL | MLOG_DRIVE,
@@ -5077,7 +5077,7 @@ Ring_get( ring_t *ringp )
 
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: get\n" );
-	
+
 	msgp = ring_get( ringp );
 	return msgp;
 }
@@ -5088,7 +5088,7 @@ Ring_put(  ring_t *ringp, ring_msg_t *msgp )
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: put %d\n",
 	      msgp->rm_op );
-	
+
 	ring_put( ringp, msgp );
 }
 
@@ -5097,7 +5097,7 @@ Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
 {
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: reset\n" );
-	
+
 	assert( ringp );
 
 	ring_reset( ringp, msgp );
@@ -5127,7 +5127,7 @@ display_ring_metrics( drive_t *drivep, int mlog_flags )
 	ring_t *ringp = contextp->dc_ringp;
 	char bufszbuf[ 16 ];
 	char *bufszsfxp;
-	
+
 	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
 		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
 		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
@@ -5178,7 +5178,7 @@ rewind_and_verify( drive_t *drivep )
 	for ( try = 1 ; ; try++ ) {
 		mtstat_t mtstat;
 		bool_t ok;
-		
+
 		if ( rval ) {
 			sleep( 1 );
 			rval = mt_op( contextp->dc_fd, MTREW, 0 );
@@ -5233,7 +5233,7 @@ bsf_and_verify( drive_t *drivep )
 		( void )mt_op( contextp->dc_fd, MTBSF, 1 );
 		for ( try = 1 ; ; try++ ) {
 			mtstat_t mtstat;
-		
+
 			ok = mt_get_status( drivep, &mtstat );
 			if ( ! ok ) {
 				mtstat = 0;
@@ -5286,7 +5286,7 @@ status:		ok = mt_get_status( drivep, &mtstat );
 				return 0;
 			}
 			try++;
-			sleep( 1 ); 
+			sleep( 1 );
 			goto status;
 		}
 		return mtstat;
@@ -5304,7 +5304,7 @@ fsf_and_verify( drive_t *drivep )
 	for ( try = 1 ; ; try++ ) {
 		mtstat_t mtstat;
 		bool_t ok;
-		
+
 		ok = mt_get_status( drivep, &mtstat );
 		if ( ! ok ) {
 			mtstat = 0;
@@ -5394,7 +5394,7 @@ isefsdump( drive_t *drivep )
  * General purpose routine which dredges through procfs trying to
  * match up device driver names with the associated major numbers
  * being used in the running kernel. (This routine is based on
- * the get_driver_block_major() routine in the libdisk library.) 
+ * the get_driver_block_major() routine in the libdisk library.)
  */
 static int
 get_driver_character_major( const char *driver )
diff --git a/common/drive_simple.c b/common/drive_simple.c
index b4e41da..54a3058 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -342,7 +342,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 			      drivep->d_pathname,
 			      strerror( errno ));
 			return BOOL_FALSE;
-		
+
 		}
 		oflags = O_RDONLY;
 		switch( statbuf.st_mode & S_IFMT ) {
@@ -495,7 +495,7 @@ do_begin_read( drive_t *drivep )
 		return rval;
 	}
 	assert( ( size_t )nread == GLOBAL_HDR_SZ );
-	
+
 	mlog(MLOG_NITTY, "do_begin_read: global_hdr\n"
 	     "\tgh_magic %.100s\n"
 	     "\tgh_version %u\n"
@@ -771,7 +771,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	if ( strmoff > mark ) {
 		return DRIVE_ERROR_CORE;
 	}
-	
+
 	/* use read_buf util func to eat up difference
 	 */
 	nreadneeded64 = mark - strmoff;
@@ -897,7 +897,7 @@ do_begin_write( drive_t *drivep )
 	/* indicate in the header that there is no recorded mark.
 	 */
 	*( ( off64_t * )dwhdrp->dh_specific ) = 0;
-	
+
 	/* prepare the drive context. initially the caller does not own
 	 * any of the write buffer, so the next portion of the buffer to
 	 * be supplied is the top of the buffer. emptyp never changes;
@@ -1491,7 +1491,7 @@ do_erase( drive_t *drivep )
 /* get_media_class()
  */
 /* ARGSUSED */
-static int 
+static int
 do_get_device_class( drive_t *drivep )
 {
 	mlog( MLOG_NITTY | MLOG_DRIVE,
diff --git a/common/global.c b/common/global.c
index e70b8a0..73efd55 100644
--- a/common/global.c
+++ b/common/global.c
@@ -163,7 +163,7 @@ global_hdr_alloc( int argc, char *argv[ ] )
                                 usage( );
                                 return 0;
                         }
-			
+
 			if ( ! uuid_parse( optarg, ghdrp->gh_dumpid ) ) {
 				mlog( MLOG_NORMAL | MLOG_ERROR,
 				      _("-%c argument not a valid uuid\n"),
@@ -275,10 +275,10 @@ global_hdr_checksum_check( global_hdr_t *hdrp )
 	return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
 }
 
-/* global_version_check - if we know this version number, return BOOL_TRUE 
+/* global_version_check - if we know this version number, return BOOL_TRUE
  * else return BOOL_FALSE
  */
-bool_t 
+bool_t
 global_version_check( uint32_t version )
 {
 	switch (version) {
diff --git a/common/global.h b/common/global.h
index 0b738de..53351a1 100644
--- a/common/global.h
+++ b/common/global.h
@@ -32,7 +32,7 @@
 	 * version 2 adds encoding of holes and a change to on-tape inventory format.
 	 * version 1 adds extended file attribute dumping.
 	 * version 0 xfsrestore can't handle media produced
-	 * by version 1 xfsdump. 
+	 * by version 1 xfsdump.
 	 */
 #define GLOBAL_HDR_VERSION	GLOBAL_HDR_VERSION_3
 
@@ -93,7 +93,7 @@ extern void global_hdr_checksum_set( global_hdr_t *hdrp );
  */
 extern bool_t global_hdr_checksum_check( global_hdr_t *hdrp );
 
-/* global_version_check - if we know this version number, return BOOL_TRUE 
+/* global_version_check - if we know this version number, return BOOL_TRUE
  * else return BOOL_FALSE
  */
 
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 0709dbe..7a3584d 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -528,7 +528,7 @@ const	xfs_bstat_t	*statp)
 		dmf_f_ctxtp->candidate = 1;
 		dmf_f_ctxtp->filesize = statp->bs_size;
 		break;
-	
+
 	default:
 		break;
 	}
diff --git a/common/inventory.c b/common/inventory.c
index 0e9c256..552f594 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -50,9 +50,9 @@ inv_open( inv_predicate_t bywhat, void *pred )
 	char uuname[ INV_STRLEN ];
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
 	invt_sescounter_t *sescnt = 0;
-	
+
 	int index = 0;
-	
+
 	assert ( pred );
 	if ((fd = init_idb ( pred, bywhat, uuname, &tok )) < 0 )
 		return tok;
@@ -86,9 +86,9 @@ inv_open( inv_predicate_t bywhat, void *pred )
 		printf("$ creating a new storage obj & index entry. \n" );
 #endif
 		close (stobjfd);
-		
+
 		stobjfd = create_invindex_entry( &tok, fd, uuname, BOOL_FALSE );
-		free ( sescnt );		
+		free ( sescnt );
 		if ( stobjfd < 0 ) {
 			close( fd );
 			close( sesslock_fd );
@@ -97,13 +97,13 @@ inv_open( inv_predicate_t bywhat, void *pred )
 		}
 		return tok;
 	}
-	
+
 	free ( sescnt );
 	tok = get_token( fd, stobjfd );
 	tok->d_invindex_off = INVINDEX_HDR_OFFSET( index - 1 );
-	
+
 	return tok;
-	
+
 }
 
 
@@ -124,7 +124,7 @@ inv_close( inv_idbtoken_t tok )
 	destroy_token( tok );
 	close( sesslock_fd );
 	sesslock_fd = -1;
-	
+
 	return BOOL_TRUE;
 }
 
@@ -141,7 +141,7 @@ inv_close( inv_idbtoken_t tok )
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_lasttime_level_lessthan( 
+inv_lasttime_level_lessthan(
 	inv_idbtoken_t  tok,
 	u_char level,
 	time32_t **tm )
@@ -166,7 +166,7 @@ inv_lasttime_level_lessthan(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_lastsession_level_lessthan( 
+inv_lastsession_level_lessthan(
 	inv_idbtoken_t 	tok,
 	u_char		level,
 	inv_session_t 	**ses )
@@ -174,7 +174,7 @@ inv_lastsession_level_lessthan(
 	int 	rval;
 	assert ( tok != INV_TOKEN_NULL );
 
-	rval = search_invt( tok, level, (void **) ses, 
+	rval = search_invt( tok, level, (void **) ses,
 			  (search_callback_t) lastsess_level_lessthan );
 
 	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
@@ -193,14 +193,14 @@ inv_lastsession_level_lessthan(
 
 
 bool_t
-inv_lastsession_level_equalto( 
-	inv_idbtoken_t 	tok,			    
+inv_lastsession_level_equalto(
+	inv_idbtoken_t 	tok,
 	u_char		level,
 	inv_session_t	**ses )
 {
 	int 	rval;
 	assert ( tok != INV_TOKEN_NULL );
-	rval = search_invt( tok, level, (void **) ses, 
+	rval = search_invt( tok, level, (void **) ses,
 			  (search_callback_t) lastsess_level_equalto );
 
 	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
@@ -220,7 +220,7 @@ inv_lastsession_level_equalto(
 /*----------------------------------------------------------------------*/
 
 inv_sestoken_t
-inv_writesession_open( 
+inv_writesession_open(
 	inv_idbtoken_t tok, 	/* token obtained by inventory_open() */
 	uuid_t		*fsid,
 	uuid_t		*sesid,
@@ -256,25 +256,25 @@ inv_writesession_open(
 	/* copy the session information to store */
 	memcpy( &ses->s_sesid, sesid, sizeof( uuid_t ) );
 	memcpy( &ses->s_fsid, fsid, sizeof( uuid_t ) );
-	strcpy( ses->s_label, label );	
-	strcpy( ses->s_mountpt, mntpt );	
-	strcpy( ses->s_devpath, devpath );	
+	strcpy( ses->s_label, label );
+	strcpy( ses->s_mountpt, mntpt );
+	strcpy( ses->s_devpath, devpath );
 	ses->s_max_nstreams = nstreams;
 
 
 	/* s_curstream_off will be set in create_session() */
 
 	fd = tok->d_stobj_fd;
-	
+
 	assert ( fd > 0 );
 
 	hdr.sh_time = time;
-	hdr.sh_level = level;	
+	hdr.sh_level = level;
 	/* sh_streams_off and sh_sess_off will be set in create_session() */
-	
+
 	sestok = get_sesstoken( tok );
 
-	/* we need to put the new session in the appropriate place in 
+	/* we need to put the new session in the appropriate place in
 	   storage object. So first find out howmany sessions are there */
 
 	INVLOCK( fd, LOCK_EX );
@@ -285,14 +285,14 @@ inv_writesession_open(
 		return INV_TOKEN_NULL;
 	}
 
-	/* create the writesession, and get ready for the streams to come 
+	/* create the writesession, and get ready for the streams to come
 	   afterwards */
 	rval = create_session( sestok, fd, sescnt, ses, &hdr );
 	assert (rval > 0);
 
 
 	INVLOCK( fd, LOCK_UN );
- 
+
 	sestok->sd_sesstime = time;
 
 	if ( tok->d_update_flag & NEW_INVINDEX ) {
@@ -325,7 +325,7 @@ bool_t
 inv_writesession_close( inv_sestoken_t tok )
 {
 	int		rval;
-	
+
 	assert ( tok != INV_TOKEN_NULL );
 
 	/* now update end_time in the inv index header */
@@ -357,22 +357,22 @@ inv_stream_open(
 	int fd;
 
 	assert ( tok != INV_TOKEN_NULL );
-	 
+
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_FALSE;
 
-	
+
 	/* XXX yukk... make the token descriptors not pointers */
 	stok = ( inv_stmtoken_t ) malloc( sizeof( invt_strdesc_entry_t ) );
-	
+
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
-	
+
 	/* get the session to find out where the stream is going to go */
-	fd = tok->sd_invtok->d_stobj_fd; 
+	fd = tok->sd_invtok->d_stobj_fd;
 
 	sess_lock();
-	
+
 	INVLOCK( fd, LOCK_SH );
 	/* get the session header first */
 	if ( GET_REC_NOLOCK( fd, &seshdr, sizeof( invt_seshdr_t ),
@@ -397,13 +397,13 @@ inv_stream_open(
 
 	if ( ses.s_cur_nstreams < ses.s_max_nstreams ) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) * 
+		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) *
 					         ses.s_cur_nstreams )
 			                         + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
-				
+
 		/* write it back. this locks and unlocks fd EXclusively */
-		if ( PUT_REC( fd, &ses, sizeof( ses ), 
+		if ( PUT_REC( fd, &ses, sizeof( ses ),
 			      tok->sd_session_off ) < 0 ) {
 			free ( stok );
 			sess_unlock();
@@ -419,7 +419,7 @@ inv_stream_open(
 	sess_unlock();
 
 	stream.st_firstmfile = stream.st_lastmfile = stok->md_stream_off;
-	
+
 	/* now put the stream header on to the disk */
 	if ( PUT_REC( fd, &stream, sizeof( invt_stream_t ),
 		      stok->md_stream_off ) < 0 ) {
@@ -450,16 +450,16 @@ inv_stream_close(
 	bool_t dowrite = BOOL_FALSE;
 
 	INVLOCK( fd, LOCK_EX );
-	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ), 
+	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ),
 			       tok->md_stream_off )) < 0 )
 		goto end;   /* eek :-)   */
-	
+
 	if ( strm.st_interrupted != wasinterrupted ) {
 		strm.st_interrupted = wasinterrupted;
 		dowrite = BOOL_TRUE;
 	}
 
-	/* get the last media file to figure out what our last ino was. 
+	/* get the last media file to figure out what our last ino was.
 	   we have a pointer to that in the stream token */
 	if ( tok->md_lastmfile ){
 		if ( strm.st_endino.ino != tok->md_lastmfile->mf_endino.ino ||
@@ -469,7 +469,7 @@ inv_stream_close(
 			strm.st_endino = tok->md_lastmfile->mf_endino;
 		}
 	}
-			
+
 	if (dowrite) {
 		rval = PUT_REC_NOLOCK(fd, &strm, sizeof(invt_stream_t),
 				      tok->md_stream_off);
@@ -483,7 +483,7 @@ inv_stream_close(
 
 	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
 }
- 
+
 
 
 
@@ -494,9 +494,9 @@ inv_stream_close(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_put_mediafile( 
-	inv_stmtoken_t 	tok, 
-	uuid_t 		*moid, 
+inv_put_mediafile(
+	inv_stmtoken_t 	tok,
+	uuid_t 		*moid,
 	char 		*label,
 	xfs_ino_t	startino,
 	off64_t		startino_offset,
@@ -512,15 +512,15 @@ inv_put_mediafile(
 	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
 
 	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
-	
+
 	/* copy the media file information */
 	memcpy( &mf->mf_moid, moid, sizeof( uuid_t ) );
-	strcpy( mf->mf_label, label );	
+	strcpy( mf->mf_label, label );
 	mf->mf_startino.ino = startino;
 	mf->mf_startino.offset = startino_offset;
 	mf->mf_endino.ino = endino;
 	mf->mf_endino.offset = endino_offset;
-	
+
 	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX );
 	rval = put_mediafile( tok, mf );
 	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN );
@@ -555,30 +555,30 @@ inv_get_inolist(
 	invt_entry_t	*iarr = NULL;
 	invt_counter_t	*icnt = NULL;
 	int	     	nindices, i;
-	struct stat64	statbuf;	
+	struct stat64	statbuf;
 	inv_inolist_t 	*curitem;
 
-#ifdef NOTDEF	
+#ifdef NOTDEF
 	*inolist = NULL;
 	curitem = malloc( sizeof( inv_inolist_t ) );
-	
+
 	/* get the array of all indices in the invindex */
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr, 
-					      (void **)&icnt, 
+	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+					      (void **)&icnt,
 					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t )) 
+					      sizeof( invt_counter_t ))
 	      ) <= 0 ) {
 		return -1;
 	}
 	free( icnt );
-	
+
 	/* attach all the StObjs */
 	for (i = nindices - 1; i >= 0; i--) {
 		if ( stat64( iarr[i].ie_filename, &statbuf ) < 0 ) {
 			perror( iarr[i].ie_filename );
 			return -1;
 		}
-		
+
 		create_inolist_item( curitem, statbuf.st_ino );
 	}
 	/* The inventory index */
@@ -594,7 +594,7 @@ inv_get_inolist(
 			return -1;
 		}
 	create_inolist_item( curitem, statbuf.st_ino );
-	
+
 	/* sesslock file */
 	if ( stat64( SESSLOCK_FILE, &statbuf ) < 0 ) {
 			perror( SESSLOCK_FILE );
@@ -604,7 +604,7 @@ inv_get_inolist(
 #endif
 
 	return 1;
-		
+
 }
 
 
@@ -634,7 +634,7 @@ inv_get_session(
 
 	/* First get the session header, and the session information. Then
 	   we can figure out how much space to allocate */
-	
+
 }
 
 
@@ -644,12 +644,12 @@ inv_get_session(
 
 /* This prints out all the sessions of a filesystem that are in the inventory */
 bool_t
-inv_DEBUG_printallsessions( 
-	inv_idbtoken_t 	tok,			    
+inv_DEBUG_printallsessions(
+	inv_idbtoken_t 	tok,
 	inv_session_t	**ses )
 {
 	int 	rval;
-	rval = search_invt( tok, 0, (void **) ses, 
+	rval = search_invt( tok, 0, (void **) ses,
 			  (search_callback_t) DEBUG_displayallsessions );
 
 	return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
diff --git a/common/inventory.h b/common/inventory.h
index f9fcb19..d5c182a 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -28,8 +28,8 @@
  * knowledge of the functionalities, some abstractions, and even typical queries
  * of dump() and restore() and uses this knowledge in formulating its storage
  * structure on disk. All these things, of course, are completely abstract with
- * respect to the clients of the inventory. 
- * 
+ * respect to the clients of the inventory.
+ *
  */
 
 #define INV_DIRPATH		inv_dirpath()
@@ -76,7 +76,7 @@ typedef enum {
 
 typedef struct inv_stream {
 	bool_t		st_interrupted;	/* was this stream interrupted ? */
-	
+
 	/* duplicate info from mediafiles for speed */
 	xfs_ino_t	st_startino;	/* the starting pt */
 	off64_t		st_startino_off;
@@ -88,11 +88,11 @@ typedef struct inv_stream {
 } inv_stream_t;
 
 
-/* 
- * inventory_session_t 
+/*
+ * inventory_session_t
  * all the information that is kept on a single dump session of a single
  * file system in the inventory.
- * 
+ *
  */
 
 typedef struct inv_session {
@@ -107,8 +107,8 @@ typedef struct inv_session {
 	char		 s_mountpt[INV_STRLEN];/* path to the mount point */
 	char		 s_devpath[INV_STRLEN];/* path to the device */
 } inv_session_t;
- 
-	
+
+
 /* Is there anything else that you need here, Chuck? */
 typedef struct inv_mediafile {
 	uuid_t		 m_moid;	/* media object id */
@@ -142,13 +142,13 @@ typedef struct invt_strdesc_entry	*inv_stmtoken_t;
 /* inventory_open - initializes access to the inventory
  */
 extern inv_idbtoken_t
-inv_open( 
-	 inv_predicate_t bywhat, /* BY_UUID, BY_MOUNTPT, BY_DEVPATH */	
+inv_open(
+	 inv_predicate_t bywhat, /* BY_UUID, BY_MOUNTPT, BY_DEVPATH */
 	 void 		 *pred );/* uuid_t *,char * mntpt, or char *dev */
 
 
 extern bool_t
-inv_close( 
+inv_close(
 	inv_idbtoken_t tok );
 
 
@@ -165,7 +165,7 @@ inv_writesession_open(
 	char		*devpath );
 
 extern bool_t
-inv_writesession_close( 
+inv_writesession_close(
 	inv_sestoken_t  tok );
 
 extern inv_stmtoken_t
@@ -178,9 +178,9 @@ inv_stream_close(
 	bool_t 		wasinterrupted );
 
 extern bool_t
-inv_put_mediafile( 
-	inv_stmtoken_t 	tok, 
-	uuid_t 		*moid, 
+inv_put_mediafile(
+	inv_stmtoken_t 	tok,
+	uuid_t 		*moid,
 	char 		*label,
 	xfs_ino_t	startino,
 	off64_t		startino_offset,
@@ -190,23 +190,23 @@ inv_put_mediafile(
 /* lasttime_level_lessthan - finds the time of the last dump of the
  * specified file system at a level less than the specified level.
  * if never dumped below the current level, *time is set to NULL.
- * 
+ *
  */
 extern bool_t
-inv_lasttime_level_lessthan( 
+inv_lasttime_level_lessthan(
 	inv_idbtoken_t 		tok,
 	u_char  		level,
 	time32_t		**time );/* out */
 
 extern bool_t
-inv_lastsession_level_lessthan( 
-	inv_idbtoken_t 		tok,			     
+inv_lastsession_level_lessthan(
+	inv_idbtoken_t 		tok,
 	u_char  		level,
 	inv_session_t		**ses );/* out */
 
 extern bool_t
-inv_lastsession_level_equalto( 
-	inv_idbtoken_t 		tok,			     
+inv_lastsession_level_equalto(
+	inv_idbtoken_t 		tok,
 	u_char  		level,
 	inv_session_t		**ses );/* out */
 
@@ -231,8 +231,8 @@ inv_put_session(
 #ifdef DEBUG
 
 bool_t
-inv_DEBUG_printallsessions( 
-	inv_idbtoken_t 	tok,			    
+inv_DEBUG_printallsessions(
+	inv_idbtoken_t 	tok,
 	inv_session_t	**ses );
 
 #endif /* ifdef DEBUG */
diff --git a/common/main.c b/common/main.c
index d3bdcf3..b3605d1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -204,7 +204,7 @@ main( int argc, char *argv[] )
 	if ( ! ok ) {
 		return mlog_exit(EXIT_ERROR, RV_OPT);
 	}
-	
+
 	/* initialize message logging (stage 1)
 	 */
 	ok = mlog_init1( argc, argv );
@@ -698,7 +698,7 @@ main( int argc, char *argv[] )
 			prbcld_xc = xc;
 			stop_requested = BOOL_TRUE;
 		}
-			
+
 		/* all children died normally. break out.
 		 */
 		if ( cldmgr_remainingcnt( ) == 0 ) {
@@ -743,7 +743,7 @@ main( int argc, char *argv[] )
 				}
 				stop_timeout = STOP_TIMEOUT;
 			}
-				
+
 			/* important that this appear after dialog.
 			 * allows dialog to be terminated with SIGINT,
 			 * without infinite loop.
@@ -793,7 +793,7 @@ main( int argc, char *argv[] )
 				coredump_requested = BOOL_TRUE;
 			}
 		}
-		
+
 		/* see if need to initiate a stop
 		 */
 		if ( stop_requested && ! stop_in_progress ) {
@@ -806,7 +806,7 @@ main( int argc, char *argv[] )
 			assert( stop_timeout >= 0 );
 			stop_deadline = now + ( time32_t )stop_timeout;
 		}
-		
+
 		/* set alarm if needed (note time stands still during dialog)
 		 */
 		if ( stop_in_progress ) {
@@ -1381,7 +1381,7 @@ loadoptfile( int *argcp, char ***argvp )
 	return BOOL_TRUE;
 }
 
-/* parent and children share this handler. 
+/* parent and children share this handler.
  */
 static void
 sighandler( int signo )
@@ -2012,7 +2012,7 @@ sigintstr( void )
 		      strerror( errno ));
 		return 0;
 	}
-	
+
 	intchr = termios.c_cc[ VINTR ];
 	mlog( MLOG_NITTY | MLOG_PROC,
 	      "tty fd: %d; terminal interrupt character: %c (0%o)\n",
@@ -2071,7 +2071,7 @@ set_rlimits( size64_t *vmszp )
 
 	vmsz = ( size64_t )rlimit64.rlim_cur;
 #endif /* RESTORE */
-	
+
 	assert( minstacksz <= maxstacksz );
 	rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
 	assert( ! rval );
@@ -2175,7 +2175,7 @@ set_rlimits( size64_t *vmszp )
 	      "RLIMIT_DATA org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
 	      rlimit64.rlim_max );
-	
+
 	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
 	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
@@ -2192,7 +2192,7 @@ set_rlimits( size64_t *vmszp )
 	      "RLIMIT_FSIZE now cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
 	      rlimit64.rlim_max );
-	
+
 	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
 	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
diff --git a/common/media.c b/common/media.c
index 02fde9c..817e99e 100644
--- a/common/media.c
+++ b/common/media.c
@@ -196,7 +196,7 @@ media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
 		mediap->m_strategyp = chosen_sp;
 		mediap->m_writehdrp->mh_strategyid = chosen_sp->ms_id;
 	}
-	
+
 	/* initialize the strategy. this will cause each of the managers
 	 * to be initialized as well. if error, return 0.
 	 */
@@ -250,7 +250,7 @@ media_get_upper_hdrs( media_t *mediap,
 
 /* definition of locally defined static functions ****************************/
 
-/* media_alloc - allocate and initialize the generic portions of a media 
+/* media_alloc - allocate and initialize the generic portions of a media
  * descriptor and read and write media headers
  */
 static media_t *
diff --git a/common/media_rmvtape.h b/common/media_rmvtape.h
index 46d25f8..61e80e1 100644
--- a/common/media_rmvtape.h
+++ b/common/media_rmvtape.h
@@ -21,7 +21,7 @@
 /* media_rmvtape.h - removalable tape media abstraction
  */
 
-/* This structure is overlayed on the mh_specific field of the media_hdr 
+/* This structure is overlayed on the mh_specific field of the media_hdr
  * structure. If is a maximum of 128 byptes long.
  */
 struct media_rmvtape_spec {
diff --git a/common/mlog.c b/common/mlog.c
index b520131..0924bf2 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -64,7 +64,7 @@ static int mlog_sym_lookup( char * );
 
 static size_t mlog_streamcnt;
 
-static char mlog_levelstr[ 3 ]; 
+static char mlog_levelstr[ 3 ];
 
 #define MLOG_SS_NAME_MAX	15
 #ifdef DUMP
@@ -201,7 +201,7 @@ mlog_init1( int argc, char *argv[ ] )
 				int suboptix;
 				char *valstr;
 
-				suboptix = getsubopt( &options, 
+				suboptix = getsubopt( &options,
 						      (constpp)suboptstrs,
 						      &valstr );
 				if ( suboptix < 0 ) {
@@ -349,7 +349,7 @@ mlog_override_level( int levelarg )
 	level = levelarg & MLOG_LEVELMASK;
 	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
 
-	if (ss == MLOG_SS_GEN) { /* do level for all subsys */  
+	if (ss == MLOG_SS_GEN) { /* do level for all subsys */
 	    for (ss = 0 ; ss < MLOG_SS_CNT ; ss++ ) {
 		mlog_level_ss[ ss ] = level;
 	    }
@@ -381,7 +381,7 @@ mlog_va( int levelarg, char *fmt, va_list args )
 	if ( level > mlog_level_ss[ ss ] ) {
 		return;
 	}
-	
+
 	if ( ! ( levelarg & MLOG_NOLOCK )) {
 		mlog_lock( );
 	}
@@ -473,7 +473,7 @@ struct rv_map {
 static struct rv_map
 rvs[_RV_NUM] = {
        /* Return Code	Displayed Code	Explanation */
-	{ RV_OK,	"OK",		"success" }, 
+	{ RV_OK,	"OK",		"success" },
 	{ RV_NOTOK,	"ERASE_FAILED",	"media erase request denied" },
 	{ RV_NOMORE,	"NOMORE",	"no more work to do" },
 	{ RV_EOD,	"EOD",		"ran out of data" },
@@ -502,7 +502,7 @@ rvs[_RV_NUM] = {
 	{ RV_UNKNOWN,	"UNKNOWN",	"unknown error" },
 };
 
-static struct rv_map 
+static struct rv_map
 rv_unknown = {
 	  _RV_NUM,	"???",		"unknown error code"
 };
@@ -638,7 +638,7 @@ _mlog_exit_hint( const char *file, int line, rv_t rv )
 
 	tid = pthread_self();
 	rvp = rv_getdesc(rv);
-	
+
 	mlog( MLOG_DEBUG | MLOG_NOLOCK,
 	      "%s: %d: mlog_exit_hint called: "
 	      "hint: %s (%s)\n",
@@ -660,7 +660,7 @@ _mlog_exit_hint( const char *file, int line, rv_t rv )
 
 	if ( pthread_equal( tid, parenttid ) )
 		mlog_main_exit_hint = rv;
-	else 
+	else
 		stream_set_hint( tid, rv );
 
 }
diff --git a/common/mlog.h b/common/mlog.h
index e080f9e..628dd28 100644
--- a/common/mlog.h
+++ b/common/mlog.h
@@ -57,7 +57,7 @@
 #define MLOG_SS_TREE	5		/* restore tree */
 #endif /* RESTORE */
 #define MLOG_SS_EXCLFILES 6		/* list excluded files */
-#define MLOG_SS_CNT	7		/* NOTE! bump this when adding ss */	
+#define MLOG_SS_CNT	7		/* NOTE! bump this when adding ss */
 
 #define MLOG_SS_SHIFT	8
 #define MLOG_SS_MASK	( 0xff << MLOG_SS_SHIFT )
diff --git a/common/qlock.c b/common/qlock.c
index c770116..1db461d 100644
--- a/common/qlock.c
+++ b/common/qlock.c
@@ -105,7 +105,7 @@ qlock_lock( qlockh_t qlockh )
 	pthread_t tid;
 	/* REFERENCED */
 	int rval;
-	
+
 	/* get the caller's tid
 	 */
 	tid = pthread_self();
@@ -148,7 +148,7 @@ qlock_unlock( qlockh_t qlockh )
 	qlock_t *qlockp = ( qlock_t * )qlockh;
 	/* REFERENCED */
 	int rval;
-	
+
 	/* verify lock is held by this thread
 	 */
 	assert( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
@@ -156,7 +156,7 @@ qlock_unlock( qlockh_t qlockh )
 	/* clear lock's ord from thread's ord map
 	 */
 	QLOCK_ORDMAP_CLR( thread_ordmap, qlockp->ql_ord );
-	
+
 	/* release the lock
 	 */
 	rval = pthread_mutex_unlock( &qlockp->ql_mutex );
@@ -203,7 +203,7 @@ qsemP( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
 	int rval;
-	
+
 	/* "P" the semaphore
 	 */
 	rval = sem_wait( semp );
@@ -215,7 +215,7 @@ qsemV( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
 	int rval;
-	
+
 	/* "V" the semaphore
 	 */
 	rval = sem_post( semp );
diff --git a/common/rec_hdr.h b/common/rec_hdr.h
index 552447c..1ab783c 100644
--- a/common/rec_hdr.h
+++ b/common/rec_hdr.h
@@ -33,7 +33,7 @@
 /*
  * This structure is used by both drive_minrmt and drive_scsi.  New
  * strategies should define their own here if they need a different
- * structure, and add a endian conversion function to arch_xlate.c 
+ * structure, and add a endian conversion function to arch_xlate.c
  */
 struct rec_hdr {
 	uint64_t magic;			/*   8   8 */
diff --git a/common/ring.c b/common/ring.c
index f5055ee..70c0f45 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -210,7 +210,7 @@ ring_put( ring_t *ringp, ring_msg_t *msgp )
 	ringp->r_active_in_ix = ( ringp->r_active_in_ix + 1 )
 				%
 				ringp->r_len;
-	
+
 	/* bump the semaphore for the active queue ("V")
 	 */
 	qsemV( ringp->r_active_qsemh );
@@ -395,7 +395,7 @@ ring_slave_put( ring_t *ringp, ring_msg_t *msgp )
 	ringp->r_ready_in_ix = ( ringp->r_ready_in_ix + 1 )
 			       %
 			       ringp->r_len;
-	
+
 	/* bump the semaphore for the ready queue ("V")
 	 */
 	qsemV( ringp->r_ready_qsemh );
diff --git a/common/ring.h b/common/ring.h
index 4a1cc54..6126b77 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -150,7 +150,7 @@ struct ring {
 };
 
 typedef struct ring ring_t;
-	
+
 
 /* ring_create - creates a ring. parameters supply the length of the ring,
  * the read/write buffer size, the drive index, a function for reading, a
diff --git a/common/stream.c b/common/stream.c
index 3047886..eadaaea 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -277,7 +277,7 @@ stream_cnt( void )
 	size_t bitix;
 
 	assert( sizeof( ixmap ) * NBBY >= STREAM_SIMMAX );
-	
+
 	lock();
 	for ( ; p < ep ; p++ ) {
 		if ( p->s_state == S_RUNNING ) {
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 40c273c..92fd889 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -25,19 +25,19 @@ typedef unsigned int    minor_t;
  * have been defined in sys/mtio.h and are supported in ST as well.
  * See sys/mtio.h for details.
  *
- *  operations (mt_op values for MTIOCTOP) 
+ *  operations (mt_op values for MTIOCTOP)
  *
- * #define MTFSF	1	 forward space file 
- * #define MTBSF	2	 backward space file 
- * #define MTFSR	3	 forward space record 
- * #define MTBSR	4	 backward space record 
+ * #define MTFSF	1	 forward space file
+ * #define MTBSF	2	 backward space file
+ * #define MTFSR	3	 forward space record
+ * #define MTBSR	4	 backward space record
  * #define MTWEOF	5	 write an end-of-file record
- * #define MTREW	6	 rewind 
- * #define MTOFFL	7	 rewind and put the drive offline 
- * #define MTNOP	8	 no operation, sets status only 
- * #define MTRETEN	9	 retention operation 
- * #define MTEOM	12	 space to end of recorded data 
- * #define MTERASE	13	 erase tape from current position to EOT 
+ * #define MTREW	6	 rewind
+ * #define MTOFFL	7	 rewind and put the drive offline
+ * #define MTNOP	8	 no operation, sets status only
+ * #define MTRETEN	9	 retention operation
+ * #define MTEOM	12	 space to end of recorded data
+ * #define MTERASE	13	 erase tape from current position to EOT
  * #define MTSETBLK	20	 set block length
  * #define MTSEEK	22	 Seek to the given block number.  Not all
  *				 drives support this option.  For drives
@@ -48,19 +48,19 @@ typedef unsigned int    minor_t;
  *				 799 decimal) the program #).  For seeking
  *				 to times in audio mode, see MTSETAUDIO.
  * #define MTWSM	27	 write mt_count setmarks (DAT)
- * #define MTUNLOAD	31	 unload tape from drive 
+ * #define MTUNLOAD	31	 unload tape from drive
  * #define MTSETPART	33	 skip to partition in mt_count (DAT); for
  * 				 DDS format DAT drives (only ones
  * 				 supported current), partition 1 is the
  * 				 first partition on the tape (nearest
  * 				 BOT), and partition 0 is the remainder of
- * 				 the tape. 
+ * 				 the tape.
  * #define MTMKPART	34	 create partition (DAT), count is
  * 				 multiplied by 1 Mybte (2^20 bytes) to
  * 				 give the size of partition 1; if 0, then
  * 				 changes tape to a single partition
- * 				 tape. 
- * 
+ * 				 tape.
+ *
  */
 
 #define MTRET		MTRETEN	/* retention operation */
@@ -82,8 +82,8 @@ typedef unsigned int    minor_t;
 				 * now). Remains set until same ioctl is
 				 * reused, or until reboot. */
 
-/* MTSPECOP - special drive specific operations.  
- * These use the mtop structure. 
+/* MTSPECOP - special drive specific operations.
+ * These use the mtop structure.
  * MTSPECOP subcodes start at 0x6000.
  */
 #define MTSCSI_CIPHER_SEC_ON	0x6001	/* enable reporting of recovered
@@ -137,7 +137,7 @@ struct	mtget_sgi	{
 	/* the following two registers are device dependent */
 	unsigned short	mt_dsreg;	/* ``drive status'' register */
 	short	mt_erreg;		/* ``error'' register */
-	short	mt_resid;		/* residual count; for SCSI, this is 
+	short	mt_resid;		/* residual count; for SCSI, this is
 					 * used to report the current partition
 					 * # for DAT tapes that are partitioned
 					 */
@@ -242,7 +242,7 @@ struct	mtvid {
 	A value of 0 indicates no limit
 	When using the variable block size device, the lastread
 	field is determined by reading one block and then spacing
-	backwards, if no i/o has yet been done to this tape.  Unlike 
+	backwards, if no i/o has yet been done to this tape.  Unlike
 	MTIOCGETBLKSIZE, all quantities are in bytes.
 */
 struct mtblkinfo {
@@ -283,13 +283,13 @@ typedef	struct	irix5_mtscsi_rdlog {
 	unsigned short	mtlen;		/* Size of buffer receiving log	*/
 	app32_ptr_t	mtarg;		/* Buffer pointer		*/
 } irix5_mtscsi_rdlog_t;
-#endif /* _KERNEL */	
+#endif /* _KERNEL */
 
 
 
 /* structure and defines for MT[GS]ETAUDIO.
  * When using SETAUDIO to locate to a particular point, the type
- * should be set to one of the MTAUDPOSN_* values, 
+ * should be set to one of the MTAUDPOSN_* values,
  * and only the corresponding fields need be filled in.  See the DAT
  * audio spec for more detail on the definitions of the different times.
  * There are 34 frames per second, legal values are 0 through 33.  The
@@ -354,16 +354,16 @@ struct mt_capablity  {
         are also used in tpsc.h */
 
 /* The expected relative behaviour of MT_EW, MT_EOT and MTANSI can be
-   described as follows. 
+   described as follows.
    - writing from BOT, with MTANSI disabled, when LEOT is encountered,
      MT_EW and MT_EOT are set. If MTANSI is now enabled, MT_EOT will be
      reset and writing will be permitted until PEOT is encountered,
      whereupon MT_EOT will again be set and will remain so until the
      tape is repositioned.
    - reading from BOT, MT_EOT will be set when PEOT is
-     encountered. LEOT is not normally reported by the drive, and therefore 
-     MT_EW will normally not be set, unless the drive supports the REW mode 
-     bit. (few do) 
+     encountered. LEOT is not normally reported by the drive, and therefore
+     MT_EW will normally not be set, unless the drive supports the REW mode
+     bit. (few do)
 */
 
 #define MT_EOT		0x01	/* tape is at end of media */
@@ -621,8 +621,8 @@ struct mt_capablity  {
 #define MTCAN_LDREW	0x1000000 /* Issue Rewind instead of Load command. Used
 				   * in conjunction with MTCANT_LOAD. */
 
-/* 
- * Definitions for MTGETATTR 
+/*
+ * Definitions for MTGETATTR
  */
 
 /* Definition of MTGETATTR return struct */
@@ -663,7 +663,7 @@ struct mt_fpmsg {
 			char   display_type;	/* Display Type: Set to 0x80 */
 			char   msg_type:3,      /* Message type: 0x00 = General
 						 * Status message */
-		               msg_cntrl:3,     /* Message control: 
+		               msg_cntrl:3,     /* Message control:
 						   0 = Display message 0
 						   1 = Display message 1
 						   2 = Flash message 0
@@ -677,7 +677,7 @@ struct mt_fpmsg {
 			char   msg2[8];	        /* message 2 */
 		} ibm3590;
 		struct {		/* Format for Fujitsu Diana 1,2,3 */
-			char   display_mode:3, 
+			char   display_mode:3,
 		               display_len:1,
 		               flash:1,
 		               half_msg:1,
@@ -706,7 +706,7 @@ struct mt_fpmsg {
 #define diana_msg2		u.diana.msg2
 
 /* Definition of MTGETPOS/MTSETPOS structure */
-#define MAX_VEND_POS_SIZE	256	/* Maximum vendor specific position 
+#define MAX_VEND_POS_SIZE	256	/* Maximum vendor specific position
 					 * data size. */
 struct	vendor_specific_pos
 {
diff --git a/common/types.h b/common/types.h
index 424b47a..50c841e 100644
--- a/common/types.h
+++ b/common/types.h
@@ -149,7 +149,7 @@ typedef struct stat64 stat64_t;
 typedef struct getbmapx getbmapx_t;
 typedef struct fsdmidata fsdmidata_t;
 
-/* flg definitions for preemptchk 
+/* flg definitions for preemptchk
  */
 #define PREEMPT_FULL		0
 #define PREEMPT_PROGRESSONLY	1
diff --git a/common/util.c b/common/util.c
index bbca758..70b17eb 100644
--- a/common/util.c
+++ b/common/util.c
@@ -73,7 +73,7 @@ write_buf( char *bufp,
 
 int
 read_buf( char *bufp,
-	  size_t bufsz, 
+	  size_t bufsz,
 	  void *contextp,
 	  rfp_t read_funcp,
 	  rrbfp_t return_read_buf_funcp,
@@ -230,7 +230,7 @@ bigstat_iter( jdm_fshandle_t *fshandlep,
 				      "bulkstat seeked to EOS\n");
 				return 0;
 			}
-			
+
 			mlog( MLOG_DEBUG,
 			      "bulkstat seeked to %llu\n", lastino);
 
@@ -397,7 +397,7 @@ diriter( jdm_fshandle_t *fshandlep,
 		assert( cbrval == 0 );
 
 		nread = getdents_wrap( fd, (char *)gdp, gdsz );
-		
+
 		/* negative count indicates something very bad happened;
 		 * try to gracefully end this dir.
 		 */
@@ -511,7 +511,7 @@ diriter( jdm_fshandle_t *fshandlep,
 	}
 }
 
-int 
+int
 cvtnum( int blocksize, char *s )
 {
 	int i;
diff --git a/common/util.h b/common/util.h
index 558bf7e..07fdd36 100644
--- a/common/util.h
+++ b/common/util.h
@@ -60,7 +60,7 @@ typedef char * ( *rfp_t )( void *contextp, size_t wantedsz, size_t *szp, int *st
 typedef void ( * rrbfp_t )( void *contextp, char *bufp, size_t bufsz );
 
 extern int read_buf( char *bufp,
-			  size_t bufsz, 
+			  size_t bufsz,
 			  void *contextp,
 			  rfp_t read_funcp,
 			  rrbfp_t return_read_buf_funcp,
diff --git a/dump/content.c b/dump/content.c
index 6540d7c..ecc867d 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -695,7 +695,7 @@ content_init( int argc,
 				return BOOL_FALSE;
 			}
 			baseuuidstr = optarg;
-			
+
 			if ( uuid_parse( baseuuidstr, baseuuid ) < 0 ) {
 				mlog( MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument not a valid "
@@ -936,7 +936,7 @@ content_init( int argc,
 						      p->dr_end.sp_ino,
 						      p->dr_end.sp_offset );
 					} else {
-						p->dr_end.sp_flags = STARTPT_FLAGS_END;	
+						p->dr_end.sp_flags = STARTPT_FLAGS_END;
 						mlog( MLOG_DEBUG,
 						      "resume range stream %u "
 						      "ino %llu:%lld to "
@@ -1082,7 +1082,7 @@ content_init( int argc,
 					      p->dr_end.sp_ino,
 					      p->dr_end.sp_offset );
 				} else {
-					p->dr_end.sp_flags = STARTPT_FLAGS_END;	
+					p->dr_end.sp_flags = STARTPT_FLAGS_END;
 					mlog( MLOG_DEBUG,
 					      "resume range stream %u "
 					      "ino %llu:%lld to "
@@ -1420,7 +1420,7 @@ baseuuidbypass:
 			       _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
 			         sc_rootxfsstatp->bs_ino, rootstat.st_ino);
 	}
-	
+
 	/* alloc a file system handle, to be used with the jdm_open()
 	 * functions.
 	 */
@@ -1481,7 +1481,7 @@ baseuuidbypass:
 	if ( ! ok ) {
 		return BOOL_FALSE;
 	}
-	
+
 	/* ask var to ask inomap to skip files under var if var is in
 	 * the fs being dumped
 	 */
@@ -1555,7 +1555,7 @@ baseuuidbypass:
 	if (drivecnt > 1) {
 	    mlog( MLOG_VERBOSE, _(
 		  "estimated dump size per stream: %llu bytes\n"),
-		    hdr_mfilesz + (filesz + datasz) / drivecnt); 
+		    hdr_mfilesz + (filesz + datasz) / drivecnt);
 	}
 	mlog( MLOG_DEBUG,
 	      "estimated dump header size: %llu bytes\n",
@@ -2010,7 +2010,7 @@ mark_set( drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags )
 		      ino,
 		      offset );
 	}
-		 
+
 	markp->startpt.sp_ino = ino;
 	markp->startpt.sp_offset = offset;
 	markp->startpt.sp_flags = flags;
@@ -2175,7 +2175,7 @@ content_stream_dump( ix_t strmix )
 	 * in the progress stats
 	 */
 	contextp->cc_stat_lastino = 0;
-	
+
 	/* used to detect generation of an empty media file;
 	 * contains at most an inomap and dirdump and null file hdr.
 	 */
@@ -2895,7 +2895,7 @@ dump_dirs( ix_t strmix,
 					continue;
 				}
 				if ( !p->bs_nlink || !p->bs_mode || !p->bs_ino ) {
-					mlog( MLOG_TRACE, 
+					mlog( MLOG_TRACE,
 					      "failed to get valid bulkstat information for inode %llu\n",
 					      p->bs_ino );
 					continue;
@@ -2904,7 +2904,7 @@ dump_dirs( ix_t strmix,
 			if ( ( p->bs_mode & S_IFMT ) != S_IFDIR ) {
 				continue;
 			}
-                        
+
 			rv = dump_dir( strmix, sc_fshandlep, sc_fsfd, p );
 			if ( rv != RV_OK ) {
 				return rv;
@@ -2998,7 +2998,7 @@ dump_dir( ix_t strmix,
 		      statp->bs_ino );
 		return RV_OK; /* continue anyway */
 	}
-	
+
 	mlog( MLOG_TRACE,
 	      "dumping directory ino %llu\n",
 	      statp->bs_ino );
@@ -3020,7 +3020,7 @@ dump_dir( ix_t strmix,
 		close( fd );
 		return rv;
 	}
-	
+
 	/* dump dirents - lots of buffering done here, to achieve OS-
 	 * independence. if proves to be to much overhead, can streamline.
 	 */
@@ -3030,7 +3030,7 @@ dump_dir( ix_t strmix,
 		register size_t reclen;
 
 		nread = getdents_wrap( fd, (char *)gdp, gdsz );
-		
+
 		/* negative count indicates something very bad happened;
 		 * try to gracefully end this dir.
 		 */
@@ -3112,7 +3112,7 @@ dump_dir( ix_t strmix,
 			if ( inomap_get_gen( NULL, p->d_ino, &gen) ) {
 				xfs_bstat_t statbuf;
 				int scrval;
-				
+
 				scrval = bigstat_one( fsfd,
 						      p->d_ino,
 						      &statbuf );
@@ -3361,7 +3361,7 @@ dump_extattr_list( drive_t *drivep,
 		/* Either the retrieve buffer is full, the dump buffer is full,
 		 * or we just put the last attribute into the dump buffer.  In
 		 * any case, fill in the values for any attributes added so far.
-		 */ 
+		 */
 
 		rtrvcnt = rtrvix;
 		if (rtrvcnt > 0) {
@@ -3735,7 +3735,7 @@ dump_file( void *arg1,
 		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as no links for ino %llu\n", 
+		mlog( MLOG_DEBUG, "skip as no links for ino %llu\n",
 			statp->bs_ino);
 		return RV_OK;
 	}
@@ -3746,7 +3746,7 @@ dump_file( void *arg1,
 		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n", 
+		mlog( MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n",
 			statp->bs_ino);
 		return RV_OK;
 	}
@@ -3760,7 +3760,7 @@ dump_file( void *arg1,
 				if ( statp->bs_ino > contextp->cc_stat_lastino ) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
-				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n", 
+				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
 					statp->bs_ino);
 				return RV_NOMORE;
 			}
@@ -3769,7 +3769,7 @@ dump_file( void *arg1,
 				if ( statp->bs_ino > contextp->cc_stat_lastino ) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
-				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n", 
+				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
 					statp->bs_ino);
 				return RV_NOMORE;
 			}
@@ -3796,9 +3796,9 @@ dump_file( void *arg1,
 		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n", 
+		mlog( MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n",
 			statp->bs_ino);
-		mlog( MLOG_DEBUG, "ino %llu is in state %d\n", 
+		mlog( MLOG_DEBUG, "ino %llu is in state %d\n",
 			statp->bs_ino, state);
 		return RV_OK;
 	}
@@ -3992,7 +3992,7 @@ dump_file_reg( drive_t *drivep,
 		}
 		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
 	}
-		
+
 	/* determine the offset within the file where the dump should end.
 	 * only significant if this is an inode spanning a startpoint.
 	 */
@@ -4303,7 +4303,7 @@ init_extent_group_context( jdm_fshandle_t *fshandlep,
 		return RV_ERROR;
 	}
 
-	/* Check if a mandatory lock is set on the file to try and 
+	/* Check if a mandatory lock is set on the file to try and
 	 * avoid blocking indefinitely on the reads later. Note that
 	 * someone could still set a mandatory lock and hose xfsdump
 	 * after this check but before all reads have completed.
@@ -4597,7 +4597,7 @@ dump_extent_group( drive_t *drivep,
 				continue;
 			}
 		}
-		
+
 		/* if the new bmap entry begins beyond the end of the file,
 		 * we are done.
 		 */
@@ -4609,7 +4609,7 @@ dump_extent_group( drive_t *drivep,
 			*cmpltflgp = BOOL_TRUE;
 			return RV_OK;
 		}
-		
+
 		/* if the new bmap entry begins at or above the stop offset,
 		 * stop. we are done.
 		 */
@@ -4621,7 +4621,7 @@ dump_extent_group( drive_t *drivep,
 			*cmpltflgp = BOOL_TRUE;
 			return RV_OK;
 		}
-		
+
 		/* if the new entry begins below the range of
 		 * interest, modify offset to begin at the
 		 * beginning of the range of interest, and shorten
@@ -4640,13 +4640,13 @@ dump_extent_group( drive_t *drivep,
 		assert( extsz > 0 );
 
 		/* if the resultant extent would put us over maxcnt,
-		 * shorten it, and round up to the next BBSIZE (round 
+		 * shorten it, and round up to the next BBSIZE (round
 		 * upto d_miniosz for realtime).
 		 */
 		if ( extsz > maxcnt - ( bytecnt + sizeof( extenthdr_t ))) {
 			int iosz;
 
-			if (isrealtime) 
+			if (isrealtime)
 				iosz = da.d_miniosz;
 			else
 				iosz = BBSIZE;
@@ -4990,7 +4990,7 @@ dump_filehdr( drive_t *drivep,
 			  ( void * )drivep,
 			  ( gwbfp_t )dop->do_get_write_buf,
 			  ( wfp_t )dop->do_write );
-	
+
 	switch ( rval ) {
 	case 0:
 		rv = RV_OK;
@@ -5027,16 +5027,16 @@ dump_extenthdr( drive_t *drivep,
 	char typestr[20];
 
 	switch( type )  {
-		case EXTENTHDR_TYPE_LAST: 
+		case EXTENTHDR_TYPE_LAST:
 			strcpy( typestr, "LAST" );
 			break;
-		case EXTENTHDR_TYPE_ALIGN: 
+		case EXTENTHDR_TYPE_ALIGN:
 			strcpy( typestr, "ALIGN" );
 			break;
-		case EXTENTHDR_TYPE_DATA: 
+		case EXTENTHDR_TYPE_DATA:
 			strcpy( typestr, "DATA" );
 			break;
-		case EXTENTHDR_TYPE_HOLE: 
+		case EXTENTHDR_TYPE_HOLE:
 			strcpy( typestr, "HOLE" );
 			break;
 		default:
@@ -5717,7 +5717,7 @@ position:
 				if ( status == DRIVE_ERROR_DEVICE ) {
 					mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 					      "encountered media error "
-					      "attempting BSF\n") ); 
+					      "attempting BSF\n") );
 					goto changemedia;
 				}
 				if ( mrhdrp->mh_mediafileix == 0 ) {
@@ -5778,7 +5778,7 @@ position:
 
 				goto write;
 			}
-			
+
 		case DRIVE_ERROR_OVERWRITE:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
@@ -5937,14 +5937,14 @@ erasemedia:
 	virginmediapr = BOOL_UNKNOWN;
 	mediawrittentopr = BOOL_FALSE;
 	goto position;
-	
+
 changemedia:
 	/* if the drive does not support media change, quit.
 	 */
 	if ( ! ( dcaps & DRIVE_CAP_REMOVABLE )) {
 		return RV_ERROR;
 	}
-	
+
 	/* first eject the current media object if capability supported
 	 */
 	assert( mediapresentpr != BOOL_UNKNOWN );
@@ -5963,10 +5963,10 @@ changemedia:
 		return RV_QUIT; /* this return value will cause approp. msg */
 	}
 
-	/* If an alert program has been specified , run it 
+	/* If an alert program has been specified , run it
 	 */
 	if (media_change_alert_program != NULL)
-	   system(media_change_alert_program);  
+	   system(media_change_alert_program);
 
 	/* if media change prompt declined or times out,
 	 * we are done
@@ -6121,9 +6121,9 @@ write:
 					     sizeof( mwhdrp->mh_medialabel ));
 		}
 	}
-	
+
 	mediawrittentopr = BOOL_TRUE;
-	
+
 	/* write hdr is prepared. place it on media
 	 */
 	if ( intr_allowed && cldmgr_stop_requested( )) {
@@ -6614,7 +6614,7 @@ save_quotas( char *mntpnt, quota_info_t *quotainfo )
                 return BOOL_FALSE;
             }
         }
- 
+
         sprintf( buf,
 		 "%s -x -c 'dump %s %s' %s 2> /dev/null",
 		 REPQUOTA,
diff --git a/dump/inomap.c b/dump/inomap.c
index 1dacf35..238fcaf 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -354,7 +354,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
 			     bstatbufp,
 			     bstatbuflen );
 	*inomap_statphasep = 0;
-	
+
 	if ( rval ) {
 		cb_context_free();
 		free( ( void * )bstatbufp );
@@ -704,7 +704,7 @@ supprt_prune( void *arg1,	/* ancestors marked as changed? */
 		if ( state != MAP_DIR_CHANGE &&
                      state != MAP_DIR_NOCHNG &&
 		     state != MAP_DIR_SUPPRT) {
-			/* 
+			/*
 			 * if file is now a dir then it has
 			 * certainly changed.
 			 */
@@ -752,7 +752,7 @@ supprt_prune( void *arg1,	/* ancestors marked as changed? */
 	state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
 	if ( state != MAP_NDR_CHANGE &&
 	     state != MAP_NDR_NOCHNG ) {
-		/* 
+		/*
 		 * if dir is now a file then it has
 		 * certainly changed.
 		 */
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 46fdde8..eee128e 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -54,13 +54,13 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 	invt_sescounter_t *sescnt = 0;
 
 	int index = 0;
-	
+
 	assert ( pred );
 	fd = retval = init_idb ( pred, bywhat, forwhat, &tok );
 
-	if ( retval == I_DONE ) 
+	if ( retval == I_DONE )
 		return tok;
-	
+
 	/* if we just want to search the db, all we need is the invidx.
 	   at this point, we know that a tok wasnt created in init_idb() */
 	if ( forwhat == INV_SEARCH_ONLY ) {
@@ -83,7 +83,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 
 	/* Now we need to make sure that this has enough space */
 	INVLOCK( stobjfd, LOCK_SH );
-	
+
 	num = GET_SESCOUNTERS( stobjfd, &sescnt );
 	if ( num < 0 ) {
 		close( fd );
@@ -92,7 +92,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 		return INV_TOKEN_NULL;
 	}
 
-	/* create another storage object ( and, an inv_index entry for it 
+	/* create another storage object ( and, an inv_index entry for it
 	   too ) if we've filled this one up */
 
 	if ( (uint) num >= sescnt->ic_maxnum ) {
@@ -105,14 +105,14 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 		stobjfd = idx_create_entry( &tok, fd, BOOL_FALSE );
 		INVLOCK( fd, LOCK_UN );
 
-		free ( sescnt );		
+		free ( sescnt );
 		if ( stobjfd < 0 ) {
 			close( fd );
 			return INV_TOKEN_NULL;
 		}
 		return tok;
 	}
-	
+
 	INVLOCK( stobjfd, LOCK_UN );
 
 	free ( sescnt );
@@ -120,7 +120,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 	tok->d_invindex_off = IDX_HDR_OFFSET( index - 1 );
 	tok->d_oflag = forwhat;
 	return tok;
-	
+
 }
 
 
@@ -137,7 +137,7 @@ bool_t
 inv_close( inv_idbtoken_t tok )
 {
 	close ( tok->d_invindex_fd );
-	if ( tok->d_stobj_fd >= 0 ) 
+	if ( tok->d_stobj_fd >= 0 )
 		close ( tok->d_stobj_fd );
 	destroy_token( tok );
 	return BOOL_TRUE;
@@ -156,7 +156,7 @@ inv_close( inv_idbtoken_t tok )
 /*----------------------------------------------------------------------*/
 
 inv_sestoken_t
-inv_writesession_open( 
+inv_writesession_open(
 	inv_idbtoken_t tok, 	/* token obtained by inventory_open() */
 	uuid_t		*fsid,
 	uuid_t		*sesid,
@@ -198,21 +198,21 @@ inv_writesession_open(
 	memset( (void *)&ses, 0, sizeof( ses ) );	/* paranoia */
 	memcpy( &ses.s_sesid, sesid, sizeof( uuid_t ) );
 	memcpy( &ses.s_fsid, fsid, sizeof( uuid_t ) );
-	strcpy( ses.s_label, label );	
-	strcpy( ses.s_mountpt, mntpt );	
-	strcpy( ses.s_devpath, devpath );	
+	strcpy( ses.s_label, label );
+	strcpy( ses.s_mountpt, mntpt );
+	strcpy( ses.s_devpath, devpath );
 	ses.s_max_nstreams = nstreams;
 
         hdr.sh_pruned = 0; /* session is not pruned by invutil */
 	hdr.sh_time = time;
-	hdr.sh_level = level;	
+	hdr.sh_level = level;
 	hdr.sh_flag = (ispartial) ? INVT_PARTIAL: 0;
 	hdr.sh_flag |= (isresumed) ? INVT_RESUMED : 0;
 	/* sh_streams_off and sh_sess_off will be set in create_session() */
-	
+
 	sestok = get_sesstoken( tok );
 
-	/* we need to put the new session in the appropriate place in 
+	/* we need to put the new session in the appropriate place in
 	   storage object. So first find out howmany sessions are there */
 
 	INVLOCK( fd, LOCK_EX );
@@ -222,14 +222,14 @@ inv_writesession_open(
 		return INV_TOKEN_NULL;
 	}
 
-	/* create the writesession, and get ready for the streams to come 
+	/* create the writesession, and get ready for the streams to come
 	   afterwards */
 	rval = stobj_create_session( sestok, fd, sescnt, &ses, &hdr );
 	assert (rval > 0);
 
 
 	INVLOCK( fd, LOCK_UN );
- 
+
 	sestok->sd_sesstime = time;
 
 	if ( tok->d_update_flag & NEW_INVINDEX ) {
@@ -262,7 +262,7 @@ bool_t
 inv_writesession_close( inv_sestoken_t tok )
 {
 	int		rval;
-	
+
 	assert ( tok != INV_TOKEN_NULL );
 
 	/* now update end_time in the inv index header */
@@ -295,7 +295,7 @@ inv_stream_open(
 	bool_t err = BOOL_FALSE;
 
 	assert ( tok != INV_TOKEN_NULL );
-	 
+
 	/* this memset is needed as a dump interrupted/crashed very soon
 	 * after starting results in an inventory with exteremely large
 	 * starting/ending inodes or offsets. This can be misleading.
@@ -309,29 +309,29 @@ inv_stream_open(
 
 	/* XXX yukk... make the token descriptors not pointers */
 	stok = ( inv_stmtoken_t ) malloc( sizeof( invt_strdesc_entry_t ) );
-	
+
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
-	
+
 	/* get the session to find out where the stream is going to go */
-	fd = tok->sd_invtok->d_stobj_fd; 
+	fd = tok->sd_invtok->d_stobj_fd;
 
 	INVLOCK( fd, LOCK_EX );
 
 	/* get the session header and the session */
-	if ( stobj_get_sessinfo( tok, &seshdr, &ses ) <= 0 ) 
+	if ( stobj_get_sessinfo( tok, &seshdr, &ses ) <= 0 )
 		err = BOOL_TRUE;
 
 	if ( ( ! err )  && ses.s_cur_nstreams < ses.s_max_nstreams ) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) * 
+		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) *
 					         ses.s_cur_nstreams )
 			                         + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
-				
+
 		/* write it back. */
-		if ( PUT_REC_NOLOCK( fd, &ses, sizeof( ses ), 
-				     tok->sd_session_off ) < 0 ) 
+		if ( PUT_REC_NOLOCK( fd, &ses, sizeof( ses ),
+				     tok->sd_session_off ) < 0 )
 			err = BOOL_TRUE;
 	} else if ( ! err ) {
 		mlog ( MLOG_NORMAL, _(
@@ -340,10 +340,10 @@ inv_stream_open(
 		err = BOOL_TRUE;
 	}
 
-	if ( ! err ) { 
-		stream.st_firstmfile = stream.st_lastmfile = 
+	if ( ! err ) {
+		stream.st_firstmfile = stream.st_lastmfile =
 			               stok->md_stream_off;
-	
+
 		/* now write the stream header on to the disk */
 		if ( PUT_REC_NOLOCK( fd, &stream, sizeof( invt_stream_t ),
 				    stok->md_stream_off ) > 0 ) {
@@ -357,7 +357,7 @@ inv_stream_open(
 	free ( stok );
 	INVLOCK( fd, LOCK_UN );
 	return INV_TOKEN_NULL;
-	
+
 }
 
 
@@ -378,25 +378,25 @@ inv_stream_close(
 	int fd = tok->md_sesstok->sd_invtok->d_stobj_fd;
 	int rval;
 	bool_t dowrite = BOOL_FALSE;
-	
+
 	rval = idx_put_sesstime( tok->md_sesstok, INVT_ENDTIME );
 	if (rval < 0)
 		mlog( MLOG_NORMAL | MLOG_INV, _(
 		      "INV: idx_put_sesstime failed in "
 		      "inv_stream_close() \n") );
 	INVLOCK( fd, LOCK_EX );
-	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ), 
+	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ),
 			       tok->md_stream_off )) > 0 ) {
-	
+
 		if ( strm.st_interrupted != wasinterrupted ) {
 			strm.st_interrupted = wasinterrupted;
 			dowrite = BOOL_TRUE;
 		}
 
-		/* get the last media file to figure out what our last 
+		/* get the last media file to figure out what our last
 		   ino was. we have a pointer to that in the stream token */
 		if ( tok->md_lastmfile ){
-			if ( strm.st_endino.ino != 
+			if ( strm.st_endino.ino !=
 			      tok->md_lastmfile->mf_endino.ino ||
 			     strm.st_endino.offset !=
 			      tok->md_lastmfile->mf_endino.offset) {
@@ -407,7 +407,7 @@ inv_stream_close(
 			      strm.st_endino = tok->md_lastmfile->mf_endino;
 			}
 		}
-			
+
 		if (dowrite) {
 			rval = PUT_REC_NOLOCK(fd, &strm, sizeof(invt_stream_t),
 					      tok->md_stream_off);
@@ -424,7 +424,7 @@ inv_stream_close(
 
 	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
 }
- 
+
 
 
 
@@ -435,9 +435,9 @@ inv_stream_close(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_put_mediafile( 
-	inv_stmtoken_t 	tok, 
-	uuid_t 		*moid, 
+inv_put_mediafile(
+	inv_stmtoken_t 	tok,
+	uuid_t 		*moid,
 	char 		*label,
 	uint		mfileindex,
 	xfs_ino_t	startino,
@@ -457,10 +457,10 @@ inv_put_mediafile(
 	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
 
 	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
-	
+
 	/* copy the media file information */
 	memcpy( &mf->mf_moid, moid, sizeof( uuid_t ) );
-	strcpy( mf->mf_label, label );	
+	strcpy( mf->mf_label, label );
 	mf->mf_mfileidx = mfileindex;
 	mf->mf_startino.ino = startino;
 	mf->mf_startino.offset = startino_offset;
@@ -468,7 +468,7 @@ inv_put_mediafile(
 	mf->mf_endino.offset = endino_offset;
 	mf->mf_size = size;
 	mf->mf_flag = 0;
-	if ( isgood ) 
+	if ( isgood )
 		mf->mf_flag |= INVT_MFILE_GOOD;
 
 	/* This flag is used to indicate the media file that contains the
@@ -476,7 +476,7 @@ inv_put_mediafile(
 	   media file */
 	if ( isinvdump )
 		mf->mf_flag |= INVT_MFILE_INVDUMP;
-	
+
 	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX );
 	rval = stobj_put_mediafile( tok, mf );
 	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN );
@@ -490,7 +490,7 @@ inv_put_mediafile(
 
 }
 
- 
+
 
 
 
@@ -558,13 +558,13 @@ bool_t
 inv_put_sessioninfo( invt_sessinfo_t *s )
 {
 	static bool_t invdir_ok = BOOL_FALSE;
-	
+
 	if ( !invdir_ok ) {
 		if ( make_invdirectory( INV_SEARCH_N_MOD ) < 0 )
 			return BOOL_FALSE;
 		else
 			invdir_ok = BOOL_TRUE;
-	} 
+	}
 
       	return insert_session( s );
 
@@ -572,10 +572,10 @@ inv_put_sessioninfo( invt_sessinfo_t *s )
 
 
 
-		   
+
 /*----------------------------------------------------------------------*/
 /* inv_free_session							*/
-/* 									*/ 
+/* 									*/
 /* free the inv_session structure allocated as a result of calls to     */
 /* inv_get_session_byuuid, etc.						*/
 /*----------------------------------------------------------------------*/
@@ -584,7 +584,7 @@ inv_free_session(
 	inv_session_t **ses)
 {
 	uint i;
-	
+
 	assert(ses);
 	assert(*ses);
 
@@ -592,10 +592,10 @@ inv_free_session(
 		/* the array of mediafiles is contiguous */
 		free ((*ses)->s_streams[i].st_mediafiles);
 	}
-	
+
 	/* all streams are contiguous too */
 	free ((*ses)->s_streams);
-      
+
 	free (*ses);
 	*ses = NULL;
 }
@@ -612,7 +612,7 @@ inv_free_session(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_lasttime_level_lessthan( 
+inv_lasttime_level_lessthan(
 	uuid_t		*fsidp,
 	inv_idbtoken_t	tok,
 	u_char		level,
@@ -626,7 +626,7 @@ inv_lasttime_level_lessthan(
 
 		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
-	
+
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid ptr */
 					 (void *)&level, /* in */
 					 (void **)tm,	 /* out */
@@ -645,7 +645,7 @@ inv_lasttime_level_lessthan(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_lastsession_level_lessthan( 
+inv_lastsession_level_lessthan(
 	uuid_t		*fsidp,
 	inv_idbtoken_t	tok,
 	u_char		level,
@@ -680,7 +680,7 @@ inv_lastsession_level_lessthan(
 
 
 bool_t
-inv_lastsession_level_equalto( 
+inv_lastsession_level_equalto(
 	uuid_t		*fsidp,
 	inv_idbtoken_t	tok,
 	u_char		level,
@@ -694,7 +694,7 @@ inv_lastsession_level_equalto(
 
 		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
-	
+
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid */
 					 (void *)&level, /* in */
 					 (void **)ses,	 /* out */
@@ -775,12 +775,12 @@ inv_delete_mediaobj( uuid_t *moid )
 			        if ( --s.nstreams == 0 )
 			            delete-session (s)
 			     }
-			 } 
+			 }
 		      }
 		 }
 	      }
 	*/
-	
+
 	invt_counter_t *cnt;
 	invt_fstab_t *arr;
 	int numfs, i, fd, invfd;
@@ -791,12 +791,12 @@ inv_delete_mediaobj( uuid_t *moid )
 		mlog( MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n") );
 		return BOOL_FALSE;
 	}
-	
+
 	close( fd );
 
 	for ( i = 0; i < numfs; i++) {
-		if ( fstab_get_fname( &arr[i].ft_uuid, 
-				      fname, 
+		if ( fstab_get_fname( &arr[i].ft_uuid,
+				      fname,
 				      (inv_predicate_t)INV_BY_UUID,
 				      forwhat
 				     )
@@ -809,7 +809,7 @@ inv_delete_mediaobj( uuid_t *moid )
 		invfd = open( fname, INV_OFLAG(forwhat));
 		if ( invfd < 0 ) {
 			mlog( MLOG_NORMAL | MLOG_INV, _(
-			     "INV: Open failed on %s\n"), 
+			     "INV: Open failed on %s\n"),
 			     fname );
 			return BOOL_FALSE;
 		}
@@ -819,9 +819,9 @@ inv_delete_mediaobj( uuid_t *moid )
 		    < 0 )
 			return BOOL_FALSE;
 		/* we have to delete the session, etc */
-		close( invfd );	
+		close( invfd );
 	}
-	
+
 	return BOOL_TRUE;
 }
 
@@ -832,24 +832,24 @@ inv_delete_mediaobj( uuid_t *moid )
 #define I_IERR		0x04
 
 
-static const char *myopts[] = { 
+static const char *myopts[] = {
 #define OPT_MNT		0
-	"mnt", 
+	"mnt",
 
 #define OPT_FSID	1
-	"fsid", 
+	"fsid",
 
 #define OPT_DEV		2
-	"dev", 
+	"dev",
 
 #define OPT_DEPTH	3
-	"depth", 
+	"depth",
 
 #define OPT_MOBJID	4
 	"mobjid",
 
 #define OPT_MOBJLABEL	5
-	"mobjlabel", 
+	"mobjlabel",
 
 #define OPT_FSTAB	6
 	"fstab",
@@ -868,14 +868,14 @@ static const char *myopts[] = {
 
 
 int
-inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx) 
+inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 {
 	int rval = 0;
 	void *fs = 0;
 	char *options, *value;
 	extern char *optarg;
 	extern int optind, opterr;
-	
+
 	inv_predicate_t bywhat = -1;
 	int c, d;
 	uuid_t fsid;
@@ -883,13 +883,13 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 	int npreds2 = 0;
 	char invoptstring[128], *rptr, *wptr;
 	optind = 1;
-	opterr = 0;     
-	
-	/* 
+	opterr = 0;
+
+	/*
 	 * getopt doesn't handle both '-I' and '-I w/subopts' so...
-	 * First set I_IFOUND if -I is set at all (with or without 
+	 * First set I_IFOUND if -I is set at all (with or without
 	 * any suboptions).  Do this by taking out the ':' so getopt
-	 * accepts it.  Later, reset opts and go through again to 
+	 * accepts it.  Later, reset opts and go through again to
 	 * pick off any subopts.
 	 */
 	strcpy(invoptstring, GETOPT_CMDSTRING);
@@ -916,7 +916,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		switch ( c ) {
 		case GETOPT_INVPRINT:
 			rval |= I_IFOUND ;
-			if ((options = optarg) == NULL) 
+			if ((options = optarg) == NULL)
 				break;
 
 			while (*options != '\0') {
@@ -926,34 +926,34 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 					continue;
 				switch( d ) {
 					/* process mntpt option */
-				      case OPT_MNT: 
+				      case OPT_MNT:
 					bywhat = (inv_predicate_t) INV_BY_MOUNTPT;
 					fs = value;
 					npreds++;
 					break;
-					
+
 					/* process fsid option */
-				      case OPT_FSID: 
+				      case OPT_FSID:
 					bywhat = (inv_predicate_t) INV_BY_UUID;
 					npreds++;
-					
+
 					uuid_parse(value, fsid);
 					fs = fsid;
 					break;
 
 				      case OPT_DEV: /* process dev option */
 					bywhat = (inv_predicate_t) INV_BY_DEVPATH;
-					fs = value;   
+					fs = value;
 					npreds++;
 					break;
 
 				      case OPT_DEPTH:
-					prctx->depth = atoi(value);   
-					if (prctx->depth < 0 || 
+					prctx->depth = atoi(value);
+					if (prctx->depth < 0 ||
 					    prctx->depth > 4 )
 						prctx->depth = 0;
 					break;
-					
+
 				      case OPT_MOBJID:
 					{
 					uuid_t *u;
@@ -970,7 +970,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 					prctx->mobj.value = (void *)value;
 					npreds2++;
 					break;
-						
+
 				      case OPT_FSTAB:
 					prctx->fstab = BOOL_TRUE;
 					break;
@@ -1004,7 +1004,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		}
 
 	}
-	
+
 	if (npreds > 1) {
 		mlog( MLOG_NORMAL | MLOG_INV, _(
 		     "INV: Only one of mnt=,dev= and fsid=value can be used.\n")
@@ -1017,14 +1017,14 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		     );
 		rval |= I_IERR;
 	}
-	else if ( (rval & I_IFOUND) && !(rval & I_IERR) && fs 
+	else if ( (rval & I_IFOUND) && !(rval & I_IERR) && fs
 		 && ! prctx->fstab && ! prctx->invcheck) {
 		inv_idbtoken_t tok;
 
 		/* A filesystem could be backed up, mkfs'ed then restored
 		 * to a new UUID value.  Therefore, we can't simply stop
 		 * when we find the first matching mount point (pv564234).
-		 * This code loops through all filesystems and does the 
+		 * This code loops through all filesystems and does the
 		 * comparison by hand. */
 		if (bywhat == INV_BY_MOUNTPT) {
 			int fd, numfs, i;
@@ -1039,7 +1039,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 
 			if ( fd >= 0 ) {
 				for ( i = 0; i < numfs; i++ ) {
-					tok = inv_open( 
+					tok = inv_open(
 						(inv_predicate_t )INV_BY_UUID,
 						INV_SEARCH_ONLY,
 						&arr[i].ft_uuid );
@@ -1047,7 +1047,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 						break;
 					if ( STREQL( arr[i].ft_mountpt, fs) ) {
 						prctx->index = i;
-						invmgr_inv_print( 
+						invmgr_inv_print(
 						          tok->d_invindex_fd,
 							  prctx );
 						rval &= ~(I_IERR);
@@ -1069,7 +1069,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		tok = inv_open( bywhat, INV_SEARCH_ONLY, fs);
 		if ( tok != INV_TOKEN_NULL ) {
 			prctx->index = 0;
-			invmgr_inv_print(tok->d_invindex_fd, prctx);	
+			invmgr_inv_print(tok->d_invindex_fd, prctx);
 			inv_close( tok );
 			rval |= I_IDONE;
 		} else {
@@ -1085,7 +1085,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 
 /* This prints out all the sessions of a filesystem that are in the inventory */
 bool_t
-inv_DEBUG_print( int argc, char **argv ) 
+inv_DEBUG_print( int argc, char **argv )
 {
 	invt_counter_t *cnt = NULL;
 	invt_fstab_t *arr = NULL;
@@ -1118,7 +1118,7 @@ inv_DEBUG_print( int argc, char **argv )
 			 if (! prctx.invidx)
 				 return BOOL_FALSE;
 		 }
-		
+
 		for ( i = 0; i < numfs; i++ ) {
 			tok = inv_open( ( inv_predicate_t )INV_BY_UUID,
 					forwhat,
@@ -1137,7 +1137,7 @@ inv_DEBUG_print( int argc, char **argv )
 			}
 			else {
 				prctx.index = i;
-				invmgr_inv_print( tok->d_invindex_fd, 
+				invmgr_inv_print( tok->d_invindex_fd,
 						 &prctx );
 			}
 			inv_close( tok );
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 5ef519c..f9866a5 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -60,7 +60,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 		*cntpp = NULL;
 		return -1;
 	}
-	
+
 	num = ((invt_counter_t *)(*cntpp))->ic_curnum;
 
 	if ( ( (invt_counter_t *)(*cntpp))->ic_vernum != INV_VERSION ) {
@@ -70,7 +70,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 		      (int) INV_VERSION );
 		assert ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
 			INV_VERSION );
-	} 
+	}
 
 	return (int) num;
 }
@@ -100,7 +100,7 @@ get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
 		*hdrs = NULL;
 		return -1;
 	}
-	
+
 	return 1;
 }
 
@@ -111,14 +111,14 @@ get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
 /*----------------------------------------------------------------------*/
 
 int
-get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, 
+get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
 		bool_t dolock )
 {
 	int  nread;
-	
+
 	assert ( fd >= 0 );
-	
-	if ( dolock ) 
+
+	if ( dolock )
 		INVLOCK( fd, LOCK_SH );
 
 	nread = pread(fd, buf, bufsz, (off_t)off);
@@ -129,7 +129,7 @@ get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
 		return -1;
 	}
 
-	if ( dolock ) 
+	if ( dolock )
 		INVLOCK( fd, LOCK_UN );
 
 	return nread;
@@ -148,10 +148,10 @@ int
 put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock )
 {
 	int nwritten;
-	
+
 	if ( dolock )
 		INVLOCK( fd, LOCK_EX );
-	
+
 	nwritten = pwrite(fd, buf, bufsz, (off_t)off);
 	if (nwritten != (int) bufsz ) {
 		INV_PERROR( _("Error in writing inventory record :") );
@@ -179,8 +179,8 @@ put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock )
 int
 get_headerinfo( int fd, void **hdrs, void **cnt,
 	        size_t hdrsz, size_t cntsz, bool_t dolock )
-{	
-	int num; 
+{
+	int num;
 
 	/* get a lock on the table for reading */
 	if ( dolock ) INVLOCK( fd, LOCK_SH );
@@ -207,17 +207,17 @@ get_headerinfo( int fd, void **hdrs, void **cnt,
 
 int
 get_lastheader( int fd, void **ent, size_t hdrsz, size_t cntsz )
-{	
+{
 	int	     	 nindices;
 	void	 	 *arr = NULL;
 	invt_counter_t	 *cnt = NULL;
 	char 		 *pos;
 	/* get the entries in the inv_index */
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( fd, &arr, (void **)&cnt, 
+	if ( ( nindices = GET_ALLHDRS_N_CNTS( fd, &arr, (void **)&cnt,
 					 hdrsz, cntsz )) <= 0 ) {
 		return -1;
 	}
-	
+
 	/* if there's space anywhere at all, then it must be in the last
 	   entry */
 	*ent = malloc( hdrsz );
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 56d6b8f..5f7e734 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -55,28 +55,28 @@ fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 	int fd;
 
 	fd = open ( INV_FSTAB, INV_OFLAG(forwhat) );
-	
-	if ( fd < 0 ) 
+
+	if ( fd < 0 )
 		return -1; /* if ENOENT, fstab_put_entry will CREAT */
-	
+
 	INVLOCK( fd, LOCK_EX );
-	if (( *numfs = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void**) arr, 
-						 (void **)cnt, 	
-						 sizeof( invt_fstab_t ), 
+	if (( *numfs = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void**) arr,
+						 (void **)cnt,
+						 sizeof( invt_fstab_t ),
 						 sizeof( invt_counter_t ) )
 	     ) < 0 ) {
 		mlog( MLOG_NORMAL | MLOG_INV, _(
 			"INV: couldn't get fstab headers\n") );
 	}
-#ifdef INVT_DEBUG	
-	mlog( MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n", 
+#ifdef INVT_DEBUG
+	mlog( MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n",
 	      *numfs );
 #endif
 	/* fstab is left locked EX on exit. The caller takes does
 	   the unlocking */
 	return fd;
 }
-		
+
 
 /*----------------------------------------------------------------------*/
 /*                                                                      */
@@ -108,10 +108,10 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 			INV_PERROR ( INV_FSTAB );
 			return -1;
 		}
-		
+
 		INVLOCK( fd, LOCK_EX );
 		fchmod( fd, INV_PERMS );
-		
+
 		cnt = (invt_counter_t *) malloc( sizeof ( invt_counter_t ) );
 
 		cnt->ic_maxnum = -1;
@@ -119,18 +119,18 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 		cnt->ic_vernum = INV_VERSION;
 
 	} else if ( numfs > 0 ) {
-		
+
 		for (i = 0; i < numfs; i++) {
 		    if ( uuid_compare( *fsidp, arr[ i ].ft_uuid ) == 0 ) {
-			
+
 /*			if ( ( STREQL( arr[i].ft_mountpt, mntpt ) ) &&
-			    ( STREQL( arr[i].ft_devpath, dev ) ) ) 
+			    ( STREQL( arr[i].ft_devpath, dev ) ) )
 */
 				free ( arr );
 				free ( cnt );
 				close( fd );
 				return 1;
-	     
+
 		}
 	    }
 	    /* entry not found. just follow thru to create a new one */
@@ -146,15 +146,15 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 		memcpy( &ent.ft_uuid, fsidp, sizeof( uuid_t ) );
 		strcpy( ent.ft_mountpt, mntpt );
 		strcpy( ent.ft_devpath, dev );
-		
+
 		/* increase the number of entries first */
 #ifdef INVT_DEBUG
 		mlog( MLOG_NITTY | MLOG_INV,"INV: putting new fstab entry for %s ....\n",
 		      mntpt);
 #endif
 		cnt->ic_curnum++;
-		hoff = (off64_t) ( sizeof( invt_counter_t ) + 
-				 (size_t)( cnt->ic_curnum - 1 ) * 
+		hoff = (off64_t) ( sizeof( invt_counter_t ) +
+				 (size_t)( cnt->ic_curnum - 1 ) *
 				           sizeof( invt_fstab_t ) );
 
 		rval = PUT_COUNTERS( fd, cnt );
@@ -164,7 +164,7 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 
 	}
 	INVLOCK( fd, LOCK_UN );
-	free ( cnt );	
+	free ( cnt );
 	close ( fd );
 	return rval;
 }
@@ -174,8 +174,8 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 
 
 int
-fstab_get_fname( void *pred, 
-		 char *fname, 
+fstab_get_fname( void *pred,
+		 char *fname,
 		 inv_predicate_t bywhat,
 		 inv_oflag_t forwhat)
 {
@@ -205,7 +205,7 @@ fstab_get_fname( void *pred,
 		/* first get hold of the uuid for this mount point/device */
 
 		for (i = 0; i < numfs; i++) {
-			if ( ( bywhat == INV_BY_MOUNTPT && 
+			if ( ( bywhat == INV_BY_MOUNTPT &&
 			     ( STREQL( arr[i].ft_mountpt, pred ) )) ||
 			     ( bywhat == INV_BY_DEVPATH &&
 			     ( STREQL( arr[i].ft_devpath, pred ) )) ) {
@@ -214,16 +214,16 @@ fstab_get_fname( void *pred,
 				break;
 			}
 		}
-#ifdef INVT_DEBUG				
+#ifdef INVT_DEBUG
 		if (! uuidp )
 			mlog( MLOG_DEBUG | MLOG_INV,"INV: get_fname: unable to find %s"
 			      " in the inventory\n", (char *)pred);
 #endif
-		
+
 	} else {
 		uuidp = (uuid_t *)pred;
 	}
-	
+
 	if (! uuidp )
 		return -1;
 
@@ -232,14 +232,14 @@ fstab_get_fname( void *pred,
 	strncpy ( fname, INV_DIRPATH, INV_STRLEN );
 	strcat ( fname, "/" );
 	strcat ( fname, uuidstr);
-	
-	if ( bywhat != INV_BY_UUID ) 
+
+	if ( bywhat != INV_BY_UUID )
 		free ( arr );
 
 	assert( (int) strlen( fname ) < INV_STRLEN );
 	return 1;
-}	
-	
+}
+
 
 void
 fstab_DEBUG_print( invt_fstab_t *arr, int num )
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index cd9b9cb..b33983d 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -53,7 +53,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 /*	invt_entry_t ient;
 	ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = tm; */
-	
+
 	/* If time period of the new entry is before our first invindex,
 	   we have to insert a new invindex in the first slot */
 	if ( iarr[0].ie_timeperiod.tp_start > tm ) {
@@ -72,7 +72,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 			*stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
 			return i;
 		}
-		if ( iarr[i].ie_timeperiod.tp_end == 0  && 
+		if ( iarr[i].ie_timeperiod.tp_end == 0  &&
 		     iarr[i].ie_timeperiod.tp_start  == 0 ) {
 #ifdef INVT_DEBUG
 			mlog( MLOG_DEBUG | MLOG_INV, "INV: end = start \n" );
@@ -80,10 +80,10 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 			     iarr[i].ie_timeperiod.tp_start,
 			     iarr[i].ie_timeperiod.tp_end );
 #endif
-			
-			iarr[i].ie_timeperiod.tp_start = 
+
+			iarr[i].ie_timeperiod.tp_start =
 				iarr[i].ie_timeperiod.tp_end = tm;
-			PUT_REC_NOLOCK( fd, iarr, 
+			PUT_REC_NOLOCK( fd, iarr,
 				       icnt->ic_curnum * sizeof(invt_entry_t),
 				       (off64_t) sizeof( invt_counter_t ) );
 #ifdef INVT_DEBUG
@@ -93,57 +93,57 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 #endif
 			*stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
 			return i;
-		}	
+		}
 
 
 
-		/* if it is beyond the end of this timeperiod, see if we 
+		/* if it is beyond the end of this timeperiod, see if we
 		   belong to a timeperiod that doesn't have an entry */
 		if ( iarr[i].ie_timeperiod.tp_end < tm ) {
 			/* see if we're the last entry here */
 			if ( i == icnt->ic_curnum - 1 ) {
-				/* our slot is (i+1)th entry. Make the 
+				/* our slot is (i+1)th entry. Make the
 				   timeperiod's the same as it was. As far
-				   as I can see there is no way that 
+				   as I can see there is no way that
 				   timeperiods can overlap.
-				
-				   insert the new entry and write back 
+
+				   insert the new entry and write back
 				   icnt and invindex entry */
-				/* *stobjfd = idx_put_newentry( fd, i+1, iarr, 
+				/* *stobjfd = idx_put_newentry( fd, i+1, iarr,
 							     icnt, &ient );*/
 			      *stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
 			      return i;
 			}
 			/* see if the next entry starts later than us */
 			if ( iarr[i+1].ie_timeperiod.tp_start > tm ) {
-				
-				
+
+
 				/* We have the option of pushing entries
-				   after (i) forward by one slot, and 
+				   after (i) forward by one slot, and
 				   taking the (i+1)th slot, OR just hooking
-				   up with the next entry. 
+				   up with the next entry.
 				   We choose the former. */
-				
+
 				/* the timeperiods had better not overlap */
 				assert(( tm > iarr[i].ie_timeperiod.tp_end ) &&
 				       ( tm < iarr[i+1].ie_timeperiod.tp_start ));
 
-				/* shift everything from (i+1) onwards by 
+				/* shift everything from (i+1) onwards by
 				   one. Then insert the new entry and write
 				   back icnt and invindex entries */
-				/* *stobjfd = idx_put_newentry( fd, i+1, iarr, 
+				/* *stobjfd = idx_put_newentry( fd, i+1, iarr,
 							     icnt, &ient );*/
 			      *stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
 				return i;
 			}
-		}	
-	}		
+		}
+	}
 
 	/* We couldnt find anything that fits */
 	assert( 0 );	/* We can't get here ! */
 	return -1;
 
-	
+
 }
 
 
@@ -154,13 +154,13 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 /*----------------------------------------------------------------------*/
 
 int
-idx_put_newentry( 
-	invt_idxinfo_t *idx, 
+idx_put_newentry(
+	invt_idxinfo_t *idx,
 	invt_entry_t *ient )
 {
 	invt_entry_t	*idxarr;
 	int stobjfd;
-	
+
 	int fd = idx->invfd; 	/* kept locked EX by caller */
 	uint index = idx->index + 1;
 	invt_entry_t *iarr = idx->iarr;
@@ -172,25 +172,25 @@ idx_put_newentry(
 
 	icnt->ic_curnum++; /* there is no maximum */
 
-	idxarr = ( invt_entry_t * ) calloc ( icnt->ic_curnum, 
+	idxarr = ( invt_entry_t * ) calloc ( icnt->ic_curnum,
 					     sizeof( invt_entry_t ) );
 	memcpy( idxarr, iarr, ( size_t ) ( sizeof( invt_entry_t ) * index ) );
 
 	/* shift everything from (i+1) onwards by one */
-	if ( index <  icnt->ic_curnum - 1 ) 
-		memcpy( &idxarr[ index + 1 ], &iarr[ index ], 
+	if ( index <  icnt->ic_curnum - 1 )
+		memcpy( &idxarr[ index + 1 ], &iarr[ index ],
 		       ( size_t ) ( ( icnt->ic_curnum - index - 1 ) *
 				    sizeof( invt_entry_t ) ) );
 	/* insert the new entry */
 	memcpy( &idxarr[ index ], ient, sizeof( invt_entry_t ) );
 
-	
+
 	if ( ( PUT_COUNTERS( fd, icnt ) < 0 ) ||
-		( PUT_REC_NOLOCK( fd, idxarr, 
-				  icnt->ic_curnum * sizeof( invt_entry_t ), 
+		( PUT_REC_NOLOCK( fd, idxarr,
+				  icnt->ic_curnum * sizeof( invt_entry_t ),
 				  sizeof( invt_counter_t ) ) < 0 ) ) {
 			/* XXX delete the stobj that we just created */
-			
+
 			memset( ient->ie_filename, 0 , INV_STRLEN );
 			free( idxarr );
 			return -1;
@@ -199,7 +199,7 @@ idx_put_newentry(
 	free( iarr );
 	idx->iarr = idxarr;
 	return stobjfd;
-	
+
 }
 
 
@@ -222,8 +222,8 @@ idx_find_stobj( invt_idxinfo_t *idx,
 	/* since sessions can be inserted in random order, the invindex
 	   table can contain time-periods that don't have corresponding
 	   entries for */
-	if ( GET_ALLHDRS_N_CNTS_NOLOCK( idx->invfd, (void **)&idx->iarr, 
-						     (void **)&idx->icnt, 
+	if ( GET_ALLHDRS_N_CNTS_NOLOCK( idx->invfd, (void **)&idx->iarr,
+						     (void **)&idx->icnt,
 						     sizeof( invt_entry_t ),
 				sizeof( invt_counter_t ) ) < 0 ) {
 		return -1;
@@ -236,7 +236,7 @@ idx_find_stobj( invt_idxinfo_t *idx,
 
 	/* Now figure out where we are going to insert this stobj among the
 	   invindices and put it there */
-	idx->index = idx_insert_newentry( idx->invfd, &stobjfd, idx->iarr, 
+	idx->index = idx_insert_newentry( idx->invfd, &stobjfd, idx->iarr,
 						 idx->icnt, tm );
 
 	return stobjfd;
@@ -267,17 +267,17 @@ idx_create( char *fname, inv_oflag_t forwhat )
 		INV_PERROR ( fname );
 		return INV_TOKEN_NULL;
 	}
-	
+
 	INVLOCK( fd, LOCK_EX );
 	fchmod( fd, INV_PERMS );
 
 #ifdef INVT_DEBUG
 	mlog( MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
 #endif
-	
+
 	/* create the first entry in the new inv_index */
 	stobjfd = idx_create_entry( &tok, fd, BOOL_TRUE );
-	
+
 	INVLOCK( fd, LOCK_UN );
 
 	if ( stobjfd < 0 )
@@ -298,11 +298,11 @@ idx_recons_time( time32_t tm, invt_idxinfo_t *idx )
 	if ( tp->tp_start && IS_WITHIN( tp, tm ) )
 		return 1;
 
-	if ( tm > tp->tp_end || tp->tp_end == 0 ) 
+	if ( tm > tp->tp_end || tp->tp_end == 0 )
 		tp->tp_end =  tm;
 	if ( tm < tp->tp_start || tp->tp_start == 0 )
 		tp->tp_start = tm;
-	PUT_REC_NOLOCK( idx->invfd,  &idx->iarr[idx->index], 
+	PUT_REC_NOLOCK( idx->invfd,  &idx->iarr[idx->index],
 		        sizeof( invt_entry_t ), IDX_HDR_OFFSET(idx->index) );
 	return 1;
 }
@@ -332,7 +332,7 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 		return -1;
 	}
 	ent.ie_timeperiod.tp_end = tok->sd_sesstime;
-	
+
 	if ( whichtime == INVT_STARTTIME || ent.ie_timeperiod.tp_start == 0 ) {
 		ent.ie_timeperiod.tp_start = tok->sd_sesstime;
 	}
@@ -343,18 +343,18 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 #endif
 	rval = PUT_REC_NOLOCK(fd, &ent, sizeof(invt_entry_t),
 			      tok->sd_invtok->d_invindex_off);
-	
+
 #ifdef INVT_DEBUG
 	{
 		int nindices;
 		invt_entry_t *iarr = NULL;
 		invt_counter_t *icnt = NULL;
-		if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd, 
-						     (void **)&iarr, 
-						     (void **)&icnt, 
+		if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd,
+						     (void **)&iarr,
+						     (void **)&icnt,
 						sizeof( invt_entry_t ),
 				sizeof( invt_counter_t ))) < 0 ) {
-			return -1;		 
+			return -1;
 		}
 		idx_DEBUG_printinvindices( iarr, (uint) nindices );
 		free( iarr );
@@ -381,8 +381,8 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 /*----------------------------------------------------------------------*/
 
 int
-idx_create_entry(  
-	inv_idbtoken_t *tok, 
+idx_create_entry(
+	inv_idbtoken_t *tok,
 	int invfd, 	/* kept locked EX  by caller */
 	bool_t firstentry )
 {
@@ -392,7 +392,7 @@ idx_create_entry(
 
 
 	memset ( &ent, 0, sizeof( ent ) );
-	
+
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
 	stobj_makefname( ent.ie_filename );
@@ -422,10 +422,10 @@ idx_create_entry(
 		if ( GET_COUNTERS( invfd, &cnt )  < 0 ) {
 			return -1;
 		}
-		
-		/* XXX check if there are too many indices. if so, create 
+
+		/* XXX check if there are too many indices. if so, create
 		   another and leave a pointer to that in here */
-		
+
 		/* create the new storage object */
 		fd = stobj_create( ent.ie_filename );
 		if ( fd < 0 ) {
@@ -446,7 +446,7 @@ idx_create_entry(
 #endif
 		if (PUT_REC_NOLOCK( invfd, &ent, sizeof( ent ), hoff) < 0 )
 			return -1;
-		
+
 	}
 
 	*tok = get_token( invfd, fd );
@@ -476,14 +476,14 @@ idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
 
 	/* if there's space anywhere at all, then it must be in the last
 	   entry. get_lastheader() does the locking */
-	
-	if ((*index = get_lastheader( invfd, (void **)&ent, 
+
+	if ((*index = get_lastheader( invfd, (void **)&ent,
 				       sizeof(invt_entry_t),
 				       sizeof(invt_counter_t) ) ) < 0 )
 		return -1;
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	assert ( ent != NULL );	
+	assert ( ent != NULL );
 	assert ( ent->ie_filename );
 
 	fd = open( ent->ie_filename, INV_OFLAG(forwhat) );
@@ -510,14 +510,14 @@ idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num )
 		strncpy( s, (char *) iarr[i].ie_filename + k -
 			( INV_UUID_STR_LEN + strlen(INV_STOBJ_PREFIX)), 8 );
 		s[8]= 0;
-		printf("%d. %s \t( %d - %d )\n", i, s, 
+		printf("%d. %s \t( %d - %d )\n", i, s,
 		       iarr[i].ie_timeperiod.tp_start,
 		       iarr[i].ie_timeperiod.tp_end );
 	}
 #undef INV_UUID_STR_LEN
 	printf( "\n ==================================\n");
 	return 1;
-	
+
 }
 
 int
@@ -526,12 +526,12 @@ idx_DEBUG_print ( int fd )
 	int nindices;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
-	if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd, 
-						    (void **)&iarr, 
-						    (void **)&icnt, 
+	if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd,
+						    (void **)&iarr,
+						    (void **)&icnt,
 						    sizeof( invt_entry_t ),
 				         sizeof( invt_counter_t ))) < 0 ) {
-		return -1;		 
+		return -1;
 	}
 	idx_DEBUG_printinvindices( iarr, (uint) nindices );
 	free( iarr );
@@ -553,7 +553,7 @@ DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
 	DEBUG_sessionprint( ses, ref, prctx);
 	free( ses->s_streams );
 	free( ses );
-	
+
 	return 0;
 }
 
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 79d4bb1..f175c02 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -71,7 +71,7 @@ init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 		if (errno != ENOENT) {
 			INV_PERROR ( fname );
 		} else if (forwhat == INV_SEARCH_N_MOD) {
-			*tok = idx_create( fname, forwhat ); 
+			*tok = idx_create( fname, forwhat );
 		} else {
 			/* this happens when the inv is empty and the user
 			   wants to do a search. this is legal - not an error */
@@ -79,7 +79,7 @@ init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 		}
 		return I_DONE; /* we are done whether token's NULL or not */
 	}
-	
+
 	/* we've got to do more housekeeping stuff. so signal that */
 	return fd;
 }
@@ -95,7 +95,7 @@ get_token( int invfd, int stobjfd  )
 
 	desc = (invt_desc_entry_t *) malloc
 		( sizeof( invt_desc_entry_t ) );
-	
+
 	desc->d_invindex_fd = invfd;
 	desc->d_stobj_fd  = stobjfd;
 	desc->d_update_flag = 0;
@@ -156,7 +156,7 @@ invmgr_query_all_sessions (
 	bool_t ret = BOOL_FALSE;
 
 	/* if on return, this is still null, the search failed */
-	*outarg = NULL; 
+	*outarg = NULL;
 	assert(inarg);
 
 	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
@@ -168,11 +168,11 @@ invmgr_query_all_sessions (
 		mlog( MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n") );
 		return ret;
 	}
-	
+
 	close( fd );
 
 	for ( i = 0; i < numfs; i++) {
-		if ( fstab_get_fname( &arr[i].ft_uuid, fname, 
+		if ( fstab_get_fname( &arr[i].ft_uuid, fname,
 				     (inv_predicate_t)INV_BY_UUID,
 				     forwhat) < 0 ) {
 			mlog( MLOG_NORMAL | MLOG_INV, _(
@@ -190,7 +190,7 @@ invmgr_query_all_sessions (
 			continue;
 		}
 		result = search_invt(fsidp, invfd, inarg, &objectfound, func);
-		close(invfd);		
+		close(invfd);
 
 		/* if error return BOOL_FALSE */
 		if (result < 0) {
@@ -204,7 +204,7 @@ invmgr_query_all_sessions (
 			ret = BOOL_TRUE;
 		}
 	}
-	
+
 	/* return val indicates if there was an error or not. *buf
 	   says whether the search was successful */
 	return ret;
@@ -222,7 +222,7 @@ invmgr_query_all_sessions (
 /*----------------------------------------------------------------------*/
 
 int
-search_invt( 
+search_invt(
 	uuid_t			*fsidp,
 	int			invfd,
 	void			*arg,
@@ -234,7 +234,7 @@ search_invt(
 	invt_entry_t	*iarr = NULL;
 	invt_counter_t	*icnt = NULL;
 	int	     	nindices;
-	
+
 
 	if (invfd == I_EMPTYINV)
 		return -1;
@@ -245,10 +245,10 @@ search_invt(
 	 */
 	*( char ** )buf = NULL;
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr, 
-					      (void **)&icnt, 
+	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+					      (void **)&icnt,
 					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t )) 
+					      sizeof( invt_counter_t ))
 	      ) <= 0 ) {
 		return -1;
 	}
@@ -271,8 +271,8 @@ search_invt(
 		INVLOCK( fd, LOCK_SH );
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr, 
-						  (void **)&scnt, 
+		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+						  (void **)&scnt,
 						  sizeof( invt_seshdr_t ),
 						 sizeof( invt_sescounter_t ))
 		     ) < 0 ) {
@@ -286,11 +286,11 @@ search_invt(
 		for (j = nsess - 1; j >= 0; j--) {
 			invt_session_t ses;
 
-			/* fd is kept locked until we return from the 
+			/* fd is kept locked until we return from the
 			   callback routine */
 
-			/* Check to see if this session has been pruned 
-			 * by xfsinvutil before checking it. 
+			/* Check to see if this session has been pruned
+			 * by xfsinvutil before checking it.
 			 */
 			if (harr[j].sh_pruned) {
 				continue;
@@ -312,7 +312,7 @@ search_invt(
 
 			found = (* do_chkcriteria)(fd, &harr[j], arg, buf);
 			if (! found ) continue;
-			
+
 			/* we found what we need; just return */
 			INVLOCK( fd, LOCK_UN );
 			close( fd );
@@ -320,11 +320,11 @@ search_invt(
 
 			return found; /* == -1 or 1 */
 		}
-		
+
 		INVLOCK( fd, LOCK_UN );
 		close( fd );
 	}
-	
+
 	return 0;
 }
 
@@ -339,7 +339,7 @@ search_invt(
 
 int
 invmgr_inv_print(
-	int 		invfd, 
+	int 		invfd,
 	invt_pr_ctx_t 	*prctx)
 {
 
@@ -351,16 +351,16 @@ invmgr_inv_print(
 
 	if (invfd == I_EMPTYINV)
 		return 0;
-	
-		
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr, 
-					      (void **)&icnt, 
+
+
+	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+					      (void **)&icnt,
 					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t )) 
+					      sizeof( invt_counter_t ))
 	      ) <= 0 ) {
 		return -1;
 	}
-	
+
 	free( icnt );
 
 	if (prctx->invidx) {
@@ -385,8 +385,8 @@ invmgr_inv_print(
 		INVLOCK( fd, LOCK_SH );
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr, 
-						  (void **)&scnt, 
+		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+						  (void **)&scnt,
 						  sizeof( invt_seshdr_t ),
 						 sizeof( invt_sescounter_t ))
 		     ) < 0 ) {
@@ -397,11 +397,11 @@ invmgr_inv_print(
 		}
 		free ( scnt );
 		for( s = 0; s < nsess; s++ ) {
-			/* fd is kept locked until we return from the 
+			/* fd is kept locked until we return from the
 			   callback routine */
 
-			/* Check to see if this session has been pruned 
-			 * by xfsinvutil before returning it. 
+			/* Check to see if this session has been pruned
+			 * by xfsinvutil before returning it.
 			 */
 			if ( harr[s].sh_pruned ) {
 				continue;
@@ -410,11 +410,11 @@ invmgr_inv_print(
 			(void)DEBUG_displayallsessions( fd, &harr[ s ],
 						        ref++, prctx);
 		}
-			
+
 		INVLOCK( fd, LOCK_UN );
 		close( fd );
 	}
-	
+
 	free (iarr);
 	return 0;
 }
@@ -440,11 +440,11 @@ invmgr_inv_check(
 
 	if (invfd == I_EMPTYINV)
 		return 0;
-	
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr, 
-					      (void **)&icnt, 
+
+	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+					      (void **)&icnt,
 					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t )) 
+					      sizeof( invt_counter_t ))
 	      ) <= 0 ) {
 		return -1;
 	}
@@ -466,8 +466,8 @@ invmgr_inv_check(
 		INVLOCK( fd, LOCK_SH );
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr, 
-						  (void **)&scnt, 
+		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+						  (void **)&scnt,
 						  sizeof( invt_seshdr_t ),
 						 sizeof( invt_sescounter_t ))
 		     ) < 0 ) {
@@ -477,7 +477,7 @@ invmgr_inv_check(
 			continue;
 		}
 		free ( scnt );
-		
+
 		if ((iarr[i].ie_timeperiod.tp_start != harr[0].sh_time) ||
 		    (iarr[i].ie_timeperiod.tp_end != harr[nsess-1].sh_time)) {
 			printf(_("INV: Check %d failed.\n"), i+1);
@@ -496,7 +496,7 @@ invmgr_inv_check(
 		INVLOCK( fd, LOCK_UN );
 		close( fd );
 	}
-	
+
 	return 0;
 }
 
@@ -518,7 +518,7 @@ tm_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
 		return 0;
 	if (hdr->sh_level < level ) {
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level, 
+		mlog( MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level,
 		     level );
 #endif
 		*tm = calloc( 1, sizeof( time32_t ) );
@@ -597,7 +597,7 @@ lastsess_level_equalto( int fd, invt_seshdr_t *hdr,
 /*----------------------------------------------------------------------*/
 bool_t
 insert_session( invt_sessinfo_t *s)
-{	
+{
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
 	int invfd, stobjfd = -1;
 	invt_idxinfo_t	  idx;
@@ -605,7 +605,7 @@ insert_session( invt_sessinfo_t *s)
 	inv_oflag_t       forwhat = INV_SEARCH_N_MOD;
 
 	/* initialize the inventory */
-	if ( ( invfd = init_idb ( (void *) s->ses->s_fsid, 
+	if ( ( invfd = init_idb ( (void *) s->ses->s_fsid,
 				  (inv_predicate_t) INV_BY_UUID,
  				  forwhat,
 				  &tok ) ) < 0 ) {
@@ -616,14 +616,14 @@ insert_session( invt_sessinfo_t *s)
 #endif
 			return BOOL_FALSE;
 		}
-		
+
 		invfd = tok->d_invindex_fd;
 		close( tok->d_stobj_fd );
 		destroy_token( tok );
 	}
-	
+
 	/* at this point we know that invindex has at least one entry
-	
+
 	   First we need to find out if this session is in the inventory
 	   already. To find the storage object that can possibly
 	   contain this session, it suffices to sequentially search the
@@ -644,7 +644,7 @@ insert_session( invt_sessinfo_t *s)
 	if ( ( stobj_insert_session( &idx, stobjfd, s ) < 0 ) ||
 		( idx_recons_time ( s->seshdr->sh_time, &idx ) < 0 ) )
 			ret = BOOL_TRUE;
-		
+
 	INVLOCK( stobjfd, LOCK_UN );
 	INVLOCK( invfd, LOCK_UN );
 
@@ -660,7 +660,7 @@ insert_session( invt_sessinfo_t *s)
 
 	/* and we are done */
 	return BOOL_TRUE;
-	
+
 }
 
 
@@ -717,7 +717,7 @@ bool_t
 invmgr_lockinit( void )
 {
 	if ( invlock_fd == -1 ) {
-		if (( invlock_fd = open( INV_LOCKFILE, 
+		if (( invlock_fd = open( INV_LOCKFILE,
 					O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
 			INV_PERROR( INV_LOCKFILE );
 			return BOOL_FALSE;
@@ -726,14 +726,14 @@ invmgr_lockinit( void )
 	}
 	return BOOL_TRUE;
 }
-	
-	
+
+
 bool_t
 invmgr_trylock( invt_mode_t mode )
 {
 	int md;
 	assert( invlock_fd >= 0 );
-	
+
 	md = (mode == INVT_RECONSTRUCT) ? LOCK_EX: LOCK_SH;
 
 	if (INVLOCK( invlock_fd, md | LOCK_NB ) < 0)
@@ -746,8 +746,8 @@ void
 invmgr_unlock( void )
 {
 	assert( invlock_fd >= 0 );
-	
-	INVLOCK( invlock_fd, LOCK_UN );	
+
+	INVLOCK( invlock_fd, LOCK_UN );
 
 }
 
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 66a03f4..56ac5e5 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -57,7 +57,7 @@ oref_resolve_(
 		assert(0);
 		break;
 	}
-	
+
 	return rval;
 }
 
@@ -66,12 +66,12 @@ oref_resolve_(
 
 
 /*
- * Resolve an object reference upto a specified point 
+ * Resolve an object reference upto a specified point
  */
 
 int
 oref_resolve_upto(
-	invt_oref_t 	*obj, 
+	invt_oref_t 	*obj,
 	invt_objtype_t	type)
 {
 	int rval = INV_OK;
@@ -101,7 +101,7 @@ oref_resolve_upto(
 	if (type >= INVT_RES_MFILES && rval != INV_ERR) {
 		rval = oref_resolve_mfiles(obj);
 	}
-	
+
 	return rval;
 }
 
@@ -137,7 +137,7 @@ oref_resolve_entries(
 	}
 
 	OREF_SET_TYPE(obj, INVT_RES_COUNTERS);
-		
+
 	return INV_OK;
 }
 
@@ -173,7 +173,7 @@ oref_resolve_counters(
 	}
 
 	OREF_SET_TYPE(obj, INVT_RES_COUNTERS);
-		
+
 	return INV_OK;
 }
 
@@ -181,7 +181,7 @@ oref_resolve_counters(
 
 int
 oref_sync(
-	invt_oref_t 	*obj, 
+	invt_oref_t 	*obj,
 	invt_objtype_t	type)
 {
 	int rval;
@@ -194,34 +194,34 @@ oref_sync(
 
 	switch (type) {
 	      case INVT_RES_COUNTERS:
-		rval = PUT_REC_NOLOCK(obj->fd, 
-				      OREF_CNT(obj), 
+		rval = PUT_REC_NOLOCK(obj->fd,
+				      OREF_CNT(obj),
 				      sizeof(*OREF_CNT(obj)),
 				      (off64_t) 0);
-				      
+
 		break;
 
 	      case INVT_RES_ENTRIES:
 		assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
 
-		rval = PUT_REC_NOLOCK(obj->fd, 
-				      OREF_ENTRIES(obj), 
+		rval = PUT_REC_NOLOCK(obj->fd,
+				      OREF_ENTRIES(obj),
 				      sizeof(*OREF_ENTRIES(obj)),
 				      (off64_t) sizeof(*OREF_CNT(obj)));
-		
+
 		break;
 
 	      default:
 		assert(0);
 		break;
 	}
-	
+
 	return rval;
 }
 
 int
 oref_sync_append(
-	invt_oref_t 	*obj, 
+	invt_oref_t 	*obj,
 	invt_objtype_t	type,
 	void		*entry,
 	size_t		entsz)
@@ -236,22 +236,22 @@ oref_sync_append(
 	switch (type) {
 	      case INVT_RES_ENTRIES:
 		assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
-		
-		rval = PUT_REC_NOLOCK(obj->fd, 
+
+		rval = PUT_REC_NOLOCK(obj->fd,
 				      entry,
 				      entsz,
 				      IDX_HDR_OFFSET(OREF_CNT_CURNUM(obj) - 1));
-		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES)) 
+		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
 			free((oref)->eu_ent);
 		OREF_UNSET_TYPE(obj, INVT_RES_ENTRIES);
-		
+
 		break;
 
 	      default:
 		assert(0);
 		break;
 	}
-	
+
 	return rval;
 }
 
@@ -259,18 +259,18 @@ oref_sync_append(
 
 void
 _oref_free(
-	invt_oref_t 	*obj, 
+	invt_oref_t 	*obj,
 	bool_t 		freethis)
 {
-	/* 
+	/*
 	 * Unlock the object *if* it is locked.
 	 * We dont want to actually close the fd because,
 	 * the tokens still need it.
 	 */
-	OREF_UNLOCK(obj);	
+	OREF_UNLOCK(obj);
 
 	if (OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ) ){
-		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS)) 
+		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_sescnt);
 		if (OREF_ISRESOLVED(obj, INVT_RES_HDRS))
 			free((oref)->eu_hdr);
@@ -282,15 +282,15 @@ _oref_free(
 			free((oref)->eu_mfile);
 	}
 	else if (OREF_ISRESOLVED(obj, INVT_OTYPE_INVIDX)) {
-		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS)) 
+		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_cnt);
-		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES)) 
+		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
 			free((oref)->eu_ent);
 	}
 	else if (OREF_ISRESOLVED(obj, INVT_OTYPE_FSTAB)) {
-		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS)) 
+		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_cnt);
-		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES)) 
+		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
 			free((oref)->eu_fstabent);
 	}
 	OREF_INIT(obj);
@@ -318,7 +318,7 @@ oref_resolve(
 	int		index;
 
 	assert(! OREF_ISRESOLVED(invidx, INVT_OTYPE_MASK));
-	
+
 	OREF_SET_TYPE(invidx, INVT_OTYPE_INVIDX);
 
 	/* come up with the unique file suffix that refers to this
@@ -336,7 +336,7 @@ oref_resolve(
 			return INV_ERR;
 		}
 		/* create the invidx */
-		return oref_resolve_new_invidx(invidx, fname);	
+		return oref_resolve_new_invidx(invidx, fname);
 	}
 
 	invidx->fd = fd;
@@ -351,27 +351,27 @@ oref_resolve(
 
 	/* Now we need to make sure that this has enough space */
 	OREF_LOCK(stobj, LOCK_SH);
-	
+
 	if (oref_resolve_upto(stobj, INVT_RES_COUNTERS) == INV_ERR) {
 		OREF_UNLOCK(stobj);
 		OREF_UNLOCK(invidx);
 		return INV_ERR;
 	}
 
-	/* create another storage object ( and, an inv_index entry for it 
+	/* create another storage object ( and, an inv_index entry for it
 	   too ) if we've filled this one up */
 	if (OREF_CNT_CURNUM(stobj) >= OREF_CNT_MAXNUM(stobj)) {
 		int 	rval;
 #ifdef INVT_DEBUG
 		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
 		      "index entry. \n" );
-#endif	
+#endif
 		/* Close(), Destroy() and mark unresolved */
 		OREF_UNRESOLVE_CHILD(invidx);
 		rval = oref_resolve_new_stobj(invidx, BOOL_FALSE);
 		/* rval = oref_idx_create_entry(invidx, BOOL_FALSE); */
 		OREF_UNLOCK(invidx);
-		
+
 		return rval;
 	}
 
@@ -380,7 +380,7 @@ oref_resolve(
 
 	tok = get_token(invidx->fd, stobj->fd);
 	tok->d_invindex_off = IDX_HDR_OFFSET(index - 1);
-	
+
 	OREF_SET_TOKEN(tok);
 	return INV_OK;
 
@@ -398,14 +398,14 @@ oref_resolve_child(
 	invt_entry_t 	*ent;
 	assert(OREF_IS_LOCKED(invidx));
 
-	if (oref_resolve_upto(invidx, INVT_RES_ENTRIES) == INV_ERR)	
+	if (oref_resolve_upto(invidx, INVT_RES_ENTRIES) == INV_ERR)
 		return INV_ERR;
-	
+
 	ent = OREF_ENTRIES(invidx);
-	
+
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	assert ( ent != NULL );	
+	assert ( ent != NULL );
 	assert ( ent->ie_filename );
 
 	fd = open( ent->ie_filename, O_RDWR );
@@ -442,7 +442,7 @@ oref_resolve_new_invidx(
 
 #ifdef INVT_DEBUG
 	mlog( MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
-#endif	
+#endif
 	/* create the new stobj as its first entry */
 	rval = oref_resolve_new_stobj(invidx, IS_EMPTY);
 
@@ -470,7 +470,7 @@ oref_resolve_new_stobj(
 	memset ( &ent, 0, sizeof( ent ) );
 	stobj = calloc(1, sizeof(invt_oref_t));
 	OREF_SET_CHILD(invidx, stobj);
-	
+
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
 	stobj_makefname( ent.ie_filename );
@@ -482,7 +482,7 @@ oref_resolve_new_stobj(
 		cnt->ic_maxnum = INVT_MAX_INVINDICES;
 		cnt->ic_curnum = 1;
 		cnt->ic_vernum = INV_VERSION;
-		
+
 		fd = stobj_create( ent.ie_filename );
 		if ( fd < 0 ) {
 			free(cnt);
@@ -499,7 +499,7 @@ oref_resolve_new_stobj(
 	else {
 		if (oref_resolve_upto(invidx, INVT_RES_COUNTERS) == INV_ERR)
 			return INV_ERR;
-		
+
 		/* create the new storage object */
 		fd = stobj_create( ent.ie_filename );
 		if ( fd < 0 ) {
@@ -508,21 +508,21 @@ oref_resolve_new_stobj(
 
 		stobj->fd = fd;
 		OREF_CNT_CURNUM(invidx)++;
-		
+
 		if ((oref_sync(invidx, INVT_RES_COUNTERS) == INV_ERR)
 		    ||
-		    (oref_sync_append(invidx, INVT_RES_ENTRIES, 
+		    (oref_sync_append(invidx, INVT_RES_ENTRIES,
 				      &ent, sizeof(ent)) == INV_ERR))
 			return INV_ERR;
-		
+
 	}
 	tok = get_token( invfd, fd );
 	tok->d_invindex_off = IDX_HDR_OFFSET(OREF_CNT_CURNUM(invidx) - 1);
 	tok->d_update_flag |= NEW_INVINDEX;
-	
+
 	OREF_SET_TOKEN(invidx, tok);
 	return INV_OK;
-	
+
 }
 
 
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 38303a4..0061722 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -51,14 +51,14 @@ typedef uint32_t	invt_objtype_t;
 #define INVT_LOCKED		0x0001
 
 typedef struct invt_oref {
-	int				 fd;  
+	int				 fd;
 
 	/* counters - contains curnum, maxnum, etc */
 	union {
 		invt_sescounter_t 	 *sescnt;
 		invt_counter_t		 *cnt;
 	} oref_cnt_u;
-	
+
 	/* entries pointing at other invt objects */
 	union {
 		invt_entry_t 		 *ent;
@@ -94,7 +94,7 @@ typedef struct invt_oref {
 #define ku_stobj	oref_kin_u.stobj
 
 /*
- *	See if the object has been resolved to the given level. 
+ *	See if the object has been resolved to the given level.
  */
 
 #define OREF_ISRESOLVED(oref, to_this_type) \
@@ -110,7 +110,7 @@ typedef struct invt_oref {
 	  else if (OREF_ISRESOLVED(oref, INVT_RES_PARENT)) \
 		  _oref_free((oref)->ku_invidx, BOOL_TRUE); \
           _oref_free(oref, BOOL_FALSE); }
-	  
+
 #define OREF_COPY(src_oref, dst_oref) \
 	(bcopy((src_oref), (dst_oref), sizeof(invt_oref_t)))
 
@@ -239,7 +239,7 @@ oref_resolve(
 
 int
 oref_resolve_upto(
-	invt_oref_t 	*obj, 
+	invt_oref_t 	*obj,
 	invt_objtype_t	type);
 
 int
@@ -252,7 +252,7 @@ oref_resolve_counters(
 
 void
 _oref_free(
-	invt_oref_t 	*obj, 
+	invt_oref_t 	*obj,
 	bool_t 		freethis);
 
 
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 5f2256d..ed50782 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -60,7 +60,7 @@
 #define INVT_DOLOCK		BOOL_TRUE
 #define INVT_DONTLOCK		BOOL_FALSE
 
-#define INVLOCK( fd, m )	flock( fd, m ) 
+#define INVLOCK( fd, m )	flock( fd, m )
 
 /* return values */
 #define INV_OK			(int) 1
@@ -110,14 +110,14 @@ typedef struct invt_session {
 	char		 s_devpath[INV_STRLEN];/* path to the device */
 	uint		 s_cur_nstreams;/* number of streams created under
 					   this session so far */
-	uint		 s_max_nstreams;/* number of media streams in 
+	uint		 s_max_nstreams;/* number of media streams in
 					   the session */
 	char		 s_padding[16];
-} invt_session_t;			   
- 
+} invt_session_t;
+
 typedef struct invt_seshdr {
 	off64_t		sh_sess_off;    /* offset to rest of the sessioninfo */
-	off64_t		sh_streams_off; /* offset to start of the set of 
+	off64_t		sh_streams_off; /* offset to start of the set of
 					   stream hdrs */
 	time32_t	sh_time;        /* time of the dump */
 	uint32_t	sh_flag;        /* for misc flags */
@@ -129,7 +129,7 @@ typedef struct invt_seshdr {
 
 /* Each session consists of a number of media streams. While it is given that
    there won't be multiple writesessions (ie. dumpsessions) concurrently,
-   there can be multiple media streams operating on a single file system, 
+   there can be multiple media streams operating on a single file system,
    each writing media files within its own stream. Hence, we have a linked
    list of media files, that the stream keeps track of. */
 
@@ -159,7 +159,7 @@ typedef struct invt_mediafile {
 	uuid_t		 mf_moid;	/* media object id */
 	char		 mf_label[INV_STRLEN];	/* media file label */
 	invt_breakpt_t	 mf_startino;	/* file that we started out with */
-	invt_breakpt_t	 mf_endino;	/* the dump file we ended this 
+	invt_breakpt_t	 mf_endino;	/* the dump file we ended this
 					   media file with */
 	off64_t		 mf_nextmf;	/* links to other mfiles */
 	off64_t		 mf_prevmf;
@@ -200,7 +200,7 @@ typedef struct invt_sescounter {
 	INVT_COUNTER_FIELDS
 	off64_t	       ic_eof;   /* current end of the file, where the next
 				 media file or stream will be written to */
-	char 	       ic_padding[0x20 - ( INVT_COUNTER_FIELDS_SIZE + 
+	char 	       ic_padding[0x20 - ( INVT_COUNTER_FIELDS_SIZE +
 					   sizeof( off64_t) )];
 } invt_sescounter_t;
 
@@ -225,7 +225,7 @@ typedef struct invt_desc_entry {
 				   this file system or not and also if
 				   we had to create a new invindex file */
 	inv_oflag_t d_oflag;    /* the open mode (SEARCH_ONLY, SEARCH_N_MOD) */
-	off64_t	d_invindex_off; /* for every session, we need a reference 
+	off64_t	d_invindex_off; /* for every session, we need a reference
 				   to its invindex entry, so that when we
 				   close a session, we know which one */
 } invt_desc_entry_t;
@@ -235,23 +235,23 @@ typedef struct invt_sesdesc_entry {
 	invt_desc_entry_t *sd_invtok;	/* generic inventory token */
 	off64_t		   sd_session_off;
 	off64_t		   sd_sesshdr_off;
-	time32_t	   sd_sesstime;	/* time that session started. 
+	time32_t	   sd_sesstime;	/* time that session started.
 					   needed for closing the session */
 } invt_sesdesc_entry_t;
-	
+
 struct invt_mediafile;
 
 typedef struct invt_strdesc_entry {
 	invt_sesdesc_entry_t  *md_sesstok;   /* the session token */
-	off64_t		       md_stream_off;/* offset to the media stream 
-						header */	
+	off64_t		       md_stream_off;/* offset to the media stream
+						header */
 	struct invt_mediafile *md_lastmfile; /* just so that we dont have
 						to get it back from disk
 						when we add the next mfile
 						to the linked list */
 
 } invt_strdesc_entry_t;
-	
+
 
 
 
@@ -262,7 +262,7 @@ typedef struct invt_strdesc_entry {
 
 typedef struct invt_sessinfo {
 	int 		  stobjfd;
-	invt_seshdr_t    *seshdr; 
+	invt_seshdr_t    *seshdr;
 	invt_session_t   *ses;
 	invt_stream_t    *strms;
 	invt_mediafile_t *mfiles;
@@ -332,7 +332,7 @@ typedef bool_t (*search_callback_t) (int, invt_seshdr_t *, void *, void *);
 #define GET_SESHEADERS( fd, hdrs, n ) get_headers( fd, (void**)(hdrs), \
 				   (size_t) ( n * sizeof(invt_seshdr_t ) ),\
 				          sizeof( invt_sescounter_t )  )
-						   
+
 #define GET_ENTRIES(fd, hdrs, n, sz) get_headers(fd, (void**)(hdrs), \
 				   (size_t) (n * sz), sizeof(invt_counter_t))
 
@@ -358,7 +358,7 @@ int
 idx_find_stobj( invt_idxinfo_t *idx, time32_t tm );
 
 uint
-idx_insert_newentry( int fd, int *stobjfd, invt_entry_t *iarr, 
+idx_insert_newentry( int fd, int *stobjfd, invt_entry_t *iarr,
 		     invt_counter_t *icnt,
 		     time32_t tm );
 int
@@ -382,23 +382,23 @@ int
 stobj_create( char *fname );
 
 int
-stobj_create_session( inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt, 
+stobj_create_session( inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt,
 		      invt_session_t *ses, invt_seshdr_t *hdr );
 
 int
 stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf );
 
 off64_t
-stobj_put_session( 
-	int fd, 
-	invt_sescounter_t *sescnt, 
-	invt_session_t *ses, 
+stobj_put_session(
+	int fd,
+	invt_sescounter_t *sescnt,
+	invt_session_t *ses,
 	invt_seshdr_t *hdr,
 	invt_stream_t *strms,
 	invt_mediafile_t *mfiles );
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
+stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles );
 
@@ -412,7 +412,7 @@ uint
 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, 
+stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	     invt_sessinfo_t *newsess );
 bool_t
 stobj_replace_session( int fd, invt_sescounter_t *sescnt, invt_session_t *ses,
@@ -427,7 +427,7 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 		     void  **bufpp, size_t *bufszp );
 
 bool_t
-stobj_unpack_sessinfo(  
+stobj_unpack_sessinfo(
         void              *bufp,
         size_t             bufsz,
 	invt_sessinfo_t   *s );
@@ -454,7 +454,7 @@ int
 stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr );
 
 int
-stobj_copy_invsess( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
+stobj_copy_invsess( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		    inv_session_t **buf);
 
 void
@@ -471,7 +471,7 @@ stobj_getsession_bylabel(int fd, invt_seshdr_t *hdr, void *label, void **buf);
 
 
 void
-stobj_convert_session(inv_session_t *ises, invt_session_t *ses, 
+stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 		      invt_seshdr_t *hdr);
 
 void
@@ -486,14 +486,14 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo);
 /*----------------------------------------------------------------------*/
 
 int
-fstab_get_fname( void *pred, char *fname, inv_predicate_t bywhat, 
+fstab_get_fname( void *pred, char *fname, inv_predicate_t bywhat,
 		 inv_oflag_t forwhat );
 
 int
 fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat );
 
 int
-fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs, 
+fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 	      inv_oflag_t forwhat );
 
 void
@@ -563,14 +563,14 @@ bool_t
 lastsess_level_equalto( int fd, invt_seshdr_t *hdr,  void *arg, void **buf );
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref, 
+DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
 			  invt_pr_ctx_t *prctx);
 
 int
 make_invdirectory( inv_oflag_t forwhat );
 
 bool_t
-init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat, 
+init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 	 inv_idbtoken_t *tok );
 
 int
@@ -582,6 +582,6 @@ insert_session( invt_sessinfo_t *s);
 /* To reconstruct a complete inventory from dumped inventories */
 extern bool_t
 inv_put_sessioninfo( invt_sessinfo_t *s );
-	        
+
 
 #endif
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 9619476..25df2fe 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -54,7 +54,7 @@ stobj_insert_session( invt_idxinfo_t *idx,
 		      invt_sessinfo_t *s )
 {
 	invt_sescounter_t *sescnt = NULL;
-	
+
 	if ( GET_SESCOUNTERS( fd, &sescnt ) < 0 ) {
 		INVLOCK( fd, LOCK_UN );
 		return -1;
@@ -64,11 +64,11 @@ stobj_insert_session( invt_idxinfo_t *idx,
 	   duplicating this session */
 	if ( sescnt->ic_curnum > 0 ) {
 		uint i;
-		invt_session_t	*sessions = calloc( sescnt->ic_curnum, 
+		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 ) + 
+				     sizeof( invt_session_t ),
+				     (off64_t) ( sizeof( *sescnt ) +
          		sescnt->ic_maxnum * sizeof( invt_seshdr_t ))) < 0 ) {
 			free ( sescnt );
 			free ( sessions );
@@ -76,14 +76,14 @@ stobj_insert_session( invt_idxinfo_t *idx,
 		}
 
 		for( i = 0; i <  sescnt->ic_curnum; i++ ) {
-			if ( uuid_compare( sessions[i].s_sesid, 
+			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, 
+			mlog( MLOG_DEBUG | MLOG_INV,
 			      "INV: attempt to insert an "
 			      "existing session.\n"
 			     );
@@ -100,15 +100,15 @@ stobj_insert_session( invt_idxinfo_t *idx,
 		}
 		free( sescnt );
 		return 1;
-		
+
 	}
-			
+
 	if ( stobj_put_session( fd, sescnt, s->ses, s->seshdr, s->strms,
 			        s->mfiles ) < 0 ){
 		free ( sescnt);
 		return -1;
 	}
-	
+
 	free ( sescnt);
 	return 1;
 }
@@ -139,17 +139,17 @@ stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm )
 	}
 
 
-	/* All the entries have the same sh_time. It's not clear if that's 
+	/* All the entries have the same sh_time. It's not clear if that's
 	   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, _(
 	      "INV: failed to find a different sh_time to split\n")
 	     );
-	      
+
 	return ns - 1;
-	
-	
+
+
 
 }
 
@@ -162,7 +162,7 @@ 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, 
+stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	     invt_sessinfo_t *newsess )
 {
 	invt_seshdr_t 	*harr = NULL;
@@ -174,24 +174,24 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 
 	if ( GET_SESHEADERS( fd, &harr, ns ) < 0 )
 		return -1;
-	
+
 	assert( harr != NULL );
 
-	if ( ( ix = stobj_find_splitpoint( fd, harr, ns, 
+	if ( ( ix = stobj_find_splitpoint( fd, harr, ns,
 				       newsess->seshdr->sh_time ) ) == 0 )
 		return -1;
-	
+
 	if ( ix == ns ) {
-		ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = 
+		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 = 
+		ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end =
 		harr[ix].sh_time;
 		if ( harr[ix - 1].sh_time >  newsess->seshdr->sh_time )
-			idx->iarr[idx->index].ie_timeperiod.tp_end 
+			idx->iarr[idx->index].ie_timeperiod.tp_end
 				= harr[ix - 1].sh_time;
 		else
-			idx->iarr[idx->index].ie_timeperiod.tp_end 
+			idx->iarr[idx->index].ie_timeperiod.tp_end
 				= newsess->seshdr->sh_time;
 	}
 
@@ -201,7 +201,7 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	newsess->stobjfd = idx_put_newentry( idx, &ient );
 	if ( newsess->stobjfd < 0 )
 		return -1;
-	
+
 	if ( ix == ns ) {
 		invt_sescounter_t *scnt = NULL;
 		off64_t rval;
@@ -209,19 +209,19 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 		/* We dont need to split. So, just put the new session in
 		   the new stobj, and rest in peace */
 		idx->index++;
-		
+
 		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->seshdr, newsess->strms,
 				        newsess->mfiles );
 		free( scnt );
 		return (rval < 0)? -1: 1;
 	}
-		
-	
+
+
 
 	for ( i = ix; i < ns; i++ ) {
 		invt_session_t session;
@@ -229,7 +229,7 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 		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 )
 			return -1;
@@ -243,11 +243,11 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 
 		/* There is no chance of a recursion here */
 		if ( stobj_insert_session( idx, newsess->stobjfd, &sesinfo )
-		     < 0 ) 
+		     < 0 )
 			return -1;
-		
+
 		/* Now delete that session from this StObj */
-		if (! stobj_delete_sessinfo( fd, sescnt, &session, 
+		if (! stobj_delete_sessinfo( fd, sescnt, &session,
 					     &harr[i] ) )
 			return -1;
 		free( bufpp );
@@ -255,14 +255,14 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	/* 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, 
+	   disk */
+	if ( stobj_put_session( fd, sescnt, newsess->ses, newsess->seshdr,
 			        newsess->strms, newsess->mfiles ) < 0 ) {
 		free ( sescnt);
 		return -1;
-	}	
+	}
+
 
-	
 	return 1;
 }
 
@@ -288,10 +288,10 @@ stobj_delete_sessinfo( int fd, /* kept locked EX by caller */
 		       invt_sescounter_t *sescnt,
 		       invt_session_t *ses, invt_seshdr_t *hdr )
 {
-	/* we change the sescnt here, but dont write it back to disk 
+	/* we change the sescnt here, but dont write it back to disk
 	   until later */
 	sescnt->ic_curnum--;
-	
+
 	/* there is really no need to take out / zero out the deleted
 	   session. The seshdr and session will be over-written, but
 	   space taken by the streams and mediafiles will be wasted. */
@@ -308,23 +308,23 @@ stobj_delete_sessinfo( int fd, /* kept locked EX by caller */
 
 
 off64_t
-stobj_put_session( 
-	int fd, 
-	invt_sescounter_t *sescnt, 
-	invt_session_t *ses, 
+stobj_put_session(
+	int fd,
+	invt_sescounter_t *sescnt,
+	invt_session_t *ses,
 	invt_seshdr_t *hdr,
 	invt_stream_t *strms,
 	invt_mediafile_t *mfiles )
 {
 	off64_t hoff;
-	
+
 	/* figure out the place where the header will go */
 	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 );	
+		hdr->sh_sess_off = STOBJ_OFFSET( sescnt->ic_maxnum,
+						 sescnt->ic_curnum );
 	sescnt->ic_curnum++;
 
 #ifdef INVT_DEBUG
@@ -334,43 +334,43 @@ stobj_put_session(
 	       (int) sescnt->ic_eof );
 #endif
 
-	/* we need to know where the streams begin, and where the 
+	/* 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 * 
+		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 * 
+		sescnt->ic_eof += (off64_t)( ses->s_cur_nstreams *
 					     sizeof( invt_stream_t ) );
-		for (i=0; i<ses->s_cur_nstreams; i++) 
+		for (i=0; i<ses->s_cur_nstreams; i++)
 			nmf += ( size_t ) strms[i].st_nmediafiles;
-		
-		sescnt->ic_eof += (off64_t)( sizeof( invt_mediafile_t ) 
+
+		sescnt->ic_eof += (off64_t)( sizeof( invt_mediafile_t )
 					     * nmf );
 		if ( stobj_put_streams( fd, hdr, ses, strms, mfiles ) < 0 )
-			return -1; 
+			return -1;
 
 	}
-				  
+
 	/* we write back the counters of this storage object first */
 	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 ) {
 		return -1;
 	}
 
 	/* write the header information to the storage object */
-	if ( PUT_REC_NOLOCK( fd, ses, sizeof( invt_session_t ), 
+	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 );
 
@@ -407,8 +407,8 @@ stobj_sortheaders( int fd, uint num )
 	printf("\nBEF\n" );
 	for (i=0; i<(int)num; i++)
 		printf("%ld\n", (long) hdrs[i].sh_time );
-#endif	
-	qsort( (void*) hdrs, (size_t) num, 
+#endif
+	qsort( (void*) hdrs, (size_t) num,
 	      sizeof( invt_seshdr_t ), stobj_hdrcmp );
 
 #ifdef INVT_DEBUG
@@ -420,7 +420,7 @@ stobj_sortheaders( int fd, uint num )
 		free ( hdrs );
 		return -1;
 	}
-	
+
 	free ( hdrs );
 	return 1;
 
@@ -437,7 +437,7 @@ 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 )
 {
@@ -453,39 +453,39 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		  (off64_t) ((size_t) nmfiles * sizeof( invt_mediafile_t ) );
 		/* now fix the offsets in mediafiles */
 		for ( j = 0; j < strms[i].st_nmediafiles; j++ ) {
-			
+
 			/* no need to fix the last element's next ptr */
 			if ( j < strms[i].st_nmediafiles - 1 )
-				mfiles[ nmfiles + j ].mf_nextmf = 
-				        strms[i].st_firstmfile + 
+				mfiles[ nmfiles + j ].mf_nextmf =
+				        strms[i].st_firstmfile +
 			      (off64_t) ((j+1) * sizeof( invt_mediafile_t ));
 
 			/* no need to fix the first element's prev ptr */
 			if ( j )
-				mfiles[ nmfiles + j ].mf_prevmf = 
-				        strms[i].st_firstmfile + 
+				mfiles[ nmfiles + j ].mf_prevmf =
+				        strms[i].st_firstmfile +
 			    (off64_t) ((j-1) * sizeof( invt_mediafile_t ));
 		}
 
-		/* adjust the offsets of the first and the last elements 
+		/* adjust the offsets of the first and the last elements
 		   in the mediafile chain */
 		mfiles[ nmfiles ].mf_prevmf = 0;
 		nmfiles += strms[i].st_nmediafiles;
 		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 ), 
+	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 ), 
+
+	if ( PUT_REC_NOLOCK( fd, mfiles, nmfiles * sizeof( invt_mediafile_t ),
 			     mfileoff ) < 0 )
 		return -1;
 
 	return 1;
-	
+
 }
 
 
@@ -499,14 +499,14 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 
 void
 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 );
-	
+
 	strcpy( fname, INV_DIRPATH );
 	strcat( fname, "/" );
 	strcat( fname, str );
@@ -516,7 +516,7 @@ stobj_makefname( char *fname )
 }
 
 
- 
+
 
 
 
@@ -525,13 +525,13 @@ stobj_makefname( char *fname )
 int
 stobj_create( char *fname )
 {
-	int fd;	
+	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);
-#endif	
+#endif
 
 	/* create the new storage object */
 	if (( fd = open( fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
@@ -539,10 +539,10 @@ stobj_create( char *fname )
 		memset( fname, 0, INV_STRLEN );
 		return -1;
 	}
-	
+
 	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;
@@ -554,7 +554,7 @@ stobj_create( char *fname )
 		close( fd );
 		return -1;
 	}
-	
+
 	INVLOCK( fd, LOCK_UN );
 	return fd;
 }
@@ -569,21 +569,21 @@ stobj_create( char *fname )
 
 
 int
-stobj_create_session( 
-	inv_sestoken_t tok, 
+stobj_create_session(
+	inv_sestoken_t tok,
 	int fd, /* kept locked EX by caller */
-	invt_sescounter_t *sescnt, 
-	invt_session_t *ses, 
+	invt_sescounter_t *sescnt,
+	invt_session_t *ses,
 	invt_seshdr_t *hdr )
 {
 	off64_t hoff;
-	
+
 	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;
 	}
@@ -630,7 +630,7 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 	   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 ), 
+	if ( GET_REC_NOLOCK( fd, &stream, sizeof( stream ),
 			     tok->md_stream_off ) < 0 )
 		return -1;
 
@@ -648,34 +648,34 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 #ifdef INVT_DEBUG
 	mlog (MLOG_VERBOSE, "#################### mediafile #%d "
 	      "###################\n", stream.st_nmediafiles);
-#endif	
+#endif
 	/* add the new mediafile at the tail of the list */
-	
-	mf->mf_nextmf = tok->md_stream_off; 
+
+	mf->mf_nextmf = tok->md_stream_off;
 	mf->mf_prevmf = stream.st_lastmfile;
 
-	
+
 	if ( tok->md_lastmfile )
-		tok->md_lastmfile->mf_nextmf = pos;	
+		tok->md_lastmfile->mf_nextmf = pos;
 	else {
 		stream.st_firstmfile = pos;
 	}
 
 	stream.st_lastmfile = pos;
 
-	
+
 	/* write the stream to disk */
-	if ( PUT_REC_NOLOCK( fd, &stream, sizeof( stream ), 
+	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 ), 
+		rval = PUT_REC_NOLOCK( fd, tok->md_lastmfile,
+				       sizeof( invt_mediafile_t ),
 				       mf->mf_prevmf );
 		free (  tok->md_lastmfile );
-		if ( rval < 0 ) 
+		if ( rval < 0 )
 			return -1;
 	}
 
@@ -709,11 +709,11 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 /*----------------------------------------------------------------------*/
 
 int
-stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr, 
+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; 
+	int fd = tok->sd_invtok->d_stobj_fd;
 
 	/* get the session header first */
 	if ( ( rval = GET_REC_NOLOCK( fd, hdr, sizeof( invt_seshdr_t ),
@@ -721,7 +721,7 @@ stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr,
 		rval = GET_REC_NOLOCK( fd, ses, sizeof( invt_session_t ),
 			     tok->sd_session_off );
 	}
-	
+
 	return rval;
 }
 
@@ -759,9 +759,9 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 		free ( strms );
 		return BOOL_FALSE;
 	}
-	
+
 	for ( i = 0; i < ses->s_cur_nstreams; i++ )
-		sessz += sizeof( invt_mediafile_t ) * 
+		sessz += sizeof( invt_mediafile_t ) *
 			 (size_t) strms[i].st_nmediafiles;
 
 	/* Now we know how big this entire thing is going to be */
@@ -770,15 +770,15 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 
 	/* 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 
+	   those in order to restore this session ( since everything's
 	   contiguous ) */
 
-	/* magic cookie that we put for sanity checking in case of an 
+	/* magic cookie that we put for sanity checking in case of an
 	   earthquake or something :) */
-	strcpy( sesbuf, INVTSESS_COOKIE ); 
+	strcpy( sesbuf, INVTSESS_COOKIE );
 	sesbuf += (size_t)( strlen( INVTSESS_COOKIE ) * sizeof( char ) );
-	
-	/* This was originally INV_VERSION. Changed it to mean packed inventory 
+
+	/* This was originally INV_VERSION. Changed it to mean packed inventory
 	 * version number and added another inv_version_t to contain the INV_VERSION.
 	 * The primary intent of this change was to make everything 64 bit aligned,
 	 * but we also got the advantage of separating the packed inv version from
@@ -805,11 +805,11 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 	/* now append all the mediafiles */
 	for ( i = 0; i < ses->s_cur_nstreams; i++ ) {
 		off = strms[i].st_firstmfile;
-		for ( j = 0; j < strms[i].st_nmediafiles; 
-		     j++, 
+		for ( j = 0; j < strms[i].st_nmediafiles;
+		     j++,
 		     off = mf.mf_nextmf ) {
 			assert( off );
-			if ( GET_REC_NOLOCK( fd, &mf, 
+			if ( GET_REC_NOLOCK( fd, &mf,
 					     sizeof( invt_mediafile_t ),
 					     off ) <= 0 ) {
 				free( strms );
@@ -837,8 +837,8 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 
 bool_t
 stobj_getsession_byuuid(
-	int fd, 
-	invt_seshdr_t *hdr, 
+	int fd,
+	invt_seshdr_t *hdr,
 	void *sesid,
 	void **buf )
 {
@@ -848,19 +848,19 @@ stobj_getsession_byuuid(
 	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 */
 	if (uuid_compare(ses.s_sesid, *((uuid_t *)sesid))) {
-		return BOOL_FALSE;	
+		return BOOL_FALSE;
 	}
 
-	/* yay. we found the session. so, make the session struct and 
+	/* yay. we found the session. so, make the session struct and
 	   put it in the buffer */
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
 	return BOOL_TRUE;
-	
-}		
+
+}
 
 
 
@@ -873,8 +873,8 @@ stobj_getsession_byuuid(
 
 bool_t
 stobj_getsession_bylabel(
-	int fd, 
-	invt_seshdr_t *hdr, 
+	int fd,
+	invt_seshdr_t *hdr,
 	void *seslabel,
 	void **buf )
 {
@@ -887,16 +887,16 @@ stobj_getsession_bylabel(
 
 	/* now see if this is the one that caller is askin for */
 	if (! STREQL(ses.s_label, (char *)seslabel)) {
-		return BOOL_FALSE;	
+		return BOOL_FALSE;
 	}
 
-	/* yay. we found the session. so, make the session struct and 
+	/* yay. we found the session. so, make the session struct and
 	   put it in the buffer */
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
 	return BOOL_TRUE;
-	
-}	
+
+}
 
 
 /*----------------------------------------------------------------------*/
@@ -907,8 +907,8 @@ stobj_getsession_bylabel(
 
 /* ARGSUSED */
 bool_t
-stobj_delete_mobj(int fd, 
-		  invt_seshdr_t *hdr, 
+stobj_delete_mobj(int fd,
+		  invt_seshdr_t *hdr,
 		  void *arg ,
 		  void **buf )
 {
@@ -928,28 +928,28 @@ stobj_delete_mobj(int fd,
 
 	/* 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, 
+	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++ ) {
 		off = strms[i].st_firstmfile;
 		nmfiles = strms[i].st_nmediafiles;
 		mfiles = mf = calloc( nmfiles, sizeof( invt_mediafile_t ) );
-		for ( j = 0; j < nmfiles; 
-		     j++, 
+		for ( j = 0; j < nmfiles;
+		     j++,
 		     off = mf->mf_nextmf,
 		     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, 
+			if ( GET_REC_NOLOCK( fd, mf,
 					     sizeof( invt_mediafile_t ),
 					     off ) <= 0 ) {
 				free( strms );
@@ -969,7 +969,7 @@ stobj_delete_mobj(int fd,
 				printf(" found one\n" );
 #endif
 
-/*                                dirty = BOOL_TRUE;	
+/*                                dirty = BOOL_TRUE;
 
 				if ( j == 0 )
 				       strms[i].st_firstmfile = mf->mf_nextmf;
@@ -1003,7 +1003,7 @@ stobj_delete_mobj(int fd,
 /*----------------------------------------------------------------------*/
 
 bool_t
-stobj_unpack_sessinfo(  
+stobj_unpack_sessinfo(
         void              *bufp,
         size_t             bufsz,
 	invt_sessinfo_t   *s )
@@ -1011,9 +1011,9 @@ stobj_unpack_sessinfo(
 	uint 		 i;
 	char	         *tmpbuf;
 	char 		 *p = (char *)bufp;
-	
+
 	assert ( bufp );
-	
+
 	tmpbuf = (char *)malloc(bufsz);
 
 	/* first make sure that the magic cookie at the beginning is right.
@@ -1038,16 +1038,16 @@ stobj_unpack_sessinfo(
 		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 
+		 * SIGBUS and core dump. The best way to handle it is to
 		 * bcopy the remaining part of bufp to a new malloc'ed area
 		 * which will be 64 bit aligned. This is a memory leak , but not much.
 		 * Have to do this because xfsrestore does another round of
 		 * unpack later , so can't disturb the original data.
-		 * This is fixed in PACKED_INV_VERSION_2 by adding another (inv_version_t) to 
+		 * This is fixed in PACKED_INV_VERSION_2 by adding another (inv_version_t) to
 		 * have the INV_VERSION. This makes everything 64 bit aligned.
 		 */
 
-		tempsz = bufsz - (strlen( INVTSESS_COOKIE ) * sizeof( char )) 
+		tempsz = bufsz - (strlen( INVTSESS_COOKIE ) * sizeof( char ))
 			       - sizeof( inv_version_t ) ;
 		temp_p = calloc(1, tempsz);
 		bcopy(p, temp_p, tempsz);
@@ -1063,7 +1063,7 @@ stobj_unpack_sessinfo(
 		      "INV: inv_put_session: unknown packed inventory version"
 		      " %d\n"), *( inv_version_t *) p);
 		return BOOL_FALSE;
-	} 
+	}
 
 	xlate_invt_seshdr((invt_seshdr_t *)p, (invt_seshdr_t *)tmpbuf, 1);
 	bcopy(tmpbuf, p, sizeof(invt_seshdr_t));
@@ -1071,7 +1071,7 @@ 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);
@@ -1094,11 +1094,11 @@ stobj_unpack_sessinfo(
 		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; 
+			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, 
+				put_invtrecord( tmpfd, &mmf->mf_moid,
 					 sizeof( uuid_t ), 0, SEEK_END, 0 );
 		}
 		close( tmpfd );
@@ -1108,16 +1108,16 @@ stobj_unpack_sessinfo(
 		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 
+
+	/* 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",  
+		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 );
-	
+
 	return BOOL_TRUE;
 }
 
@@ -1138,7 +1138,7 @@ stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr )
 	    < 0 ) {
 		return -1;
 	}
-	
+
 	return stobj_copy_invsess(fd, hdr, &ses, buf);
 }
 
@@ -1168,7 +1168,7 @@ stobj_convert_strm(inv_stream_t *expstrm, invt_stream_t *strm)
 
 	expstrm->st_interrupted = strm->st_interrupted;
 	expstrm->st_startino = strm->st_startino.ino;
-	expstrm->st_startino_off = 
+	expstrm->st_startino_off =
 		strm->st_startino.offset;
 	expstrm->st_endino = strm->st_endino.ino;
 	expstrm->st_endino_off = strm->st_endino.offset;
@@ -1181,7 +1181,7 @@ stobj_convert_strm(inv_stream_t *expstrm, invt_stream_t *strm)
 }
 
 void
-stobj_convert_session(inv_session_t *ises, invt_session_t *ses, 
+stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 		      invt_seshdr_t *hdr)
 {
 	ises->s_time = hdr->sh_time;
@@ -1208,7 +1208,7 @@ stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 /*----------------------------------------------------------------------*/
 
 int
-stobj_copy_invsess(int fd,  
+stobj_copy_invsess(int fd,
 		   invt_seshdr_t *hdr,
 		   invt_session_t *ses,
 		   inv_session_t **buf)
@@ -1218,11 +1218,11 @@ 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 ), 
+	if ( GET_REC_NOLOCK( fd, strms,
+			     ses->s_cur_nstreams * sizeof( invt_stream_t ),
 			     hdr->sh_streams_off ) < 0 ) {
 		free (strms);
 		return -1;
@@ -1231,13 +1231,13 @@ stobj_copy_invsess(int fd,
 	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 ));
-	
+
 	/* fill in the stream structures too */
 	i = (int) ses->s_cur_nstreams;
 	while ( i-- ) {
 		off64_t		 off;
 		uint            j, nmf;
-		
+
 		stobj_convert_strm(&ises->s_streams[i], &strms[i]);
 		nmf = strms[i].st_nmediafiles;
 		off = strms[i].st_firstmfile;
@@ -1247,11 +1247,11 @@ stobj_copy_invsess(int fd,
 						    sizeof( inv_mediafile_t ) );
 		assert( !nmf || ises->s_streams[i].st_mediafiles );
 
-		for ( j = 0; j < nmf; 
-		      j++, 
+		for ( j = 0; j < nmf;
+		      j++,
 		      off = mf.mf_nextmf ) {
 			assert( off );
-			if ( GET_REC_NOLOCK( fd, &mf, 
+			if ( GET_REC_NOLOCK( fd, &mf,
 					     sizeof( invt_mediafile_t ),
 					     off ) <= 0 ) {
 				INV_PERROR( "stobj::make_invsess\n" );
@@ -1272,9 +1272,9 @@ stobj_copy_invsess(int fd,
 				return -1;
 			}
 		}
-		
+
 	}
-	
+
 
 	free( strms );
 	*buf = ises;
@@ -1314,7 +1314,7 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 					     mf++ );
 		}
 	}
-	
+
 	*buf = ises;
 }
 
@@ -1323,7 +1323,7 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 int
 stobj_hdrcmp( const void *h1, const void *h2 )
 {
-	return (int) ( ((invt_seshdr_t *)h1)->sh_time - 
+	return (int) ( ((invt_seshdr_t *)h1)->sh_time -
 		       ((invt_seshdr_t *)h2)->sh_time );
 }
 
@@ -1354,21 +1354,21 @@ mobj_eql ( inv_mediafile_t *mfp, invt_mobjinfo_t *mobj )
 {
 
 	if ( mobj->type == INVT_MOID ) {
-		if ( !uuid_compare( *((uuid_t*) mobj->value), 
+		if ( !uuid_compare( *((uuid_t*) mobj->value),
 			      mfp->m_moid) ) {
 			return BOOL_TRUE;
 		}
 	} else {
-		if ( STREQL( (char*) mobj->value, 
+		if ( STREQL( (char*) mobj->value,
 			    mfp->m_label ) ) {
 			return BOOL_TRUE;
 		}
 	}
-	
+
 	return BOOL_FALSE;
 }
 
-  
+
 bool_t
 check_for_mobj ( inv_session_t *ses, invt_mobjinfo_t *mobj )
 {
@@ -1405,7 +1405,7 @@ DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 		if (!check_for_mobj (ses, mobj))
 			return;
 	}
-		
+
 	if ( ref == 0 || fsidxprinted != (uint) prctx->index ) {
 		fsidxprinted = (uint) prctx->index;
 
@@ -1413,7 +1413,7 @@ DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 		uuid_unparse( ses->s_fsid, str );
 		printf("\tfs id:\t\t%s\n", str);
 	}
-	
+
 	if (prctx->depth == PR_FSONLY)
 		return;
 
@@ -1431,7 +1431,7 @@ DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 	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 )
 		return;
 
@@ -1474,7 +1474,7 @@ DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 			}
 			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:"
 					"\tino %llu offset %lld\n",
diff --git a/inventory/inventory.h b/inventory/inventory.h
index c1d7403..076b83e 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -30,8 +30,8 @@
  * knowledge of the functionalities, some abstractions, and even typical queries
  * of dump() and restore() and uses this knowledge in formulating its storage
  * structure on disk. All these things, of course, are completely abstract with
- * respect to the clients of the inventory. 
- * 
+ * respect to the clients of the inventory.
+ *
  */
 
 #define INV_DIRPATH		inv_dirpath()
@@ -45,12 +45,12 @@
 
 typedef uint32_t		inv_version_t;
 
-/* This is the general inventory version. 
+/* This is the general inventory version.
  */
-#define INV_VERSION		(inv_version_t) 1	
+#define INV_VERSION		(inv_version_t) 1
 
 /* This is the version of the on-tape (packed) inventory.
- * version 2 has an extra inv_version_t in it to make everything 
+ * version 2 has an extra inv_version_t in it to make everything
  * 64 bit aligned.
  */
 #define PACKED_INV_VERSION_1	(inv_version_t) 1
@@ -106,13 +106,13 @@ typedef enum {
 	INV_BY_DEVPATH
 } inv_predicate_t;
 
-	
+
 typedef enum {
 	INV_SEARCH_ONLY,
 	INV_SEARCH_N_MOD
 } inv_oflag_t;
 
-		     
+
 typedef struct inv_mediafile {
 	uuid_t		 m_moid;	/* media object id */
 	uint		 m_mfile_index; /* index within the media object */
@@ -122,7 +122,7 @@ typedef struct inv_mediafile {
 	off64_t		 m_endino_off;	/* .. media file with. */
 	off64_t		 m_size;	/* size of mediafile in bytes */
 	bool_t           m_isgood;      /* distinguishes good mfiles */
-	bool_t		 m_isinvdump;	/* is this the mfile that has the dump 
+	bool_t		 m_isinvdump;	/* is this the mfile that has the dump
 					   of the rest of the session? */
 	char		 m_label[INV_STRLEN];	/* media file label */
 } inv_mediafile_t;
@@ -130,12 +130,12 @@ typedef struct inv_mediafile {
 
 typedef struct inv_stream {
 	bool_t		st_interrupted;	/* was this stream interrupted ? */
-	
+
 	/* duplicate info from mediafiles for speed */
 	xfs_ino_t	st_startino;	/* the starting pt */
 	off64_t		st_startino_off;
-	xfs_ino_t	st_endino;  	/* where we actually ended up. this 
-					   means we've written upto but not 
+	xfs_ino_t	st_endino;  	/* where we actually ended up. this
+					   means we've written upto but not
 					   including this breakpoint. */
 	off64_t		st_endino_off;
 	char            st_cmdarg[INV_STRLEN]; /* the driver path user entered */
@@ -144,11 +144,11 @@ typedef struct inv_stream {
 } inv_stream_t;
 
 
-/* 
- * inventory_session_t 
+/*
+ * inventory_session_t
  * all the information that is kept on a single dump session of a single
  * file system in the inventory.
- * 
+ *
  */
 
 typedef struct inv_session {
@@ -164,11 +164,11 @@ typedef struct inv_session {
 	uint		 s_nstreams;	/* num of media streams recorded */
 	inv_stream_t	*s_streams;	/* array of streams */
         uint            s_refnum;      /* storage location dependent ref.
-					   used in displaying the session and 
+					   used in displaying the session and
 					   nowhere else */
-					   
+
 } inv_session_t;
- 
+
 
 
 struct invt_desc_entry;
@@ -186,14 +186,14 @@ typedef struct invt_strdesc_entry	*inv_stmtoken_t;
 /* inventory_open - initializes access to the inventory
  */
 extern inv_idbtoken_t
-inv_open( 
-	 inv_predicate_t bywhat, /* BY_UUID, BY_MOUNTPT, BY_DEVPATH */	
+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 */
 
 
 extern bool_t
-inv_close( 
+inv_close(
 	inv_idbtoken_t	tok );
 
 
@@ -209,16 +209,16 @@ inv_writesession_open(
 	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
-	char		*devpath );	      
+	char		*devpath );
 
 extern bool_t
-inv_writesession_close( 
+inv_writesession_close(
 	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(
@@ -226,9 +226,9 @@ inv_stream_close(
 	bool_t 		wasinterrupted );
 
 extern bool_t
-inv_put_mediafile( 
-	inv_stmtoken_t 	tok, 
-	uuid_t 		*moid, 
+inv_put_mediafile(
+	inv_stmtoken_t 	tok,
+	uuid_t 		*moid,
 	char 		*label,
 	uint		mfileindex,
 	xfs_ino_t	startino,
@@ -243,26 +243,26 @@ inv_put_mediafile(
 /* lasttime_level_lessthan - finds the time of the last dump of the
  * specified file system at a level less than the specified level.
  * if never dumped below the current level, *time is set to NULL.
- * 
+ *
  */
 extern bool_t
-inv_lasttime_level_lessthan( 
+inv_lasttime_level_lessthan(
 	uuid_t			*fsidp,
 	inv_idbtoken_t 		tok,
 	u_char			level,
 	time32_t		**time); /* out */
 
 extern bool_t
-inv_lastsession_level_lessthan( 
+inv_lastsession_level_lessthan(
 	uuid_t			*fsidp,
-	inv_idbtoken_t 		tok,			     
+	inv_idbtoken_t 		tok,
 	u_char  		level,
 	inv_session_t		**ses); /* out */
 
 extern bool_t
-inv_lastsession_level_equalto( 
+inv_lastsession_level_equalto(
 	uuid_t			*fsidp,
-	inv_idbtoken_t 		tok,			     
+	inv_idbtoken_t 		tok,
 	u_char  		level,
 	inv_session_t		**ses); /* out */
 
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 05e3c02..e43e392 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -90,13 +90,13 @@ recons_test( int howmany )
 {
 	int fd, i, rval = 1;
 	off64_t off = 0;
-	
+
 	ses sarr[ SESLIM];
-	
+
 	fd = open( sesfile, O_RDONLY );
-	
+
 	for ( i=0; i<howmany && i < SESLIM; i++ ){
-		rval = get_invtrecord( fd, &sarr[i], 
+		rval = get_invtrecord( fd, &sarr[i],
 				       sizeof( uuid_t ) + sizeof( size_t ), off,
 				       BOOL_FALSE );
 		assert( rval > 0 );
@@ -108,9 +108,9 @@ recons_test( int howmany )
 		assert( rval > 0 );
 		off += sarr[i].sz;
 	}
-	
-	
-	
+
+
+
 	for ( i=0; i<howmany && i < SESLIM; i++ ){
 		if ( inv_put_sessioninfo( sarr[i].buf, sarr[i].sz ) < 0)
 			printf("$ insert failed.\n");
@@ -134,13 +134,13 @@ delete_test( int n )
 
 	fd = open( "moids", O_RDONLY );
 	if ( fd < 0 ) return -1;
-	
+
 	get_invtrecord( fd, &moid, sizeof(uuid_t), (n-1)* sizeof( uuid_t), 0 );
 	uuid_to_string( &moid, &str, &stat );
 	printf("Searching for Moid = %s\n", str );
 	free( str );
 	if (! inv_delete_mediaobj( &moid ) ) return -1;
-	    
+
 	return 1;
 
 }
@@ -200,7 +200,7 @@ query_test( int level )
 	time_t *tm;
 	inv_session_t *ses;
 	invt_pr_ctx_t prctx;
-	
+
 	if (level == -2) {
 		printf("mount pt %s\n",sesfile);
 		tok = inv_open( INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile );
@@ -208,7 +208,7 @@ query_test( int level )
 		idx_DEBUG_print (tok->d_invindex_fd);
 		return 1;
 	}
-		
+
 	for (i = 7; i<8; i++) {
 		printf("\n\n\n----------------------------------\n"
 		       "$ Searching fs %s\n", mnt_str[7-i] );
@@ -239,8 +239,8 @@ query_test( int level )
 		inv_close( tok );
 	}
 	return 1;
-}				
-				   
+}
+
 
 /*----------------------------------------------------------------------*/
 /*                                                                      */
@@ -256,7 +256,7 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 	uuid_t *fsidp;
 	inv_idbtoken_t tok1;
 	inv_sestoken_t tok2;
-	inv_stmtoken_t tok3;	
+	inv_stmtoken_t tok3;
 	char *dev, *mnt;
 	char label[120];
 	uuid_t fsidarr[8], labelid;
@@ -314,13 +314,13 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 		free (str);
 		strbuf[8] = '\0';
 		sprintf(label,"%s_%s (%d)\0","SESSION_LABEL", strbuf, i );
-		
+
 		tok2 = inv_writesession_open(tok1, fsidp,
 					     &labelid,
-					     label, 
+					     label,
 					     (bool_t)i%2,
 					     (bool_t)i%2,
-					     dumplevel, nstreams, 
+					     dumplevel, nstreams,
 					     time(NULL),
 					     mnt, dev );
 		assert (tok2 != INV_TOKEN_NULL );
@@ -333,7 +333,7 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 					      k*100 + 99 );
 			inv_stream_close( tok3, BOOL_TRUE );
 		}
-	
+
 #ifdef RECONS
 		if (inv_get_sessioninfo( tok2, &bufp, &sz ) == BOOL_TRUE ) {
 			put_invtrecord( rfd, fsidp, sizeof( uuid_t ), off,
@@ -351,8 +351,8 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 #endif
 		inv_writesession_close( tok2 );
 		inv_close( tok1 );
-	}	
-#ifdef RECONS	
+	}
+#ifdef RECONS
 	close( rfd );
 #endif
 	return 1;
@@ -375,10 +375,10 @@ mp_test(int nstreams)
 
 	tok2 = inv_writesession_open(tok1, fsidp,
 				     &labelid,
-				     label, 
+				     label,
 				     (bool_t)i%2,
 				     (bool_t)i%2,
-				     dumplevel, nstreams, 
+				     dumplevel, nstreams,
 				     time(NULL),
 				     mnt, dev );
 	assert (tok2 != INV_TOKEN_NULL );
@@ -392,7 +392,7 @@ mp_test(int nstreams)
 					      k*100 + 99 );
 			inv_stream_close( tok3, BOOL_TRUE );
 		}
-#endif	
+#endif
 }
 
 
@@ -404,7 +404,7 @@ mp_test(int nstreams)
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-	
+
 main(int argc, char *argv[])
 {
 	int rval = -1, nsess = 8, nmedia = 2, nstreams = 3, level = 0;
@@ -418,12 +418,12 @@ main(int argc, char *argv[])
 	progname = argv[0];
 	sesfile = "sessions";
 	assert( argc > 1 );
-	
+
 	mlog_init( argc, argv );
 
 	if (! inv_DEBUG_print(argc, argv))
 		return 0;
-	
+
 	optind = 1;
 	optarg = 0;
 
@@ -433,21 +433,21 @@ main(int argc, char *argv[])
 			op = WRI;
 			break;
 		      case 'r':
-			op = REC;	
+			op = REC;
 			break;
-			
+
 		      case 'q':
-			op = QUE;			
+			op = QUE;
 			break;
-			
+
 		      case 'd':
-			op = DEL;			
+			op = DEL;
 			break;
 
 		      case 'z':
 			op = MP;
 			break;
-			
+
 		      case 'g':
 			op = QUE2;
 			break;
@@ -463,7 +463,7 @@ main(int argc, char *argv[])
 		      case 's':
 			nsess = atoi(optarg);
 			break;
-			
+
 		      case 'l':
 			level = atoi(optarg);
 			break;
@@ -471,24 +471,24 @@ main(int argc, char *argv[])
 		      case 't':
 			nstreams = atoi(optarg);
 			break;
-			
+
 		      case 'm':
 			nmedia = atoi( optarg );
 			break;
 		      case 'v':
 			break;
-			
+
 		      case 'f':
 			sesfile = optarg;
 			break;
 
 		      default:
-			usage(); 
+			usage();
 			break;
 		}
 	}
-	
-	
+
+
 	if ( op == WRI )
 		rval = write_test( nsess, nstreams, nmedia, level );
 	else if ( op == QUE )
@@ -504,10 +504,10 @@ main(int argc, char *argv[])
 			rval = sess_queries_byuuid(uuid);
 		else if (label)
 			rval = sess_queries_bylabel(label);
-		}	
+		}
 	else
 		usage();
-		
+
 	if (rval < 0 )
 		printf( "aborted\n");
 	else
diff --git a/invutil/fstab.c b/invutil/fstab.c
index 4284cd1..a4333ad 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -87,7 +87,7 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
 	    memmove(fstabentry,
 		    fstabentry + 1,
 		    (sizeof(invt_fstab_t) * (fstab_file[fidx].counter->ic_curnum - fstabentry_idx - 1)));
-	    
+
 	    fstab_file[fidx].data[d->data_idx] = NULL;
 
 	    for(i = d->data_idx + 1; i < fstab_file[fidx].numrecords; i++) {
@@ -119,7 +119,7 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
 
 	/* copy new data to mmap */
 	memmove(dest, fstabentry, sizeof(*fstabentry));
-	
+
 	/* increment counter */
 	fstab_file[0].counter->ic_curnum++;
     }
@@ -137,7 +137,7 @@ fstab_select(WINDOW *win, node_t *current, node_t *list)
 	return 0;
     }
     d = (data_t *)(current->data);
-	
+
     if(d->expanded == TRUE) {
 	return menu_collapse(win, current, list);
     }
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 82d89d9..5e540a3 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -156,7 +156,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 				&ses,
 				&strms,
 				&mfiles);
-		    
+
 		    insert_stobj_into_stobjfile(dst_fileidx,
 		    		stobj_filename,
 				stobj_fd,
@@ -180,7 +180,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		tmp_parent = ((data_t *)(dst_n->data))->parent;
 		while(dst_n != NULL) {
 		    node_t *tmp_n1;
-		    
+
 		    dst_d = dst_n->data;
 
 		    /* close affected invidx file and stobj files */
@@ -221,10 +221,10 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		else {
 		    dest = invidx_file[dst_fileidx].data[invidx_file[dst_fileidx].counter->ic_curnum - 1] + 1;
 		}
-		
+
 		/* copy new data to mmap */
 		memmove(dest, inv_entry, sizeof(*inv_entry));
-	    
+
 		/* increment counter */
 		invidx_file[dst_fileidx].counter->ic_curnum++;
 
@@ -249,13 +249,13 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		    put_error("Error: unable to copy stobj file: file exists");
 		    return 0;
 		}
-	    
+
 		snprintf(cmd, sizeof(cmd), "cp %s %s", stobjfile, dst_stobjfile);
 		if(system(cmd) != 0) {
 		    put_error("Error: unable to copy stobj file: cp failed");
 		    return 0;
 		}
-	    
+
 		open_stobj(dst_stobjfile);
 		return 0;
 	    }
@@ -319,13 +319,13 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		put_error("Error: unable to copy stobj file: file exists");
 		return 0;
 	    }
-	    
+
 	    snprintf(cmd, sizeof(cmd), "cp %s %s", stobjfile, dst_stobjfile);
 	    if(system(cmd) != 0) {
 		put_error("Error: unable to copy stobj file: cp failed");
 		return 0;
 	    }
-	    
+
 	    open_stobj(dst_stobjfile);
 	    return 0;
 	}
@@ -335,7 +335,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 }
 
 int
-create_stobjfile(int invidx_fileidx, char *filename, int fname_len, 
+create_stobjfile(int invidx_fileidx, char *filename, int fname_len,
 	invt_seshdr_t *hdr, invt_session_t *ses, invt_stream_t *strms,
 	invt_mediafile_t *mfiles)
 {
@@ -386,7 +386,7 @@ read_stobj_info(int fd, int idx, invt_seshdr_t **out_hdr,
 	else {
 	    mfiles = NULL;
 	}
-    }    
+    }
     else {
 	strms = NULL;
 	mfiles = NULL;
@@ -396,7 +396,7 @@ read_stobj_info(int fd, int idx, invt_seshdr_t **out_hdr,
     *out_ses = ses;
     *out_strms = strms;
     *out_mfiles = mfiles;
-    
+
     return fd;
 }
 
@@ -461,7 +461,7 @@ update_invidx_entry(int fd, char *filename, int stobj_fd)
     /* find the start and stop in stobj file */
     lseek(stobj_fd, 0, SEEK_SET);
     read_n_bytes(stobj_fd, &sescnt, sizeof(sescnt), "stobj file");
-    
+
     memset(&hdr, 0, sizeof(hdr));
     first_offset = STOBJ_OFFSET(0,0);
     lseek(stobj_fd, first_offset, SEEK_SET);
@@ -488,7 +488,7 @@ update_invidx_entry(int fd, char *filename, int stobj_fd)
 	    return i;
 	}
     }
-    
+
     entry.ie_timeperiod.tp_start = start_time;
     entry.ie_timeperiod.tp_end = end_time;
     strcpy(entry.ie_filename, filename);
@@ -534,7 +534,7 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
 
 	for(i = pos; i < sescnt.ic_curnum; i++) {
 	    read_stobj_info(fd, i, &s_hdr, &s_ses, &s_strms, &s_mfiles);
-	    
+
 	    insert_stobj_into_stobjfile(invidx_fileidx, new_filename, new_fd, s_hdr, s_ses, s_strms, s_mfiles);
 
 	    free(s_hdr); free(s_ses); free(s_strms); free(s_mfiles);
@@ -585,7 +585,7 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
 
 static void
 stobj_makefname_len( char *fname, int fname_len )
-{	
+{
     /* come up with a new unique name */
     uuid_t	fn;
     char	str[UUID_STR_LEN + 1];
@@ -599,14 +599,14 @@ stobj_makefname_len( char *fname, int fname_len )
 int
 stobj_create( char *fname )
 {
-    int fd;	
+    int fd;
     invt_sescounter_t sescnt;
 
     /* create the new storage object */
     if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
 	return -1;
     }
-    
+
     INVLOCK( fd, LOCK_EX );
     fchmod( fd, INV_PERMS );
 
@@ -618,13 +618,13 @@ stobj_create( char *fname )
 
     lseek(fd, 0, SEEK_SET);
     write_n_bytes ( fd, (char *)&sescnt, sizeof(sescnt), "new stobj file" );
-	
+
     INVLOCK( fd, LOCK_UN );
     return fd;
 }
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
+stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles )
 {
@@ -639,7 +639,7 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 	strms[i].st_firstmfile = mfileoff + (off64_t) ((size_t) nmfiles * sizeof( invt_mediafile_t ) );
 	/* now fix the offsets in mediafiles */
 	for ( j = 0; j < strms[i].st_nmediafiles; j++ ) {
-			
+
 	    /* no need to fix the last element's next ptr */
 	    if ( j < strms[i].st_nmediafiles - 1 )
 		mfiles[ nmfiles + j ].mf_nextmf =  strms[i].st_firstmfile + (off64_t) ((j+1) * sizeof( invt_mediafile_t ));
@@ -649,11 +649,11 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		mfiles[ nmfiles + j ].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof( invt_mediafile_t ));
 	}
 
-	/* adjust the offsets of the first and the last elements 
+	/* adjust the offsets of the first and the last elements
 	   in the mediafile chain */
 	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 */
@@ -663,7 +663,7 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
     lseek(fd, mfileoff, SEEK_SET);
     write_n_bytes( fd, mfiles, nmfiles * sizeof( invt_mediafile_t ), "stobj file" );
 
-    return 1;	
+    return 1;
 }
 
 /*ARGSUSED*/
@@ -771,7 +771,7 @@ find_invidx_node(node_t *list, int inv_fileidx)
 {
     node_t *n;
     data_t *d;
-    
+
     n = list;
     while(n != NULL && n->data != NULL) {
     	d = n->data;
@@ -783,7 +783,7 @@ find_invidx_node(node_t *list, int inv_fileidx)
 	}
 	n = n->next;
     }
-    
+
     return NULL;
 }
 
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 06bdeda..e06b1f4 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -112,7 +112,7 @@ main(int argc, char *argv[])
 	    break;
 	case GETOPT_UUID:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n", 
+		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
 			 c );
@@ -133,14 +133,14 @@ main(int argc, char *argv[])
 	    break;
 	case GETOPT_CHECKPRUNEFSTAB:
 	    if (mntpnt_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n", 
+		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNEMNT,
 			 c );
 		usage();
 	    }
 	    if (uuid_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n", 
+		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_UUID,
 			 c );
@@ -167,7 +167,7 @@ main(int argc, char *argv[])
 	    break;
 	case GETOPT_PRUNEMNT:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n", 
+		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
 			 c );
@@ -355,10 +355,10 @@ ParseDate(char *strDate)
         "%b %d",
         "%B %d",
         "%m%d%H",
-        "%m%d", 
+        "%m%d",
         0};
 
-    for (fmt = &templateStr[0]; *fmt != NULL; fmt++) { 
+    for (fmt = &templateStr[0]; *fmt != NULL; fmt++) {
         memset (&tm, 0, sizeof (struct tm)); /* ensure fields init'ed */
         if (strptime(strDate, *fmt, &tm) != NULL)
             break;
@@ -371,15 +371,15 @@ ParseDate(char *strDate)
 
     if (*fmt == NULL || (date = mktime(&tm)) < 0) {
         fprintf(stderr, "%s: bad date, \"%s\"\n", g_programName, strDate );
-        usage(); 
+        usage();
     }
 
-    /* HACK to ensure tm_isdst is set BEFORE calling mktime(3) */ 
+    /* HACK to ensure tm_isdst is set BEFORE calling mktime(3) */
     if (tm.tm_isdst) {
         int dst = tm.tm_isdst;
         memset (&tm, 0, sizeof (struct tm));
         tm.tm_isdst = dst;
-        (void)strptime(strDate, *fmt, &tm); 
+        (void)strptime(strDate, *fmt, &tm);
         tm.tm_isdst = dst;
         date = mktime(&tm);
     }
@@ -423,7 +423,7 @@ GetNameOfInvIndex (char *inv_path, uuid_t uuid)
     char *name;
 
     uuid_unparse( uuid, str );
-    name = (char *) malloc( strlen( inv_path ) + 1  + strlen( str ) 
+    name = (char *) malloc( strlen( inv_path ) + 1  + strlen( str )
 			     + strlen( INV_INVINDEX_PREFIX ) + 1);
     strcpy( name, inv_path );
     strcat( name, "/" );
@@ -506,7 +506,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 		break;
 	    }
 	}
-	
+
 	if (!removeflag)
 	{
 	    bool_t IdxCheckOnly = BOOL_TRUE;
@@ -514,7 +514,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	    invname = GetNameOfInvIndex(inv_path, fstabentry[i].ft_uuid);
 
 #ifdef INV_DEBUG
-	    printf("INV_DEBUG: ft_mountpt = %s, mountPt = %s, r_mf_label = %s\n", 
+	    printf("INV_DEBUG: ft_mountpt = %s, mountPt = %s, r_mf_label = %s\n",
 		   fstabentry[i].ft_mountpt, mountPt,
 		   (r_mf_label ? r_mf_label : "(NULL)"));
 #endif
@@ -560,7 +560,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	    }
 	    counter->ic_curnum--;
 	}
-	else 
+	else
 	    i++; /* next entry if this entry not removed */
     }
 
@@ -599,7 +599,7 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 			   char *idxFileName,
 			   uuid_t *sessionp,
 			   time32_t prunetime,
-			   char *r_mf_label) 
+			   char *r_mf_label)
 {
     char	*temp;
     int		fd;
@@ -651,7 +651,7 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 		   invIndexEntry[i].ie_filename, idxFileName);
 	    printf("         removing index entry \n");
 	    removeflag = BOOL_TRUE;
-	}    
+	}
 
 	if (CheckAndPruneStObjFile(checkonly, invIndexEntry[i].ie_filename,
 		    sessionp, prunetime, r_mf_label) == -1) {
@@ -667,7 +667,7 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 	    }
 	    counter->ic_curnum--;
 	}
-	else 
+	else
 	    i++; /* next entry if this entry not removed */
     }
 
@@ -712,7 +712,7 @@ CheckAndPruneStObjFile( bool_t checkonly,
 			char *StObjFileName,
 			uuid_t *sessionp,
 			time32_t prunetime,
-		        char *r_mf_label) 
+		        char *r_mf_label)
 {
     char	response[GEN_STRLEN];
     char	*temp;
@@ -759,9 +759,9 @@ CheckAndPruneStObjFile( bool_t checkonly,
 	removeflag = BOOL_FALSE;
 	if (StObjhdr->sh_pruned)
 	    prunedcount++;
-	
+
 	if (! StObjhdr->sh_pruned) {
-	    printf("            Session %d: %s %s", 
+	    printf("            Session %d: %s %s",
 		   sescount++,
 		   StObjses->s_mountpt,
 		   ctime32(&StObjhdr->sh_time));
@@ -783,7 +783,7 @@ CheckAndPruneStObjFile( bool_t checkonly,
 	    invt_mediafile_t *StObjmed;
 
 	    if (StObjhdr->sh_pruned)
-		printf("            Pruned Session: %s %s", 
+		printf("            Pruned Session: %s %s",
 		       StObjses->s_mountpt,
 		       ctime32(&StObjhdr->sh_time));
 	    printf("\t\tdevice:\t\t%s\n", StObjses->s_devpath);
@@ -794,7 +794,7 @@ CheckAndPruneStObjFile( bool_t checkonly,
 	    printf("\t\tstreams:\t%d\n", StObjses->s_cur_nstreams );
 	    for ( i = 0; i < (int) StObjses->s_cur_nstreams; i++ ) {
 		printf( "\t\tstream %d:\n", i);
-		StObjstrm = (invt_stream_t *)(temp + 
+		StObjstrm = (invt_stream_t *)(temp +
 					      StObjhdr->sh_streams_off +
 					      (i * sizeof(invt_stream_t)));
 		printf( "\t\t\tpathname:\t%s\n",
@@ -808,7 +808,7 @@ CheckAndPruneStObjFile( bool_t checkonly,
 		printf( "\t\t\tmedia files:\t%d\n",
 			StObjstrm->st_nmediafiles);
 		for ( j = 0; j < StObjstrm->st_nmediafiles; j++) {
-		    StObjmed = (invt_mediafile_t *)(temp + 
+		    StObjmed = (invt_mediafile_t *)(temp +
 						    StObjstrm->st_firstmfile +
 						    (j * sizeof(invt_mediafile_t)));
 		    printf( "\t\t\tmfile file %d:\n", j);
@@ -828,7 +828,7 @@ CheckAndPruneStObjFile( bool_t checkonly,
         printf("INV_DEBUG: sh_time = %d, prunetime = %d\n",
 	       StObjhdr->sh_time, prunetime);
         printf("INV_DEBUG: checkonly = %d, sh_pruned = %d\n",
-               checkonly, StObjhdr->sh_pruned); 
+               checkonly, StObjhdr->sh_pruned);
 #endif
 
 	session_match = !uuid_compare(*sessionp, StObjses->s_sesid);
@@ -843,7 +843,7 @@ CheckAndPruneStObjFile( bool_t checkonly,
 	    bool_t GotResponse = BOOL_FALSE;
 
 	    uuid_unparse( StObjses->s_sesid, str );
-		
+
 	    if(force) {
 		printf("-------------------------------------------------\n");
 		printf("Pruning this matching entry:\n");
@@ -868,9 +868,9 @@ CheckAndPruneStObjFile( bool_t checkonly,
 
 		    printf("\nDo you want to prune this entry: [y/n] ");
 		    fgets( response, GEN_STRLEN, stdin );
-		    chp = strchr( response, '\n');  
+		    chp = strchr( response, '\n');
 		    if (chp)
-			*chp = '\0';   
+			*chp = '\0';
 		    if (strcasecmp( response, "Y" ) == 0) {
 			removeflag = BOOL_TRUE;
 			GotResponse = BOOL_TRUE;
@@ -944,7 +944,7 @@ uses_specified_mf_label(
 	for ( m = 0; m < StObjstrm->st_nmediafiles; m++, num_media_objects++) {
 	    StObjmed = (invt_mediafile_t *)
 		(temp + StObjstrm->st_firstmfile + (m * sizeof(invt_mediafile_t)));
-	    if (!strncmp(StObjmed->mf_label, r_mf_label, 
+	    if (!strncmp(StObjmed->mf_label, r_mf_label,
 			sizeof(StObjmed->mf_label))) {
 		printf("\t\tSpecified media label \"%s\" found - "
 			"pruning session \"%s\"\n",
@@ -1150,7 +1150,7 @@ mmap_n_bytes(int fd, size_t count, bool_t checkonly, char *path)
     temp = mmap( NULL, count,
 		 (checkonly == BOOL_TRUE) ? PROT_READ : PROT_READ|PROT_WRITE,
 		 MAP_SHARED, fd, 0 );
-	
+
     if (temp == (void *)-1) {
 	fprintf( stderr, "%s: error in mmap of %ld bytes for file %s\n",
 		 g_programName, (long) count, path);
diff --git a/invutil/menu.c b/invutil/menu.c
index f81f9b6..81baa42 100644
--- a/invutil/menu.c
+++ b/invutil/menu.c
@@ -109,7 +109,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
     int last_line;
     int size;
 
-    current = list; 
+    current = list;
     last = current;
     current_line = 0;
     last_line = current_line;
@@ -184,7 +184,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		node_t *n = current->prev;
 
 		while(n != NULL) {
-		    d = ((data_t *)(n->data)); 
+		    d = ((data_t *)(n->data));
 		    if(d == NULL) {
 			n = n->prev;
 			continue;
@@ -208,7 +208,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		node_t *n = current->next;
 
 		while(n != NULL) {
-		    d = ((data_t *)(n->data)); 
+		    d = ((data_t *)(n->data));
 		    if(d == NULL) {
 			n = n->next;
 			continue;
@@ -258,7 +258,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		}
 		i = current_line - 1;
 		while(n != NULL) {
-		    d = ((data_t *)(n->data)); 
+		    d = ((data_t *)(n->data));
 		    if(d == NULL) {
 			n = n->prev;
 			continue;
diff --git a/invutil/screen.c b/invutil/screen.c
index 6e913a7..5e478c9 100644
--- a/invutil/screen.c
+++ b/invutil/screen.c
@@ -83,6 +83,6 @@ get_string(WINDOW *win, char *prompt, char *response, int len)
     echo();
     wgetnstr(stdscr, response, len);
     noecho();
-    
+
     return 0;
 }
diff --git a/invutil/stobj.c b/invutil/stobj.c
index f389c53..582858f 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -454,7 +454,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 	parent_session = n;
 	for ( j = 0; j < (int) StObjses->s_cur_nstreams; j++ ) {
-	    StObjstrm = (invt_stream_t *)(stobj_file[idx].mapaddr + 
+	    StObjstrm = (invt_stream_t *)(stobj_file[idx].mapaddr +
 					  StObjhdr->sh_streams_off +
 					  (j * sizeof(invt_stream_t)));
 
@@ -487,10 +487,10 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 	    parent_stream = n;
 	    for ( k = 0; k < StObjstrm->st_nmediafiles; k++) {
-		StObjmed = (invt_mediafile_t *)(stobj_file[idx].mapaddr + 
+		StObjmed = (invt_mediafile_t *)(stobj_file[idx].mapaddr +
 						StObjstrm->st_firstmfile +
 						(k * sizeof(invt_mediafile_t)));
-		
+
 		len = strlen(StObjmed->mf_label) + 26;
 		txt = malloc(len);
 		if(txt == NULL) {
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index bd6f887..edcd611 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -139,7 +139,7 @@ static int _rmt_ioctl(int, unsigned int, void *);
 /*
  *	Do ioctl on file.  Looks just like ioctl(2) to caller.
  */
- 
+
 int
 rmtioctl(int fildes, unsigned int request, void *arg)
 {
@@ -159,9 +159,9 @@ rmtioctl(int fildes, unsigned int request, void *arg)
 /*
  * WARNING: MTIOCGET code is highly dependent on the format
  *          of mtget on different platforms
- *          We only support Linux 32/ia64 and IRIX 32/64 for this case. 
- *          We use the result of uname(1) (in rmtopen()) and 
- *          the size of the mtget structure to determine which 
+ *          We only support Linux 32/ia64 and IRIX 32/64 for this case.
+ *          We use the result of uname(1) (in rmtopen()) and
+ *          the size of the mtget structure to determine which
  *          architecture it is.
  */
 
@@ -178,7 +178,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 	static int onetrip = 0;
 
 	if (!onetrip) {
-		onetrip = 1; 
+		onetrip = 1;
 		init_mtop_map();
 	}
 
@@ -226,7 +226,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		 *  Grab the status and read it directly into the structure.
 		 *  Since the data is binary data, and the other machine might
 		 *  be IRIX or Linux of a different byte-order,
-		 *  we have to be careful in converting the data. 
+		 *  we have to be careful in converting the data.
 		 *
 		 *  NOTE: the original /etc/rmt did NOT support a newline after
 		 *  the S command, and Sun still does not.  Neither does the
@@ -243,7 +243,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		 * and the size of the get structure.
 		 * If we know our rmt host, then verify that the
 		 * structure is the correct size for the supported ones
-		 */ 
+		 */
  		switch (RMTHOST(fildes)) {
 		    case UNAME_UNDEFINED:
 			_rmt_msg(RMTWARN,
@@ -262,10 +262,10 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			break;
 		    case UNAME_LINUX:
 			if (sizeof(struct linux32_mtget) == rc) {
-			    islinux32 = 1;	
+			    islinux32 = 1;
 			}
 			else if (sizeof(struct linux64_mtget) == rc) {
-			    islinux32 = 0;	
+			    islinux32 = 0;
 			}
 			else {
 			    _rmt_msg(RMTWARN,
@@ -316,9 +316,9 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			struct irix_mtget *irixp = (struct irix_mtget *)irixget;
 
 			if (irixp->mt_type > 0xff) {
-			    /* assume that mt_type should fit in 1 byte */ 
+			    /* assume that mt_type should fit in 1 byte */
 
-			    irixp->mt_type   = INT_SWAP(irixp->mt_type, irixp->mt_type);	
+			    irixp->mt_type   = INT_SWAP(irixp->mt_type, irixp->mt_type);
 			    irixp->mt_dsreg  = INT_SWAP(irixp->mt_dsreg, irixp->mt_dsreg);
 			    irixp->mt_erreg  = INT_SWAP(irixp->mt_erreg, irixp->mt_erreg);
 			    irixp->mt_resid  = INT_SWAP(irixp->mt_resid, irixp->mt_resid);
@@ -330,9 +330,9 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			struct linux32_mtget *linuxp = (struct linux32_mtget *)linux32get;
 
 			if (linuxp->mt_type > 0xffff) {
-			    /* assume that mt_type should fit in 2 bytes */ 
+			    /* assume that mt_type should fit in 2 bytes */
 
-			    linuxp->mt_type   = INT_SWAP(linuxp->mt_type, linuxp->mt_type);	
+			    linuxp->mt_type   = INT_SWAP(linuxp->mt_type, linuxp->mt_type);
 			    linuxp->mt_dsreg  = INT_SWAP(linuxp->mt_dsreg, linuxp->mt_dsreg);
 			    linuxp->mt_erreg  = INT_SWAP(linuxp->mt_erreg, linuxp->mt_erreg);
 			    linuxp->mt_resid  = INT_SWAP(linuxp->mt_resid, linuxp->mt_resid);
@@ -346,9 +346,9 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			struct linux64_mtget *linuxp = (struct linux64_mtget *)linux64get;
 
 			if (linuxp->mt_type > 0xffff) {
-			    /* assume that mt_type should fit in 2 bytes */ 
+			    /* assume that mt_type should fit in 2 bytes */
 
-			    linuxp->mt_type   = INT_SWAP(linuxp->mt_type, linuxp->mt_type);	
+			    linuxp->mt_type   = INT_SWAP(linuxp->mt_type, linuxp->mt_type);
 			    linuxp->mt_dsreg  = INT_SWAP(linuxp->mt_dsreg, linuxp->mt_dsreg);
 			    linuxp->mt_erreg  = INT_SWAP(linuxp->mt_erreg, linuxp->mt_erreg);
 			    linuxp->mt_resid  = INT_SWAP(linuxp->mt_resid, linuxp->mt_resid);
@@ -359,8 +359,8 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			}
 		}
 
-		/* 
-		 * now mtget has the correct (byte-swapped if needed) data, 
+		/*
+		 * now mtget has the correct (byte-swapped if needed) data,
                  * so we just need to copy over the fields which are possibly
                  * of different length and different semantics.
 		 */
diff --git a/librmt/rmtlib.h b/librmt/rmtlib.h
index 1f877ca..6373075 100644
--- a/librmt/rmtlib.h
+++ b/librmt/rmtlib.h
@@ -51,7 +51,7 @@
  *
  *	READ --- Return the number of the read side file descriptor
  *	WRITE --- Return the number of the write side file descriptor
- *	RMTHOST --- Return an id which says host type from uname    
+ *	RMTHOST --- Return an id which says host type from uname
  */
 
 /* rmt msg types */
diff --git a/restore/bag.c b/restore/bag.c
index 55bba73..dfe7aa5 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -116,7 +116,7 @@ bag_find( bag_t *bagp,
 	      ;
 	      p = p->be_nextp )
 		;
-	
+
 	if ( ! p || p->be_key != key ) {
 		*payloadpp = 0;
 		return 0;
diff --git a/restore/content.c b/restore/content.c
index 7c4a81f..078c6b8 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -491,7 +491,7 @@ struct pers {
 
 		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 
+			 * Max possible is two per stream except the first
 			 * drive will never finish another drives file and the
 			 * last drive will never leave a file for another to
 			 * complete.
@@ -911,7 +911,7 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	int rval;
 	bool_t fullpr;
 
-	/* Calculate the size needed for the persistent inventory 
+	/* Calculate the size needed for the persistent inventory
 	 */
 	for ( perssz = pgsz; perssz < sizeof(pers_t); perssz += pgsz )
 		;
@@ -1289,7 +1289,7 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * destination directory, unless this is a toc, in which case
 	 * it will be placed in the current directory. in either case, an
 	 * alternate directory may be specified on the command line.
-	 * if this is toconly, modify the housekeeping dir's name with 
+	 * if this is toconly, modify the housekeeping dir's name with
 	 * the pid.
 	 */
 	if ( ! tranp->t_hkdir ) {
@@ -1580,7 +1580,7 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			      GETOPT_SETDM );
 			return BOOL_FALSE;
 		}
-		if ( ! restoreextattrpr && 
+		if ( ! restoreextattrpr &&
 		       persp->a.restoreextattrpr != restoreextattrpr) {
 			mlog( MLOG_NORMAL | MLOG_ERROR, _(
 			     "-%c cannot reset flag from previous restore\n"),
@@ -2759,7 +2759,7 @@ content_statline( char **linespp[ ] )
 			 (unsigned long long)tranp->t_direntcnt,
 			 elapsed );
 		assert( strlen( statline[ 0 ] ) < STATLINESZ );
-		
+
 		return 1;
 	}
 
@@ -2799,7 +2799,7 @@ content_statline( char **linespp[ ] )
 		 percent,
 		 elapsed );
 	assert( strlen( statline[ 0 ] ) < STATLINESZ );
-	
+
 	/* return buffer to caller
 	 */
 	return 1;
@@ -3547,7 +3547,7 @@ applynondirdump( drive_t *drivep,
 			 */
 			( * dop->do_get_mark )( drivep, &drivemark );
 
-			/* read the file header. 
+			/* read the file header.
 			 */
 			rv = read_filehdr( drivep, fhdrp, fhcs );
 			switch( rv ) {
@@ -3751,7 +3751,7 @@ Inv_validate_cmdline( void )
 	if ( ok && sessp ) {
 		uuid_t baseid;
 
-		uuid_clear(baseid);	
+		uuid_clear(baseid);
                 askinvforbaseof( baseid, sessp );
 		if ( ! dumpcompat( sessp->s_isresumed,
 				   ( ix_t )( sessp->s_level ),
@@ -3834,13 +3834,13 @@ Media_atnondir( Media_t *Mediap )
  * dump ID. smart enough to know that if purpose was search but is now dir,
  * current media file can be returned again. same for other transitions.
  * always traverses the media object in a forward direction, beginning with
- * current media file, wrapping around to beginning of media if necessary. 
+ * current media file, wrapping around to beginning of media if necessary.
  * also supplies fresh hdr pointers and drive manager. in current
  * implementation these do not change, but will when we use new TLM. does
  * fine positioning within media file according to purpose of request.
  *
- * Note: 
- * The difference between rval and rv. 
+ * Note:
+ * The difference between rval and rv.
  * rval is used for the drive_* functions (e.g. do_begin_read)
  * and will take on values such as DRIVE_ERROR_*.
  * However, it also set to 0 for no error and 1 for error.
@@ -4103,7 +4103,7 @@ Media_mfile_next( Media_t *Mediap,
  * pv: 766024; tes@engr
  * The setting of emptypr, in my opinion, should only happen
  * in the case that the drive does not have a tape online.
- * This corresponds to a couple of cases in prepare_drive(). 
+ * This corresponds to a couple of cases in prepare_drive().
  * Otherwise, when we go to a newmedia we won't be able to eject
  * the tape when we want/need to.
  * This may need to be reviewed in the future.
@@ -4292,7 +4292,7 @@ validate:
 				return RV_NOMORE;
 			}
 		}
-			
+
 		/* if this media file is not part of the desired dump session,
 		 * and preceeding media files on this object were, decide if
 		 * we need to rewind and look at the beginning of the object.
@@ -4699,7 +4699,7 @@ newmedia:
 			return RV_DONE;
 		}
 
-		/* if media not removable, just return 
+		/* if media not removable, just return
 		 */
 		if ( ( * dop->do_get_device_class )( drivep )
 		     ==
@@ -5486,7 +5486,7 @@ pi_addfile( Media_t *Mediap,
 					      "incorporating on-media session "
 					      "inventory into online "
 					      "inventory\n") );
-					inv_put_sessioninfo( &sessinfo ); 
+					inv_put_sessioninfo( &sessinfo );
 				}
 
 				/* convert into pi format
@@ -5807,7 +5807,7 @@ pi_seeobjstrmend( ix_t strmix, ix_t mediaix )
 	      ix++,
 	      objh = DH2O( objh )->o_nexth )
 		;
-	
+
 	/* if an empty object (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
@@ -5816,7 +5816,7 @@ pi_seeobjstrmend( ix_t strmix, ix_t mediaix )
 		return;
 	}
 
-	
+
 	/* set object flag
 	 */
 	DH2O( objh )->o_lmfknwnpr = BOOL_TRUE;
@@ -6177,7 +6177,7 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 	 * object containing the media file has not been IDed.
 	 */
 	knownobjmissingpr = BOOL_FALSE;
-	
+
 	tailegrp.eg_ino = 0;
 	tailegrp.eg_off = 0;
 
@@ -6459,7 +6459,7 @@ pi_hiteod( ix_t strmix, ix_t objix )
 		;
 	assert( objcnt != 0 );
 	lastobjix = objcnt - 1;
-	
+
 	pi_unlock( );
 
 	/* can't possibly happen, but check for case where pi indicates
@@ -6522,7 +6522,7 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
 		;
 	assert( objcnt != 0 );
 	lastobjix = objcnt - 1;
-	
+
 	pi_unlock( );
 
 	/* can't possibly happen, but check for case where pi indicates
@@ -6581,7 +6581,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
 	      objh = DH2O( objh )->o_nexth )
 		;
 	assert( objh != DH_NULL );
-	
+
 	/* if don't know last media file on object, return FALSE
 	 */
 	if ( ! DH2O( objh )->o_lmfknwnpr ) {
@@ -6617,7 +6617,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
 			}
 		}
 	}
-	
+
 	pi_unlock( );
 	return BOOL_TRUE;
 }
@@ -6660,7 +6660,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
 	      objh = DH2O( objh )->o_nexth )
 		;
 	assert( objh != DH_NULL );
-	
+
 	/* if don't know last media file on object, return FALSE
 	 */
 	if ( ! DH2O( objh )->o_lmfknwnpr ) {
@@ -6701,7 +6701,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
 			}
 		}
 	}
-	
+
 	pi_unlock( );
 	return BOOL_TRUE;
 }
@@ -7483,7 +7483,7 @@ restore_reg( drive_t *drivep,
 	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,
@@ -7654,7 +7654,7 @@ restore_extent_group( drive_t *drivep,
 	}
 
 	/* The extent group has been restored.  If the file is not
-	 * complete, we may need to co-ordinate with other restore 
+	 * complete, we may need to co-ordinate with other restore
 	 * streams to time the restoration of extended attributes
 	 * and certain extended inode flags. Register the portion
 	 * of the file completed here in the persistent state.
@@ -8027,7 +8027,7 @@ restore_symlink( drive_t *drivep,
 	if ( ! tranp->t_toconlypr && path ) {
 		/* create the symbolic link
 		 */
-		/* NOTE: There is no direct way to set mode for 
+		/* NOTE: There is no direct way to set mode for
 		 * sym links. Do it using umask.
 		 * No way of setting times for sym links.
 		 */
@@ -8067,7 +8067,7 @@ restore_symlink( drive_t *drivep,
 
 		if ( persp->a.restoredmpr) {
 		fsdmidata_t fssetdm;
-		
+
 		/*	Restore DMAPI fields. */
 
 		fssetdm.fsd_dmevmask = bstatp->bs_dmevmask;
@@ -8580,15 +8580,15 @@ restore_extent( filehdr_t *fhdrp,
 					    (remaining % da.d_miniosz != 0 ||
 					     remaining < da.d_miniosz) ) {
 						/*
-						 * Since the ring and static 
-						 * buffers from the different 
+						 * Since the ring and static
+						 * buffers from the different
 						 * drives are always large, we
-						 * just need to write to the 
-						 * end of the next block 
+						 * just need to write to the
+						 * end of the next block
 						 * boundry and truncate.
 						 */
 						rttrunc = remaining;
-						remaining += da.d_miniosz - 
+						remaining += da.d_miniosz -
 						   (remaining % da.d_miniosz);
 					}
 					/*
@@ -8784,9 +8784,9 @@ restore_extattr( drive_t *drivep,
 		if ( onlydoreadpr || tranp->t_toconlypr )
 			continue;
 
-		/* NOTE: In the cases below, if we get errors then we issue warnings 
+		/* NOTE: In the cases below, if we get errors then we issue warnings
 		 * but we do not stop the restoration.
-		 * We can still restore the file possibly without the 
+		 * We can still restore the file possibly without the
 		 * extended attributes.
 		 */
 		if ( isdirpr ) {
@@ -8817,7 +8817,7 @@ restore_extattr( drive_t *drivep,
 static bool_t
 restore_dir_extattr_cb( char *path, dah_t dah )
 {
-        /* 
+        /*
          * directory extattr's are built during the directory phase
          * by 1 thread so we only need one extattr buffer
          * -> we pick the 0th one
@@ -8919,14 +8919,14 @@ dump_partials(void)
 				printf("\tino=%llu ",
 				       (unsigned long long)isptr->is_ino);
 				for (j=0, bsptr=isptr->is_bs;
-				     j < drivecnt; 
+				     j < drivecnt;
 				     j++, bsptr++)
 				{
 					if (bsptr->endoffset > 0) {
 						printf("%d:%lld-%lld ",
 						   j, (long long)bsptr->offset,
 						   (long long)bsptr->endoffset);
-					} 
+					}
 				}
 				printf( "\n");
 			}
@@ -8965,19 +8965,19 @@ check_valid_partials(void)
 
 				isptr = &persp->a.parrest[i];
 				for (j=0, bsptr=isptr->is_bs;
-				     j < drivecnt; 
+				     j < drivecnt;
 				     j++, bsptr++)
 				{
 					if (bsptr->endoffset > 0) {
 					    num_partials[j]++;
 					    if (num_partials[j] > 2) {
 						pi_unlock();
-						mlog( MLOG_NORMAL | MLOG_WARNING, 
+						mlog( MLOG_NORMAL | MLOG_WARNING,
 		  "partial_reg: Too many partials (>2) for drive: %d\n", j);
 						dump_partials();
 						exit(EXIT_ERROR);
 					    }
-					} 
+					}
 				}
 			}
 		}
@@ -8991,7 +8991,7 @@ check_valid_partials(void)
  * a dump stream into the persistent state.
  *
  * This is done because DMAPI extended attributes must not be set until
- * the entire file has been restored in order to co-ordinate with the 
+ * the entire file has been restored in order to co-ordinate with the
  * Data Migration Facility (DMF) daemons.  Since extended attributes are
  * recorded with each extent group in the dump, this registry is used to
  * make sure only the final dump stream applies the extended attributes.
@@ -9000,10 +9000,10 @@ check_valid_partials(void)
  * should only be set after all data for a file has been restored.
  */
 static void
-partial_reg( ix_t d_index, 
-	     xfs_ino_t ino, 
-	     off64_t fsize, 
-	     off64_t offset, 
+partial_reg( ix_t d_index,
+	     xfs_ino_t ino,
+	     off64_t fsize,
+	     off64_t offset,
 	     off64_t sz)
 {
 	off64_t	endoffset;
@@ -9012,7 +9012,7 @@ partial_reg( ix_t d_index,
 	int i;
 
 	mlog(MLOG_NITTY, "partial_reg: d_index = %d, ino = %llu, "
-                           "fsize = %lld, offset = %lld, sz = %lld\n", 
+                           "fsize = %lld, offset = %lld, sz = %lld\n",
                            d_index, ino, fsize, offset, sz);
 
 	endoffset = offset + sz;
@@ -9023,7 +9023,7 @@ partial_reg( ix_t d_index,
 	pi_lock();
 
 	/* Search for a matching inode.  Gaps can exist so we must search
-	 * all entries. 
+	 * all entries.
 	 */
 	for (i=0; i < partialmax; i++ ) {
 		if (persp->a.parrest[i].is_ino == ino) {
@@ -9126,7 +9126,7 @@ partial_check (xfs_ino_t ino, off64_t fsize)
 	}
 
 	/* Search for the inode.  Gaps can exist so we must search
-	 * all entries. 
+	 * all entries.
 	 */
 	for (i=0; i < partialmax; i++ ) {
 		if (persp->a.parrest[i].is_ino == ino) {
@@ -9171,9 +9171,9 @@ gapsearch:
 	 * so the search is repeated from the start each time.
 	 */
 	for (i=0, bsptr=isptr->is_bs; i < drivecnt; i++, bsptr++) {
-		if (bsptr->endoffset > 0 && 
-		    bsptr->offset <= curoffset && 
-		    bsptr->endoffset > curoffset) 
+		if (bsptr->endoffset > 0 &&
+		    bsptr->offset <= curoffset &&
+		    bsptr->endoffset > curoffset)
 		{
 			curoffset = bsptr->endoffset;
 			goto gapsearch;
@@ -9237,7 +9237,7 @@ content_overwrite_ok( char *path,
 		return BOOL_FALSE;
 	}
 
-	/* if newer time specified, compare 
+	/* if newer time specified, compare
 	 */
 	if ( persp->a.newerpr ) {
 		if ( ( time32_t )ctime < persp->a.newertime ) {
@@ -9661,7 +9661,7 @@ display_needed_objects( purp_t purp,
 	if ( knownholespr ) {
 		if ( purp == PURP_DIR ) {
 			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
-			      bagp ? 
+			      bagp ?
 			      _("\nthere are additional unidentified media "
 			      "objects containing media files not yet tried "
 			      "for directory hierarchy restoral:\n")
@@ -9690,7 +9690,7 @@ display_needed_objects( purp_t purp,
 			      _("\nthere may be unidentified media "
 			      "objects containing media files not yet tried "
 			      "for directory hierarchy restoral:\n") );
-			      
+
 		}
 		if ( purp == PURP_NONDIR ) {
 			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
diff --git a/restore/dirattr.c b/restore/dirattr.c
index 7a423ab..f057b78 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -105,7 +105,7 @@
 struct dirattr {
 #ifdef DIRATTRCHK
 	uint16_t d_unq;
-	uint16_t d_sum; 
+	uint16_t d_sum;
 #endif /* DIRATTRCHK */
 	mode_t d_mode;
 	uid_t d_uid;
@@ -395,7 +395,7 @@ dirattr_add( filehdr_t *fhdrp )
 	uint16_t sum;
 #endif /* DIRATTRCHK */
 	dah_t dah;
-	
+
 	/* sanity checks
 	 */
 	assert( dtp );
diff --git a/restore/inomap.c b/restore/inomap.c
index fd55907..5f81897 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -427,7 +427,7 @@ inomap_sync_pers( char *hkdir )
 						 SEGPERHNK * ( hnkcnt - 1 )
 						 -
 						 1 ) ];
-	
+
 	/* now all inomap operators will work
 	 */
 	return BOOL_TRUE;
diff --git a/restore/namreg.c b/restore/namreg.c
index 97e6524..8e7ff76 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -261,7 +261,7 @@ namreg_add( char *name, size_t namelen )
 	off64_t oldoff;
 	unsigned char c;
 	nrh_t nrh;
-	
+
 	/* sanity checks
 	 */
 	assert( ntp );
@@ -476,7 +476,7 @@ namreg_get( nrh_t nrh,
 	/* null-terminate the string if room
 	 */
 	bufp[ len ] = 0;
-	
+
 	unlock( );
 
 	return ( int )len;
diff --git a/restore/node.c b/restore/node.c
index 92a21ce..b6b6906 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -376,7 +376,7 @@ node_init( int fd,
 		  node_hdrp->nh_firstsegoff,
 		  segsz,
 		  winmapmax );
-	
+
 	/* announce the results
 	 */
 	mlog( MLOG_DEBUG | MLOG_TREE,
diff --git a/restore/tree.c b/restore/tree.c
index 0336e77..bc948fc 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -65,7 +65,7 @@
 
 /* structure definitions used locally ****************************************/
 
-/* name of persistent state file 
+/* name of persistent state file
  */
 #define PERS_NAME	"tree"
 
@@ -228,7 +228,7 @@ typedef struct node node_t;
 	 * longer exists or it has not changed. if it is referenced, we assume
 	 * it exists, in which case if it is not dumped then all of its entries
 	 * are referenced as well.
-	 */ 
+	 */
 #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.
@@ -462,7 +462,7 @@ tree_init( char *hkdir,
 	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, 
+	ok = node_init( tranp->t_persfd,
 		        nodeoff,
 		        NODESZ,
 			 ( ix_t )offsetofmember( node_t, n_nodehkbyte ),
@@ -875,7 +875,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 			nh_t renameh;
 			node_t *renamep;
 			/* REFERENCED */
-			int namebuflen; 
+			int namebuflen;
 
 			hardp->n_flags |= NF_REFED;
 			if ( hardp->n_parh == persp->p_orphh ) {
@@ -1620,7 +1620,7 @@ mkdirs_recurse( nh_t parh, nh_t cldh, char *path )
 				      "mkdir %s failed: %s\n"),
 				      path,
 				      strerror( errno ));
-				
+
 			} else {
 				cldp = Node_map( cldh );
 				cldp->n_flags |= NF_REAL;
@@ -1644,7 +1644,7 @@ mkdirs_recurse( nh_t parh, nh_t cldh, char *path )
 		 */
 		cldh = nextcldh;
 	}
-	
+
 	return BOOL_TRUE;
 }
 
@@ -1845,7 +1845,7 @@ tree_cb_links( xfs_ino_t ino,
 				if ( ! tranp->t_toconlypr && exists ) {
 					rval = unlink( path );
 					if ( rval && errno != ENOENT ) {
-						mlog( MLOG_NORMAL | 
+						mlog( MLOG_NORMAL |
 						      MLOG_WARNING, _(
 						      "unable to unlink "
 						      "current file prior to "
@@ -1904,17 +1904,17 @@ tree_cb_links( xfs_ino_t ino,
 			 * with 'orphanage' the file is one of two
 			 * things:
 			 * 1) It's a file that really is an
-			 * orphanage file from a previous restore 
+			 * orphanage file from a previous restore
 			 * that has now ended up on this dump tape.
 			 * We don't really want to restore this file
-			 * but, it's harmless to do so, it should 
-			 * happen rarely, and the path name is 
+			 * but, it's harmless to do so, it should
+			 * happen rarely, and the path name is
 			 * indistinguishable from ...
 			 * 2) A file whose name was never resolved
 			 * from root because of file corruption.
-			 * Some granparent dir (parent dir of it's 
-			 * parent dir) was corrupted so the code that 
-			 * walks the trees was thus never able to set 
+			 * Some granparent dir (parent dir of it's
+			 * parent dir) was corrupted so the code that
+			 * walks the trees was thus never able to set
 			 * the NF_SUBTREE flag.  It then ends up here
 			 * with a non-resolved name but a valid
 			 * hard reference.  We really need to give
@@ -1923,7 +1923,7 @@ 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,
 				      "discarding %llu %u\n",
@@ -1947,12 +1947,12 @@ 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, 
+				ok = ( * funcp )( contextp, path == path2,
 					path1, path2 );
 				if ( ! ok ) {
 					return RV_NOTOK;
 				}
-			} 
+			}
 		} else {
 			mlog( MLOG_VERBOSE | MLOG_NOTE | MLOG_TREE, _(
 			      "ino %llu gen %u not referenced: "
@@ -1967,7 +1967,7 @@ tree_cb_links( xfs_ino_t ino,
 			if (nh == NH_NULL) {
 				mlog( MLOG_ERROR | MLOG_TREE, _(
 				"node allocation failed when placing ino %llu"
-				" in orphanage\n"), ino); 
+				" in orphanage\n"), ino);
 				return RV_ERROR; /* allocation failed */
 			}
 			link_in( nh );
@@ -2117,7 +2117,7 @@ tree_extattr_recurse( nh_t parh,
 	} else {
 		ok = BOOL_TRUE;
 	}
-	
+
 	return ok;
 }
 
@@ -2148,7 +2148,7 @@ proc_hardlinks( char *path1, char *path2 )
 /* called for every hard head
  *
  * tes@sgi.com:
- * This code processes the hardlinks, extracting out a 
+ * This code processes the hardlinks, extracting out a
  * src_list - real & !ref
  * dest_list - !real & ref
  * The src_list are the entries to delete and the dst_list
@@ -2224,7 +2224,7 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 			Node_free( &nh );
 			continue;
 		}
-		
+
 		/* not real, refed, but not selected, can't help
 		 */
 		if ( ! isrealpr &&   isrefpr && ! isselpr ) {
@@ -2356,7 +2356,7 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 			successpr = BOOL_TRUE;
 		}
 
-		/* tes@sgi.com: note: loop of one iteration only 
+		/* tes@sgi.com: note: loop of one iteration only
 		 */
 		while ( ! successpr && lnsrch != NH_NULL ) {
 			ok = Node2path( lnsrch, phcbp->path1, _("link") );
@@ -2813,7 +2813,7 @@ restart:
 		mlog( MLOG_NORMAL, _("Unmark and quit\n") );
 		selsubtree( persp->p_rooth , BOOL_FALSE );
 	}
-	    
+
 	return BOOL_TRUE;
 }
 
@@ -3668,7 +3668,7 @@ disown( nh_t cldh )
 		parp->n_cldh = cldp->n_sibh;
 		if ( cldp->n_sibh != NH_NULL ) {
 			node_t *sibp = Node_map( cldp->n_sibh );
-			sibp->n_sibprevh = NH_NULL; 
+			sibp->n_sibprevh = NH_NULL;
 			Node_unmap( cldp->n_sibh, &sibp );
 		}
 	} else {
@@ -3681,13 +3681,13 @@ disown( nh_t cldh )
 		prevcldp = Node_map( prevcldh );
 
 		/* fix up previous */
-		prevcldp->n_sibh = cldp->n_sibh; 
+		prevcldp->n_sibh = cldp->n_sibh;
 		Node_unmap( prevcldh, &prevcldp  );
 
 		/* fix up next */
 		if ( cldp->n_sibh != NH_NULL ) {
 			node_t *sibp = Node_map( cldp->n_sibh );
-			sibp->n_sibprevh = prevcldh; 
+			sibp->n_sibprevh = prevcldh;
 			Node_unmap( cldp->n_sibh, &sibp );
 		}
 	}
@@ -4027,7 +4027,7 @@ link_iter_next( link_iter_context_t *link_iter_contextp )
 	if ( link_iter_contextp->li_donepr == BOOL_TRUE ) {
 		return NH_NULL;
 	}
-		
+
 	/* if no hardhead, done
 	 */
 	if ( link_iter_contextp->li_headh == NH_NULL ) {
@@ -4242,7 +4242,7 @@ hash_in( nh_t nh )
 	/* get ino from node
 	 */
 	ino = np->n_ino;
-	
+
 	/* assert not already in
 	 */
 	assert( hash_find( np->n_ino, np->n_gen ) == NH_NULL );
@@ -4292,7 +4292,7 @@ hash_out( nh_t nh )
 	 */
 	hashheadh = *entryp;
 	assert( hashheadh != NH_NULL );
-	
+
 	/* if node is first in list, replace entry with following node.
 	 * otherwise, walk the list until found.
 	 */
@@ -4339,7 +4339,7 @@ hash_find( xfs_ino_t ino, gen_t gen )
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE,
 	     "hash_find(%llu,%u): traversing hash link list\n",
-		ino, gen); 
+		ino, gen);
 #endif
 
 	/* walk the list until found.
@@ -4842,9 +4842,9 @@ collapse_white( char *string, char *liter )
 	for ( s = string, l = liter ; is_white( *s ) && ! *l ; s++, l++ ) {
 		cnt++;
 	}
-	
+
 	string[ 0 ] = ' ';
-	
+
 	if ( cnt > 1 ) {
 		shrink( &string[ 1 ], cnt - 1 );
 		shrink( &liter[ 1 ], cnt - 1 );
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 02/24] xfsdump: do not split function call with ifdef
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
  2018-11-09 14:29 ` [PATCH 01/24] xfsdump: (style) remove trailing whitespaces Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 04/24] xfsdump: (2/4)(style) remove spaces from parentheses Jan Tulak
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

In two files in xfsdump, a function call is split in half by an ifdef
macro to conditionally pick an argument at compile time. This causes the
code to be a bit less obvious and some analysis tools have trouble with
understanding it.

So, instead of splitting the function in half, move the whole function
call into each of the ifdef macros.

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/drive_minrmt.c | 3 ++-
 common/main.c         | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 59a40a7..04fed3e 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -2585,11 +2585,12 @@ read_label( drive_t *drivep )
 	if (( nread == 0 )  /* takes care of sun */
 	      ||            /* now handle SGI */
 	      (nread < 0 && saved_errno == ENOSPC )) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
 #ifdef DUMP
+		mlog( MLOG_NORMAL | MLOG_DRIVE,
 		      _("encountered EOD : assuming blank media\n") );
 #endif
 #ifdef RESTORE
+		mlog( MLOG_NORMAL | MLOG_DRIVE,
 		      _("encountered EOD : end of data\n") );
 #endif
 		( void )rewind_and_verify( drivep );
diff --git a/common/main.c b/common/main.c
index b3605d1..0c23eb4 100644
--- a/common/main.c
+++ b/common/main.c
@@ -581,12 +581,14 @@ main( int argc, char *argv[] )
 		sigaction( SIGTERM, &sa, NULL );
 		sigaction( SIGQUIT, &sa, NULL );
 
+#ifdef DUMP
 		ok = drive_init2( argc,
 				  argv,
-#ifdef DUMP
 				  gwhdrtemplatep );
 #endif /* DUMP */
 #ifdef RESTORE
+		ok = drive_init2( argc,
+				  argv,
 				  ( global_hdr_t * )0 );
 #endif /* RESTORE */
 		if ( ! ok ) {
@@ -629,12 +631,14 @@ main( int argc, char *argv[] )
 	 * time-consuming chore. drive_init3 will synchronize with each slave.
 	 */
 	if ( ! init_error ) {
+#ifdef DUMP
 		ok = drive_init2( argc,
 				  argv,
-#ifdef DUMP
 				  gwhdrtemplatep );
 #endif /* DUMP */
 #ifdef RESTORE
+		ok = drive_init2( argc,
+				  argv,
 				  ( global_hdr_t * )0 );
 #endif /* RESTORE */
 		if ( ! ok ) {
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 04/24] xfsdump: (2/4)(style) remove spaces from parentheses
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
  2018-11-09 14:29 ` [PATCH 01/24] xfsdump: (style) remove trailing whitespaces Jan Tulak
  2018-11-09 14:29 ` [PATCH 02/24] xfsdump: do not split function call with ifdef Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 06/24] xfsdump: (4/4)(style) " Jan Tulak
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: 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)'

# regexps in order:
# - remove spaces after opening parentheses (
# - remove spaces before closing parentheses )
# - remove spaces after opening brackets [
# - remove spaces before closing brackets ]

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/(\s\+/(/g" \
    -e "s/\(\S\)\s\+)/\1)/g" \
    -e "s/\[\s\+/[/g" \
    -e "s/\(\S\)\s\+\]/\1]/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 dump/content.c | 3644 ++++++++++++++++++++++++------------------------
 dump/getopt.h  |    2 +-
 dump/inomap.c  |  768 +++++-----
 dump/inomap.h  |   32 +-
 dump/var.c     |   96 +-
 dump/var.h     |    4 +-
 6 files changed, 2273 insertions(+), 2273 deletions(-)

diff --git a/dump/content.c b/dump/content.c
index ecc867d..81159ee 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -109,7 +109,7 @@ struct mark {
 
 typedef struct mark mark_t;
 
-/* Media_mfile_begin( ) entry state.
+/* Media_mfile_begin() entry state.
  */
 enum bes { BES_INIT,	/* in the beginning */
 	   BES_ENDOK,   /* last media file successfully flushed to media */
@@ -197,7 +197,7 @@ typedef struct context context_t;
 #define BMAP_LEN	512
 
 struct extent_group_context {
-	getbmapx_t eg_bmap[ BMAP_LEN ];
+	getbmapx_t eg_bmap[BMAP_LEN];
 	getbmapx_t *eg_nextbmapp;	/* ptr to the next extent to dump */
 	getbmapx_t *eg_endbmapp;		/* to detect extent exhaustion */
 	int eg_fd;			/* file desc. */
@@ -208,27 +208,27 @@ struct extent_group_context {
 typedef struct extent_group_context extent_group_context_t;
 
 
-/* minimum getdents( ) buffer size
+/* minimum getdents() buffer size
  */
-#define GETDENTSBUF_SZ_MIN	( 2 * pgsz )
+#define GETDENTSBUF_SZ_MIN	(2 * pgsz)
 
 
 /* minimum sizes for extended attributes buffers
  */
-#define EXTATTR_LISTBUF_SZ	( XATTR_LIST_MAX )
-#define EXTATTR_RTRVARRAY_LEN	( 1 * pgsz )
-#define EXTATTR_DUMPBUF_SZ	( 4 * pgsz )
+#define EXTATTR_LISTBUF_SZ	(XATTR_LIST_MAX)
+#define EXTATTR_RTRVARRAY_LEN	(1 * pgsz)
+#define EXTATTR_DUMPBUF_SZ	(4 * pgsz)
 
 /* for printing ext attr namespace
  */
-#define EXTATTR_NAMESPACE(flag)	( ((flag) & ATTR_ROOT) ? _("root") : \
-				( ((flag) & ATTR_SECURE) ? _("secure") : \
-				  _("non-root") ) )
+#define EXTATTR_NAMESPACE(flag)	(((flag) & ATTR_ROOT) ? _("root") : \
+				(((flag) & ATTR_SECURE) ? _("secure") : \
+				  _("non-root")) )
 
 /* for printing file type
  */
-#define FILETYPE(statp)		( ( (statp)->bs_mode & S_IFMT ) == S_IFDIR \
-				  ? _("dir") : _("nondir") )
+#define FILETYPE(statp)		(((statp)->bs_mode & S_IFMT) == S_IFDIR \
+				  ? _("dir") : _("nondir"))
 
 /* per-drive status descriptor
  */
@@ -248,8 +248,8 @@ typedef struct pds pds_t;
 
 /* declarations of externally defined global symbols *************************/
 
-extern void usage( void );
-extern bool_t preemptchk( int );
+extern void usage(void);
+extern bool_t preemptchk(int);
 extern char *homedir;
 extern bool_t pipeline;
 extern bool_t stdoutpiped;
@@ -261,51 +261,51 @@ extern size_t pgsz;
 
 /* file dumpers
  */
-static rv_t dump_dirs( ix_t strmix,
+static rv_t dump_dirs(ix_t strmix,
 		       xfs_bstat_t *bstatbufp,
 		       size_t bstatbuflen,
-		       void *inomap_contextp );
-static rv_t dump_dir( ix_t strmix,
+		       void *inomap_contextp);
+static rv_t dump_dir(ix_t strmix,
 		      jdm_fshandle_t *,
 		      int,
-		      xfs_bstat_t * );
-static rv_t dump_file( void *,
+		      xfs_bstat_t *);
+static rv_t dump_file(void *,
 		       jdm_fshandle_t *,
 		       int,
-		       xfs_bstat_t * );
-static rv_t dump_file_reg( drive_t *drivep,
+		       xfs_bstat_t *);
+static rv_t dump_file_reg(drive_t *drivep,
 			   context_t *contextp,
 			   content_inode_hdr_t *scwhdrp,
 			   jdm_fshandle_t *,
 			   xfs_bstat_t *,
 			   bool_t *);
-static rv_t dump_file_spec( drive_t *drivep,
+static rv_t dump_file_spec(drive_t *drivep,
 			    context_t *contextp,
 			    jdm_fshandle_t *,
-			    xfs_bstat_t * );
-static rv_t dump_filehdr( drive_t *drivep,
+			    xfs_bstat_t *);
+static rv_t dump_filehdr(drive_t *drivep,
 			  context_t *contextp,
 			  xfs_bstat_t *,
 			  off64_t,
-			  int );
-static rv_t dump_extenthdr( drive_t *drivep,
+			  int);
+static rv_t dump_extenthdr(drive_t *drivep,
 			    context_t *contextp,
 			    int32_t,
 			    int32_t,
 			    off64_t,
-			    off64_t );
-static rv_t dump_dirent( drive_t *drivep,
+			    off64_t);
+static rv_t dump_dirent(drive_t *drivep,
 			 context_t *contextp,
 			 xfs_bstat_t *,
 			 xfs_ino_t,
 			 gen_t,
 			 char *,
-			 size_t );
-static rv_t init_extent_group_context( jdm_fshandle_t *,
+			 size_t);
+static rv_t init_extent_group_context(jdm_fshandle_t *,
 				       xfs_bstat_t *,
-				       extent_group_context_t * );
-static void cleanup_extent_group_context( extent_group_context_t * );
-static rv_t dump_extent_group( drive_t *drivep,
+				       extent_group_context_t *);
+static void cleanup_extent_group_context(extent_group_context_t *);
+static rv_t dump_extent_group(drive_t *drivep,
 			       context_t *contextp,
 			       xfs_bstat_t *,
 			       extent_group_context_t *,
@@ -314,70 +314,70 @@ static rv_t dump_extent_group( drive_t *drivep,
 			       bool_t,
 			       off64_t *,
 			       off64_t *,
-			       bool_t * );
-static bool_t dump_session_inv( drive_t *drivep,
+			       bool_t *);
+static bool_t dump_session_inv(drive_t *drivep,
 			        context_t *contextp,
 			        media_hdr_t *mwhdrp,
-			        content_inode_hdr_t *scwhdrp );
-static rv_t write_pad( drive_t *drivep, size_t );
+			        content_inode_hdr_t *scwhdrp);
+static rv_t write_pad(drive_t *drivep, size_t);
 
-static void mark_callback( void *, drive_markrec_t *, bool_t );
+static void mark_callback(void *, drive_markrec_t *, bool_t);
 
-static void inv_cleanup( void );
-static void dump_terminator( drive_t *drivep,
+static void inv_cleanup(void);
+static void dump_terminator(drive_t *drivep,
 			     context_t *contextp,
-			     media_hdr_t *mwhdrp );
-static rv_t Media_mfile_begin( drive_t *drivep,
+			     media_hdr_t *mwhdrp);
+static rv_t Media_mfile_begin(drive_t *drivep,
 			       context_t *contextp,
-			       bool_t intr_allowed );
-static rv_t Media_mfile_end( drive_t *drivep,
+			       bool_t intr_allowed);
+static rv_t Media_mfile_end(drive_t *drivep,
 			     context_t *contextp,
 			     media_hdr_t *mwhdrp,
 			     off64_t *ncommittedp,
-			     bool_t hit_eom );
-static bool_t Media_prompt_overwrite( drive_t *drivep );
-static rv_t Media_erasechk( drive_t *drivep,
+			     bool_t hit_eom);
+static bool_t Media_prompt_overwrite(drive_t *drivep);
+static rv_t Media_erasechk(drive_t *drivep,
 			    int dcaps,
 			    bool_t intr_allowed,
-			    bool_t prevmediapresentpr );
-static bool_t Media_prompt_erase( drive_t *drivep );
-static char *Media_prompt_label( drive_t *drivep, char *bufp, size_t bufsz );
-static void update_cc_Media_useterminatorpr( drive_t *drivep,
-					     context_t *contextp );
-static void set_mcflag( ix_t thrdix );
-static void clr_mcflag( ix_t thrdix );
+			    bool_t prevmediapresentpr);
+static bool_t Media_prompt_erase(drive_t *drivep);
+static char *Media_prompt_label(drive_t *drivep, char *bufp, size_t bufsz);
+static void update_cc_Media_useterminatorpr(drive_t *drivep,
+					     context_t *contextp);
+static void set_mcflag(ix_t thrdix);
+static void clr_mcflag(ix_t thrdix);
 
-static bool_t check_complete_flags( void );
+static bool_t check_complete_flags(void);
 
-static rv_t dump_extattrs( drive_t *drivep,
+static rv_t dump_extattrs(drive_t *drivep,
 			   context_t *contextp,
 	       		   jdm_fshandle_t *fshandlep,
 			   xfs_bstat_t *statp);
-static rv_t dump_extattr_list( drive_t *drivep,
+static rv_t dump_extattr_list(drive_t *drivep,
 			       context_t *contextp,
 	       		       jdm_fshandle_t *fshandlep,
 			       xfs_bstat_t *statp,
 			       attrlist_t *listp,
 			       int flag,
-			       bool_t *abortprp );
-static char *dump_extattr_buildrecord( xfs_bstat_t *statp,
+			       bool_t *abortprp);
+static char *dump_extattr_buildrecord(xfs_bstat_t *statp,
 				       char *dumpbufp,
 				       char *dumpbufendp,
 				       char *namesrcp,
 				       uint32_t valuesz,
 				       int flag,
-				       char **valuepp );
-static rv_t dump_extattrhdr( drive_t *drivep,
+				       char **valuepp);
+static rv_t dump_extattrhdr(drive_t *drivep,
 			     context_t *contextp,
 			     xfs_bstat_t *statp,
 			     size_t recsz,
 			     size_t valoff,
 			     ix_t flags,
-			     uint32_t valsz );
+			     uint32_t valsz);
 
-static bool_t save_quotas( char *mntpnt,
-			   quota_info_t *quotainfo );
-static int getxfsqstat( char *fsdev );
+static bool_t save_quotas(char *mntpnt,
+			   quota_info_t *quotainfo);
+static int getxfsqstat(char *fsdev);
 
 
 
@@ -448,7 +448,7 @@ static size64_t sc_stat_inomapdone;
 static size64_t sc_stat_dircnt = 0;
 	/* total number of directory inodes to be dumped (strm 0)
 	 */
-static pds_t sc_stat_pds[ STREAM_SIMMAX ];
+static pds_t sc_stat_pds[STREAM_SIMMAX];
 	/* per-drive stream status
 	 */
 static size64_t sc_stat_nondircnt = 0;
@@ -470,13 +470,13 @@ static size_t sc_thrdsarrivedcnt = 0;
 	 */
 static size_t sc_thrdsdonecnt = 0;
 	/* number of threads which are ready to dump the session inventory.
-	 * when equal to the number of streams remaining (stream_cnt( )),
+	 * when equal to the number of streams remaining (stream_cnt()),
 	 * can proceed with inventory dumps
 	 */
 static context_t *sc_contextp;
 	/* an array of per-stream context descriptors
 	 */
-static bool_t sc_mcflag[ STREAM_SIMMAX ];
+static bool_t sc_mcflag[STREAM_SIMMAX];
 	/* media change flag
 	 */
 static bool_t sc_dumpextattrpr = BOOL_TRUE;
@@ -512,9 +512,9 @@ static bool_t create_inv_session(
 		size_t strmix);
 
 bool_t
-content_init( int argc,
-	      char *argv[ ],
-	      global_hdr_t *gwhdrtemplatep )
+content_init(int argc,
+	      char *argv[],
+	      global_hdr_t *gwhdrtemplatep)
 {
 
 	inv_idbtoken_t inv_idbt;
@@ -528,13 +528,13 @@ content_init( int argc,
 	ix_t subtreeix;
 	bool_t resumereqpr = BOOL_FALSE;
 	char *srcname;
-	char mntpnt[ GLOBAL_HDR_STRING_SZ ];
-	char fsdevice[ GLOBAL_HDR_STRING_SZ ];
-	char fstype[ CONTENT_HDR_FSTYPE_SZ ];
+	char mntpnt[GLOBAL_HDR_STRING_SZ];
+	char fsdevice[GLOBAL_HDR_STRING_SZ];
+	char fstype[CONTENT_HDR_FSTYPE_SZ];
 	bool_t skip_unchanged_dirs = BOOL_FALSE;
 	uuid_t fsid;
 	bool_t underfoundpr;
-	ix_t underlevel = ( ix_t )( -1 );
+	ix_t underlevel = (ix_t)(-1);
 	time32_t undertime = 0;
 	uuid_t underid;
 	bool_t underpartialpr = BOOL_FALSE;
@@ -566,27 +566,27 @@ content_init( int argc,
 
 	/* basic sanity checks
 	 */
-	assert( sizeof( mode_t ) == MODE_SZ );
-	assert( sizeof( timestruct_t ) == TIMESTRUCT_SZ );
-	assert( sizeof( bstat_t ) == BSTAT_SZ );
-	assert( sizeof( filehdr_t ) == FILEHDR_SZ );
-	assert( sizeof( extenthdr_t ) == EXTENTHDR_SZ );
-	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
-	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
-	assert( DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0 );
-	assert( sizeofmember( content_hdr_t, ch_specific )
+	assert(sizeof(mode_t) == MODE_SZ);
+	assert(sizeof(timestruct_t) == TIMESTRUCT_SZ);
+	assert(sizeof(bstat_t) == BSTAT_SZ);
+	assert(sizeof(filehdr_t) == FILEHDR_SZ);
+	assert(sizeof(extenthdr_t) == EXTENTHDR_SZ);
+	assert(sizeof(direnthdr_t) == DIRENTHDR_SZ);
+	assert(sizeof(direnthdr_v1_t) == DIRENTHDR_SZ);
+	assert(DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0);
+	assert(sizeofmember(content_hdr_t, ch_specific)
 		>=
-		sizeof( content_inode_hdr_t ));
-	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
+		sizeof(content_inode_hdr_t));
+	assert(sizeof(extattrhdr_t) == EXTATTRHDR_SZ);
 
 	/* calculate offsets of portions of the write hdr template
 	 */
-	dwhdrtemplatep = ( drive_hdr_t * )gwhdrtemplatep->gh_upper;
-	mwhdrtemplatep = ( media_hdr_t * )dwhdrtemplatep->dh_upper;
-	cwhdrtemplatep = ( content_hdr_t * )mwhdrtemplatep->mh_upper;
-	scwhdrtemplatep = ( content_inode_hdr_t * ) cwhdrtemplatep->ch_specific;
+	dwhdrtemplatep = (drive_hdr_t *)gwhdrtemplatep->gh_upper;
+	mwhdrtemplatep = (media_hdr_t *)dwhdrtemplatep->dh_upper;
+	cwhdrtemplatep = (content_hdr_t *)mwhdrtemplatep->mh_upper;
+	scwhdrtemplatep = (content_inode_hdr_t *) cwhdrtemplatep->ch_specific;
 
-	if ( gwhdrtemplatep->gh_version < GLOBAL_HDR_VERSION_3 ) {
+	if (gwhdrtemplatep->gh_version < GLOBAL_HDR_VERSION_3) {
 		sc_use_old_direntpr = BOOL_TRUE;
 	}
 
@@ -596,61 +596,61 @@ content_init( int argc,
 	opterr = 0;
 	subtreecnt = 0;
 	baseuuidvalpr = BOOL_FALSE;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_LEVEL:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			sc_level = ( ix_t )atoi( optarg );
-			if ( sc_level > LEVEL_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			sc_level = (ix_t)atoi(optarg);
+			if (sc_level > LEVEL_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument must be "
 				      "between 0 and %d\n"),
 				      c,
-				      LEVEL_MAX );
-				usage( );
+				      LEVEL_MAX);
+				usage();
 				return BOOL_FALSE;
 			}
 			break;
 		case GETOPT_SUBTREE:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
-			if ( optarg[ 0 ] == '/' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (optarg[0] == '/') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument (subtree) "
 				      "must be a relative pathname\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			subtreecnt++;
 			break;
 		case GETOPT_MAXDUMPFILESIZE:
-			if ( ! optarg || optarg [ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg [0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			maxdumpfilesize = strtoull(optarg, NULL, 0);
-			if ( maxdumpfilesize == 0 ||
+			if (maxdumpfilesize == 0 ||
 			     maxdumpfilesize > ULONGLONG_MAX / 1024 ||
-			     ( maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE ) ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			     (maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE) ) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument is not a valid file size\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			maxdumpfilesize *= 1024;
@@ -671,11 +671,11 @@ content_init( int argc,
 			sc_preerasepr = BOOL_TRUE;
 			break;
 		case GETOPT_ALERTPROG:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					"-%c argument missing\n"),
-				    c );
-				usage( );
+				    c);
+				usage();
 				return BOOL_FALSE;
 			}
 			media_change_alert_program = optarg;
@@ -687,32 +687,32 @@ content_init( int argc,
 			sc_dumpasoffline = BOOL_TRUE;
 			break;
 		case GETOPT_BASED:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument missing\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			baseuuidstr = optarg;
 
-			if ( uuid_parse( baseuuidstr, baseuuid ) < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (uuid_parse(baseuuidstr, baseuuid) < 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "-%c argument not a valid "
 				      "dump session id\n"),
-				      c );
-				usage( );
+				      c);
+				usage();
 				return BOOL_FALSE;
 			}
 			baseuuidvalpr = BOOL_TRUE;
 		}
 	}
 
-	if ( resumereqpr && baseuuidvalpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (resumereqpr && baseuuidvalpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "may not specify both -%c and -%c\n"),
 		      GETOPT_BASED,
-		      GETOPT_RESUME );
+		      GETOPT_RESUME);
 		return BOOL_FALSE;
 	}
 
@@ -720,44 +720,44 @@ content_init( int argc,
 	 * dash ('-') with no option letter. This must appear between
 	 * all lettered arguments and the source file system pathname.
 	 */
-	if ( optind < argc && ! strcmp( argv[ optind ], "-" )) {
+	if (optind < argc && ! strcmp(argv[optind], "-")) {
 		optind++;
 	}
 
 	/* the last argument must be either the mount point or a
 	 * device pathname of the file system to be dumped.
 	 */
-	if ( optind >= argc ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (optind >= argc) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "source file system "
-		      "not specified\n") );
-		usage( );
+		      "not specified\n"));
+		usage();
 		return BOOL_FALSE;
 	}
-	srcname = argv[ optind ];
+	srcname = argv[optind];
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* allocate space for the subtree pointer array and load it
 	 */
-	if ( subtreecnt ) {
-		subtreep = ( char ** )calloc( subtreecnt, sizeof( char * ));
-		assert( subtreep );
+	if (subtreecnt) {
+		subtreep = (char **)calloc(subtreecnt, sizeof(char *));
+		assert(subtreep);
 		optind = 1;
 		opterr = 0;
 		subtreeix = 0;
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-			switch ( c ) {
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+			switch (c) {
 			case GETOPT_SUBTREE:
-				assert( subtreeix < subtreecnt );
-				assert( optarg && optarg[ 0 ] != '-' );
-				subtreep[ subtreeix++ ] = optarg;
+				assert(subtreeix < subtreecnt);
+				assert(optarg && optarg[0] != '-');
+				subtreep[subtreeix++] = optarg;
 				break;
 			}
 		}
-		assert( subtreeix == subtreecnt );
+		assert(subtreeix == subtreecnt);
 	} else {
 		subtreep = 0;
 	}
@@ -769,20 +769,20 @@ content_init( int argc,
 	 * system ID (uuid). returns BOOL_FALSE if the last
 	 * argument doesn't look like a file system.
 	 */
-	if ( ! fs_info( fstype,
-			sizeof( fstype ),
+	if (! fs_info(fstype,
+			sizeof(fstype),
 			FS_DEFAULT,
 			fsdevice,
-			sizeof( fsdevice ),
+			sizeof(fsdevice),
 			mntpnt,
-			sizeof( mntpnt ),
+			sizeof(mntpnt),
 			&fsid,
-			srcname )) {
+			srcname)) {
 
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "%s does not identify a file system\n"),
-		      srcname );
-		usage( );
+		      srcname);
+		usage();
 		return BOOL_FALSE;
 	}
 
@@ -790,49 +790,49 @@ content_init( int argc,
 	 * to mount an unmounted file system on a temporary mount point,
 	 * if it is not currently mounted.
 	 */
-	if ( ! fs_mounted( fstype, fsdevice, mntpnt, &fsid )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (! fs_mounted(fstype, fsdevice, mntpnt, &fsid)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "%s must be mounted to be dumped\n"),
-		      srcname );
+		      srcname);
 		return BOOL_FALSE;
 	}
 
 	/* place the fs info in the write hdr template
 	 */
-	( void )strncpyterm( cwhdrtemplatep->ch_mntpnt,
+	(void)strncpyterm(cwhdrtemplatep->ch_mntpnt,
 			     mntpnt,
-			     sizeof( cwhdrtemplatep->ch_mntpnt ));
-	( void )strncpyterm( cwhdrtemplatep->ch_fsdevice,
+			     sizeof(cwhdrtemplatep->ch_mntpnt));
+	(void)strncpyterm(cwhdrtemplatep->ch_fsdevice,
 			     fsdevice,
-			     sizeof( cwhdrtemplatep->ch_fsdevice ));
-	( void )strncpyterm( cwhdrtemplatep->ch_fstype,
+			     sizeof(cwhdrtemplatep->ch_fsdevice));
+	(void)strncpyterm(cwhdrtemplatep->ch_fstype,
 			     fstype,
-			     sizeof( cwhdrtemplatep->ch_fstype ));
-	uuid_copy( cwhdrtemplatep->ch_fsid, fsid );
+			     sizeof(cwhdrtemplatep->ch_fstype));
+	uuid_copy(cwhdrtemplatep->ch_fsid, fsid);
 
 	/* write quota information */
-	if( sc_savequotas ) {
+	if(sc_savequotas) {
 
 		sc_savequotas = BOOL_FALSE;
 		for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
 			quotas[i].savequotas = BOOL_FALSE;
-			qstat = getxfsqstat( fsdevice );
-			if (qstat > 0 && (qstat & quotas[i].statflag) ) {
-				sprintf( quotas[i].quotapath, "%s/%s", mntpnt, quotas[i].quotafile );
-				if( save_quotas( mntpnt, &quotas[i] )) {
-					if( subtreecnt ) {
+			qstat = getxfsqstat(fsdevice);
+			if (qstat > 0 && (qstat & quotas[i].statflag)) {
+				sprintf(quotas[i].quotapath, "%s/%s", mntpnt, quotas[i].quotafile);
+				if(save_quotas(mntpnt, &quotas[i])) {
+					if(subtreecnt) {
 						subtreecnt++;
-						subtreep = (char **) realloc( subtreep,
+						subtreep = (char **) realloc(subtreep,
 								subtreecnt * sizeof(char *));
-						assert( subtreep );
-						subtreep[ subtreecnt - 1 ] = quotas[i].quotafile;
+						assert(subtreep);
+						subtreep[subtreecnt - 1] = quotas[i].quotafile;
 					}
 					sc_savequotas = BOOL_TRUE;
 					quotas[i].savequotas = BOOL_TRUE;
 				} else {
-					mlog( MLOG_NORMAL | MLOG_ERROR, _(
+					mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					      "failed to save %s information, continuing\n"),
-					      quotas[i].desc );
+					      quotas[i].desc);
 				}
 			}
 		}
@@ -841,7 +841,7 @@ content_init( int argc,
 
 	/* create my /var directory if it doesn't already exist.
 	 */
-	var_create( );
+	var_create();
 
 	/* get two session descriptors from the inventory: one for the last
 	 * dump at this level, and one for the last dump at a lower level.
@@ -851,23 +851,23 @@ content_init( int argc,
 	 * will give us a change date for all other inos.
 	 */
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* briefly open the online dump inventory, so it can be used
 	 * to calculate incremental and resumed dumps.
 	 */
-	inv_idbt = inv_open( ( inv_predicate_t )INV_BY_UUID,
+	inv_idbt = inv_open((inv_predicate_t)INV_BY_UUID,
 			     INV_SEARCH_ONLY,
-			     ( void * )&fsid );
+			     (void *)&fsid);
 
 	/* if a based request, look for the indicated session.
 	 * if found, and not interrupted, this will be used as an
 	 * incremental base. if interrupted, will be used as
 	 * resume base.
 	 */
-	if ( baseuuidvalpr ) {
+	if (baseuuidvalpr) {
 		ix_t strix;
 		ix_t strcnt;
 		inv_stream_t *bsp;
@@ -880,53 +880,53 @@ content_init( int argc,
 		interruptedpr = BOOL_FALSE;
 
 		ok = inv_get_session_byuuid(&fsid, &baseuuid, &sessp);
-		if ( ! ok ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+		if (! ok) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "could not find specified base dump (%s) "
 			      "in inventory\n"),
-			      baseuuidstr );
+			      baseuuidstr);
 			return BOOL_FALSE;
 		}
-		strcnt =  ( ix_t )sessp->s_nstreams;
-		for ( strix = 0 ; strix < strcnt ; strix++ ) {
-			bsp = &sessp->s_streams[ strix ];
-			if ( bsp->st_interrupted ) {
+		strcnt =  (ix_t)sessp->s_nstreams;
+		for (strix = 0 ; strix < strcnt ; strix++) {
+			bsp = &sessp->s_streams[strix];
+			if (bsp->st_interrupted) {
 				interruptedpr = BOOL_TRUE;
 				break;
 			}
 		}
 
-		if ( interruptedpr ) {
-			sc_level = ( ix_t )sessp->s_level;
+		if (interruptedpr) {
+			sc_level = (ix_t)sessp->s_level;
 			resumereqpr = BOOL_TRUE;
 			samefoundpr = BOOL_TRUE;
 			sametime = sessp->s_time;
 			uuid_copy (sameid, sessp->s_sesid);
 			samepartialpr = sessp->s_ispartial;
 			sameinterruptedpr = BOOL_TRUE;
-			sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
-			sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
-								sizeof( drange_t ));
-			assert( sc_resumerangep );
-			for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
+			sc_resumerangecnt =  (size_t)sessp->s_nstreams;
+			sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
+								sizeof(drange_t));
+			assert(sc_resumerangep);
+			for (strmix = 0 ; strmix < sc_resumerangecnt ; strmix++) {
 				inv_stream_t *bsp;
 				inv_stream_t *esp;
-				drange_t *p = &sc_resumerangep[ strmix ];
-				bsp = &sessp->s_streams[ strmix ];
-				esp = ( strmix < sc_resumerangecnt - 1 )
+				drange_t *p = &sc_resumerangep[strmix];
+				bsp = &sessp->s_streams[strmix];
+				esp = (strmix < sc_resumerangecnt - 1)
 				      ?
 				      bsp + 1
 				      :
 				      0;
-				if ( bsp->st_interrupted ) {
+				if (bsp->st_interrupted) {
 					sameinterruptedpr = BOOL_TRUE;
 					p->dr_begin.sp_ino = bsp->st_endino;
 					p->dr_begin.sp_offset = bsp->st_endino_off;
-					if ( esp ) {
+					if (esp) {
 						p->dr_end.sp_ino = esp->st_startino;
 						p->dr_end.sp_offset =
 								esp->st_startino_off;
-						mlog( MLOG_DEBUG,
+						mlog(MLOG_DEBUG,
 						      "resume range stream %u "
 						      "ino %llu:%lld to "
 						      "%llu:%lld\n",
@@ -934,16 +934,16 @@ content_init( int argc,
 						      p->dr_begin.sp_ino,
 						      p->dr_begin.sp_offset,
 						      p->dr_end.sp_ino,
-						      p->dr_end.sp_offset );
+						      p->dr_end.sp_offset);
 					} else {
 						p->dr_end.sp_flags = STARTPT_FLAGS_END;
-						mlog( MLOG_DEBUG,
+						mlog(MLOG_DEBUG,
 						      "resume range stream %u "
 						      "ino %llu:%lld to "
 						      "end\n",
 						      strmix,
 						      p->dr_begin.sp_ino,
-						      p->dr_begin.sp_offset );
+						      p->dr_begin.sp_offset);
 					}
 				} else {
 					/* set the range start pt's END flag to
@@ -953,27 +953,27 @@ content_init( int argc,
 				}
 			}
 		} else {
-			if ( sessp->s_level >= LEVEL_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			if (sessp->s_level >= LEVEL_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot select dump session %d as base "
 				      "for incremental dump: "
 				      "level must be less than %d\n"),
 				      sessp->s_level,
-				      LEVEL_MAX );
+				      LEVEL_MAX);
 				return BOOL_FALSE;
 			}
-			sc_level = ( ix_t )sessp->s_level + 1;
+			sc_level = (ix_t)sessp->s_level + 1;
 			undertime = sessp->s_time;
-			underlevel = ( ix_t )sessp->s_level;
+			underlevel = (ix_t)sessp->s_level;
 			uuid_copy (underid, sessp->s_sesid);
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
 			underfoundpr = BOOL_TRUE;
 		}
-		inv_free_session( &sessp );
+		inv_free_session(&sessp);
 		sessp = 0;
-		ok = inv_close( inv_idbt );
-		assert( ok );
+		ok = inv_close(inv_idbt);
+		assert(ok);
 		inv_idbt = INV_TOKEN_NULL;
 		goto baseuuidbypass;
 	}
@@ -983,41 +983,41 @@ content_init( int argc,
 	 * and interrupted.
 	 */
 	underfoundpr = BOOL_FALSE;
-	if ( sc_level > 0 ) {
-		if ( inv_idbt == INV_TOKEN_NULL ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (sc_level > 0) {
+		if (inv_idbt == INV_TOKEN_NULL) {
+			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			      "cannot calculate incremental dump: "
-			      "online inventory not available\n") );
+			      "online inventory not available\n"));
 			return BOOL_FALSE;
 		}
 		ok = inv_lastsession_level_lessthan(&fsid,
 						    inv_idbt,
 						    (u_char_t)sc_level,
 						    &sessp);
-		if ( ! ok ) {
+		if (! ok) {
 			sessp = 0;
 		}
 
-		if ( sessp ) {
+		if (sessp) {
 			ix_t strix;
 			ix_t strcnt;
 			inv_stream_t *bsp;
 
 			undertime = sessp->s_time;
-			underlevel = ( ix_t )sessp->s_level;
+			underlevel = (ix_t)sessp->s_level;
 			uuid_copy (underid, sessp->s_sesid);
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
-			strcnt =  ( ix_t )sessp->s_nstreams;
-			for ( strix = 0 ; strix < strcnt ; strix++ ) {
-				bsp = &sessp->s_streams[ strix ];
-				if ( bsp->st_interrupted ) {
+			strcnt =  (ix_t)sessp->s_nstreams;
+			for (strix = 0 ; strix < strcnt ; strix++) {
+				bsp = &sessp->s_streams[strix];
+				if (bsp->st_interrupted) {
 					underinterruptedpr = BOOL_TRUE;
 					break;
 				}
 			}
 			underfoundpr = BOOL_TRUE;
-			inv_free_session( & sessp );
+			inv_free_session(& sessp);
 			sessp = 0;
 		}
 	}
@@ -1027,16 +1027,16 @@ content_init( int argc,
 	 * and interrupted, and for each stream the range of ino/offset
 	 * values not dumped.
 	 */
-	if ( inv_idbt != INV_TOKEN_NULL ) {
+	if (inv_idbt != INV_TOKEN_NULL) {
 		/* REFERENCED */
 		bool_t ok1;
 		ok = inv_lastsession_level_equalto(&fsid,
 						   inv_idbt,
 						   (u_char_t)sc_level,
 						   &sessp);
-		ok1 = inv_close( inv_idbt );
-		assert( ok1 );
-		if ( ! ok ) {
+		ok1 = inv_close(inv_idbt);
+		assert(ok1);
+		if (! ok) {
 			sessp = 0;
 		}
 		inv_idbt = INV_TOKEN_NULL;
@@ -1045,34 +1045,34 @@ content_init( int argc,
 	}
 
 	samefoundpr = BOOL_FALSE;
-	if ( sessp ) {
+	if (sessp) {
 		sametime = sessp->s_time;
 		uuid_copy(sameid, sessp->s_sesid);
 		samepartialpr = sessp->s_ispartial;
 		sameinterruptedpr = BOOL_FALSE;
-		sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
-		sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
-						        sizeof( drange_t ));
-		assert( sc_resumerangep );
-		for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
+		sc_resumerangecnt =  (size_t)sessp->s_nstreams;
+		sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
+						        sizeof(drange_t));
+		assert(sc_resumerangep);
+		for (strmix = 0 ; strmix < sc_resumerangecnt ; strmix++) {
 			inv_stream_t *bsp;
 			inv_stream_t *esp;
-			drange_t *p = &sc_resumerangep[ strmix ];
-			bsp = &sessp->s_streams[ strmix ];
-			esp = ( strmix < sc_resumerangecnt - 1 )
+			drange_t *p = &sc_resumerangep[strmix];
+			bsp = &sessp->s_streams[strmix];
+			esp = (strmix < sc_resumerangecnt - 1)
 			      ?
 			      bsp + 1
 			      :
 			      0;
-			if ( bsp->st_interrupted ) {
+			if (bsp->st_interrupted) {
 				sameinterruptedpr = BOOL_TRUE;
 				p->dr_begin.sp_ino = bsp->st_endino;
 				p->dr_begin.sp_offset = bsp->st_endino_off;
-				if ( esp ) {
+				if (esp) {
 					p->dr_end.sp_ino = esp->st_startino;
 					p->dr_end.sp_offset =
 							esp->st_startino_off;
-					mlog( MLOG_DEBUG,
+					mlog(MLOG_DEBUG,
 					      "resume range stream %u "
 					      "ino %llu:%lld to "
 					      "%llu:%lld\n",
@@ -1080,16 +1080,16 @@ content_init( int argc,
 					      p->dr_begin.sp_ino,
 					      p->dr_begin.sp_offset,
 					      p->dr_end.sp_ino,
-					      p->dr_end.sp_offset );
+					      p->dr_end.sp_offset);
 				} else {
 					p->dr_end.sp_flags = STARTPT_FLAGS_END;
-					mlog( MLOG_DEBUG,
+					mlog(MLOG_DEBUG,
 					      "resume range stream %u "
 					      "ino %llu:%lld to "
 					      "end\n",
 					      strmix,
 					      p->dr_begin.sp_ino,
-					      p->dr_begin.sp_offset );
+					      p->dr_begin.sp_offset);
 				}
 			} else {
 				/* set the range start pt's END flag to
@@ -1098,7 +1098,7 @@ content_init( int argc,
 				p->dr_begin.sp_flags = STARTPT_FLAGS_END;
 			}
 		}
-		inv_free_session( & sessp );
+		inv_free_session(& sessp);
 		sessp = 0;
 		samefoundpr = BOOL_TRUE;
 	}
@@ -1107,166 +1107,166 @@ baseuuidbypass:
 
 	/* now determine the incremental and resume bases, if any.
 	 */
-	if ( samefoundpr && ! sameinterruptedpr ) {
-		free( ( void * )sc_resumerangep );
+	if (samefoundpr && ! sameinterruptedpr) {
+		free((void *)sc_resumerangep);
 		sc_resumerangep = 0;
 		samefoundpr = BOOL_FALSE;
 	}
-	if ( samefoundpr && ! resumereqpr ) {
-		if ( ! underfoundpr || undertime <= sametime ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+	if (samefoundpr && ! resumereqpr) {
+		if (! underfoundpr || undertime <= sametime) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "most recent level %d dump "
 			      "was interrupted, "
 			      "but not resuming that dump since "
 			      "resume (-R) option not specified\n"),
-			      sc_level );
+			      sc_level);
 		}
-		free( ( void * )sc_resumerangep );
+		free((void *)sc_resumerangep);
 		sc_resumerangep = 0;
 		samefoundpr = BOOL_FALSE;
 	}
-	if ( underfoundpr ) {
-		assert( underlevel <= LEVEL_MAX );
-		assert( undertime );
-		if ( samefoundpr ) {
-			if ( undertime >= sametime ) {
-				if ( underinterruptedpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (underfoundpr) {
+		assert(underlevel <= LEVEL_MAX);
+		assert(undertime);
+		if (samefoundpr) {
+			if (undertime >= sametime) {
+				if (underinterruptedpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "most recent base for "
 					      "incremental dump was "
 					      "interrupted (level %u): "
 					      "must resume or redump "
 					      "at or below level %d\n"),
 					      underlevel,
-					      sc_level );
+					      sc_level);
 					return BOOL_FALSE;
 				}
-				if ( subtreecnt && ! underpartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (subtreecnt && ! underpartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "subtree dump "
 					      "will be based on non-subtree "
 					      "level %u dump\n"),
 					      sc_level,
-					      underlevel );
+					      underlevel);
 				}
-				if ( ! subtreecnt && underpartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (! subtreecnt && underpartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "non-subtree dump "
 					      "will be based on subtree "
 					      "level %u dump\n"),
 					      sc_level,
-					      underlevel );
+					      underlevel);
 				}
 				sc_incrpr = BOOL_TRUE;
 				sc_incrbasetime = undertime;
 				sc_incrbaselevel = underlevel;
 				uuid_copy(sc_incrbaseid, underid);
 				sc_resumepr = BOOL_FALSE;
-				assert( sc_resumerangep );
-				free( ( void * )sc_resumerangep );
+				assert(sc_resumerangep);
+				free((void *)sc_resumerangep);
 				sc_resumerangep = 0;
 			} else {
-				if ( subtreecnt && ! samepartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (subtreecnt && ! samepartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "subtree dump "
 					      "will be based on non-subtree "
 					      "level %u resumed dump\n"),
 					      sc_level,
-					      sc_level );
+					      sc_level);
 				}
-				if ( ! subtreecnt && samepartialpr ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				if (! subtreecnt && samepartialpr) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "level %u incremental "
 					      "non-subtree dump "
 					      "will be based on subtree "
 					      "level %u resumed dump\n"),
 					      sc_level,
-					      sc_level );
+					      sc_level);
 				}
-				assert( sametime );
+				assert(sametime);
 				sc_incrpr = BOOL_TRUE;
 				sc_incrbasetime = undertime;
 				sc_incrbaselevel = underlevel;
 				sc_resumepr = BOOL_TRUE;
 				sc_resumebasetime = sametime;
 				uuid_copy(sc_resumebaseid, sameid);
-				assert( sc_resumerangep );
+				assert(sc_resumerangep);
 			}
 		} else {
-			if ( underinterruptedpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (underinterruptedpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "most recent base for "
 				      "incremental dump was "
 				      "interrupted (level %u): "
 				      "must resume or redump "
 				      "at or below level %d\n"),
 				      underlevel,
-				      sc_level );
+				      sc_level);
 				return BOOL_FALSE;
 			}
-			if ( subtreecnt && ! underpartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (subtreecnt && ! underpartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u incremental "
 				      "subtree dump "
 				      "will be based on non-subtree "
 				      "level %u dump\n"),
 				      sc_level,
-				      underlevel );
+				      underlevel);
 			}
-			if ( ! subtreecnt && underpartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (! subtreecnt && underpartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u incremental "
 				      "non-subtree dump "
 				      "will be based on subtree "
 				      "level %u dump\n"),
 				      sc_level,
-				      underlevel );
+				      underlevel);
 			}
 			sc_incrpr = BOOL_TRUE;
 			sc_incrbasetime = undertime;
 			sc_incrbaselevel = underlevel;
 			uuid_copy(sc_incrbaseid, underid);
 			sc_resumepr = BOOL_FALSE;
-			assert( ! sc_resumerangep );
+			assert(! sc_resumerangep);
 		}
 	} else {
-		if ( samefoundpr ) {
-			assert( sametime );
-			if ( subtreecnt && ! samepartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if (samefoundpr) {
+			assert(sametime);
+			if (subtreecnt && ! samepartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u "
 				      "subtree dump "
 				      "will be based on non-subtree "
 				      "level %u resumed dump\n"),
 				      sc_level,
-				      sc_level );
+				      sc_level);
 			}
-			if ( ! subtreecnt && samepartialpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (! subtreecnt && samepartialpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u "
 				      "non-subtree dump "
 				      "will be based on subtree "
 				      "level %u resumed dump\n"),
 				      sc_level,
-				      sc_level );
+				      sc_level);
 			}
 			sc_incrpr = BOOL_FALSE;
 			sc_resumepr = BOOL_TRUE;
 			sc_resumebasetime = sametime;
 			uuid_copy(sc_resumebaseid, sameid);
-			assert( sc_resumerangep );
+			assert(sc_resumerangep);
 		} else {
 			sc_incrpr = BOOL_FALSE;
 			sc_resumepr = BOOL_FALSE;
-			assert( ! sc_resumerangep );
-			if ( sc_level > 0 ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR, _(
+			assert(! sc_resumerangep);
+			if (sc_level > 0) {
+				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot find earlier dump "
 				      "to base level %d increment upon\n"),
-				      sc_level );
+				      sc_level);
 				return BOOL_FALSE;
 			}
 		}
@@ -1274,38 +1274,38 @@ baseuuidbypass:
 
 	/* don't allow interrupted dumps of a lesser level to be bases
 	 */
-	if ( sc_incrpr && underinterruptedpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (sc_incrpr && underinterruptedpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "most recent base dump (level %d begun %s) "
 		      "was interrupted: aborting\n"),
 		      sc_incrbaselevel,
-		      ctimennl( &sc_incrbasetime ));
+		      ctimennl(&sc_incrbasetime));
 		return BOOL_FALSE;
 	}
 
 	/* reject if resume (-R) specified, but base was not interrupted
 	 */
-	if ( ! sc_resumepr && resumereqpr ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR, _(
+	if (! sc_resumepr && resumereqpr) {
+		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 		      "resume (-R) option inappropriate: "
 		      "no interrupted level %d dump to resume\n"),
-		      sc_level );
+		      sc_level);
 		return BOOL_FALSE;
 	}
 
 	/* announce the dump characteristics
 	 */
-	if ( sc_incrpr ) {
-		if ( sc_resumepr ) {
-			char restimestr[ 30 ];
-			char incrtimestr[ 30 ];
+	if (sc_incrpr) {
+		if (sc_resumepr) {
+			char restimestr[30];
+			char incrtimestr[30];
 
-			strcpy( restimestr, ctimennl( &sc_resumebasetime ));
-			assert( strlen( restimestr ) < sizeof( restimestr ));
-			strcpy( incrtimestr, ctimennl( &sc_incrbasetime ));
-			assert( strlen( incrtimestr ) < sizeof( incrtimestr ));
+			strcpy(restimestr, ctimennl(&sc_resumebasetime));
+			assert(strlen(restimestr) < sizeof(restimestr));
+			strcpy(incrtimestr, ctimennl(&sc_incrbasetime));
+			assert(strlen(incrtimestr) < sizeof(incrtimestr));
 
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "resuming level %d incremental dump of %s:%s "
 			      "begun %s "
 			      "(incremental base level %d begun %s)\n"),
@@ -1314,70 +1314,70 @@ baseuuidbypass:
 			      mntpnt,
 			      restimestr,
 			      sc_incrbaselevel,
-			      incrtimestr );
+			      incrtimestr);
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "level %d incremental dump of %s:%s "
 			      "based on level %d dump begun %s\n"),
 			      sc_level,
 			      gwhdrtemplatep->gh_hostname,
 			      mntpnt,
 			      sc_incrbaselevel,
-			      ctimennl( &sc_incrbasetime ));
+			      ctimennl(&sc_incrbasetime));
 		}
 	} else {
-		if ( sc_resumepr ) {
-			mlog( MLOG_VERBOSE, _(
+		if (sc_resumepr) {
+			mlog(MLOG_VERBOSE, _(
 			      "resuming level %d dump of %s:%s begun %s\n"),
 			      sc_level,
 			      gwhdrtemplatep->gh_hostname,
 			      mntpnt,
-			      ctimennl( &sc_resumebasetime ));
+			      ctimennl(&sc_resumebasetime));
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "level %d dump of %s:%s\n"),
 			      sc_level,
 			      gwhdrtemplatep->gh_hostname,
-			      mntpnt );
+			      mntpnt);
 		}
 	}
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* announce the dump time
 	 */
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "dump date: %s\n"),
-	      ctimennl( &gwhdrtemplatep->gh_timestamp ));
+	      ctimennl(&gwhdrtemplatep->gh_timestamp));
 
 	/* display the session UUID
 	 */
 	{
 		char string_uuid[UUID_STR_LEN + 1];
-		uuid_unparse( gwhdrtemplatep->gh_dumpid, string_uuid );
-		mlog( MLOG_VERBOSE, _(
+		uuid_unparse(gwhdrtemplatep->gh_dumpid, string_uuid);
+		mlog(MLOG_VERBOSE, _(
 		      "session id: %s\n"),
-		      string_uuid );
+		      string_uuid);
 	}
 
 	/* display the session label
 	 */
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "session label: \"%s\"\n"),
-	      gwhdrtemplatep->gh_dumplabel );
+	      gwhdrtemplatep->gh_dumplabel);
 
 	/* get a file descriptor for the file system. any file
 	 * contained in the file system will do; use the mntpnt.
 	 * needed by bigstat.
 	 */
-	sc_fsfd = open( mntpnt, O_RDONLY );
-	if ( sc_fsfd < 0 ) {
-		mlog( MLOG_NORMAL, _(
+	sc_fsfd = open(mntpnt, O_RDONLY);
+	if (sc_fsfd < 0) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to open %s: %s\n"),
 		      mntpnt,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -1393,16 +1393,16 @@ baseuuidbypass:
 		xfs_fsop_bulkreq_t bulkreq;
 
 		/* Get the inode of the mount point */
-		rval = fstat64( sc_fsfd, &rootstat );
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _(
+		rval = fstat64(sc_fsfd, &rootstat);
+		if (rval) {
+			mlog(MLOG_NORMAL, _(
 			      "could not stat %s\n"),
-			      mntpnt );
+			      mntpnt);
 			return BOOL_FALSE;
 		}
 		sc_rootxfsstatp =
-			( xfs_bstat_t * )calloc( 1, sizeof( xfs_bstat_t ));
-		assert( sc_rootxfsstatp );
+			(xfs_bstat_t *)calloc(1, sizeof(xfs_bstat_t));
+		assert(sc_rootxfsstatp);
 
 		/* Get the first valid (i.e. root) inode in this fs */
 		bulkreq.lastip = (__u64 *)&lastino;
@@ -1410,13 +1410,13 @@ baseuuidbypass:
 		bulkreq.ubuffer = sc_rootxfsstatp;
 		bulkreq.ocount = &ocount;
 		if (ioctl(sc_fsfd, XFS_IOC_FSBULKSTAT, &bulkreq) < 0) {
-			mlog( MLOG_ERROR,
+			mlog(MLOG_ERROR,
 			      _("failed to get bulkstat information for root inode\n"));
 			return BOOL_FALSE;
 		}
 
 		if (sc_rootxfsstatp->bs_ino != rootstat.st_ino)
-			mlog ( MLOG_NORMAL | MLOG_NOTE,
+			mlog (MLOG_NORMAL | MLOG_NOTE,
 			       _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
 			         sc_rootxfsstatp->bs_ino, rootstat.st_ino);
 	}
@@ -1424,16 +1424,16 @@ baseuuidbypass:
 	/* alloc a file system handle, to be used with the jdm_open()
 	 * functions.
 	 */
-	sc_fshandlep = jdm_getfshandle( mntpnt );
-	if ( ! sc_fshandlep ) {
-		mlog( MLOG_NORMAL, _(
+	sc_fshandlep = jdm_getfshandle(mntpnt);
+	if (! sc_fshandlep) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to construct a file system handle for %s: %s\n"),
 		      mntpnt,
-		      strerror( errno ));
+		      strerror(errno));
 		return BOOL_FALSE;
 	}
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
@@ -1454,11 +1454,11 @@ baseuuidbypass:
 	 * until the startpoints are copied into each streams header. will
 	 * be freed at the end of this function.
 	 */
-	sc_stat_inomapcnt = ( size64_t )fs_getinocnt( mntpnt );
+	sc_stat_inomapcnt = (size64_t)fs_getinocnt(mntpnt);
 
-	sc_startptp = ( startpt_t * )calloc( drivecnt, sizeof( startpt_t ));
-	assert( sc_startptp );
-	ok = inomap_build( sc_fshandlep,
+	sc_startptp = (startpt_t *)calloc(drivecnt, sizeof(startpt_t));
+	assert(sc_startptp);
+	ok = inomap_build(sc_fshandlep,
 			   sc_fsfd,
 			   sc_rootxfsstatp,
 			   sc_incrpr,
@@ -1475,58 +1475,58 @@ baseuuidbypass:
 			   &sc_stat_inomapphase,
 			   &sc_stat_inomappass,
 			   sc_stat_inomapcnt,
-			   &sc_stat_inomapdone );
-	free( ( void * )subtreep );
+			   &sc_stat_inomapdone);
+	free((void *)subtreep);
 	subtreep = 0;
-	if ( ! ok ) {
+	if (! ok) {
 		return BOOL_FALSE;
 	}
 
 	/* ask var to ask inomap to skip files under var if var is in
 	 * the fs being dumped
 	 */
-	var_skip( &fsid, inomap_skip );
+	var_skip(&fsid, inomap_skip);
 
 	/* fill in write header template content info. always produce
 	 * an inomap for each media file. the dirdump flag will be set
 	 * in content_stream_dump() for streams which dump the directories.
 	 */
-	assert( sizeof( cwhdrtemplatep->ch_specific ) >= sizeof( *scwhdrtemplatep ));
+	assert(sizeof(cwhdrtemplatep->ch_specific) >= sizeof(*scwhdrtemplatep));
 	scwhdrtemplatep->cih_mediafiletype = CIH_MEDIAFILETYPE_DATA;
-	scwhdrtemplatep->cih_level = ( int32_t )sc_level;
+	scwhdrtemplatep->cih_level = (int32_t)sc_level;
 	scwhdrtemplatep->cih_dumpattr = CIH_DUMPATTR_INOMAP;
-	if ( subtreecnt ) {
+	if (subtreecnt) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_SUBTREE;
 	}
-	if ( sc_inv_updatepr ) {
+	if (sc_inv_updatepr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_INVENTORY;
 	}
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_FILEHDR_CHECKSUM;
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_EXTENTHDR_CHECKSUM;
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_DIRENTHDR_CHECKSUM;
 	scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_DIRENTHDR_GEN;
-	if ( sc_incrpr ) {
+	if (sc_incrpr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_INCREMENTAL;
 		scwhdrtemplatep->cih_last_time = sc_incrbasetime;
 		uuid_copy(scwhdrtemplatep->cih_last_id, sc_incrbaseid);
-		if ( skip_unchanged_dirs ) {
+		if (skip_unchanged_dirs) {
 			scwhdrtemplatep->cih_dumpattr |=
 				CIH_DUMPATTR_NOTSELFCONTAINED;
 		}
 	}
-	if ( sc_resumepr ) {
+	if (sc_resumepr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_RESUME;
 		scwhdrtemplatep->cih_resume_time = sc_resumebasetime;
 		uuid_copy(scwhdrtemplatep->cih_resume_id, sc_resumebaseid);
 	}
-	if ( sc_dumpextattrpr ) {
+	if (sc_dumpextattrpr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_EXTATTR;
 		scwhdrtemplatep->cih_dumpattr |=
 					CIH_DUMPATTR_EXTATTRHDR_CHECKSUM;
 	}
 
 	scwhdrtemplatep->cih_rootino = sc_rootxfsstatp->bs_ino;
-	inomap_writehdr( scwhdrtemplatep );
+	inomap_writehdr(scwhdrtemplatep);
 
 	/* log the dump size. just a rough approx.
 	 */
@@ -1534,9 +1534,9 @@ baseuuidbypass:
 	nondircnt = scwhdrtemplatep->cih_inomap_nondircnt;
 	datasz = scwhdrtemplatep->cih_inomap_datasz;
 	inocnt = dircnt + nondircnt;
-	inomapsz = inomap_getsz( );
-	direntsz = inocnt * ( uint64_t )( DIRENTHDR_SZ + 8 );
-	filesz = inocnt * ( uint64_t )( FILEHDR_SZ + EXTENTHDR_SZ );
+	inomapsz = inomap_getsz();
+	direntsz = inocnt * (uint64_t)(DIRENTHDR_SZ + 8);
+	filesz = inocnt * (uint64_t)(FILEHDR_SZ + EXTENTHDR_SZ);
 
 	hdr_mfilesz =	GLOBAL_HDR_SZ
 			+
@@ -1548,27 +1548,27 @@ baseuuidbypass:
 			filesz
 			+
 			datasz;
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "estimated dump size: %llu bytes\n"),
-	      size_estimate );
+	      size_estimate);
 
 	if (drivecnt > 1) {
-	    mlog( MLOG_VERBOSE, _(
+	    mlog(MLOG_VERBOSE, _(
 		  "estimated dump size per stream: %llu bytes\n"),
 		    hdr_mfilesz + (filesz + datasz) / drivecnt);
 	}
-	mlog( MLOG_DEBUG,
+	mlog(MLOG_DEBUG,
 	      "estimated dump header size: %llu bytes\n",
-	      hdr_mfilesz );
-	mlog( MLOG_DEBUG,
+	      hdr_mfilesz);
+	mlog(MLOG_DEBUG,
 	      "estimated component sizes: global hdr: %llu bytes, "
 	      "inomap: %llu bytes,  dir entries: %llu bytes, "
 	      "file hdrs: %llu bytes, datasz: %llu bytes\n",
 	      GLOBAL_HDR_SZ, inomapsz, direntsz,
-	      filesz, datasz );
+	      filesz, datasz);
 
 	/* extract the progress stat denominators from the write hdr
-	 * template. placed there by inomap_writehdr( )
+	 * template. placed there by inomap_writehdr()
 	 */
 	sc_stat_dircnt = scwhdrtemplatep->cih_inomap_dircnt;
 	sc_stat_nondircnt = scwhdrtemplatep->cih_inomap_nondircnt;
@@ -1576,55 +1576,55 @@ baseuuidbypass:
 
 	/* allocate and populate per-stream context descriptors
 	 */
-	sc_contextp = ( context_t * )calloc( drivecnt, sizeof( context_t ));
-	assert( sc_contextp );
-	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-		context_t *contextp = &sc_contextp[ strmix ];
+	sc_contextp = (context_t *)calloc(drivecnt, sizeof(context_t));
+	assert(sc_contextp);
+	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		context_t *contextp = &sc_contextp[strmix];
 
 		contextp->cc_filehdrp =
-				( filehdr_t * )calloc( 1, sizeof( filehdr_t ));
-		assert( contextp->cc_filehdrp );
+				(filehdr_t *)calloc(1, sizeof(filehdr_t));
+		assert(contextp->cc_filehdrp);
 
 		contextp->cc_extenthdrp =
-			    ( extenthdr_t * )calloc( 1, sizeof( extenthdr_t ));
-		assert( contextp->cc_extenthdrp );
+			    (extenthdr_t *)calloc(1, sizeof(extenthdr_t));
+		assert(contextp->cc_extenthdrp);
 
-		contextp->cc_getdentsbufsz = sizeof( struct dirent )
+		contextp->cc_getdentsbufsz = sizeof(struct dirent)
 					       +
 					       NAME_MAX + 1;
-		if ( contextp->cc_getdentsbufsz < GETDENTSBUF_SZ_MIN ) {
+		if (contextp->cc_getdentsbufsz < GETDENTSBUF_SZ_MIN) {
 			contextp->cc_getdentsbufsz = GETDENTSBUF_SZ_MIN;
 		}
 		contextp->cc_getdentsbufp =
-			   ( char * ) calloc( 1, contextp->cc_getdentsbufsz );
-		assert( contextp->cc_getdentsbufp );
+			   (char *) calloc(1, contextp->cc_getdentsbufsz);
+		assert(contextp->cc_getdentsbufp);
 
-		contextp->cc_mdirentbufsz = sizeof( direnthdr_t  )
+		contextp->cc_mdirentbufsz = sizeof(direnthdr_t)
 					    +
 					    NAME_MAX + 1
 					    +
 					    DIRENTHDR_ALIGN;
 		contextp->cc_mdirentbufp =
-			   ( char * ) calloc( 1, contextp->cc_mdirentbufsz );
-		assert( contextp->cc_mdirentbufp );
+			   (char *) calloc(1, contextp->cc_mdirentbufsz);
+		assert(contextp->cc_mdirentbufp);
 
 		contextp->cc_extattrlistbufsz = EXTATTR_LISTBUF_SZ;
 		contextp->cc_extattrrtrvarraylen = EXTATTR_RTRVARRAY_LEN;
 		contextp->cc_extattrdumpbufsz = 2 * ATTR_MAX_VALUELEN;
-		if ( contextp->cc_extattrdumpbufsz < EXTATTR_DUMPBUF_SZ ) {
+		if (contextp->cc_extattrdumpbufsz < EXTATTR_DUMPBUF_SZ) {
 			contextp->cc_extattrdumpbufsz = EXTATTR_DUMPBUF_SZ;
 		}
 		contextp->cc_extattrlistbufp =
-			   ( char * )calloc( 1, contextp->cc_extattrlistbufsz );
-		assert( contextp->cc_extattrlistbufp );
+			   (char *)calloc(1, contextp->cc_extattrlistbufsz);
+		assert(contextp->cc_extattrlistbufp);
 		contextp->cc_extattrrtrvarrayp =
-		  ( attr_multiop_t * )calloc( contextp->cc_extattrrtrvarraylen,
-				    sizeof( attr_multiop_t ));
-		assert( contextp->cc_extattrrtrvarrayp );
+		  (attr_multiop_t *)calloc(contextp->cc_extattrrtrvarraylen,
+				    sizeof(attr_multiop_t));
+		assert(contextp->cc_extattrrtrvarrayp);
 		contextp->cc_extattrdumpbufp =
-			   ( char * )memalign( sizeof( extattrhdr_t ),
-					       contextp->cc_extattrdumpbufsz );
-		assert( contextp->cc_extattrdumpbufp );
+			   (char *)memalign(sizeof(extattrhdr_t),
+					       contextp->cc_extattrdumpbufsz);
+		assert(contextp->cc_extattrdumpbufp);
 		if (hsm_fs_ctxtp) {
 			contextp->cc_hsm_f_ctxtp = HsmAllocateFileContext(
 				hsm_fs_ctxtp);
@@ -1634,10 +1634,10 @@ baseuuidbypass:
 
 		contextp->cc_readlinkbufsz = MAXPATHLEN + SYMLINK_ALIGN;
 		contextp->cc_readlinkbufp =
-			   ( char * ) calloc( 1, contextp->cc_readlinkbufsz );
-		assert( contextp->cc_readlinkbufp );
+			   (char *) calloc(1, contextp->cc_readlinkbufsz);
+		assert(contextp->cc_readlinkbufp);
 
-		contextp->cc_inomap_contextp = inomap_alloc_context( );
+		contextp->cc_inomap_contextp = inomap_alloc_context();
 	}
 
 	/* look for command line media labels. these will be assigned
@@ -1652,22 +1652,22 @@ baseuuidbypass:
 
 		optind = 1;
 		opterr = 0;
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-			switch ( c ) {
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+			switch (c) {
 			case GETOPT_MEDIALABEL:
-				if ( cp >= ep ) {
-					mlog( MLOG_NORMAL, _(
+				if (cp >= ep) {
+					mlog(MLOG_NORMAL, _(
 					      "more -%c arguments "
 					      "than number of drives\n"),
-					      c );
-					usage( );
+					      c);
+					usage();
 					return BOOL_FALSE;
 				}
-				if ( ! optarg || optarg[ 0 ] == '-' ) {
-					mlog( MLOG_NORMAL, _(
+				if (! optarg || optarg[0] == '-') {
+					mlog(MLOG_NORMAL, _(
 					      "-%c argument missing\n"),
-					      c );
-					usage( );
+					      c);
+					usage();
 					return BOOL_FALSE;
 				}
 				cp->cc_Media_firstlabel = optarg;
@@ -1676,39 +1676,39 @@ baseuuidbypass:
 			}
 		}
 
-		if ( cp > sc_contextp && cp < ep ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if (cp > sc_contextp && cp < ep) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "media labels given for only %d out of %d "
 			      "drives\n"),
 			      cp - sc_contextp,
-			      drivecnt );
+			      drivecnt);
 		}
 	}
 
-	if ( preemptchk( PREEMPT_FULL )) {
+	if (preemptchk(PREEMPT_FULL)) {
 		return BOOL_FALSE;
 	}
 
 	/* open the dump inventory and a dump inventory write session
 	 * if an inventory update is to be done.
 	 */
-	if ( sc_inv_updatepr ) {
+	if (sc_inv_updatepr) {
 		bool_t result;
 		sigset_t tty_set, orig_set;
 
 		/* hold tty signals while creating a new inventory session */
-		sigemptyset( &tty_set );
-		sigaddset( &tty_set, SIGINT );
-		sigaddset( &tty_set, SIGQUIT );
-		sigaddset( &tty_set, SIGHUP );
-		pthread_sigmask( SIG_BLOCK, &tty_set, &orig_set );
+		sigemptyset(&tty_set);
+		sigaddset(&tty_set, SIGINT);
+		sigaddset(&tty_set, SIGQUIT);
+		sigaddset(&tty_set, SIGHUP);
+		pthread_sigmask(SIG_BLOCK, &tty_set, &orig_set);
 
-		result = create_inv_session( gwhdrtemplatep, &fsid, mntpnt,
-					     fsdevice, subtreecnt, strmix );
+		result = create_inv_session(gwhdrtemplatep, &fsid, mntpnt,
+					     fsdevice, subtreecnt, strmix);
 
-		pthread_sigmask( SIG_SETMASK, &orig_set, NULL );
+		pthread_sigmask(SIG_SETMASK, &orig_set, NULL);
 
-		if ( !result ) {
+		if (!result) {
 			return BOOL_FALSE;
 		}
 	}
@@ -1717,11 +1717,11 @@ baseuuidbypass:
 	 */
 	{
 		ix_t ix;
-		ix_t endix = sizeof( sc_mcflag )
+		ix_t endix = sizeof(sc_mcflag)
 			     /
-			     sizeof( sc_mcflag[ 0 ] );
-		for ( ix = 0 ; ix < endix ; ix++ ) {
-			sc_mcflag[ ix ] = BOOL_FALSE;
+			     sizeof(sc_mcflag[0]);
+		for (ix = 0 ; ix < endix ; ix++) {
+			sc_mcflag[ix] = BOOL_FALSE;
 		}
 	}
 	content_media_change_needed = BOOL_FALSE;
@@ -1730,8 +1730,8 @@ baseuuidbypass:
 	 */
 	{
 		ix_t driveix;
-		for ( driveix = 0 ; driveix < STREAM_SIMMAX ; driveix++ ) {
-			sc_stat_pds[ driveix ].pds_phase = PDS_NULL;
+		for (driveix = 0 ; driveix < STREAM_SIMMAX ; driveix++) {
+			sc_stat_pds[driveix].pds_phase = PDS_NULL;
 		}
 	}
 
@@ -1741,10 +1741,10 @@ baseuuidbypass:
 #define STATLINESZ	160
 
 size_t
-content_statline( char **linespp[ ] )
+content_statline(char **linespp[])
 {
-	static char statlinebuf[ STREAM_SIMMAX + 1 ][ STATLINESZ ];
-	static char *statline[ STREAM_SIMMAX + 1 ];
+	static char statlinebuf[STREAM_SIMMAX + 1][STATLINESZ];
+	static char *statline[STREAM_SIMMAX + 1];
 	size_t statlinecnt;
 	size64_t nondirdone;
 	size64_t datadone;
@@ -1756,32 +1756,32 @@ content_statline( char **linespp[ ] )
 
 	/* build and supply the line array
 	 */
-	for ( i = 0 ; i < STREAM_SIMMAX + 1 ; i++ ) {
-		statline[ i ] = &statlinebuf[ i ][ 0 ];
+	for (i = 0 ; i < STREAM_SIMMAX + 1 ; i++) {
+		statline[i] = &statlinebuf[i][0];
 	}
 	*linespp = statline;
 	statlinecnt = 0;
 
 	/* if start time not initialized, return no strings
 	 */
-	if ( ! sc_stat_starttime ) {
+	if (! sc_stat_starttime) {
 		return 0;
 	}
 
 	/* calculate the elapsed time
 	 */
-	now = time( 0 );
+	now = time(0);
 	elapsed = now - sc_stat_starttime;
 
 	/* get local time
 	 */
-	tmp = localtime( &now );
+	tmp = localtime(&now);
 
 	/* if inomap phase indicated, report on that
 	 */
-	if ( sc_stat_inomapphase && sc_stat_inomapcnt ) {
-		if ( sc_stat_inomappass ) {
-			sprintf( statline[ 0 ],
+	if (sc_stat_inomapphase && sc_stat_inomapcnt) {
+		if (sc_stat_inomappass) {
+			sprintf(statline[0],
 				 "status at %02d:%02d:%02d: "
 				 "inomap phase %u pass %u "
 				 "%llu/%llu inos scanned, "
@@ -1793,10 +1793,10 @@ content_statline( char **linespp[ ] )
 				 (unsigned int)sc_stat_inomappass,
 				 (unsigned long long)sc_stat_inomapdone,
 				 (unsigned long long)sc_stat_inomapcnt,
-				 elapsed );
-			assert( strlen( statline[ 0 ] ) < STATLINESZ );
+				 elapsed);
+			assert(strlen(statline[0]) < STATLINESZ);
 		} else {
-			sprintf( statline[ 0 ],
+			sprintf(statline[0],
 				 "status at %02d:%02d:%02d: "
 				 "inomap phase %u "
 				 "%llu/%llu inos scanned, "
@@ -1807,38 +1807,38 @@ content_statline( char **linespp[ ] )
 				 (unsigned int)sc_stat_inomapphase,
 				 (unsigned long long)sc_stat_inomapdone,
 				 (unsigned long long)sc_stat_inomapcnt,
-				 elapsed );
-			assert( strlen( statline[ 0 ] ) < STATLINESZ );
+				 elapsed);
+			assert(strlen(statline[0]) < STATLINESZ);
 		}
 		return 1;
 	}
 
 	/* get the accumulated totals for non-dir inos and data bytes dumped
 	 */
-	lock( );
+	lock();
 	nondirdone = sc_stat_nondirdone;
 	datadone = sc_stat_datadone;
-	unlock( );
+	unlock();
 
 	/* non-dir dump phase */
-	if ( nondirdone || datadone ) {
+	if (nondirdone || datadone) {
 		/* calculate percentage of data dumped
 		*/
-		if ( sc_stat_datasz ) {
-			percent = ( double )datadone
+		if (sc_stat_datasz) {
+			percent = (double)datadone
 				/
-				( double )sc_stat_datasz;
+				(double)sc_stat_datasz;
 			percent *= 100.0;
 		} else {
 			percent = 100.0;
 		}
-		if ( percent > 100.0 ) {
+		if (percent > 100.0) {
 			percent = 100.0;
 		}
 
 		/* format the status line in a local static buffer (non-re-entrant!)
 		*/
-		sprintf( statline[ 0 ],
+		sprintf(statline[0],
 				"status at %02d:%02d:%02d: %llu/%llu files dumped, "
 				"%.1lf%%%% data dumped, "
 				"%ld seconds elapsed\n",
@@ -1848,66 +1848,66 @@ content_statline( char **linespp[ ] )
 				(unsigned long long) nondirdone,
 				(unsigned long long) sc_stat_nondircnt,
 				percent,
-				elapsed );
+				elapsed);
 	} else {
-		sprintf( statline[ 0 ],
+		sprintf(statline[0],
 				"status at %02d:%02d:%02d: "
 				"%ld seconds elapsed\n",
 				tmp->tm_hour,
 				tmp->tm_min,
 				tmp->tm_sec,
-				elapsed );
+				elapsed);
 	}
 
-	assert( strlen( statline[ 0 ] ) < STATLINESZ );
+	assert(strlen(statline[0]) < STATLINESZ);
 
 	/* optionally create stat lines for each drive
 	 */
 	statlinecnt = 1;
-	for ( i = 0 ; i < drivecnt ; i++ ) {
-		pds_t *pdsp = &sc_stat_pds[ i ];
-		if ( pdsp->pds_phase == PDS_NULL
+	for (i = 0 ; i < drivecnt ; i++) {
+		pds_t *pdsp = &sc_stat_pds[i];
+		if (pdsp->pds_phase == PDS_NULL
 		     ||
-		     pdsp->pds_phase == PDS_NONDIR ) {
+		     pdsp->pds_phase == PDS_NONDIR) {
 			continue;
 		}
-		statline[ statlinecnt ][ 0 ] = 0;
-		if ( drivecnt > 1 ) {
-			sprintf( statline[ statlinecnt ],
+		statline[statlinecnt][0] = 0;
+		if (drivecnt > 1) {
+			sprintf(statline[statlinecnt],
 				 "drive %u: ",
-				 (unsigned int)i );
+				 (unsigned int)i);
 		}
-		switch( pdsp->pds_phase ) {
+		switch(pdsp->pds_phase) {
 		case PDS_INOMAP:
-			strcat( statline[ statlinecnt ],
-				"dumping inomap" );
+			strcat(statline[statlinecnt],
+				"dumping inomap");
 			break;
 		case PDS_DIRDUMP:
-			sprintf( &statline[ statlinecnt ]
-					  [ strlen( statline[ statlinecnt ] ) ],
+			sprintf(&statline[statlinecnt]
+					  [strlen(statline[statlinecnt])],
 				 "%llu/%llu directories dumped",
 				 (unsigned long long)pdsp->pds_dirdone,
-				 (unsigned long long)sc_stat_dircnt );
+				 (unsigned long long)sc_stat_dircnt);
 			break;
 		case PDS_INVSYNC:
-			strcat( statline[ statlinecnt ],
-				"waiting to dump inventory" );
+			strcat(statline[statlinecnt],
+				"waiting to dump inventory");
 			break;
 		case PDS_INVDUMP:
-			strcat( statline[ statlinecnt ],
-				"dumping inventory" );
+			strcat(statline[statlinecnt],
+				"dumping inventory");
 			break;
 		case PDS_TERMDUMP:
-			strcat( statline[ statlinecnt ],
-				"dumping stream terminator" );
+			strcat(statline[statlinecnt],
+				"dumping stream terminator");
 			break;
 		default:
 			break;
 		}
-		sprintf( &statline[ statlinecnt ]
-				  [ strlen( statline[ statlinecnt ] ) ],
-			 "\n" );
-		assert( strlen( statline[ statlinecnt ] ) < STATLINESZ );
+		sprintf(&statline[statlinecnt]
+				  [strlen(statline[statlinecnt])],
+			 "\n");
+		assert(strlen(statline[statlinecnt]) < STATLINESZ);
 		statlinecnt++;
 	}
 
@@ -1928,61 +1928,61 @@ create_inv_session(
 	char *qfsdevice;
 
 	/* create a cleanup handler to close the inventory on exit. */
-	rval = atexit( inv_cleanup );
-	assert( ! rval );
+	rval = atexit(inv_cleanup);
+	assert(! rval);
 
-	sc_inv_idbtoken = inv_open( ( inv_predicate_t )INV_BY_UUID,
+	sc_inv_idbtoken = inv_open((inv_predicate_t)INV_BY_UUID,
 					INV_SEARCH_N_MOD,
-					( void * )fsidp );
-	if ( sc_inv_idbtoken == INV_TOKEN_NULL ) {
+					(void *)fsidp);
+	if (sc_inv_idbtoken == INV_TOKEN_NULL) {
 		return BOOL_FALSE;
 	}
-	qmntpnt = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
-					+ 1 + strlen( mntpnt ) + 1 );
-	assert( qmntpnt );
-	assert( strlen( gwhdrtemplatep->gh_hostname ));
-	sprintf( qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt );
-	qfsdevice = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
-					 + 1 + strlen( fsdevice ) + 1 );
-	assert( qfsdevice );
-	sprintf( qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice );
-
-	sc_inv_sestoken = inv_writesession_open( sc_inv_idbtoken,
+	qmntpnt = (char *)calloc(1, strlen(gwhdrtemplatep->gh_hostname)
+					+ 1 + strlen(mntpnt) + 1);
+	assert(qmntpnt);
+	assert(strlen(gwhdrtemplatep->gh_hostname));
+	sprintf(qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt);
+	qfsdevice = (char *)calloc(1, strlen(gwhdrtemplatep->gh_hostname)
+					 + 1 + strlen(fsdevice) + 1);
+	assert(qfsdevice);
+	sprintf(qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice);
+
+	sc_inv_sestoken = inv_writesession_open(sc_inv_idbtoken,
 						fsidp,
 						&gwhdrtemplatep->gh_dumpid,
 						gwhdrtemplatep->gh_dumplabel,
 						subtreecnt ? BOOL_TRUE
 							   : BOOL_FALSE,
 						sc_resumepr,
-						( u_char_t )sc_level,
+						(u_char_t)sc_level,
 						drivecnt,
 						gwhdrtemplatep->gh_timestamp,
 						qmntpnt,
-						qfsdevice );
-	if ( sc_inv_sestoken == INV_TOKEN_NULL ) {
+						qfsdevice);
+	if (sc_inv_sestoken == INV_TOKEN_NULL) {
 		return BOOL_FALSE;
 	}
 
 	/* open an inventory stream for each stream
 	*/
-	sc_inv_stmtokenp = ( inv_stmtoken_t * )
-				calloc( drivecnt, sizeof( inv_stmtoken_t ));
-	assert( sc_inv_stmtokenp );
-	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-		drive_t *drivep = drivepp[ strmix ];
+	sc_inv_stmtokenp = (inv_stmtoken_t *)
+				calloc(drivecnt, sizeof(inv_stmtoken_t));
+	assert(sc_inv_stmtokenp);
+	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		drive_t *drivep = drivepp[strmix];
 		char *drvpath;
 
-		if ( strcmp( drivep->d_pathname, "stdio" )) {
-			drvpath = path_reltoabs( drivep->d_pathname, homedir );
+		if (strcmp(drivep->d_pathname, "stdio")) {
+			drvpath = path_reltoabs(drivep->d_pathname, homedir);
 		} else {
 			drvpath = drivep->d_pathname;
 		}
-		sc_inv_stmtokenp[ strmix ] = inv_stream_open( sc_inv_sestoken,
-								drvpath );
-		if ( strcmp( drivep->d_pathname, "stdio" )) {
-			free( ( void * )drvpath );
+		sc_inv_stmtokenp[strmix] = inv_stream_open(sc_inv_sestoken,
+								drvpath);
+		if (strcmp(drivep->d_pathname, "stdio")) {
+			free((void *)drvpath);
 		}
-		if ( sc_inv_stmtokenp[ strmix ] == INV_TOKEN_NULL ) {
+		if (sc_inv_stmtokenp[strmix] == INV_TOKEN_NULL) {
 			return BOOL_FALSE;
 		}
 	}
@@ -1991,55 +1991,55 @@ create_inv_session(
 }
 
 static void
-mark_set( drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags )
+mark_set(drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags)
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	mark_t *markp = ( mark_t * )calloc( 1, sizeof( mark_t ));
-	assert( markp );
-
-	if ( flags & STARTPT_FLAGS_NULL ) {
-		mlog( MLOG_DEBUG,
-		      "setting media NULL mark\n" );
-	} else if ( flags & STARTPT_FLAGS_END ) {
-		mlog( MLOG_DEBUG,
-		      "setting media END mark\n" );
+	mark_t *markp = (mark_t *)calloc(1, sizeof(mark_t));
+	assert(markp);
+
+	if (flags & STARTPT_FLAGS_NULL) {
+		mlog(MLOG_DEBUG,
+		      "setting media NULL mark\n");
+	} else if (flags & STARTPT_FLAGS_END) {
+		mlog(MLOG_DEBUG,
+		      "setting media END mark\n");
 	} else {
-		mlog( MLOG_DEBUG,
+		mlog(MLOG_DEBUG,
 		      "setting media mark"
 		      " for ino %llu offset %lld\n",
 		      ino,
-		      offset );
+		      offset);
 	}
 
 	markp->startpt.sp_ino = ino;
 	markp->startpt.sp_offset = offset;
 	markp->startpt.sp_flags = flags;
-	( * dop->do_set_mark )( drivep,
+	(* dop->do_set_mark)(drivep,
 				mark_callback,
-				( void * )drivep->d_index,
-				( drive_markrec_t * )markp );
+				(void *)drivep->d_index,
+				(drive_markrec_t *)markp);
 }
 
 static void
-mark_callback( void *p, drive_markrec_t *dmp, bool_t committed )
+mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 {
 	/* get context
 	 */
-	ix_t strmix = ( ix_t )p;
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	ix_t strmix = (ix_t)p;
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
-	content_hdr_t *cwhdrp = ( content_hdr_t * )mwhdrp->mh_upper;
-	content_inode_hdr_t *scwhdrp = ( content_inode_hdr_t * )
-				       ( void * )
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
+	content_hdr_t *cwhdrp = (content_hdr_t *)mwhdrp->mh_upper;
+	content_inode_hdr_t *scwhdrp = (content_inode_hdr_t *)
+				       (void *)
 				       cwhdrp->ch_specific;
 
 	/* this is really a mark_t, allocated by mark_set()
 	 */
-	mark_t *markp = ( mark_t * )dmp;
+	mark_t *markp = (mark_t *)dmp;
 
-	if ( committed ) {
+	if (committed) {
 		/* bump the per-mfile mark committed count
 		 */
 		contextp->cc_markscommitted++;
@@ -2051,18 +2051,18 @@ mark_callback( void *p, drive_markrec_t *dmp, bool_t committed )
 
 		/* log the mark commit
 		 */
-		if ( markp->startpt.sp_flags & STARTPT_FLAGS_NULL ) {
-			mlog( MLOG_DEBUG,
+		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
+			mlog(MLOG_DEBUG,
 			      "media NULL mark committed"
 			      " in media file %d\n",
-			      mwhdrp->mh_dumpfileix );
+			      mwhdrp->mh_dumpfileix);
 			scwhdrp->cih_startpt.sp_flags |= STARTPT_FLAGS_NULL;
-		} else if ( markp->startpt.sp_flags & STARTPT_FLAGS_END ) {
-			mlog( MLOG_DEBUG,
+		} else if (markp->startpt.sp_flags & STARTPT_FLAGS_END) {
+			mlog(MLOG_DEBUG,
 			      "media END mark committed"
 			      " in media file %d\n",
-			      mwhdrp->mh_dumpfileix );
-			if ( scwhdrp->cih_endpt.sp_flags & STARTPT_FLAGS_END ) {
+			      mwhdrp->mh_dumpfileix);
+			if (scwhdrp->cih_endpt.sp_flags & STARTPT_FLAGS_END) {
 				scwhdrp->cih_startpt.sp_ino++;
 				scwhdrp->cih_startpt.sp_offset = 0;
 			} else {
@@ -2070,49 +2070,49 @@ mark_callback( void *p, drive_markrec_t *dmp, bool_t committed )
 			}
 			scwhdrp->cih_startpt.sp_flags |= STARTPT_FLAGS_END;
 		} else {
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "media mark committed"
 			      " for ino %llu offset %lld"
 			      " in media file %d\n",
 			      markp->startpt.sp_ino,
 			      markp->startpt.sp_offset,
-			      mwhdrp->mh_dumpfileix );
+			      mwhdrp->mh_dumpfileix);
 			scwhdrp->cih_startpt = markp->startpt;
 		}
 	} else {
 		/* note the mark was not committed
 		 */
-		if ( markp->startpt.sp_flags & STARTPT_FLAGS_NULL ) {
-			mlog( MLOG_DEBUG,
-			      "media NULL mark -NOT- committed\n" );
-		} else if ( markp->startpt.sp_flags & STARTPT_FLAGS_END ) {
-			mlog( MLOG_DEBUG,
-			      "media END mark -NOT- committed\n" );
+		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
+			mlog(MLOG_DEBUG,
+			      "media NULL mark -NOT- committed\n");
+		} else if (markp->startpt.sp_flags & STARTPT_FLAGS_END) {
+			mlog(MLOG_DEBUG,
+			      "media END mark -NOT- committed\n");
 		} else {
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "media mark -NOT- committed"
 			      " for ino %llu offset %lld\n",
 			      markp->startpt.sp_ino,
-			      markp->startpt.sp_offset );
+			      markp->startpt.sp_offset);
 		}
 	}
 
 	/* get rid of this mark (it was allocated by mark_set())
 	 */
-	free( ( void * )markp );
+	free((void *)markp);
 }
 
 /* begin - called by stream process to invoke the dump stream
  */
 int
-content_stream_dump( ix_t strmix )
+content_stream_dump(ix_t strmix)
 {
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
-	content_hdr_t *cwhdrp = ( content_hdr_t * )mwhdrp->mh_upper;
-	content_inode_hdr_t *scwhdrp = ( content_inode_hdr_t * )
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
+	content_hdr_t *cwhdrp = (content_hdr_t *)mwhdrp->mh_upper;
+	content_inode_hdr_t *scwhdrp = (content_inode_hdr_t *)
 				       cwhdrp->ch_specific;
 	void *inomap_contextp;
 	bool_t all_nondirs_committed;
@@ -2126,46 +2126,46 @@ content_stream_dump( ix_t strmix )
 
 	/* sanity checks
 	 */
-	assert( RV_OK == 0 ); /* bigstat_iter depends on this */
+	assert(RV_OK == 0); /* bigstat_iter depends on this */
 
 	/* allocate a buffer for use by bstat_iter
 	 */
-	bstatbufp = ( xfs_bstat_t * )calloc( bstatbuflen,
-					     sizeof( xfs_bstat_t ));
-	assert( bstatbufp );
+	bstatbufp = (xfs_bstat_t *)calloc(bstatbuflen,
+					     sizeof(xfs_bstat_t));
+	assert(bstatbufp);
 
 	/* allocate an inomap context */
 	inomap_contextp = inomap_alloc_context();
-	assert( inomap_contextp );
+	assert(inomap_contextp);
 
 	/* determine if stream terminators will be used and are expected.
 	 * this will be revised each time a new media file is begun.
 	 */
-	update_cc_Media_useterminatorpr( drivep, contextp );
+	update_cc_Media_useterminatorpr(drivep, contextp);
 
 	/* check in
 	 */
-	lock( );
+	lock();
 	sc_thrdsarrivedcnt++;
-	unlock( );
+	unlock();
 
 	/* fill in write hdr stream start and end points
 	 */
-	scwhdrp->cih_startpt = sc_startptp[ strmix ];
-	if ( strmix < drivecnt - 1 ) {
-		scwhdrp->cih_endpt = sc_startptp[ strmix + 1 ];
+	scwhdrp->cih_startpt = sc_startptp[strmix];
+	if (strmix < drivecnt - 1) {
+		scwhdrp->cih_endpt = sc_startptp[strmix + 1];
 	} else {
 		scwhdrp->cih_endpt.sp_flags = STARTPT_FLAGS_END;
 	}
 
 	// the first stream dumps the directories
-	if ( strmix == 0 ) {
+	if (strmix == 0) {
 		scwhdrp->cih_dumpattr |= CIH_DUMPATTR_DIRDUMP;
 	}
 
 	/* fill in inomap fields of write hdr
 	 */
-	inomap_writehdr( scwhdrp );
+	inomap_writehdr(scwhdrp);
 
 	/* used to decide if any non-dirs not yet on media
 	 */
@@ -2183,8 +2183,8 @@ content_stream_dump( ix_t strmix )
 
 	/* get the inventory stream token
 	 */
-	if ( sc_inv_stmtokenp ) {
-		inv_stmt = sc_inv_stmtokenp[ strmix ];
+	if (sc_inv_stmtokenp) {
+		inv_stmt = sc_inv_stmtokenp[strmix];
 	} else {
 		inv_stmt = INV_TOKEN_NULL;
 	}
@@ -2195,7 +2195,7 @@ content_stream_dump( ix_t strmix )
 	 * The current startpoint will be updated each time a media mark
 	 * is committed.
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		xfs_ino_t startino;
 		bool_t stop_requested;
 		bool_t hit_eom;
@@ -2248,48 +2248,48 @@ content_stream_dump( ix_t strmix )
 		 * and begin a new media file. This will dump the media
 		 * file header if successful.
 		 */
-		rv = Media_mfile_begin( drivep, contextp, BOOL_TRUE );
-		if ( rv == RV_INTR ) {
+		rv = Media_mfile_begin(drivep, contextp, BOOL_TRUE);
+		if (rv == RV_INTR) {
 			return mlog_exit(EXIT_INTERRUPT, rv);
 		}
-		if ( rv == RV_TIMEOUT ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		if (rv == RV_TIMEOUT) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change timeout will be treated as "
 			      "a request to stop using drive: "
-			      "can resume later\n") );
+			      "can resume later\n"));
 			mlog_exit_hint(RV_QUIT);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_QUIT ) {
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+		if (rv == RV_QUIT) {
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change decline will be treated as "
 			      "a request to stop using drive: "
-			      "can resume later\n") );
+			      "can resume later\n"));
 			mlog_exit_hint(RV_QUIT);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_DRIVE ) {
+		if (rv == RV_DRIVE) {
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_ERROR ) {
+		if (rv == RV_ERROR) {
 			return mlog_exit(EXIT_ERROR, rv);
 		}
-		if ( rv == RV_CORE ) {
+		if (rv == RV_CORE) {
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		assert( rv == RV_OK );
-		if ( rv != RV_OK ) {
+		assert(rv == RV_OK);
+		if (rv != RV_OK) {
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
 		/* sync up here with other streams if reasonable
 		 */
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "creating dump session media file %u "
 		      "(media %u, file %u)\n"),
 		      mwhdrp->mh_dumpfileix,
 		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix );
+		      mwhdrp->mh_mediafileix);
 
 		/* initialize the count of marks committed in the media file.
 		 * will be bumped by mark_callback().
@@ -2298,33 +2298,33 @@ content_stream_dump( ix_t strmix )
 
 		/* first dump the inomap
 		 */
-		mlog( MLOG_VERBOSE, _(
-		      "dumping ino map\n") );
-		sc_stat_pds[ strmix ].pds_phase = PDS_INOMAP;
-		rv = inomap_dump( drivep );
-		if ( rv == RV_INTR ) {
+		mlog(MLOG_VERBOSE, _(
+		      "dumping ino map\n"));
+		sc_stat_pds[strmix].pds_phase = PDS_INOMAP;
+		rv = inomap_dump(drivep);
+		if (rv == RV_INTR) {
 			stop_requested = BOOL_TRUE;
 			goto decision_more;
 		}
-		if ( rv == RV_EOM ) {
+		if (rv == RV_EOM) {
 			hit_eom = BOOL_TRUE;
 			goto decision_more;
 		}
-		if ( rv == RV_DRIVE ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_DRIVE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_ERROR ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_ERROR) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_ERROR, rv);
 		}
-		if ( rv == RV_CORE ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_CORE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		assert( rv == RV_OK );
-		if ( rv != RV_OK ) {
-			free( ( void * )bstatbufp );
+		assert(rv == RV_OK);
+		if (rv != RV_OK) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
@@ -2332,35 +2332,35 @@ content_stream_dump( ix_t strmix )
 		 * directories. use the bigstat iterator capability to call
 		 * my dump_dir function for each directory in the bitmap.
 		 */
-		if ( scwhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP ) {
-			sc_stat_pds[ strmix ].pds_dirdone = 0;
-			rv = dump_dirs( strmix,
+		if (scwhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP) {
+			sc_stat_pds[strmix].pds_dirdone = 0;
+			rv = dump_dirs(strmix,
 					bstatbufp,
 					bstatbuflen,
-					inomap_contextp );
-			if ( rv == RV_INTR ) {
+					inomap_contextp);
+			if (rv == RV_INTR) {
 				stop_requested = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_EOM ) {
+			if (rv == RV_EOM) {
 				hit_eom = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_DRIVE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_DRIVE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
 			}
-			if ( rv == RV_ERROR ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_ERROR) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_ERROR, rv);
 			}
-			if ( rv == RV_CORE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_CORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			assert( rv == RV_OK );
-			if ( rv != RV_OK ) {
-				free( ( void * )bstatbufp );
+			assert(rv == RV_OK);
+			if (rv != RV_OK) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
 		}
@@ -2372,55 +2372,55 @@ content_stream_dump( ix_t strmix )
 		 * non-directory file is fully committed to media,
 		 * the starting point for the next media file will be advanced.
 		 */
-		if ( ! all_nondirs_committed ) {
-			mlog( MLOG_VERBOSE, _(
-			      "dumping non-directory files\n") );
-			sc_stat_pds[ strmix ].pds_phase = PDS_NONDIR;
+		if (! all_nondirs_committed) {
+			mlog(MLOG_VERBOSE, _(
+			      "dumping non-directory files\n"));
+			sc_stat_pds[strmix].pds_phase = PDS_NONDIR;
 			rv = RV_OK;
 			inomap_reset_context(inomap_contextp);
-			rval = bigstat_iter( sc_fshandlep,
+			rval = bigstat_iter(sc_fshandlep,
 					     sc_fsfd,
 					     BIGSTAT_ITER_NONDIR,
 					     scwhdrp->cih_startpt.sp_ino,
-					     ( bstat_cbfp_t )dump_file,
-					     ( void * )strmix,
+					     (bstat_cbfp_t)dump_file,
+					     (void *)strmix,
 					     inomap_next_nondir,
 					     inomap_contextp,
-					     ( int * )&rv,
+					     (int *)&rv,
 					     pipeline ?
 					       (bool_t (*)(int))preemptchk : 0,
 					     bstatbufp,
-					     bstatbuflen );
-			if ( rval ) {
-				free( ( void * )bstatbufp );
+					     bstatbuflen);
+			if (rval) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, RV_CORE);
 			}
-			if ( rv == RV_INTR ) {
+			if (rv == RV_INTR) {
 				stop_requested = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_EOM ) {
+			if (rv == RV_EOM) {
 				hit_eom = BOOL_TRUE;
 				goto decision_more;
 			}
-			if ( rv == RV_EOF ) {
+			if (rv == RV_EOF) {
 				goto decision_more;
 			}
-			if ( rv == RV_DRIVE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_DRIVE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
 			}
-			if ( rv == RV_ERROR ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_ERROR) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_ERROR, rv);
 			}
-			if ( rv == RV_CORE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_CORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			assert( rv == RV_OK || rv == RV_NOMORE );
-			if ( rv != RV_OK && rv != RV_NOMORE ) {
-				free( ( void * )bstatbufp );
+			assert(rv == RV_OK || rv == RV_NOMORE);
+			if (rv != RV_OK && rv != RV_NOMORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
 		}
@@ -2435,10 +2435,10 @@ content_stream_dump( ix_t strmix )
 		 * we attempt to end the write stream.
 		 */
 		all_nondirs_sent = BOOL_TRUE;
-		mark_set( drivep,
+		mark_set(drivep,
 			  INO64MAX,
 			  OFF64MAX,
-			  STARTPT_FLAGS_END );
+			  STARTPT_FLAGS_END);
 
 decision_more:
 		/* write a null file hdr, to let restore recognize
@@ -2447,28 +2447,28 @@ decision_more:
 		 * media file in the stream. don't bother if we hit
 		 * EOM.
 		 */
-		if ( ! hit_eom ) {
-			rv = dump_filehdr( drivep,
+		if (! hit_eom) {
+			rv = dump_filehdr(drivep,
 					   contextp,
 					   0,
 					   0,
 					   all_nondirs_sent
 					   ?
-					   ( FILEHDR_FLAGS_NULL
+					   (FILEHDR_FLAGS_NULL
 					     |
-					     FILEHDR_FLAGS_END )
+					     FILEHDR_FLAGS_END)
 					   :
-					   FILEHDR_FLAGS_NULL );
-			if ( rv == RV_DRIVE ) {
-				free( ( void * )bstatbufp );
+					   FILEHDR_FLAGS_NULL);
+			if (rv == RV_DRIVE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
 			}
-			if ( rv == RV_CORE ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_CORE) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			if ( rv == RV_ERROR ) {
-				free( ( void * )bstatbufp );
+			if (rv == RV_ERROR) {
+				free((void *)bstatbufp);
 				return mlog_exit(EXIT_ERROR, rv);
 			}
 
@@ -2476,14 +2476,14 @@ decision_more:
 			 * it. mark callback will adjust start pt before this
 			 * call returns if the null file header made it.
 			 */
-			mark_set( drivep,
+			mark_set(drivep,
 				  INO64MAX,
 				  OFF64MAX,
 				  all_nondirs_sent
 				  ?
 				  STARTPT_FLAGS_NULL | STARTPT_FLAGS_END
 				  :
-				  STARTPT_FLAGS_NULL );
+				  STARTPT_FLAGS_NULL);
 		}
 
 		/* tell the Media abstraction to end the media file.
@@ -2492,38 +2492,38 @@ decision_more:
 		 * will invoke drive end_write, which will flush
 		 * all pending marks.
 		 */
-		mlog( MLOG_VERBOSE, _(
-		      "ending media file\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "ending media file\n"));
 		ncommitted = 0;
-		rv = Media_mfile_end( drivep,
+		rv = Media_mfile_end(drivep,
 				      contextp,
 				      mwhdrp,
 				      &ncommitted,
-				      hit_eom );
-		if ( rv == RV_DRIVE ) {
-			free( ( void * )bstatbufp );
+				      hit_eom);
+		if (rv == RV_DRIVE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
-		if ( rv == RV_CORE ) {
-			free( ( void * )bstatbufp );
+		if (rv == RV_CORE) {
+			free((void *)bstatbufp);
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "media file size %lld bytes\n"),
-		      ncommitted );
+		      ncommitted);
 
 		/* if at least one mark committed, we know all of
 		 * the inomap and dirdump was committed.
 		 */
-		all_dirs_committed = ( contextp->cc_markscommitted > 0 );
+		all_dirs_committed = (contextp->cc_markscommitted > 0);
 
 		/* at this point we can check the new start point
 		 * to determine if all nondirs have been committed.
 		 * if this flag was already set, then this is a
 		 * inomap and dirdump-only media file.
 		 */
-		if ( scwhdrp->cih_startpt.sp_flags & STARTPT_FLAGS_END ) {
-			if ( all_nondirs_committed ) {
+		if (scwhdrp->cih_startpt.sp_flags & STARTPT_FLAGS_END) {
+			if (all_nondirs_committed) {
 				empty_mediafile = BOOL_TRUE;
 			}
 			all_nondirs_committed = BOOL_TRUE;
@@ -2537,51 +2537,51 @@ decision_more:
 
 		/* tell the inventory about the media file
 		 */
-		if ( inv_stmt != INV_TOKEN_NULL ) {
+		if (inv_stmt != INV_TOKEN_NULL) {
 			bool_t ok;
 
-			if ( ! all_dirs_committed ) {
-				mlog( MLOG_DEBUG,
+			if (! all_dirs_committed) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
-				      "partial dirdump media file\n" );
-			} else if ( done && empty_mediafile ) {
-				mlog( MLOG_DEBUG,
+				      "partial dirdump media file\n");
+			} else if (done && empty_mediafile) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "empty last media file: "
 				      "%llu:%lld\n",
 				       startino,
-				       startoffset );
-			} else if ( empty_mediafile ) {
-				mlog( MLOG_DEBUG,
+				       startoffset);
+			} else if (empty_mediafile) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "empty media file: "
 				      "%llu:%lld\n",
 				       startino,
-				       startoffset );
-			} else if ( done ) {
-				mlog( MLOG_DEBUG,
+				       startoffset);
+			} else if (done) {
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "last media file: "
 				      "%llu:%lld\n",
 				       startino,
-				       startoffset );
+				       startoffset);
 			} else {
-				mlog( MLOG_DEBUG,
+				mlog(MLOG_DEBUG,
 				      "giving inventory "
 				      "media file: "
 				      "%llu:%lld - %llu:%lld\n",
 				       startino,
 				       startoffset,
 				       scwhdrp->cih_startpt.sp_ino,
-				       scwhdrp->cih_startpt.sp_offset );
+				       scwhdrp->cih_startpt.sp_offset);
 			}
 
 			/* already thread-safe, don't need to lock
 			 */
-			ok = inv_put_mediafile( inv_stmt,
+			ok = inv_put_mediafile(inv_stmt,
 						&mwhdrp->mh_mediaid,
 						mwhdrp->mh_medialabel,
-					( uint )mwhdrp->mh_mediafileix,
+					(uint)mwhdrp->mh_mediafileix,
 						startino,
 						startoffset,
 						scwhdrp->cih_startpt.sp_ino,
@@ -2590,13 +2590,13 @@ decision_more:
 					        all_dirs_committed
 						&&
 						! empty_mediafile,
-						BOOL_FALSE );
-			if ( ! ok ) {
-				mlog( MLOG_NORMAL, _(
-				      "inventory media file put failed\n") );
+						BOOL_FALSE);
+			if (! ok) {
+				mlog(MLOG_NORMAL, _(
+				      "inventory media file put failed\n"));
 			}
 		}
-		if ( done ) {
+		if (done) {
 			contextp->cc_completepr = BOOL_TRUE;
 			    /* so inv_end_stream and main will know
 			     */
@@ -2604,58 +2604,58 @@ decision_more:
 
 		/* don't go back for more if done or stop was requested
 		 */
-		if ( done || stop_requested ) {
+		if (done || stop_requested) {
 			break;
 		}
 	} /* end main dump loop */
 
 	/* check in
 	 */
-	lock( );
+	lock();
 	sc_thrdsdonecnt++;
-	unlock( );
+	unlock();
 
 	/* dump the session inventory and terminator here, if the drive
 	 * supports multiple media files. must wait until all
 	 * streams have completed or given up, so all media files
 	 * from all streams have been registered.
 	 */
-	if ( drivep->d_capabilities & DRIVE_CAP_FILES ) {
-		if ( stream_cnt( ) > 1 ) {
-			mlog( MLOG_VERBOSE, _(
+	if (drivep->d_capabilities & DRIVE_CAP_FILES) {
+		if (stream_cnt() > 1) {
+			mlog(MLOG_VERBOSE, _(
 			      "waiting for synchronized "
-			      "session inventory dump\n") );
-			sc_stat_pds[ strmix ].pds_phase = PDS_INVSYNC;
+			      "session inventory dump\n"));
+			sc_stat_pds[strmix].pds_phase = PDS_INVSYNC;
 		}
 
 		/* first be sure all threads have begun
 		*/
-		while ( sc_thrdsarrivedcnt < drivecnt ) {
-			sleep( 1 );
+		while (sc_thrdsarrivedcnt < drivecnt) {
+			sleep(1);
 		}
 		/* now wait for survivors to checkin
 		*/
-		while ( sc_thrdsdonecnt < stream_cnt( )) {
-			sleep( 1 );
+		while (sc_thrdsdonecnt < stream_cnt()) {
+			sleep(1);
 		}
 		/* proceeed
 		 */
-		sc_stat_pds[ strmix ].pds_phase = PDS_INVDUMP;
-		if ( dump_session_inv( drivep, contextp, mwhdrp, scwhdrp )) {
-			sc_stat_pds[ strmix ].pds_phase = PDS_TERMDUMP;
-			dump_terminator( drivep, contextp, mwhdrp );
+		sc_stat_pds[strmix].pds_phase = PDS_INVDUMP;
+		if (dump_session_inv(drivep, contextp, mwhdrp, scwhdrp)) {
+			sc_stat_pds[strmix].pds_phase = PDS_TERMDUMP;
+			dump_terminator(drivep, contextp, mwhdrp);
 		}
 	}
 
-	sc_stat_pds[ strmix ].pds_phase = PDS_NULL;
+	sc_stat_pds[strmix].pds_phase = PDS_NULL;
 
-	free( ( void * )bstatbufp );
+	free((void *)bstatbufp);
 
-	elapsed = time( 0 ) - sc_stat_starttime;
+	elapsed = time(0) - sc_stat_starttime;
 
-	mlog( MLOG_TRACE, _(
+	mlog(MLOG_TRACE, _(
 	      "ending stream: %ld seconds elapsed\n"),
-	      elapsed );
+	      elapsed);
 
 	return mlog_exit(EXIT_NORMAL, rv);
 }
@@ -2666,53 +2666,53 @@ decision_more:
  * dump is not complete.
  */
 bool_t
-content_complete( void )
+content_complete(void)
 {
 	time_t elapsed;
 	bool_t completepr;
 	int i;
 
-	completepr = check_complete_flags( );
+	completepr = check_complete_flags();
 
-	elapsed = time( 0 ) - sc_stat_starttime;
+	elapsed = time(0) - sc_stat_starttime;
 
-	mlog( MLOG_VERBOSE, _(
+	mlog(MLOG_VERBOSE, _(
 	      "dump size (non-dir files) : %llu bytes\n"),
-	      sc_stat_datadone );
+	      sc_stat_datadone);
 
-	if ( completepr ) {
-		if( sc_savequotas ) {
+	if (completepr) {
+		if(sc_savequotas) {
 			for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
-				if( quotas[i].savequotas && unlink( quotas[i].quotapath ) < 0 ) {
-					mlog( MLOG_ERROR, _(
+				if(quotas[i].savequotas && unlink(quotas[i].quotapath) < 0) {
+					mlog(MLOG_ERROR, _(
 					"unable to remove %s: %s\n"),
 					quotas[i].quotapath,
-					strerror ( errno ));
+					strerror (errno));
 				}
 			}
 		}
 
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "dump complete"
 		      ": %ld seconds elapsed"
 		      "\n"),
-		      elapsed );
+		      elapsed);
 	} else {
-		if ( sc_inv_updatepr ) {
-			mlog( MLOG_VERBOSE | MLOG_NOTE, _(
+		if (sc_inv_updatepr) {
+			mlog(MLOG_VERBOSE | MLOG_NOTE, _(
 			      "dump interrupted"
 			      ": %ld seconds elapsed"
 			      ": may resume later using -%c option"
 			      "\n"),
 			      elapsed,
-			      GETOPT_RESUME );
+			      GETOPT_RESUME);
 			mlog_exit_hint(RV_INTR);
 		} else {
-			mlog( MLOG_VERBOSE | MLOG_NOTE, _(
+			mlog(MLOG_VERBOSE | MLOG_NOTE, _(
 			      "dump interrupted"
 			      ": %ld seconds elapsed"
 			      "\n"),
-			      elapsed );
+			      elapsed);
 			mlog_exit_hint(RV_INTR);
 		}
 	}
@@ -2728,15 +2728,15 @@ content_complete( 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;
 	size_t maxdrvchoiceix;
 	size_t nochangeix;
@@ -2744,25 +2744,25 @@ content_mediachange_query( void )
 	ix_t thrdix;
 
 	querycnt = 0;
-	querystr[ querycnt++ ] = "select a drive to acknowledge media change\n";
+	querystr[querycnt++] = "select a drive to acknowledge media change\n";
 	choicecnt = 0;
 	maxdrvchoiceix = 0;
-	for ( thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++ ) {
-		if ( sc_mcflag[ thrdix ] ) {
-			choicetothrdmap[ choicecnt ].thrdix = thrdix;
-			sprintf( choicetothrdmap[ choicecnt ].choicestr,
+	for (thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++) {
+		if (sc_mcflag[thrdix]) {
+			choicetothrdmap[choicecnt].thrdix = thrdix;
+			sprintf(choicetothrdmap[choicecnt].choicestr,
 				 "drive %u",
-				 (unsigned int)thrdix );
-			choicestr[ choicecnt ] =
-					choicetothrdmap[ choicecnt ].choicestr;
+				 (unsigned int)thrdix);
+			choicestr[choicecnt] =
+					choicetothrdmap[choicecnt].choicestr;
 			maxdrvchoiceix = choicecnt;
 			choicecnt++;
 		}
 	}
 	nochangeix = choicecnt;
-	choicestr[ choicecnt++ ] = "continue";
-	assert( choicecnt <= CHOICEMAX );
-	responseix = dlog_multi_query( querystr,
+	choicestr[choicecnt++] = "continue";
+	assert(choicecnt <= CHOICEMAX);
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -2775,40 +2775,40 @@ 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";
 	}
-	assert( responseix == nochangeix );
+	assert(responseix == nochangeix);
 	return "continuing\n";
 }
 
 
 static void
-update_cc_Media_useterminatorpr( drive_t *drivep, context_t *contextp )
+update_cc_Media_useterminatorpr(drive_t *drivep, context_t *contextp)
 {
 	int dcaps = drivep->d_capabilities;
 
 	contextp->cc_Media_useterminatorpr = BOOL_TRUE;
-	if ( ! ( dcaps & DRIVE_CAP_FILES )) {
+	if (! (dcaps & DRIVE_CAP_FILES)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if ( ! ( dcaps & DRIVE_CAP_OVERWRITE )) {
+	if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if ( ! ( dcaps & DRIVE_CAP_BSF )) {
+	if (! (dcaps & DRIVE_CAP_BSF)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if ( ! ( dcaps & DRIVE_CAP_APPEND )) {
+	if (! (dcaps & DRIVE_CAP_APPEND)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
 }
 
 static rv_t
-dump_dirs( ix_t strmix,
+dump_dirs(ix_t strmix,
 	   xfs_bstat_t *bstatbufp,
 	   size_t bstatbuflen,
-	   void *inomap_contextp )
+	   void *inomap_contextp)
 {
 	xfs_ino_t lastino;
 	size_t bulkstatcallcnt;
@@ -2819,30 +2819,30 @@ dump_dirs( ix_t strmix,
 	/* begin iteration at ino zero
 	 */
 	lastino = 0;
-	for ( bulkstatcallcnt = 0 ; ; bulkstatcallcnt++ ) {
+	for (bulkstatcallcnt = 0 ; ; bulkstatcallcnt++) {
 		xfs_bstat_t *p;
 		xfs_bstat_t *endp;
 		__s32 buflenout;
 		int rval;
 
-		if ( bulkstatcallcnt == 0 ) {
-			mlog( MLOG_VERBOSE, _(
-			      "dumping directories\n") );
+		if (bulkstatcallcnt == 0) {
+			mlog(MLOG_VERBOSE, _(
+			      "dumping directories\n"));
 		}
-		sc_stat_pds[ strmix ].pds_phase = PDS_DIRDUMP;
+		sc_stat_pds[strmix].pds_phase = PDS_DIRDUMP;
 
 		/* check for interruption
 		 */
-		if ( cldmgr_stop_requested( )) {
+		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
 		/* get a bunch of bulkstats
 		 */
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "dump_dirs SGI_FS_BULKSTAT %u buf len %u\n",
 		      bulkstatcallcnt,
-		      bstatbuflen );
+		      bstatbuflen);
 
 		bulkreq.lastip = (__u64 *)&lastino;
 		bulkreq.icount = bstatbuflen;
@@ -2851,73 +2851,73 @@ dump_dirs( ix_t strmix,
 
 		rval = ioctl(sc_fsfd, XFS_IOC_FSBULKSTAT, &bulkreq);
 
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _(
+		if (rval) {
+			mlog(MLOG_NORMAL, _(
 			      "SGI_FS_BULKSTAT failed: "
 			      "%s (%d)\n"),
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			return RV_ERROR;
 		}
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "dump_dirs SGI_FS_BULKSTAT returns %d entries\n",
-		      buflenout );
+		      buflenout);
 
 		/* check if done
 		 */
-		if ( buflenout == 0 ) {
+		if (buflenout == 0) {
 			return RV_OK;
 		}
 
 		/* step through each node, dumping if
 		 * appropriate
 		 */
-		for ( p = bstatbufp, endp = bstatbufp + buflenout
+		for (p = bstatbufp, endp = bstatbufp + buflenout
 		      ;
 		      p < endp
 		      ;
-		      p++ ) {
+		      p++) {
 			rv_t rv;
 
-			if ( p->bs_ino == 0 )
+			if (p->bs_ino == 0)
 				continue;
 
-			if ( !p->bs_nlink || !p->bs_mode ) {
+			if (!p->bs_nlink || !p->bs_mode) {
 				/* inode being modified, get synced data */
-				mlog( MLOG_NITTY,
+				mlog(MLOG_NITTY,
 				      "ino %llu needs second bulkstat\n",
-				      p->bs_ino );
+				      p->bs_ino);
 
-				if ( bigstat_one( sc_fsfd, p->bs_ino, p ) < 0 ) {
-					mlog( MLOG_WARNING,  _(
+				if (bigstat_one(sc_fsfd, p->bs_ino, p) < 0) {
+					mlog(MLOG_WARNING,  _(
 					      "failed to get bulkstat information for inode %llu\n"),
-					      p->bs_ino );
+					      p->bs_ino);
 					continue;
 				}
-				if ( !p->bs_nlink || !p->bs_mode || !p->bs_ino ) {
-					mlog( MLOG_TRACE,
+				if (!p->bs_nlink || !p->bs_mode || !p->bs_ino) {
+					mlog(MLOG_TRACE,
 					      "failed to get valid bulkstat information for inode %llu\n",
-					      p->bs_ino );
+					      p->bs_ino);
 					continue;
 				}
 			}
-			if ( ( p->bs_mode & S_IFMT ) != S_IFDIR ) {
+			if ((p->bs_mode & S_IFMT) != S_IFDIR) {
 				continue;
 			}
 
-			rv = dump_dir( strmix, sc_fshandlep, sc_fsfd, p );
-			if ( rv != RV_OK ) {
+			rv = dump_dir(strmix, sc_fshandlep, sc_fsfd, p);
+			if (rv != RV_OK) {
 				return rv;
 			}
 		}
 
 		lastino = inomap_next_dir(inomap_contextp, lastino);
 		if (lastino == INO64MAX) {
-			mlog( MLOG_DEBUG, "bulkstat seeked to EOS\n" );
+			mlog(MLOG_DEBUG, "bulkstat seeked to EOS\n");
 			return 0;
 		}
 
-		mlog( MLOG_DEBUG, "bulkstat seeked to %llu\n", lastino );
+		mlog(MLOG_DEBUG, "bulkstat seeked to %llu\n", lastino);
 
 		lastino = (lastino > 0) ? lastino - 1 : 0;
 	}
@@ -2925,17 +2925,17 @@ dump_dirs( ix_t strmix,
 }
 
 static rv_t
-dump_dir( ix_t strmix,
+dump_dir(ix_t strmix,
 	  jdm_fshandle_t *fshandlep,
 	  int fsfd,
-	  xfs_bstat_t *statp )
+	  xfs_bstat_t *statp)
 {
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	void *inomap_contextp = contextp->cc_inomap_contextp;
 	int state;
 	int fd;
-	struct dirent *gdp = ( struct dirent *)contextp->cc_getdentsbufp;
+	struct dirent *gdp = (struct dirent *)contextp->cc_getdentsbufp;
 	size_t gdsz = contextp->cc_getdentsbufsz;
 	int gdcnt;
 	gen_t gen;
@@ -2943,104 +2943,104 @@ dump_dir( ix_t strmix,
 
 	/* no way this can be non-dir, but check anyway
 	 */
-	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
-	if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
+	assert((statp->bs_mode & S_IFMT) == S_IFDIR);
+	if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 		return RV_OK;
 	}
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink < 1 ) {
+	if (statp->bs_nlink < 1) {
 		return RV_OK;
 	}
 
 	/* see what the inomap says about this ino
 	 */
-	state = inomap_get_state( inomap_contextp, statp->bs_ino );
+	state = inomap_get_state(inomap_contextp, statp->bs_ino);
 
 	/* skip if not in inomap
 	 */
-	if ( state == MAP_INO_UNUSED
+	if (state == MAP_INO_UNUSED
 	     ||
 	     state == MAP_DIR_NOCHNG
 	     ||
-	     state == MAP_NDR_NOCHNG ) {
-		if ( state == MAP_NDR_NOCHNG ) {
-			mlog( MLOG_DEBUG,
+	     state == MAP_NDR_NOCHNG) {
+		if (state == MAP_NDR_NOCHNG) {
+			mlog(MLOG_DEBUG,
 			      "inomap inconsistency ino %llu: "
 			      "map says is non-dir but is dir: skipping\n",
-			      statp->bs_ino );
+			      statp->bs_ino);
 		}
 		return RV_OK;
 	}
 
 	/* note if map says a non-dir
 	 */
-	if ( state == MAP_NDR_CHANGE ) {
-		mlog( MLOG_DEBUG,
+	if (state == MAP_NDR_CHANGE) {
+		mlog(MLOG_DEBUG,
 		      "inomap inconsistency ino %llu: "
 		      "map says non-dir but is dir: skipping\n",
-		      statp->bs_ino );
+		      statp->bs_ino);
 		return RV_OK;
 	}
 
 	/* bump the stats now. a bit early, but fewer lines of code
 	 */
-	sc_stat_pds[ strmix ].pds_dirdone++;
+	sc_stat_pds[strmix].pds_dirdone++;
 
         /* if bulkstat ino# occupied more than 32 bits and
          * linux ino# for getdents is 32 bits then
          * warn and skip.
          */
-	if ( statp->bs_ino > ( xfs_ino_t )INOMAX ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (statp->bs_ino > (xfs_ino_t)INOMAX) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "unable to dump directory: ino %llu too large\n"),
-		      statp->bs_ino );
+		      statp->bs_ino);
 		return RV_OK; /* continue anyway */
 	}
 
-	mlog( MLOG_TRACE,
+	mlog(MLOG_TRACE,
 	      "dumping directory ino %llu\n",
-	      statp->bs_ino );
+	      statp->bs_ino);
 
 	/* open the directory named by statp
 	 */
-	fd = jdm_open( fshandlep, statp, O_RDONLY );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	fd = jdm_open(fshandlep, statp, O_RDONLY);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "unable to open directory: ino %llu: %s\n"),
-		      statp->bs_ino, strerror( errno ) );
+		      statp->bs_ino, strerror(errno) );
 		return RV_OK; /* continue anyway */
 	}
 
 	/* dump the file header.
 	 */
-	rv = dump_filehdr( drivep, contextp, statp, 0, 0 );
-	if ( rv != RV_OK ) {
-		close( fd );
+	rv = dump_filehdr(drivep, contextp, statp, 0, 0);
+	if (rv != RV_OK) {
+		close(fd);
 		return rv;
 	}
 
 	/* dump dirents - lots of buffering done here, to achieve OS-
 	 * independence. if proves to be to much overhead, can streamline.
 	 */
-	for ( gdcnt = 1, rv = RV_OK ; rv == RV_OK ; gdcnt++ ) {
+	for (gdcnt = 1, rv = RV_OK ; rv == RV_OK ; gdcnt++) {
 		struct dirent *p;
 		int nread;
 		register size_t reclen;
 
-		nread = getdents_wrap( fd, (char *)gdp, gdsz );
+		nread = getdents_wrap(fd, (char *)gdp, gdsz);
 
 		/* negative count indicates something very bad happened;
 		 * try to gracefully end this dir.
 		 */
-		if ( nread < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if (nread < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "unable to read dirents (%d) for "
 			      "directory ino %llu: %s\n"),
 			      gdcnt,
 			      statp->bs_ino,
-			      strerror( errno ));
+			      strerror(errno));
 			/* !!! curtis looked at this, and pointed out that
 			 * we could take some recovery action here. if the
 			 * errno is appropriate, lseek64 to the value of
@@ -3052,93 +3052,93 @@ dump_dir( ix_t strmix,
 
 		/* no more directory entries: break;
 		 */
-		if ( nread == 0 ) {
+		if (nread == 0) {
 			break;
 		}
 
 		/* translate and dump each entry: skip "." and ".."
 		 * and null entries.
 		 */
-		for ( p = gdp,
-		      reclen = ( size_t )p->d_reclen
+		for (p = gdp,
+		      reclen = (size_t)p->d_reclen
 		      ;
 		      nread > 0
 		      ;
-		      nread -= ( int )reclen,
-		      assert( nread >= 0 ),
-		      p = ( struct dirent * )( ( char * )p + reclen ),
-		      reclen = ( size_t )p->d_reclen ) {
+		      nread -= (int)reclen,
+		      assert(nread >= 0),
+		      p = (struct dirent *)((char *)p + reclen),
+		      reclen = (size_t)p->d_reclen) {
 			xfs_ino_t ino;
-			register size_t namelen = strlen( p->d_name );
+			register size_t namelen = strlen(p->d_name);
 #ifdef DEBUG
-			register size_t nameszmax = ( size_t )reclen
+			register size_t nameszmax = (size_t)reclen
 						    -
-						    offsetofmember( struct dirent,
-								    d_name );
+						    offsetofmember(struct dirent,
+								    d_name);
 
 			/* getdents(2) guarantees that the string will
 			 * be null-terminated, but the record may have
 			 * padding after the null-termination.
 			 */
-			assert( namelen < nameszmax );
+			assert(namelen < nameszmax);
 #endif
 
 			/* skip "." and ".."
 			 */
-			if ( *( p->d_name + 0 ) == '.'
+			if (*(p->d_name + 0) == '.'
 			     &&
-			     ( *( p->d_name + 1 ) == 0
+			     (*(p->d_name + 1) == 0
 			       ||
-			       ( *( p->d_name + 1 ) == '.'
+			       (*(p->d_name + 1) == '.'
 				 &&
-				 *( p->d_name + 2 ) == 0 ))) {
+				 *(p->d_name + 2) == 0))) {
 				continue;
 			}
 
 			ino = (xfs_ino_t)p->d_ino;
 
-			if ( ino == 0 ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (ino == 0) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "encountered 0 ino (%s) in "
 				      "directory ino %llu: NOT dumping\n"),
 				      p->d_name,
-				      statp->bs_ino );
+				      statp->bs_ino);
 				continue;
 			}
 
 			/* lookup the gen number in the ino-to-gen map.
 			 * if it's not there, we have to get it the slow way.
 			 */
-			if ( inomap_get_gen( NULL, p->d_ino, &gen) ) {
+			if (inomap_get_gen(NULL, p->d_ino, &gen)) {
 				xfs_bstat_t statbuf;
 				int scrval;
 
-				scrval = bigstat_one( fsfd,
+				scrval = bigstat_one(fsfd,
 						      p->d_ino,
-						      &statbuf );
-				if ( scrval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+						      &statbuf);
+				if (scrval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "could not stat "
 					      "dirent %s ino %llu: %s: "
 					      "using null generation count "
 					      "in directory entry\n"),
 					      p->d_name,
-					      ( xfs_ino_t )p->d_ino,
-					      strerror( errno ));
+					      (xfs_ino_t)p->d_ino,
+					      strerror(errno));
 					gen = 0;
 				} else {
 					gen = statbuf.bs_gen;
 				}
 			}
 
-			rv = dump_dirent( drivep,
+			rv = dump_dirent(drivep,
 					  contextp,
 					  statp,
 					  ino,
 					  gen,
 					  p->d_name,
-					  namelen );
-			if ( rv != RV_OK ) {
+					  namelen);
+			if (rv != RV_OK) {
 				break;
 			}
 		}
@@ -3146,19 +3146,19 @@ dump_dir( ix_t strmix,
 
 	/* write a null dirent hdr, unless trouble encountered in the loop
 	 */
-	if ( rv == RV_OK ) {
-		rv = dump_dirent( drivep, contextp, statp, 0, 0, 0, 0 );
+	if (rv == RV_OK) {
+		rv = dump_dirent(drivep, contextp, statp, 0, 0, 0, 0);
 	}
 
-	if ( rv == RV_OK
+	if (rv == RV_OK
 	     &&
 	     sc_dumpextattrpr
 	     &&
-	     ( statp->bs_xflags & XFS_XFLAG_HASATTR )) {
-		rv = dump_extattrs( drivep, contextp, fshandlep, statp);
+	     (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
+		rv = dump_extattrs(drivep, contextp, fshandlep, statp);
 	}
 
-	close( fd );
+	close(fd);
 
 	/* if an error occurred, just return the error
 	 */
@@ -3166,7 +3166,7 @@ dump_dir( ix_t strmix,
 }
 
 static rv_t
-dump_extattrs( drive_t *drivep,
+dump_extattrs(drive_t *drivep,
 	       context_t *contextp,
 	       jdm_fshandle_t *fshandlep,
 	       xfs_bstat_t *statp)
@@ -3179,39 +3179,39 @@ dump_extattrs( drive_t *drivep,
 
 	/* dump a file header specially marked as heading extended attributes
 	 */
-	mlog( MLOG_NITTY,
+	mlog(MLOG_NITTY,
 	      "dumping %s ino %llu extended attributes filehdr\n",
 	      FILETYPE(statp),
-	      statp->bs_ino );
+	      statp->bs_ino);
 
-	rv = dump_filehdr( drivep, contextp, statp, 0, FILEHDR_FLAGS_EXTATTR );
-	if ( rv != RV_OK ) {
+	rv = dump_filehdr(drivep, contextp, statp, 0, FILEHDR_FLAGS_EXTATTR);
+	if (rv != RV_OK) {
 		return rv;
 	}
 
 	/* loop three times: once for the non-root, once for root, and
 	 * again for the secure attributes.
 	 */
-	for ( pass = 0; pass < 3; pass++ ) {
+	for (pass = 0; pass < 3; pass++) {
 		bool_t more;
 
-		if ( pass == 0 )
+		if (pass == 0)
 			flag = 0;
-		else if ( pass == 1)
+		else if (pass == 1)
 			flag = ATTR_ROOT;
 		else
 			flag = ATTR_SECURE;
 
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "dumping %s extended attributes for %s ino %llu\n",
 		      EXTATTR_NAMESPACE(flag),
 		      FILETYPE(statp),
-		      statp->bs_ino );
+		      statp->bs_ino);
 
 		/* loop dumping the extended attributes from the namespace
 		 * selected by the outer loop
 		 */
-		memset( &cursor, 0, sizeof( cursor ));
+		memset(&cursor, 0, sizeof(cursor));
 		more = BOOL_FALSE;
 		do {
 			attrlist_t *listp;
@@ -3219,62 +3219,62 @@ dump_extattrs( drive_t *drivep,
 
 			rval = jdm_attr_list(fshandlep, statp,
 				contextp->cc_extattrlistbufp,
-				( int )contextp->cc_extattrlistbufsz,
-				flag, &cursor );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				(int)contextp->cc_extattrlistbufsz,
+				flag, &cursor);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "could not get list of %s attributes for "
 				      "%s ino %llu: %s (%d)\n"),
 				      EXTATTR_NAMESPACE(flag),
 				      FILETYPE(statp),
 				      statp->bs_ino,
-				      strerror( errno ),
-				      errno );
+				      strerror(errno),
+				      errno);
 				break;
 			}
 
-			listp = ( attrlist_t * )contextp->cc_extattrlistbufp;
+			listp = (attrlist_t *)contextp->cc_extattrlistbufp;
 			more = listp->al_more;
 
 			abort = BOOL_FALSE;
-			rv = dump_extattr_list( drivep,
+			rv = dump_extattr_list(drivep,
 						contextp,
 						fshandlep,
 						statp,
 						listp,
 						flag,
-						&abort );
-			if ( rv != RV_OK ) {
+						&abort);
+			if (rv != RV_OK) {
 				return rv;
 			}
-		} while ( more && !abort );
+		} while (more && !abort);
 	}
 
 	/* finally, dump a dummy extattr hdr so restore will know
 	 * we're done.
 	 */
-	/*DBG*/mlog( MLOG_NITTY,
-		     "dumping NULL extattrhdr\n" );
-	rv = dump_extattrhdr( drivep,
+	/*DBG*/mlog(MLOG_NITTY,
+		     "dumping NULL extattrhdr\n");
+	rv = dump_extattrhdr(drivep,
 			      contextp,
 			      statp,
 			      EXTATTRHDR_SZ,
 			      0,
 			      EXTATTRHDR_FLAGS_NULL,
-			      0 );
+			      0);
 	return rv;
 }
 
 static rv_t
-dump_extattr_list( drive_t *drivep,
+dump_extattr_list(drive_t *drivep,
 		   context_t *contextp,
 		   jdm_fshandle_t *fshandlep,
 		   xfs_bstat_t *statp,
 		   attrlist_t *listp,
 		   int flag,
-		   bool_t *abortprp )
+		   bool_t *abortprp)
 {
-	size_t listlen = ( size_t )listp->al_count;
+	size_t listlen = (size_t)listp->al_count;
 	ix_t nameix;
 	char *dumpbufp;
 	char *endp;
@@ -3287,7 +3287,7 @@ dump_extattr_list( drive_t *drivep,
 
 	/* sanity checks
 	 */
-	assert( listp->al_count >= 0 );
+	assert(listp->al_count >= 0);
 
 	/* fill up a retrieve array and build a dump buffer;
 	 * can run out of entries in the name list, space in the
@@ -3295,7 +3295,7 @@ dump_extattr_list( drive_t *drivep,
 	 */
 	dumpbufp = contextp->cc_extattrdumpbufp;
 	endp = dumpbufp;
-	for ( nameix = 0 ; nameix < listlen ; ) {
+	for (nameix = 0 ; nameix < listlen ;) {
 		ix_t rtrvix;
 		size_t rtrvcnt;
 
@@ -3305,8 +3305,8 @@ dump_extattr_list( drive_t *drivep,
 			char *valuep;
 			attr_multiop_t *opp;
 
-			entp = ATTR_ENTRY( listp, nameix );
-			opp = &contextp->cc_extattrrtrvarrayp[ rtrvix ];
+			entp = ATTR_ENTRY(listp, nameix);
+			opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
 
 			/* Offer the HSM a chance to avoid dumping certain
 			 * attributes.
@@ -3319,7 +3319,7 @@ dump_extattr_list( drive_t *drivep,
 				    contextp->cc_hsm_f_ctxtp, entp->a_name,
 				    entp->a_valuelen, flag,
 				    &skip_entry)) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      		    "HSM could not filter %s "
 					    "attribute %s for %s ino %llu\n"),
 					    EXTATTR_NAMESPACE(flag),
@@ -3335,21 +3335,21 @@ dump_extattr_list( drive_t *drivep,
 				}
 			}
 
-			dumpbufp = dump_extattr_buildrecord( statp,
+			dumpbufp = dump_extattr_buildrecord(statp,
 							     dumpbufp,
 							     dumpbufendp,
 							     entp->a_name,
 							     entp->a_valuelen,
 							     flag,
-							     &valuep );
-			if ( dumpbufp > dumpbufendp ) {
+							     &valuep);
+			if (dumpbufp > dumpbufendp) {
 				break;		/* won't fit in buffer */
 			}
 			if (valuep != NULL) {	/* if added to dump buffer */
 				endp = dumpbufp;
 				opp->am_attrname = entp->a_name;
 				opp->am_attrvalue = valuep;
-				opp->am_length = ( int )entp->a_valuelen;
+				opp->am_length = (int)entp->a_valuelen;
 				opp->am_flags = flag;
 				opp->am_error = 0;
 				opp->am_opcode = ATTR_OP_GET;
@@ -3365,29 +3365,29 @@ dump_extattr_list( drive_t *drivep,
 
 		rtrvcnt = rtrvix;
 		if (rtrvcnt > 0) {
-			rval = jdm_attr_multi( fshandlep, statp,
+			rval = jdm_attr_multi(fshandlep, statp,
 					(void *)contextp->cc_extattrrtrvarrayp,
-					( int )rtrvcnt,
-					0 );
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					(int)rtrvcnt,
+					0);
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "could not retrieve %s attributes for "
 				      "%s ino %llu: %s (%d)\n"),
 				      EXTATTR_NAMESPACE(flag),
 				      FILETYPE(statp),
 				      statp->bs_ino,
-				      strerror( errno ),
-				      errno );
+				      strerror(errno),
+				      errno);
 				*abortprp = BOOL_TRUE;
 				return RV_OK;
 			}
 
-			for ( rtrvix = 0 ; rtrvix < rtrvcnt ; rtrvix++ ) {
+			for (rtrvix = 0 ; rtrvix < rtrvcnt ; rtrvix++) {
 				attr_multiop_t *opp;
-				opp = &contextp->cc_extattrrtrvarrayp[ rtrvix ];
-				if ( opp->am_error ) {
-					if ( opp->am_error == ENOATTR &&
-					     flag & ATTR_SECURE ) {
+				opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
+				if (opp->am_error) {
+					if (opp->am_error == ENOATTR &&
+					     flag & ATTR_SECURE) {
 				/* Security attributes are supported by
 				 * the kernel but jdm_attr_multi() returns
 				 * ENOATTR for every 'user' space attribute
@@ -3399,7 +3399,7 @@ dump_extattr_list( drive_t *drivep,
 				 */
 						continue;
 					}
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					     "attr_multi indicates error while "
 					     "retrieving %s attribute [%s] for "
 					     "%s ino %llu: %s (%d)\n"),
@@ -3407,8 +3407,8 @@ dump_extattr_list( drive_t *drivep,
 					     opp->am_attrname,
 					     FILETYPE(statp),
 					     statp->bs_ino,
-					     strerror( opp->am_error ),
-					     opp->am_error );
+					     strerror(opp->am_error),
+					     opp->am_error);
 				}
 			}
 		}
@@ -3421,15 +3421,15 @@ dump_extattr_list( drive_t *drivep,
 		if (dumpbufp <= dumpbufendp)
 			continue;	/* no buffer overflow yet */
 
-		assert( endp > contextp->cc_extattrdumpbufp );
-		bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
+		assert(endp > contextp->cc_extattrdumpbufp);
+		bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
-		rval = write_buf( contextp->cc_extattrdumpbufp,
+		rval = write_buf(contextp->cc_extattrdumpbufp,
 				  bufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -3445,7 +3445,7 @@ dump_extattr_list( drive_t *drivep,
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			*abortprp = BOOL_FALSE;
 			return rv;
 		}
@@ -3471,7 +3471,7 @@ dump_extattr_list( drive_t *drivep,
 						&hsmnamep,
 						&hsmvaluep,
 						&hsmvaluesz)) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      		"HSM could not add new %s attribute "
 					"#%d for %s ino %llu\n"),
 					EXTATTR_NAMESPACE(flag),
@@ -3485,30 +3485,30 @@ dump_extattr_list( drive_t *drivep,
 				break;		/* No more attributes to add */
 			}
 
-			dumpbufp = dump_extattr_buildrecord( statp,
+			dumpbufp = dump_extattr_buildrecord(statp,
 							     dumpbufp,
 							     dumpbufendp,
 							     hsmnamep,
 							     hsmvaluesz,
 							     flag,
-							     &valuep );
+							     &valuep);
 
-			if ( dumpbufp < dumpbufendp ) {	/* if fits in buffer */
+			if (dumpbufp < dumpbufendp) {	/* if fits in buffer */
 				endp = dumpbufp;
 				(void)memcpy(valuep, hsmvaluep, hsmvaluesz);
 				hsmcursor++;
 				continue;
 			}
 
-			assert( endp > contextp->cc_extattrdumpbufp );
-			bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
+			assert(endp > contextp->cc_extattrdumpbufp);
+			bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
-			rval = write_buf( contextp->cc_extattrdumpbufp,
+			rval = write_buf(contextp->cc_extattrdumpbufp,
 				  bufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-			switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+			switch (rval) {
 			case 0:
 				rv = RV_OK;
 				break;
@@ -3524,7 +3524,7 @@ dump_extattr_list( drive_t *drivep,
 				rv = RV_CORE;
 				break;
 			}
-			if ( rv != RV_OK ) {
+			if (rv != RV_OK) {
 				*abortprp = BOOL_FALSE;
 				return rv;
 			}
@@ -3538,14 +3538,14 @@ dump_extattr_list( drive_t *drivep,
 	 */
 
 	if (endp > contextp->cc_extattrdumpbufp) {
-		bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
+		bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
-		rval = write_buf( contextp->cc_extattrdumpbufp,
+		rval = write_buf(contextp->cc_extattrdumpbufp,
 				  bufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -3561,7 +3561,7 @@ dump_extattr_list( drive_t *drivep,
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			*abortprp = BOOL_FALSE;
 			return rv;
 		}
@@ -3572,58 +3572,58 @@ dump_extattr_list( drive_t *drivep,
 }
 
 static char *
-dump_extattr_buildrecord( xfs_bstat_t *statp,
+dump_extattr_buildrecord(xfs_bstat_t *statp,
 			  char *dumpbufp,
 			  char *dumpbufendp,
 			  char *namesrcp,
 			  uint32_t valuesz,
 			  int flag,
-			  char **valuepp )
+			  char **valuepp)
 {
-	extattrhdr_t *ahdrp = ( extattrhdr_t * )dumpbufp;
+	extattrhdr_t *ahdrp = (extattrhdr_t *)dumpbufp;
 	char *namep = dumpbufp + EXTATTRHDR_SZ;
-	uint32_t namelen = strlen( namesrcp );
+	uint32_t namelen = strlen(namesrcp);
 	uint32_t namesz = namelen + 1;
 	char *valuep = namep + namesz;
 	uint32_t recsz = EXTATTRHDR_SZ + namesz + valuesz;
 	extattrhdr_t tmpah;
 
-	recsz = ( recsz + ( EXTATTRHDR_ALIGN - 1 ))
+	recsz = (recsz + (EXTATTRHDR_ALIGN - 1))
 		&
-		~( EXTATTRHDR_ALIGN - 1 );
+		~(EXTATTRHDR_ALIGN - 1);
 
-	if ( dumpbufp + recsz > dumpbufendp ) {
+	if (dumpbufp + recsz > dumpbufendp) {
 		*valuepp = 0;
 		return dumpbufp + recsz;
 	}
 
-	if ( namelen > NAME_MAX ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (namelen > NAME_MAX) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "%s extended attribute name for %s ino %llu too long: "
 		      "%u, max is %u: skipping\n"),
 		      EXTATTR_NAMESPACE(flag),
 		      FILETYPE(statp),
 		      statp->bs_ino,
 		      namelen,
-		      NAME_MAX );
+		      NAME_MAX);
 		*valuepp = 0;
 		return dumpbufp;
 	}
 
-	if ( valuesz > ATTR_MAX_VALUELEN ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (valuesz > ATTR_MAX_VALUELEN) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "%s extended attribute value for %s ino %llu too long: "
 		      "%u, max is %u: skipping\n"),
 		      EXTATTR_NAMESPACE(flag),
 		      FILETYPE(statp),
 		      statp->bs_ino,
 		      valuesz,
-		      ATTR_MAX_VALUELEN );
+		      ATTR_MAX_VALUELEN);
 		*valuepp = 0;
 		return dumpbufp;
 	}
 
-	/*DBG*/mlog( MLOG_NITTY,
+	/*DBG*/mlog(MLOG_NITTY,
 		     "building extattr "
 		     "record sz %u "
 		     "hdrsz %u "
@@ -3632,19 +3632,19 @@ dump_extattr_buildrecord( xfs_bstat_t *statp,
 		     recsz,
 		     EXTATTRHDR_SZ,
 		     namesz, namesrcp,
-		     valuesz );
-	( void )strcpy( namep, namesrcp );
+		     valuesz);
+	(void)strcpy(namep, namesrcp);
 
-	memset( ( void * )&tmpah, 0, sizeof( tmpah ));
+	memset((void *)&tmpah, 0, sizeof(tmpah));
 	tmpah.ah_sz = recsz;
-	assert( EXTATTRHDR_SZ + namesz < UINT16MAX );
-	tmpah.ah_valoff = ( uint16_t )( EXTATTRHDR_SZ + namesz );
-	tmpah.ah_flags = ( uint16_t )
-		(( flag & ATTR_ROOT ) ? EXTATTRHDR_FLAGS_ROOT :
-		(( flag & ATTR_SECURE ) ? EXTATTRHDR_FLAGS_SECURE : 0));
+	assert(EXTATTRHDR_SZ + namesz < UINT16MAX);
+	tmpah.ah_valoff = (uint16_t)(EXTATTRHDR_SZ + namesz);
+	tmpah.ah_flags = (uint16_t)
+		((flag & ATTR_ROOT) ? EXTATTRHDR_FLAGS_ROOT :
+		((flag & ATTR_SECURE) ? EXTATTRHDR_FLAGS_SECURE : 0));
 	tmpah.ah_valsz = valuesz;
 	tmpah.ah_flags |= EXTATTRHDR_FLAGS_CHECKSUM;
-	tmpah.ah_checksum = calc_checksum( &tmpah, EXTATTRHDR_SZ );
+	tmpah.ah_checksum = calc_checksum(&tmpah, EXTATTRHDR_SZ);
 
 	xlate_extattrhdr(ahdrp, &tmpah, -1);
 	*valuepp = valuep;
@@ -3653,34 +3653,34 @@ dump_extattr_buildrecord( xfs_bstat_t *statp,
 
 /* ARGSUSED */
 static rv_t
-dump_extattrhdr( drive_t *drivep,
+dump_extattrhdr(drive_t *drivep,
 		 context_t *contextp,
 		 xfs_bstat_t *statp,
 		 size_t recsz,
 		 size_t valoff,
 		 ix_t flags,
-		 uint32_t valsz )
+		 uint32_t valsz)
 {
 	extattrhdr_t ahdr;
 	extattrhdr_t tmpahdr;
 	int rval;
 	rv_t rv;
 
-	memset( ( void * )&ahdr, 0, sizeof( ahdr ));
+	memset((void *)&ahdr, 0, sizeof(ahdr));
 	ahdr.ah_sz = recsz;
-	assert( valoff < UINT16MAX );
-	ahdr.ah_valoff = ( uint16_t )valoff;
-	ahdr.ah_flags = ( uint16_t )flags | EXTATTRHDR_FLAGS_CHECKSUM;
+	assert(valoff < UINT16MAX);
+	ahdr.ah_valoff = (uint16_t)valoff;
+	ahdr.ah_flags = (uint16_t)flags | EXTATTRHDR_FLAGS_CHECKSUM;
 	ahdr.ah_valsz = valsz;
-	ahdr.ah_checksum = calc_checksum( &ahdr, EXTATTRHDR_SZ );
+	ahdr.ah_checksum = calc_checksum(&ahdr, EXTATTRHDR_SZ);
 
 	xlate_extattrhdr(&ahdr, &tmpahdr, 1);
-	rval = write_buf( ( char * )&tmpahdr,
+	rval = write_buf((char *)&tmpahdr,
 			  EXTATTRHDR_SZ,
-			  ( void * )drivep,
-			  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-			  ( wfp_t )drivep->d_opsp->do_write );
-	switch ( rval ) {
+			  (void *)drivep,
+			  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+			  (wfp_t)drivep->d_opsp->do_write);
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -3709,19 +3709,19 @@ dump_extattrhdr( drive_t *drivep,
  */
 /* ARGSUSED */
 static rv_t
-dump_file( void *arg1,
+dump_file(void *arg1,
 	   jdm_fshandle_t *fshandlep,
 	   int fsfd,
-	   xfs_bstat_t *statp )
+	   xfs_bstat_t *statp)
 {
-	ix_t strmix = ( ix_t )arg1;
-	context_t *contextp = &sc_contextp[ strmix ];
-	drive_t *drivep = drivepp[ strmix ];
+	ix_t strmix = (ix_t)arg1;
+	context_t *contextp = &sc_contextp[strmix];
+	drive_t *drivep = drivepp[strmix];
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
-	content_hdr_t *cwhdrp = ( content_hdr_t * )mwhdrp->mh_upper;
-	content_inode_hdr_t *scwhdrp = ( content_inode_hdr_t * )
-				       ( void * )
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
+	content_hdr_t *cwhdrp = (content_hdr_t *)mwhdrp->mh_upper;
+	content_inode_hdr_t *scwhdrp = (content_inode_hdr_t *)
+				       (void *)
 				       cwhdrp->ch_specific;
 	startpt_t *startptp = &scwhdrp->cih_startpt;
 	startpt_t *endptp = &scwhdrp->cih_endpt;
@@ -3731,22 +3731,22 @@ dump_file( void *arg1,
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink < 1 ) {
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+	if (statp->bs_nlink < 1) {
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as no links for ino %llu\n",
+		mlog(MLOG_DEBUG, "skip as no links for ino %llu\n",
 			statp->bs_ino);
 		return RV_OK;
 	}
 
 	/* skip if prior to startpoint
 	 */
-	if ( statp->bs_ino < startptp->sp_ino ) {
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+	if (statp->bs_ino < startptp->sp_ino) {
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n",
+		mlog(MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n",
 			statp->bs_ino);
 		return RV_OK;
 	}
@@ -3754,22 +3754,22 @@ dump_file( void *arg1,
 	/* skip if at or beyond next startpoint. return non-zero to
 	 * abort iteration.
 	 */
-	if ( ! ( endptp->sp_flags & STARTPT_FLAGS_END )) {
-		if ( endptp->sp_offset == 0 ) {
-			if ( statp->bs_ino >= endptp->sp_ino ) {
-				if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+	if (! (endptp->sp_flags & STARTPT_FLAGS_END)) {
+		if (endptp->sp_offset == 0) {
+			if (statp->bs_ino >= endptp->sp_ino) {
+				if (statp->bs_ino > contextp->cc_stat_lastino) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
-				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
+				mlog(MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
 					statp->bs_ino);
 				return RV_NOMORE;
 			}
 		} else {
-			if ( statp->bs_ino > endptp->sp_ino ) {
-				if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+			if (statp->bs_ino > endptp->sp_ino) {
+				if (statp->bs_ino > contextp->cc_stat_lastino) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
-				mlog( MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
+				mlog(MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
 					statp->bs_ino);
 				return RV_NOMORE;
 			}
@@ -3778,35 +3778,35 @@ dump_file( void *arg1,
 
 	/* see what the inomap says about this ino
 	 */
-	state = inomap_get_state( contextp->cc_inomap_contextp, statp->bs_ino );
+	state = inomap_get_state(contextp->cc_inomap_contextp, statp->bs_ino);
 
 	/* skip if not in inomap
 	 */
-	if ( state == MAP_INO_UNUSED
+	if (state == MAP_INO_UNUSED
 	     ||
 	     state == MAP_DIR_NOCHNG
 	     ||
-	     state == MAP_NDR_NOCHNG ) {
-		if ( state == MAP_DIR_NOCHNG ) {
-			mlog( MLOG_DEBUG,
+	     state == MAP_NDR_NOCHNG) {
+		if (state == MAP_DIR_NOCHNG) {
+			mlog(MLOG_DEBUG,
 			      "inomap inconsistency ino %llu: "
 			      "MAP_DIR_NOCHNG but is non-dir: skipping\n",
-			      statp->bs_ino );
+			      statp->bs_ino);
 		}
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
-		mlog( MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n",
+		mlog(MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n",
 			statp->bs_ino);
-		mlog( MLOG_DEBUG, "ino %llu is in state %d\n",
+		mlog(MLOG_DEBUG, "ino %llu is in state %d\n",
 			statp->bs_ino, state);
 		return RV_OK;
 	}
 
 	/* note if map says a dir
 	 */
-	if ( state == MAP_DIR_CHANGE || state == MAP_DIR_SUPPRT ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (state == MAP_DIR_CHANGE || state == MAP_DIR_SUPPRT) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "inomap inconsistency ino %llu: "
 		      "%s but is now non-dir: NOT dumping\n"),
 		      statp->bs_ino,
@@ -3814,7 +3814,7 @@ dump_file( void *arg1,
 		      ?
 		      "map says changed dir"
 		      :
-		      "map says unchanged dir" );
+		      "map says unchanged dir");
 	}
 
 	/* if GETOPT_DUMPASOFFLINE was specified, initialize the HSM's file
@@ -3824,11 +3824,11 @@ dump_file( void *arg1,
 
 	if (hsm_fs_ctxtp) {
 		if (HsmInitFileContext(contextp->cc_hsm_f_ctxtp, statp)) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "inomap inconsistency ino %llu: "
 			      "hsm detected error: NOT dumping\n"),
 			      statp->bs_ino);
-			if ( statp->bs_ino > contextp->cc_stat_lastino ) {
+			if (statp->bs_ino > contextp->cc_stat_lastino) {
 				contextp->cc_stat_lastino = statp->bs_ino;
 			}
 			return RV_OK;
@@ -3837,7 +3837,7 @@ dump_file( void *arg1,
 
 	/* pass on to specific dump function
 	 */
-	switch( statp->bs_mode & S_IFMT ) {
+	switch(statp->bs_mode & S_IFMT) {
 	case S_IFREG:
 		/* ordinary file
 		 */
@@ -3847,7 +3847,7 @@ dump_file( void *arg1,
 		 */
 		if (maxdumpfilesize) {
 			off64_t estimated_size = statp->bs_blocks *
-						 ( off64_t )statp->bs_blksize;
+						 (off64_t)statp->bs_blksize;
 
 			if (hsm_fs_ctxtp) {
 				HsmEstimateFileSpace(hsm_fs_ctxtp,
@@ -3860,23 +3860,23 @@ dump_file( void *arg1,
 			/* quota files are exempt from max size check */
 			if (estimated_size > maxdumpfilesize &&
 			    !is_quota_file(statp->bs_ino)) {
-				mlog( MLOG_DEBUG | MLOG_NOTE,
+				mlog(MLOG_DEBUG | MLOG_NOTE,
 				      "ino %llu increased beyond maximum size: "
 				      "NOT dumping\n",
 				      statp->bs_ino);
 				return RV_OK;
 			}
 		}
-		rv = dump_file_reg( drivep,
+		rv = dump_file_reg(drivep,
 				    contextp,
 				    scwhdrp,
 				    fshandlep,
 				    statp,
-				    &file_skipped );
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
-			lock( );
+				    &file_skipped);
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
+			lock();
 			sc_stat_nondirdone++;
-			unlock( );
+			unlock();
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		break; /* drop out of switch to extattr dump */
@@ -3890,11 +3890,11 @@ dump_file( void *arg1,
 	case S_IFSOCK:
 		/* only need a filehdr_t; no data
 		 */
-		rv = dump_file_spec( drivep, contextp, fshandlep, statp );
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
-			lock( );
+		rv = dump_file_spec(drivep, contextp, fshandlep, statp);
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
+			lock();
 			sc_stat_nondirdone++;
-			unlock( );
+			unlock();
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		break; /* drop out of switch to extattr dump */
@@ -3902,14 +3902,14 @@ dump_file( void *arg1,
 	default:
 		/* don't know how to dump these
 		 */
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "don't know how to dump ino %llu: mode %08x\n"),
 		      statp->bs_ino,
-		      statp->bs_mode );
-		if ( statp->bs_ino > contextp->cc_stat_lastino ) {
-			lock( );
+		      statp->bs_mode);
+		if (statp->bs_ino > contextp->cc_stat_lastino) {
+			lock();
 			sc_stat_nondirdone++;
-			unlock( );
+			unlock();
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		return RV_OK;
@@ -3918,14 +3918,14 @@ dump_file( void *arg1,
 	 */
 	}
 
-	if ( rv == RV_OK
+	if (rv == RV_OK
 	     &&
 	     file_skipped == BOOL_FALSE
 	     &&
 	     sc_dumpextattrpr
 	     &&
-	     ( statp->bs_xflags & XFS_XFLAG_HASATTR )) {
-		rv = dump_extattrs( drivep, contextp, fshandlep, statp);
+	     (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
+		rv = dump_extattrs(drivep, contextp, fshandlep, statp);
 	}
 
 	return rv;
@@ -3938,12 +3938,12 @@ dump_file( void *arg1,
  * operator requested stop.
  */
 static rv_t
-dump_file_reg( drive_t *drivep,
+dump_file_reg(drive_t *drivep,
 	       context_t *contextp,
 	       content_inode_hdr_t *scwhdrp,
 	       jdm_fshandle_t *fshandlep,
 	       xfs_bstat_t *statp,
-	       bool_t *file_skippedp )
+	       bool_t *file_skippedp)
 {
 	startpt_t *startptp = &scwhdrp->cih_startpt;
 	startpt_t *endptp = &scwhdrp->cih_endpt;
@@ -3959,9 +3959,9 @@ dump_file_reg( drive_t *drivep,
 	 * it must have been aligned to the basic fs block size by the
 	 * startpoint calculations done during strategy initialization.
 	 */
-	if ( statp->bs_ino == startptp->sp_ino ) {
+	if (statp->bs_ino == startptp->sp_ino) {
 		offset = startptp->sp_offset;
-		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
 	} else {
 		offset = 0;
 	}
@@ -3971,35 +3971,35 @@ dump_file_reg( drive_t *drivep,
 	 * above, and that file hasn't changed since the resumed dump,
 	 * modify offset.
 	 */
-	if ( sc_resumepr ) {
+	if (sc_resumepr) {
 		drange_t *drangep = sc_resumerangep;
 		size_t drangecnt = sc_resumerangecnt;
 		size_t drangeix;
 
-		for ( drangeix = 0 ; drangeix < drangecnt ; drangeix++ ) {
-			drange_t *rp = &drangep[ drangeix ];
-			if ( statp->bs_ino == rp->dr_begin.sp_ino ) {
+		for (drangeix = 0 ; drangeix < drangecnt ; drangeix++) {
+			drange_t *rp = &drangep[drangeix];
+			if (statp->bs_ino == rp->dr_begin.sp_ino) {
 				register time32_t mtime = statp->bs_mtime.tv_sec;
 				register time32_t ctime = statp->bs_ctime.tv_sec;
-				register time32_t ltime = max( mtime, ctime );
-				if ( ltime < sc_resumebasetime ) {
-					if ( rp->dr_begin.sp_offset > offset ){
+				register time32_t ltime = max(mtime, ctime);
+				if (ltime < sc_resumebasetime) {
+					if (rp->dr_begin.sp_offset > offset){
 						offset =rp->dr_begin.sp_offset;
 					}
 				}
 				break;
 			}
 		}
-		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
 	}
 
 	/* determine the offset within the file where the dump should end.
 	 * only significant if this is an inode spanning a startpoint.
 	 */
-	if ( endptp->sp_flags & STARTPT_FLAGS_END ) {
+	if (endptp->sp_flags & STARTPT_FLAGS_END) {
 		sosig = BOOL_FALSE;
 		stopoffset = 0;
-	} else if ( statp->bs_ino == endptp->sp_ino ) {
+	} else if (statp->bs_ino == endptp->sp_ino) {
 		sosig = BOOL_TRUE;
 		stopoffset = endptp->sp_offset;
 	} else {
@@ -4007,7 +4007,7 @@ dump_file_reg( drive_t *drivep,
 		stopoffset = 0;
 	}
 
-	mlog( MLOG_TRACE,
+	mlog(MLOG_TRACE,
 	      "dumping regular file ino %llu "
 	      "offset %lld "
 	      "to offset %lld "
@@ -4015,7 +4015,7 @@ dump_file_reg( drive_t *drivep,
 	      statp->bs_ino,
 	      offset,
 	      sosig ? stopoffset : statp->bs_size,
-	      statp->bs_size );
+	      statp->bs_size);
 
 	/* calculate the maximum extent group size. files larger than this
 	 * will be broken into multiple extent groups, each with its own
@@ -4026,16 +4026,16 @@ dump_file_reg( drive_t *drivep,
 	/* initialize the extent group context. if fails, just return,
 	 * pretending the dump succeeded.
 	 */
-	rv = init_extent_group_context( fshandlep,
+	rv = init_extent_group_context(fshandlep,
 					statp,
-					&extent_group_context );
-	if ( rv != RV_OK ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					&extent_group_context);
+	if (rv != RV_OK) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not open regular file ino %llu mode 0x%08x: "
 		      "%s: not dumped\n"),
 		      statp->bs_ino,
 		      statp->bs_mode,
-		      strerror( errno ));
+		      strerror(errno));
 		*file_skippedp = BOOL_TRUE;
 		return RV_OK;
 	}
@@ -4051,14 +4051,14 @@ dump_file_reg( drive_t *drivep,
 	cmpltflg = BOOL_FALSE;
 
 	rv = RV_OK;
-	for ( ; ; ) {
+	for (; ;) {
 		off64_t bytecnt = 0;
 		off64_t bc;
 
 		/* see if we are done.
 		 */
-		if ( cmpltflg ) {
-			assert( rv == RV_OK );
+		if (cmpltflg) {
+			assert(rv == RV_OK);
 			break;
 		}
 
@@ -4067,23 +4067,23 @@ dump_file_reg( drive_t *drivep,
 		 * interrupt the dump. this mark, if committed, indicates
 		 * the previous fs file / extent group was completely dumped.
 		 */
-		mark_set( drivep, statp->bs_ino, offset, 0 );
+		mark_set(drivep, statp->bs_ino, offset, 0);
 
 		/* spoof EOF if the media file size is getting too big.
 		 * note that the most we can go over is d_recmarksep.
 		 */
-		if ( contextp->cc_mfilesz >= drivep->d_recmfilesz ){
+		if (contextp->cc_mfilesz >= drivep->d_recmfilesz){
 			rv = RV_EOF;
 			break;
 		}
 
 		/* check if the operator has requested to interrupt the dump.
 		 */
-		if ( cldmgr_stop_requested( )) {
-			mlog( MLOG_NORMAL, _(
+		if (cldmgr_stop_requested()) {
+			mlog(MLOG_NORMAL, _(
 			      "dump interrupted prior to ino %llu offset %lld\n"),
 			      statp->bs_ino,
-			      offset );
+			      offset);
 			mlog_exit_hint(RV_INTR);
 			rv = RV_INTR;
 			break;
@@ -4091,15 +4091,15 @@ dump_file_reg( drive_t *drivep,
 
 		/* dump the file header
 		 */
-		mlog( MLOG_DEBUG,
+		mlog(MLOG_DEBUG,
 		      "dumping extent group ino %llu offset %lld\n",
 		      statp->bs_ino,
-		      offset );
-		rv = dump_filehdr( drivep, contextp, statp, offset, 0 );
-		if ( rv != RV_OK ) {
+		      offset);
+		rv = dump_filehdr(drivep, contextp, statp, offset, 0);
+		if (rv != RV_OK) {
 			break;
 		}
-		bytecnt += sizeof( filehdr_t );
+		bytecnt += sizeof(filehdr_t);
 
 		/* dump a group of extents. returns by reference
 		 * the offset of the next extent group (to be placed
@@ -4108,7 +4108,7 @@ dump_file_reg( drive_t *drivep,
 		 * all extents have been dumped.
 		 */
 		bc = 0; /* for lint */
-		rv = dump_extent_group( drivep,
+		rv = dump_extent_group(drivep,
 					contextp,
 					statp,
 					&extent_group_context,
@@ -4117,33 +4117,33 @@ dump_file_reg( drive_t *drivep,
 					sosig,
 					&offset,
 					&bc,
-					&cmpltflg );
-		assert( bc >= 0 );
+					&cmpltflg);
+		assert(bc >= 0);
 		bytecnt += bc;
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			break;
 		}
 
 		/* update global stat
 		 */
-		lock( );
-		sc_stat_datadone += ( size64_t )bc;
-		unlock( );
+		lock();
+		sc_stat_datadone += (size64_t)bc;
+		unlock();
 
 		/* dump LAST extent hdr. one of these is placed at the
 		 * end of each dumped file. necessary to detect the
 		 * end of the file.
 		 */
-		rv = dump_extenthdr( drivep,
+		rv = dump_extenthdr(drivep,
 				     contextp,
 				     EXTENTHDR_TYPE_LAST,
 				     0,
 				     0,
-				     0 );
-		if ( rv != RV_OK ) {
+				     0);
+		if (rv != RV_OK) {
 			break;
 		}
-		bytecnt += sizeof( extenthdr_t );
+		bytecnt += sizeof(extenthdr_t);
 
 		/* update the media file size
 		 */
@@ -4151,7 +4151,7 @@ dump_file_reg( drive_t *drivep,
 
 	}
 
-	cleanup_extent_group_context( &extent_group_context );
+	cleanup_extent_group_context(&extent_group_context);
 	return rv;
 }
 
@@ -4160,42 +4160,42 @@ dump_file_reg( drive_t *drivep,
  * appends a variable-length string after the filehdr_t.
  */
 static rv_t
-dump_file_spec( drive_t *drivep,
+dump_file_spec(drive_t *drivep,
 		context_t *contextp,
 		jdm_fshandle_t *fshandlep,
-		xfs_bstat_t *statp )
+		xfs_bstat_t *statp)
 {
 	int rval;
 	rv_t rv;
 
-	mlog( MLOG_TRACE,
+	mlog(MLOG_TRACE,
 	      "dumping special file ino %llu mode 0x%04x\n",
 	      statp->bs_ino,
-	      statp->bs_mode );
+	      statp->bs_mode);
 
 	/* set a mark - important to do this now, before deciding
 	 * the media file is to big. this mark, if committed,
 	 * indicates the previous fs file was completely dumped.
 	 */
-	mark_set( drivep, statp->bs_ino, 0, 0 );
+	mark_set(drivep, statp->bs_ino, 0, 0);
 
 	/* dump the file header
 	 */
-	rv = dump_filehdr( drivep, contextp, statp, 0, 0 );
-	if ( rv != RV_OK ) {
+	rv = dump_filehdr(drivep, contextp, statp, 0, 0);
+	if (rv != RV_OK) {
 		return rv;
 	}
 
 	/* update the media file size
 	 */
-	contextp->cc_mfilesz += sizeof( filehdr_t );
+	contextp->cc_mfilesz += sizeof(filehdr_t);
 
 	/* if a symbolic link, also dump the link pathname.
 	 * use an extent header to represent the pathname. the
 	 * extent sz will always be a multiple of SYMLINK_ALIGN.
 	 * the symlink pathname char string will always  be NULL-terminated.
 	 */
-	if ( ( statp->bs_mode & S_IFMT ) == S_IFLNK ) {
+	if ((statp->bs_mode & S_IFMT) == S_IFLNK) {
 		int nread;
 		size_t extentsz;
 
@@ -4204,50 +4204,50 @@ dump_file_spec( drive_t *drivep,
 		 * bytes to dump, and contextp->cc_direntbufp will contain
 		 * the bytes.
 		 */
-		nread = jdm_readlink( fshandlep,
+		nread = jdm_readlink(fshandlep,
 				      statp,
 				      contextp->cc_readlinkbufp,
-				      contextp->cc_readlinkbufsz );
-		if ( nread < 0 ) {
-			mlog( MLOG_DEBUG,
+				      contextp->cc_readlinkbufsz);
+		if (nread < 0) {
+			mlog(MLOG_DEBUG,
 			      "could not read symlink ino %llu\n",
-			      statp->bs_ino );
+			      statp->bs_ino);
 			nread = 0;
 		}
 
 		/* null-terminate the string
 		 */
-		assert( ( size_t )nread < contextp->cc_readlinkbufsz );
-		contextp->cc_readlinkbufp[ nread ] = 0;
+		assert((size_t)nread < contextp->cc_readlinkbufsz);
+		contextp->cc_readlinkbufp[nread] = 0;
 
 		/* calculate the extent size - be sure to include room
 		 * for the null-termination.
 		 */
-		extentsz = ( ( size_t )nread + 1 + ( SYMLINK_ALIGN - 1 ))
+		extentsz = ((size_t)nread + 1 + (SYMLINK_ALIGN - 1))
 			   &
-			   ~ ( SYMLINK_ALIGN - 1 );
-		assert( extentsz <= contextp->cc_readlinkbufsz );
+			   ~ (SYMLINK_ALIGN - 1);
+		assert(extentsz <= contextp->cc_readlinkbufsz);
 
 		/* dump an extent header
 		 */
-		rv = dump_extenthdr( drivep,
+		rv = dump_extenthdr(drivep,
 				     contextp,
 				     EXTENTHDR_TYPE_DATA,
 				     0,
 				     0,
-				     ( off64_t )extentsz );
-		if ( rv != RV_OK ) {
+				     (off64_t)extentsz);
+		if (rv != RV_OK) {
 			return rv;
 		}
 
 		/* dump the link path extent
 		 */
-		rval = write_buf( contextp->cc_readlinkbufp,
+		rval = write_buf(contextp->cc_readlinkbufp,
 				  extentsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-				  ( wfp_t )drivep->d_opsp->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				  (wfp_t)drivep->d_opsp->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -4263,7 +4263,7 @@ dump_file_spec( drive_t *drivep,
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			return rv;
 		}
 	}
@@ -4276,30 +4276,30 @@ dump_file_spec( drive_t *drivep,
  * does anything else.
  */
 static rv_t
-init_extent_group_context( jdm_fshandle_t *fshandlep,
+init_extent_group_context(jdm_fshandle_t *fshandlep,
 			   xfs_bstat_t *statp,
-			   extent_group_context_t *gcp )
+			   extent_group_context_t *gcp)
 {
 	bool_t isrealtime;
 	int oflags;
 	struct flock fl;
 
-	isrealtime = ( bool_t )(statp->bs_xflags & XFS_XFLAG_REALTIME );
+	isrealtime = (bool_t)(statp->bs_xflags & XFS_XFLAG_REALTIME);
 	oflags = O_RDONLY;
-	if ( isrealtime ) {
+	if (isrealtime) {
 		oflags |= O_DIRECT;
 	}
-	( void )memset( ( void * )gcp, 0, sizeof( *gcp ));
-	gcp->eg_bmap[ 0 ].bmv_offset = 0;
-	gcp->eg_bmap[ 0 ].bmv_length = -1;
-	gcp->eg_bmap[ 0 ].bmv_count = BMAP_LEN;
-	gcp->eg_bmap[ 0 ].bmv_iflags = BMV_IF_NO_DMAPI_READ;
-	gcp->eg_nextbmapp = &gcp->eg_bmap[ 1 ];
-	gcp->eg_endbmapp = &gcp->eg_bmap[ 1 ];
+	(void)memset((void *)gcp, 0, sizeof(*gcp));
+	gcp->eg_bmap[0].bmv_offset = 0;
+	gcp->eg_bmap[0].bmv_length = -1;
+	gcp->eg_bmap[0].bmv_count = BMAP_LEN;
+	gcp->eg_bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
+	gcp->eg_nextbmapp = &gcp->eg_bmap[1];
+	gcp->eg_endbmapp = &gcp->eg_bmap[1];
 	gcp->eg_bmapix = 0;
 	gcp->eg_gbmcnt = 0;
-	gcp->eg_fd = jdm_open( fshandlep, statp, oflags );
-	if ( gcp->eg_fd < 0 ) {
+	gcp->eg_fd = jdm_open(fshandlep, statp, oflags);
+	if (gcp->eg_fd < 0) {
 		return RV_ERROR;
 	}
 
@@ -4309,15 +4309,15 @@ init_extent_group_context( jdm_fshandle_t *fshandlep,
 	 * after this check but before all reads have completed.
 	 * This change just closes the window a bit.
 	 */
-	if ( (statp->bs_mode & S_ISGID) && ( ! (statp->bs_mode&S_IXOTH) ) ) {
+	if ((statp->bs_mode & S_ISGID) && (! (statp->bs_mode&S_IXOTH)) ) {
 		fl.l_type = F_RDLCK;
 		fl.l_whence = SEEK_SET;
 		fl.l_start = (off_t)0;
 		fl.l_len = 0;
-		if ((fcntl(gcp->eg_fd, F_GETLK, &fl)) < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+		if ((fcntl(gcp->eg_fd, F_GETLK, &fl)) < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "locking check failed ino %llu\n"),
-			      statp->bs_ino );
+			      statp->bs_ino);
 			close(gcp->eg_fd);
 			return RV_ERROR;
 		}
@@ -4332,13 +4332,13 @@ init_extent_group_context( jdm_fshandle_t *fshandlep,
 }
 
 static void
-cleanup_extent_group_context( extent_group_context_t *gcp )
+cleanup_extent_group_context(extent_group_context_t *gcp)
 {
-	( void )close( gcp->eg_fd );
+	(void)close(gcp->eg_fd);
 }
 
 static rv_t
-dump_extent_group( drive_t *drivep,
+dump_extent_group(drive_t *drivep,
 		   context_t *contextp,
 		   xfs_bstat_t *statp,
 		   extent_group_context_t *gcp,
@@ -4347,13 +4347,13 @@ dump_extent_group( drive_t *drivep,
 		   bool_t sosig,
 		   off64_t *nextoffsetp,
 		   off64_t *bytecntp,
-		   bool_t *cmpltflgp )
+		   bool_t *cmpltflgp)
 {
 	struct dioattr da;
 	drive_ops_t *dop = drivep->d_opsp;
-	bool_t isrealtime = ( bool_t )( statp->bs_xflags
+	bool_t isrealtime = (bool_t)(statp->bs_xflags
 					&
-					XFS_XFLAG_REALTIME );
+					XFS_XFLAG_REALTIME);
 	off64_t nextoffset;
 	off64_t bytecnt;	/* accumulates total bytes sent to media */
 	int rval;
@@ -4362,11 +4362,11 @@ dump_extent_group( drive_t *drivep,
 	/*
 	 * Setup realtime I/O size.
 	 */
-	if ( isrealtime ) {
-		if ( (ioctl(gcp->eg_fd, XFS_IOC_DIOINFO, &da) < 0) ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (isrealtime) {
+		if ((ioctl(gcp->eg_fd, XFS_IOC_DIOINFO, &da) < 0)) {
+			mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			      "dioinfo failed ino %llu\n"),
-			      statp->bs_ino );
+			      statp->bs_ino);
 			da.d_miniosz = PGSZ;
 		}
 	}
@@ -4375,17 +4375,17 @@ dump_extent_group( drive_t *drivep,
 	 */
 	nextoffset = *nextoffsetp;
 	bytecnt = 0;
-	assert( ( nextoffset & ( BBSIZE - 1 )) == 0 );
+	assert((nextoffset & (BBSIZE - 1)) == 0);
 
-	for ( ; ; ) {
+	for (; ;) {
 		off64_t offset;
 		off64_t extsz;
 
 		/* if we've dumped to the stop point return.
 		 */
-		if ( sosig && nextoffset >= stopoffset ) {
-			mlog( MLOG_NITTY,
-			      "dumped to stop offset\n" );
+		if (sosig && nextoffset >= stopoffset) {
+			mlog(MLOG_NITTY,
+			      "dumped to stop offset\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4394,9 +4394,9 @@ dump_extent_group( drive_t *drivep,
 
 		/* if we've dumped the entire file, return
 		 */
-		if ( nextoffset >= statp->bs_size ) {
-			mlog( MLOG_NITTY,
-			      "dumped to end of file\n" );
+		if (nextoffset >= statp->bs_size) {
+			mlog(MLOG_NITTY,
+			      "dumped to end of file\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4407,9 +4407,9 @@ dump_extent_group( drive_t *drivep,
 		 * call it quits. we'll be called back for more because the
 		 * completion flag is set FALSE.
 		 */
-		if ( bytecnt >= maxcnt ) {
-			mlog( MLOG_NITTY,
-			      "reached per-extent group byte count\n" );
+		if (bytecnt >= maxcnt) {
+			mlog(MLOG_NITTY,
+			      "reached per-extent group byte count\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_FALSE;
@@ -4419,21 +4419,21 @@ dump_extent_group( drive_t *drivep,
 		/* if we are not looking at a valid bmap entry,
 		 * get one.
 		 */
-		if ( gcp->eg_nextbmapp >= gcp->eg_endbmapp ) {
+		if (gcp->eg_nextbmapp >= gcp->eg_endbmapp) {
 			int entrycnt; /* entries in new bmap */
 
-			assert( gcp->eg_nextbmapp == gcp->eg_endbmapp );
+			assert(gcp->eg_nextbmapp == gcp->eg_endbmapp);
 
 			/* get a new extent block
 			 */
-			mlog( MLOG_NITTY,
+			mlog(MLOG_NITTY,
 			      "calling getbmapx for ino %llu\n",
-			      statp->bs_ino );
-			rval = ioctl( gcp->eg_fd, XFS_IOC_GETBMAPX, gcp->eg_bmap );
+			      statp->bs_ino);
+			rval = ioctl(gcp->eg_fd, XFS_IOC_GETBMAPX, gcp->eg_bmap);
 			gcp->eg_gbmcnt++;
-			entrycnt = gcp->eg_bmap[ 0 ].bmv_entries;
-			if ( entrycnt < 0 ) { /* workaround for getbmap bug */
-				mlog( MLOG_DEBUG | MLOG_WARNING, _(
+			entrycnt = gcp->eg_bmap[0].bmv_entries;
+			if (entrycnt < 0) { /* workaround for getbmap bug */
+				mlog(MLOG_DEBUG | MLOG_WARNING, _(
 				      "getbmapx %d ino %lld mode 0x%08x "
 				      "offset %lld ix %d "
 				      "returns negative entry count\n"),
@@ -4441,21 +4441,21 @@ dump_extent_group( drive_t *drivep,
 				      statp->bs_ino,
 				      statp->bs_mode,
 				      nextoffset,
-				      gcp->eg_bmapix );
+				      gcp->eg_bmapix);
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
 				return RV_OK;
 			}
-			if ( rval ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING, _(
+			if (rval) {
+				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "getbmapx %d ino %lld mode 0x%08x "
 				      "offset %lld failed: %s\n"),
 				      gcp->eg_gbmcnt,
 				      statp->bs_ino,
 				      statp->bs_mode,
 				      nextoffset,
-				      strerror( errno ));
+				      strerror(errno));
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
@@ -4470,7 +4470,7 @@ dump_extent_group( drive_t *drivep,
 			if (hsm_fs_ctxtp) {
 				if (!HsmModifyExtentMap(contextp->cc_hsm_f_ctxtp,
 					&gcp->eg_bmap[0])) {
-					mlog( MLOG_NORMAL | MLOG_WARNING, _(
+					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 						"hsm detected an extent map "
 						"error in ino %lld, skipping\n"),
 						statp->bs_ino);
@@ -4479,74 +4479,74 @@ dump_extent_group( drive_t *drivep,
 					*cmpltflgp = BOOL_TRUE;
 					return RV_OK;
 				}
-				entrycnt = gcp->eg_bmap[ 0 ].bmv_entries;
+				entrycnt = gcp->eg_bmap[0].bmv_entries;
 			}
 
-			if ( entrycnt <= 0 ) {
-				mlog( MLOG_NITTY,
-				      "all extent groups dumped\n" );
+			if (entrycnt <= 0) {
+				mlog(MLOG_NITTY,
+				      "all extent groups dumped\n");
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
 				return RV_OK;
 			}
-			gcp->eg_nextbmapp = &gcp->eg_bmap[ 1 ];
-			gcp->eg_endbmapp = &gcp->eg_bmap[ entrycnt + 1 ];
-			mlog( MLOG_NITTY,
+			gcp->eg_nextbmapp = &gcp->eg_bmap[1];
+			gcp->eg_endbmapp = &gcp->eg_bmap[entrycnt + 1];
+			mlog(MLOG_NITTY,
 			      "getbmapx supplied %d extent entries\n",
-			      entrycnt );
+			      entrycnt);
 		}
 
-		mlog( MLOG_NITTY,
+		mlog(MLOG_NITTY,
 		      "bmap entry %d ix %d block %lld offset %lld length %lld\n",
-		      gcp->eg_nextbmapp - &gcp->eg_bmap[ 0 ],
+		      gcp->eg_nextbmapp - &gcp->eg_bmap[0],
 		      gcp->eg_bmapix,
 		      gcp->eg_nextbmapp->bmv_block,
 		      gcp->eg_nextbmapp->bmv_offset,
-		      gcp->eg_nextbmapp->bmv_length );
+		      gcp->eg_nextbmapp->bmv_length);
 
 		/* if the next bmap entry represents a hole, go to the next
 		 * one in the bmap, and rescan to check above assumptions.
 		 * bump nextoffset to after the hole, if beyond current value.
 		 */
-		if ( gcp->eg_nextbmapp->bmv_block == -1 ) {
+		if (gcp->eg_nextbmapp->bmv_block == -1) {
 			off64_t tmpoffset;
 
 			/* extract the offset and extent size from this
 			 * entry
 			 */
 			offset = gcp->eg_nextbmapp->bmv_offset
-					* ( off64_t )BBSIZE;
+					* (off64_t)BBSIZE;
 			extsz  = gcp->eg_nextbmapp->bmv_length
-					* ( off64_t )BBSIZE;
+					* (off64_t)BBSIZE;
 
-			mlog( MLOG_NITTY,
+			mlog(MLOG_NITTY,
 			      "hole extent offset = %lld size = %lld\n",
-			      offset, extsz );
+			      offset, extsz);
 
 			/* Encode the hole - dump the extent header
 			 * with the right extent type.
 			 */
-			rv = dump_extenthdr( drivep,
+			rv = dump_extenthdr(drivep,
 					     contextp,
 					     EXTENTHDR_TYPE_HOLE,
 					     0,
 					     offset,
-					     extsz );
-			if ( rv != RV_OK ) {
+					     extsz);
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE; /*moot since rv != OK */
 				return rv;
 			}
-			bytecnt += sizeof( extenthdr_t );
+			bytecnt += sizeof(extenthdr_t);
 
-			tmpoffset = ( gcp->eg_nextbmapp->bmv_offset
+			tmpoffset = (gcp->eg_nextbmapp->bmv_offset
 				      +
-				      gcp->eg_nextbmapp->bmv_length )
+				      gcp->eg_nextbmapp->bmv_length)
 				    *
-				    ( off64_t )BBSIZE;
-			if ( tmpoffset > nextoffset ) {
+				    (off64_t)BBSIZE;
+			if (tmpoffset > nextoffset) {
 				nextoffset = tmpoffset;
 			}
 			gcp->eg_nextbmapp++;
@@ -4557,15 +4557,15 @@ dump_extent_group( drive_t *drivep,
 		/* if the next bmap entry has a zero size, go to the next
 		 * one in the bmap, and rescan to check above assumptions.
 		 */
-		if ( gcp->eg_nextbmapp->bmv_length <= 0 ) {
+		if (gcp->eg_nextbmapp->bmv_length <= 0) {
 			off64_t tmpoffset;
 
-			mlog( MLOG_NITTY,
-			      "non-positive extent\n" );
+			mlog(MLOG_NITTY,
+			      "non-positive extent\n");
 			tmpoffset = gcp->eg_nextbmapp->bmv_offset
 				    *
-				    ( off64_t )BBSIZE;
-			if ( tmpoffset > nextoffset ) {
+				    (off64_t)BBSIZE;
+			if (tmpoffset > nextoffset) {
 				nextoffset = tmpoffset;
 			}
 			gcp->eg_nextbmapp++;
@@ -4576,22 +4576,22 @@ dump_extent_group( drive_t *drivep,
 		/* extract the offset and extent size from this
 		 * entry
 		 */
-		offset = gcp->eg_nextbmapp->bmv_offset * ( off64_t )BBSIZE;
-		extsz = gcp->eg_nextbmapp->bmv_length * ( off64_t )BBSIZE;
-		mlog( MLOG_NITTY,
+		offset = gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE;
+		extsz = gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE;
+		mlog(MLOG_NITTY,
 		      "extent offset %lld sz %lld; nextoffset %lld\n",
 		      offset,
 		      extsz,
-		      nextoffset );
+		      nextoffset);
 
 		/* if the new bmap entry begins below the stop offset
 		 * but does not contain any data above the current
 		 * offset, go to the next one and rescan.
 		 */
-		if ( ! sosig || offset < stopoffset ) {
-			if ( offset + extsz <= nextoffset ) {
-				mlog( MLOG_NITTY,
-				      "extent ends before nextoffset\n" );
+		if (! sosig || offset < stopoffset) {
+			if (offset + extsz <= nextoffset) {
+				mlog(MLOG_NITTY,
+				      "extent ends before nextoffset\n");
 				gcp->eg_nextbmapp++;
 				gcp->eg_bmapix++;
 				continue;
@@ -4601,9 +4601,9 @@ dump_extent_group( drive_t *drivep,
 		/* if the new bmap entry begins beyond the end of the file,
 		 * we are done.
 		 */
-		if ( offset >= statp->bs_size ) {
-			mlog( MLOG_NITTY,
-			      "extent beyond end of file\n" );
+		if (offset >= statp->bs_size) {
+			mlog(MLOG_NITTY,
+			      "extent beyond end of file\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4613,9 +4613,9 @@ dump_extent_group( drive_t *drivep,
 		/* if the new bmap entry begins at or above the stop offset,
 		 * stop. we are done.
 		 */
-		if ( sosig && offset >= stopoffset ) {
-			mlog( MLOG_NITTY,
-			      "extent beyond stop offset\n" );
+		if (sosig && offset >= stopoffset) {
+			mlog(MLOG_NITTY,
+			      "extent beyond stop offset\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4627,41 +4627,41 @@ dump_extent_group( drive_t *drivep,
 		 * beginning of the range of interest, and shorten
 		 * extsz accordingly.
 		 */
-		if ( offset < nextoffset ) {
+		if (offset < nextoffset) {
 			extsz -= nextoffset - offset;
 			offset = nextoffset;
-			mlog( MLOG_NITTY,
+			mlog(MLOG_NITTY,
 			      "adjusted bottom of extent to nextoffset: "
 			      "offset %lld, sz %lld; nextoffset %lld\n",
 			      offset,
 			      extsz,
-			      nextoffset );
+			      nextoffset);
 		}
-		assert( extsz > 0 );
+		assert(extsz > 0);
 
 		/* if the resultant extent would put us over maxcnt,
 		 * shorten it, and round up to the next BBSIZE (round
 		 * upto d_miniosz for realtime).
 		 */
-		if ( extsz > maxcnt - ( bytecnt + sizeof( extenthdr_t ))) {
+		if (extsz > maxcnt - (bytecnt + sizeof(extenthdr_t))) {
 			int iosz;
 
 			if (isrealtime)
 				iosz = da.d_miniosz;
 			else
 				iosz = BBSIZE;
-			extsz = maxcnt - ( bytecnt + sizeof( extenthdr_t ));
-			extsz = ( extsz + ( off64_t )( iosz - 1 ))
+			extsz = maxcnt - (bytecnt + sizeof(extenthdr_t));
+			extsz = (extsz + (off64_t)(iosz - 1))
 				&
-				~( off64_t )( iosz - 1 );
-			mlog( MLOG_NITTY,
+				~(off64_t)(iosz - 1);
+			mlog(MLOG_NITTY,
 			      "adjusted top of extent to honor maxcnt "
 			      "(rounded up %d): "
 			      "offset %lld, sz %lld; maxcnt %lld\n",
 			      iosz,
 			      offset,
 			      extsz,
-			      maxcnt );
+			      maxcnt);
 		}
 
 		/* if the shortened extent is too small, return; we'll
@@ -4669,15 +4669,15 @@ dump_extent_group( drive_t *drivep,
 		 * size is zero, indicate we are done.
 		 * !!! I don't believe this rule can ever fire!
 		 */
-		if ( extsz <= 0 ) {
-			mlog( MLOG_NITTY,
+		if (extsz <= 0) {
+			mlog(MLOG_NITTY,
 			      "adjusted extent size is non-positive: "
 			      "%lld (bs_size %lld)\n",
 			      extsz,
-			      statp->bs_size );
+			      statp->bs_size);
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
-			if ( statp->bs_size == 0 ) {
+			if (statp->bs_size == 0) {
 			    *cmpltflgp = BOOL_TRUE;
 			} else {
 			    *cmpltflgp = BOOL_FALSE;
@@ -4690,7 +4690,7 @@ dump_extent_group( drive_t *drivep,
 		 * at or beyond EOF.  (Shorten to d_miniosz for realtime
 		 * files).
 		 */
-		if ( extsz > statp->bs_size - offset ) {
+		if (extsz > statp->bs_size - offset) {
 			int iosz;
 
 			if (isrealtime)
@@ -4698,33 +4698,33 @@ dump_extent_group( drive_t *drivep,
 			else
 				iosz = BBSIZE;
 			extsz = statp->bs_size - offset;
-			extsz = ( extsz + ( off64_t )( iosz - 1 ))
+			extsz = (extsz + (off64_t)(iosz - 1))
 				&
-				~( off64_t )( iosz - 1 );
-			mlog( MLOG_NITTY,
+				~(off64_t)(iosz - 1);
+			mlog(MLOG_NITTY,
 			      "adjusted top of extent to match file size "
 			      "(rounded up %d): "
 			      "offset %lld, sz %lld; bs_size %lld\n",
 			      iosz,
 			      offset,
 			      extsz,
-			      statp->bs_size );
+			      statp->bs_size);
 		}
 
 		/* if the extent extends beyond the stop offset,
 		 * shorten it to the stop offset.
 		 */
-		if ( sosig && ( extsz > stopoffset - offset )) {
+		if (sosig && (extsz > stopoffset - offset)) {
 			extsz = stopoffset - offset;
-			assert( extsz >= 0 );
-			assert( ! ( extsz & ( off64_t )( BBSIZE - 1 )));
-			mlog( MLOG_NITTY,
+			assert(extsz >= 0);
+			assert(! (extsz & (off64_t)(BBSIZE - 1)));
+			mlog(MLOG_NITTY,
 			      "adjusted top of extent "
 			      "to adhere to stop offset: "
 			      "offset %lld, sz %lld; bs_size %lld\n",
 			      offset,
 			      extsz,
-			      statp->bs_size );
+			      statp->bs_size);
 		}
 
 		/* I/O performance is better if we align the media write
@@ -4732,131 +4732,131 @@ dump_extent_group( drive_t *drivep,
 		 * at least a page in length. Also, necessary for real time
 		 * files
 		 */
-		if ( isrealtime || extsz >= PGALIGNTHRESH * PGSZ ) {
+		if (isrealtime || extsz >= PGALIGNTHRESH * PGSZ) {
 			size_t cnt_to_align;
-			cnt_to_align = ( * dop->do_get_align_cnt )( drivep );
-			if ( ( size_t )cnt_to_align < 2*sizeof( extenthdr_t )) {
+			cnt_to_align = (* dop->do_get_align_cnt)(drivep);
+			if ((size_t)cnt_to_align < 2*sizeof(extenthdr_t)) {
 				cnt_to_align += PGSZ;
 			}
 
 			/* account for the DATA header following the alignment
 			 */
-			cnt_to_align -= sizeof( extenthdr_t );
+			cnt_to_align -= sizeof(extenthdr_t);
 
-			rv = dump_extenthdr( drivep,
+			rv = dump_extenthdr(drivep,
 					     contextp,
 					     EXTENTHDR_TYPE_ALIGN,
 					     0,
 					     0,
-					     ( off64_t )
-					     ( ( size_t )cnt_to_align
+					     (off64_t)
+					     ((size_t)cnt_to_align
 					       -
 					       sizeof(extenthdr_t)));
-			if ( rv != RV_OK ) {
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
 				return rv;
 			}
-			bytecnt += sizeof( extenthdr_t );
-			cnt_to_align -= sizeof( extenthdr_t );
-			rv = write_pad( drivep, cnt_to_align );
-			if ( rv != RV_OK ) {
+			bytecnt += sizeof(extenthdr_t);
+			cnt_to_align -= sizeof(extenthdr_t);
+			rv = write_pad(drivep, cnt_to_align);
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE; /* moot: rv != OK */
 				return rv;
 			}
-			bytecnt += ( off64_t )cnt_to_align;
+			bytecnt += (off64_t)cnt_to_align;
 		}
 		/* adjust the next offset
 		 */
-		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
-		assert( ( extsz & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
+		assert((extsz & (off64_t)(BBSIZE - 1)) == 0);
 		nextoffset = offset + extsz;
 
 		/* dump the extent header
 		 */
-		rv = dump_extenthdr( drivep,
+		rv = dump_extenthdr(drivep,
 				     contextp,
 				     EXTENTHDR_TYPE_DATA,
 				     0,
 				     offset,
-				     extsz );
-		if ( rv != RV_OK ) {
+				     extsz);
+		if (rv != RV_OK) {
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE; /* moot since rv != OK */
 			return rv;
 		}
-		bytecnt += sizeof( extenthdr_t );
+		bytecnt += sizeof(extenthdr_t);
 
 		/* dump the extent. if read fails to return all
 		 * asked for, pad out the extent with zeros. necessary
 		 * because the extent hdr is already out there!
 		 */
-		while ( extsz ) {
+		while (extsz) {
 			off64_t new_off;
 			int nread;
 			size_t reqsz;
 			size_t actualsz;
 			char *bufp;
 
-			reqsz = extsz > ( off64_t )INTGENMAX
+			reqsz = extsz > (off64_t)INTGENMAX
 				?
 				INTGENMAX
 				:
-				( size_t )extsz;
-			bufp = ( * dop->do_get_write_buf )( drivep,
+				(size_t)extsz;
+			bufp = (* dop->do_get_write_buf)(drivep,
 							    reqsz,
-							    &actualsz );
-			assert( actualsz <= reqsz );
-			new_off = lseek64( gcp->eg_fd, offset, SEEK_SET );
-			if ( new_off == ( off64_t )( -1 )) {
-				mlog( MLOG_NORMAL, _(
+							    &actualsz);
+			assert(actualsz <= reqsz);
+			new_off = lseek64(gcp->eg_fd, offset, SEEK_SET);
+			if (new_off == (off64_t)(-1)) {
+				mlog(MLOG_NORMAL, _(
 				      "can't lseek ino %llu\n"),
-				      statp->bs_ino );
+				      statp->bs_ino);
 				nread = 0;
 			} else {
-				nread = read( gcp->eg_fd, bufp, actualsz);
+				nread = read(gcp->eg_fd, bufp, actualsz);
 			}
-			if ( nread < 0 ) {
+			if (nread < 0) {
 #ifdef HIDDEN
 				struct statvfs64 s;
 
  				/* Be quiet if this is a swap file - #510197 */
-				if ( (fstatvfs64(gcp->eg_fd, &s) < 0 ) ||
-				     ((s.f_flag & ST_LOCAL) != 0) )
-				   mlog( MLOG_NORMAL, _(
+				if ((fstatvfs64(gcp->eg_fd, &s) < 0) ||
+				     ((s.f_flag & ST_LOCAL) != 0))
+				   mlog(MLOG_NORMAL, _(
 		"can't read ino %llu at offset %d (act=%d req=%d) rt=%d\n"),
-		statp->bs_ino, new_off, actualsz , reqsz, isrealtime );
+		statp->bs_ino, new_off, actualsz , reqsz, isrealtime);
 #endif /* HIDDEN */
 
 				nread = 0;
 			}
-			assert( ( size_t )nread <= actualsz );
-			mlog( MLOG_NITTY,
+			assert((size_t)nread <= actualsz);
+			mlog(MLOG_NITTY,
 			      "read ino %llu offset %lld sz %d actual %d\n",
 			      statp->bs_ino,
 			      offset,
 			      actualsz,
-			      nread );
+			      nread);
 
 			/* must return entire buffer supplied by call to
 			 * do_get_write_buf; so pad end with zeros. below
 			 * we assume the short read implies EOF, so will
 			 * then pad out remainder of extent as well.
 			 */
-			if ( ( size_t )nread < actualsz ) {
-				memset( ( void * )( bufp + nread ),
+			if ((size_t)nread < actualsz) {
+				memset((void *)(bufp + nread),
 					0,
-					actualsz - ( size_t )nread );
+					actualsz - (size_t)nread);
 			}
 
-			rval = ( * dop->do_write )( drivep,
+			rval = (* dop->do_write)(drivep,
 						    bufp,
-						    actualsz );
-			switch ( rval ) {
+						    actualsz);
+			switch (rval) {
 			case 0:
 				rv = RV_OK;
 				break;
@@ -4872,41 +4872,41 @@ dump_extent_group( drive_t *drivep,
 				rv = RV_CORE;
 				break;
 			}
-			if ( rv != RV_OK ) {
+			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE; /* moot: rv != OK */
 				return rv;
 			}
-			bytecnt += ( off64_t )actualsz;
-			extsz -= ( off64_t )actualsz;
-			offset += ( off64_t )actualsz;
+			bytecnt += (off64_t)actualsz;
+			extsz -= (off64_t)actualsz;
+			offset += (off64_t)actualsz;
 
 			/* if we got a short read, assume we are at the
 			 * end of the file; pad out the remainder of the
 			 * extent to match the header.
 			 */
-			if ( ( size_t )nread < actualsz ) {
-				mlog( MLOG_NITTY,
+			if ((size_t)nread < actualsz) {
+				mlog(MLOG_NITTY,
 				      "padding remaind %lld bytes of extent\n",
-				      extsz );
-				while ( extsz ) {
-					reqsz = extsz > ( off64_t )INTGENMAX
+				      extsz);
+				while (extsz) {
+					reqsz = extsz > (off64_t)INTGENMAX
 						?
 						INTGENMAX
 						:
-						( size_t )extsz;
-					rv = write_pad( drivep,
-							( size_t )reqsz );
-					if ( rv != RV_OK ) {
+						(size_t)extsz;
+					rv = write_pad(drivep,
+							(size_t)reqsz);
+					if (rv != RV_OK) {
 						*nextoffsetp = nextoffset;
 						*bytecntp = bytecnt;
 						*cmpltflgp = BOOL_TRUE;
 						return rv;
 					}
-					bytecnt += ( off64_t )reqsz;
-					extsz -= ( off64_t )reqsz;
-					offset += ( off64_t )reqsz;
+					bytecnt += (off64_t)reqsz;
+					extsz -= (off64_t)reqsz;
+					offset += (off64_t)reqsz;
 				}
 			}
 		}
@@ -4916,13 +4916,13 @@ dump_extent_group( drive_t *drivep,
 		 * !!! not be necessary, taken care of near the
 		 * !!! top of the loop.
 		 */
-		if ( nextoffset
+		if (nextoffset
 		     >=
-		     gcp->eg_nextbmapp->bmv_offset * ( off64_t )BBSIZE
+		     gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE
 		     +
-		     gcp->eg_nextbmapp->bmv_length * ( off64_t )BBSIZE ) {
-			mlog( MLOG_NITTY,
-			      "advancing to next extent in bmap\n" );
+		     gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE) {
+			mlog(MLOG_NITTY,
+			      "advancing to next extent in bmap\n");
 			gcp->eg_nextbmapp++;
 			gcp->eg_bmapix++;
 		}
@@ -4961,11 +4961,11 @@ copy_xfs_bstat(bstat_t *dst, xfs_bstat_t *src)
 }
 
 static rv_t
-dump_filehdr( drive_t *drivep,
+dump_filehdr(drive_t *drivep,
 	      context_t *contextp,
 	      xfs_bstat_t *statp,
 	      off64_t offset,
-	      int flags )
+	      int flags)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register filehdr_t *fhdrp = contextp->cc_filehdrp;
@@ -4973,8 +4973,8 @@ dump_filehdr( drive_t *drivep,
 	int rval;
 	rv_t rv;
 
-	( void )memset( ( void * )fhdrp, 0, sizeof( *fhdrp ));
-	if ( statp ) {
+	(void)memset((void *)fhdrp, 0, sizeof(*fhdrp));
+	if (statp) {
 		if (hsm_fs_ctxtp) {
 			HsmModifyInode(contextp->cc_hsm_f_ctxtp, statp);
 		}
@@ -4982,16 +4982,16 @@ dump_filehdr( drive_t *drivep,
 	}
 	fhdrp->fh_offset = offset;
 	fhdrp->fh_flags = flags | FILEHDR_FLAGS_CHECKSUM;
-	fhdrp->fh_checksum = calc_checksum( fhdrp, FILEHDR_SZ );
+	fhdrp->fh_checksum = calc_checksum(fhdrp, FILEHDR_SZ);
 
 	xlate_filehdr(fhdrp, &tmpfhdrp, 1);
-	rval = write_buf( ( char * )&tmpfhdrp,
-			  sizeof( tmpfhdrp ),
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+	rval = write_buf((char *)&tmpfhdrp,
+			  sizeof(tmpfhdrp),
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5012,12 +5012,12 @@ dump_filehdr( drive_t *drivep,
 }
 
 static rv_t
-dump_extenthdr( drive_t *drivep,
+dump_extenthdr(drive_t *drivep,
 		context_t *contextp,
 		int32_t type,
 		int32_t flags,
 		off64_t offset,
-		off64_t sz )
+		off64_t sz)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register extenthdr_t *ehdrp = contextp->cc_extenthdrp;
@@ -5026,44 +5026,44 @@ dump_extenthdr( drive_t *drivep,
 	rv_t rv;
 	char typestr[20];
 
-	switch( type )  {
+	switch(type)  {
 		case EXTENTHDR_TYPE_LAST:
-			strcpy( typestr, "LAST" );
+			strcpy(typestr, "LAST");
 			break;
 		case EXTENTHDR_TYPE_ALIGN:
-			strcpy( typestr, "ALIGN" );
+			strcpy(typestr, "ALIGN");
 			break;
 		case EXTENTHDR_TYPE_DATA:
-			strcpy( typestr, "DATA" );
+			strcpy(typestr, "DATA");
 			break;
 		case EXTENTHDR_TYPE_HOLE:
-			strcpy( typestr, "HOLE" );
+			strcpy(typestr, "HOLE");
 			break;
 		default:
-			strcpy( typestr, "UNKNOWN" );
+			strcpy(typestr, "UNKNOWN");
 	}
 
-	mlog( MLOG_DEBUG,
+	mlog(MLOG_DEBUG,
 	      "dumping extent type = %s offset = %lld size = %lld\n",
 	      typestr,
 	      offset,
-	       sz );
+	       sz);
 
-	( void )memset( ( void * )ehdrp, 0, sizeof( *ehdrp ));
+	(void)memset((void *)ehdrp, 0, sizeof(*ehdrp));
 	ehdrp->eh_type = type;
 	ehdrp->eh_flags = flags | EXTENTHDR_FLAGS_CHECKSUM;
 	ehdrp->eh_offset = offset;
 	ehdrp->eh_sz = sz;
-	ehdrp->eh_checksum = calc_checksum( ehdrp, EXTENTHDR_SZ );
+	ehdrp->eh_checksum = calc_checksum(ehdrp, EXTENTHDR_SZ);
 
 	xlate_extenthdr(ehdrp, &tmpehdrp, 1);
-	rval = write_buf( ( char * )&tmpehdrp,
-			  sizeof( tmpehdrp ),
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+	rval = write_buf((char *)&tmpehdrp,
+			  sizeof(tmpehdrp),
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5084,13 +5084,13 @@ dump_extenthdr( drive_t *drivep,
 }
 
 static rv_t
-dump_dirent( drive_t *drivep,
+dump_dirent(drive_t *drivep,
 	     context_t *contextp,
 	     xfs_bstat_t *statp,
 	     xfs_ino_t ino,
 	     gen_t gen,
 	     char *name,
-	     size_t namelen )
+	     size_t namelen)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	char *outbufp;
@@ -5100,10 +5100,10 @@ dump_dirent( drive_t *drivep,
 	int rval;
 	rv_t rv;
 
-	if ( sc_use_old_direntpr ) {
-		name_offset = offsetofmember( direnthdr_v1_t, dh_name );
+	if (sc_use_old_direntpr) {
+		name_offset = offsetofmember(direnthdr_v1_t, dh_name);
 	} else {
-		name_offset = offsetofmember( direnthdr_t, dh_name );
+		name_offset = offsetofmember(direnthdr_t, dh_name);
 	}
 
 	sz = name_offset
@@ -5111,72 +5111,72 @@ dump_dirent( drive_t *drivep,
 	     namelen
 	     +
 	     1;
-	sz = ( sz + DIRENTHDR_ALIGN - 1 )
+	sz = (sz + DIRENTHDR_ALIGN - 1)
 	     &
-	     ~( DIRENTHDR_ALIGN - 1 );
+	     ~(DIRENTHDR_ALIGN - 1);
 
-	if ( sz > direntbufsz ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
+	if (sz > direntbufsz) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 		      "unable to dump "
 		      "directory %llu entry %s (%llu): "
 		      "name too long\n"),
 		      statp->bs_ino,
 		      name,
-		      ino );
+		      ino);
 		mlog_exit_hint(RV_INCOMPLETE);
 		return RV_OK;
 	}
 
-	assert( sz <= UINT16MAX );
-	assert( sz >= DIRENTHDR_SZ );
+	assert(sz <= UINT16MAX);
+	assert(sz >= DIRENTHDR_SZ);
 
 	outbufp = malloc(sz);
 
-	if ( sc_use_old_direntpr ) {
-		direnthdr_v1_t *dhdrp = ( direnthdr_v1_t * )contextp->cc_mdirentbufp;
-		direnthdr_v1_t *tmpdhdrp = ( direnthdr_v1_t * )outbufp;
+	if (sc_use_old_direntpr) {
+		direnthdr_v1_t *dhdrp = (direnthdr_v1_t *)contextp->cc_mdirentbufp;
+		direnthdr_v1_t *tmpdhdrp = (direnthdr_v1_t *)outbufp;
 
-		memset( ( void * )dhdrp, 0, sz );
+		memset((void *)dhdrp, 0, sz);
 		dhdrp->dh_ino = ino;
-		dhdrp->dh_sz = ( uint16_t )sz;
-		dhdrp->dh_gen = ( uint16_t )( gen & DENTGENMASK );
-		if ( name ) {
-			strcpy( dhdrp->dh_name, name );
+		dhdrp->dh_sz = (uint16_t)sz;
+		dhdrp->dh_gen = (uint16_t)(gen & DENTGENMASK);
+		if (name) {
+			strcpy(dhdrp->dh_name, name);
 		}
 
-		dhdrp->dh_checksum = calc_checksum( dhdrp, DIRENTHDR_SZ );
+		dhdrp->dh_checksum = calc_checksum(dhdrp, DIRENTHDR_SZ);
 
-		xlate_direnthdr_v1( dhdrp, tmpdhdrp, 1 );
-		if ( name ) {
-			strcpy( tmpdhdrp->dh_name, name );
+		xlate_direnthdr_v1(dhdrp, tmpdhdrp, 1);
+		if (name) {
+			strcpy(tmpdhdrp->dh_name, name);
 		}
 	} else {
-		direnthdr_t *dhdrp = ( direnthdr_t * )contextp->cc_mdirentbufp;
-		direnthdr_t *tmpdhdrp = ( direnthdr_t * )outbufp;
+		direnthdr_t *dhdrp = (direnthdr_t *)contextp->cc_mdirentbufp;
+		direnthdr_t *tmpdhdrp = (direnthdr_t *)outbufp;
 
-		memset( ( void * )dhdrp, 0, sz );
+		memset((void *)dhdrp, 0, sz);
 		dhdrp->dh_ino = ino;
 		dhdrp->dh_gen = gen;
-		dhdrp->dh_sz = ( uint16_t )sz;
-		if ( name ) {
-			strcpy( dhdrp->dh_name, name );
+		dhdrp->dh_sz = (uint16_t)sz;
+		if (name) {
+			strcpy(dhdrp->dh_name, name);
 		}
 
-		dhdrp->dh_checksum = calc_checksum( dhdrp, DIRENTHDR_SZ );
+		dhdrp->dh_checksum = calc_checksum(dhdrp, DIRENTHDR_SZ);
 
-		xlate_direnthdr( dhdrp, tmpdhdrp, 1 );
-		if ( name ) {
-			strcpy( tmpdhdrp->dh_name, name );
+		xlate_direnthdr(dhdrp, tmpdhdrp, 1);
+		if (name) {
+			strcpy(tmpdhdrp->dh_name, name);
 		}
 	}
 
-	rval = write_buf( outbufp,
+	rval = write_buf(outbufp,
 			  sz,
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 	free(outbufp);
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5197,10 +5197,10 @@ dump_dirent( drive_t *drivep,
 }
 
 static bool_t
-dump_session_inv( drive_t *drivep,
+dump_session_inv(drive_t *drivep,
 		  context_t *contextp,
 		  media_hdr_t *mwhdrp,
-		  content_inode_hdr_t *scwhdrp )
+		  content_inode_hdr_t *scwhdrp)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	ix_t strmix = drivep->d_index;
@@ -5213,24 +5213,24 @@ dump_session_inv( drive_t *drivep,
 
 	/* if the inventory session token is null, skip
 	 */
-	if ( sc_inv_sestoken == INV_TOKEN_NULL ) {
+	if (sc_inv_sestoken == INV_TOKEN_NULL) {
 		return BOOL_TRUE;
 	}
 
-	mlog( MLOG_VERBOSE, _(
-	      "dumping session inventory\n") );
+	mlog(MLOG_VERBOSE, _(
+	      "dumping session inventory\n"));
 
 	/* get a buffer from the inventory manager
 	 */
 	inv_sbufp = 0;
 	inv_sbufsz = 0;
-	ok = inv_get_sessioninfo( sc_inv_sestoken, ( void * )&inv_sbufp, &inv_sbufsz );
-	if ( ! ok ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING, _(
-		      "unable to get session inventory to dump\n") );
+	ok = inv_get_sessioninfo(sc_inv_sestoken, (void *)&inv_sbufp, &inv_sbufsz);
+	if (! ok) {
+		mlog(MLOG_NORMAL | MLOG_WARNING, _(
+		      "unable to get session inventory to dump\n"));
 		return BOOL_TRUE;
 	}
-	assert( inv_sbufp );
+	assert(inv_sbufp);
 
 	/* modify the write header to indicate the media file type.
 	 */
@@ -5240,32 +5240,32 @@ dump_session_inv( drive_t *drivep,
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
-	for ( done = BOOL_FALSE ; ! done ; ) {
+	for (done = BOOL_FALSE ; ! done ;) {
 		uuid_t mediaid;
-		char medialabel[ GLOBAL_HDR_STRING_SZ ];
+		char medialabel[GLOBAL_HDR_STRING_SZ];
 		bool_t partial;
 		int mediafileix;
 		int rval;
 		rv_t rv;
 
-		mlog( MLOG_VERBOSE, _(
-		      "beginning inventory media file\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "beginning inventory media file\n"));
 
 		partial = BOOL_FALSE;
-		rv = Media_mfile_begin( drivep, contextp, BOOL_FALSE );
-		switch( rv ) {
+		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_TIMEOUT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change timeout: "
-			      "session inventory not dumped\n") );
+			      "session inventory not dumped\n"));
 			mlog_exit_hint(RV_INV);
 			return BOOL_FALSE;
 		case RV_QUIT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change declined: "
-			      "session inventory not dumped\n") );
+			      "session inventory not dumped\n"));
 			mlog_exit_hint(RV_INV);
 			return BOOL_FALSE;
 		case RV_DRIVE:
@@ -5275,22 +5275,22 @@ dump_session_inv( drive_t *drivep,
 			return BOOL_FALSE;
 		}
 
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "media file %u (media %u, file %u)\n"),
 		      mwhdrp->mh_dumpfileix,
 		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix );
+		      mwhdrp->mh_mediafileix);
 
 		uuid_copy(mediaid, mwhdrp->mh_mediaid);
-		strcpy( medialabel, mwhdrp->mh_medialabel );
-		mediafileix = ( int )mwhdrp->mh_mediafileix;
+		strcpy(medialabel, mwhdrp->mh_medialabel);
+		mediafileix = (int)mwhdrp->mh_mediafileix;
 
-		rval = write_buf( inv_sbufp,
+		rval = write_buf(inv_sbufp,
 				  inv_sbufsz,
-				  ( void * )drivep,
-				  ( gwbfp_t )dop->do_get_write_buf,
-				  ( wfp_t )dop->do_write );
-		switch ( rval ) {
+				  (void *)drivep,
+				  (gwbfp_t)dop->do_get_write_buf,
+				  (wfp_t)dop->do_write);
+		switch (rval) {
 		case 0:
 			break;
 		case DRIVE_ERROR_MEDIA:
@@ -5303,15 +5303,15 @@ dump_session_inv( drive_t *drivep,
 			return BOOL_FALSE;
 		}
 
-		mlog( MLOG_VERBOSE, _(
-		      "ending inventory media file\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "ending inventory media file\n"));
 		ncommitted = 0;
-		rv = Media_mfile_end( drivep,
+		rv = Media_mfile_end(drivep,
 				      contextp,
 				      mwhdrp,
 				      &ncommitted,
-				      partial );
-		switch( rv ) {
+				      partial);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_EOM:
@@ -5321,42 +5321,42 @@ dump_session_inv( drive_t *drivep,
 			return BOOL_FALSE;
 		}
 
-		if ( partial ) {
-			mlog( MLOG_VERBOSE, _(
+		if (partial) {
+			mlog(MLOG_VERBOSE, _(
 			      "encountered EOM while writing "
 			      "inventory media file size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 			mlog_exit_hint(RV_INV);
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "inventory media file size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 		}
-		if ( sc_inv_stmtokenp ) {
-			inv_stmt = sc_inv_stmtokenp[ strmix ];
+		if (sc_inv_stmtokenp) {
+			inv_stmt = sc_inv_stmtokenp[strmix];
 		} else {
 			inv_stmt = INV_TOKEN_NULL;
 		}
 
-		if ( inv_stmt != INV_TOKEN_NULL ) {
-			mlog( MLOG_DEBUG,
+		if (inv_stmt != INV_TOKEN_NULL) {
+			mlog(MLOG_DEBUG,
 			      "giving inventory "
-			      "session dump media file\n" );
-			ok = inv_put_mediafile( inv_stmt,
+			      "session dump media file\n");
+			ok = inv_put_mediafile(inv_stmt,
 						&mediaid,
 						medialabel,
-						( uint )mediafileix,
-						(xfs_ino_t )0,
-						( off64_t )0,
-						(xfs_ino_t )0,
-						( off64_t )0,
+						(uint)mediafileix,
+						(xfs_ino_t)0,
+						(off64_t)0,
+						(xfs_ino_t)0,
+						(off64_t)0,
 						ncommitted,
 						! partial,
-						BOOL_TRUE );
-			if ( ! ok ) {
-				mlog( MLOG_NORMAL, _(
+						BOOL_TRUE);
+			if (! ok) {
+				mlog(MLOG_NORMAL, _(
 				      "inventory session media file "
-				      "put failed\n") );
+				      "put failed\n"));
 				return BOOL_FALSE;
 			}
 		}
@@ -5368,49 +5368,49 @@ dump_session_inv( drive_t *drivep,
 }
 
 static void
-dump_terminator( drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp )
+dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 {
 	off64_t ncommitted;
 	bool_t done;
 
 	/* if the drive doesn't support use of stream terminators, don't bother
 	 */
-	if ( ! contextp->cc_Media_useterminatorpr ) {
+	if (! contextp->cc_Media_useterminatorpr) {
 		return;
 	}
 
-	mlog( MLOG_VERBOSE, _(
-	      "writing stream terminator\n") );
+	mlog(MLOG_VERBOSE, _(
+	      "writing stream terminator\n"));
 
 	/* modify the write header to indicate a terminator
 	 */
-	MEDIA_TERMINATOR_SET( mwhdrp );
+	MEDIA_TERMINATOR_SET(mwhdrp);
 
 	/* loop attempting to write a complete media file header
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
-	for ( done = BOOL_FALSE ; ! done ; ) {
+	for (done = BOOL_FALSE ; ! done ;) {
 		bool_t partial;
 		rv_t rv;
 
-		mlog( MLOG_VERBOSE, _(
-		      "beginning media stream terminator\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "beginning media stream terminator\n"));
 
 		partial = BOOL_FALSE;
-		rv = Media_mfile_begin( drivep, contextp, BOOL_FALSE );
-		switch( rv ) {
+		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_TIMEOUT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change timeout: "
-			      "media stream terminator not written\n") );
+			      "media stream terminator not written\n"));
 			return;
 		case RV_QUIT:
-			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
+			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
 			      "media change declined: "
-			      "media stream terminator not written\n") );
+			      "media stream terminator not written\n"));
 			return;
 		case RV_DRIVE:
 		case RV_ERROR:
@@ -5419,21 +5419,21 @@ dump_terminator( drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp )
 			return;
 		}
 
-		mlog( MLOG_VERBOSE, _(
+		mlog(MLOG_VERBOSE, _(
 		      "media file %u (media %u, file %u)\n"),
 		      mwhdrp->mh_dumpfileix,
 		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix );
+		      mwhdrp->mh_mediafileix);
 
-		mlog( MLOG_VERBOSE, _(
-		      "ending media stream terminator\n") );
+		mlog(MLOG_VERBOSE, _(
+		      "ending media stream terminator\n"));
 		ncommitted = 0;
-		rv = Media_mfile_end( drivep,
+		rv = Media_mfile_end(drivep,
 				      contextp,
 				      mwhdrp,
 				      &ncommitted,
-				      BOOL_FALSE );
-		switch( rv ) {
+				      BOOL_FALSE);
+		switch(rv) {
 		case RV_OK:
 			break;
 		case RV_EOM:
@@ -5443,15 +5443,15 @@ dump_terminator( drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp )
 			return;
 		}
 
-		if ( partial ) {
-			mlog( MLOG_VERBOSE, _(
+		if (partial) {
+			mlog(MLOG_VERBOSE, _(
 			      "encountered EOM while writing "
 			      "media stream terminator size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 		} else {
-			mlog( MLOG_VERBOSE, _(
+			mlog(MLOG_VERBOSE, _(
 			      "media stream terminator size %lld bytes\n"),
-			      ncommitted );
+			      ncommitted);
 		}
 
 		done = ! partial;
@@ -5459,19 +5459,19 @@ dump_terminator( drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp )
 }
 
 static rv_t
-write_pad( drive_t *drivep, size_t sz )
+write_pad(drive_t *drivep, size_t sz)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int rval;
 	rv_t rv;
 
-	rval = write_buf( 0,
+	rval = write_buf(0,
 			  sz,
-			  ( void * )drivep,
-			  ( gwbfp_t )dop->do_get_write_buf,
-			  ( wfp_t )dop->do_write );
+			  (void *)drivep,
+			  (gwbfp_t)dop->do_get_write_buf,
+			  (wfp_t)dop->do_write);
 
-	switch ( rval ) {
+	switch (rval) {
 	case 0:
 		rv = RV_OK;
 		break;
@@ -5492,16 +5492,16 @@ write_pad( drive_t *drivep, size_t sz )
 }
 
 static void
-inv_cleanup( void )
+inv_cleanup(void)
 {
 	/* REFERENCED */
 	bool_t ok;
 
-	if ( sc_inv_stmtokenp && sc_contextp ) {
+	if (sc_inv_stmtokenp && sc_contextp) {
 		size_t strmix;
 		inv_stmtoken_t *inv_stmtp;
 		context_t *contextp;
-		for ( strmix = 0,
+		for (strmix = 0,
 		      inv_stmtp = sc_inv_stmtokenp,
 		      contextp = sc_contextp
 		      ;
@@ -5509,30 +5509,30 @@ inv_cleanup( void )
 		      ;
 		      strmix++,
 		      inv_stmtp++,
-		      contextp++ ) {
+		      contextp++) {
 			bool_t interrupted;
 			interrupted = ! contextp->cc_completepr;
-			if ( *inv_stmtp == INV_TOKEN_NULL ) {
+			if (*inv_stmtp == INV_TOKEN_NULL) {
 				continue;
 			}
-			mlog( MLOG_DEBUG,
+			mlog(MLOG_DEBUG,
 			      "closing inventory stream %d%s\n",
 			      strmix,
-			      interrupted ? ": interrupted" : "" );
+			      interrupted ? ": interrupted" : "");
 			if (interrupted) mlog_exit_hint(RV_INTR);
-			ok = inv_stream_close( *inv_stmtp, interrupted );
-			assert( ok );
+			ok = inv_stream_close(*inv_stmtp, interrupted);
+			assert(ok);
 		}
 	}
 
-	if ( sc_inv_sestoken != INV_TOKEN_NULL ) {
-		ok = inv_writesession_close( sc_inv_sestoken );
-		assert( ok );
+	if (sc_inv_sestoken != INV_TOKEN_NULL) {
+		ok = inv_writesession_close(sc_inv_sestoken);
+		assert(ok);
 	}
 
-	if ( sc_inv_idbtoken != INV_TOKEN_NULL ) {
-		ok = inv_close( sc_inv_idbtoken );
-		assert( ok );
+	if (sc_inv_idbtoken != INV_TOKEN_NULL) {
+		ok = inv_close(sc_inv_idbtoken);
+		assert(ok);
 	}
 }
 
@@ -5546,15 +5546,15 @@ inv_cleanup( void )
  * of automatic variables.
  */
 static rv_t
-Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
+Media_mfile_begin(drive_t *drivep, context_t *contextp, bool_t intr_allowed)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int dcaps = drivep->d_capabilities;
 	global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 	drive_hdr_t *drhdrp = drivep->d_readhdrp;
-	media_hdr_t *mrhdrp = ( media_hdr_t * )drhdrp->dh_upper;
+	media_hdr_t *mrhdrp = (media_hdr_t *)drhdrp->dh_upper;
 	char *cmdlinemedialabel;
 	bool_t virginmediapr;
 	bool_t mediapresentpr;
@@ -5566,10 +5566,10 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 
 	/* sanity checks
 	 */
-	assert( BES_INIT == 0 );
+	assert(BES_INIT == 0);
 
-	mlog( MLOG_DEBUG | MLOG_MEDIA,
-	      "Media op: begin media file\n" );
+	mlog(MLOG_DEBUG | MLOG_MEDIA,
+	      "Media op: begin media file\n");
 
 	/* the command line-specified media label is good only for the
 	 * first media object written to. after that, the operator will
@@ -5587,12 +5587,12 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 		bes_t entrystate;
 		entrystate = contextp->cc_Media_begin_entrystate;
 		contextp->cc_Media_begin_entrystate = BES_INVAL;
-		switch ( entrystate ) {
+		switch (entrystate) {
 		case BES_INIT:
 			mediawrittentopr = BOOL_FALSE;
-			mwhdrp->mh_mediaix = ( uint32_t )( -1 );
-			mwhdrp->mh_dumpfileix = ( uint32_t )( -1 );
-			if ( dcaps & DRIVE_CAP_READ ) {
+			mwhdrp->mh_mediaix = (uint32_t)(-1);
+			mwhdrp->mh_dumpfileix = (uint32_t)(-1);
+			if (dcaps & DRIVE_CAP_READ) {
 				mediapresentpr = BOOL_UNKNOWN;
 				virginmediapr = BOOL_UNKNOWN;
 				goto position;
@@ -5612,7 +5612,7 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 			mediawrittentopr = BOOL_TRUE;
 			goto changemedia;
 		default:
-			assert( 0 );
+			assert(0);
 			return RV_CORE;
 		}
 	}
@@ -5626,40 +5626,40 @@ position:
 	 * be concatenated but not jumbled. a dump stream must be virtually
 	 * contiguous.
 	 */
-	for ( ; ; ) {
+	for (; ;) {
 		/* check if a stop has been requested
 		 */
-		if ( intr_allowed && cldmgr_stop_requested( )) {
+		if (intr_allowed && cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
 		/* do a begin_read to see the disposition of the drive/media.
 		 */
-		rval = ( * dop->do_begin_read )( drivep );
+		rval = (* dop->do_begin_read)(drivep);
 
 		/* update cc_Media_useterminatorpr after every begin_read,
 		 * since begin_read will cause some unknown drive params
 		 * to be resolved.
 		 */
-		update_cc_Media_useterminatorpr( drivep, contextp );
+		update_cc_Media_useterminatorpr(drivep, contextp);
 
-		switch( rval ) {
+		switch(rval) {
 		case 0:
-			mlog_lock( );
-			mlog( MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
+			mlog_lock();
+			mlog(MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
 			      "positioned at media file %u: "
 			      "dump %u, "
 			      "stream %u\n"),
 			      mrhdrp->mh_mediafileix,
 			      mrhdrp->mh_dumpmediaix,
-			      drhdrp->dh_driveix );
-			mlog( MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
+			      drhdrp->dh_driveix);
+			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
 			      "stream media file %u (%u in object), "
 			      "stream media object %d\n",
 			      mrhdrp->mh_dumpfileix,
 			      mrhdrp->mh_dumpmediafileix,
-			      mrhdrp->mh_mediaix );
-			mlog_unlock( );
+			      mrhdrp->mh_mediaix);
+			mlog_unlock();
 
 			/* successfully read media file header.
 			 * we know media must be present in drive, and
@@ -5679,12 +5679,12 @@ position:
 			 * media object a virgin.
 			 * also, check for erase option.
 			 */
-			( * dop->do_end_read )( drivep );
+			(* dop->do_end_read)(drivep);
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5693,34 +5693,34 @@ position:
 				break;
 			}
 
-			if ( ( int32_t )mwhdrp->mh_mediaix >= 0 ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			if ((int32_t)mwhdrp->mh_mediaix >= 0) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "cannot interleave dump streams: "
-				      "must supply a blank media object\n") );
+				      "must supply a blank media object\n"));
 				goto changemedia;
 			}
-			if ( ! ( dcaps & DRIVE_CAP_APPEND )) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+			if (! (dcaps & DRIVE_CAP_APPEND)) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 				      "media contains valid xfsdump "
-				      "but does not support append\n") );
+				      "but does not support append\n"));
 				goto changemedia;
 			}
-			if ( MEDIA_TERMINATOR_CHK( mrhdrp )) {
+			if (MEDIA_TERMINATOR_CHK(mrhdrp)) {
 				int status;
-				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-				      "stream terminator found\n") );
-				assert( contextp->cc_Media_useterminatorpr );
-				assert( dcaps & DRIVE_CAP_BSF ); /* redundant */
+				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+				      "stream terminator found\n"));
+				assert(contextp->cc_Media_useterminatorpr);
+				assert(dcaps & DRIVE_CAP_BSF); /* redundant */
 				status = 0;
-				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				assert( rval == 0 );
-				if ( status == DRIVE_ERROR_DEVICE ) {
-					mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+				rval = (* dop->do_bsf)(drivep, 0, &status);
+				assert(rval == 0);
+				if (status == DRIVE_ERROR_DEVICE) {
+					mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 					      "encountered media error "
-					      "attempting BSF\n") );
+					      "attempting BSF\n"));
 					goto changemedia;
 				}
-				if ( mrhdrp->mh_mediafileix == 0 ) {
+				if (mrhdrp->mh_mediafileix == 0) {
 					virginmediapr = BOOL_TRUE;
 				}
 				goto write;
@@ -5729,16 +5729,16 @@ position:
 		case DRIVE_ERROR_FOREIGN:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "media contains non-xfsdump data "
 			      "or a corrupt xfsdump media file header "
-			      "at beginning of media\n") );
+			      "at beginning of media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5747,30 +5747,30 @@ position:
 				break;
 			}
 
-			if ( dlog_allowed( )) {
+			if (dlog_allowed()) {
 				bool_t ok;
-				ok = Media_prompt_overwrite( drivep );
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+				ok = Media_prompt_overwrite(drivep);
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
-				if ( ! ok ) {
+				if (! ok) {
 					goto changemedia;
 				}
 			}
 
-			if ( ! ( dcaps & DRIVE_CAP_OVERWRITE )) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "unable to overwrite\n") );
+			if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+				      "unable to overwrite\n"));
 				goto changemedia;
 			} else {
 				int status;
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "repositioning to overwrite\n") );
-				assert( dcaps & DRIVE_CAP_BSF );
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+				      "repositioning to overwrite\n"));
+				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
-				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				assert( rval == 0 );
-				if ( status == DRIVE_ERROR_DEVICE ) {
+				rval = (* dop->do_bsf)(drivep, 0, &status);
+				assert(rval == 0);
+				if (status == DRIVE_ERROR_DEVICE) {
 					return RV_DRIVE;
 				}
 
@@ -5782,17 +5782,17 @@ position:
 		case DRIVE_ERROR_OVERWRITE:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				"media may contain data. "
-				"Overwrite option specified\n") );
+				"Overwrite option specified\n"));
 
-			if ( dlog_allowed( )) {
+			if (dlog_allowed()) {
 				bool_t ok;
-				ok = Media_prompt_overwrite( drivep );
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+				ok = Media_prompt_overwrite(drivep);
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
-				if ( ! ok ) {
+				if (! ok) {
 					goto changemedia;
 				}
 			}
@@ -5810,16 +5810,16 @@ position:
 		case DRIVE_ERROR_DEVICE:
 			return RV_DRIVE;
 		case DRIVE_ERROR_EOD:
-			mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
-			      "at end of data\n") );
+			mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
+			      "at end of data\n"));
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5828,11 +5828,11 @@ position:
 				break;
 			}
 
-			if ( contextp->cc_Media_useterminatorpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			if (contextp->cc_Media_useterminatorpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered EOD but expecting a media "
 				      "stream terminator: "
-				      "assuming full media\n") );
+				      "assuming full media\n"));
 				goto changemedia;
 			} else {
 				goto write;
@@ -5841,13 +5841,13 @@ position:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-			      "encountered EOM: media is full\n") );
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			      "encountered EOM: media is full\n"));
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5864,15 +5864,15 @@ position:
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "encountered corrupt or foreign data: "
-			      "assuming corrupted media\n") );
+			      "assuming corrupted media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
-			switch( Media_erasechk( drivep,
+			switch(Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
-						prevmediapresentpr )) {
+						prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5881,32 +5881,32 @@ position:
 				break;
 			}
 
-			if ( contextp->cc_Media_useterminatorpr ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			if (contextp->cc_Media_useterminatorpr) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data "
 				      "but expecting a media "
 				      "stream terminator: "
-				      "assuming corrupted media\n") );
+				      "assuming corrupted media\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
-			} else if ( ! ( dcaps & DRIVE_CAP_OVERWRITE )) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+			} else if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data: "
 				      "unable to overwrite: "
-				      "assuming corrupted media\n") );
+				      "assuming corrupted media\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
 			} else {
 				int status;
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data: "
-				      "repositioning to overwrite\n") );
+				      "repositioning to overwrite\n"));
 				mlog_exit_hint(RV_CORRUPT);
-				assert( dcaps & DRIVE_CAP_BSF );
+				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
-				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				assert( rval == 0 );
-				if ( status == DRIVE_ERROR_DEVICE ) {
+				rval = (* dop->do_bsf)(drivep, 0, &status);
+				assert(rval == 0);
+				if (status == DRIVE_ERROR_DEVICE) {
 					return RV_DRIVE;
 				}
 				goto write;
@@ -5917,19 +5917,19 @@ position:
 			return RV_ERROR;
 		case DRIVE_ERROR_EOF:
 		default:
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 			      "unexpected error from do_begin_read: %d\n"),
-			      rval );
+			      rval);
 			return RV_CORE;
 		}
 	}
 	/* NOTREACHED */
 
 erasemedia:
-	mlog( MLOG_VERBOSE | MLOG_WARNING | MLOG_MEDIA, _(
-	      "erasing media\n") );
-	rval = ( * dop->do_erase )( drivep );
-	if ( rval ) {
+	mlog(MLOG_VERBOSE | MLOG_WARNING | MLOG_MEDIA, _(
+	      "erasing media\n"));
+	rval = (* dop->do_erase)(drivep);
+	if (rval) {
 		return RV_DRIVE;
 	}
 	prevmediapresentpr = mediapresentpr;
@@ -5941,17 +5941,17 @@ erasemedia:
 changemedia:
 	/* if the drive does not support media change, quit.
 	 */
-	if ( ! ( dcaps & DRIVE_CAP_REMOVABLE )) {
+	if (! (dcaps & DRIVE_CAP_REMOVABLE)) {
 		return RV_ERROR;
 	}
 
 	/* first eject the current media object if capability supported
 	 */
-	assert( mediapresentpr != BOOL_UNKNOWN );
-	if ( mediapresentpr == BOOL_TRUE ) {
-		if ( dcaps & DRIVE_CAP_EJECT ) {
-			rval = ( * dop->do_eject_media )( drivep );
-			if ( rval ) {
+	assert(mediapresentpr != BOOL_UNKNOWN);
+	if (mediapresentpr == BOOL_TRUE) {
+		if (dcaps & DRIVE_CAP_EJECT) {
+			rval = (* dop->do_eject_media)(drivep);
+			if (rval) {
 				return RV_DRIVE;
 			}
 		}
@@ -5959,7 +5959,7 @@ changemedia:
 
 	/* if dialogs not allowed, we are done.
 	 */
-	if ( ! dlog_allowed( )) {
+	if (! dlog_allowed()) {
 		return RV_QUIT; /* this return value will cause approp. msg */
 	}
 
@@ -5971,29 +5971,29 @@ changemedia:
 	/* if media change prompt declined or times out,
 	 * we are done
 	 */
-	if ( drivecnt > 1 && ! stdoutpiped ) {
+	if (drivecnt > 1 && ! stdoutpiped) {
 		ix_t thrdix = drivep->d_index;
-		assert( sistr );
-		mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
+		assert(sistr);
+		mlog(MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
 		      "please change media: "
 		      "type %s to confirm media change\n"),
-		      sistr );
-		set_mcflag( thrdix );
-		while ( sc_mcflag[ thrdix ] ) {
-			sleep( 2 );
-			if ( cldmgr_stop_requested( )) {
-				clr_mcflag( thrdix );
+		      sistr);
+		set_mcflag(thrdix);
+		while (sc_mcflag[thrdix]) {
+			sleep(2);
+			if (cldmgr_stop_requested()) {
+				clr_mcflag(thrdix);
 				return RV_INTR;
 			}
 		}
 		ok = BOOL_TRUE;
 	} else {
-		ok = Media_prompt_change( drivep );
+		ok = Media_prompt_change(drivep);
 	}
-	if ( intr_allowed && cldmgr_stop_requested( )) {
+	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
-	if ( ! ok ) {
+	if (! ok) {
 		return RV_QUIT;
 	}
 
@@ -6007,10 +6007,10 @@ changemedia:
 	goto position;
 
 write:
-	assert( mediapresentpr == BOOL_TRUE );
-	assert( virginmediapr != BOOL_UNKNOWN );
+	assert(mediapresentpr == BOOL_TRUE);
+	assert(virginmediapr != BOOL_UNKNOWN);
 
-	if ( intr_allowed && cldmgr_stop_requested( )) {
+	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
 
@@ -6021,104 +6021,104 @@ write:
 	 */
 	saved_gwhdr = *gwhdrp;
 
-	if ( mediawrittentopr ) {
+	if (mediawrittentopr) {
 		mwhdrp->mh_dumpmediafileix++;
 	} else {
 		mwhdrp->mh_dumpmediafileix = 0;
 	}
 	mwhdrp->mh_dumpfileix++; /* pre-initialized to -1 */
-	if ( virginmediapr ) {
+	if (virginmediapr) {
 		mwhdrp->mh_mediafileix = 0;
 		mwhdrp->mh_dumpmediaix = 0;
 	} else {
-		if ( mwhdrp->mh_dumpmediafileix == 0 ) {
+		if (mwhdrp->mh_dumpmediafileix == 0) {
 			mwhdrp->mh_dumpmediaix = mrhdrp->mh_dumpmediaix + 1;
 		}
-		if ( mediawrittentopr ) {
+		if (mediawrittentopr) {
 			mwhdrp->mh_mediafileix++;
 		} else {
 			mwhdrp->mh_mediafileix = mrhdrp->mh_mediafileix;
-			if ( ! MEDIA_TERMINATOR_CHK( mrhdrp )) {
+			if (! MEDIA_TERMINATOR_CHK(mrhdrp)) {
 				mwhdrp->mh_mediafileix++;
 			}
 		}
 	}
 
-	if ( ! mediawrittentopr ) {
+	if (! mediawrittentopr) {
 		mwhdrp->mh_mediaix++; /* pre-initialized to -1 */
 	}
 
-	assert( mwhdrp->mh_mediaix != ( uint32_t )( -1 ));
-	assert( mwhdrp->mh_dumpfileix != ( uint32_t )( -1 ));
+	assert(mwhdrp->mh_mediaix != (uint32_t)(-1));
+	assert(mwhdrp->mh_dumpfileix != (uint32_t)(-1));
 
 	/* do not allow interleaving of media files from different xfsdumps.
 	 */
-	if ( mwhdrp->mh_mediaix != 0
+	if (mwhdrp->mh_mediaix != 0
 	     &&
 	     mwhdrp->mh_dumpmediafileix == 0
 	     &&
-	     ! virginmediapr ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+	     ! virginmediapr) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 		      "cannot interleave dump streams: must supply a blank "
-		      "media object\n") );
+		      "media object\n"));
 		*gwhdrp = saved_gwhdr;
 		goto changemedia;
 	}
 
 	/* update the media object previous id and label
 	 */
-	if ( ! mediawrittentopr && mwhdrp->mh_dumpfileix != 0 ) {
+	if (! mediawrittentopr && mwhdrp->mh_dumpfileix != 0) {
 		uuid_copy(mwhdrp->mh_prevmediaid, mwhdrp->mh_mediaid);
-		( void )strncpyterm( mwhdrp->mh_prevmedialabel,
+		(void)strncpyterm(mwhdrp->mh_prevmedialabel,
 				     mwhdrp->mh_medialabel,
-				     sizeof( mwhdrp->mh_medialabel ));
+				     sizeof(mwhdrp->mh_medialabel));
 	}
 
 	/* update the media object current id and label
 	 */
-	if ( ! mediawrittentopr ) {
-		if ( mwhdrp->mh_mediafileix == 0 ) {
-			char labelbuf[ GLOBAL_HDR_STRING_SZ ];
+	if (! mediawrittentopr) {
+		if (mwhdrp->mh_mediafileix == 0) {
+			char labelbuf[GLOBAL_HDR_STRING_SZ];
 
-			uuid_generate( mwhdrp->mh_mediaid );
+			uuid_generate(mwhdrp->mh_mediaid);
 
-			if ( ! cmdlinemedialabel
+			if (! cmdlinemedialabel
 			     &&
 			     ! drivep->d_isnamedpipepr
 			     &&
 			     ! drivep->d_isunnamedpipepr
 			     &&
-			     dlog_allowed( )) {
-				cmdlinemedialabel = Media_prompt_label( drivep,
+			     dlog_allowed()) {
+				cmdlinemedialabel = Media_prompt_label(drivep,
 							labelbuf,
-							sizeof( labelbuf ));
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+							sizeof(labelbuf));
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
 			}
-			if ( cmdlinemedialabel && strlen( cmdlinemedialabel )) {
-				( void )strncpyterm( mwhdrp->mh_medialabel,
+			if (cmdlinemedialabel && strlen(cmdlinemedialabel)) {
+				(void)strncpyterm(mwhdrp->mh_medialabel,
 						     cmdlinemedialabel,
-					       sizeof( mwhdrp->mh_medialabel ));
+					       sizeof(mwhdrp->mh_medialabel));
 			} else {
-				( void )memset( ( void * )mwhdrp->mh_medialabel,
+				(void)memset((void *)mwhdrp->mh_medialabel,
 						     0,
-					       sizeof( mwhdrp->mh_medialabel ));
-				if ( ! pipeline ) {
-					mlog( MLOG_VERBOSE
+					       sizeof(mwhdrp->mh_medialabel));
+				if (! pipeline) {
+					mlog(MLOG_VERBOSE
 					      |
 					      MLOG_WARNING
 					      |
 					      MLOG_MEDIA, _(
-					      "no media label specified\n") );
+					      "no media label specified\n"));
 				}
 			}
 		} else {
-			assert( ! virginmediapr );
+			assert(! virginmediapr);
 			uuid_copy(mwhdrp->mh_mediaid, mrhdrp->mh_mediaid);
-			( void )strncpyterm( mwhdrp->mh_medialabel,
+			(void)strncpyterm(mwhdrp->mh_medialabel,
 					     mrhdrp->mh_medialabel,
-					     sizeof( mwhdrp->mh_medialabel ));
+					     sizeof(mwhdrp->mh_medialabel));
 		}
 	}
 
@@ -6126,17 +6126,17 @@ write:
 
 	/* write hdr is prepared. place it on media
 	 */
-	if ( intr_allowed && cldmgr_stop_requested( )) {
+	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
-	rval = ( * dop->do_begin_write )( drivep );
-	switch( rval ) {
+	rval = (* dop->do_begin_write)(drivep);
+	switch(rval) {
 	case 0:
 		return RV_OK;
 	case DRIVE_ERROR_EOM:
-		mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+		mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 		      "encountered end of media "
-		      "while attempting to begin new media file\n") );
+		      "while attempting to begin new media file\n"));
 		*gwhdrp = saved_gwhdr;
 		goto changemedia;
 	case DRIVE_ERROR_MEDIA:
@@ -6151,38 +6151,38 @@ write:
 
 /* ARGSUSED */
 static rv_t
-Media_mfile_end( drive_t *drivep,
+Media_mfile_end(drive_t *drivep,
 		 context_t *contextp,
 		 media_hdr_t *mwhdrp,
 		 off64_t *ncommittedp,
-		 bool_t hit_eom )
+		 bool_t hit_eom)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_MEDIA,
-	      "Media op: end media file\n" );
+	mlog(MLOG_DEBUG | MLOG_MEDIA,
+	      "Media op: end media file\n");
 
-	assert( contextp->cc_Media_begin_entrystate == BES_INVAL );
+	assert(contextp->cc_Media_begin_entrystate == BES_INVAL);
 
 	/* call drive's end_write op to flush the tail of the media file
 	 * if has previously hit EOM, this is moot.
 	 */
-	rval = ( dop->do_end_write )( drivep, ncommittedp );
-	if ( hit_eom ) {
-		assert( ! rval );
+	rval = (dop->do_end_write)(drivep, ncommittedp);
+	if (hit_eom) {
+		assert(! rval);
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
 	}
-	switch( rval ) {
+	switch(rval) {
 	case 0:
 		contextp->cc_Media_begin_entrystate = BES_ENDOK;
 		return RV_OK;
 	case DRIVE_ERROR_MEDIA:
 	case DRIVE_ERROR_EOM:
-		mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
+		mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 		      "encountered end of media "
-		      "while ending media file\n") );
+		      "while ending media file\n"));
 		mlog_exit_hint(RV_EOM);
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
@@ -6197,19 +6197,19 @@ Media_mfile_end( drive_t *drivep,
 }
 
 static bool_t
-Media_prompt_overwrite( drive_t *drivep )
+Media_prompt_overwrite(drive_t *drivep)
 {
 	fold_t fold;
-	char question[ 100 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char question[100];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -6218,31 +6218,31 @@ Media_prompt_overwrite( drive_t *drivep )
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, "media overwrite dialog", '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, "media overwrite dialog", '=');
+	preamblestr[preamblecnt++] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* query: ask if overwrite ok
 	 */
-	sprintf( question,
+	sprintf(question,
 		 "overwrite data on media in "
 		 "drive %u?\n",
-		 (unsigned int)drivep->d_index );
+		 (unsigned int)drivep->d_index);
 	querycnt = 0;
-	querystr[ querycnt++ ] = question;
-	assert( querycnt <= QUERYMAX );
+	querystr[querycnt++] = question;
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = "don't overwrite";
+	choicestr[choicecnt++] = "don't overwrite";
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = "overwrite";
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++] = "overwrite";
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -6254,41 +6254,41 @@ retry:
 				       dontix,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = "media will be overwritten\n";
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = "media will NOT be overwritten\n";
+	if (responseix == doix) {
+		ackstr[ackcnt++] = "media will be overwritten\n";
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++] = "media will NOT be overwritten\n";
 	} else {
-		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
+		ackstr[ackcnt++] = "keyboard interrupt\n";
 	}
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
-
-	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 overwrite dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media overwrite dialog\n");
 		goto retry;
 	}
 
@@ -6297,24 +6297,24 @@ retry:
 }
 
 static rv_t
-Media_erasechk( drive_t *drivep,
+Media_erasechk(drive_t *drivep,
 		int dcaps,
 		bool_t intr_allowed,
-		bool_t prevmediapresentpr )
+		bool_t prevmediapresentpr)
 {
-	if ( prevmediapresentpr == BOOL_TRUE ) {
+	if (prevmediapresentpr == BOOL_TRUE) {
 		return RV_NOTOK;
 	}
 
-	if ( sc_preerasepr ) {
-		if ( dcaps & DRIVE_CAP_ERASE ) {
-			if ( dlog_allowed( )) {
+	if (sc_preerasepr) {
+		if (dcaps & DRIVE_CAP_ERASE) {
+			if (dlog_allowed()) {
 				bool_t ok;
-				ok = Media_prompt_erase( drivep );
-				if ( intr_allowed && cldmgr_stop_requested( )) {
+				ok = Media_prompt_erase(drivep);
+				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
-				if ( ok ) {
+				if (ok) {
 					return RV_OK;
 				} else {
 					return RV_NOTOK;
@@ -6323,10 +6323,10 @@ Media_erasechk( drive_t *drivep,
 				return RV_OK;
 			}
 		} else {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "drive does not support media erase: "
 			      "ignoring -%c option\n"),
-			      GETOPT_ERASE );
+			      GETOPT_ERASE);
 			return RV_NOTOK;
 		}
 	} else {
@@ -6335,19 +6335,19 @@ Media_erasechk( drive_t *drivep,
 }
 
 static bool_t
-Media_prompt_erase( drive_t *drivep )
+Media_prompt_erase(drive_t *drivep)
 {
 	fold_t fold;
-	char question[ 100 ];
-	char *preamblestr[ PREAMBLEMAX ];
+	char question[100];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *querystr[ QUERYMAX ];
+	char *querystr[QUERYMAX];
 	size_t querycnt;
-	char *choicestr[ CHOICEMAX ];
+	char *choicestr[CHOICEMAX];
 	size_t choicecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	ix_t doix;
 	ix_t dontix;
@@ -6356,34 +6356,34 @@ Media_prompt_erase( drive_t *drivep )
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, "media erase dialog", '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
+	fold_init(fold, "media erase dialog", '=');
+	preamblestr[preamblecnt++] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
 
 	/* query: ask if overwrite ok
 	 */
-	sprintf( question,
+	sprintf(question,
 		 "pre-erase (-%c) option specified "
 		 "and non-blank media encountered:\n"
 		 "please confirm media erase "
 		 "drive %u\n",
 		 GETOPT_ERASE,
-		 (unsigned int)drivep->d_index );
+		 (unsigned int)drivep->d_index);
 	querycnt = 0;
-	querystr[ querycnt++ ] = question;
-	assert( querycnt <= QUERYMAX );
+	querystr[querycnt++] = question;
+	assert(querycnt <= QUERYMAX);
 	choicecnt = 0;
 	dontix = choicecnt;
-	choicestr[ choicecnt++ ] = "don't erase";
+	choicestr[choicecnt++] = "don't erase";
 	doix = choicecnt;
-	choicestr[ choicecnt++ ] = "erase";
-	assert( choicecnt <= CHOICEMAX );
+	choicestr[choicecnt++] = "erase";
+	assert(choicecnt <= CHOICEMAX);
 	sigintix = IXMAX - 1;
 
-	responseix = dlog_multi_query( querystr,
+	responseix = dlog_multi_query(querystr,
 				       querycnt,
 				       choicestr,
 				       choicecnt,
@@ -6395,41 +6395,41 @@ retry:
 				       dontix,		/* timeout ix */
 				       sigintix,	/* sigint ix */
 				       dontix,		/* sighup ix */
-				       dontix );	/* sigquit ix */
+				       dontix);	/* sigquit ix */
 	ackcnt = 0;
-	if ( responseix == doix ) {
-		ackstr[ ackcnt++ ] = "media will be erased\n";
-	} else if ( responseix == dontix ) {
-		ackstr[ ackcnt++ ] = "media will NOT be erased\n";
+	if (responseix == doix) {
+		ackstr[ackcnt++] = "media will be erased\n";
+	} else if (responseix == dontix) {
+		ackstr[ackcnt++] = "media will NOT be erased\n";
 	} else {
-		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
+		ackstr[ackcnt++] = "keyboard interrupt\n";
 	}
-	assert( ackcnt <= ACKMAX );
-	dlog_multi_ack( ackstr,
-			ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_multi_ack(ackstr,
+			ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
-
-	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 erase dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media erase dialog\n");
 		goto retry;
 	}
 
@@ -6438,27 +6438,27 @@ retry:
 }
 
 static void
-Media_prompt_label_cb( void *uctxp, dlog_pcbp_t pcb, void *pctxp )
+Media_prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
-	drive_t *drivep = ( drive_t * )uctxp;
+	drive_t *drivep = (drive_t *)uctxp;
 
 	/* query: ask for a label
 	 */
-	( * pcb )( pctxp,
+	(* pcb)(pctxp,
 		   "please enter label for media in "
 		   "drive %u",
-		   drivep->d_index );
+		   drivep->d_index);
 }
 
 static char *
-Media_prompt_label( drive_t *drivep, char *bufp, size_t bufsz )
+Media_prompt_label(drive_t *drivep, char *bufp, size_t bufsz)
 {
 	fold_t fold;
-	char *preamblestr[ PREAMBLEMAX ];
+	char *preamblestr[PREAMBLEMAX];
 	size_t preamblecnt;
-	char *ackstr[ ACKMAX ];
+	char *ackstr[ACKMAX];
 	size_t ackcnt;
-	char *postamblestr[ POSTAMBLEMAX ];
+	char *postamblestr[POSTAMBLEMAX];
 	size_t postamblecnt;
 	const ix_t timeoutix = 1;
 	const ix_t abortix = 2;
@@ -6468,15 +6468,15 @@ Media_prompt_label( drive_t *drivep, char *bufp, size_t bufsz )
 
 retry:
 	preamblecnt = 0;
-	fold_init( fold, "media label dialog", '=' );
-	preamblestr[ preamblecnt++ ] = "\n";
-	preamblestr[ preamblecnt++ ] = fold;
-	preamblestr[ preamblecnt++ ] = "\n\n";
-	assert( preamblecnt <= PREAMBLEMAX );
-	dlog_begin( preamblestr, preamblecnt );
-
-	responseix = dlog_string_query( Media_prompt_label_cb,
-					( void * )drivep,
+	fold_init(fold, "media label dialog", '=');
+	preamblestr[preamblecnt++] = "\n";
+	preamblestr[preamblecnt++] = fold;
+	preamblestr[preamblecnt++] = "\n\n";
+	assert(preamblecnt <= PREAMBLEMAX);
+	dlog_begin(preamblestr, preamblecnt);
+
+	responseix = dlog_string_query(Media_prompt_label_cb,
+					(void *)drivep,
 					bufp,
 					bufsz,
 					DLOG_TIMEOUT,
@@ -6484,51 +6484,51 @@ retry:
 					sigintix, /* sigint ix */
 					abortix,  /* sighup ix */
 					abortix,  /* sigquit ix */
-					okix );   /* ok ix */
+					okix);   /* ok ix */
 	ackcnt = 0;
-	if ( responseix == okix ) {
-		ackstr[ ackcnt++ ] = "media label entered: \"";
-		ackstr[ ackcnt++ ] = bufp;
-		ackstr[ ackcnt++ ] = "\"\n";
-	} else if ( responseix == timeoutix ) {
-		ackstr[ ackcnt++ ] = "timeout: media label left blank\n";
-	} else if ( responseix == sigintix ) {
-		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
+	if (responseix == okix) {
+		ackstr[ackcnt++] = "media label entered: \"";
+		ackstr[ackcnt++] = bufp;
+		ackstr[ackcnt++] = "\"\n";
+	} else if (responseix == timeoutix) {
+		ackstr[ackcnt++] = "timeout: media label left blank\n";
+	} else if (responseix == sigintix) {
+		ackstr[ackcnt++] = "keyboard interrupt\n";
 	} else {
-		ackstr[ ackcnt++ ] = "abort\n";
+		ackstr[ackcnt++] = "abort\n";
 	}
 
-	assert( ackcnt <= ACKMAX );
-	dlog_string_ack( ackstr,
-			 ackcnt );
+	assert(ackcnt <= ACKMAX);
+	dlog_string_ack(ackstr,
+			 ackcnt);
 
 	postamblecnt = 0;
-	fold_init( fold, "end dialog", '-' );
-	postamblestr[ postamblecnt++ ] = "\n";
-	postamblestr[ postamblecnt++ ] = fold;
-	postamblestr[ postamblecnt++ ] = "\n\n";
-	assert( postamblecnt <= POSTAMBLEMAX );
-	dlog_end( postamblestr,
-		  postamblecnt );
-
-	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 0;
 		}
-		sleep( 1 ); /* to allow main thread to begin dialog */
-		mlog( MLOG_NORMAL | MLOG_BARE,
-		      "" ); /* to block until main thread dialog complete */
-		sleep( 1 ); /* to allow main thread to request children die */
-		if ( cldmgr_stop_requested( )) {
+		sleep(1); /* to allow main thread to begin dialog */
+		mlog(MLOG_NORMAL | MLOG_BARE,
+		      ""); /* to block until main thread dialog complete */
+		sleep(1); /* to allow main thread to request children die */
+		if (cldmgr_stop_requested()) {
 			return 0;
 		}
-		mlog( MLOG_DEBUG,
-		      "retrying media label dialog\n" );
+		mlog(MLOG_DEBUG,
+		      "retrying media label dialog\n");
 		goto retry;
 	}
 
 
-	if ( responseix == okix ) {
+	if (responseix == okix) {
 		return bufp;
 	} else {
 		return 0;
@@ -6536,38 +6536,38 @@ retry:
 }
 
 static void
-set_mcflag( ix_t thrdix )
+set_mcflag(ix_t thrdix)
 {
-	lock( );
-	sc_mcflag[ thrdix ] = BOOL_TRUE;
+	lock();
+	sc_mcflag[thrdix] = BOOL_TRUE;
 	content_media_change_needed = BOOL_TRUE;
-	unlock( );
+	unlock();
 }
 
 static void
-clr_mcflag( ix_t thrdix )
+clr_mcflag(ix_t thrdix)
 {
-	lock( );
-	sc_mcflag[ thrdix ] = BOOL_FALSE;
-	for ( thrdix = 0 ; thrdix < drivecnt ; thrdix++ ) {
-		if ( sc_mcflag[ thrdix ] ) {
-			unlock( );
+	lock();
+	sc_mcflag[thrdix] = BOOL_FALSE;
+	for (thrdix = 0 ; thrdix < drivecnt ; thrdix++) {
+		if (sc_mcflag[thrdix]) {
+			unlock();
 			return;
 		}
 	}
 	content_media_change_needed = BOOL_FALSE;
-	unlock( );
+	unlock();
 }
 
 static bool_t
-check_complete_flags( void )
+check_complete_flags(void)
 {
 	ix_t strmix;
 	bool_t completepr = BOOL_TRUE;
 
-	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
-		context_t *contextp = &sc_contextp[ strmix ];
-		if ( ! contextp->cc_completepr ) {
+	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		context_t *contextp = &sc_contextp[strmix];
+		if (! contextp->cc_completepr) {
 			completepr = BOOL_FALSE;
 			break;
 		}
@@ -6591,7 +6591,7 @@ is_quota_file(ino_t ino)
 #define REPQUOTA "xfs_quota"
 
 static bool_t
-save_quotas( char *mntpnt, quota_info_t *quotainfo )
+save_quotas(char *mntpnt, quota_info_t *quotainfo)
 {
         int             sts = 0;
         char            buf[1024] = "";
@@ -6599,50 +6599,50 @@ save_quotas( char *mntpnt, quota_info_t *quotainfo )
         char            tmp;
         struct stat     statb;
 
-        mlog( MLOG_VERBOSE, _(
-		"saving %s information for: %s\n"), quotainfo->desc, mntpnt );
+        mlog(MLOG_VERBOSE, _(
+		"saving %s information for: %s\n"), quotainfo->desc, mntpnt);
 
-        if( unlink( quotainfo->quotapath ) == 0 ) {
-            mlog( MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
+        if(unlink(quotainfo->quotapath) == 0) {
+            mlog(MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
         }
         else {
-            if( errno != ENOENT ) {
-                mlog( MLOG_ERROR, _(
+            if(errno != ENOENT) {
+                mlog(MLOG_ERROR, _(
                       "unable to remove %s: %s\n"),
                       quotainfo->quotapath,
-                      strerror( errno ));
+                      strerror(errno));
                 return BOOL_FALSE;
             }
         }
 
-        sprintf( buf,
+        sprintf(buf,
 		 "%s -x -c 'dump %s %s' %s 2> /dev/null",
 		 REPQUOTA,
                  quotainfo->repquotaargs,
                  quotainfo->quotapath,
-                 mntpnt );
+                 mntpnt);
 
-        mlog( MLOG_NITTY, "saving quotas: %s\n", buf );
+        mlog(MLOG_NITTY, "saving quotas: %s\n", buf);
 
-        sts = system( buf );
-        if( sts != 0 ) {
-            mlog( MLOG_ERROR, _(
+        sts = system(buf);
+        if(sts != 0) {
+            mlog(MLOG_ERROR, _(
                   "%s failed with exit status: %d\n"), REPQUOTA,
 		  sts == -1 ? -1 : WEXITSTATUS(sts));
             return BOOL_FALSE;
         }
-        if((fd = open( quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
-            mlog( MLOG_ERROR, _(
+        if((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
+            mlog(MLOG_ERROR, _(
                   "open failed %s: %s\n"),
                   quotainfo->quotapath,
-                  strerror( errno ));
+                  strerror(errno));
             return BOOL_FALSE;
         }
         if(fstat(fd, &statb) < 0) {
-            mlog( MLOG_ERROR, _(
+            mlog(MLOG_ERROR, _(
                   "stat failed %s: %s\n"),
                   quotainfo->quotapath,
-                  strerror( errno ));
+                  strerror(errno));
             close(fd);
             return BOOL_FALSE;
         }
diff --git a/dump/getopt.h b/dump/getopt.h
index 3bab87a..dd798d8 100644
--- a/dump/getopt.h
+++ b/dump/getopt.h
@@ -50,7 +50,7 @@
 #define	GETOPT_SUBTREE		's'	/* subtree dump (content_inode.c) */
 #define GETOPT_DUMPTIME		't'	/* use mtime of file as dump time */
 /*				'u' */
-#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4 ) */
+#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4) */
 /*				'w' */
 /*				'x'	   used in irix for xvm snapshot */
 /*				'y' */
diff --git a/dump/inomap.c b/dump/inomap.c
index 238fcaf..75e26e2 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -57,7 +57,7 @@
 
 /* declarations of externally defined global symbols *************************/
 
-extern bool_t preemptchk( int );
+extern bool_t preemptchk(int);
 extern size_t pgsz;
 extern hsm_fs_ctxt_t *hsm_fs_ctxtp;
 extern uint64_t maxdumpfilesize;
@@ -67,7 +67,7 @@ extern bool_t allowexcludefiles_pr;
 
 /* inomap construction callbacks
  */
-static int cb_context( bool_t last,
+static int cb_context(bool_t last,
 			    time32_t,
 			    bool_t,
 			    time32_t,
@@ -78,50 +78,50 @@ static int cb_context( bool_t last,
 			    int,
 			    bool_t,
 			    bool_t *);
-static void cb_context_free( void );
-static int cb_count_inogrp( void *, int, xfs_inogrp_t *);
-static int cb_add_inogrp( void *, int, xfs_inogrp_t * );
-static int cb_add( void *, jdm_fshandle_t *, int, xfs_bstat_t * );
-static bool_t cb_inoinresumerange( xfs_ino_t );
-static bool_t cb_inoresumed( xfs_ino_t );
-static void cb_accuminit_sz( void );
-static void cb_spinit( void );
-static int cb_startpt( void *,
+static void cb_context_free(void);
+static int cb_count_inogrp(void *, int, xfs_inogrp_t *);
+static int cb_add_inogrp(void *, int, xfs_inogrp_t *);
+static int cb_add(void *, jdm_fshandle_t *, int, xfs_bstat_t *);
+static bool_t cb_inoinresumerange(xfs_ino_t);
+static bool_t cb_inoresumed(xfs_ino_t);
+static void cb_accuminit_sz(void);
+static void cb_spinit(void);
+static int cb_startpt(void *,
 			    jdm_fshandle_t *,
 			    int,
-			    xfs_bstat_t * );
-static int supprt_prune( void *,
+			    xfs_bstat_t *);
+static int supprt_prune(void *,
 			      jdm_fshandle_t *,
 			      int,
 			      xfs_bstat_t *,
-			      char * );
-static off64_t quantity2offset( jdm_fshandle_t *, xfs_bstat_t *, off64_t );
-static off64_t estimate_dump_space( xfs_bstat_t * );
+			      char *);
+static off64_t quantity2offset(jdm_fshandle_t *, xfs_bstat_t *, off64_t);
+static off64_t estimate_dump_space(xfs_bstat_t *);
 
 /* inomap primitives
  */
-static int inomap_init( int igrpcnt );
-static void inomap_add( void *, xfs_ino_t ino, gen_t gen, int );
-static int inomap_set_state( void *, xfs_ino_t ino, int );
-static void inomap_set_gen(void *, xfs_ino_t, gen_t );
+static int inomap_init(int igrpcnt);
+static void inomap_add(void *, xfs_ino_t ino, gen_t gen, int);
+static int inomap_set_state(void *, xfs_ino_t ino, int);
+static void inomap_set_gen(void *, xfs_ino_t, gen_t);
 
 /* subtree abstraction
  */
-static int subtree_descend_cb( void *,
+static int subtree_descend_cb(void *,
 				    jdm_fshandle_t *,
 				    int fsfd,
 				    xfs_bstat_t *,
-				    char * );
-static int subtreelist_parse_cb( void *,
+				    char *);
+static int subtreelist_parse_cb(void *,
 				      jdm_fshandle_t *,
 				      int fsfd,
 				      xfs_bstat_t *,
-				      char * );
-static int subtreelist_parse( jdm_fshandle_t *,
+				      char *);
+static int subtreelist_parse(jdm_fshandle_t *,
 				   int,
 				   xfs_bstat_t *,
 				   char *[],
-				   ix_t );
+				   ix_t);
 
 /* definition of locally defined global variables ****************************/
 
@@ -142,7 +142,7 @@ static uint64_t inomap_exclude_skipattr = 0;
  */
 /* ARGSUSED */
 bool_t
-inomap_build( jdm_fshandle_t *fshandlep,
+inomap_build(jdm_fshandle_t *fshandlep,
 	      int fsfd,
 	      xfs_bstat_t *rootstatp,
 	      bool_t last,
@@ -159,7 +159,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
 	      ix_t *statphasep,
 	      ix_t *statpassp,
 	      size64_t statcnt,
-	      size64_t *statdonep )
+	      size64_t *statdonep)
 {
 	xfs_bstat_t *bstatbufp;
 	size_t bstatbuflen;
@@ -185,24 +185,24 @@ inomap_build( jdm_fshandle_t *fshandlep,
 	/* allocate a bulkstat buf
 	 */
 	bstatbuflen = BSTATBUFLEN;
-	bstatbufp = ( xfs_bstat_t * )memalign( pgsz,
+	bstatbufp = (xfs_bstat_t *)memalign(pgsz,
 					       bstatbuflen
 					       *
-					       sizeof( xfs_bstat_t ));
-	assert( bstatbufp );
+					       sizeof(xfs_bstat_t));
+	assert(bstatbufp);
 
 	/* count the number of inode groups, which will serve as a
 	 * starting point for the size of the inomap.
 	 */
-	rval = inogrp_iter( fsfd, cb_count_inogrp, (void *)&igrpcnt, &stat );
-	if ( rval || stat ) {
-		free( ( void * )bstatbufp );
+	rval = inogrp_iter(fsfd, cb_count_inogrp, (void *)&igrpcnt, &stat);
+	if (rval || stat) {
+		free((void *)bstatbufp);
 		return BOOL_FALSE;
 	}
 
 	/* initialize the callback context
 	 */
-	rval = cb_context( last,
+	rval = cb_context(last,
 			   lasttime,
 			   resume,
 			   resumetime,
@@ -212,9 +212,9 @@ inomap_build( jdm_fshandle_t *fshandlep,
 			   startptcnt,
 			   igrpcnt,
 			   skip_unchanged_dirs,
-			   &pruneneeded );
- 	if ( rval ) {
- 		free( ( void * )bstatbufp );
+			   &pruneneeded);
+ 	if (rval) {
+ 		free((void *)bstatbufp);
  		return BOOL_FALSE;
  	}
 
@@ -225,10 +225,10 @@ inomap_build( jdm_fshandle_t *fshandlep,
 	 * in this filesystem. each inode will be marked unused until its
 	 * correct state is set in cb_add.
 	 */
-	rval = inogrp_iter( fsfd, cb_add_inogrp, NULL, &stat );
- 	if ( rval || stat ) {
+	rval = inogrp_iter(fsfd, cb_add_inogrp, NULL, &stat);
+ 	if (rval || stat) {
 		cb_context_free();
- 		free( ( void * )bstatbufp );
+ 		free((void *)bstatbufp);
  		return BOOL_FALSE;
  	}
 
@@ -244,26 +244,26 @@ inomap_build( jdm_fshandle_t *fshandlep,
 	 * set a flag if any ino not put in a dump state. This will be used
 	 * to decide if any pruning can be done.
 	 */
-	mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+	mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 	      "ino map phase 1: "
-	      "constructing initial dump list\n") );
+	      "constructing initial dump list\n"));
 
 	*inomap_statdonep = 0;
 	*inomap_statphasep = 1;
 	stat = 0;
-	cb_accuminit_sz( );
+	cb_accuminit_sz();
 
-	if ( subtreecnt ) {
-		rval = subtreelist_parse( fshandlep,
+	if (subtreecnt) {
+		rval = subtreelist_parse(fshandlep,
 					  fsfd,
 					  rootstatp,
 					  subtreebuf,
-					  subtreecnt );
+					  subtreecnt);
 	} else {
-		rval = bigstat_iter( fshandlep,
+		rval = bigstat_iter(fshandlep,
 				     fsfd,
 				     BIGSTAT_ITER_ALL,
-				     ( xfs_ino_t )0,
+				     (xfs_ino_t)0,
 				     cb_add,
 				     NULL,
 				     NULL,
@@ -271,80 +271,80 @@ inomap_build( jdm_fshandle_t *fshandlep,
 				     &stat,
 				     preemptchk,
 				     bstatbufp,
-				     bstatbuflen );
+				     bstatbuflen);
 	}
 	*inomap_statphasep = 0;
-	if ( rval || preemptchk( PREEMPT_FULL )) {
+	if (rval || preemptchk(PREEMPT_FULL)) {
 		cb_context_free();
-		free( ( void * )bstatbufp );
+		free((void *)bstatbufp);
 		return BOOL_FALSE;
 	}
 
-	if ( inomap_exclude_filesize > 0 ) {
-		mlog( MLOG_NOTE | MLOG_VERBOSE, _(
+	if (inomap_exclude_filesize > 0) {
+		mlog(MLOG_NOTE | MLOG_VERBOSE, _(
 		      "pruned %llu files: maximum size exceeded\n"),
-		      inomap_exclude_filesize );
+		      inomap_exclude_filesize);
 	}
-	if ( inomap_exclude_skipattr > 0 ) {
-		mlog( MLOG_NOTE | MLOG_VERBOSE, _(
+	if (inomap_exclude_skipattr > 0) {
+		mlog(MLOG_NOTE | MLOG_VERBOSE, _(
 		      "pruned %llu files: skip attribute set\n"),
-		      inomap_exclude_skipattr );
+		      inomap_exclude_skipattr);
 	}
 
 	/* prune directories unchanged since the last dump and containing
 	 * no children needing dumping.
 	 */
-	if ( pruneneeded ) {
+	if (pruneneeded) {
 		bool_t	rootdump = BOOL_FALSE;
 
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 2: "
-		      "pruning unneeded subtrees\n") );
+		      "pruning unneeded subtrees\n"));
 		*inomap_statdonep = 0;
 		*inomap_statpassp = 0;
 		*inomap_statphasep = 2;
 
-		(void) supprt_prune( &rootdump,
+		(void) supprt_prune(&rootdump,
 				     fshandlep,
 				     fsfd,
 				     rootstatp,
-				     NULL );
+				     NULL);
 		*inomap_statphasep = 0;
 
-		if ( preemptchk( PREEMPT_FULL )) {
+		if (preemptchk(PREEMPT_FULL)) {
 			cb_context_free();
-			free( ( void * )bstatbufp );
+			free((void *)bstatbufp);
 			return BOOL_FALSE;
 		}
 
 	} else {
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 2: "
-		      "skipping (no pruning necessary)\n") );
+		      "skipping (no pruning necessary)\n"));
 	}
 
 	/* initialize the callback context for startpoint calculation
 	 */
-	cb_spinit( );
+	cb_spinit();
 
 	/* identify dump stream startpoints
 	 */
-	if ( startptcnt > 1 ) {
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+	if (startptcnt > 1) {
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 3: "
-		      "identifying stream starting points\n") );
+		      "identifying stream starting points\n"));
 	} else {
-		mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
+		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 		      "ino map phase 3: "
-		      "skipping (only one dump stream)\n") );
+		      "skipping (only one dump stream)\n"));
 	}
 	stat = 0;
 	*inomap_statdonep = 0;
 	*inomap_statphasep = 3;
-	rval = bigstat_iter( fshandlep,
+	rval = bigstat_iter(fshandlep,
 			     fsfd,
 			     BIGSTAT_ITER_NONDIR,
-			     ( xfs_ino_t )0,
+			     (xfs_ino_t)0,
 			     cb_startpt,
 			     NULL,
 			     inomap_next_nondir,
@@ -352,66 +352,66 @@ inomap_build( jdm_fshandle_t *fshandlep,
 			     &stat,
 			     preemptchk,
 			     bstatbufp,
-			     bstatbuflen );
+			     bstatbuflen);
 	*inomap_statphasep = 0;
 
-	if ( rval ) {
+	if (rval) {
 		cb_context_free();
-		free( ( void * )bstatbufp );
+		free((void *)bstatbufp);
 		return BOOL_FALSE;
 	}
 
-	if ( startptcnt > 1 ) {
+	if (startptcnt > 1) {
 		ix_t startptix;
-		for ( startptix = 0 ; startptix < startptcnt ; startptix++ ) {
+		for (startptix = 0 ; startptix < startptcnt ; startptix++) {
 			startpt_t *p;
 			startpt_t *ep;
 
-			p = &startptp[ startptix ];
-			if ( startptix == startptcnt - 1 ) {
+			p = &startptp[startptix];
+			if (startptix == startptcnt - 1) {
 				ep = 0;
 			} else {
-				ep = &startptp[ startptix + 1 ];
+				ep = &startptp[startptix + 1];
 			}
-			assert( ! p->sp_flags );
-			mlog( MLOG_VERBOSE | MLOG_INOMAP,
+			assert(! p->sp_flags);
+			mlog(MLOG_VERBOSE | MLOG_INOMAP,
 			      _("stream %u: ino %llu offset %lld to "),
 			      startptix,
 			      p->sp_ino,
-			      p->sp_offset );
-			if ( ! ep ) {
-				mlog( MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
-				      _("end\n") );
+			      p->sp_offset);
+			if (! ep) {
+				mlog(MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
+				      _("end\n"));
 			} else {
-				mlog( MLOG_VERBOSE |  MLOG_BARE | MLOG_INOMAP,
+				mlog(MLOG_VERBOSE |  MLOG_BARE | MLOG_INOMAP,
 				      _("ino %llu offset %lld\n"),
 				      ep->sp_ino,
-				      ep->sp_offset );
+				      ep->sp_offset);
 			}
 		}
 	}
 
 	cb_context_free();
-	free( ( void * )bstatbufp );
-	mlog( MLOG_VERBOSE | MLOG_INOMAP, _(
-	      "ino map construction complete\n") );
+	free((void *)bstatbufp);
+	mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
+	      "ino map construction complete\n"));
 	return BOOL_TRUE;
 }
 
 void
-inomap_skip( xfs_ino_t ino )
+inomap_skip(xfs_ino_t ino)
 {
 	int oldstate;
 
-	oldstate = inomap_get_state( NULL, ino );
-	if ( oldstate == MAP_NDR_CHANGE) {
-		inomap_set_state( NULL, ino, MAP_NDR_NOCHNG );
+	oldstate = inomap_get_state(NULL, ino);
+	if (oldstate == MAP_NDR_CHANGE) {
+		inomap_set_state(NULL, ino, MAP_NDR_NOCHNG);
 	}
 
-	if ( oldstate == MAP_DIR_CHANGE
+	if (oldstate == MAP_DIR_CHANGE
 	     ||
-	     oldstate == MAP_DIR_SUPPRT ) {
-		inomap_set_state( NULL, ino, MAP_DIR_NOCHNG );
+	     oldstate == MAP_DIR_SUPPRT) {
+		inomap_set_state(NULL, ino, MAP_DIR_NOCHNG);
 	}
 }
 
@@ -445,7 +445,7 @@ static bool_t cb_skip_unchanged_dirs;	/* set by cb_context() */
  * phases of inomap_build().
  */
 static int
-cb_context( bool_t last,
+cb_context(bool_t last,
 	    time32_t lasttime,
 	    bool_t resume,
 	    time32_t resumetime,
@@ -455,7 +455,7 @@ cb_context( bool_t last,
 	    size_t startptcnt,
 	    int igrpcnt,
 	    bool_t skip_unchanged_dirs,
-	    bool_t *pruneneededp )
+	    bool_t *pruneneededp)
 {
 	cb_last = last;
 	cb_lasttime = lasttime;
@@ -471,7 +471,7 @@ cb_context( bool_t last,
 	cb_pruneneededp = pruneneededp;
 	cb_skip_unchanged_dirs = skip_unchanged_dirs;
 
-	if (inomap_init( igrpcnt ))
+	if (inomap_init(igrpcnt))
 		return -1;
 
 	cb_inomap_contextp = inomap_alloc_context();
@@ -482,13 +482,13 @@ cb_context( bool_t last,
 }
 
 static void
-cb_context_free( void )
+cb_context_free(void)
 {
-	inomap_free_context( cb_inomap_contextp );
+	inomap_free_context(cb_inomap_contextp);
 }
 
 static int
-cb_count_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
+cb_count_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 {
 	int *count = (int *)arg1;
 	(*count)++;
@@ -502,25 +502,25 @@ cb_count_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
  */
 /* ARGSUSED */
 static int
-cb_add( void *arg1,
+cb_add(void *arg1,
 	jdm_fshandle_t *fshandlep,
 	int fsfd,
-	xfs_bstat_t *statp )
+	xfs_bstat_t *statp)
 {
 	register time32_t mtime = statp->bs_mtime.tv_sec;
 	register time32_t ctime = statp->bs_ctime.tv_sec;
-	register time32_t ltime = max( mtime, ctime );
+	register time32_t ltime = max(mtime, ctime);
 	register mode_t mode = statp->bs_mode & S_IFMT;
 	xfs_off_t estimated_size = 0;
 	xfs_ino_t ino = statp->bs_ino;
 	bool_t changed;
 	bool_t resumed;
 
-	( *inomap_statdonep )++;
+	(*inomap_statdonep)++;
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink == 0 ) {
+	if (statp->bs_nlink == 0) {
 		return 0;
 	}
 
@@ -533,14 +533,14 @@ cb_add( void *arg1,
 	 * increment was based, dump it if it has changed since that
 	 * original base dump.
 	 */
-	if ( cb_resume && ! cb_inoinresumerange( ino )) {
-		if ( ltime >= cb_resumetime ) {
+	if (cb_resume && ! cb_inoinresumerange(ino)) {
+		if (ltime >= cb_resumetime) {
 			changed = BOOL_TRUE;
 		} else {
 			changed = BOOL_FALSE;
 		}
-	} else if ( cb_last ) {
-		if ( ltime >= cb_lasttime ) {
+	} else if (cb_last) {
+		if (ltime >= cb_lasttime) {
 			changed = BOOL_TRUE;
 		} else {
 			changed = BOOL_FALSE;
@@ -552,86 +552,86 @@ cb_add( void *arg1,
 	/* this is redundant: make sure any ino partially dumped
 	 * is completed.
 	 */
-	if ( cb_resume && cb_inoresumed( ino )) {
+	if (cb_resume && cb_inoresumed(ino)) {
 		resumed = BOOL_TRUE;
 	} else {
 		resumed = BOOL_FALSE;
 	}
 
-	if ( changed ) {
-		if ( mode == S_IFDIR ) {
-			inomap_add( cb_inomap_contextp,
+	if (changed) {
+		if (mode == S_IFDIR) {
+			inomap_add(cb_inomap_contextp,
 				    ino,
 				    (gen_t)statp->bs_gen,
-				    MAP_DIR_CHANGE );
+				    MAP_DIR_CHANGE);
 			cb_dircnt++;
 		} else {
-			estimated_size = estimate_dump_space( statp );
+			estimated_size = estimate_dump_space(statp);
 
 			/* skip if size is greater than prune size. quota
 			 * files are exempt from the check.
 			 */
-			if ( maxdumpfilesize > 0 &&
+			if (maxdumpfilesize > 0 &&
 			     estimated_size > maxdumpfilesize &&
-			     !is_quota_file(statp->bs_ino) ) {
-				mlog( MLOG_DEBUG | MLOG_EXCLFILES,
+			     !is_quota_file(statp->bs_ino)) {
+				mlog(MLOG_DEBUG | MLOG_EXCLFILES,
 				      "pruned ino %llu, owner %u, estimated size %llu: maximum size exceeded\n",
 				      statp->bs_ino,
 				      statp->bs_uid,
-				      estimated_size );
-				inomap_add( cb_inomap_contextp,
+				      estimated_size);
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_NDR_NOCHNG );
+					    MAP_NDR_NOCHNG);
 				inomap_exclude_filesize++;
 				return 0;
 			}
 
 			if (allowexcludefiles_pr && statp->bs_xflags & XFS_XFLAG_NODUMP) {
-				mlog( MLOG_DEBUG | MLOG_EXCLFILES,
+				mlog(MLOG_DEBUG | MLOG_EXCLFILES,
 				      "pruned ino %llu, owner %u, estimated size %llu: skip flag set\n",
 				      statp->bs_ino,
 				      statp->bs_uid,
-				      estimated_size );
-				inomap_add( cb_inomap_contextp,
+				      estimated_size);
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_NDR_NOCHNG );
+					    MAP_NDR_NOCHNG);
 				inomap_exclude_skipattr++;
 				return 0;
 			}
 
-			inomap_add( cb_inomap_contextp,
+			inomap_add(cb_inomap_contextp,
 				    ino,
 				    (gen_t)statp->bs_gen,
-				    MAP_NDR_CHANGE );
+				    MAP_NDR_CHANGE);
 			cb_nondircnt++;
 			cb_datasz += estimated_size;
-			cb_hdrsz += ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
+			cb_hdrsz += (EXTENTHDR_SZ * (statp->bs_extents + 1));
 		}
-	} else if ( resumed ) {
-		assert( mode != S_IFDIR );
-		assert( changed );
+	} else if (resumed) {
+		assert(mode != S_IFDIR);
+		assert(changed);
 	} else {
-		if ( mode == S_IFDIR ) {
-			if ( cb_skip_unchanged_dirs ) {
-				inomap_add( cb_inomap_contextp,
+		if (mode == S_IFDIR) {
+			if (cb_skip_unchanged_dirs) {
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_DIR_NOCHNG );
+					    MAP_DIR_NOCHNG);
 			} else {
 				*cb_pruneneededp = BOOL_TRUE;
-				inomap_add( cb_inomap_contextp,
+				inomap_add(cb_inomap_contextp,
 					    ino,
 					    (gen_t)statp->bs_gen,
-					    MAP_DIR_SUPPRT );
+					    MAP_DIR_SUPPRT);
 				cb_dircnt++;
 			}
 		} else {
-			inomap_add( cb_inomap_contextp,
+			inomap_add(cb_inomap_contextp,
 				    ino,
 				    (gen_t)statp->bs_gen,
-				    MAP_NDR_NOCHNG );
+				    MAP_NDR_NOCHNG);
 		}
 	}
 
@@ -639,23 +639,23 @@ cb_add( void *arg1,
 }
 
 static bool_t
-cb_inoinresumerange( xfs_ino_t ino )
+cb_inoinresumerange(xfs_ino_t ino)
 {
 	register size_t streamix;
 
-	for ( streamix = 0 ; streamix < cb_resumerangecnt ; streamix++ ) {
-		register drange_t *rp = &cb_resumerangep[ streamix ];
-		if ( ! ( rp->dr_begin.sp_flags & STARTPT_FLAGS_END )
+	for (streamix = 0 ; streamix < cb_resumerangecnt ; streamix++) {
+		register drange_t *rp = &cb_resumerangep[streamix];
+		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
 		     &&
 		     ino >= rp->dr_begin.sp_ino
 		     &&
-		     ( ( rp->dr_end.sp_flags & STARTPT_FLAGS_END )
+		     ((rp->dr_end.sp_flags & STARTPT_FLAGS_END)
 		       ||
 		       ino < rp->dr_end.sp_ino
 		       ||
-		       ( ino == rp->dr_end.sp_ino
+		       (ino == rp->dr_end.sp_ino
 			 &&
-			 rp->dr_end.sp_offset != 0 ))) {
+			 rp->dr_end.sp_offset != 0))) {
 			return BOOL_TRUE;
 		}
 	}
@@ -664,17 +664,17 @@ cb_inoinresumerange( xfs_ino_t ino )
 }
 
 static bool_t
-cb_inoresumed( xfs_ino_t ino )
+cb_inoresumed(xfs_ino_t ino)
 {
 	size_t streamix;
 
-	for ( streamix = 0 ; streamix < cb_resumerangecnt ; streamix++ ) {
-		drange_t *rp = &cb_resumerangep[ streamix ];
-		if ( ! ( rp->dr_begin.sp_flags & STARTPT_FLAGS_END )
+	for (streamix = 0 ; streamix < cb_resumerangecnt ; streamix++) {
+		drange_t *rp = &cb_resumerangep[streamix];
+		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
 		     &&
 		     ino == rp->dr_begin.sp_ino
 		     &&
-		     rp->dr_begin.sp_offset != 0 ) {
+		     rp->dr_begin.sp_offset != 0) {
 			return BOOL_TRUE;
 		}
 	}
@@ -688,20 +688,20 @@ cb_inoresumed( xfs_ino_t ino )
  */
 /* ARGSUSED */
 static bool_t			/* false, used as diriter callback */
-supprt_prune( void *arg1,	/* ancestors marked as changed? */
+supprt_prune(void *arg1,	/* ancestors marked as changed? */
 	      jdm_fshandle_t *fshandlep,
 	      int fsfd,
 	      xfs_bstat_t *statp,
-	      char *name )
+	      char *name)
 {
 	static bool_t cbrval = BOOL_FALSE;
 	int state;
 
-	if ( ( statp->bs_mode & S_IFMT ) == S_IFDIR ) {
+	if ((statp->bs_mode & S_IFMT) == S_IFDIR) {
 		bool_t changed_below = BOOL_FALSE;
 
-		state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
-		if ( state != MAP_DIR_CHANGE &&
+		state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
+		if (state != MAP_DIR_CHANGE &&
                      state != MAP_DIR_NOCHNG &&
 		     state != MAP_DIR_SUPPRT) {
 			/*
@@ -709,67 +709,67 @@ supprt_prune( void *arg1,	/* ancestors marked as changed? */
 			 * certainly changed.
 			 */
 			state = MAP_DIR_CHANGE;
-			inomap_set_state( cb_inomap_contextp,
+			inomap_set_state(cb_inomap_contextp,
 					  statp->bs_ino,
-					  state );
+					  state);
 		}
 
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 supprt_prune,
 				 (void *)&changed_below,
 				 &cbrval,
 				 NULL,
-				 0 );
+				 0);
 
-		if ( state == MAP_DIR_SUPPRT ) {
-			if ( changed_below == BOOL_FALSE ) {
-				inomap_set_state( cb_inomap_contextp,
+		if (state == MAP_DIR_SUPPRT) {
+			if (changed_below == BOOL_FALSE) {
+				inomap_set_state(cb_inomap_contextp,
 						  statp->bs_ino,
-						  MAP_DIR_NOCHNG );
+						  MAP_DIR_NOCHNG);
 				cb_dircnt--;	/* dump size just changed! */
 			}
 			else {
 				/* Directory entries back up the hierarchy */
 				/* to be dumped - as either MAP_DIR_SUPPRT */
 				/* or as MAP_DIR_CHANGE in inode state map */
-				*( bool_t * )arg1 = BOOL_TRUE;
+				*(bool_t *)arg1 = BOOL_TRUE;
 			}
 		}
-		else if ( state == MAP_DIR_CHANGE ) {
+		else if (state == MAP_DIR_CHANGE) {
 			/* Directory entries back up the hierarchy must get */
 			/* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */
-			*( bool_t * )arg1 = BOOL_TRUE;
+			*(bool_t *)arg1 = BOOL_TRUE;
 		}
 		return cbrval;
 	}
 
-	if ( *(bool_t *)arg1 == BOOL_TRUE ) {	/* shortcut, sibling changed */
+	if (*(bool_t *)arg1 == BOOL_TRUE) {	/* shortcut, sibling changed */
 		return cbrval;
 	}
 
-	state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
-	if ( state != MAP_NDR_CHANGE &&
-	     state != MAP_NDR_NOCHNG ) {
+	state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
+	if (state != MAP_NDR_CHANGE &&
+	     state != MAP_NDR_NOCHNG) {
 		/*
 		 * if dir is now a file then it has
 		 * certainly changed.
 		 */
 		state = MAP_NDR_CHANGE;
-		inomap_set_state( cb_inomap_contextp, statp->bs_ino, state );
+		inomap_set_state(cb_inomap_contextp, statp->bs_ino, state);
 	}
-	if ( state == MAP_NDR_CHANGE ) {
+	if (state == MAP_NDR_CHANGE) {
 		/* Directory entries back up the hierarchy must get */
 		/* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */
-		*( bool_t * )arg1 = BOOL_TRUE;
+		*(bool_t *)arg1 = BOOL_TRUE;
 	}
 	return cbrval;
 }
 
 
 static void
-cb_accuminit_sz( void )
+cb_accuminit_sz(void)
 {
 	cb_datasz = 0;
 	cb_hdrsz = 0;
@@ -782,10 +782,10 @@ cb_accuminit_sz( void )
  * cb_accum accumulates the dump space.
  */
 static void
-cb_spinit( void )
+cb_spinit(void)
 {
 	cb_startptix = 0;
-	cb_incr = (cb_datasz + cb_hdrsz) / ( off64_t )cb_startptcnt;
+	cb_incr = (cb_datasz + cb_hdrsz) / (off64_t)cb_startptcnt;
 	cb_target = 0; /* so first ino will push us over the edge */
 	cb_accum = 0;
 }
@@ -809,10 +809,10 @@ typedef enum {
 
 /* ARGSUSED */
 static int
-cb_startpt( void *arg1,
+cb_startpt(void *arg1,
 	    jdm_fshandle_t *fshandlep,
 	    int fsfd,
-	    xfs_bstat_t *statp )
+	    xfs_bstat_t *statp)
 {
 	register int state;
 
@@ -821,31 +821,31 @@ cb_startpt( void *arg1,
 	off64_t qty;	/* amount of a SPLIT file to skip */
 	action_t action;
 
-	( *inomap_statdonep )++;
+	(*inomap_statdonep)++;
 
 	/* skip if no links
 	 */
-	if ( statp->bs_nlink == 0 ) {
+	if (statp->bs_nlink == 0) {
 		return 0;
 	}
 
 	/* skip if not in inomap or not a non-dir
 	 */
-	state = inomap_get_state( cb_inomap_contextp, statp->bs_ino );
-	if ( state != MAP_NDR_CHANGE ) {
+	state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
+	if (state != MAP_NDR_CHANGE) {
 		return 0;
 	}
 
-	assert( cb_startptix < cb_startptcnt );
+	assert(cb_startptix < cb_startptcnt);
 
-	estimate = estimate_dump_space( statp );
-	cb_accum += estimate + ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
+	estimate = estimate_dump_space(statp);
+	cb_accum += estimate + (EXTENTHDR_SZ * (statp->bs_extents + 1));
 
 	/* loop until no new start points found. loop is necessary
 	 * to handle the pathological case of a huge file so big it
 	 * spans several streams.
 	 */
-	action = ( action_t )HOLD; /* irrelevant, but demanded by lint */
+	action = (action_t)HOLD; /* irrelevant, but demanded by lint */
 	do {
 		/* decide what to do: hold, bump, or split. there are
 		 * 8 valid cases to consider:
@@ -874,69 +874,69 @@ cb_startpt( void *arg1,
 		 *    accum incl. this file is would be way beyond the
 		 *    target: HOLD.
 		 */
-		if ( cb_target - old_accum >= TOO_SHY ) {
-			if ( cb_target - cb_accum >= TOO_SHY ) {
-				action = ( action_t )HOLD;
-			} else if ( cb_accum <= cb_target ) {
-				action = ( action_t )HOLD;
-			} else if ( cb_accum - cb_target < TOO_BOLD ) {
-				action = ( action_t )HOLD;
+		if (cb_target - old_accum >= TOO_SHY) {
+			if (cb_target - cb_accum >= TOO_SHY) {
+				action = (action_t)HOLD;
+			} else if (cb_accum <= cb_target) {
+				action = (action_t)HOLD;
+			} else if (cb_accum - cb_target < TOO_BOLD) {
+				action = (action_t)HOLD;
 			} else {
-				action = ( action_t )SPLIT;
+				action = (action_t)SPLIT;
 			}
 		} else {
-			if ( cb_target - cb_accum >= TOO_SHY ) {
-				action = ( action_t )YELL;
-			} else if ( cb_accum < cb_target ) {
-				action = ( action_t )HOLD;
-			} else if ( cb_accum - cb_target < TOO_BOLD ) {
-				if ( cb_accum - cb_target >=
-						      cb_target - old_accum ) {
-					action = ( action_t )BUMP;
+			if (cb_target - cb_accum >= TOO_SHY) {
+				action = (action_t)YELL;
+			} else if (cb_accum < cb_target) {
+				action = (action_t)HOLD;
+			} else if (cb_accum - cb_target < TOO_BOLD) {
+				if (cb_accum - cb_target >=
+						      cb_target - old_accum) {
+					action = (action_t)BUMP;
 				} else {
-					action = ( action_t )HOLD;
+					action = (action_t)HOLD;
 				}
 			} else {
-				action = ( action_t )BUMP;
+				action = (action_t)BUMP;
 			}
 		}
 
 		/* perform the action selected above
 		 */
-		switch ( action ) {
-		case ( action_t )HOLD:
+		switch (action) {
+		case (action_t)HOLD:
 			break;
-		case ( action_t )BUMP:
+		case (action_t)BUMP:
 			cb_startptp->sp_ino = statp->bs_ino;
 			cb_startptp->sp_offset = 0;
 			cb_startptix++;
 			cb_startptp++;
 			cb_target += cb_incr;
-			if ( cb_startptix == cb_startptcnt ) {
+			if (cb_startptix == cb_startptcnt) {
 				return 1; /* done; abort the iteration */
 			}
 			break;
-		case ( action_t )SPLIT:
+		case (action_t)SPLIT:
 			cb_startptp->sp_ino = statp->bs_ino;
-			qty = ( cb_target - old_accum )
+			qty = (cb_target - old_accum)
 			      &
-			      ~( off64_t )( BBSIZE - 1 );
+			      ~(off64_t)(BBSIZE - 1);
 			cb_startptp->sp_offset =
-					quantity2offset( fshandlep,
+					quantity2offset(fshandlep,
 							 statp,
-							 qty );
+							 qty);
 			cb_startptix++;
 			cb_startptp++;
 			cb_target += cb_incr;
-			if ( cb_startptix == cb_startptcnt ) {
+			if (cb_startptix == cb_startptcnt) {
 				return 1; /* done; abort the iteration */
 			}
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 			return 1;
 		}
-	} while ( action == ( action_t )BUMP || action == ( action_t )SPLIT );
+	} while (action == (action_t)BUMP || action == (action_t)SPLIT);
 
 	return 0;
 }
@@ -948,7 +948,7 @@ cb_startpt( void *arg1,
  */
 struct i2gseg {
 	uint64_t s_valid;
-	gen_t s_gen[ INOPERSEG ];
+	gen_t s_gen[INOPERSEG];
 };
 typedef struct i2gseg i2gseg_t;
 
@@ -966,15 +966,15 @@ static struct inomap {
 } inomap;
 
 static inline void
-SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
+SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 {
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	register uint64_t clrmask;
 	relino = ino - segp->base;
-	mask = ( uint64_t )1 << relino;
+	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
-	switch( state ) {
+	switch(state) {
 	case 0:
 		segp->lobits &= clrmask;
 		segp->mebits &= clrmask;
@@ -1019,22 +1019,22 @@ SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
 }
 
 static inline int
-SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
+SEG_GET_BITS(seg_t *segp, xfs_ino_t ino)
 {
 	int state;
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	relino = ino - segp->base;
-	mask = ( uint64_t )1 << relino;
-	if ( segp->lobits & mask ) {
+	mask = (uint64_t)1 << relino;
+	if (segp->lobits & mask) {
 		state = 1;
 	} else {
 		state = 0;
 	}
-	if ( segp->mebits & mask ) {
+	if (segp->mebits & mask) {
 		state |= 2;
 	}
-	if ( segp->hibits & mask ) {
+	if (segp->hibits & mask) {
 		state |= 4;
 	}
 
@@ -1044,9 +1044,9 @@ SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 /* context for inomap construction - initialized by map_init
  */
 static int
-inomap_init( int igrpcnt )
+inomap_init(int igrpcnt)
 {
-	assert( sizeof( hnk_t ) == HNKSZ );
+	assert(sizeof(hnk_t) == HNKSZ);
 
 	/* lastseg must be initialized with -1 offsets since
 	 * no segments have been added yet */
@@ -1055,58 +1055,58 @@ inomap_init( int igrpcnt )
 	inomap.hnkmaplen = (igrpcnt + SEGPERHNK - 1) / SEGPERHNK;
 	inomap.hnkmap = (hnk_t *)malloc(inomap.hnkmaplen * HNKSZ);
 	inomap.i2gmap = (i2gseg_t *)
-		calloc( inomap.hnkmaplen * SEGPERHNK, sizeof(i2gseg_t) );
+		calloc(inomap.hnkmaplen * SEGPERHNK, sizeof(i2gseg_t));
 	if (!inomap.hnkmap || !inomap.i2gmap)
 		return -1;
 	return 0;
 }
 
 uint64_t
-inomap_getsz( void )
+inomap_getsz(void)
 {
 	return (inomap.lastseg.hnkoff + 1) * HNKSZ;
 }
 
 static inline bool_t
-inomap_validaddr( seg_addr_t *addrp )
+inomap_validaddr(seg_addr_t *addrp)
 {
 	int maxseg;
 
-	if ( addrp->hnkoff < 0 || addrp->hnkoff > inomap.lastseg.hnkoff )
+	if (addrp->hnkoff < 0 || addrp->hnkoff > inomap.lastseg.hnkoff)
 		return BOOL_FALSE;
 
-	maxseg = ( addrp->hnkoff == inomap.lastseg.hnkoff ) ?
+	maxseg = (addrp->hnkoff == inomap.lastseg.hnkoff) ?
 			inomap.lastseg.segoff : SEGPERHNK - 1;
 
-	if ( addrp->segoff < 0 || addrp->segoff > maxseg )
+	if (addrp->segoff < 0 || addrp->segoff > maxseg)
 		return BOOL_FALSE;
 
 	return BOOL_TRUE;
 }
 
 static inline hnk_t *
-inomap_addr2hnk( seg_addr_t *addrp )
+inomap_addr2hnk(seg_addr_t *addrp)
 {
 	return &inomap.hnkmap[addrp->hnkoff];
 }
 
 static inline seg_t *
-inomap_addr2seg( seg_addr_t *addrp )
+inomap_addr2seg(seg_addr_t *addrp)
 {
-	hnk_t *hunkp = inomap_addr2hnk( addrp );
+	hnk_t *hunkp = inomap_addr2hnk(addrp);
 	return &hunkp->seg[addrp->segoff];
 }
 
 static inline int
-inomap_addr2segix( seg_addr_t *addrp )
+inomap_addr2segix(seg_addr_t *addrp)
 {
-	return ( addrp->hnkoff * SEGPERHNK ) + addrp->segoff;
+	return (addrp->hnkoff * SEGPERHNK) + addrp->segoff;
 }
 
 static inline int
-inomap_lastseg( int hnkoff )
+inomap_lastseg(int hnkoff)
 {
-	if ( hnkoff == inomap.lastseg.hnkoff )
+	if (hnkoff == inomap.lastseg.hnkoff)
 		return inomap.lastseg.segoff;
 	else
 		return SEGPERHNK - 1;
@@ -1116,7 +1116,7 @@ inomap_lastseg( int hnkoff )
  * order. adds a new segment to the inomap and ino-to-gen map.
  */
 static int
-cb_add_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
+cb_add_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 {
 	hnk_t *hunk;
 	seg_t *segp;
@@ -1149,13 +1149,13 @@ cb_add_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
 			       SEGPERHNK * sizeof(i2gseg_t));
 		}
 
-		memset(inomap_addr2hnk( lastsegp ), 0, HNKSZ);
+		memset(inomap_addr2hnk(lastsegp), 0, HNKSZ);
 	}
 
-	hunk = inomap_addr2hnk( lastsegp );
+	hunk = inomap_addr2hnk(lastsegp);
 	hunk->maxino = inogrp->xi_startino + INOPERSEG - 1;
 
-	segp = inomap_addr2seg( lastsegp );
+	segp = inomap_addr2seg(lastsegp);
 	segp->base = inogrp->xi_startino;
 
 	return 0;
@@ -1164,41 +1164,41 @@ cb_add_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
 /* called for every ino to be added to the map.
  */
 static void
-inomap_add( void *contextp, xfs_ino_t ino, gen_t gen, int state )
+inomap_add(void *contextp, xfs_ino_t ino, gen_t gen, int state)
 {
-	inomap_set_state( contextp, ino, state );
-	inomap_set_gen( contextp, ino, gen );
+	inomap_set_state(contextp, ino, state);
+	inomap_set_gen(contextp, ino, gen);
 }
 
 void *
-inomap_alloc_context( void )
+inomap_alloc_context(void)
 {
-	void *addr = calloc( 1, sizeof(seg_addr_t) );
+	void *addr = calloc(1, sizeof(seg_addr_t));
 	if (!addr) {
-		mlog( MLOG_NORMAL | MLOG_ERROR,
+		mlog(MLOG_NORMAL | MLOG_ERROR,
 		      _("failed to allocate inomap context: %s\n"),
-		      strerror(errno) );
+		      strerror(errno));
 	}
 	return addr;
 }
 
 void
-inomap_reset_context( void *p )
+inomap_reset_context(void *p)
 {
-	memset( p, 0, sizeof(seg_addr_t) );
+	memset(p, 0, sizeof(seg_addr_t));
 }
 
 void
-inomap_free_context( void *p )
+inomap_free_context(void *p)
 {
-	free( p );
+	free(p);
 }
 
 /* use binary search to find the hunk containing the given inode.
  * use the supplied addr as the starting point for the search.
  */
 static bool_t
-inomap_find_hnk( seg_addr_t *addrp, xfs_ino_t ino )
+inomap_find_hnk(seg_addr_t *addrp, xfs_ino_t ino)
 {
 	hnk_t *hunkp;
 	int lower;
@@ -1206,12 +1206,12 @@ inomap_find_hnk( seg_addr_t *addrp, xfs_ino_t ino )
 
 	lower = 0;
 	upper = inomap.lastseg.hnkoff;
-	while ( upper >= lower ) {
-		hunkp = inomap_addr2hnk( addrp );
+	while (upper >= lower) {
+		hunkp = inomap_addr2hnk(addrp);
 
-		if ( hunkp->seg[0].base > ino ) {
+		if (hunkp->seg[0].base > ino) {
 			upper = addrp->hnkoff - 1;
-		} else if ( hunkp->maxino < ino ) {
+		} else if (hunkp->maxino < ino) {
 			lower = addrp->hnkoff + 1;
 		} else {
 			return BOOL_TRUE;
@@ -1230,29 +1230,29 @@ inomap_find_hnk( seg_addr_t *addrp, xfs_ino_t ino )
  * point for the search.
  */
 static bool_t
-inomap_find_seg( seg_addr_t *addrp, xfs_ino_t ino )
+inomap_find_seg(seg_addr_t *addrp, xfs_ino_t ino)
 {
 	seg_t *segp;
 	int lower;
 	int upper;
 
-	if ( !inomap_validaddr( addrp ) ) {
-		inomap_reset_context( addrp );
+	if (!inomap_validaddr(addrp) ) {
+		inomap_reset_context(addrp);
 	}
 
-	if ( !inomap_find_hnk( addrp, ino ) )
+	if (!inomap_find_hnk(addrp, ino) )
 		return BOOL_FALSE;
 
 	/* find the correct segment */
 	lower = 0;
 	upper = inomap_lastseg(addrp->hnkoff);
 
-	while ( upper >= lower ) {
-		segp = inomap_addr2seg( addrp );
+	while (upper >= lower) {
+		segp = inomap_addr2seg(addrp);
 
-		if ( segp->base > ino ) {
+		if (segp->base > ino) {
 			upper = addrp->segoff - 1;
-		} else if ( segp->base + INOPERSEG <= ino ) {
+		} else if (segp->base + INOPERSEG <= ino) {
 			lower = addrp->segoff + 1;
 		} else {
 			return BOOL_TRUE;
@@ -1265,28 +1265,28 @@ inomap_find_seg( seg_addr_t *addrp, xfs_ino_t ino )
 }
 
 static xfs_ino_t
-inomap_iter( void *contextp, int statemask )
+inomap_iter(void *contextp, int statemask)
 {
 	xfs_ino_t ino, endino;
 	seg_t *segp;
 	seg_addr_t *addrp = (seg_addr_t *)contextp;
 
-	for ( ;
+	for (;
 	      addrp->hnkoff <= inomap.lastseg.hnkoff;
-	      addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0 ) {
+	      addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0) {
 
-		for ( ;
+		for (;
 		      addrp->segoff <= inomap_lastseg(addrp->hnkoff);
-		      addrp->segoff++, addrp->inooff = 0 ) {
+		      addrp->segoff++, addrp->inooff = 0) {
 
-			segp = inomap_addr2seg( addrp );
+			segp = inomap_addr2seg(addrp);
 
 			ino = segp->base + addrp->inooff;
 			endino = segp->base + INOPERSEG;
-			for ( ; ino < endino ; ino++, addrp->inooff++ ) {
+			for (; ino < endino ; ino++, addrp->inooff++) {
 				int st;
-				st = SEG_GET_BITS( segp, ino );
-				if ( statemask & ( 1 << st )) {
+				st = SEG_GET_BITS(segp, ino);
+				if (statemask & (1 << st)) {
 					addrp->inooff++; /* for next call */
 					return ino;
 				}
@@ -1324,7 +1324,7 @@ inomap_next_dir(void *contextp, xfs_ino_t lastino)
 }
 
 static int
-inomap_set_state( void *contextp, xfs_ino_t ino, int state )
+inomap_set_state(void *contextp, xfs_ino_t ino, int state)
 {
 	int oldstate;
 	seg_addr_t *addrp;
@@ -1332,31 +1332,31 @@ inomap_set_state( void *contextp, xfs_ino_t ino, int state )
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino) )
 		return MAP_INO_UNUSED;
 
-	segp = inomap_addr2seg( addrp );
+	segp = inomap_addr2seg(addrp);
 
-	oldstate = SEG_GET_BITS( segp, ino );
-	SEG_SET_BITS( segp, ino, state );
+	oldstate = SEG_GET_BITS(segp, ino);
+	SEG_SET_BITS(segp, ino, state);
 
 	return oldstate;
 }
 
 int
-inomap_get_state( void *contextp, xfs_ino_t ino )
+inomap_get_state(void *contextp, xfs_ino_t ino)
 {
 	seg_addr_t *addrp;
 	seg_addr_t addr;
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino) )
 		return MAP_INO_UNUSED;
 
-	segp = inomap_addr2seg( addrp );
+	segp = inomap_addr2seg(addrp);
 
-	return SEG_GET_BITS( segp, ino );
+	return SEG_GET_BITS(segp, ino);
 }
 
 static void
@@ -1369,11 +1369,11 @@ inomap_set_gen(void *contextp, xfs_ino_t ino, gen_t gen)
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino) )
 		return;
 
-	segp = inomap_addr2seg( addrp );
-	i2gsegp = &inomap.i2gmap[inomap_addr2segix( addrp )];
+	segp = inomap_addr2seg(addrp);
+	i2gsegp = &inomap.i2gmap[inomap_addr2segix(addrp)];
 
 	relino = ino - segp->base;
 	i2gsegp->s_valid |= (uint64_t)1 << relino;
@@ -1381,7 +1381,7 @@ inomap_set_gen(void *contextp, xfs_ino_t ino, gen_t gen)
 }
 
 int
-inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen )
+inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen)
 {
 	seg_addr_t *addrp;
 	seg_addr_t addr;
@@ -1390,14 +1390,14 @@ inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen )
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if ( !inomap_find_seg( addrp, ino ) )
+	if (!inomap_find_seg(addrp, ino) )
 		return 1;
 
-	segp = inomap_addr2seg( addrp );
-	i2gsegp = &inomap.i2gmap[inomap_addr2segix( addrp )];
+	segp = inomap_addr2seg(addrp);
+	i2gsegp = &inomap.i2gmap[inomap_addr2segix(addrp)];
 
 	relino = ino - segp->base;
-	if ( ! (i2gsegp->s_valid & ((uint64_t)1 << relino)) )
+	if (! (i2gsegp->s_valid & ((uint64_t)1 << relino)))
 		return 1;
 
 	*gen = i2gsegp->s_gen[relino];
@@ -1405,21 +1405,21 @@ inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen )
 }
 
 void
-inomap_writehdr( content_inode_hdr_t *scwhdrp )
+inomap_writehdr(content_inode_hdr_t *scwhdrp)
 {
 	/* update the inomap info in the content header
 	 */
 	scwhdrp->cih_inomap_hnkcnt = inomap.lastseg.hnkoff + 1;
-	scwhdrp->cih_inomap_segcnt = inomap_addr2segix( &inomap.lastseg ) + 1;
-	scwhdrp->cih_inomap_dircnt = ( uint64_t )cb_dircnt;
-	scwhdrp->cih_inomap_nondircnt = ( uint64_t )cb_nondircnt;
-	scwhdrp->cih_inomap_firstino = inomap.hnkmap[0].seg[ 0 ].base;
+	scwhdrp->cih_inomap_segcnt = inomap_addr2segix(&inomap.lastseg) + 1;
+	scwhdrp->cih_inomap_dircnt = (uint64_t)cb_dircnt;
+	scwhdrp->cih_inomap_nondircnt = (uint64_t)cb_nondircnt;
+	scwhdrp->cih_inomap_firstino = inomap.hnkmap[0].seg[0].base;
 	scwhdrp->cih_inomap_lastino = inomap.hnkmap[inomap.lastseg.hnkoff].maxino;
-	scwhdrp->cih_inomap_datasz = ( uint64_t )cb_datasz;
+	scwhdrp->cih_inomap_datasz = (uint64_t)cb_datasz;
 }
 
 rv_t
-inomap_dump( drive_t *drivep )
+inomap_dump(drive_t *drivep)
 {
 	seg_addr_t addr;
 	hnk_t *hnkp;
@@ -1427,22 +1427,22 @@ inomap_dump( drive_t *drivep )
 
 	/* use write_buf to dump the hunks
 	 */
-	for ( addr.hnkoff = 0 ;
+	for (addr.hnkoff = 0 ;
 	      addr.hnkoff <= inomap.lastseg.hnkoff ;
-	      addr.hnkoff++ ) {
+	      addr.hnkoff++) {
 		int rval;
 		rv_t rv;
 		drive_ops_t *dop = drivep->d_opsp;
 
-		hnkp = inomap_addr2hnk( &addr );
+		hnkp = inomap_addr2hnk(&addr);
 
 		xlate_hnk(hnkp, &tmphnkp, 1);
-		rval = write_buf( ( char * )&tmphnkp,
-				  sizeof( tmphnkp ),
-				  ( void * )drivep,
-				  ( gwbfp_t )dop->do_get_write_buf,
-				  ( wfp_t )dop->do_write );
-		switch ( rval ) {
+		rval = write_buf((char *)&tmphnkp,
+				  sizeof(tmphnkp),
+				  (void *)drivep,
+				  (gwbfp_t)dop->do_get_write_buf,
+				  (wfp_t)dop->do_write);
+		switch (rval) {
 		case 0:
 			rv = RV_OK;
 			break;
@@ -1461,7 +1461,7 @@ inomap_dump( drive_t *drivep )
 			rv = RV_CORE;
 			break;
 		}
-		if ( rv != RV_OK ) {
+		if (rv != RV_OK) {
 			return rv;
 		}
 	}
@@ -1470,38 +1470,38 @@ inomap_dump( drive_t *drivep )
 }
 
 static int
-subtreelist_parse( jdm_fshandle_t *fshandlep,
+subtreelist_parse(jdm_fshandle_t *fshandlep,
 		   int fsfd,
 		   xfs_bstat_t *rootstatp,
 		   char *subtreebuf[],
-		   ix_t subtreecnt )
+		   ix_t subtreecnt)
 {
 	ix_t subtreeix;
 
 	/* add the root ino to the dump
 	 */
-	cb_add( NULL, fshandlep, fsfd, rootstatp );
+	cb_add(NULL, fshandlep, fsfd, rootstatp);
 
 	/* do a recursive descent for each subtree specified
 	 */
-	for ( subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++ ) {
+	for (subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++) {
 		int cbrval = 0;
-		char *currentpath = subtreebuf[ subtreeix ];
-		assert( *currentpath != '/' );
-		( void )diriter( fshandlep,
+		char *currentpath = subtreebuf[subtreeix];
+		assert(*currentpath != '/');
+		(void)diriter(fshandlep,
 				 fsfd,
 				 rootstatp,
 				 subtreelist_parse_cb,
-				 ( void * )currentpath,
+				 (void *)currentpath,
 				 &cbrval,
 				 NULL,
-				 0 );
-		if ( cbrval != 1 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_INOMAP,
+				 0);
+		if (cbrval != 1) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_INOMAP,
 			      "%s: %s\n",
 			      cbrval == 0 ? _("subtree not present")
 					  : _("invalid subtree specified"),
-			      currentpath );
+			      currentpath);
 			return -1;
 		}
 	}
@@ -1510,30 +1510,30 @@ subtreelist_parse( jdm_fshandle_t *fshandlep,
 }
 
 static int
-subtreelist_parse_cb( void *arg1,
+subtreelist_parse_cb(void *arg1,
 		      jdm_fshandle_t *fshandlep,
 		      int fsfd,
 		      xfs_bstat_t *statp,
-		      char *name  )
+		      char *name)
 {
 	int cbrval = 0;
 
 	/* arg1 is used to carry the tail of the subtree path
 	 */
-	char *subpath = ( char * )arg1;
+	char *subpath = (char *)arg1;
 
 	/* temporarily terminate the subpath at the next slash
 	 */
-	char *nextslash = strchr( subpath, '/' );
-	if ( nextslash ) {
+	char *nextslash = strchr(subpath, '/');
+	if (nextslash) {
 		*nextslash = 0;
 	}
 
 	/* if the first element of the subpath doesn't match this
 	 * directory entry, try the next entry.
 	 */
-	if ( strcmp( subpath, name )) {
-		if ( nextslash ) {
+	if (strcmp(subpath, name)) {
+		if (nextslash) {
 			*nextslash = '/';
 		}
 		return 0;
@@ -1541,15 +1541,15 @@ subtreelist_parse_cb( void *arg1,
 
 	/* it matches, so add ino to list and continue down the path
 	 */
-	cb_add( NULL, fshandlep, fsfd, statp );
+	cb_add(NULL, fshandlep, fsfd, statp);
 
-	if ( nextslash ) {
+	if (nextslash) {
 
 		/* if we're not at the end of the path, yet the current
 		 * path element is not a directory, complain and abort the
 		 * iteration in a way which terminates the application
 		 */
-		if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
+		if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 			*nextslash = '/';
 			return 2;
 		}
@@ -1560,14 +1560,14 @@ subtreelist_parse_cb( void *arg1,
 
 		/* peel the first element of the subpath and recurse
 		*/
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 subtreelist_parse_cb,
-				 ( void * )( nextslash + 1 ),
+				 (void *)(nextslash + 1),
 				 &cbrval,
 				 NULL,
-				 0 );
+				 0);
 		return cbrval;
 
 	} else {
@@ -1576,43 +1576,43 @@ subtreelist_parse_cb( void *arg1,
 		 * to the inomap.
 		 */
 
-		if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
+		if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 			return 1;
 		}
 
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 subtree_descend_cb,
 				 NULL,
 				 &cbrval,
 				 0,
-				 0 );
+				 0);
 		return 1;
 	}
 }
 
 static int
-subtree_descend_cb( void *arg1,
+subtree_descend_cb(void *arg1,
 		    jdm_fshandle_t *fshandlep,
 		    int fsfd,
 		    xfs_bstat_t *statp,
-		    char *name  )
+		    char *name)
 {
 	int cbrval = 0;
 
-	cb_add( NULL, fshandlep, fsfd, statp );
+	cb_add(NULL, fshandlep, fsfd, statp);
 
-	if ( ( statp->bs_mode & S_IFMT ) == S_IFDIR ) {
+	if ((statp->bs_mode & S_IFMT) == S_IFDIR) {
 
-		( void )diriter( fshandlep,
+		(void)diriter(fshandlep,
 				 fsfd,
 				 statp,
 				 subtree_descend_cb,
 				 NULL,
 				 &cbrval,
 				 NULL,
-				 0 );
+				 0);
 	}
 
 	return cbrval;
@@ -1624,10 +1624,10 @@ subtree_descend_cb( void *arg1,
 #define BMAP_LEN	512
 
 static off64_t
-quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
+quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 {
 	int fd;
-	getbmapx_t bmap[ BMAP_LEN ];
+	getbmapx_t bmap[BMAP_LEN];
 	off64_t offset;
 	off64_t offset_next;
 	off64_t qty_accum;
@@ -1644,51 +1644,51 @@ quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
 	offset = 0;
 	offset_next = 0;
 	qty_accum = 0;
-	bmap[ 0 ].bmv_offset = 0;
-	bmap[ 0 ].bmv_length = -1;
-	bmap[ 0 ].bmv_count = BMAP_LEN;
-	bmap[ 0 ].bmv_iflags = BMV_IF_NO_DMAPI_READ;
-	bmap[ 0 ].bmv_entries = -1;
-	fd = jdm_open( fshandlep, statp, O_RDONLY );
-	if ( fd < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
+	bmap[0].bmv_offset = 0;
+	bmap[0].bmv_length = -1;
+	bmap[0].bmv_count = BMAP_LEN;
+	bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
+	bmap[0].bmv_entries = -1;
+	fd = jdm_open(fshandlep, statp, O_RDONLY);
+	if (fd < 0) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 		      "could not open ino %llu to read extent map: %s\n"),
 		      statp->bs_ino,
-		      strerror( errno ));
+		      strerror(errno));
 		return 0;
 	}
 
-	for ( ; ; ) {
+	for (; ;) {
 		int eix;
 		int rval;
 
-		rval = ioctl( fd, XFS_IOC_GETBMAPX, bmap );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
+		rval = ioctl(fd, XFS_IOC_GETBMAPX, bmap);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 			      "could not read extent map for ino %llu: %s\n"),
 			      statp->bs_ino,
-			      strerror( errno ));
-			( void )close( fd );
+			      strerror(errno));
+			(void)close(fd);
 			return 0;
 		}
 
-		if ( bmap[ 0 ].bmv_entries <= 0 ) {
-			assert( bmap[ 0 ].bmv_entries == 0 );
-			( void )close( fd );
+		if (bmap[0].bmv_entries <= 0) {
+			assert(bmap[0].bmv_entries == 0);
+			(void)close(fd);
 			return offset_next;
 		}
 
-		for ( eix = 1 ; eix <= bmap[ 0 ].bmv_entries ; eix++ ) {
-			getbmapx_t *bmapp = &bmap[ eix ];
+		for (eix = 1 ; eix <= bmap[0].bmv_entries ; eix++) {
+			getbmapx_t *bmapp = &bmap[eix];
 			off64_t qty_new;
-			if ( bmapp->bmv_block == -1 ) {
+			if (bmapp->bmv_block == -1) {
 				continue; /* hole */
 			}
 			offset = bmapp->bmv_offset * BBSIZE;
 			qty_new = qty_accum + bmapp->bmv_length * BBSIZE;
-			if ( qty_new >= qty ) {
-				( void )close( fd );
-				return offset + ( qty - qty_accum );
+			if (qty_new >= qty) {
+				(void)close(fd);
+				return offset + (qty - qty_accum);
 			}
 			offset_next = offset + bmapp->bmv_length * BBSIZE;
 			qty_accum = qty_new;
@@ -1699,9 +1699,9 @@ quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
 
 
 static off64_t
-estimate_dump_space( xfs_bstat_t *statp )
+estimate_dump_space(xfs_bstat_t *statp)
 {
-	switch ( statp->bs_mode & S_IFMT ) {
+	switch (statp->bs_mode & S_IFMT) {
 	case S_IFREG:
 		/* very rough: must improve this.  If GETOPT_DUMPASOFFLINE was
 		 * specified and the HSM provided an estimate, then use it.
@@ -1719,7 +1719,7 @@ estimate_dump_space( xfs_bstat_t *statp )
 			if (HsmEstimateFileSpace(hsm_fs_ctxtp, NULL, statp, &bytes, accurate))
 				return bytes;
 		}
-		return statp->bs_blocks * ( off64_t )statp->bs_blksize;
+		return statp->bs_blocks * (off64_t)statp->bs_blksize;
 	case S_IFIFO:
 	case S_IFCHR:
 	case S_IFDIR:
@@ -1734,11 +1734,11 @@ estimate_dump_space( xfs_bstat_t *statp )
 	*/
 		return 0;
 	default:
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 		      "unknown inode type: ino=%llu, mode=0x%04x 0%06o\n"),
 		      statp->bs_ino,
 		      statp->bs_mode,
-		      statp->bs_mode );
+		      statp->bs_mode);
 		return 0;
 	}
 }
diff --git a/dump/inomap.h b/dump/inomap.h
index fb9bbf7..64b769a 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -47,7 +47,7 @@ struct xfs_bstat;
  * fall at file boundaries. returns BOOL_FALSE if error encountered (should
  * abort the dump; else returns BOOL_TRUE.
  */
-extern bool_t inomap_build( void *fshandlep,
+extern bool_t inomap_build(void *fshandlep,
 			    int fsfd,
 			    struct xfs_bstat *rootstatp,
 			    bool_t last,
@@ -64,26 +64,26 @@ extern bool_t inomap_build( void *fshandlep,
 			    ix_t *statphasep,
 			    ix_t *statpassp,
 			    size64_t statcnt,
-			    size64_t *statdonep );
+			    size64_t *statdonep);
 
-extern uint64_t inomap_getsz( void );
+extern uint64_t inomap_getsz(void);
 
 /* inomap_skip - tell inomap about inodes to skip in the dump
  */
-extern void inomap_skip( xfs_ino_t ino );
+extern void inomap_skip(xfs_ino_t ino);
 
 
 /* inomap_writehdr - updates the write header with inomap-private info
  * to be communicated to the restore side
  */
-extern void inomap_writehdr( content_inode_hdr_t *scwhdrp );
+extern void inomap_writehdr(content_inode_hdr_t *scwhdrp);
 
 
 /* inomap_dump - dumps the map to media - content-abstraction-knowledgable
  *
  * returns error from media write op
  */
-extern rv_t inomap_dump( drive_t *drivep );
+extern rv_t inomap_dump(drive_t *drivep);
 
 
 /* map state values
@@ -111,16 +111,16 @@ struct seg {
 
 typedef struct seg seg_t;
 
-#define INOPERSEG	( sizeof( (( seg_t * )0 )->lobits ) * NBBY )
+#define INOPERSEG	(sizeof(((seg_t *)0)->lobits) * NBBY)
 
-#define HNKSZ		( 4 * PGSZ )
-#define SEGPERHNK	( ( HNKSZ / sizeof( seg_t )) - 1 )
+#define HNKSZ		(4 * PGSZ)
+#define SEGPERHNK	((HNKSZ / sizeof(seg_t)) - 1)
 
 struct hnk {
-	seg_t seg[ SEGPERHNK ];
+	seg_t seg[SEGPERHNK];
 	xfs_ino_t maxino;
 	struct hnk *nextp;		/* no longer used, kept for binary compat */
-	char pad[sizeof( seg_t ) - sizeof( xfs_ino_t ) - sizeof( struct hnk * )];
+	char pad[sizeof(seg_t) - sizeof(xfs_ino_t) - sizeof(struct hnk *)];
 };
 
 typedef struct hnk hnk_t;
@@ -129,11 +129,11 @@ typedef struct hnk hnk_t;
  * requires a pointer to a context block, obtained from
  * inomap_alloc_context(), and released by inomap_free_context().
  */
-extern void *inomap_alloc_context( void );
-extern void inomap_reset_context( void *contextp );
-extern void inomap_free_context( void *contextp );
-extern int inomap_get_state( void *contextp, xfs_ino_t ino );
-extern int inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen );
+extern void *inomap_alloc_context(void);
+extern void inomap_reset_context(void *contextp);
+extern void inomap_free_context(void *contextp);
+extern int inomap_get_state(void *contextp, xfs_ino_t ino);
+extern int inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen);
 
 
 /* generators returning the next dir or non-dir ino selected in this dump.
diff --git a/dump/var.c b/dump/var.c
index 6e3ead0..c9f251a 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -34,137 +34,137 @@
 #include "global.h"
 #include "inventory.h"
 
-static void var_skip_recurse( char *, void ( * )( xfs_ino_t ));
-static int  var_create_component( char * );
+static void var_skip_recurse(char *, void (*)(xfs_ino_t));
+static int  var_create_component(char *);
 
 void
-var_create( void )
+var_create(void)
 {
 	char path[PATH_MAX];
 	char *p;
 
-	p = strcpy( path, XFSDUMP_DIRPATH );
-	mlog( MLOG_DEBUG, "creating directory %s\n", path );
+	p = strcpy(path, XFSDUMP_DIRPATH);
+	mlog(MLOG_DEBUG, "creating directory %s\n", path);
 
 	do {
 		p++;
-		if ( *p == '/' ) {
+		if (*p == '/') {
 			*p = '\0';
-			if ( ! var_create_component( path ) )
+			if (! var_create_component(path) )
 				return;
 			*p = '/';
 		}
-	} while ( *p );
+	} while (*p);
 
-	( void ) var_create_component( path );
+	(void) var_create_component(path);
 }
 
 static int
-var_create_component( char *path )
+var_create_component(char *path)
 {
-	int rval = mkdir( path, 0755 );
+	int rval = mkdir(path, 0755);
 
-	if ( rval && errno != EEXIST ) {
-		mlog( MLOG_NORMAL, _("unable to create %s: %s\n"),
-		      path, strerror( errno ));
+	if (rval && errno != EEXIST) {
+		mlog(MLOG_NORMAL, _("unable to create %s: %s\n"),
+		      path, strerror(errno));
 		return 0;
 	}
-	if ( rval == 0 ) {
-		rval = chown( path, 0, 0 );
-		if ( rval ) {
-			mlog( MLOG_NORMAL, _("unable to chown %s: %s\n"),
-			      path, strerror( errno ));
+	if (rval == 0) {
+		rval = chown(path, 0, 0);
+		if (rval) {
+			mlog(MLOG_NORMAL, _("unable to chown %s: %s\n"),
+			      path, strerror(errno));
 		}
 	}
 	return 1;
 }
 
 void
-var_skip( uuid_t *dumped_fsidp, void ( *cb )( xfs_ino_t ino ))
+var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino))
 {
 	uuid_t fsid;
 	int rval;
 
 	/* see if the fs uuid's match
 	 */
-	rval = fs_getid( XFSDUMP_DIRPATH, &fsid );
-	if ( rval ) {
+	rval = fs_getid(XFSDUMP_DIRPATH, &fsid);
+	if (rval) {
 #ifdef HIDDEN
                 /* NOTE: this will happen for non-XFS file systems */
                 /*       and is expected, so no msg */
-		mlog( MLOG_NORMAL, _(
+		mlog(MLOG_NORMAL, _(
 		      "unable to determine uuid of fs containing %s: "
 		      "%s\n"),
 		      XFSDUMP_DIRPATH,
-		      strerror( errno ));
+		      strerror(errno));
 #endif
 		return;
 	}
 
-	if ( uuid_compare( *dumped_fsidp, fsid ) != 0) {
+	if (uuid_compare(*dumped_fsidp, fsid) != 0) {
 		return;
 	}
 
 	/* traverse the xfsdump directory, getting inode numbers of it
 	 * and all of its children, and reporting those to the callback.
 	 */
-	var_skip_recurse( XFSDUMP_DIRPATH, cb );
+	var_skip_recurse(XFSDUMP_DIRPATH, cb);
 }
 
 static void
-var_skip_recurse( char *base, void ( *cb )( xfs_ino_t ino ))
+var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 {
 	struct stat64 statbuf;
 	DIR *dirp;
 	struct dirent *direntp;
 	int rval;
 
-	rval = lstat64( base, &statbuf );
-	if ( rval ) {
-		mlog( MLOG_NORMAL, _(
+	rval = lstat64(base, &statbuf);
+	if (rval) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to get status of %s: %s\n"),
 		      base,
-		      strerror( errno ));
+		      strerror(errno));
 		return;
 	}
 
-	mlog( MLOG_DEBUG,
+	mlog(MLOG_DEBUG,
 	      "excluding %s from dump\n",
-	      base );
+	      base);
 
-	( * cb )( statbuf.st_ino );
+	(* cb)(statbuf.st_ino);
 
-	if ( ( statbuf.st_mode & S_IFMT ) != S_IFDIR ) {
+	if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
 		return;
 	}
 
-	dirp = opendir( base );
-	if ( ! dirp ) {
-		mlog( MLOG_NORMAL, _(
+	dirp = opendir(base);
+	if (! dirp) {
+		mlog(MLOG_NORMAL, _(
 		      "unable to open directory %s\n"),
-		      base );
+		      base);
 		return;
 	}
 
-	while ( ( direntp = readdir( dirp )) != NULL ) {
+	while ((direntp = readdir(dirp)) != NULL) {
 		char *path;
 
 		/* skip "." and ".."
 		 */
-		if ( *( direntp->d_name + 0 ) == '.'
+		if (*(direntp->d_name + 0) == '.'
 		     &&
-		     ( *( direntp->d_name + 1 ) == 0
+		     (*(direntp->d_name + 1) == 0
 		       ||
-		       ( *( direntp->d_name + 1 ) == '.'
+		       (*(direntp->d_name + 1) == '.'
 			 &&
-			 *( direntp->d_name + 2 ) == 0 ))) {
+			 *(direntp->d_name + 2) == 0))) {
 			continue;
 		}
 
-		path = open_pathalloc( base, direntp->d_name, 0 );
-		var_skip_recurse( path, cb );
-		free( ( void * )path );
+		path = open_pathalloc(base, direntp->d_name, 0);
+		var_skip_recurse(path, cb);
+		free((void *)path);
 	}
 
-	closedir( dirp );
+	closedir(dirp);
 }
diff --git a/dump/var.h b/dump/var.h
index 889a389..0a8f13d 100644
--- a/dump/var.h
+++ b/dump/var.h
@@ -21,8 +21,8 @@
 /* var.[ch] - abstraction dealing with /var/[lib/]xfsdump/
  */
 
-extern void var_create( void );
+extern void var_create(void);
 
-extern void var_skip( uuid_t *dumped_fsidp, void ( *cb )( xfs_ino_t ino ));
+extern void var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino));
 
 #endif /* VAR_H */
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 06/24] xfsdump: (4/4)(style) remove spaces from parentheses
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (2 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 04/24] xfsdump: (2/4)(style) remove spaces from parentheses Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 07/24] xfsdump: (style) remove a space in front of comma/semicolon Jan Tulak
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: 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)'

# regexps in order:
# - remove spaces after opening parentheses (
# - remove spaces before closing parentheses )
# - remove spaces after opening brackets [
# - remove spaces before closing brackets ]

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/(\s\+/(/g" \
    -e "s/\(\S\)\s\+)/\1)/g" \
    -e "s/\[\s\+/[/g" \
    -e "s/\(\S\)\s\+\]/\1]/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 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   | 276 ++++++++--------
 inventory/inv_mgr.c   | 332 +++++++++----------
 inventory/inv_oref.c  |  46 +--
 inventory/inv_oref.h  |   2 +-
 inventory/inv_priv.h  | 244 +++++++-------
 inventory/inv_stobj.c | 748 +++++++++++++++++++++---------------------
 inventory/inventory.h |  28 +-
 inventory/testmain.c  | 238 +++++++-------
 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 +-
 27 files changed, 1534 insertions(+), 1534 deletions(-)

diff --git a/include/swab.h b/include/swab.h
index 2684aa7..abfeeb6 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -7,25 +7,25 @@
 #define ___swab16(x) \
 ({ \
 	__u16 __x = (x); \
-	((__u16)( \
+	((__u16)(\
 		(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
-		(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
+		(((__u16)(__x) & (__u16)0xff00U) >> 8))); \
 })
 
 #define ___swab32(x) \
 ({ \
 	__u32 __x = (x); \
-	((__u32)( \
+	((__u32)(\
 		(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
 		(((__u32)(__x) & (__u32)0x0000ff00UL) <<  8) | \
 		(((__u32)(__x) & (__u32)0x00ff0000UL) >>  8) | \
-		(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
+		(((__u32)(__x) & (__u32)0xff000000UL) >> 24))); \
 })
 
 #define ___swab64(x) \
 ({ \
 	__u64 __x = (x); \
-	((__u64)( \
+	((__u64)(\
 		(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
 		(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
 		(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
@@ -33,21 +33,21 @@
 		(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >>  8) | \
 		(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
 		(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-		(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
+		(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56))); \
 })
 
 #define ___constant_swab16(x) \
-	((__u16)( \
+	((__u16)(\
 		(((__u16)(x) & (__u16)0x00ffU) << 8) | \
-		(((__u16)(x) & (__u16)0xff00U) >> 8) ))
+		(((__u16)(x) & (__u16)0xff00U) >> 8)))
 #define ___constant_swab32(x) \
-	((__u32)( \
+	((__u32)(\
 		(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
 		(((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
 		(((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
-		(((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+		(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
 #define ___constant_swab64(x) \
-	((__u64)( \
+	((__u64)(\
 		(__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
 		(__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
 		(__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
@@ -55,7 +55,7 @@
 		(__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) | \
 		(__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
 		(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-		(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+		(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
 
 /*
  * provide defaults when no architecture-specific optimization is detected
diff --git a/include/swap.h b/include/swap.h
index fa6aec6..ae575ee 100644
--- a/include/swap.h
+++ b/include/swap.h
@@ -51,11 +51,11 @@
 
 #define INT_SET(ref,arch,valueref) \
 	(__builtin_constant_p(valueref) ? \
-	(void)( (ref) = ( ((arch) != ARCH_NOCONVERT) ? \
-	  		   (INT_SWAP((ref),(valueref))) : (valueref)) ) : \
-	(void)( ((ref) = (valueref)), \
-			( ((arch) != ARCH_NOCONVERT) ? \
-			   (ref) = INT_SWAP((ref),(ref)) : 0 ) ))
+	(void)((ref) = (((arch) != ARCH_NOCONVERT) ? \
+	  		   (INT_SWAP((ref),(valueref))) : (valueref))) : \
+	(void)(((ref) = (valueref)), \
+			(((arch) != ARCH_NOCONVERT) ? \
+			   (ref) = INT_SWAP((ref),(ref)) : 0) ))
 
 #define INT_XLATE(buf,p,dir,arch) \
 	((dir > 0) ? ((p) = INT_GET((buf),(arch))) : INT_SET((buf),(arch),(p)))
diff --git a/inventory/getopt.h b/inventory/getopt.h
index 7bebc6d..4ae23e4 100644
--- a/inventory/getopt.h
+++ b/inventory/getopt.h
@@ -32,7 +32,7 @@
 #define	GETOPT_DUMPDEST		'f'	/* dump dest. file (drive.c) */
 #define	GETOPT_LEVEL		'l'	/* dump level (content_inode.c) */
 #define	GETOPT_SUBTREE		's'	/* subtree dump (content_inode.c) */
-#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4 ) */
+#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4) */
 #define	GETOPT_DUMPLABEL	'L'	/* dump session label (global.c) */
 #define	GETOPT_MEDIALABEL	'M'	/* media object label (content.c) */
 #define	GETOPT_RESUME		'R'	/* resume intr dump (content_inode.c) */
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index eee128e..6473811 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -47,7 +47,7 @@
 /*----------------------------------------------------------------------*/
 
 inv_idbtoken_t
-inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
+inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 {
 	int fd, stobjfd, num, retval;
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
@@ -55,17 +55,17 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 
 	int index = 0;
 
-	assert ( pred );
-	fd = retval = init_idb ( pred, bywhat, forwhat, &tok );
+	assert (pred);
+	fd = retval = init_idb (pred, bywhat, forwhat, &tok);
 
-	if ( retval == I_DONE )
+	if (retval == I_DONE)
 		return tok;
 
 	/* if we just want to search the db, all we need is the invidx.
 	   at this point, we know that a tok wasnt created in init_idb() */
-	if ( forwhat == INV_SEARCH_ONLY ) {
+	if (forwhat == INV_SEARCH_ONLY) {
 		/* fd == I_EMPTYINV or fd == valid fd */
-		tok = get_token( fd, -1);
+		tok = get_token(fd, -1);
 		tok->d_oflag = forwhat;
 		return tok;
 	}
@@ -73,51 +73,51 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 	/* XXX also, see if it is too full. if so, make another and leave a
 	   reference to the new file in the old one */
 
-	stobjfd = idx_get_stobj( fd, forwhat, &index );
-	if ( stobjfd < 0 ) {
-		close( fd );
+	stobjfd = idx_get_stobj(fd, forwhat, &index);
+	if (stobjfd < 0) {
+		close(fd);
 		return INV_TOKEN_NULL;
 	}
 
-	assert ( index > 0 );
+	assert (index > 0);
 
 	/* Now we need to make sure that this has enough space */
-	INVLOCK( stobjfd, LOCK_SH );
+	INVLOCK(stobjfd, LOCK_SH);
 
-	num = GET_SESCOUNTERS( stobjfd, &sescnt );
-	if ( num < 0 ) {
-		close( fd );
-		INVLOCK( stobjfd, LOCK_UN );
-		close( stobjfd );
+	num = GET_SESCOUNTERS(stobjfd, &sescnt);
+	if (num < 0) {
+		close(fd);
+		INVLOCK(stobjfd, LOCK_UN);
+		close(stobjfd);
 		return INV_TOKEN_NULL;
 	}
 
-	/* create another storage object ( and, an inv_index entry for it
-	   too ) if we've filled this one up */
+	/* create another storage object (and, an inv_index entry for it
+	   too) if we've filled this one up */
 
-	if ( (uint) num >= sescnt->ic_maxnum ) {
-		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
-		      "index entry. \n" );
-		INVLOCK( stobjfd, LOCK_UN );
+	if ((uint) num >= sescnt->ic_maxnum) {
+		mlog(MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
+		      "index entry. \n");
+		INVLOCK(stobjfd, LOCK_UN);
 		close (stobjfd);
 
-		INVLOCK( fd, LOCK_EX );
-		stobjfd = idx_create_entry( &tok, fd, BOOL_FALSE );
-		INVLOCK( fd, LOCK_UN );
+		INVLOCK(fd, LOCK_EX);
+		stobjfd = idx_create_entry(&tok, fd, BOOL_FALSE);
+		INVLOCK(fd, LOCK_UN);
 
-		free ( sescnt );
-		if ( stobjfd < 0 ) {
-			close( fd );
+		free (sescnt);
+		if (stobjfd < 0) {
+			close(fd);
 			return INV_TOKEN_NULL;
 		}
 		return tok;
 	}
 
-	INVLOCK( stobjfd, LOCK_UN );
+	INVLOCK(stobjfd, LOCK_UN);
 
-	free ( sescnt );
-	tok = get_token( fd, stobjfd );
-	tok->d_invindex_off = IDX_HDR_OFFSET( index - 1 );
+	free (sescnt);
+	tok = get_token(fd, stobjfd);
+	tok->d_invindex_off = IDX_HDR_OFFSET(index - 1);
 	tok->d_oflag = forwhat;
 	return tok;
 
@@ -134,12 +134,12 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 
 
 bool_t
-inv_close( inv_idbtoken_t tok )
+inv_close(inv_idbtoken_t tok)
 {
-	close ( tok->d_invindex_fd );
-	if ( tok->d_stobj_fd >= 0 )
-		close ( tok->d_stobj_fd );
-	destroy_token( tok );
+	close (tok->d_invindex_fd);
+	if (tok->d_stobj_fd >= 0)
+		close (tok->d_stobj_fd);
+	destroy_token(tok);
 	return BOOL_TRUE;
 }
 
@@ -167,7 +167,7 @@ inv_writesession_open(
 	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
-	char		*devpath )
+	char		*devpath)
 {
 	invt_session_t  ses;
 	int		fd;
@@ -177,17 +177,17 @@ inv_writesession_open(
 	inv_sestoken_t	sestok;
 	inv_oflag_t     forwhat;
 
-	assert ( tok != INV_TOKEN_NULL );
-	assert ( sesid && fsid && mntpt && devpath );
+	assert (tok != INV_TOKEN_NULL);
+	assert (sesid && fsid && mntpt && devpath);
 	forwhat = tok->d_oflag;
 	fd = tok->d_stobj_fd;
-	assert ( forwhat != INV_SEARCH_ONLY );
-	assert ( fd > 0 );
+	assert (forwhat != INV_SEARCH_ONLY);
+	assert (fd > 0);
 
-	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
-		if ( fstab_put_entry( fsid, mntpt, devpath, forwhat ) < 0 ) {
-		       mlog( MLOG_NORMAL | MLOG_INV, _(
-				"INV: put_fstab_entry failed.\n") );
+	if (! (tok->d_update_flag & FSTAB_UPDATED) ) {
+		if (fstab_put_entry(fsid, mntpt, devpath, forwhat) < 0) {
+		       mlog(MLOG_NORMAL | MLOG_INV, _(
+				"INV: put_fstab_entry failed.\n"));
 		       return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag |= FSTAB_UPDATED;
@@ -195,12 +195,12 @@ inv_writesession_open(
 
 
 	/* copy the session information to store */
-	memset( (void *)&ses, 0, sizeof( ses ) );	/* paranoia */
-	memcpy( &ses.s_sesid, sesid, sizeof( uuid_t ) );
-	memcpy( &ses.s_fsid, fsid, sizeof( uuid_t ) );
-	strcpy( ses.s_label, label );
-	strcpy( ses.s_mountpt, mntpt );
-	strcpy( ses.s_devpath, devpath );
+	memset((void *)&ses, 0, sizeof(ses) );	/* paranoia */
+	memcpy(&ses.s_sesid, sesid, sizeof(uuid_t) );
+	memcpy(&ses.s_fsid, fsid, sizeof(uuid_t) );
+	strcpy(ses.s_label, label);
+	strcpy(ses.s_mountpt, mntpt);
+	strcpy(ses.s_devpath, devpath);
 	ses.s_max_nstreams = nstreams;
 
         hdr.sh_pruned = 0; /* session is not pruned by invutil */
@@ -210,41 +210,41 @@ inv_writesession_open(
 	hdr.sh_flag |= (isresumed) ? INVT_RESUMED : 0;
 	/* sh_streams_off and sh_sess_off will be set in create_session() */
 
-	sestok = get_sesstoken( tok );
+	sestok = get_sesstoken(tok);
 
 	/* we need to put the new session in the appropriate place in
 	   storage object. So first find out howmany sessions are there */
 
-	INVLOCK( fd, LOCK_EX );
-	if ( GET_SESCOUNTERS( fd, &sescnt) < 0 ) {
-		free ( sestok );
-		INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_EX);
+	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
+		free (sestok);
+		INVLOCK(fd, LOCK_UN);
 		return INV_TOKEN_NULL;
 	}
 
 	/* create the writesession, and get ready for the streams to come
 	   afterwards */
-	rval = stobj_create_session( sestok, fd, sescnt, &ses, &hdr );
+	rval = stobj_create_session(sestok, fd, sescnt, &ses, &hdr);
 	assert (rval > 0);
 
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
 	sestok->sd_sesstime = time;
 
-	if ( tok->d_update_flag & NEW_INVINDEX ) {
-		if ( idx_put_sesstime( sestok, INVT_STARTTIME ) < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
-				"INV: put_starttime failed.\n") );
+	if (tok->d_update_flag & NEW_INVINDEX) {
+		if (idx_put_sesstime(sestok, INVT_STARTTIME) < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
+				"INV: put_starttime failed.\n"));
 			return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag &= ~(NEW_INVINDEX);
 	}
 
-	free ( sescnt );
+	free (sescnt);
 
 
-	return ( rval < 0 )? INV_TOKEN_NULL: sestok;
+	return (rval < 0)? INV_TOKEN_NULL: sestok;
 }
 
 
@@ -259,19 +259,19 @@ inv_writesession_open(
 
 
 bool_t
-inv_writesession_close( inv_sestoken_t tok )
+inv_writesession_close(inv_sestoken_t tok)
 {
 	int		rval;
 
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
 	/* now update end_time in the inv index header */
-	rval = idx_put_sesstime( tok, INVT_ENDTIME );
+	rval = idx_put_sesstime(tok, INVT_ENDTIME);
 
-	memset( tok, 0, sizeof( invt_sesdesc_entry_t ) );
-	free ( tok );
+	memset(tok, 0, sizeof(invt_sesdesc_entry_t) );
+	free (tok);
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -285,7 +285,7 @@ inv_writesession_close( inv_sestoken_t tok )
 inv_stmtoken_t
 inv_stream_open(
 	inv_sestoken_t tok,
-	char		*cmdarg )
+	char		*cmdarg)
 {
 	inv_stmtoken_t stok;
 	invt_stream_t  stream;
@@ -294,21 +294,21 @@ inv_stream_open(
 	int fd;
 	bool_t err = BOOL_FALSE;
 
-	assert ( tok != INV_TOKEN_NULL );
+	assert (tok != INV_TOKEN_NULL);
 
 	/* this memset is needed as a dump interrupted/crashed very soon
 	 * after starting results in an inventory with exteremely large
 	 * starting/ending inodes or offsets. This can be misleading.
 	 * See bug #463702 for an example.
 	 */
-	memset( (void *)&stream, 0 , sizeof(invt_stream_t) );
+	memset((void *)&stream, 0 , sizeof(invt_stream_t));
 
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_TRUE; /* fix for 353197 */
-	strcpy( stream.st_cmdarg, cmdarg );
+	strcpy(stream.st_cmdarg, cmdarg);
 
 	/* XXX yukk... make the token descriptors not pointers */
-	stok = ( inv_stmtoken_t ) malloc( sizeof( invt_strdesc_entry_t ) );
+	stok = (inv_stmtoken_t) malloc(sizeof(invt_strdesc_entry_t) );
 
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
@@ -316,46 +316,46 @@ inv_stream_open(
 	/* get the session to find out where the stream is going to go */
 	fd = tok->sd_invtok->d_stobj_fd;
 
-	INVLOCK( fd, LOCK_EX );
+	INVLOCK(fd, LOCK_EX);
 
 	/* get the session header and the session */
-	if ( stobj_get_sessinfo( tok, &seshdr, &ses ) <= 0 )
+	if (stobj_get_sessinfo(tok, &seshdr, &ses) <= 0)
 		err = BOOL_TRUE;
 
-	if ( ( ! err )  && ses.s_cur_nstreams < ses.s_max_nstreams ) {
+	if ((! err)  && ses.s_cur_nstreams < ses.s_max_nstreams) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof( invt_stream_t ) *
-					         ses.s_cur_nstreams )
+		stok->md_stream_off = (off64_t) (sizeof(invt_stream_t) *
+					         ses.s_cur_nstreams)
 			                         + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
 
 		/* write it back. */
-		if ( PUT_REC_NOLOCK( fd, &ses, sizeof( ses ),
-				     tok->sd_session_off ) < 0 )
+		if (PUT_REC_NOLOCK(fd, &ses, sizeof(ses),
+				     tok->sd_session_off) < 0)
 			err = BOOL_TRUE;
-	} else if ( ! err ) {
-		mlog ( MLOG_NORMAL, _(
+	} else if (! err) {
+		mlog (MLOG_NORMAL, _(
 		       "INV: cant create more than %d streams."
-		       " Max'd out..\n"), ses.s_cur_nstreams );
+		       " Max'd out..\n"), ses.s_cur_nstreams);
 		err = BOOL_TRUE;
 	}
 
-	if ( ! err ) {
+	if (! err) {
 		stream.st_firstmfile = stream.st_lastmfile =
 			               stok->md_stream_off;
 
 		/* now write the stream header on to the disk */
-		if ( PUT_REC_NOLOCK( fd, &stream, sizeof( invt_stream_t ),
-				    stok->md_stream_off ) > 0 ) {
+		if (PUT_REC_NOLOCK(fd, &stream, sizeof(invt_stream_t),
+				    stok->md_stream_off) > 0) {
 			/* we're all set */
-			INVLOCK( fd, LOCK_UN );
+			INVLOCK(fd, LOCK_UN);
 			return stok;
 		}
 	}
 
 	/* error occured somewhere */
-	free ( stok );
-	INVLOCK( fd, LOCK_UN );
+	free (stok);
+	INVLOCK(fd, LOCK_UN);
 	return INV_TOKEN_NULL;
 
 }
@@ -372,36 +372,36 @@ inv_stream_open(
 bool_t
 inv_stream_close(
 		inv_stmtoken_t	tok,
-		bool_t wasinterrupted )
+		bool_t wasinterrupted)
 {
 	invt_stream_t strm;
 	int fd = tok->md_sesstok->sd_invtok->d_stobj_fd;
 	int rval;
 	bool_t dowrite = BOOL_FALSE;
 
-	rval = idx_put_sesstime( tok->md_sesstok, INVT_ENDTIME );
+	rval = idx_put_sesstime(tok->md_sesstok, INVT_ENDTIME);
 	if (rval < 0)
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		      "INV: idx_put_sesstime failed in "
-		      "inv_stream_close() \n") );
-	INVLOCK( fd, LOCK_EX );
-	if ((rval = GET_REC_NOLOCK( fd, &strm, sizeof( invt_stream_t ),
-			       tok->md_stream_off )) > 0 ) {
+		      "inv_stream_close() \n"));
+	INVLOCK(fd, LOCK_EX);
+	if ((rval = GET_REC_NOLOCK(fd, &strm, sizeof(invt_stream_t),
+			       tok->md_stream_off)) > 0) {
 
-		if ( strm.st_interrupted != wasinterrupted ) {
+		if (strm.st_interrupted != wasinterrupted) {
 			strm.st_interrupted = wasinterrupted;
 			dowrite = BOOL_TRUE;
 		}
 
 		/* get the last media file to figure out what our last
 		   ino was. we have a pointer to that in the stream token */
-		if ( tok->md_lastmfile ){
-			if ( strm.st_endino.ino !=
+		if (tok->md_lastmfile){
+			if (strm.st_endino.ino !=
 			      tok->md_lastmfile->mf_endino.ino ||
 			     strm.st_endino.offset !=
 			      tok->md_lastmfile->mf_endino.offset) {
 
-			      mlog( MLOG_DEBUG | MLOG_INV, "INV: stream_close() "
+			      mlog(MLOG_DEBUG | MLOG_INV, "INV: stream_close() "
 				    " - endinos dont match ! \n");
 			      dowrite = BOOL_TRUE;
 			      strm.st_endino = tok->md_lastmfile->mf_endino;
@@ -414,15 +414,15 @@ inv_stream_close(
 		}
 	}
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
-	if ( tok->md_lastmfile ) {
-		free ( tok->md_lastmfile );
+	if (tok->md_lastmfile) {
+		free (tok->md_lastmfile);
 	}
-	memset( tok, 0, sizeof( invt_strdesc_entry_t ) );
-	free ( tok );
+	memset(tok, 0, sizeof(invt_strdesc_entry_t) );
+	free (tok);
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 }
 
 
@@ -452,15 +452,15 @@ inv_put_mediafile(
 	int 		 rval;
 
 
-	assert ( tok != INV_TOKEN_NULL );
-	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
-	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
+	assert (tok != INV_TOKEN_NULL);
+	assert (tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
+	assert (tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
 
-	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
+	mf = (invt_mediafile_t *) calloc(1, sizeof(invt_mediafile_t) );
 
 	/* copy the media file information */
-	memcpy( &mf->mf_moid, moid, sizeof( uuid_t ) );
-	strcpy( mf->mf_label, label );
+	memcpy(&mf->mf_moid, moid, sizeof(uuid_t) );
+	strcpy(mf->mf_label, label);
 	mf->mf_mfileidx = mfileindex;
 	mf->mf_startino.ino = startino;
 	mf->mf_startino.offset = startino_offset;
@@ -468,25 +468,25 @@ inv_put_mediafile(
 	mf->mf_endino.offset = endino_offset;
 	mf->mf_size = size;
 	mf->mf_flag = 0;
-	if ( isgood )
+	if (isgood)
 		mf->mf_flag |= INVT_MFILE_GOOD;
 
 	/* This flag is used to indicate the media file that contains the
 	   dump of the sessioninfo structure that contains all but this
 	   media file */
-	if ( isinvdump )
+	if (isinvdump)
 		mf->mf_flag |= INVT_MFILE_INVDUMP;
 
-	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX );
-	rval = stobj_put_mediafile( tok, mf );
-	INVLOCK( tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN );
+	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_EX);
+	rval = stobj_put_mediafile(tok, mf);
+	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN);
 
 	/* we dont free the mfile here. we always keep the last mfile
 	   around, inside the inv_stmtoken, and when we add a new mfile,
 	   we free the previous one. The last one is freed in stream_close()
 	   */
 
-	return ( rval < 0 ) ? BOOL_FALSE: BOOL_TRUE;
+	return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 
 }
 
@@ -510,7 +510,7 @@ bool_t
 inv_get_sessioninfo(
 	inv_sestoken_t		tok,
 	void		      **bufpp,	/* buf to fill */
-	size_t		       *bufszp )/* size of that buffer */
+	size_t		       *bufszp)/* size of that buffer */
 {
 	invt_session_t 	ses;
 	invt_seshdr_t	hdr;
@@ -518,23 +518,23 @@ inv_get_sessioninfo(
 	int		fd;
 
 
-	assert( tok != INV_TOKEN_NULL );
-	assert( tok->sd_invtok );
+	assert(tok != INV_TOKEN_NULL);
+	assert(tok->sd_invtok);
 	*bufpp = NULL;
 	*bufszp = 0;
 	fd = tok->sd_invtok->d_stobj_fd;
 
-	INVLOCK( fd, LOCK_SH );
+	INVLOCK(fd, LOCK_SH);
 
 	/* Next we get the session header, and the session information. Then
 	   we can figure out how much space to allocate */
-	if ( stobj_get_sessinfo( tok, &hdr, &ses ) <= 0 ) {
-		INVLOCK( fd, LOCK_UN );
+	if (stobj_get_sessinfo(tok, &hdr, &ses) <= 0) {
+		INVLOCK(fd, LOCK_UN);
 		return BOOL_FALSE;
 	}
 
-	rval = stobj_pack_sessinfo( fd, &ses, &hdr, bufpp, bufszp );
-	INVLOCK( fd, LOCK_UN );
+	rval = stobj_pack_sessinfo(fd, &ses, &hdr, bufpp, bufszp);
+	INVLOCK(fd, LOCK_UN);
 
 
 	return rval;
@@ -555,18 +555,18 @@ inv_get_sessioninfo(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_put_sessioninfo( invt_sessinfo_t *s )
+inv_put_sessioninfo(invt_sessinfo_t *s)
 {
 	static bool_t invdir_ok = BOOL_FALSE;
 
-	if ( !invdir_ok ) {
-		if ( make_invdirectory( INV_SEARCH_N_MOD ) < 0 )
+	if (!invdir_ok) {
+		if (make_invdirectory(INV_SEARCH_N_MOD) < 0)
 			return BOOL_FALSE;
 		else
 			invdir_ok = BOOL_TRUE;
 	}
 
-      	return insert_session( s );
+      	return insert_session(s);
 
 }
 
@@ -588,7 +588,7 @@ inv_free_session(
 	assert(ses);
 	assert(*ses);
 
-	for ( i = 0; i < (*ses)->s_nstreams; i++ ) {
+	for (i = 0; i < (*ses)->s_nstreams; i++) {
 		/* the array of mediafiles is contiguous */
 		free ((*ses)->s_streams[i].st_mediafiles);
 	}
@@ -619,12 +619,12 @@ inv_lasttime_level_lessthan(
 	time32_t	**tm)
 {
 	int 	rval;
-	if ( tok != INV_TOKEN_NULL ) {
+	if (tok != INV_TOKEN_NULL) {
 		rval =  search_invt(fsidp, tok->d_invindex_fd, &level,
 				    (void **)tm,
 				    (search_callback_t)tm_level_lessthan);
 
-		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+		return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
 
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid ptr */
@@ -652,12 +652,12 @@ inv_lastsession_level_lessthan(
 	inv_session_t	**ses)
 {
 	int 	rval;
-	if ( tok != INV_TOKEN_NULL ) {
+	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)ses,
 				   (search_callback_t)lastsess_level_lessthan);
 
-		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+		return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
 
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid */
@@ -684,15 +684,15 @@ inv_lastsession_level_equalto(
 	uuid_t		*fsidp,
 	inv_idbtoken_t	tok,
 	u_char		level,
-	inv_session_t	**ses )
+	inv_session_t	**ses)
 {
 	int 	rval;
-	if ( tok != INV_TOKEN_NULL ) {
+	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)ses,
 				   (search_callback_t)lastsess_level_equalto);
 
-		return ( rval < 0) ? BOOL_FALSE: BOOL_TRUE;
+		return (rval < 0) ? BOOL_FALSE: BOOL_TRUE;
 	}
 
 	return invmgr_query_all_sessions(fsidp,		 /* fs uuid */
@@ -758,7 +758,7 @@ inv_get_session_bylabel(
 /*----------------------------------------------------------------------*/
 
 bool_t
-inv_delete_mediaobj( uuid_t *moid )
+inv_delete_mediaobj(uuid_t *moid)
 {
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 
@@ -771,8 +771,8 @@ inv_delete_mediaobj( uuid_t *moid )
 		         forall mediafiles (m) in strm {
 			     if (m.mediaobj == moid) {
 			     // delete m
-			     if ( --strm.nmediafiles == 0 )
-			        if ( --s.nstreams == 0 )
+			     if (--strm.nmediafiles == 0)
+			        if (--s.nstreams == 0)
 			            delete-session (s)
 			     }
 			 }
@@ -786,40 +786,40 @@ inv_delete_mediaobj( uuid_t *moid )
 	int numfs, i, fd, invfd;
 	char fname[INV_STRLEN];
 
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-	if ( fd < 0 || numfs <= 0 ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n") );
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+	if (fd < 0 || numfs <= 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n"));
 		return BOOL_FALSE;
 	}
 
-	close( fd );
+	close(fd);
 
-	for ( i = 0; i < numfs; i++) {
-		if ( fstab_get_fname( &arr[i].ft_uuid,
+	for (i = 0; i < numfs; i++) {
+		if (fstab_get_fname(&arr[i].ft_uuid,
 				      fname,
 				      (inv_predicate_t)INV_BY_UUID,
 				      forwhat
 				     )
-		     < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
-			      "INV: Cant get inv-name for uuid\n") );
+		     < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
+			      "INV: Cant get inv-name for uuid\n"));
 			return BOOL_FALSE;
 		}
-		strcat( fname, INV_INVINDEX_PREFIX );
-		invfd = open( fname, INV_OFLAG(forwhat));
-		if ( invfd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+		strcat(fname, INV_INVINDEX_PREFIX);
+		invfd = open(fname, INV_OFLAG(forwhat));
+		if (invfd < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Open failed on %s\n"),
-			     fname );
+			     fname);
 			return BOOL_FALSE;
 		}
 
 		if (search_invt(&arr[i].ft_uuid, invfd, NULL, (void **)&moid,
 				(search_callback_t)stobj_delete_mobj)
-		    < 0 )
+		    < 0)
 			return BOOL_FALSE;
 		/* we have to delete the session, etc */
-		close( invfd );
+		close(invfd);
 	}
 
 	return BOOL_TRUE;
@@ -899,8 +899,8 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		rptr = wptr + 1;
 		while (*wptr != '\0')
 			*wptr++ = *rptr++;
-		while ( ( c = getopt( argc, argv, invoptstring)) != EOF ) {
-			switch ( c ) {
+		while ((c = getopt(argc, argv, invoptstring)) != EOF) {
+			switch (c) {
 			case GETOPT_INVPRINT:
 				prctx->depth = 0;
 				rval |= I_IFOUND ;
@@ -912,8 +912,8 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		optarg = NULL;
 	}
 
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_INVPRINT:
 			rval |= I_IFOUND ;
 			if ((options = optarg) == NULL)
@@ -924,7 +924,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 				if (value == NULL && d != OPT_FSTAB &&
 				     d != OPT_INVIDX && d != OPT_INVCHECK)
 					continue;
-				switch( d ) {
+				switch(d) {
 					/* process mntpt option */
 				      case OPT_MNT:
 					bywhat = (inv_predicate_t) INV_BY_MOUNTPT;
@@ -950,14 +950,14 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 				      case OPT_DEPTH:
 					prctx->depth = atoi(value);
 					if (prctx->depth < 0 ||
-					    prctx->depth > 4 )
+					    prctx->depth > 4)
 						prctx->depth = 0;
 					break;
 
 				      case OPT_MOBJID:
 					{
 					uuid_t *u;
-					u = malloc ( sizeof( uuid_t ) );
+					u = malloc (sizeof(uuid_t) );
 					uuid_parse(value, *u);
 					prctx->mobj.type = INVT_MOID;
 					prctx->mobj.value = (void *)u;
@@ -988,13 +988,13 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 					break;
 
 				      default:
-					if ( strlen(value) == 1 &&
-					     atoi(value) < PR_MAXDEPTH )
+					if (strlen(value) == 1 &&
+					     atoi(value) < PR_MAXDEPTH)
 						prctx->depth = atoi(value);
 					else {
-						mlog( MLOG_NORMAL | MLOG_INV, _(
+						mlog(MLOG_NORMAL | MLOG_INV, _(
 					       "INV: invalid sub-option %s"
-					       " for -I option\n"), value );
+					       " for -I option\n"), value);
 						rval |= I_IERR;
 					}
 					break;
@@ -1006,18 +1006,18 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 	}
 
 	if (npreds > 1) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		     "INV: Only one of mnt=,dev= and fsid=value can be used.\n")
 		     );
 		rval |= I_IERR;
 	}
 	else if (npreds2 > 1) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		     "INV: Only one of mobjid= and mobjlabel= can be used.\n")
 		     );
 		rval |= I_IERR;
 	}
-	else if ( (rval & I_IFOUND) && !(rval & I_IERR) && fs
+	else if ((rval & I_IFOUND) && !(rval & I_IERR) && fs
 		 && ! prctx->fstab && ! prctx->invcheck) {
 		inv_idbtoken_t tok;
 
@@ -1032,33 +1032,33 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 			invt_counter_t *cnt = NULL;
 			inv_oflag_t forwhat = INV_SEARCH_ONLY;
 
-			fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-			free( cnt );
+			fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+			free(cnt);
 
 			rval |= I_IERR; /* Cleared if successful */
 
-			if ( fd >= 0 ) {
-				for ( i = 0; i < numfs; i++ ) {
+			if (fd >= 0) {
+				for (i = 0; i < numfs; i++) {
 					tok = inv_open(
-						(inv_predicate_t )INV_BY_UUID,
+						(inv_predicate_t)INV_BY_UUID,
 						INV_SEARCH_ONLY,
-						&arr[i].ft_uuid );
-					if ( tok == INV_TOKEN_NULL )
+						&arr[i].ft_uuid);
+					if (tok == INV_TOKEN_NULL)
 						break;
-					if ( STREQL( arr[i].ft_mountpt, fs) ) {
+					if (STREQL(arr[i].ft_mountpt, fs)) {
 						prctx->index = i;
 						invmgr_inv_print(
 						          tok->d_invindex_fd,
-							  prctx );
+							  prctx);
 						rval &= ~(I_IERR);
 					}
-					inv_close( tok );
+					inv_close(tok);
 				}
-				free ( arr );
+				free (arr);
 				rval |= I_IDONE;
 			}
-			if ( (rval&I_IERR) ) {
-				mlog( MLOG_NORMAL | MLOG_INV, _(
+			if ((rval&I_IERR)) {
+				mlog(MLOG_NORMAL | MLOG_INV, _(
 				    "INV: open failed on mount point \"%s\"\n"),
 				     fs);
 			}
@@ -1066,14 +1066,14 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		}
 
 		/* We have to print only one file system to print by UUID */
-		tok = inv_open( bywhat, INV_SEARCH_ONLY, fs);
-		if ( tok != INV_TOKEN_NULL ) {
+		tok = inv_open(bywhat, INV_SEARCH_ONLY, fs);
+		if (tok != INV_TOKEN_NULL) {
 			prctx->index = 0;
 			invmgr_inv_print(tok->d_invindex_fd, prctx);
-			inv_close( tok );
+			inv_close(tok);
 			rval |= I_IDONE;
 		} else {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: open failed on file system id \"%s\"\n"),
 			     fs);
 			rval |= I_IERR;
@@ -1085,7 +1085,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 
 /* This prints out all the sessions of a filesystem that are in the inventory */
 bool_t
-inv_DEBUG_print( int argc, char **argv )
+inv_DEBUG_print(int argc, char **argv)
 {
 	invt_counter_t *cnt = NULL;
 	invt_fstab_t *arr = NULL;
@@ -1099,37 +1099,37 @@ inv_DEBUG_print( int argc, char **argv )
 	prctx.level = PR_MAXLEVEL;
 
 	/* If user didnt indicate -i option, we can't do anything */
-	rval = inv_getopt( argc, argv, &prctx );
+	rval = inv_getopt(argc, argv, &prctx);
 
 	if (!prctx.invcheck && ! prctx.fstab) {
 		if (! (rval & I_IFOUND)) {
 			return BOOL_TRUE;
-		} else if ( rval & I_IERR || rval & I_IDONE ) {
+		} else if (rval & I_IERR || rval & I_IDONE) {
 			return BOOL_FALSE;
 		}
 	}
 
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-	free( cnt );
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+	free(cnt);
 
-	if ( fd >= 0 ) {
+	if (fd >= 0) {
 		 if (prctx.fstab) {
-			 fstab_DEBUG_print( arr, numfs );
+			 fstab_DEBUG_print(arr, numfs);
 			 if (! prctx.invidx)
 				 return BOOL_FALSE;
 		 }
 
-		for ( i = 0; i < numfs; i++ ) {
-			tok = inv_open( ( inv_predicate_t )INV_BY_UUID,
+		for (i = 0; i < numfs; i++) {
+			tok = inv_open((inv_predicate_t)INV_BY_UUID,
 					forwhat,
-				        &arr[i].ft_uuid );
-			if ( tok == INV_TOKEN_NULL ) {
-				free ( arr );
+				        &arr[i].ft_uuid);
+			if (tok == INV_TOKEN_NULL) {
+				free (arr);
 				return BOOL_FALSE;
 			}
 
 			if (prctx.invcheck) {
-				mlog( MLOG_VERBOSE | MLOG_INV, _(
+				mlog(MLOG_VERBOSE | MLOG_INV, _(
 				     "INV: checking fs \"%s\"\n"),
 				     &arr[i].ft_mountpt
 				     );
@@ -1137,10 +1137,10 @@ inv_DEBUG_print( int argc, char **argv )
 			}
 			else {
 				prctx.index = i;
-				invmgr_inv_print( tok->d_invindex_fd,
-						 &prctx );
+				invmgr_inv_print(tok->d_invindex_fd,
+						 &prctx);
 			}
-			inv_close( tok );
+			inv_close(tok);
 		}
 	}
 
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index f9866a5..006b41b 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -46,30 +46,30 @@
 /*----------------------------------------------------------------------*/
 
 int
-get_counters( int fd, void **cntpp, size_t cntsz )
+get_counters(int fd, void **cntpp, size_t cntsz)
 {
 	/* object must be locked at least SHARED by caller */
 	uint num;
-	assert( cntsz >= sizeof( invt_counter_t ) );
+	assert(cntsz >= sizeof(invt_counter_t) );
 
-	*cntpp =  calloc( 1, cntsz);
+	*cntpp =  calloc(1, cntsz);
 
 	/* find the number of sessions and the max possible */
-	if ( GET_REC_NOLOCK( fd, (void *) *cntpp, cntsz, (off64_t) 0 ) < 0 ) {
-		free( *cntpp );
+	if (GET_REC_NOLOCK(fd, (void *) *cntpp, cntsz, (off64_t) 0) < 0) {
+		free(*cntpp);
 		*cntpp = NULL;
 		return -1;
 	}
 
 	num = ((invt_counter_t *)(*cntpp))->ic_curnum;
 
-	if ( ( (invt_counter_t *)(*cntpp))->ic_vernum != INV_VERSION ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
+	if (((invt_counter_t *)(*cntpp))->ic_vernum != INV_VERSION) {
+		mlog(MLOG_NORMAL | MLOG_INV, _(
 		      "INV : Unknown version %d - Expected version %d\n"),
-		      (int) ( (invt_counter_t *)(*cntpp))->ic_vernum,
-		      (int) INV_VERSION );
-		assert ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
-			INV_VERSION );
+		      (int) ((invt_counter_t *)(*cntpp))->ic_vernum,
+		      (int) INV_VERSION);
+		assert (((invt_counter_t *)(*cntpp))->ic_vernum ==
+			INV_VERSION);
 	}
 
 	return (int) num;
@@ -84,19 +84,19 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 /*----------------------------------------------------------------------*/
 
 int
-get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
+get_headers(int fd, void **hdrs, size_t bufsz, size_t off)
 {
 
-	*hdrs = malloc( bufsz );
-	if ( *hdrs == NULL ) {
-		INV_PERROR( _("get_headers() - malloc(seshdrs)\n") );
+	*hdrs = malloc(bufsz);
+	if (*hdrs == NULL) {
+		INV_PERROR(_("get_headers() - malloc(seshdrs)\n"));
 		return -1;
 	}
 	/* file must be locked at least SHARED by caller */
 
 	/* get the array of hdrs */
-	if ( GET_REC_NOLOCK( fd, (void *) *hdrs, bufsz, (off64_t)off ) < 0 ) {
-		free ( *hdrs );
+	if (GET_REC_NOLOCK(fd, (void *) *hdrs, bufsz, (off64_t)off) < 0) {
+		free (*hdrs);
 		*hdrs = NULL;
 		return -1;
 	}
@@ -111,26 +111,26 @@ get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
 /*----------------------------------------------------------------------*/
 
 int
-get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
-		bool_t dolock )
+get_invtrecord(int fd, void *buf, size_t bufsz, off64_t off,
+		bool_t dolock)
 {
 	int  nread;
 
-	assert ( fd >= 0 );
+	assert (fd >= 0);
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_SH );
+	if (dolock)
+		INVLOCK(fd, LOCK_SH);
 
 	nread = pread(fd, buf, bufsz, (off_t)off);
-	if (  nread != (int) bufsz ) {
-		INV_PERROR( _("Error in reading inventory record :") );
-		if ( dolock )
-			INVLOCK( fd, LOCK_UN );
+	if (nread != (int) bufsz) {
+		INV_PERROR(_("Error in reading inventory record :"));
+		if (dolock)
+			INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_UN );
+	if (dolock)
+		INVLOCK(fd, LOCK_UN);
 
 	return nread;
 }
@@ -145,23 +145,23 @@ get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
 /*----------------------------------------------------------------------*/
 
 int
-put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock )
+put_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock)
 {
 	int nwritten;
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_EX );
+	if (dolock)
+		INVLOCK(fd, LOCK_EX);
 
 	nwritten = pwrite(fd, buf, bufsz, (off_t)off);
-	if (nwritten != (int) bufsz ) {
-		INV_PERROR( _("Error in writing inventory record :") );
-		if ( dolock )
-			INVLOCK( fd, LOCK_UN );
+	if (nwritten != (int) bufsz) {
+		INV_PERROR(_("Error in writing inventory record :"));
+		if (dolock)
+			INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 
-	if ( dolock )
-		INVLOCK( fd, LOCK_UN );
+	if (dolock)
+		INVLOCK(fd, LOCK_UN);
 	return nwritten;
 }
 
@@ -177,25 +177,25 @@ put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock )
 
 
 int
-get_headerinfo( int fd, void **hdrs, void **cnt,
-	        size_t hdrsz, size_t cntsz, bool_t dolock )
+get_headerinfo(int fd, void **hdrs, void **cnt,
+	        size_t hdrsz, size_t cntsz, bool_t dolock)
 {
 	int num;
 
 	/* get a lock on the table for reading */
-	if ( dolock ) INVLOCK( fd, LOCK_SH );
+	if (dolock) INVLOCK(fd, LOCK_SH);
 
-	num = get_counters( fd, cnt, cntsz );
+	num = get_counters(fd, cnt, cntsz);
 
 	/* If there are no sessions recorded yet, we're done too */
-	if ( num > 0 ) {
-		if ( get_headers( fd, hdrs, hdrsz * (size_t)num, cntsz ) < 0 ) {
-			free ( *cnt );
+	if (num > 0) {
+		if (get_headers(fd, hdrs, hdrsz * (size_t)num, cntsz) < 0) {
+			free (*cnt);
 			num = -1;
 		}
 	}
 
-	if ( dolock ) INVLOCK( fd, LOCK_UN );
+	if (dolock) INVLOCK(fd, LOCK_UN);
 	return num;
 }
 
@@ -206,25 +206,25 @@ get_headerinfo( int fd, void **hdrs, void **cnt,
 /*----------------------------------------------------------------------*/
 
 int
-get_lastheader( int fd, void **ent, size_t hdrsz, size_t cntsz )
+get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 {
 	int	     	 nindices;
 	void	 	 *arr = NULL;
 	invt_counter_t	 *cnt = NULL;
 	char 		 *pos;
 	/* get the entries in the inv_index */
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( fd, &arr, (void **)&cnt,
-					 hdrsz, cntsz )) <= 0 ) {
+	if ((nindices = GET_ALLHDRS_N_CNTS(fd, &arr, (void **)&cnt,
+					 hdrsz, cntsz)) <= 0) {
 		return -1;
 	}
 
 	/* if there's space anywhere at all, then it must be in the last
 	   entry */
-	*ent = malloc( hdrsz );
-	pos = (char *) arr + ( (uint)nindices - 1 ) * hdrsz;
-	memcpy( *ent, pos, hdrsz );
-	free ( arr );
-	free ( cnt );
+	*ent = malloc(hdrsz);
+	pos = (char *) arr + ((uint)nindices - 1) * hdrsz;
+	memcpy(*ent, pos, hdrsz);
+	free (arr);
+	free (cnt);
 
 	return nindices;
 }
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index 46f6b8f..ae4642d 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -49,35 +49,35 @@ static char inv_dirpathp[MGR_PATH_MAX];
 static char inv_lockfilep[MGR_PATH_MAX];
 
 char *
-inv_dirpath( void )
+inv_dirpath(void)
 {
 	assert(inv_base);
 	return inv_dirpathp;
 }
 
 char *
-inv_fstab( void )
+inv_fstab(void)
 {
 	assert(inv_base);
 	return inv_fstabp;
 }
 
 char *
-inv_lockfile( void )
+inv_lockfile(void)
 {
 	assert(inv_base);
 	return inv_lockfilep;
 }
 
 char *
-inv_basepath( void )
+inv_basepath(void)
 {
 	assert(inv_base);
 	return inv_base;
 }
 
 int
-inv_setup_base( void )
+inv_setup_base(void)
 {
 	struct stat64 new_sbuf, old_sbuf;
 	int new_exists, old_exists;
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 5f7e734..5afec57 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -49,28 +49,28 @@
 
 
 int
-fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
-	      inv_oflag_t forwhat )
+fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
+	      inv_oflag_t forwhat)
 {
 	int fd;
 
-	fd = open ( INV_FSTAB, INV_OFLAG(forwhat) );
+	fd = open (INV_FSTAB, INV_OFLAG(forwhat));
 
-	if ( fd < 0 )
+	if (fd < 0)
 		return -1; /* if ENOENT, fstab_put_entry will CREAT */
 
-	INVLOCK( fd, LOCK_EX );
-	if (( *numfs = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void**) arr,
+	INVLOCK(fd, LOCK_EX);
+	if ((*numfs = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void**) arr,
 						 (void **)cnt,
-						 sizeof( invt_fstab_t ),
-						 sizeof( invt_counter_t ) )
-	     ) < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _(
-			"INV: couldn't get fstab headers\n") );
+						 sizeof(invt_fstab_t),
+						 sizeof(invt_counter_t) )
+	     ) < 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _(
+			"INV: couldn't get fstab headers\n"));
 	}
 #ifdef INVT_DEBUG
-	mlog( MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n",
-	      *numfs );
+	mlog(MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n",
+	      *numfs);
 #endif
 	/* fstab is left locked EX on exit. The caller takes does
 	   the unlocking */
@@ -88,53 +88,53 @@ fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 
 
 int
-fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
+fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 {
 	int numfs, i, fd;
 	invt_counter_t *cnt;
 	invt_fstab_t *arr;
 	int rval = 1;
 
-	assert( forwhat != INV_SEARCH_ONLY );
+	assert(forwhat != INV_SEARCH_ONLY);
 
 	/* fd is locked on succesful return */
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-	if ( fd < 0 ) {
-		if ( errno != ENOENT ) {
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+	if (fd < 0) {
+		if (errno != ENOENT) {
 			return -1;
 		}
-		if ((fd = open( INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ))
-		    < 0 ) {
-			INV_PERROR ( INV_FSTAB );
+		if ((fd = open(INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR))
+		    < 0) {
+			INV_PERROR (INV_FSTAB);
 			return -1;
 		}
 
-		INVLOCK( fd, LOCK_EX );
-		fchmod( fd, INV_PERMS );
+		INVLOCK(fd, LOCK_EX);
+		fchmod(fd, INV_PERMS);
 
-		cnt = (invt_counter_t *) malloc( sizeof ( invt_counter_t ) );
+		cnt = (invt_counter_t *) malloc(sizeof (invt_counter_t) );
 
 		cnt->ic_maxnum = -1;
 		cnt->ic_curnum = 0;
 		cnt->ic_vernum = INV_VERSION;
 
-	} else if ( numfs > 0 ) {
+	} else if (numfs > 0) {
 
 		for (i = 0; i < numfs; i++) {
-		    if ( uuid_compare( *fsidp, arr[ i ].ft_uuid ) == 0 ) {
+		    if (uuid_compare(*fsidp, arr[i].ft_uuid) == 0) {
 
-/*			if ( ( STREQL( arr[i].ft_mountpt, mntpt ) ) &&
-			    ( STREQL( arr[i].ft_devpath, dev ) ) )
+/*			if ((STREQL(arr[i].ft_mountpt, mntpt) ) &&
+			    (STREQL(arr[i].ft_devpath, dev) ))
 */
-				free ( arr );
-				free ( cnt );
-				close( fd );
+				free (arr);
+				free (cnt);
+				close(fd);
 				return 1;
 
 		}
 	    }
 	    /* entry not found. just follow thru to create a new one */
-	    free ( arr );
+	    free (arr);
 	}
 
 	/* make a new fstab entry and insert it at the end. the table
@@ -143,29 +143,29 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 		invt_fstab_t ent;
 		off64_t hoff;
 
-		memcpy( &ent.ft_uuid, fsidp, sizeof( uuid_t ) );
-		strcpy( ent.ft_mountpt, mntpt );
-		strcpy( ent.ft_devpath, dev );
+		memcpy(&ent.ft_uuid, fsidp, sizeof(uuid_t) );
+		strcpy(ent.ft_mountpt, mntpt);
+		strcpy(ent.ft_devpath, dev);
 
 		/* increase the number of entries first */
 #ifdef INVT_DEBUG
-		mlog( MLOG_NITTY | MLOG_INV,"INV: putting new fstab entry for %s ....\n",
+		mlog(MLOG_NITTY | MLOG_INV,"INV: putting new fstab entry for %s ....\n",
 		      mntpt);
 #endif
 		cnt->ic_curnum++;
-		hoff = (off64_t) ( sizeof( invt_counter_t ) +
-				 (size_t)( cnt->ic_curnum - 1 ) *
-				           sizeof( invt_fstab_t ) );
+		hoff = (off64_t) (sizeof(invt_counter_t) +
+				 (size_t)(cnt->ic_curnum - 1) *
+				           sizeof(invt_fstab_t) );
 
-		rval = PUT_COUNTERS( fd, cnt );
-		if ( rval > 0 ) {
-		      rval = PUT_REC_NOLOCK( fd, &ent, sizeof( ent ), hoff );
+		rval = PUT_COUNTERS(fd, cnt);
+		if (rval > 0) {
+		      rval = PUT_REC_NOLOCK(fd, &ent, sizeof(ent), hoff);
 		}
 
 	}
-	INVLOCK( fd, LOCK_UN );
-	free ( cnt );
-	close ( fd );
+	INVLOCK(fd, LOCK_UN);
+	free (cnt);
+	close (fd);
 	return rval;
 }
 
@@ -174,7 +174,7 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 
 
 int
-fstab_get_fname( void *pred,
+fstab_get_fname(void *pred,
 		 char *fname,
 		 inv_predicate_t bywhat,
 		 inv_oflag_t forwhat)
@@ -189,34 +189,34 @@ fstab_get_fname( void *pred,
 		invt_counter_t *cnt;
 
 		/* on sucessful return fd is locked */
-		fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
-		if ( fd < 0 )
+		fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
+		if (fd < 0)
 			return -1;
-		if ( numfs <= 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+		if (numfs <= 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			      "INV: No recorded filesystems in"
-			      " inventory's fstab.\n") );
+			      " inventory's fstab.\n"));
 			return -1;
 		}
-		INVLOCK( fd, LOCK_UN );
-		close ( fd );
-		free ( cnt ); /* we dont need it */
+		INVLOCK(fd, LOCK_UN);
+		close (fd);
+		free (cnt); /* we dont need it */
 
 		/* first get hold of the uuid for this mount point/device */
 
 		for (i = 0; i < numfs; i++) {
-			if ( ( bywhat == INV_BY_MOUNTPT &&
-			     ( STREQL( arr[i].ft_mountpt, pred ) )) ||
-			     ( bywhat == INV_BY_DEVPATH &&
-			     ( STREQL( arr[i].ft_devpath, pred ) )) ) {
+			if ((bywhat == INV_BY_MOUNTPT &&
+			     (STREQL(arr[i].ft_mountpt, pred) )) ||
+			     (bywhat == INV_BY_DEVPATH &&
+			     (STREQL(arr[i].ft_devpath, pred) ))) {
 
 				uuidp = &arr[i].ft_uuid;
 				break;
 			}
 		}
 #ifdef INVT_DEBUG
-		if (! uuidp )
-			mlog( MLOG_DEBUG | MLOG_INV,"INV: get_fname: unable to find %s"
+		if (! uuidp)
+			mlog(MLOG_DEBUG | MLOG_INV,"INV: get_fname: unable to find %s"
 			      " in the inventory\n", (char *)pred);
 #endif
 
@@ -224,35 +224,35 @@ fstab_get_fname( void *pred,
 		uuidp = (uuid_t *)pred;
 	}
 
-	if (! uuidp )
+	if (! uuidp)
 		return -1;
 
-	uuid_unparse( *uuidp, uuidstr );
+	uuid_unparse(*uuidp, uuidstr);
 
-	strncpy ( fname, INV_DIRPATH, INV_STRLEN );
-	strcat ( fname, "/" );
-	strcat ( fname, uuidstr);
+	strncpy (fname, INV_DIRPATH, INV_STRLEN);
+	strcat (fname, "/");
+	strcat (fname, uuidstr);
 
-	if ( bywhat != INV_BY_UUID )
-		free ( arr );
+	if (bywhat != INV_BY_UUID)
+		free (arr);
 
-	assert( (int) strlen( fname ) < INV_STRLEN );
+	assert((int) strlen(fname) < INV_STRLEN);
 	return 1;
 }
 
 
 void
-fstab_DEBUG_print( invt_fstab_t *arr, int num )
+fstab_DEBUG_print(invt_fstab_t *arr, int num)
 {
 	int i;
 	char str[UUID_STR_LEN + 1];
 
-	mlog( MLOG_NORMAL | MLOG_INV, _("\n\n--------- fstab ------------\n") );
-	for ( i = 0; i < num; i++ ) {
-		printf( _("Mount\t%s\n"), arr[i].ft_mountpt );
-		printf( _("Dev\t%s\n"), arr[i].ft_devpath );
-		uuid_unparse( arr[i].ft_uuid, str );
-		printf( _("FSid\t%s\n\n"), str );
+	mlog(MLOG_NORMAL | MLOG_INV, _("\n\n--------- fstab ------------\n"));
+	for (i = 0; i < num; i++) {
+		printf(_("Mount\t%s\n"), arr[i].ft_mountpt);
+		printf(_("Dev\t%s\n"), arr[i].ft_devpath);
+		uuid_unparse(arr[i].ft_uuid, str);
+		printf(_("FSid\t%s\n\n"), str);
 	}
-	mlog( MLOG_NORMAL | MLOG_INV, "\n---------========------------\n" );
+	mlog(MLOG_NORMAL | MLOG_INV, "\n---------========------------\n");
 }
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index b33983d..7b36cd6 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -44,10 +44,10 @@
 /* into.                                                                */
 /*----------------------------------------------------------------------*/
 uint
-idx_insert_newentry( int fd, /* kept locked EX by caller */
+idx_insert_newentry(int fd, /* kept locked EX by caller */
 		     int *stobjfd, /* OUT */
 		     invt_entry_t *iarr, invt_counter_t *icnt,
-		     time32_t tm )
+		     time32_t tm)
 {
 	uint i;
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
@@ -56,42 +56,42 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 
 	/* If time period of the new entry is before our first invindex,
 	   we have to insert a new invindex in the first slot */
-	if ( iarr[0].ie_timeperiod.tp_start > tm ) {
-		/* *stobjfd = idx_put_newentry( fd, 0, iarr, icnt, &ient );*/
-		*stobjfd = open( iarr[0].ie_filename, INV_OFLAG(forwhat) );
+	if (iarr[0].ie_timeperiod.tp_start > tm) {
+		/* *stobjfd = idx_put_newentry(fd, 0, iarr, icnt, &ient);*/
+		*stobjfd = open(iarr[0].ie_filename, INV_OFLAG(forwhat));
 		return 0;
 	}
 
-	for ( i = 0; i < icnt->ic_curnum; i++ ) {
+	for (i = 0; i < icnt->ic_curnum; i++) {
 		/* if our time is nicely within an existing entry's time
 		   period, hellalujah */
-		if ( IS_WITHIN( &iarr[i].ie_timeperiod, tm ) ) {
+		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm) ) {
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n",i );
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n",i);
 #endif
-			*stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+			*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			return i;
 		}
-		if ( iarr[i].ie_timeperiod.tp_end == 0  &&
-		     iarr[i].ie_timeperiod.tp_start  == 0 ) {
+		if (iarr[i].ie_timeperiod.tp_end == 0  &&
+		     iarr[i].ie_timeperiod.tp_start  == 0) {
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV, "INV: end = start \n" );
-			mlog( MLOG_DEBUG | MLOG_INV,"BEF: st %ld end %ld\n",
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: end = start \n");
+			mlog(MLOG_DEBUG | MLOG_INV,"BEF: st %ld end %ld\n",
 			     iarr[i].ie_timeperiod.tp_start,
-			     iarr[i].ie_timeperiod.tp_end );
+			     iarr[i].ie_timeperiod.tp_end);
 #endif
 
 			iarr[i].ie_timeperiod.tp_start =
 				iarr[i].ie_timeperiod.tp_end = tm;
-			PUT_REC_NOLOCK( fd, iarr,
+			PUT_REC_NOLOCK(fd, iarr,
 				       icnt->ic_curnum * sizeof(invt_entry_t),
-				       (off64_t) sizeof( invt_counter_t ) );
+				       (off64_t) sizeof(invt_counter_t) );
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV,"AFT: st %ld end %ld\n",
+			mlog(MLOG_DEBUG | MLOG_INV,"AFT: st %ld end %ld\n",
 			     iarr[i].ie_timeperiod.tp_start,
-			     iarr[i].ie_timeperiod.tp_end );
+			     iarr[i].ie_timeperiod.tp_end);
 #endif
-			*stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+			*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			return i;
 		}
 
@@ -99,9 +99,9 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 
 		/* if it is beyond the end of this timeperiod, see if we
 		   belong to a timeperiod that doesn't have an entry */
-		if ( iarr[i].ie_timeperiod.tp_end < tm ) {
+		if (iarr[i].ie_timeperiod.tp_end < tm) {
 			/* see if we're the last entry here */
-			if ( i == icnt->ic_curnum - 1 ) {
+			if (i == icnt->ic_curnum - 1) {
 				/* our slot is (i+1)th entry. Make the
 				   timeperiod's the same as it was. As far
 				   as I can see there is no way that
@@ -109,13 +109,13 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 
 				   insert the new entry and write back
 				   icnt and invindex entry */
-				/* *stobjfd = idx_put_newentry( fd, i+1, iarr,
-							     icnt, &ient );*/
-			      *stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
+							     icnt, &ient);*/
+			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			      return i;
 			}
 			/* see if the next entry starts later than us */
-			if ( iarr[i+1].ie_timeperiod.tp_start > tm ) {
+			if (iarr[i+1].ie_timeperiod.tp_start > tm) {
 
 
 				/* We have the option of pushing entries
@@ -125,22 +125,22 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 				   We choose the former. */
 
 				/* the timeperiods had better not overlap */
-				assert(( tm > iarr[i].ie_timeperiod.tp_end ) &&
-				       ( tm < iarr[i+1].ie_timeperiod.tp_start ));
+				assert((tm > iarr[i].ie_timeperiod.tp_end) &&
+				       (tm < iarr[i+1].ie_timeperiod.tp_start));
 
 				/* shift everything from (i+1) onwards by
 				   one. Then insert the new entry and write
 				   back icnt and invindex entries */
-				/* *stobjfd = idx_put_newentry( fd, i+1, iarr,
-							     icnt, &ient );*/
-			      *stobjfd = open( iarr[i].ie_filename, INV_OFLAG(forwhat) );
+				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
+							     icnt, &ient);*/
+			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 				return i;
 			}
 		}
 	}
 
 	/* We couldnt find anything that fits */
-	assert( 0 );	/* We can't get here ! */
+	assert(0);	/* We can't get here ! */
 	return -1;
 
 
@@ -156,7 +156,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 int
 idx_put_newentry(
 	invt_idxinfo_t *idx,
-	invt_entry_t *ient )
+	invt_entry_t *ient)
 {
 	invt_entry_t	*idxarr;
 	int stobjfd;
@@ -166,37 +166,37 @@ idx_put_newentry(
 	invt_entry_t *iarr = idx->iarr;
 	invt_counter_t *icnt = idx->icnt;
 
-	stobj_makefname( ient->ie_filename );
-	if ( ( stobjfd = stobj_create( ient->ie_filename ) ) < 0 )
+	stobj_makefname(ient->ie_filename);
+	if ((stobjfd = stobj_create(ient->ie_filename) ) < 0)
 		return -1;
 
 	icnt->ic_curnum++; /* there is no maximum */
 
-	idxarr = ( invt_entry_t * ) calloc ( icnt->ic_curnum,
-					     sizeof( invt_entry_t ) );
-	memcpy( idxarr, iarr, ( size_t ) ( sizeof( invt_entry_t ) * index ) );
+	idxarr = (invt_entry_t *) calloc (icnt->ic_curnum,
+					     sizeof(invt_entry_t) );
+	memcpy(idxarr, iarr, (size_t) (sizeof(invt_entry_t) * index) );
 
 	/* shift everything from (i+1) onwards by one */
-	if ( index <  icnt->ic_curnum - 1 )
-		memcpy( &idxarr[ index + 1 ], &iarr[ index ],
-		       ( size_t ) ( ( icnt->ic_curnum - index - 1 ) *
-				    sizeof( invt_entry_t ) ) );
+	if (index <  icnt->ic_curnum - 1)
+		memcpy(&idxarr[index + 1], &iarr[index],
+		       (size_t) ((icnt->ic_curnum - index - 1) *
+				    sizeof(invt_entry_t) ));
 	/* insert the new entry */
-	memcpy( &idxarr[ index ], ient, sizeof( invt_entry_t ) );
+	memcpy(&idxarr[index], ient, sizeof(invt_entry_t) );
 
 
-	if ( ( PUT_COUNTERS( fd, icnt ) < 0 ) ||
-		( PUT_REC_NOLOCK( fd, idxarr,
-				  icnt->ic_curnum * sizeof( invt_entry_t ),
-				  sizeof( invt_counter_t ) ) < 0 ) ) {
+	if ((PUT_COUNTERS(fd, icnt) < 0) ||
+		(PUT_REC_NOLOCK(fd, idxarr,
+				  icnt->ic_curnum * sizeof(invt_entry_t),
+				  sizeof(invt_counter_t) ) < 0) ) {
 			/* XXX delete the stobj that we just created */
 
-			memset( ient->ie_filename, 0 , INV_STRLEN );
-			free( idxarr );
+			memset(ient->ie_filename, 0 , INV_STRLEN);
+			free(idxarr);
 			return -1;
 		}
 
-	free( iarr );
+	free(iarr);
 	idx->iarr = idxarr;
 	return stobjfd;
 
@@ -213,8 +213,8 @@ idx_put_newentry(
 
 
 int
-idx_find_stobj( invt_idxinfo_t *idx,
-	        time32_t tm )
+idx_find_stobj(invt_idxinfo_t *idx,
+	        time32_t tm)
 {
 
 	int 		stobjfd;
@@ -222,22 +222,22 @@ idx_find_stobj( invt_idxinfo_t *idx,
 	/* since sessions can be inserted in random order, the invindex
 	   table can contain time-periods that don't have corresponding
 	   entries for */
-	if ( GET_ALLHDRS_N_CNTS_NOLOCK( idx->invfd, (void **)&idx->iarr,
+	if (GET_ALLHDRS_N_CNTS_NOLOCK(idx->invfd, (void **)&idx->iarr,
 						     (void **)&idx->icnt,
-						     sizeof( invt_entry_t ),
-				sizeof( invt_counter_t ) ) < 0 ) {
+						     sizeof(invt_entry_t),
+				sizeof(invt_counter_t) ) < 0) {
 		return -1;
 	}
 
 #ifdef INVT_DEBUG
-	printf( "idx_find_stobj Time: %ld\n", tm );
-	idx_DEBUG_printinvindices( idx->iarr, idx->icnt->ic_curnum );
+	printf("idx_find_stobj Time: %ld\n", tm);
+	idx_DEBUG_printinvindices(idx->iarr, idx->icnt->ic_curnum);
 #endif
 
 	/* Now figure out where we are going to insert this stobj among the
 	   invindices and put it there */
-	idx->index = idx_insert_newentry( idx->invfd, &stobjfd, idx->iarr,
-						 idx->icnt, tm );
+	idx->index = idx_insert_newentry(idx->invfd, &stobjfd, idx->iarr,
+						 idx->icnt, tm);
 
 	return stobjfd;
 }
@@ -254,33 +254,33 @@ idx_find_stobj( invt_idxinfo_t *idx,
 /*----------------------------------------------------------------------*/
 
 inv_idbtoken_t
-idx_create( char *fname, inv_oflag_t forwhat )
+idx_create(char *fname, inv_oflag_t forwhat)
 {
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
 	/* This is not to be called when the user wants to open
 	   the db for SEARCH_ONLY. */
-	assert( forwhat != INV_SEARCH_ONLY );
+	assert(forwhat != INV_SEARCH_ONLY);
 
-	if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
-		INV_PERROR ( fname );
+	if ((fd = open (fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
+		INV_PERROR (fname);
 		return INV_TOKEN_NULL;
 	}
 
-	INVLOCK( fd, LOCK_EX );
-	fchmod( fd, INV_PERMS );
+	INVLOCK(fd, LOCK_EX);
+	fchmod(fd, INV_PERMS);
 
 #ifdef INVT_DEBUG
-	mlog( MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
+	mlog(MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
 #endif
 
 	/* create the first entry in the new inv_index */
-	stobjfd = idx_create_entry( &tok, fd, BOOL_TRUE );
+	stobjfd = idx_create_entry(&tok, fd, BOOL_TRUE);
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 
-	if ( stobjfd < 0 )
+	if (stobjfd < 0)
 		return INV_TOKEN_NULL;
 	return tok;
 }
@@ -292,18 +292,18 @@ idx_create( char *fname, inv_oflag_t forwhat )
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 int
-idx_recons_time( time32_t tm, invt_idxinfo_t *idx )
+idx_recons_time(time32_t tm, invt_idxinfo_t *idx)
 {
 	invt_timeperiod_t *tp = &idx->iarr[idx->index].ie_timeperiod;
-	if ( tp->tp_start && IS_WITHIN( tp, tm ) )
+	if (tp->tp_start && IS_WITHIN(tp, tm) )
 		return 1;
 
-	if ( tm > tp->tp_end || tp->tp_end == 0 )
+	if (tm > tp->tp_end || tp->tp_end == 0)
 		tp->tp_end =  tm;
-	if ( tm < tp->tp_start || tp->tp_start == 0 )
+	if (tm < tp->tp_start || tp->tp_start == 0)
 		tp->tp_start = tm;
-	PUT_REC_NOLOCK( idx->invfd,  &idx->iarr[idx->index],
-		        sizeof( invt_entry_t ), IDX_HDR_OFFSET(idx->index) );
+	PUT_REC_NOLOCK(idx->invfd,  &idx->iarr[idx->index],
+		        sizeof(invt_entry_t), IDX_HDR_OFFSET(idx->index));
 	return 1;
 }
 
@@ -317,29 +317,29 @@ idx_recons_time( time32_t tm, invt_idxinfo_t *idx )
 /*----------------------------------------------------------------------*/
 
 int
-idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
+idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime)
 {
 	int rval;
 	invt_entry_t ent;
 	int fd = tok->sd_invtok->d_invindex_fd;
 
-	INVLOCK( fd, LOCK_EX );
+	INVLOCK(fd, LOCK_EX);
 
-	rval = GET_REC_NOLOCK( fd, &ent, sizeof( invt_entry_t ),
+	rval = GET_REC_NOLOCK(fd, &ent, sizeof(invt_entry_t),
 			        tok->sd_invtok->d_invindex_off);
-	if ( rval < 0 ) {
-		INVLOCK( fd, LOCK_UN );
+	if (rval < 0) {
+		INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 	ent.ie_timeperiod.tp_end = tok->sd_sesstime;
 
-	if ( whichtime == INVT_STARTTIME || ent.ie_timeperiod.tp_start == 0 ) {
+	if (whichtime == INVT_STARTTIME || ent.ie_timeperiod.tp_start == 0) {
 		ent.ie_timeperiod.tp_start = tok->sd_sesstime;
 	}
 #ifdef INVT_DEBUG
-	mlog( MLOG_DEBUG | MLOG_INV,"Putsestime: st %ld end %ld\n",
+	mlog(MLOG_DEBUG | MLOG_INV,"Putsestime: st %ld end %ld\n",
 			      ent.ie_timeperiod.tp_start,
-			      ent.ie_timeperiod.tp_end );
+			      ent.ie_timeperiod.tp_end);
 #endif
 	rval = PUT_REC_NOLOCK(fd, &ent, sizeof(invt_entry_t),
 			      tok->sd_invtok->d_invindex_off);
@@ -349,20 +349,20 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 		int nindices;
 		invt_entry_t *iarr = NULL;
 		invt_counter_t *icnt = NULL;
-		if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd,
+		if ((nindices = GET_ALLHDRS_N_CNTS_NOLOCK(fd,
 						     (void **)&iarr,
 						     (void **)&icnt,
-						sizeof( invt_entry_t ),
-				sizeof( invt_counter_t ))) < 0 ) {
+						sizeof(invt_entry_t),
+				sizeof(invt_counter_t))) < 0) {
 			return -1;
 		}
-		idx_DEBUG_printinvindices( iarr, (uint) nindices );
-		free( iarr );
-		free( icnt );
+		idx_DEBUG_printinvindices(iarr, (uint) nindices);
+		free(iarr);
+		free(icnt);
 	}
 #endif
 
-	INVLOCK( fd, LOCK_UN );
+	INVLOCK(fd, LOCK_UN);
 	return rval;
 }
 
@@ -384,42 +384,42 @@ int
 idx_create_entry(
 	inv_idbtoken_t *tok,
 	int invfd, 	/* kept locked EX  by caller */
-	bool_t firstentry )
+	bool_t firstentry)
 {
 	invt_entry_t   	ent;
 	int	      	fd;
 	off64_t 	hoff;
 
 
-	memset ( &ent, 0, sizeof( ent ) );
+	memset (&ent, 0, sizeof(ent) );
 
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
-	stobj_makefname( ent.ie_filename );
+	stobj_makefname(ent.ie_filename);
 
-	if ( firstentry ) {
+	if (firstentry) {
 		invt_counter_t cnt;
 
 		cnt.ic_maxnum = INVT_MAX_INVINDICES;
 		cnt.ic_curnum = 1;
 		cnt.ic_vernum = INV_VERSION;
 
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			return -1;
 		}
 
-		if ( PUT_REC_NOLOCK( invfd, &cnt, sizeof(cnt), (off64_t)0 ) < 0 )
+		if (PUT_REC_NOLOCK(invfd, &cnt, sizeof(cnt), (off64_t)0) < 0)
 			return -1;
 
-		hoff = sizeof( invt_counter_t );
+		hoff = sizeof(invt_counter_t);
 
-		if ( PUT_REC_NOLOCK( invfd, &ent, sizeof( ent ), hoff ) < 0)
+		if (PUT_REC_NOLOCK(invfd, &ent, sizeof(ent), hoff) < 0)
 			return -1;
 	} else {
 		invt_counter_t *cnt = NULL;
 
-		if ( GET_COUNTERS( invfd, &cnt )  < 0 ) {
+		if (GET_COUNTERS(invfd, &cnt)  < 0) {
 			return -1;
 		}
 
@@ -427,29 +427,29 @@ idx_create_entry(
 		   another and leave a pointer to that in here */
 
 		/* create the new storage object */
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			return -1;
 		}
 		++(cnt->ic_curnum);
-		if ( PUT_COUNTERS( invfd, cnt ) < 0 ) {
+		if (PUT_COUNTERS(invfd, cnt) < 0) {
 			return -1;
 		}
 
 		/* add the new index entry to the array, at the end */
 
-		hoff = IDX_HDR_OFFSET( cnt->ic_curnum - 1 );
+		hoff = IDX_HDR_OFFSET(cnt->ic_curnum - 1);
 		free (cnt);
 #ifdef INVT_DEBUG
-		mlog( MLOG_NITTY | MLOG_INV, "new stobj name %s @ offset %d\n",
-		      ent.ie_filename,(int)hoff );
+		mlog(MLOG_NITTY | MLOG_INV, "new stobj name %s @ offset %d\n",
+		      ent.ie_filename,(int)hoff);
 #endif
-		if (PUT_REC_NOLOCK( invfd, &ent, sizeof( ent ), hoff) < 0 )
+		if (PUT_REC_NOLOCK(invfd, &ent, sizeof(ent), hoff) < 0)
 			return -1;
 
 	}
 
-	*tok = get_token( invfd, fd );
+	*tok = get_token(invfd, fd);
 	(*tok)->d_invindex_off = hoff;
 	(*tok)->d_update_flag |= NEW_INVINDEX;
 	(*tok)->d_oflag = INV_SEARCH_N_MOD;
@@ -469,7 +469,7 @@ idx_create_entry(
 /*----------------------------------------------------------------------*/
 
 int
-idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
+idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index)
 {
 	invt_entry_t 	*ent = 0;
 	int	     	 fd;
@@ -477,65 +477,65 @@ idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
 	/* if there's space anywhere at all, then it must be in the last
 	   entry. get_lastheader() does the locking */
 
-	if ((*index = get_lastheader( invfd, (void **)&ent,
+	if ((*index = get_lastheader(invfd, (void **)&ent,
 				       sizeof(invt_entry_t),
-				       sizeof(invt_counter_t) ) ) < 0 )
+				       sizeof(invt_counter_t)) ) < 0)
 		return -1;
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	assert ( ent != NULL );
-	assert ( ent->ie_filename );
+	assert (ent != NULL);
+	assert (ent->ie_filename);
 
-	fd = open( ent->ie_filename, INV_OFLAG(forwhat) );
-	if ( fd < 0 )
-		INV_PERROR( ent->ie_filename );
-	free ( ent );
+	fd = open(ent->ie_filename, INV_OFLAG(forwhat));
+	if (fd < 0)
+		INV_PERROR(ent->ie_filename);
+	free (ent);
 
 	return fd;
 }
 
 
 int
-idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num )
+idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num)
 {
 	uint i;
 	uint k;
 
 	char s[9];
-	printf( "\n ==================================\n"
-	        " InvIndex\n # StObjs\t%d\n", num );
+	printf("\n ==================================\n"
+	        " InvIndex\n # StObjs\t%d\n", num);
 #define INV_UUID_STR_LEN	36 /* not exported via uuid.h */
-	for ( i = 0; i < num; i++ ) {
-		k = strlen( iarr[i].ie_filename );
-		strncpy( s, (char *) iarr[i].ie_filename + k -
-			( INV_UUID_STR_LEN + strlen(INV_STOBJ_PREFIX)), 8 );
+	for (i = 0; i < num; i++) {
+		k = strlen(iarr[i].ie_filename);
+		strncpy(s, (char *) iarr[i].ie_filename + k -
+			(INV_UUID_STR_LEN + strlen(INV_STOBJ_PREFIX)), 8);
 		s[8]= 0;
-		printf("%d. %s \t( %d - %d )\n", i, s,
+		printf("%d. %s \t(%d - %d)\n", i, s,
 		       iarr[i].ie_timeperiod.tp_start,
-		       iarr[i].ie_timeperiod.tp_end );
+		       iarr[i].ie_timeperiod.tp_end);
 	}
 #undef INV_UUID_STR_LEN
-	printf( "\n ==================================\n");
+	printf("\n ==================================\n");
 	return 1;
 
 }
 
 int
-idx_DEBUG_print ( int fd )
+idx_DEBUG_print (int fd)
 {
 	int nindices;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
-	if ( ( nindices = GET_ALLHDRS_N_CNTS_NOLOCK( fd,
+	if ((nindices = GET_ALLHDRS_N_CNTS_NOLOCK(fd,
 						    (void **)&iarr,
 						    (void **)&icnt,
-						    sizeof( invt_entry_t ),
-				         sizeof( invt_counter_t ))) < 0 ) {
+						    sizeof(invt_entry_t),
+				         sizeof(invt_counter_t))) < 0) {
 		return -1;
 	}
-	idx_DEBUG_printinvindices( iarr, (uint) nindices );
-	free( iarr );
-	free( icnt );
+	idx_DEBUG_printinvindices(iarr, (uint) nindices);
+	free(iarr);
+	free(icnt);
 
 	return 1;
 }
@@ -543,16 +543,16 @@ idx_DEBUG_print ( int fd )
 
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
+DEBUG_displayallsessions(int fd, invt_seshdr_t *hdr, uint ref,
 			  invt_pr_ctx_t *prctx)
 {
 	inv_session_t *ses;
-	if ( stobj_make_invsess( fd, &ses, hdr ) < 1 )
+	if (stobj_make_invsess(fd, &ses, hdr) < 1)
 		return -1;
 
-	DEBUG_sessionprint( ses, ref, prctx);
-	free( ses->s_streams );
-	free( ses );
+	DEBUG_sessionprint(ses, ref, prctx);
+	free(ses->s_streams);
+	free(ses);
 
 	return 0;
 }
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index f175c02..078798f 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -45,33 +45,33 @@
 /*----------------------------------------------------------------------*/
 
 int
-init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
-	  inv_idbtoken_t *tok )
+init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
+	  inv_idbtoken_t *tok)
 {
-	char fname[ INV_STRLEN ];
-	char uuname[ INV_STRLEN ];
+	char fname[INV_STRLEN];
+	char uuname[INV_STRLEN];
 	int fd;
 
 	*tok = INV_TOKEN_NULL;
 	/* make sure INV_DIRPATH exists, and is writable */
-	if ( make_invdirectory( forwhat ) < 0 )
+	if (make_invdirectory(forwhat) < 0)
 		return I_DONE;
 
 	/* come up with the unique file suffix that refers to this
 	   filesystem */
-	if ( fstab_get_fname( pred, uuname, bywhat, forwhat ) < 0 ) {
+	if (fstab_get_fname(pred, uuname, bywhat, forwhat) < 0) {
 		return I_DONE;
 	}
 
-	( void )strcpy( fname, uuname );
-	strcat ( fname, INV_INVINDEX_PREFIX );
+	(void)strcpy(fname, uuname);
+	strcat (fname, INV_INVINDEX_PREFIX);
 
 	/* first check if the inv_index file exists: if not create it */
-	if ( ( fd = open( fname, INV_OFLAG(forwhat) ) ) == -1 ) {
+	if ((fd = open(fname, INV_OFLAG(forwhat)) ) == -1) {
 		if (errno != ENOENT) {
-			INV_PERROR ( fname );
+			INV_PERROR (fname);
 		} else if (forwhat == INV_SEARCH_N_MOD) {
-			*tok = idx_create( fname, forwhat );
+			*tok = idx_create(fname, forwhat);
 		} else {
 			/* this happens when the inv is empty and the user
 			   wants to do a search. this is legal - not an error */
@@ -89,12 +89,12 @@ init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 
 
 inv_idbtoken_t
-get_token( int invfd, int stobjfd  )
+get_token(int invfd, int stobjfd)
 {
 	invt_desc_entry_t *desc;
 
 	desc = (invt_desc_entry_t *) malloc
-		( sizeof( invt_desc_entry_t ) );
+		(sizeof(invt_desc_entry_t) );
 
 	desc->d_invindex_fd = invfd;
 	desc->d_stobj_fd  = stobjfd;
@@ -110,19 +110,19 @@ get_token( int invfd, int stobjfd  )
 
 
 void
-destroy_token( inv_idbtoken_t tok )
+destroy_token(inv_idbtoken_t tok)
 {
-	free ( (invt_desc_entry_t *) tok );
+	free ((invt_desc_entry_t *) tok);
 }
 
 
 
 inv_sestoken_t
-get_sesstoken( inv_idbtoken_t tok )
+get_sesstoken(inv_idbtoken_t tok)
 {
 	inv_sestoken_t stok;
 
-	stok = (inv_sestoken_t) malloc( sizeof( invt_sesdesc_entry_t ) );
+	stok = (inv_sestoken_t) malloc(sizeof(invt_sesdesc_entry_t) );
 	stok->sd_invtok = tok;
 	stok->sd_session_off = stok->sd_sesshdr_off = -1;
 	stok->sd_sesstime = (time32_t) 0;
@@ -159,31 +159,31 @@ invmgr_query_all_sessions (
 	*outarg = NULL;
 	assert(inarg);
 
-	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
+	fd = fstab_getall(&arr, &cnt, &numfs, forwhat);
 	/* special case missing file: ok, outarg says zero */
-	if ( fd < 0 && errno == ENOENT ) {
+	if (fd < 0 && errno == ENOENT) {
 		return BOOL_TRUE;
 	}
-	if ( fd < 0 || numfs <= 0 ) {
-		mlog( MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n") );
+	if (fd < 0 || numfs <= 0) {
+		mlog(MLOG_NORMAL | MLOG_INV, _("INV: Error in fstab\n"));
 		return ret;
 	}
 
-	close( fd );
+	close(fd);
 
-	for ( i = 0; i < numfs; i++) {
-		if ( fstab_get_fname( &arr[i].ft_uuid, fname,
+	for (i = 0; i < numfs; i++) {
+		if (fstab_get_fname(&arr[i].ft_uuid, fname,
 				     (inv_predicate_t)INV_BY_UUID,
-				     forwhat) < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+				     forwhat) < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Cant get inv-name for uuid\n")
 			     );
 			continue;
 		}
-		strcat( fname, INV_INVINDEX_PREFIX );
-		invfd = open( fname, INV_OFLAG(forwhat) );
-		if ( invfd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_INV, _(
+		strcat(fname, INV_INVINDEX_PREFIX);
+		invfd = open(fname, INV_OFLAG(forwhat));
+		if (invfd < 0) {
+			mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Open failed on %s\n"),
 			     fname
 			     );
@@ -216,7 +216,7 @@ invmgr_query_all_sessions (
 /*----------------------------------------------------------------------*/
 /* search_invt                                                          */
 /*                                                                      */
-/* Used by the toplevel (inv layer ) to do common searches on the inven-*/
+/* Used by the toplevel (inv layer) to do common searches on the inven-*/
 /* tory. Caller supplies a callback routine that performs the real      */
 /* comparison/check.                                                    */
 /*----------------------------------------------------------------------*/
@@ -243,17 +243,17 @@ search_invt(
 	 * if no session found, the caller will expect to see
 	 * NULL.
 	 */
-	*( char ** )buf = NULL;
+	*(char **)buf = NULL;
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
 
-	free( icnt );
+	free(icnt);
 
 	/* we need to get all the invindex headers and seshdrs in reverse
 	   order */
@@ -263,25 +263,25 @@ search_invt(
 		invt_seshdr_t		*harr = NULL;
 		bool_t                  found;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY );
+		fd = open (iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
-			INV_PERROR( iarr[i].ie_filename );
+			INV_PERROR(iarr[i].ie_filename);
 			continue;
 		}
-		INVLOCK( fd, LOCK_SH );
+		INVLOCK(fd, LOCK_SH);
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+		if ((nsess = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)&harr,
 						  (void **)&scnt,
-						  sizeof( invt_seshdr_t ),
-						 sizeof( invt_sescounter_t ))
-		     ) < 0 ) {
-			INV_PERROR( iarr[i].ie_filename );
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
+						  sizeof(invt_seshdr_t),
+						 sizeof(invt_sescounter_t))
+		     ) < 0) {
+			INV_PERROR(iarr[i].ie_filename);
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
 			continue;
 		}
-		free ( scnt );
+		free (scnt);
 
 		for (j = nsess - 1; j >= 0; j--) {
 			invt_session_t ses;
@@ -311,18 +311,18 @@ search_invt(
 			}
 
 			found = (* do_chkcriteria)(fd, &harr[j], arg, buf);
-			if (! found ) continue;
+			if (! found) continue;
 
 			/* we found what we need; just return */
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
-			free( harr );
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
+			free(harr);
 
 			return found; /* == -1 or 1 */
 		}
 
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 	}
 
 	return 0;
@@ -353,66 +353,66 @@ invmgr_inv_print(
 		return 0;
 
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
 
-	free( icnt );
+	free(icnt);
 
 	if (prctx->invidx) {
-		idx_DEBUG_printinvindices( iarr, (uint) nindices );
+		idx_DEBUG_printinvindices(iarr, (uint) nindices);
 		free(iarr);
 		return (0);
 	}
 
 
 
-	for ( i = 0; i < nindices; i++ ) {
+	for (i = 0; i < nindices; i++) {
 		int 			nsess;
 		invt_sescounter_t 	*scnt = NULL;
 		invt_seshdr_t		*harr = NULL;
 		int                     s;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY );
+		fd = open (iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
-			INV_PERROR( iarr[i].ie_filename );
+			INV_PERROR(iarr[i].ie_filename);
 			continue;
 		}
-		INVLOCK( fd, LOCK_SH );
+		INVLOCK(fd, LOCK_SH);
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+		if ((nsess = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)&harr,
 						  (void **)&scnt,
-						  sizeof( invt_seshdr_t ),
-						 sizeof( invt_sescounter_t ))
-		     ) < 0 ) {
-			INV_PERROR( iarr[i].ie_filename );
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
+						  sizeof(invt_seshdr_t),
+						 sizeof(invt_sescounter_t))
+		     ) < 0) {
+			INV_PERROR(iarr[i].ie_filename);
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
 			continue;
 		}
-		free ( scnt );
-		for( s = 0; s < nsess; s++ ) {
+		free (scnt);
+		for(s = 0; s < nsess; s++) {
 			/* fd is kept locked until we return from the
 			   callback routine */
 
 			/* Check to see if this session has been pruned
 			 * by xfsinvutil before returning it.
 			 */
-			if ( harr[s].sh_pruned ) {
+			if (harr[s].sh_pruned) {
 				continue;
 			}
 
-			(void)DEBUG_displayallsessions( fd, &harr[ s ],
+			(void)DEBUG_displayallsessions(fd, &harr[s],
 						        ref++, prctx);
 		}
 
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 	}
 
 	free (iarr);
@@ -441,42 +441,42 @@ invmgr_inv_check(
 	if (invfd == I_EMPTYINV)
 		return 0;
 
-	if ( ( nindices = GET_ALLHDRS_N_CNTS( invfd, (void **)&iarr,
+	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
 					      (void **)&icnt,
-					      sizeof( invt_entry_t ),
-					      sizeof( invt_counter_t ))
-	      ) <= 0 ) {
+					      sizeof(invt_entry_t),
+					      sizeof(invt_counter_t))
+	      ) <= 0) {
 		return -1;
 	}
 
-	free( icnt );
+	free(icnt);
 
 
-	for ( i = 0; i < nindices; i++ ) {
+	for (i = 0; i < nindices; i++) {
 		int 			nsess;
 		invt_sescounter_t 	*scnt = NULL;
 		invt_seshdr_t		*harr = NULL;
 		int                     s;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY );
+		fd = open (iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
-			INV_PERROR( iarr[i].ie_filename );
+			INV_PERROR(iarr[i].ie_filename);
 			continue;
 		}
-		INVLOCK( fd, LOCK_SH );
+		INVLOCK(fd, LOCK_SH);
 
 		/* Now see if we can find the session we're looking for */
-		if (( nsess = GET_ALLHDRS_N_CNTS_NOLOCK( fd, (void **)&harr,
+		if ((nsess = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)&harr,
 						  (void **)&scnt,
-						  sizeof( invt_seshdr_t ),
-						 sizeof( invt_sescounter_t ))
-		     ) < 0 ) {
-			INV_PERROR( iarr[i].ie_filename );
-			INVLOCK( fd, LOCK_UN );
-			close( fd );
+						  sizeof(invt_seshdr_t),
+						 sizeof(invt_sescounter_t))
+		     ) < 0) {
+			INV_PERROR(iarr[i].ie_filename);
+			INVLOCK(fd, LOCK_UN);
+			close(fd);
 			continue;
 		}
-		free ( scnt );
+		free (scnt);
 
 		if ((iarr[i].ie_timeperiod.tp_start != harr[0].sh_time) ||
 		    (iarr[i].ie_timeperiod.tp_end != harr[nsess-1].sh_time)) {
@@ -485,7 +485,7 @@ invmgr_inv_check(
 			       i+1,
 			       iarr[i].ie_timeperiod.tp_start,
 			       iarr[i].ie_timeperiod.tp_end);
-			for( s = 0; s < nsess; s++ ) {
+			for(s = 0; s < nsess; s++) {
 				printf(_("tm (%d)\t%d\n"), s, harr[s].sh_time);
 			}
 		}
@@ -493,8 +493,8 @@ invmgr_inv_check(
 			printf(_("INV: Check %d out of %d succeeded\n"),
 			       i+1, nindices);
 		}
-		INVLOCK( fd, LOCK_UN );
-		close( fd );
+		INVLOCK(fd, LOCK_UN);
+		close(fd);
 	}
 
 	return 0;
@@ -509,20 +509,20 @@ invmgr_inv_check(
 
 /* ARGSUSED */
 bool_t
-tm_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
-		   void **tm )
+tm_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
+		   void **tm)
 {
 	u_char level = *(u_char *)arg;
 	*tm = NULL;
-	if ( IS_PARTIAL_SESSION( hdr ) )
+	if (IS_PARTIAL_SESSION(hdr) )
 		return 0;
-	if (hdr->sh_level < level ) {
+	if (hdr->sh_level < level) {
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level,
-		     level );
+		mlog(MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level,
+		     level);
 #endif
-		*tm = calloc( 1, sizeof( time32_t ) );
-		memcpy( *tm, &hdr->sh_time, sizeof( time32_t ) );
+		*tm = calloc(1, sizeof(time32_t) );
+		memcpy(*tm, &hdr->sh_time, sizeof(time32_t) );
 		return 1;
 	}
 	return 0;
@@ -538,19 +538,19 @@ tm_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
 /*----------------------------------------------------------------------*/
 
 bool_t
-lastsess_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
-			 void **buf )
+lastsess_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
+			 void **buf)
 {
 	u_char level = *(u_char *)arg;
 	*buf = NULL;
-	if ( IS_PARTIAL_SESSION( hdr ) )
+	if (IS_PARTIAL_SESSION(hdr) )
 		return 0;
-	if (hdr->sh_level < level ) {
+	if (hdr->sh_level < level) {
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d < %d \n",
-		     hdr->sh_level, level );
+		mlog(MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d < %d \n",
+		     hdr->sh_level, level);
 #endif
-		return stobj_make_invsess( fd, (inv_session_t **) buf, hdr );
+		return stobj_make_invsess(fd, (inv_session_t **) buf, hdr);
 	}
 	return 0;
 
@@ -565,19 +565,19 @@ lastsess_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
 /*----------------------------------------------------------------------*/
 
 bool_t
-lastsess_level_equalto( int fd, invt_seshdr_t *hdr,
-		       void *arg, void **buf )
+lastsess_level_equalto(int fd, invt_seshdr_t *hdr,
+		       void *arg, void **buf)
 {
 	u_char level = *(u_char *)arg;
 	*buf = NULL;
-	if ( IS_PARTIAL_SESSION( hdr ) )
+	if (IS_PARTIAL_SESSION(hdr) )
 		return 0;
-	if (hdr->sh_level == level ) {
+	if (hdr->sh_level == level) {
 #ifdef INVT_DEBUG
-	mlog( MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d == %d \n", hdr->sh_level,
-	     level );
+	mlog(MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d == %d \n", hdr->sh_level,
+	     level);
 #endif
-		return stobj_make_invsess( fd, (inv_session_t **) buf, hdr );
+		return stobj_make_invsess(fd, (inv_session_t **) buf, hdr);
 	}
 	return 0;
 
@@ -596,7 +596,7 @@ lastsess_level_equalto( int fd, invt_seshdr_t *hdr,
 /* this is used in reconstructing the database.                         */
 /*----------------------------------------------------------------------*/
 bool_t
-insert_session( invt_sessinfo_t *s)
+insert_session(invt_sessinfo_t *s)
 {
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
 	int invfd, stobjfd = -1;
@@ -605,21 +605,21 @@ insert_session( invt_sessinfo_t *s)
 	inv_oflag_t       forwhat = INV_SEARCH_N_MOD;
 
 	/* initialize the inventory */
-	if ( ( invfd = init_idb ( (void *) s->ses->s_fsid,
+	if ((invfd = init_idb ((void *) s->ses->s_fsid,
 				  (inv_predicate_t) INV_BY_UUID,
  				  forwhat,
-				  &tok ) ) < 0 ) {
-		if ( tok == INV_TOKEN_NULL ) {
+				  &tok) ) < 0) {
+		if (tok == INV_TOKEN_NULL) {
 #ifdef INVT_DEBUG
-			mlog( MLOG_DEBUG | MLOG_INV, "INV: insert_session: init_db "
-			      "failed\n" );
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: insert_session: init_db "
+			      "failed\n");
 #endif
 			return BOOL_FALSE;
 		}
 
 		invfd = tok->d_invindex_fd;
-		close( tok->d_stobj_fd );
-		destroy_token( tok );
+		close(tok->d_stobj_fd);
+		destroy_token(tok);
 	}
 
 	/* at this point we know that invindex has at least one entry
@@ -629,33 +629,33 @@ insert_session( invt_sessinfo_t *s)
 	   contain this session, it suffices to sequentially search the
 	   inventory indices of this filesystem for the particular invt-entry
 	 */
-	INVLOCK( invfd, LOCK_EX );
+	INVLOCK(invfd, LOCK_EX);
 	idx.invfd = invfd;
-	stobjfd = idx_find_stobj( &idx, s->seshdr->sh_time );
+	stobjfd = idx_find_stobj(&idx, s->seshdr->sh_time);
 	if (stobjfd < 0) {
-		INVLOCK( invfd, LOCK_UN );
-		free( idx.icnt );
-		free( idx.iarr );
+		INVLOCK(invfd, LOCK_UN);
+		free(idx.icnt);
+		free(idx.iarr);
 		return BOOL_FALSE;
 	}
 
 	/* Now put the session in the storage-object */
-	INVLOCK( stobjfd, LOCK_EX );
-	if ( ( stobj_insert_session( &idx, stobjfd, s ) < 0 ) ||
-		( idx_recons_time ( s->seshdr->sh_time, &idx ) < 0 ) )
+	INVLOCK(stobjfd, LOCK_EX);
+	if ((stobj_insert_session(&idx, stobjfd, s) < 0) ||
+		(idx_recons_time (s->seshdr->sh_time, &idx) < 0) )
 			ret = BOOL_TRUE;
 
-	INVLOCK( stobjfd, LOCK_UN );
-	INVLOCK( invfd, LOCK_UN );
+	INVLOCK(stobjfd, LOCK_UN);
+	INVLOCK(invfd, LOCK_UN);
 
-	free( idx.icnt );
-	free( idx.iarr );
+	free(idx.icnt);
+	free(idx.iarr);
 
 	if (ret) return BOOL_FALSE;
 
 	/* make sure the fstab is uptodate too */
-	if ( fstab_put_entry( &s->ses->s_fsid, s->ses->s_mountpt, s->ses->s_devpath,
-			      forwhat ) < 0 )
+	if (fstab_put_entry(&s->ses->s_fsid, s->ses->s_mountpt, s->ses->s_devpath,
+			      forwhat) < 0)
 		return BOOL_FALSE;
 
 	/* and we are done */
@@ -672,82 +672,82 @@ insert_session( invt_sessinfo_t *s)
 /*----------------------------------------------------------------------*/
 
 int
-make_invdirectory( inv_oflag_t forwhat )
+make_invdirectory(inv_oflag_t forwhat)
 {
 	struct stat64 st;
 	char path[PATH_MAX];
 	char *p;
 
-	p = strcpy( path, INV_DIRPATH );
+	p = strcpy(path, INV_DIRPATH);
 
-	if ( stat64( path, &st ) == 0 )
+	if (stat64(path, &st) == 0)
 		return 1;
 
-	if ( forwhat == INV_SEARCH_ONLY || errno != ENOENT )
+	if (forwhat == INV_SEARCH_ONLY || errno != ENOENT)
 		return -1;
 
 	do {
 		p++;
-		if ( *p == '/' ) {
+		if (*p == '/') {
 			*p = '\0';
-			if ( mkdir( path, (mode_t)0755 ) < 0 ) {
-				if ( errno != EEXIST ) {
-					INV_PERROR( path );
+			if (mkdir(path, (mode_t)0755) < 0) {
+				if (errno != EEXIST) {
+					INV_PERROR(path);
 					return -1;
 				}
 			}
 			*p = '/';
 		}
-	} while ( *p );
+	} while (*p);
 
-	if ( mkdir( path, (mode_t)0755 ) < 0 ) {
-		if ( errno != EEXIST ) {
-			INV_PERROR( path );
+	if (mkdir(path, (mode_t)0755) < 0) {
+		if (errno != EEXIST) {
+			INV_PERROR(path);
 			return -1;
 		}
 	}
 
-	mlog( MLOG_VERBOSE | MLOG_INV, _("%s created\n"), path );
+	mlog(MLOG_VERBOSE | MLOG_INV, _("%s created\n"), path);
 	return 1;
 }
 
 #ifdef NOTDEF
 
 bool_t
-invmgr_lockinit( void )
+invmgr_lockinit(void)
 {
-	if ( invlock_fd == -1 ) {
-		if (( invlock_fd = open( INV_LOCKFILE,
-					O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
-			INV_PERROR( INV_LOCKFILE );
+	if (invlock_fd == -1) {
+		if ((invlock_fd = open(INV_LOCKFILE,
+					O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+			INV_PERROR(INV_LOCKFILE);
 			return BOOL_FALSE;
 		}
-		fchmod ( invlock_fd, INV_PERMS );
+		fchmod (invlock_fd, INV_PERMS);
 	}
 	return BOOL_TRUE;
 }
 
 
 bool_t
-invmgr_trylock( invt_mode_t mode )
+invmgr_trylock(invt_mode_t mode)
 {
 	int md;
-	assert( invlock_fd >= 0 );
+	assert(invlock_fd >= 0);
 
 	md = (mode == INVT_RECONSTRUCT) ? LOCK_EX: LOCK_SH;
 
-	if (INVLOCK( invlock_fd, md | LOCK_NB ) < 0)
+	if (INVLOCK(invlock_fd, md | LOCK_NB) < 0)
 		return BOOL_FALSE;
 
 	return BOOL_TRUE;
 }
 
 void
-invmgr_unlock( void )
+invmgr_unlock(void)
 {
-	assert( invlock_fd >= 0 );
+	assert(invlock_fd >= 0);
 
-	INVLOCK( invlock_fd, LOCK_UN );
+	INVLOCK(invlock_fd, LOCK_UN);
 
 }
 
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 56ac5e5..70fc634 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -269,7 +269,7 @@ _oref_free(
 	 */
 	OREF_UNLOCK(obj);
 
-	if (OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ) ){
+	if (OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ)){
 		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_sescnt);
 		if (OREF_ISRESOLVED(obj, INVT_RES_HDRS))
@@ -311,8 +311,8 @@ oref_resolve(
 	inv_predicate_t bywhat,
 	void 		*pred)
 {
-	char 		fname[ INV_STRLEN ];
-	char 		uuname[ INV_STRLEN ];
+	char 		fname[INV_STRLEN];
+	char 		uuname[INV_STRLEN];
 	int 		fd;
 	invt_oref_t	*stobj;
 	int		index;
@@ -358,13 +358,13 @@ oref_resolve(
 		return INV_ERR;
 	}
 
-	/* create another storage object ( and, an inv_index entry for it
-	   too ) if we've filled this one up */
+	/* create another storage object (and, an inv_index entry for it
+	   too) if we've filled this one up */
 	if (OREF_CNT_CURNUM(stobj) >= OREF_CNT_MAXNUM(stobj)) {
 		int 	rval;
 #ifdef INVT_DEBUG
-		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
-		      "index entry. \n" );
+		mlog(MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
+		      "index entry. \n");
 #endif
 		/* Close(), Destroy() and mark unresolved */
 		OREF_UNRESOLVE_CHILD(invidx);
@@ -405,12 +405,12 @@ oref_resolve_child(
 
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	assert ( ent != NULL );
-	assert ( ent->ie_filename );
+	assert (ent != NULL);
+	assert (ent->ie_filename);
 
-	fd = open( ent->ie_filename, O_RDWR );
-	if ( fd < 0 ) {
-		INV_PERROR( ent->ie_filename );
+	fd = open(ent->ie_filename, O_RDWR);
+	if (fd < 0) {
+		INV_PERROR(ent->ie_filename);
 		return INV_ERR;
 	}
 
@@ -432,8 +432,8 @@ oref_resolve_new_invidx(
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
-	if ((fd = open ( fname , O_RDWR | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
-		INV_PERROR ( fname );
+	if ((fd = open (fname , O_RDWR | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
+		INV_PERROR (fname);
 		return INV_ERR;
 	}
 	invidx->fd = fd;
@@ -441,7 +441,7 @@ oref_resolve_new_invidx(
 	fchmod(fd, INV_PERMS);
 
 #ifdef INVT_DEBUG
-	mlog( MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
+	mlog(MLOG_NITTY | MLOG_INV, "creating InvIndex %s\n", fname);
 #endif
 	/* create the new stobj as its first entry */
 	rval = oref_resolve_new_stobj(invidx, IS_EMPTY);
@@ -467,15 +467,15 @@ oref_resolve_new_stobj(
 
 	assert(OREF_ISLOCKED(invidx));
 
-	memset ( &ent, 0, sizeof( ent ) );
+	memset (&ent, 0, sizeof(ent) );
 	stobj = calloc(1, sizeof(invt_oref_t));
 	OREF_SET_CHILD(invidx, stobj);
 
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
-	stobj_makefname( ent.ie_filename );
+	stobj_makefname(ent.ie_filename);
 
-	if ( firstentry ) {
+	if (firstentry) {
 		invt_counter_t *cnt;
 		cnt = malloc(sizeof(invt_counter_t));
 
@@ -483,8 +483,8 @@ oref_resolve_new_stobj(
 		cnt->ic_curnum = 1;
 		cnt->ic_vernum = INV_VERSION;
 
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			free(cnt);
 			return INV_ERR;
 		}
@@ -501,8 +501,8 @@ oref_resolve_new_stobj(
 			return INV_ERR;
 
 		/* create the new storage object */
-		fd = stobj_create( ent.ie_filename );
-		if ( fd < 0 ) {
+		fd = stobj_create(ent.ie_filename);
+		if (fd < 0) {
 			return -1;
 		}
 
@@ -516,7 +516,7 @@ oref_resolve_new_stobj(
 			return INV_ERR;
 
 	}
-	tok = get_token( invfd, fd );
+	tok = get_token(invfd, fd);
 	tok->d_invindex_off = IDX_HDR_OFFSET(OREF_CNT_CURNUM(invidx) - 1);
 	tok->d_update_flag |= NEW_INVINDEX;
 
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 0061722..836ce82 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -120,7 +120,7 @@ typedef struct invt_oref {
  * For locking/unlocking orefs - mode { LOCK_SH, LOCK_EX, LOCK_UN }
  */
 
-#define OREF_LOCKMODE_EQL(oref, mode) ((oref)->lockflag == mode )
+#define OREF_LOCKMODE_EQL(oref, mode) ((oref)->lockflag == mode)
 #define OREF_ISLOCKED(oref)	      ((oref)->lockflag == 0 ||
 				       (oref)->lockflag == LOCK_UN)
 
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index ed50782..7199920 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -47,11 +47,11 @@
 #define FSTAB_UPDATED		1
 #define NEW_INVINDEX		2
 
-/* session flags ( seshdr.sh_flag ) */
+/* session flags (seshdr.sh_flag) */
 #define INVT_PARTIAL		(uint)0x0001
 #define INVT_RESUMED            (uint)0x0002
 
-/* media file flags ( mfile.mf_flag ) */
+/* media file flags (mfile.mf_flag) */
 #define INVT_MFILE_GOOD         (u_char)0x01
 #define INVT_MFILE_INVDUMP      (u_char)0x02
 
@@ -60,7 +60,7 @@
 #define INVT_DOLOCK		BOOL_TRUE
 #define INVT_DONTLOCK		BOOL_FALSE
 
-#define INVLOCK( fd, m )	flock( fd, m )
+#define INVLOCK(fd, m)	flock(fd, m)
 
 /* return values */
 #define INV_OK			(int) 1
@@ -75,27 +75,27 @@
 
 #define INV_PERMS               S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-#define IS_WITHIN(ttpe, tm)	( tm >= (ttpe)->tp_start && \
-				  tm <= (ttpe)->tp_end )
-#define IDX_HDR_OFFSET(n) 	(off64_t) ( sizeof( invt_entry_t ) * \
+#define IS_WITHIN(ttpe, tm)	(tm >= (ttpe)->tp_start && \
+				  tm <= (ttpe)->tp_end)
+#define IDX_HDR_OFFSET(n) 	(off64_t) (sizeof(invt_entry_t) * \
 					   (size_t) (n)\
-					   + sizeof( invt_counter_t ) )
-#define STOBJ_OFFSET( nhdrs, nsess ) (off64_t) ( \
-			       sizeof( invt_sescounter_t ) + \
-			       (size_t) nhdrs * sizeof( invt_seshdr_t ) + \
-			       (size_t) nsess * sizeof( invt_session_t ) )
-
-#define STREQL( n,m )		( strcmp((n),(m)) == 0 )
-#define UUID_EQL( n,m,t )	( uuid_compare( n, m, t ) == 0 )
-#define IS_PARTIAL_SESSION( h ) ( (h)->sh_flag & INVT_PARTIAL )
-#define IS_RESUMED_SESSION( h ) ( (h)->sh_flag & INVT_RESUMED )
-#define SC_EOF_INITIAL_POS	(off64_t) (sizeof( invt_sescounter_t ) + \
+					   + sizeof(invt_counter_t) )
+#define STOBJ_OFFSET(nhdrs, nsess) (off64_t) (\
+			       sizeof(invt_sescounter_t) + \
+			       (size_t) nhdrs * sizeof(invt_seshdr_t) + \
+			       (size_t) nsess * sizeof(invt_session_t) )
+
+#define STREQL(n,m)		(strcmp((n),(m)) == 0)
+#define UUID_EQL(n,m,t)	(uuid_compare(n, m, t) == 0)
+#define IS_PARTIAL_SESSION(h) ((h)->sh_flag & INVT_PARTIAL)
+#define IS_RESUMED_SESSION(h) ((h)->sh_flag & INVT_RESUMED)
+#define SC_EOF_INITIAL_POS	(off64_t) (sizeof(invt_sescounter_t) + \
 					 INVT_STOBJ_MAXSESSIONS * \
-					 ( sizeof( invt_seshdr_t ) + \
-					   sizeof( invt_session_t ) ) )
+					 (sizeof(invt_seshdr_t) + \
+					   sizeof(invt_session_t) ))
 
-#define INV_PERROR(s)  	mlog( MLOG_NORMAL,"INV: %s %s\n", s,strerror(errno) )
-#define INV_OFLAG(f)    ( f == INV_SEARCH_ONLY ) ? O_RDONLY: O_RDWR
+#define INV_PERROR(s)  	mlog(MLOG_NORMAL,"INV: %s %s\n", s,strerror(errno))
+#define INV_OFLAG(f)    (f == INV_SEARCH_ONLY) ? O_RDONLY: O_RDWR
 
 /*----------------------------------------------------------------------*/
 /* On Disk Data Structures                                              */
@@ -200,8 +200,8 @@ typedef struct invt_sescounter {
 	INVT_COUNTER_FIELDS
 	off64_t	       ic_eof;   /* current end of the file, where the next
 				 media file or stream will be written to */
-	char 	       ic_padding[0x20 - ( INVT_COUNTER_FIELDS_SIZE +
-					   sizeof( off64_t) )];
+	char 	       ic_padding[0x20 - (INVT_COUNTER_FIELDS_SIZE +
+					   sizeof(off64_t))];
 } invt_sescounter_t;
 
 
@@ -297,41 +297,41 @@ typedef struct invt_pr_ctx {
 typedef bool_t (*search_callback_t) (int, invt_seshdr_t *, void *, void *);
 
 
-#define GET_REC( fd, buf, sz, off )  \
-                 get_invtrecord( fd, buf, sz, off, INVT_DOLOCK )
+#define GET_REC(fd, buf, sz, off)  \
+                 get_invtrecord(fd, buf, sz, off, INVT_DOLOCK)
 
-#define GET_REC_NOLOCK( fd, buf, sz, off )  \
-                 get_invtrecord( fd, buf, sz, off, INVT_DONTLOCK )
+#define GET_REC_NOLOCK(fd, buf, sz, off)  \
+                 get_invtrecord(fd, buf, sz, off, INVT_DONTLOCK)
 
-#define GET_ALLHDRS_N_CNTS( fd, h, c, hsz, csz ) \
-                 get_headerinfo( fd, h, c, hsz, csz, INVT_DOLOCK )
+#define GET_ALLHDRS_N_CNTS(fd, h, c, hsz, csz) \
+                 get_headerinfo(fd, h, c, hsz, csz, INVT_DOLOCK)
 
-#define GET_ALLHDRS_N_CNTS_NOLOCK( fd, h, c, hsz, csz ) \
-                 get_headerinfo( fd, h, c, hsz, csz, INVT_DONTLOCK )
+#define GET_ALLHDRS_N_CNTS_NOLOCK(fd, h, c, hsz, csz) \
+                 get_headerinfo(fd, h, c, hsz, csz, INVT_DONTLOCK)
 
-#define PUT_REC( fd, buf, sz, off )  \
-                 put_invtrecord( fd, buf, sz, off, INVT_DOLOCK )
+#define PUT_REC(fd, buf, sz, off)  \
+                 put_invtrecord(fd, buf, sz, off, INVT_DOLOCK)
 
-#define PUT_REC_NOLOCK( fd, buf, sz, off )  \
-                 put_invtrecord( fd, buf, sz, off, INVT_DONTLOCK )
+#define PUT_REC_NOLOCK(fd, buf, sz, off)  \
+                 put_invtrecord(fd, buf, sz, off, INVT_DONTLOCK)
 
 
-#define GET_COUNTERS( fd, cnt ) get_counters( fd, (void **)(cnt), \
-					      sizeof(invt_counter_t) )
-#define GET_SESCOUNTERS( fd, cnt ) get_counters( fd, (void **)(cnt), \
-						sizeof(invt_sescounter_t) )
+#define GET_COUNTERS(fd, cnt) get_counters(fd, (void **)(cnt), \
+					      sizeof(invt_counter_t))
+#define GET_SESCOUNTERS(fd, cnt) get_counters(fd, (void **)(cnt), \
+						sizeof(invt_sescounter_t))
 
-#define PUT_COUNTERS( fd, cnt ) PUT_REC_NOLOCK( fd, (void *)(cnt), \
-					     sizeof( invt_counter_t ), \
-					     (off64_t) 0 )
+#define PUT_COUNTERS(fd, cnt) PUT_REC_NOLOCK(fd, (void *)(cnt), \
+					     sizeof(invt_counter_t), \
+					     (off64_t) 0)
 
-#define PUT_SESCOUNTERS( fd, cnt )  PUT_REC_NOLOCK( fd, (void *)(cnt), \
-					     sizeof( invt_sescounter_t ), \
-					     (off64_t) 0 )
+#define PUT_SESCOUNTERS(fd, cnt)  PUT_REC_NOLOCK(fd, (void *)(cnt), \
+					     sizeof(invt_sescounter_t), \
+					     (off64_t) 0)
 
-#define GET_SESHEADERS( fd, hdrs, n ) get_headers( fd, (void**)(hdrs), \
-				   (size_t) ( n * sizeof(invt_seshdr_t ) ),\
-				          sizeof( invt_sescounter_t )  )
+#define GET_SESHEADERS(fd, hdrs, n) get_headers(fd, (void**)(hdrs), \
+				   (size_t) (n * sizeof(invt_seshdr_t) ),\
+				          sizeof(invt_sescounter_t)  )
 
 #define GET_ENTRIES(fd, hdrs, n, sz) get_headers(fd, (void**)(hdrs), \
 				   (size_t) (n * sz), sizeof(invt_counter_t))
@@ -345,48 +345,48 @@ typedef bool_t (*search_callback_t) (int, invt_seshdr_t *, void *, void *);
 
 /*----------------------------------------------------------------------*/
 inv_idbtoken_t
-idx_create( char *fname, inv_oflag_t forwhat );
+idx_create(char *fname, inv_oflag_t forwhat);
 
 int
-idx_create_entry( inv_idbtoken_t *tok, int invfd, bool_t firstentry );
+idx_create_entry(inv_idbtoken_t *tok, int invfd, bool_t firstentry);
 
 int
-idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime);
+idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime);
 
 
 int
-idx_find_stobj( invt_idxinfo_t *idx, time32_t tm );
+idx_find_stobj(invt_idxinfo_t *idx, time32_t tm);
 
 uint
-idx_insert_newentry( int fd, int *stobjfd, invt_entry_t *iarr,
+idx_insert_newentry(int fd, int *stobjfd, invt_entry_t *iarr,
 		     invt_counter_t *icnt,
-		     time32_t tm );
+		     time32_t tm);
 int
-idx_put_newentry( invt_idxinfo_t *idx, invt_entry_t *ient );
+idx_put_newentry(invt_idxinfo_t *idx, invt_entry_t *ient);
 
 int
-idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index );
+idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index);
 
 int
-idx_recons_time( time32_t tm, invt_idxinfo_t *idx );
+idx_recons_time(time32_t tm, invt_idxinfo_t *idx);
 
 int
-idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num );
+idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num);
 
 int
-idx_DEBUG_print ( int fd );
+idx_DEBUG_print (int fd);
 
 /*----------------------------------------------------------------------*/
 
 int
-stobj_create( char *fname );
+stobj_create(char *fname);
 
 int
-stobj_create_session( inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt,
-		      invt_session_t *ses, invt_seshdr_t *hdr );
+stobj_create_session(inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt,
+		      invt_session_t *ses, invt_seshdr_t *hdr);
 
 int
-stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf );
+stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf);
 
 off64_t
 stobj_put_session(
@@ -395,73 +395,73 @@ stobj_put_session(
 	invt_session_t *ses,
 	invt_seshdr_t *hdr,
 	invt_stream_t *strms,
-	invt_mediafile_t *mfiles );
+	invt_mediafile_t *mfiles);
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
-		   invt_mediafile_t *mfiles );
+		   invt_mediafile_t *mfiles);
 
 int
-stobj_hdrcmp( const void *h1, const void *h2 );
+stobj_hdrcmp(const void *h1, const void *h2);
 
 int
-stobj_sortheaders( int fd, uint num );
+stobj_sortheaders(int fd, uint num);
 
 uint
-stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm );
+stobj_find_splitpoint(int fd, invt_seshdr_t *harr, uint ns, time32_t tm);
 
 int
-stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
-	     invt_sessinfo_t *newsess );
+stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
+	     invt_sessinfo_t *newsess);
 bool_t
-stobj_replace_session( int fd, invt_sescounter_t *sescnt, invt_session_t *ses,
-		       invt_seshdr_t *hdr, invt_sessinfo_t *newsess );
+stobj_replace_session(int fd, invt_sescounter_t *sescnt, invt_session_t *ses,
+		       invt_seshdr_t *hdr, invt_sessinfo_t *newsess);
 
 int
-stobj_delete_mfile( int fd, inv_stream_t *strm, invt_mediafile_t *mf,
-		    off64_t  mfileoff );
+stobj_delete_mfile(int fd, inv_stream_t *strm, invt_mediafile_t *mf,
+		    off64_t  mfileoff);
 
 bool_t
-stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
-		     void  **bufpp, size_t *bufszp );
+stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
+		     void  **bufpp, size_t *bufszp);
 
 bool_t
 stobj_unpack_sessinfo(
         void              *bufp,
         size_t             bufsz,
-	invt_sessinfo_t   *s );
+	invt_sessinfo_t   *s);
 
 bool_t
-stobj_delete_sessinfo( int fd, invt_sescounter_t *sescnt,
-		       invt_session_t *ses, invt_seshdr_t *hdr );
+stobj_delete_sessinfo(int fd, invt_sescounter_t *sescnt,
+		       invt_session_t *ses, invt_seshdr_t *hdr);
 
 bool_t
-stobj_delete_mobj( int fd, invt_seshdr_t *hdr, void *arg,
-		   void **buf );
+stobj_delete_mobj(int fd, invt_seshdr_t *hdr, void *arg,
+		   void **buf);
 
 int
-stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses );
+stobj_get_sessinfo (inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses);
 
 void
-stobj_makefname( char *fname );
+stobj_makefname(char *fname);
 
 int
-stobj_insert_session( invt_idxinfo_t *idx, int fd,
-		      invt_sessinfo_t *s );
+stobj_insert_session(invt_idxinfo_t *idx, int fd,
+		      invt_sessinfo_t *s);
 
 int
-stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr );
+stobj_make_invsess(int fd, inv_session_t **buf, invt_seshdr_t *hdr);
 
 int
-stobj_copy_invsess( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_copy_invsess(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		    inv_session_t **buf);
 
 void
-DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx);
+DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx);
 
 void
-DEBUG_sessprint( invt_session_t *ses );
+DEBUG_sessprint(invt_session_t *ses);
 
 bool_t
 stobj_getsession_byuuid(int fd, invt_seshdr_t *hdr, void *sesid, void **buf);
@@ -486,57 +486,57 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo);
 /*----------------------------------------------------------------------*/
 
 int
-fstab_get_fname( void *pred, char *fname, inv_predicate_t bywhat,
-		 inv_oflag_t forwhat );
+fstab_get_fname(void *pred, char *fname, inv_predicate_t bywhat,
+		 inv_oflag_t forwhat);
 
 int
-fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat );
+fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat);
 
 int
-fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
-	      inv_oflag_t forwhat );
+fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
+	      inv_oflag_t forwhat);
 
 void
-fstab_DEBUG_print( invt_fstab_t *arr, int num );
+fstab_DEBUG_print(invt_fstab_t *arr, int num);
 
 
 /*----------------------------------------------------------------------*/
 
 int
-get_invtentry( char *fname, time32_t tm, invt_entry_t *buf, size_t bufsz );
+get_invtentry(char *fname, time32_t tm, invt_entry_t *buf, size_t bufsz);
 
 int
-get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock );
+get_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock);
 
 int
-put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock );
+put_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock);
 
 inv_idbtoken_t
-get_token( int fd, int objfd );
+get_token(int fd, int objfd);
 
 void
-destroy_token( inv_idbtoken_t tok );
+destroy_token(inv_idbtoken_t tok);
 
 
 int
-get_headers( int fd, void **hdrs, size_t bufsz, size_t cntsz );
+get_headers(int fd, void **hdrs, size_t bufsz, size_t cntsz);
 
 int
-get_counters( int fd, void **cntpp, size_t sz );
+get_counters(int fd, void **cntpp, size_t sz);
 
 int
-get_sescounters( int fd, invt_sescounter_t **cntpp );
+get_sescounters(int fd, invt_sescounter_t **cntpp);
 
 int
-get_lastheader( int fd, void **ent, size_t hdrsz,  size_t cntsz );
+get_lastheader(int fd, void **ent, size_t hdrsz,  size_t cntsz);
 
 
 inv_sestoken_t
-get_sesstoken( inv_idbtoken_t tok );
+get_sesstoken(inv_idbtoken_t tok);
 
 int
-get_headerinfo( int fd, void **hdrs, void **cnt,
-	        size_t hdrsz, size_t cntsz, bool_t doblock );
+get_headerinfo(int fd, void **hdrs, void **cnt,
+	        size_t hdrsz, size_t cntsz, bool_t doblock);
 
 bool_t
 invmgr_query_all_sessions(uuid_t *fsidp, void *inarg, void **outarg,
@@ -546,42 +546,42 @@ int
 search_invt(uuid_t *fsidp, int invfd, void *arg, void **buf,
 	    search_callback_t do_chkcriteria);
 int
-invmgr_inv_print( int invfd, invt_pr_ctx_t *prctx);
+invmgr_inv_print(int invfd, invt_pr_ctx_t *prctx);
 
 int
-invmgr_inv_check( int invfd );
+invmgr_inv_check(int invfd);
 
 bool_t
-tm_level_lessthan( int fd, invt_seshdr_t *hdr, void *arg,
-		   void **tm );
+tm_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
+		   void **tm);
 
 bool_t
-lastsess_level_lessthan( int fd, invt_seshdr_t *hdr,  void *arg,
-			 void **buf );
+lastsess_level_lessthan(int fd, invt_seshdr_t *hdr,  void *arg,
+			 void **buf);
 
 bool_t
-lastsess_level_equalto( int fd, invt_seshdr_t *hdr,  void *arg, void **buf );
+lastsess_level_equalto(int fd, invt_seshdr_t *hdr,  void *arg, void **buf);
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
+DEBUG_displayallsessions(int fd, invt_seshdr_t *hdr, uint ref,
 			  invt_pr_ctx_t *prctx);
 
 int
-make_invdirectory( inv_oflag_t forwhat );
+make_invdirectory(inv_oflag_t forwhat);
 
 bool_t
-init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
-	 inv_idbtoken_t *tok );
+init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
+	 inv_idbtoken_t *tok);
 
 int
-inv_getopt( int argc, char **argv, invt_pr_ctx_t *prctx);
+inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx);
 
 bool_t
-insert_session( invt_sessinfo_t *s);
+insert_session(invt_sessinfo_t *s);
 
 /* To reconstruct a complete inventory from dumped inventories */
 extern bool_t
-inv_put_sessioninfo( invt_sessinfo_t *s );
+inv_put_sessioninfo(invt_sessinfo_t *s);
 
 
 #endif
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 25df2fe..235e621 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -49,67 +49,67 @@
 /* storage object whether or not it has reached its maximum.            */
 /*----------------------------------------------------------------------*/
 int
-stobj_insert_session( invt_idxinfo_t *idx,
+stobj_insert_session(invt_idxinfo_t *idx,
 		      int fd, /* kept locked EX by caller */
-		      invt_sessinfo_t *s )
+		      invt_sessinfo_t *s)
 {
 	invt_sescounter_t *sescnt = NULL;
 
-	if ( GET_SESCOUNTERS( fd, &sescnt ) < 0 ) {
-		INVLOCK( fd, LOCK_UN );
+	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
+		INVLOCK(fd, LOCK_UN);
 		return -1;
 	}
 
 	/* Check the existing sessions to make sure that we're not
 	   duplicating this session */
-	if ( sescnt->ic_curnum > 0 ) {
+	if (sescnt->ic_curnum > 0) {
 		uint i;
-		invt_session_t	*sessions = calloc( sescnt->ic_curnum,
-				   sizeof( invt_session_t ) );
-		if ( GET_REC_NOLOCK( fd, sessions, sescnt->ic_curnum *
-				     sizeof( invt_session_t ),
-				     (off64_t) ( sizeof( *sescnt ) +
-         		sescnt->ic_maxnum * sizeof( invt_seshdr_t ))) < 0 ) {
-			free ( sescnt );
-			free ( sessions );
+		invt_session_t	*sessions = calloc(sescnt->ic_curnum,
+				   sizeof(invt_session_t) );
+		if (GET_REC_NOLOCK(fd, sessions, sescnt->ic_curnum *
+				     sizeof(invt_session_t),
+				     (off64_t) (sizeof(*sescnt) +
+         		sescnt->ic_maxnum * sizeof(invt_seshdr_t))) < 0) {
+			free (sescnt);
+			free (sessions);
 			return -1;
 		}
 
-		for( i = 0; i <  sescnt->ic_curnum; i++ ) {
-			if ( uuid_compare( sessions[i].s_sesid,
-					   s->ses->s_sesid ) == 0 )
+		for(i = 0; i <  sescnt->ic_curnum; i++) {
+			if (uuid_compare(sessions[i].s_sesid,
+					   s->ses->s_sesid) == 0)
 				break;
 
 		}
-		free ( sessions );
-		if ( i < sescnt->ic_curnum ) {
-			mlog( MLOG_DEBUG | MLOG_INV,
+		free (sessions);
+		if (i < sescnt->ic_curnum) {
+			mlog(MLOG_DEBUG | MLOG_INV,
 			      "INV: attempt to insert an "
 			      "existing session.\n"
 			     );
-			free ( sescnt );
+			free (sescnt);
 			return 1;
 		}
 
 	}
 
-	if ( sescnt->ic_curnum >= sescnt->ic_maxnum ) {
-		if ( stobj_split( idx, fd, sescnt, s ) < 0 ) {
-			free( sescnt );
+	if (sescnt->ic_curnum >= sescnt->ic_maxnum) {
+		if (stobj_split(idx, fd, sescnt, s) < 0) {
+			free(sescnt);
 			return -1;
 		}
-		free( sescnt );
+		free(sescnt);
 		return 1;
 
 	}
 
-	if ( stobj_put_session( fd, sescnt, s->ses, s->seshdr, s->strms,
-			        s->mfiles ) < 0 ){
-		free ( sescnt);
+	if (stobj_put_session(fd, sescnt, s->ses, s->seshdr, s->strms,
+			        s->mfiles) < 0){
+		free (sescnt);
 		return -1;
 	}
 
-	free ( sescnt);
+	free (sescnt);
 	return 1;
 }
 
@@ -125,16 +125,16 @@ 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,21 +1047,21 @@ 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);
+		      " %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);
 		}
 	}
 }
diff --git a/inventory/inventory.h b/inventory/inventory.h
index 076b83e..ad27205 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -189,12 +189,12 @@ 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 */
diff --git a/inventory/testmain.c b/inventory/testmain.c
index e43e392..c4003fd 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -52,28 +52,28 @@ static char *dev_str[] = { "/dev/usr/lib", "/dev/usr", "/dev/u/sw/courses",
 
 typedef enum { BULL = -1, WRI, REC, QUE, DEL, MP, QUE2 } hi;
 
-void usage( void );
+void usage(void);
 char *progname;
 char *sesfile;
 
 
 void
-CREAT_mfiles( inv_stmtoken_t tok, uuid_t *moid, ino_t f, ino_t n )
+CREAT_mfiles(inv_stmtoken_t tok, uuid_t *moid, ino_t f, ino_t n)
 {
 	uuid_t labelid;
 	char label[128], strbuf[20];
 	char *str;
 	unsigned int stat;
 
-	uuid_create( &labelid, &stat );
-	uuid_to_string( &labelid, &str, &stat );
-	strncpy( strbuf, str, 8 );
+	uuid_create(&labelid, &stat);
+	uuid_to_string(&labelid, &str, &stat);
+	strncpy(strbuf, str, 8);
 	free (str);
 	strbuf[8] = '\0';
-	sprintf(label,"%s_%s (%d-%d)\0","MEDIA_FILE", strbuf, (int)f, (int)n );
+	sprintf(label,"%s_%s (%d-%d)\0","MEDIA_FILE", strbuf, (int)f, (int)n);
 
-	inv_put_mediafile( tok, moid, label, 12, f, 0, n, 0, 0xffff,
-			  BOOL_TRUE, BOOL_FALSE );
+	inv_put_mediafile(tok, moid, label, 12, f, 0, n, 0, 0xffff,
+			  BOOL_TRUE, BOOL_FALSE);
 
 }
 
@@ -86,33 +86,33 @@ typedef struct ses{
 #define SESLIM  240
 
 int
-recons_test( int howmany )
+recons_test(int howmany)
 {
 	int fd, i, rval = 1;
 	off64_t off = 0;
 
-	ses sarr[ SESLIM];
+	ses sarr[SESLIM];
 
-	fd = open( sesfile, O_RDONLY );
+	fd = open(sesfile, O_RDONLY);
 
-	for ( i=0; i<howmany && i < SESLIM; i++ ){
-		rval = get_invtrecord( fd, &sarr[i],
-				       sizeof( uuid_t ) + sizeof( size_t ), off,
-				       BOOL_FALSE );
-		assert( rval > 0 );
-		assert( sarr[i].sz > 0 );
-		sarr[i].buf = calloc( 1,  sarr[i].sz );
+	for (i=0; i<howmany && i < SESLIM; i++){
+		rval = get_invtrecord(fd, &sarr[i],
+				       sizeof(uuid_t) + sizeof(size_t), off,
+				       BOOL_FALSE);
+		assert(rval > 0);
+		assert(sarr[i].sz > 0);
+		sarr[i].buf = calloc(1,  sarr[i].sz);
 		off += (off64_t)(sizeof(uuid_t) + sizeof(size_t));
-		rval = get_invtrecord( fd, sarr[i].buf,  sarr[i].sz, off,
-				       BOOL_FALSE );
-		assert( rval > 0 );
+		rval = get_invtrecord(fd, sarr[i].buf,  sarr[i].sz, off,
+				       BOOL_FALSE);
+		assert(rval > 0);
 		off += sarr[i].sz;
 	}
 
 
 
-	for ( i=0; i<howmany && i < SESLIM; i++ ){
-		if ( inv_put_sessioninfo( sarr[i].buf, sarr[i].sz ) < 0)
+	for (i=0; i<howmany && i < SESLIM; i++){
+		if (inv_put_sessioninfo(sarr[i].buf, sarr[i].sz) < 0)
 			printf("$ insert failed.\n");
 	}
 
@@ -125,21 +125,21 @@ recons_test( int howmany )
 
 
 int
-delete_test( int n )
+delete_test(int n)
 {
 	int fd, i;
 	uuid_t moid;
 	char *str = 0;
 	unsigned int stat;
 
-	fd = open( "moids", O_RDONLY );
-	if ( fd < 0 ) return -1;
+	fd = open("moids", O_RDONLY);
+	if (fd < 0) return -1;
 
-	get_invtrecord( fd, &moid, sizeof(uuid_t), (n-1)* sizeof( uuid_t), 0 );
-	uuid_to_string( &moid, &str, &stat );
-	printf("Searching for Moid = %s\n", str );
-	free( str );
-	if (! inv_delete_mediaobj( &moid ) ) return -1;
+	get_invtrecord(fd, &moid, sizeof(uuid_t), (n-1)* sizeof(uuid_t), 0);
+	uuid_to_string(&moid, &str, &stat);
+	printf("Searching for Moid = %s\n", str);
+	free(str);
+	if (! inv_delete_mediaobj(&moid) ) return -1;
 
 	return 1;
 
@@ -193,7 +193,7 @@ sess_queries_bylabel(char *lab)
 
 
 int
-query_test( int level )
+query_test(int level)
 {
 	int i;
 	inv_idbtoken_t tok;
@@ -203,40 +203,40 @@ query_test( int level )
 
 	if (level == -2) {
 		printf("mount pt %s\n",sesfile);
-		tok = inv_open( INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile );
-		if (! tok ) return -1;
+		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile);
+		if (! tok) return -1;
 		idx_DEBUG_print (tok->d_invindex_fd);
 		return 1;
 	}
 
 	for (i = 7; i<8; i++) {
 		printf("\n\n\n----------------------------------\n"
-		       "$ Searching fs %s\n", mnt_str[7-i] );
-		tok = inv_open( INV_BY_MOUNTPT, INV_SEARCH_ONLY, mnt_str[7-i] );
-		if (! tok ) return -1;
+		       "$ Searching fs %s\n", mnt_str[7-i]);
+		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, mnt_str[7-i]);
+		if (! tok) return -1;
 
 		prctx.index = i;
-		if (level == -1 )
-			invmgr_inv_print( tok->d_invindex_fd, &prctx );
+		if (level == -1)
+			invmgr_inv_print(tok->d_invindex_fd, &prctx);
 		else {
-		if (inv_lasttime_level_lessthan( tok, level, &tm ) && tm) {
-			printf("\n\nTIME %s %ld\n", ctime(tm), (long) *tm );
+		if (inv_lasttime_level_lessthan(tok, level, &tm) && tm) {
+			printf("\n\nTIME %s %ld\n", ctime(tm), (long) *tm);
 			free (tm);
 		}
-		if (inv_lastsession_level_lessthan( tok, level, &ses ) && ses) {
-			DEBUG_sessionprint( ses, 99, &prctx);
-			free ( ses->s_streams );
-			free ( ses );
+		if (inv_lastsession_level_lessthan(tok, level, &ses) && ses) {
+			DEBUG_sessionprint(ses, 99, &prctx);
+			free (ses->s_streams);
+			free (ses);
 		}
 
-		if (inv_lastsession_level_equalto( tok, level, &ses ) && ses) {
+		if (inv_lastsession_level_equalto(tok, level, &ses) && ses) {
 			printf("Gotcha\n");
-			DEBUG_sessionprint( ses, 99, &prctx );
-			free ( ses->s_streams );
-			free ( ses );
+			DEBUG_sessionprint(ses, 99, &prctx);
+			free (ses->s_streams);
+			free (ses);
 		}
 	        }
-		inv_close( tok );
+		inv_close(tok);
 	}
 	return 1;
 }
@@ -249,7 +249,7 @@ query_test( int level )
 /*----------------------------------------------------------------------*/
 
 int
-write_test( int nsess, int nstreams, int nmedia, int dumplevel )
+write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 {
 	int i,j,k,m,fd;
 	unsigned int stat;
@@ -274,23 +274,23 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 #ifdef FIRSTTIME
 	printf("first time!\n");
 	for (i=0; i<8; i++) {
-		uuid_create( &fsidarr[i], &stat );
-		assert ( stat == uuid_s_ok );
-		uuid_create( &sesidarr[i], &stat );
-		assert ( stat == uuid_s_ok );
+		uuid_create(&fsidarr[i], &stat);
+		assert (stat == uuid_s_ok);
+		uuid_create(&sesidarr[i], &stat);
+		assert (stat == uuid_s_ok);
 	}
-	fd = open( "uuids", O_RDWR | O_CREAT );
-	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L );
-	PUT_REC(fd, (void *)sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8 );
+	fd = open("uuids", O_RDWR | O_CREAT);
+	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L);
+	PUT_REC(fd, (void *)sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8);
 	close(fd);
 #endif
-	fd = open("uuids", O_RDONLY );
-	GET_REC( fd, fsidarr, sizeof (uuid_t) * 8, 0L );
-	GET_REC( fd, sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8 );
+	fd = open("uuids", O_RDONLY);
+	GET_REC(fd, fsidarr, sizeof (uuid_t) * 8, 0L);
+	GET_REC(fd, sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8);
 	close(fd);
 #ifdef RECONS
-	rfd = open( sesfile, O_RDWR | O_CREAT );
-	fchmod( rfd, INV_PERMS );
+	rfd = open(sesfile, O_RDWR | O_CREAT);
+	fchmod(rfd, INV_PERMS);
 	if (fstat64(fd, &statbuf) < 0) {
 		perror("fstat64 session file");
 		return -1;
@@ -298,22 +298,22 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 	off = (off64_t)statbuf.st_size;
 #endif
 
-	for ( i = 0; i < nsess; i++ ) {
+	for (i = 0; i < nsess; i++) {
 		j = i % 8;
 		/*mnt = mnt_str[j];
 		dev = dev_str[7-j];*/
 		mnt = mnt_str[0];
 		dev = dev_str[7];
 		fsidp = &fsidarr[0]; /* j */
-		tok1 = inv_open( INV_BY_UUID, INV_SEARCH_N_MOD, fsidp );
-		assert (tok1 != INV_TOKEN_NULL );
+		tok1 = inv_open(INV_BY_UUID, INV_SEARCH_N_MOD, fsidp);
+		assert (tok1 != INV_TOKEN_NULL);
 
-		uuid_create( &labelid, &stat );
-		uuid_to_string( &labelid, &str, &stat );
-		strncpy( strbuf, str, 8 );
+		uuid_create(&labelid, &stat);
+		uuid_to_string(&labelid, &str, &stat);
+		strncpy(strbuf, str, 8);
 		free (str);
 		strbuf[8] = '\0';
-		sprintf(label,"%s_%s (%d)\0","SESSION_LABEL", strbuf, i );
+		sprintf(label,"%s_%s (%d)\0","SESSION_LABEL", strbuf, i);
 
 		tok2 = inv_writesession_open(tok1, fsidp,
 					     &labelid,
@@ -322,47 +322,47 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 					     (bool_t)i%2,
 					     dumplevel, nstreams,
 					     time(NULL),
-					     mnt, dev );
-		assert (tok2 != INV_TOKEN_NULL );
+					     mnt, dev);
+		assert (tok2 != INV_TOKEN_NULL);
 		for (m = 0; m<nstreams; m++) {
-			tok3 = inv_stream_open( tok2,"/dev/rmt");
-			assert (tok3 != INV_TOKEN_NULL );
+			tok3 = inv_stream_open(tok2,"/dev/rmt");
+			assert (tok3 != INV_TOKEN_NULL);
 
-			for (k = 0; k<nmedia; k++ )
-				CREAT_mfiles( tok3, &labelid, k*100,
-					      k*100 + 99 );
-			inv_stream_close( tok3, BOOL_TRUE );
+			for (k = 0; k<nmedia; k++)
+				CREAT_mfiles(tok3, &labelid, k*100,
+					      k*100 + 99);
+			inv_stream_close(tok3, BOOL_TRUE);
 		}
 
 #ifdef RECONS
-		if (inv_get_sessioninfo( tok2, &bufp, &sz ) == BOOL_TRUE ) {
-			put_invtrecord( rfd, fsidp, sizeof( uuid_t ), off,
-					BOOL_FALSE );
+		if (inv_get_sessioninfo(tok2, &bufp, &sz) == BOOL_TRUE) {
+			put_invtrecord(rfd, fsidp, sizeof(uuid_t), off,
+					BOOL_FALSE);
 			off += (off64_t)sizeof(uuid_t);
-			put_invtrecord( rfd, &sz, sizeof( size_t ), off,
+			put_invtrecord(rfd, &sz, sizeof(size_t), off,
 					BOOL_FALSE);
 			off += (off64_t)sizeof(size_t);
-			put_invtrecord( rfd, bufp, sz, off, BOOL_FALSE );
+			put_invtrecord(rfd, bufp, sz, off, BOOL_FALSE);
 		}
 #endif
 #ifdef NOTDEF
-		if (inv_get_sessioninfo( tok2, &bufp, &sz ) == BOOL_TRUE )
-			inv_put_sessioninfo(  fsidp, bufp, sz );
+		if (inv_get_sessioninfo(tok2, &bufp, &sz) == BOOL_TRUE)
+			inv_put_sessioninfo(fsidp, bufp, sz);
 #endif
-		inv_writesession_close( tok2 );
-		inv_close( tok1 );
+		inv_writesession_close(tok2);
+		inv_close(tok1);
 	}
 #ifdef RECONS
-	close( rfd );
+	close(rfd);
 #endif
 	return 1;
 }
 
 
-void usage( void )
+void usage(void)
 {
-	printf("( %s ./inv w|r|q -v <verbosity> -s <nsess>"
-	       "-t <strms> -m <nmediafiles> \n", optarg );
+	printf("(%s ./inv w|r|q -v <verbosity> -s <nsess>"
+	       "-t <strms> -m <nmediafiles> \n", optarg);
 }
 
 
@@ -370,8 +370,8 @@ int
 mp_test(int nstreams)
 {
 #if 0
-	tok1 = inv_open( INV_BY_UUID, fsidp );
-	assert (tok1 != INV_TOKEN_NULL );
+	tok1 = inv_open(INV_BY_UUID, fsidp);
+	assert (tok1 != INV_TOKEN_NULL);
 
 	tok2 = inv_writesession_open(tok1, fsidp,
 				     &labelid,
@@ -380,17 +380,17 @@ mp_test(int nstreams)
 				     (bool_t)i%2,
 				     dumplevel, nstreams,
 				     time(NULL),
-				     mnt, dev );
-	assert (tok2 != INV_TOKEN_NULL );
+				     mnt, dev);
+	assert (tok2 != INV_TOKEN_NULL);
 
 	for (m = 0; m<nstreams; m++) {
-			tok3 = inv_stream_open( tok2,"/dev/rmt");
-			assert (tok3 != INV_TOKEN_NULL );
+			tok3 = inv_stream_open(tok2,"/dev/rmt");
+			assert (tok3 != INV_TOKEN_NULL);
 
-			for (k = 0; k<nmedia; k++ )
-				CREAT_mfiles( tok3, &labelid, k*100,
-					      k*100 + 99 );
-			inv_stream_close( tok3, BOOL_TRUE );
+			for (k = 0; k<nmedia; k++)
+				CREAT_mfiles(tok3, &labelid, k*100,
+					      k*100 + 99);
+			inv_stream_close(tok3, BOOL_TRUE);
 		}
 #endif
 }
@@ -417,9 +417,9 @@ main(int argc, char *argv[])
 
 	progname = argv[0];
 	sesfile = "sessions";
-	assert( argc > 1 );
+	assert(argc > 1);
 
-	mlog_init( argc, argv );
+	mlog_init(argc, argv);
 
 	if (! inv_DEBUG_print(argc, argv))
 		return 0;
@@ -427,8 +427,8 @@ main(int argc, char *argv[])
 	optind = 1;
 	optarg = 0;
 
-	while( ( cc = getopt( argc, argv, GETOPT_CMDSTRING)) != EOF ) {
-		switch ( cc ) {
+	while((cc = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (cc) {
 		      case 'w':
 			op = WRI;
 			break;
@@ -473,7 +473,7 @@ main(int argc, char *argv[])
 			break;
 
 		      case 'm':
-			nmedia = atoi( optarg );
+			nmedia = atoi(optarg);
 			break;
 		      case 'v':
 			break;
@@ -489,17 +489,17 @@ main(int argc, char *argv[])
 	}
 
 
-	if ( op == WRI )
-		rval = write_test( nsess, nstreams, nmedia, level );
-	else if ( op == QUE )
-		rval = query_test( level );
-	else if ( op == REC )
-		rval = recons_test( nsess );
-	else if ( op == DEL )
-		rval = delete_test( nsess );
-	else if ( op == MP )
+	if (op == WRI)
+		rval = write_test(nsess, nstreams, nmedia, level);
+	else if (op == QUE)
+		rval = query_test(level);
+	else if (op == REC)
+		rval = recons_test(nsess);
+	else if (op == DEL)
+		rval = delete_test(nsess);
+	else if (op == MP)
 		rval = mp_test (nstreams);
-	else if ( op == QUE2 ) {
+	else if (op == QUE2) {
 		if (uuid)
 			rval = sess_queries_byuuid(uuid);
 		else if (label)
@@ -508,10 +508,10 @@ main(int argc, char *argv[])
 	else
 		usage();
 
-	if (rval < 0 )
-		printf( "aborted\n");
+	if (rval < 0)
+		printf("aborted\n");
 	else
-		printf( "done\n" );
+		printf("done\n");
 
 
 }
diff --git a/invutil/cmenu.h b/invutil/cmenu.h
index a9788f2..f3c205f 100644
--- a/invutil/cmenu.h
+++ b/invutil/cmenu.h
@@ -44,18 +44,18 @@ 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 {
diff --git a/invutil/fstab.c b/invutil/fstab.c
index a4333ad..3319a5c 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -83,7 +83,7 @@ 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);
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 5e540a3..9944bd0 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -47,7 +47,7 @@ int invidx_numfiles;
 extern stobj_fileinfo_t *stobj_file;
 extern int stobj_numfiles;
 
-static void stobj_makefname_len( char *fname, int fname_len );
+static void stobj_makefname_len(char *fname, int fname_len);
 
 menu_ops_t invidx_ops = {
     NULL,
@@ -94,7 +94,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 	}
 	mark_all_children_commited(current);
 
-	if ( invidx_file[fidx].counter->ic_curnum > 1 ) {
+	if (invidx_file[fidx].counter->ic_curnum > 1) {
 	    memmove(&inv_entry[idx],
 		    &inv_entry[idx + 1],
 		    (sizeof(invt_entry_t) * (invidx_file[fidx].counter->ic_curnum - idx - 1)));
@@ -547,7 +547,7 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
     }
 
     /* stobj file not full, just insert the entry */
-    hdr->sh_sess_off = STOBJ_OFFSET( sescnt.ic_maxnum, pos);
+    hdr->sh_sess_off = STOBJ_OFFSET(sescnt.ic_maxnum, pos);
     hdr->sh_streams_off = sescnt.ic_eof;
 
     /* for seshdr: malloc buffer, copy new entry into buffer, read file entries into buffer, write the lot out */
@@ -584,31 +584,31 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
 }
 
 static void
-stobj_makefname_len( char *fname, int fname_len )
+stobj_makefname_len(char *fname, int fname_len)
 {
     /* come up with a new unique name */
     uuid_t	fn;
     char	str[UUID_STR_LEN + 1];
 
-    uuid_generate( fn );
-    uuid_unparse( fn, str );
+    uuid_generate(fn);
+    uuid_unparse(fn, str);
 
     snprintf(fname, fname_len, "%s/%s.StObj", inventory_path, str);
 }
 
 int
-stobj_create( char *fname )
+stobj_create(char *fname)
 {
     int fd;
     invt_sescounter_t sescnt;
 
     /* create the new storage object */
-    if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
+    if ((fd = open(fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
 	return -1;
     }
 
-    INVLOCK( fd, LOCK_EX );
-    fchmod( fd, INV_PERMS );
+    INVLOCK(fd, LOCK_EX);
+    fchmod(fd, INV_PERMS);
 
     memset(&sescnt, 0, sizeof(sescnt));
     sescnt.ic_vernum = INV_VERSION;
@@ -617,51 +617,51 @@ stobj_create( char *fname )
     sescnt.ic_eof = SC_EOF_INITIAL_POS;
 
     lseek(fd, 0, SEEK_SET);
-    write_n_bytes ( fd, (char *)&sescnt, sizeof(sescnt), "new stobj file" );
+    write_n_bytes (fd, (char *)&sescnt, sizeof(sescnt), "new stobj file");
 
-    INVLOCK( fd, LOCK_UN );
+    INVLOCK(fd, LOCK_UN);
     return fd;
 }
 
 int
-stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
+stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
-		   invt_mediafile_t *mfiles )
+		   invt_mediafile_t *mfiles)
 {
     uint	nstm	= ses->s_cur_nstreams;
     off64_t	off	= hdr->sh_streams_off;
-    off64_t	mfileoff= off + (off64_t)( nstm * sizeof( invt_stream_t ) );
+    off64_t	mfileoff= off + (off64_t)(nstm * sizeof(invt_stream_t) );
     uint	nmfiles = 0;
     uint	i,j;
 
     /* fix the offsets in streams */
-     for ( i = 0; i < nstm; i++ ) {
-	strms[i].st_firstmfile = mfileoff + (off64_t) ((size_t) nmfiles * sizeof( invt_mediafile_t ) );
+     for (i = 0; i < nstm; i++) {
+	strms[i].st_firstmfile = mfileoff + (off64_t) ((size_t) nmfiles * sizeof(invt_mediafile_t) );
 	/* now fix the offsets in mediafiles */
-	for ( j = 0; j < strms[i].st_nmediafiles; j++ ) {
+	for (j = 0; j < strms[i].st_nmediafiles; j++) {
 
 	    /* no need to fix the last element's next ptr */
-	    if ( j < strms[i].st_nmediafiles - 1 )
-		mfiles[ nmfiles + j ].mf_nextmf =  strms[i].st_firstmfile + (off64_t) ((j+1) * sizeof( invt_mediafile_t ));
+	    if (j < strms[i].st_nmediafiles - 1)
+		mfiles[nmfiles + j].mf_nextmf =  strms[i].st_firstmfile + (off64_t) ((j+1) * sizeof(invt_mediafile_t));
 
 	    /* no need to fix the first element's prev ptr */
-	    if ( j )
-		mfiles[ nmfiles + j ].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof( invt_mediafile_t ));
+	    if (j)
+		mfiles[nmfiles + j].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof(invt_mediafile_t));
 	}
 
 	/* adjust the offsets of the first and the last elements
 	   in the mediafile chain */
-	mfiles[ nmfiles ].mf_prevmf = 0;
+	mfiles[nmfiles].mf_prevmf = 0;
 	nmfiles += strms[i].st_nmediafiles;
-	mfiles[ nmfiles - 1 ].mf_nextmf = 0;
+	mfiles[nmfiles - 1].mf_nextmf = 0;
     }
 
     /* first put the streams. hdr already points at the right place */
     lseek(fd, off, SEEK_SET);
-    write_n_bytes( fd, strms, nstm * sizeof( invt_stream_t ), "stobj file" );
+    write_n_bytes(fd, strms, nstm * sizeof(invt_stream_t), "stobj file");
 
     lseek(fd, mfileoff, SEEK_SET);
-    write_n_bytes( fd, mfiles, nmfiles * sizeof( invt_mediafile_t ), "stobj file" );
+    write_n_bytes(fd, mfiles, nmfiles * sizeof(invt_mediafile_t), "stobj file");
 
     return 1;
 }
@@ -834,7 +834,7 @@ find_invidx_insert_pos(int fidx, invt_entry_t *inv_entry)
 	next_entry = invidx_file[fidx].data[i+1];
 
 	if(inv_entry->ie_timeperiod.tp_start > entry->ie_timeperiod.tp_end
-	   && inv_entry->ie_timeperiod.tp_end < next_entry->ie_timeperiod.tp_start ) {
+	   && inv_entry->ie_timeperiod.tp_end < next_entry->ie_timeperiod.tp_start) {
 	    return i;
 	}
     }
@@ -916,7 +916,7 @@ generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFil
 	return startnode;
     }
 
-    invidx_entry = (invt_entry_t *)( invidx_file[idx].mapaddr + sizeof(invt_counter_t));
+    invidx_entry = (invt_entry_t *)(invidx_file[idx].mapaddr + sizeof(invt_counter_t));
 
     n = startnode;
     for (i=0; i < invidx_file[idx].counter->ic_curnum; i++) {
@@ -947,7 +947,7 @@ generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFil
 
 	add_invidx_data(idx, &(invidx_entry[i]));
 	stobjname = GetNameOfStobj(inv_path, invidx_entry[i].ie_filename);
-	n = generate_stobj_menu( n, level + 1, stobjname );
+	n = generate_stobj_menu(n, level + 1, stobjname);
 	free(stobjname);
     }
 
@@ -1001,7 +1001,7 @@ remmap_invidx(int fidx, int num)
 
     nEntries = invidx_file[fidx].counter->ic_curnum;
 
-    munmap( invidx_file[fidx].mapaddr,
+    munmap(invidx_file[fidx].mapaddr,
 	    (nEntries * sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     /* need to lseek on the file to grow it to the right size - no autogrow on linux */
@@ -1042,7 +1042,7 @@ open_invidx(char *idxFileName)
     invt_counter_t header;
 
     errno=0;
-    fd = open_and_lock( idxFileName, FILE_WRITE, wait_for_locks );
+    fd = open_and_lock(idxFileName, FILE_WRITE, wait_for_locks);
     if (fd < 0) {
         return fd;
     }
@@ -1053,7 +1053,7 @@ open_invidx(char *idxFileName)
 	exit(1);
     }
 
-    read_n_bytes( fd, &header, sizeof(invt_counter_t), idxFileName);
+    read_n_bytes(fd, &header, sizeof(invt_counter_t), idxFileName);
 
     nEntries = header.ic_curnum;
 
@@ -1075,21 +1075,21 @@ close_invidx(int idx)
 	return 0;
 
     nEntries = invidx_file[idx].counter->ic_curnum;
-    munmap( invidx_file[idx].mapaddr,
-	    (invidx_file[idx].nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t) );
+    munmap(invidx_file[idx].mapaddr,
+	    (invidx_file[idx].nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     if(nEntries != 0 && nEntries != invidx_file[idx].nEntries) {
 	ftruncate(invidx_file[idx].fd,
-		  sizeof(invt_counter_t) + (nEntries * sizeof(invt_entry_t)) );
+		  sizeof(invt_counter_t) + (nEntries * sizeof(invt_entry_t)));
     }
 
-    close( invidx_file[idx].fd );
+    close(invidx_file[idx].fd);
 
     if(nEntries == 0) {
 	unlink(invidx_file[idx].name);
     }
-    free( invidx_file[idx].name );
-    free( invidx_file[idx].data );
+    free(invidx_file[idx].name);
+    free(invidx_file[idx].data);
 
     invidx_file[idx].fd = -1;
     invidx_file[idx].name = NULL;
diff --git a/invutil/invutil.c b/invutil/invutil.c
index e06b1f4..242574f 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -78,51 +78,51 @@ main(int argc, char *argv[])
     uuid_clear(uuid);
     uuid_clear(session);
 
-    while((c = getopt( argc, argv, GETOPT_CMDSTRING)) != EOF) {
+    while((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 	switch(c) {
 	case GETOPT_DEBUG:
 	    debug = BOOL_TRUE;
 	    break;
 	case GETOPT_INTERACTIVE:
 	    if (force) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_FORCE,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    interactive_option = BOOL_TRUE;
 	    break;
 	case GETOPT_NONINTERACTIVE: /* obsoleted by -F */
 	    if (interactive_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_INTERACTIVE,
-			 c );
+			 c);
 		usage();
 	    }
 	    force = BOOL_TRUE;
 	    break;
 	case GETOPT_UUID:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (mntpnt_option || session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 mntpnt_option ? GETOPT_PRUNEMNT : GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    uuid_option = BOOL_TRUE;
@@ -133,51 +133,51 @@ main(int argc, char *argv[])
 	    break;
 	case GETOPT_CHECKPRUNEFSTAB:
 	    if (mntpnt_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNEMNT,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (uuid_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_UUID,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    check_option = BOOL_TRUE;
 	    break;
 	case GETOPT_FORCE:
 	    if (interactive_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_INTERACTIVE,
-			 c );
+			 c);
 		usage();
 	    }
 	    force = BOOL_TRUE;
 	    break;
 	case GETOPT_PRUNEMNT:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (uuid_option || session_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 uuid_option ? GETOPT_UUID : GETOPT_PRUNESESSION,
-			 c );
+			 c);
 		usage();
 	    }
 	    mntpnt_option = BOOL_TRUE;
@@ -188,24 +188,24 @@ main(int argc, char *argv[])
 	    break;
 	case GETOPT_PRUNESESSION:
 	    if (check_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_CHECKPRUNEFSTAB,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (interactive_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 GETOPT_INTERACTIVE,
-			 c );
+			 c);
 		usage();
 	    }
 	    if (mntpnt_option || uuid_option) {
-		fprintf( stderr, "%s: may not specify both -%c and -%c\n",
+		fprintf(stderr, "%s: may not specify both -%c and -%c\n",
 			 g_programName,
 			 mntpnt_option ? GETOPT_PRUNEMNT : GETOPT_UUID,
-			 c );
+			 c);
 		usage();
 	    }
 	    session_option = BOOL_TRUE;
@@ -218,11 +218,11 @@ main(int argc, char *argv[])
     }
 
     if (r_mf_label != NULL && !(mntpnt_option || uuid_option)) {
-	    fprintf( stderr, "%s: -%c requires either -%c or -%c\n",
+	    fprintf(stderr, "%s: -%c requires either -%c or -%c\n",
 			 g_programName,
 			 GETOPT_PRUNEMEDIALABEL,
 			 GETOPT_PRUNEMNT,
-			 GETOPT_UUID );
+			 GETOPT_UUID);
 	    usage();
     }
 
@@ -245,9 +245,9 @@ main(int argc, char *argv[])
     /* sanity check the inventory database directory, setup global paths
      */
     if (!inv_setup_base()) {
-        fprintf( stderr,
+        fprintf(stderr,
                 "%s: both /var/lib/xfsdump and /var/xfsdump exist - fatal\n",
-	        g_programName );
+	        g_programName);
         exit(1);
     }
     inventory_path = INV_DIRPATH;
@@ -276,7 +276,7 @@ main(int argc, char *argv[])
 		    &session, timeSecs, r_mf_label);
 	}
     }
-    else if ( interactive_option ) {
+    else if (interactive_option) {
 	invutil_interactive(inventory_path, mntPoint, &uuid, 0);
 	printf("\n");
     }
@@ -370,7 +370,7 @@ ParseDate(char *strDate)
 #endif
 
     if (*fmt == NULL || (date = mktime(&tm)) < 0) {
-        fprintf(stderr, "%s: bad date, \"%s\"\n", g_programName, strDate );
+        fprintf(stderr, "%s: bad date, \"%s\"\n", g_programName, strDate);
         usage();
     }
 
@@ -408,10 +408,10 @@ GetNameOfStobj (char *inv_path, char *filename)
     char *name;
 
     str = basename(filename);
-    name = (char *) malloc( strlen( inv_path ) + 1  + strlen( str ) + 1);
-    strcpy( name, inv_path );
-    strcat( name, "/" );
-    strcat( name, str );
+    name = (char *) malloc(strlen(inv_path) + 1  + strlen(str) + 1);
+    strcpy(name, inv_path);
+    strcat(name, "/");
+    strcat(name, str);
 
     return(name);
 }
@@ -422,13 +422,13 @@ GetNameOfInvIndex (char *inv_path, uuid_t uuid)
     char str[UUID_STR_LEN + 1];
     char *name;
 
-    uuid_unparse( uuid, str );
-    name = (char *) malloc( strlen( inv_path ) + 1  + strlen( str )
-			     + strlen( INV_INVINDEX_PREFIX ) + 1);
-    strcpy( name, inv_path );
-    strcat( name, "/" );
-    strcat( name, str );
-    strcat( name, INV_INVINDEX_PREFIX );
+    uuid_unparse(uuid, str);
+    name = (char *) malloc(strlen(inv_path) + 1  + strlen(str)
+			     + strlen(INV_INVINDEX_PREFIX) + 1);
+    strcpy(name, inv_path);
+    strcat(name, "/");
+    strcat(name, str);
+    strcat(name, INV_INVINDEX_PREFIX);
 
     return(name);
 }
@@ -438,11 +438,11 @@ GetFstabFullPath(char *inv_path)
 {
     char *fstabname;
 
-    fstabname = (char *) malloc( strlen(inv_path) + 1 /* one for the "/" */
-				   + strlen("fstab") + 1 );
-    strcpy( fstabname, inv_path );
-    strcat( fstabname, "/" );
-    strcat( fstabname, "fstab" );
+    fstabname = (char *) malloc(strlen(inv_path) + 1 /* one for the "/" */
+				   + strlen("fstab") + 1);
+    strcpy(fstabname, inv_path);
+    strcat(fstabname, "/");
+    strcat(fstabname, "fstab");
     return(fstabname);
 }
 
@@ -463,18 +463,18 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
     invt_counter_t *counter,cnt;
 
     if (mountPt == NULL && uuid_is_null(*uuidp) && uuid_is_null(*sessionp)) {
-	fprintf( stderr, "%s: mountpoint, uuid or session "
-			 "must be specified\n", g_programName );
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: mountpoint, uuid or session "
+			 "must be specified\n", g_programName);
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
 
     fstabname = GetFstabFullPath(inv_path);
-    fd = open_and_lock( fstabname,
+    fd = open_and_lock(fstabname,
 			FILE_WRITE,
-			wait_for_locks );
+			wait_for_locks);
     if (fd < 0) {
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
 
@@ -492,13 +492,13 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
     printf("Processing file %s\n", fstabname);
 
     /* check each entry in fstab for mount pt or uuid match */
-    for (i = 0; i < counter->ic_curnum; )
+    for (i = 0; i < counter->ic_curnum;)
     {
 	removeflag = BOOL_FALSE;
 
 	printf("   Found entry for %s\n" , fstabentry[i].ft_mountpt);
 
-	for (j = i +1 ; j < counter->ic_curnum ; j++ ) {
+	for (j = i +1 ; j < counter->ic_curnum ; j++) {
 	    if (uuid_compare(fstabentry[i].ft_uuid, fstabentry[j].ft_uuid) == 0)
 	    {
 		printf("     duplicate fstab entry\n");
@@ -519,7 +519,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 		   (r_mf_label ? r_mf_label : "(NULL)"));
 #endif
 
-	    if ( checkonly == BOOL_FALSE ) {
+	    if (checkonly == BOOL_FALSE) {
 		if(mountPt != NULL && strcmp(mountPt, fstabentry[i].ft_mountpt) == 0) {
 		    printf("     Match on hostname and path\n");
 		    IdxCheckOnly = BOOL_FALSE;
@@ -542,18 +542,18 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 
 	    if (CheckAndPruneInvIndexFile(
 			IdxCheckOnly, invname, sessionp,
-			prunetime, r_mf_label) == -1 ) {
+			prunetime, r_mf_label) == -1) {
 		removeflag = BOOL_TRUE;
 	    }
 
-	    free( invname );
+	    free(invname);
 
 	}
 
 	if (removeflag == BOOL_TRUE)
 	{
 	    printf("     removing fstab entry %s\n", fstabentry[i].ft_mountpt);
-	    if ( counter->ic_curnum > 1 ) {
+	    if (counter->ic_curnum > 1) {
 		bcopy((void *)&fstabentry[i + 1],
 		      (void *)&fstabentry[i],
 		      (sizeof(invt_fstab_t) * (counter->ic_curnum - i - 1)));
@@ -566,7 +566,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 
     fstabEntries = counter->ic_curnum;
 
-    munmap( mapaddr,
+    munmap(mapaddr,
 	    (nEntries*sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
 
     if ((fstabEntries != 0)  && (fstabEntries != nEntries)) {
@@ -588,14 +588,14 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	if(debug) {
 	    printf("unlink fstab file %s\n", fstabname);
 	}
-	unlink( fstabname );
+	unlink(fstabname);
     }
 
-    free( fstabname );
+    free(fstabname);
 }
 
 int
-CheckAndPruneInvIndexFile( bool_t checkonly,
+CheckAndPruneInvIndexFile(bool_t checkonly,
 			   char *idxFileName,
 			   uuid_t *sessionp,
 			   time32_t prunetime,
@@ -615,14 +615,14 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
     printf("      processing index file \n"
 	   "       %s\n",idxFileName);
 
-    fd = open_and_lock( idxFileName,
+    fd = open_and_lock(idxFileName,
 			FILE_WRITE,
-			wait_for_locks );
+			wait_for_locks);
     if (fd < 0) {
         return -1;
     }
 
-    read_n_bytes( fd, &header, sizeof(invt_counter_t), idxFileName);
+    read_n_bytes(fd, &header, sizeof(invt_counter_t), idxFileName);
     nEntries = header.ic_curnum;
 
     temp = mmap_n_bytes(fd,
@@ -630,9 +630,9 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 			BOOL_FALSE, idxFileName);
 
     counter = (invt_counter_t *)temp;
-    invIndexEntry = (invt_entry_t *)( temp + sizeof(invt_counter_t));
+    invIndexEntry = (invt_entry_t *)(temp + sizeof(invt_counter_t));
 
-    for (i=0; i < counter->ic_curnum; )
+    for (i=0; i < counter->ic_curnum;)
     {
 	removeflag = BOOL_FALSE;
 	printf("         Checking access for\n"
@@ -644,7 +644,7 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 		   ctime32(&(invIndexEntry[i].ie_timeperiod.tp_end)));
 	}
 
-	if (( access( invIndexEntry[i].ie_filename, R_OK | W_OK ) == -1)  &&
+	if ((access(invIndexEntry[i].ie_filename, R_OK | W_OK) == -1)  &&
 	   (errno == ENOENT))
 	{
 	    printf("         Unable to access %s referred in %s\n",
@@ -660,7 +660,7 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 
 	if (removeflag == BOOL_TRUE)
 	{
-	    if ( counter->ic_curnum > 1 ) {
+	    if (counter->ic_curnum > 1) {
 	        bcopy((void *)&invIndexEntry[i + 1],
 		      (void *)&invIndexEntry[i],
 		      (sizeof(invt_entry_t) * (counter->ic_curnum - i - 1)));
@@ -673,18 +673,18 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 
     validEntries = counter->ic_curnum;
 
-    munmap( temp, (nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t) );
+    munmap(temp, (nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     if ((validEntries != 0)  && (validEntries != nEntries)) {
 	if(debug) {
 	    printf("ftruncate idx from %d to %d (%ld bytes)\n",
 		   nEntries,
 		   validEntries,
-		   (long) sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)) );
+		   (long) sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)));
             printf("- truncate %s\n", idxFileName);
 	}
-    	ftruncate( fd,
-		   sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)) );
+    	ftruncate(fd,
+		   sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)));
     }
 
     if (debug) {
@@ -693,14 +693,14 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 	       validEntries);
     }
 
-    close( fd );
+    close(fd);
 
     if (validEntries == 0)
     {
 	if(debug) {
 	    printf("unlink idx file %s\n", idxFileName);
 	}
-	unlink( idxFileName );
+	unlink(idxFileName);
 	return(-1);
     }
 
@@ -708,7 +708,7 @@ CheckAndPruneInvIndexFile( bool_t checkonly,
 }
 
 int
-CheckAndPruneStObjFile( bool_t checkonly,
+CheckAndPruneStObjFile(bool_t checkonly,
 			char *StObjFileName,
 			uuid_t *sessionp,
 			time32_t prunetime,
@@ -734,9 +734,9 @@ CheckAndPruneStObjFile( bool_t checkonly,
     invt_sescounter_t *counter;
     invt_sescounter_t header;
 
-    fd = open_and_lock( StObjFileName,
+    fd = open_and_lock(StObjFileName,
 			FILE_WRITE,
-			wait_for_locks );
+			wait_for_locks);
     if (fd < 0) {
         return -1;
     }
@@ -751,11 +751,11 @@ CheckAndPruneStObjFile( bool_t checkonly,
 
     temp = mmap_n_bytes(fd, sb.st_size, BOOL_FALSE, StObjFileName);
     counter = (invt_sescounter_t *)temp;
-    StObjhdr = (invt_seshdr_t *)( temp + sizeof(invt_sescounter_t));
+    StObjhdr = (invt_seshdr_t *)(temp + sizeof(invt_sescounter_t));
     StObjses = (invt_session_t *)(temp + StObjhdr->sh_sess_off);
 
     sescount = 0;
-    for (i=0; i < counter->ic_curnum; ) {
+    for (i=0; i < counter->ic_curnum;) {
 	removeflag = BOOL_FALSE;
 	if (StObjhdr->sh_pruned)
 	    prunedcount++;
@@ -788,37 +788,37 @@ CheckAndPruneStObjFile( bool_t checkonly,
 		       ctime32(&StObjhdr->sh_time));
 	    printf("\t\tdevice:\t\t%s\n", StObjses->s_devpath);
 	    printf("\t\tsession label:\t\"%s\"\n", StObjses->s_label);
-	    uuid_unparse( StObjses->s_sesid, str );
+	    uuid_unparse(StObjses->s_sesid, str);
 	    printf("\t\tsession id:\t%s\n", str);
 	    printf("\t\tlevel:\t\t%d\n", StObjhdr->sh_level);
-	    printf("\t\tstreams:\t%d\n", StObjses->s_cur_nstreams );
-	    for ( i = 0; i < (int) StObjses->s_cur_nstreams; i++ ) {
-		printf( "\t\tstream %d:\n", i);
+	    printf("\t\tstreams:\t%d\n", StObjses->s_cur_nstreams);
+	    for (i = 0; i < (int) StObjses->s_cur_nstreams; i++) {
+		printf("\t\tstream %d:\n", i);
 		StObjstrm = (invt_stream_t *)(temp +
 					      StObjhdr->sh_streams_off +
 					      (i * sizeof(invt_stream_t)));
-		printf( "\t\t\tpathname:\t%s\n",
+		printf("\t\t\tpathname:\t%s\n",
 			StObjstrm->st_cmdarg);
-		printf( "\t\t\tinode start:\t%llu\n",
+		printf("\t\t\tinode start:\t%llu\n",
 			(unsigned long long) StObjstrm->st_startino.ino);
-		printf( "\t\t\tinode   end:\t%llu\n",
+		printf("\t\t\tinode   end:\t%llu\n",
 			(unsigned long long) StObjstrm->st_endino.ino);
-		printf( "\t\t\tinterrupted:\t%s\n",
-			StObjstrm->st_interrupted ? "YES" : "NO" );
-		printf( "\t\t\tmedia files:\t%d\n",
+		printf("\t\t\tinterrupted:\t%s\n",
+			StObjstrm->st_interrupted ? "YES" : "NO");
+		printf("\t\t\tmedia files:\t%d\n",
 			StObjstrm->st_nmediafiles);
-		for ( j = 0; j < StObjstrm->st_nmediafiles; j++) {
+		for (j = 0; j < StObjstrm->st_nmediafiles; j++) {
 		    StObjmed = (invt_mediafile_t *)(temp +
 						    StObjstrm->st_firstmfile +
 						    (j * sizeof(invt_mediafile_t)));
-		    printf( "\t\t\tmfile file %d:\n", j);
-		    printf( "\t\t\t\tmfile size:\t%lld\n",
+		    printf("\t\t\tmfile file %d:\n", j);
+		    printf("\t\t\t\tmfile size:\t%lld\n",
 			    (long long) StObjmed->mf_size);
-		    printf( "\t\t\t\tmfile start:\t%llu\n",
+		    printf("\t\t\t\tmfile start:\t%llu\n",
 			    (unsigned long long) StObjmed->mf_startino.ino);
-		    printf( "\t\t\t\tmfile end:\t%llu\n",
+		    printf("\t\t\t\tmfile end:\t%llu\n",
 			    (unsigned long long) StObjmed->mf_endino.ino);
-		    printf( "\t\t\t\tmedia label:\t\"%s\"\n",
+		    printf("\t\t\t\tmedia label:\t\"%s\"\n",
 			    StObjmed->mf_label);
 		}
 	    }
@@ -842,12 +842,12 @@ CheckAndPruneStObjFile( bool_t checkonly,
 	    && (uses_specified_mf_label(StObjhdr, StObjses, temp, r_mf_label))){
 	    bool_t GotResponse = BOOL_FALSE;
 
-	    uuid_unparse( StObjses->s_sesid, str );
+	    uuid_unparse(StObjses->s_sesid, str);
 
 	    if(force) {
 		printf("-------------------------------------------------\n");
 		printf("Pruning this matching entry:\n");
-		printf( "UUID\t\t:\t%s\nMOUNT POINT\t:\t%s\n"
+		printf("UUID\t\t:\t%s\nMOUNT POINT\t:\t%s\n"
 			"DEV PATH\t:\t%s\n"
 			"LABEL\t\t:\t%s\n"
 			"TIME OF DUMP\t:\t%s",
@@ -862,20 +862,20 @@ CheckAndPruneStObjFile( bool_t checkonly,
 		       "DEV PATH\t:\t%s\nTIME OF DUMP\t:\t%s",
 		       str, StObjses->s_mountpt, StObjses->s_devpath,
 		       ctime32(&StObjhdr->sh_time));
-		while ( GotResponse == BOOL_FALSE )
+		while (GotResponse == BOOL_FALSE)
 		{
 		    char *chp;
 
 		    printf("\nDo you want to prune this entry: [y/n] ");
-		    fgets( response, GEN_STRLEN, stdin );
-		    chp = strchr( response, '\n');
+		    fgets(response, GEN_STRLEN, stdin);
+		    chp = strchr(response, '\n');
 		    if (chp)
 			*chp = '\0';
-		    if (strcasecmp( response, "Y" ) == 0) {
+		    if (strcasecmp(response, "Y") == 0) {
 			removeflag = BOOL_TRUE;
 			GotResponse = BOOL_TRUE;
 		    }
-		    else if (strcasecmp( response, "N" ) == 0) {
+		    else if (strcasecmp(response, "N") == 0) {
 			GotResponse = BOOL_TRUE;
 		    }
 		}
@@ -891,26 +891,26 @@ CheckAndPruneStObjFile( bool_t checkonly,
 
 	i++;
 
-	StObjhdr = (invt_seshdr_t *)( temp + sizeof(invt_sescounter_t) +
-				      (i * sizeof(invt_seshdr_t)) );
+	StObjhdr = (invt_seshdr_t *)(temp + sizeof(invt_sescounter_t) +
+				      (i * sizeof(invt_seshdr_t)));
 	StObjses = (invt_session_t *)(temp + StObjhdr->sh_sess_off);
     }
 
     validEntries = counter->ic_curnum - prunedcount - removedcount;
 
-    munmap( temp, sb.st_size);
+    munmap(temp, sb.st_size);
 
     if (debug && removedcount)
 	printf("       pruned %d entries from this StObj file,"
 	       " %d remaining\n", removedcount, validEntries);
 
-    close( fd );
+    close(fd);
 
     if (validEntries == 0)
     {
 	if (debug)
 	    printf("Removing: %s\n", StObjFileName);
-	unlink( StObjFileName );
+	unlink(StObjFileName);
 	return(-1);
     }
 
@@ -938,10 +938,10 @@ uses_specified_mf_label(
     if (!r_mf_label) {
 	return 1;	/* prune */
     }
-    for ( s = 0; s < (int) StObjses->s_cur_nstreams; s++ ) {
+    for (s = 0; s < (int) StObjses->s_cur_nstreams; s++) {
 	StObjstrm = (invt_stream_t *)
 	    (temp + StObjhdr->sh_streams_off + (s * sizeof(invt_stream_t)));
-	for ( m = 0; m < StObjstrm->st_nmediafiles; m++, num_media_objects++) {
+	for (m = 0; m < StObjstrm->st_nmediafiles; m++, num_media_objects++) {
 	    StObjmed = (invt_mediafile_t *)
 		(temp + StObjstrm->st_firstmfile + (m * sizeof(invt_mediafile_t)));
 	    if (!strncmp(StObjmed->mf_label, r_mf_label,
@@ -963,7 +963,7 @@ uses_specified_mf_label(
 
 /* copied from inv_api.c */
 char *
-inv_DEBUG_lock_str( int c )
+inv_DEBUG_lock_str(int c)
 {
 #ifdef USE_LOCKF
     static char *lockstr[] = {
@@ -1050,9 +1050,9 @@ open_and_lock(char * path, Open_t open_type, uint lock_wait_flag)
 
     fd = open(path, open_mode);
     if (fd < 0) {
-	fprintf( stderr, "%s: open of %s failed.\n",
+	fprintf(stderr, "%s: open of %s failed.\n",
 		 g_programName, path);
-	perror( "open" );
+	perror("open");
 	return SYSCALL_FAILED;
     }
 
@@ -1146,16 +1146,16 @@ mmap_n_bytes(int fd, size_t count, bool_t checkonly, char *path)
 {
     void *  temp;
 
-    lseek( fd, 0, SEEK_SET );
-    temp = mmap( NULL, count,
+    lseek(fd, 0, SEEK_SET);
+    temp = mmap(NULL, count,
 		 (checkonly == BOOL_TRUE) ? PROT_READ : PROT_READ|PROT_WRITE,
-		 MAP_SHARED, fd, 0 );
+		 MAP_SHARED, fd, 0);
 
     if (temp == (void *)-1) {
-	fprintf( stderr, "%s: error in mmap of %ld bytes for file %s\n",
+	fprintf(stderr, "%s: error in mmap of %ld bytes for file %s\n",
 		 g_programName, (long) count, path);
 	perror("mmap");
-	fprintf( stderr, "%s: abnormal termination\n", g_programName );
+	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
     return temp;
diff --git a/invutil/invutil.h b/invutil/invutil.h
index f1b1681..db5fc26 100644
--- a/invutil/invutil.h
+++ b/invutil/invutil.h
@@ -46,8 +46,8 @@ char *	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);
diff --git a/invutil/stobj.c b/invutil/stobj.c
index 582858f..2912e0c 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -409,12 +409,12 @@ 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);
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index 82c9032..b5726d9 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -56,7 +56,7 @@ char *buf;
 
 	_rmt_abort(fildes);
 
-	setoserror( EIO );
+	setoserror(EIO);
 	return(-1);
 }
 
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 92a49d7..8bfaea7 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -54,10 +54,10 @@ struct stat *buf;
 static int
 _rmt_fstat(int fildes, char *arg)
 {
-	char buffer[ BUFMAGIC ];
+	char buffer[BUFMAGIC];
 	int rc, cnt, adj_rc;
 
-	sprintf( buffer, "Z%d\n", fildes );
+	sprintf(buffer, "Z%d\n", fildes);
 
 	/*
 	 *	grab the status and read it directly into the structure
@@ -83,7 +83,7 @@ _rmt_fstat(int fildes, char *arg)
 		{
 abortit:
 			_rmt_abort(fildes);
-			setoserror( EIO );
+			setoserror(EIO);
 			return(-1);
 		}
 	}
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index edcd611..84932a5 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -193,7 +193,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		if (RMTHOST(fildes) == UNAME_UNDEFINED) {
 			_rmt_msg(RMTWARN,
 		_("rmtioctl: remote host type not supported for MTIOCTOP\n"));
-			setoserror( EPROTONOSUPPORT );
+			setoserror(EPROTONOSUPPORT);
 			return(-1);
 		}
 
@@ -201,7 +201,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		if (RMTHOST(fildes) == UNAME_IRIX) {
 			mt_op = mtop_irixmap[mt_op];
 			if (mt_op == -1) {
-			    setoserror( EINVAL );
+			    setoserror(EINVAL);
 			    return(-1);
 			}
 		}
@@ -209,7 +209,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		/* map the linux op code to the standard/fallback op code */
 			mt_op = mtop_stdmap[mt_op];
 			if (mt_op == -1) {
-			    setoserror( EINVAL );
+			    setoserror(EINVAL);
 			    return(-1);
 			}
 		}
@@ -248,7 +248,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		    case UNAME_UNDEFINED:
 			_rmt_msg(RMTWARN,
 		_("rmtioctl: remote host type not supported for MTIOCGET\n"));
-			setoserror( EPROTONOSUPPORT );
+			setoserror(EPROTONOSUPPORT);
 			return(-1);
 		    case UNAME_IRIX:
 			if (sizeof(struct irix_mtget) != rc) {
@@ -256,7 +256,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 				_("rmtioctl: IRIX mtget structure of wrong size"
 				  " - got %d, wanted %d\n"),
 				rc, sizeof(struct irix_mtget));
-			    setoserror( EPROTONOSUPPORT );
+			    setoserror(EPROTONOSUPPORT);
 			    return(-1);
 			}
 			break;
@@ -273,12 +273,12 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			  "- got %d, wanted %d or %d\n"),
 				rc, sizeof(struct linux32_mtget),
 				sizeof(struct linux64_mtget));
-			    setoserror( EPROTONOSUPPORT );
+			    setoserror(EPROTONOSUPPORT);
 			    return(-1);
 			}
 			break;
 		    default:
-			setoserror( EPROTONOSUPPORT );
+			setoserror(EPROTONOSUPPORT);
 			return(-1);
 		}
 
@@ -303,7 +303,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			cnt = read(READ(fildes), p, ssize);
 			if (cnt <= 0) {
 				_rmt_abort(fildes);
-				setoserror( EIO );
+				setoserror(EIO);
 				return(-1);
 			}
 		}
@@ -421,7 +421,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 
 	}
         else {
-	    setoserror( EINVAL );
+	    setoserror(EINVAL);
 	    return(-1);
 	}
 }
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 09ba3e4..a091c72 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -120,7 +120,7 @@ static int _rmt_open (char *path, int oflag, int mode)
 
 	if (i == MAXUNIT)
 	{
-		setoserror( EMFILE );
+		setoserror(EMFILE);
 		return(-1);
 	}
 
@@ -144,7 +144,7 @@ static int _rmt_open (char *path, int oflag, int mode)
 	}
 	else
 	{
-		for ( user = login; (*sys = *user); user++, sys++ )
+		for (user = login; (*sys = *user); user++, sys++)
 			;
 		user = login;
 	}
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index 21d909d..f141395 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -47,7 +47,7 @@ int fildes;
 		if (read(READ(fildes), cp, 1) != 1)
 		{
 			_rmt_abort(fildes);
-			setoserror( EIO );
+			setoserror(EIO);
 			return(-1);
 		}
 		if (*cp == '\n')
@@ -60,7 +60,7 @@ int fildes;
 	if (i == BUFMAGIC)
 	{
 		_rmt_abort(fildes);
-		setoserror( EIO );
+		setoserror(EIO);
 		return(-1);
 	}
 
@@ -74,7 +74,7 @@ int fildes;
 
 	if (*cp == 'E' || *cp == 'F')
 	{
-		setoserror( atoi(cp + 1) );
+		setoserror(atoi(cp + 1));
 		while (read(READ(fildes), &c, 1) == 1)
 			if (c == '\n')
 				break;
@@ -92,7 +92,7 @@ int fildes;
 	if (*cp != 'A')
 	{
 		_rmt_abort(fildes);
-		setoserror( EIO );
+		setoserror(EIO);
 		return(-1);
 	}
 
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index 9e5a1a3..9b4cc50 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -67,6 +67,6 @@ static int _rmt_write(int fildes, char *buf, unsigned int nbyte)
 	}
 
 	_rmt_abort(fildes);
-	setoserror( EIO );
+	setoserror(EIO);
 	return(-1);
 }
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 07/24] xfsdump: (style) remove a space in front of comma/semicolon
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (3 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 06/24] xfsdump: (4/4)(style) " Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 08/24] xfsdump: (style) remove a space in ptr dereferences Jan Tulak
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Turn all the "x , y , z" into "x, y, z" and "for (moo ; foo ; bar)"
to "for (moo; foo; bar)".

Created by this script:

#!/usr/bin/env bash
# remove the space before , and ;

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/ ,/,/g" \
    -e "s/ ;/;/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/cldmgr.c         |   8 +-
 common/cleanup.c        |   4 +-
 common/dlog.c           |  14 ++--
 common/drive.c          |  10 +--
 common/drive_minrmt.c   |  40 ++++-----
 common/drive_scsitape.c |  42 +++++-----
 common/drive_simple.c   |   4 +-
 common/fs.c             |   8 +-
 common/global.c         |   4 +-
 common/hsmapi.c         |   2 +-
 common/main.c           |  34 ++++----
 common/media.c          |   8 +-
 common/mlog.c           |  18 ++--
 common/path.c           |  10 +--
 common/ring.c           |   6 +-
 common/stream.c         |  12 +--
 common/ts_mtio.h        |   2 +-
 common/util.c           |  10 +--
 dump/content.c          |  64 +++++++-------
 dump/inomap.c           |  18 ++--
 include/swab.h          |   6 +-
 inventory/inv_api.c     |   8 +-
 inventory/inv_idx.c     |   4 +-
 inventory/inv_oref.c    |   2 +-
 inventory/inv_stobj.c   |  20 ++---
 invutil/invutil.c       |   8 +-
 librmt/rmtfstat.c       |   2 +-
 librmt/rmtioctl.c       |   2 +-
 restore/bag.c           |   4 +-
 restore/content.c       | 182 ++++++++++++++++++++--------------------
 restore/dirattr.c       |   6 +-
 restore/inomap.c        |  36 ++++----
 restore/namreg.c        |   4 +-
 restore/node.c          |   2 +-
 restore/tree.c          |  46 +++++-----
 35 files changed, 325 insertions(+), 325 deletions(-)

diff --git a/common/cldmgr.c b/common/cldmgr.c
index ba931f1..ebe9101 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -133,7 +133,7 @@ cldmgr_join(void)
 	int xc = EXIT_NORMAL;
 
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (p->c_state == C_EXITED) {
 			if ((int)(p->c_streamix) >= 0) {
 				stream_dead(p->c_tid);
@@ -173,7 +173,7 @@ cldmgr_remainingcnt(void)
 
 	cnt = 0;
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (p->c_state == C_ALIVE) {
 			cnt++;
 		}
@@ -190,7 +190,7 @@ cldmgr_otherstreamsremain(ix_t streamix)
 	cld_t *ep = cld + sizeof(cld) / sizeof(cld[0]);
 
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (p->c_state == C_ALIVE && p->c_streamix != streamix) {
 			unlock();
 			return BOOL_TRUE;
@@ -208,7 +208,7 @@ cldmgr_getcld(void)
 	cld_t *ep = cld + sizeof(cld) / sizeof(cld[0]);
 
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (p->c_state == C_AVAIL) {
 			p->c_state = C_ALIVE;
 			break;
diff --git a/common/cleanup.c b/common/cleanup.c
index 5248f3c..572355f 100644
--- a/common/cleanup.c
+++ b/common/cleanup.c
@@ -98,9 +98,9 @@ cleanup_cancel(cleanup_t *cleanupp)
 	assert(cu_rootp);
 
 	for (prevp = 0, nextp = cu_rootp
-	      ;
+	     ;
 	      nextp && nextp != p
-	      ;
+	     ;
 	      prevp = nextp, nextp = nextp->cu_nextp)
 	;
 
diff --git a/common/dlog.c b/common/dlog.c
index 47940f4..f62f374 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -88,7 +88,7 @@ dlog_init(int argc, char *argv[])
 	}
 #ifdef RESTORE
 	/* look to see if restore source coming in on
-	 * stdin. If so , try to open /dev/tty for dialogs.
+	 * stdin. If so, try to open /dev/tty for dialogs.
 	 */
 	if (optind < argc && ! strcmp(argv[optind], "-")) {
 		dlog_ttyfd = open("/dev/tty", O_RDWR);
@@ -150,7 +150,7 @@ dlog_begin(char *preamblestr[], size_t preamblecnt)
 	size_t ix;
 
 	mlog_lock();
-	for (ix = 0 ; ix < preamblecnt ; ix++) {
+	for (ix = 0; ix < preamblecnt; ix++) {
 		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      preamblestr[ix]);
 	}
@@ -161,7 +161,7 @@ dlog_end(char *postamblestr[], size_t postamblecnt)
 {
 	size_t ix;
 
-	for (ix = 0 ; ix < postamblecnt ; ix++) {
+	for (ix = 0; ix < postamblecnt; ix++) {
 		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      postamblestr[ix]);
 	}
@@ -193,14 +193,14 @@ dlog_multi_query(char *querystr[],
 
 	/* display query description strings
 	 */
-	for (ix = 0 ; ix < querycnt ; ix++) {
+	for (ix = 0; ix < querycnt; ix++) {
 		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      querystr[ix]);
 	}
 
 	/* display the choices: NOTE: display is 1-based, code intfs 0-based!
 	 */
-	for (ix = 0 ; ix < choicecnt ; ix++) {
+	for (ix = 0; ix < choicecnt; ix++) {
 		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      "%u: %s",
 		      ix + 1,
@@ -231,7 +231,7 @@ dlog_multi_query(char *querystr[],
 	/* read the tty until we get a proper answer or are interrupted
 	 */
 	prepromptstr = "";
-	for (; ;) {
+	for (;;) {
 		ix_t exceptionix;
 		bool_t ok;
 
@@ -275,7 +275,7 @@ dlog_multi_ack(char *ackstr[], size_t ackcnt)
 {
 	size_t ix;
 
-	for (ix = 0 ; ix < ackcnt ; ix++) {
+	for (ix = 0; ix < ackcnt; ix++) {
 		mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE,
 		      ackstr[ix]);
 	}
diff --git a/common/drive.c b/common/drive.c
index c7a80a1..17aae6c 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -199,7 +199,7 @@ drive_init1(int argc, char *argv[])
 	/* run each drive past each strategy, pick the best match
 	 * and instantiate a drive manager.
 	 */
-	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+	for (driveix = 0; driveix < drivecnt; driveix++) {
 		drive_t *drivep = drivepp[driveix];
 		int bestscore = 0 - INTGENMAX;
 		ix_t six;
@@ -207,7 +207,7 @@ drive_init1(int argc, char *argv[])
 		drive_strategy_t *bestsp = 0;
 		bool_t ok;
 
-		for (six = 0 ; six < scnt ; six++) {
+		for (six = 0; six < scnt; six++) {
 			drive_strategy_t *sp = strategypp[six];
 			int score;
 			score = (* sp->ds_match)(argc,
@@ -250,7 +250,7 @@ drive_init2(int argc,
 {
 	ix_t driveix;
 
-	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+	for (driveix = 0; driveix < drivecnt; driveix++) {
 		drive_t *drivep = drivepp[driveix];
 		bool_t ok;
 
@@ -273,7 +273,7 @@ drive_init3(void)
 {
 	ix_t driveix;
 
-	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+	for (driveix = 0; driveix < drivecnt; driveix++) {
 		drive_t *drivep = drivepp[driveix];
 		bool_t ok;
 
@@ -335,7 +335,7 @@ drive_display_metrics(void)
 {
 	ix_t driveix;
 
-	for (driveix = 0 ; driveix < drivecnt ; driveix++) {
+	for (driveix = 0; driveix < drivecnt; driveix++) {
 		drive_t *drivep = drivepp[driveix];
 		drive_ops_t *dop = drivep->d_opsp;
 		if (dop->do_display_metrics) {
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 0581781..d0d1e09 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -269,7 +269,7 @@ static int ds_instantiate(int, char *[], drive_t *);
 static bool_t do_init(drive_t *);
 static bool_t do_sync(drive_t *);
 static int do_begin_read(drive_t *);
-static char *do_read(drive_t *, size_t , size_t *, int *);
+static char *do_read(drive_t *, size_t, size_t *, int *);
 static void do_return_read_buf(drive_t *, char *, size_t);
 static void do_get_mark(drive_t *, drive_mark_t *);
 static int do_seek_mark(drive_t *, drive_mark_t *);
@@ -278,12 +278,12 @@ static void do_get_mark(drive_t *, drive_mark_t *);
 static void do_end_read(drive_t *);
 static int do_begin_write(drive_t *);
 static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
-static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static char * do_get_write_buf(drive_t *, size_t, size_t *);
 static int do_write(drive_t *, char *, size_t);
 static size_t do_get_align_cnt(drive_t *);
 static int do_end_write(drive_t *, off64_t *);
-static int do_fsf(drive_t *, int , int *);
-static int do_bsf(drive_t *, int , int *);
+static int do_fsf(drive_t *, int, int *);
+static int do_bsf(drive_t *, int, int *);
 static int do_rewind(drive_t *);
 static int do_erase(drive_t *);
 static int do_eject_media(drive_t *);
@@ -293,7 +293,7 @@ static void do_quit(drive_t *);
 
 /* misc. local utility funcs
  */
-static int	mt_op(int , int , int);
+static int	mt_op(int, int, int);
 static int determine_write_error(int, int);
 static int read_label(drive_t *);
 static bool_t tape_rec_checksum_check(drive_context_t *, char *);
@@ -423,7 +423,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)
 
 	/* Check if the min rmt flag and block size have
 	 * been specified.
-	 * If so , this is a non-SGI drive and this is the right
+	 * If so, this is a non-SGI drive and this is the right
 	 * strategy.
 	 */
 	{
@@ -653,7 +653,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)
 				 DRIVE_CAP_ERASE
 				 |
 				 DRIVE_CAP_EJECT
-				 ;
+				;
 
 	return BOOL_TRUE;
 }
@@ -757,7 +757,7 @@ do_begin_read(drive_t *drivep)
 			return rval;
 		}
 	} else {
-		rval = read_label(drivep) ;
+		rval = read_label(drivep);
 		if (rval) {
 			if (! contextp->dc_singlethreadedpr) {
 			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
@@ -1330,7 +1330,7 @@ do_next_mark(drive_t *drivep)
 	}
 
 noerrorsearch:
-	for (; ;) {
+	for (;;) {
 		rval = getrec(drivep);
 		if (rval == DRIVE_ERROR_CORRUPTION) {
 			goto resetring;
@@ -1516,9 +1516,9 @@ huntQIC:
 	 * to read the remaining blocks in the record.
 	 */
 	for (p = contextp->dc_recp + QIC_BLKSZ
-	      ;
+	     ;
 	      p < contextp->dc_recendp
-	      ;
+	     ;
 	      p += QIC_BLKSZ) {
 		if (*(uint64_t *)p == STAPE_MAGIC) {
 			goto adjustQIC;
@@ -2230,7 +2230,7 @@ do_fsf(drive_t *drivep, int count, int *statp)
 	assert(count);
 	assert(contextp->dc_mode == OM_NONE);
 
-	for (i = 0 ; i < count; i++) {
+	for (i = 0; i < count; i++) {
 		done = 0;
 		opcount = 2;
 
@@ -2328,7 +2328,7 @@ do_bsf(drive_t *drivep, int count, int *statp)
 
 	/* now loop, skipping media files
 	 */
-	for (skipped = 0 ; skipped < count ; skipped++) {
+	for (skipped = 0; skipped < count; skipped++) {
 
 		/* move to the left of the next file mark on the left.
 		 * check for BOT.
@@ -2932,7 +2932,7 @@ tape_rec_checksum_set(drive_context_t *contextp, char *bufp)
 	INT_SET(rechdrp->ischecksum, ARCH_CONVERT, 1);
 	rechdrp->checksum = 0;
 	accum = 0;
-	for (p = beginp ; p < endp ; p++) {
+	for (p = beginp; p < endp; p++) {
 	        accum += INT_GET(*p, ARCH_CONVERT);
 	}
 	INT_SET(rechdrp->checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
@@ -2949,7 +2949,7 @@ tape_rec_checksum_check(drive_context_t *contextp, char *bufp)
 
 	if (contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
 		accum = 0;
-		for (p = beginp ; p < endp ; p++) {
+		for (p = beginp; p < endp; p++) {
 	       		accum += INT_GET(*p, ARCH_CONVERT);
 		}
 		return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
@@ -3088,7 +3088,7 @@ prepare_drive(drive_t *drivep)
 	 * if not present or write-protected during dump, return.
 	 */
 	maxtries = 15;
-	for (try = 1 ; ; sleep(10), try++) {
+	for (try = 1;; sleep(10), try++) {
 		if (cldmgr_stop_requested()) {
 			return DRIVE_ERROR_STOP;
 		}
@@ -3139,7 +3139,7 @@ prepare_drive(drive_t *drivep)
 	else
 		tape_recsz = tape_blksz;
 
-	/* if the overwrite option was specified , return.
+	/* if the overwrite option was specified, return.
 	 */
 	if (contextp->dc_overwritepr) {
 		mlog(MLOG_DEBUG | MLOG_DRIVE,
@@ -3157,7 +3157,7 @@ prepare_drive(drive_t *drivep)
 	maxtries = 5;
 	changedblkszpr = BOOL_FALSE;
 
-	for (try = 1 ; ; try++) {
+	for (try = 1;; try++) {
 		int nread;
 		int saved_errno;
 
@@ -3896,7 +3896,7 @@ rewind_and_verify(drive_t *drivep)
 	int rval;
 
 	rval = mt_op(contextp->dc_fd, MTREW, 0);
-	for (try = 1 ; ; try++) {
+	for (try = 1;; try++) {
 		if (rval) {
 			sleep(1);
 			rval = mt_op(contextp->dc_fd, MTREW, 0);
@@ -3935,7 +3935,7 @@ erase_and_verify(drive_t *drivep)
 	 * detect if we have erased the tape.
 	 */
 
-	tempbufp = (char *) calloc(1 , (size_t)tape_recsz);
+	tempbufp = (char *) calloc(1, (size_t)tape_recsz);
 	strcpy(tempbufp, ERASE_MAGIC);
 	Write(drivep, tempbufp, tape_recsz, &saved_errno);
 	free(tempbufp);
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 4be1291..c9ba0cf 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -311,7 +311,7 @@ static int ds_instantiate(int, char *[], drive_t *);
 static bool_t do_init(drive_t *);
 static bool_t do_sync(drive_t *);
 static int do_begin_read(drive_t *);
-static char *do_read(drive_t *, size_t , size_t *, int *);
+static char *do_read(drive_t *, size_t, size_t *, int *);
 static void do_return_read_buf(drive_t *, char *, size_t);
 static void do_get_mark(drive_t *, drive_mark_t *);
 static int do_seek_mark(drive_t *, drive_mark_t *);
@@ -320,12 +320,12 @@ static void do_get_mark(drive_t *, drive_mark_t *);
 static void do_end_read(drive_t *);
 static int do_begin_write(drive_t *);
 static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
-static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static char * do_get_write_buf(drive_t *, size_t, size_t *);
 static int do_write(drive_t *, char *, size_t);
 static size_t do_get_align_cnt(drive_t *);
 static int do_end_write(drive_t *, off64_t *);
-static int do_fsf(drive_t *, int , int *);
-static int do_bsf(drive_t *, int , int *);
+static int do_fsf(drive_t *, int, int *);
+static int do_bsf(drive_t *, int, int *);
 static int do_rewind(drive_t *);
 static int do_erase(drive_t *);
 static int do_eject_media(drive_t *);
@@ -335,8 +335,8 @@ static void do_quit(drive_t *);
 
 /* misc. local utility funcs
  */
-static int	mt_op(int , int , int);
-static int mt_blkinfo(int , struct mtblkinfo *);
+static int	mt_op(int, int, int);
+static int mt_blkinfo(int, struct mtblkinfo *);
 static bool_t mt_get_fileno(drive_t *, long *);
 static bool_t mt_get_status(drive_t *, mtstat_t *);
 static int determine_write_error(drive_t *, int, int);
@@ -762,7 +762,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)
 				 DRIVE_CAP_REMOVABLE
 				 |
 				 DRIVE_CAP_ERASE
-				 ;
+				;
 
 	/* initialize origcurblksz so we only save it once
 	 */
@@ -1445,7 +1445,7 @@ do_next_mark(drive_t *drivep)
 	}
 
 noerrorsearch:
-	for (; ;) {
+	for (;;) {
 		rval = getrec(drivep);
 		if (rval == DRIVE_ERROR_CORRUPTION) {
 			goto resetring;
@@ -1659,9 +1659,9 @@ huntQIC:
 	 * to read the remaining blocks in the record.
 	 */
 	for (p = contextp->dc_recp + QIC_BLKSZ
-	      ;
+	     ;
 	      p < contextp->dc_recendp
-	      ;
+	     ;
 	      p += QIC_BLKSZ) {
 		if (*(uint64_t *)p == STAPE_MAGIC) {
 			goto adjustQIC;
@@ -2403,7 +2403,7 @@ do_fsf(drive_t *drivep, int count, int *statp)
 		return 0;
 	}
 
-	for (i = 0 ; i < count; i++) {
+	for (i = 0; i < count; i++) {
 		done = 0;
 		opcount = 2;
 
@@ -2559,7 +2559,7 @@ do_bsf(drive_t *drivep, int count, int *statp)
 
 	/* now loop, skipping media files
 	 */
-	for (skipped = 0 ; skipped < count ; skipped++) {
+	for (skipped = 0; skipped < count; skipped++) {
 
 		/* move to the left of the next file mark on the left.
 		 * check for BOT.
@@ -3146,7 +3146,7 @@ set_fixed_blksz(drive_t *drivep, size_t blksz)
 
 	/* give it two tries: first without rewinding, second with rewinding
 	 */
-	for (try = 1 ; try <= 2 ; try++) {
+	for (try = 1; try <= 2; try++) {
 		struct mtblkinfo mtinfo;
 
 		/* set the tape block size. requires re-open
@@ -3624,7 +3624,7 @@ tape_rec_checksum_set(drive_context_t *contextp, char *bufp)
 	INT_SET(rechdrp->ischecksum, ARCH_CONVERT, 1);
 	rechdrp->checksum = 0;
 	accum = 0;
-	for (p = beginp ; p < endp ; p++) {
+	for (p = beginp; p < endp; p++) {
 	        accum += INT_GET(*p, ARCH_CONVERT);
 	}
 	INT_SET(rechdrp->checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
@@ -3641,7 +3641,7 @@ tape_rec_checksum_check(drive_context_t *contextp, char *bufp)
 
 	if (contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
 		accum = 0;
-		for (p = beginp ; p < endp ; p++) {
+		for (p = beginp; p < endp; p++) {
 	       		accum += INT_GET(*p, ARCH_CONVERT);
 		}
 		return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
@@ -3878,7 +3878,7 @@ retry:
 	 * if not present or write-protected during dump, return.
 	 */
 	maxtries = 15;
-	for (try = 1 ; ; sleep(10), try++) {
+	for (try = 1;; sleep(10), try++) {
 		if (cldmgr_stop_requested()) {
 			return DRIVE_ERROR_STOP;
 		}
@@ -3990,7 +3990,7 @@ retry:
 		return DRIVE_ERROR_INVAL;
 	}
 
-	/* if the overwrite option was specified , set the best blocksize
+	/* if the overwrite option was specified, set the best blocksize
 	 * we can and return.
 	 */
 	if (contextp->dc_overwritepr) {
@@ -4051,7 +4051,7 @@ retry:
  	 */
 	maxtries = 5;
 	changedblkszpr = BOOL_FALSE;
-	for (try = 1 ; ; try++) {
+	for (try = 1;; try++) {
 		bool_t wasatbotpr;
 		int nread;
 		int saved_errno;
@@ -5175,7 +5175,7 @@ rewind_and_verify(drive_t *drivep)
 	int rval;
 
 	rval = mt_op(contextp->dc_fd, MTREW, 0);
-	for (try = 1 ; ; try++) {
+	for (try = 1;; try++) {
 		mtstat_t mtstat;
 		bool_t ok;
 
@@ -5231,7 +5231,7 @@ bsf_and_verify(drive_t *drivep)
 	/* Can't do with LINUX ST driver, as GMT_EOF never set for left of fmk */
 	if (TS_ISDRIVER) {
 		(void)mt_op(contextp->dc_fd, MTBSF, 1);
-		for (try = 1 ; ; try++) {
+		for (try = 1;; try++) {
 			mtstat_t mtstat;
 
 			ok = mt_get_status(drivep, &mtstat);
@@ -5301,7 +5301,7 @@ fsf_and_verify(drive_t *drivep)
 	ix_t try;
 
 	(void)mt_op(contextp->dc_fd, MTFSF, 1);
-	for (try = 1 ; ; try++) {
+	for (try = 1;; try++) {
 		mtstat_t mtstat;
 		bool_t ok;
 
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 81d75d4..697a597 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -116,7 +116,7 @@ static int ds_instantiate(int, char *[], drive_t *);
 static bool_t do_init(drive_t *);
 static bool_t do_sync(drive_t *);
 static int do_begin_read(drive_t *);
-static char *do_read(drive_t *, size_t , size_t *, int *);
+static char *do_read(drive_t *, size_t, size_t *, int *);
 static void do_return_read_buf(drive_t *, char *, size_t);
 static void do_get_mark(drive_t *, drive_mark_t *);
 static int do_seek_mark(drive_t *, drive_mark_t *);
@@ -125,7 +125,7 @@ static void do_get_mark(drive_t *, drive_mark_t *);
 static void do_end_read(drive_t *);
 static int do_begin_write(drive_t *);
 static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
-static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static char * do_get_write_buf(drive_t *, size_t, size_t *);
 static int do_write(drive_t *, char *, size_t);
 static size_t do_get_align_cnt(drive_t *);
 static int do_end_write(drive_t *, off64_t *);
diff --git a/common/fs.c b/common/fs.c
index 04cb7c4..1bb0c2c 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -271,9 +271,9 @@ fs_tab_free(void)
 	fs_tab_ent_t *otep;
 
 	for (tep = fs_tabp
-	      ;
+	     ;
 	      tep
-	      ;
+	     ;
 	      otep = tep, tep = tep->fte_nextp, fs_tab_ent_free(otep) )
 
 		;
@@ -333,7 +333,7 @@ fs_tab_lookup_blk(char *blks)
 {
 	fs_tab_ent_t *tep;
 
-	for (tep = fs_tabp ; tep ; tep = tep->fte_nextp) {
+	for (tep = fs_tabp; tep; tep = tep->fte_nextp) {
 		struct stat64 stata;
 		bool_t aok;
 		struct stat64 statb;
@@ -361,7 +361,7 @@ fs_tab_lookup_mnt(char *mnts)
 {
 	fs_tab_ent_t *tep;
 
-	for (tep = fs_tabp ; tep ; tep = tep->fte_nextp) {
+	for (tep = fs_tabp; tep; tep = tep->fte_nextp) {
 		if (tep->fte_mnts && ! strcmp(tep->fte_mnts, mnts)) {
 			return tep;
 		}
diff --git a/common/global.c b/common/global.c
index 6971e2b..42bfc3d 100644
--- a/common/global.c
+++ b/common/global.c
@@ -250,7 +250,7 @@ global_hdr_checksum_set(global_hdr_t *hdrp)
 
 	hdrp->gh_checksum = 0;
 	accum = 0;
-	for (p = beginp ; p < endp ; p++) {
+	for (p = beginp; p < endp; p++) {
 		accum += INT_GET(*p, ARCH_CONVERT);
 	}
 	INT_SET(hdrp->gh_checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
@@ -269,7 +269,7 @@ global_hdr_checksum_check(global_hdr_t *hdrp)
 	uint32_t accum;
 
 	accum = 0;
-	for (p = beginp ; p < endp ; p++) {
+	for (p = beginp; p < endp; p++) {
 		accum += INT_GET(*p, ARCH_CONVERT);
 	}
 	return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 24bb924..e3e18a7 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -871,7 +871,7 @@ HsmEndRestoreFile(
 	 */
 	if (*hsm_flagp) {
 		int rv;
-		rv = attr_removef(fd, DMF_ATTR_NAME , ATTR_ROOT);
+		rv = attr_removef(fd, DMF_ATTR_NAME, ATTR_ROOT);
 		if (rv) {
 			mlog(MLOG_NORMAL | MLOG_WARNING,
 			     _("error removing temp DMF attr on %s: %s\n"),
diff --git a/common/main.c b/common/main.c
index a9affe2..3f3ce0c 100644
--- a/common/main.c
+++ b/common/main.c
@@ -656,7 +656,7 @@ main(int argc, char *argv[])
 	 * drive.h, initialized by drive_init[12]
 	 */
 	if (! init_error) {
-		for (stix = 0 ; stix < drivecnt ; stix++) {
+		for (stix = 0; stix < drivecnt; stix++) {
 			ok = cldmgr_create(childmain,
 					    stix,
 					    "child",
@@ -673,7 +673,7 @@ main(int argc, char *argv[])
 	if (progrpt_enabledpr) {
 		(void)alarm((uint)progrpt_interval);
 	}
-	for (; ;) {
+	for (;;) {
 		time32_t now;
 		bool_t stop_requested = BOOL_FALSE;
 		int stop_timeout = -1;
@@ -839,7 +839,7 @@ main(int argc, char *argv[])
 				char **statline;
 				ix_t i;
 				statlinecnt = content_statline(&statline);
-				for (i = 0 ; i < statlinecnt ; i++) {
+				for (i = 0; i < statlinecnt; i++) {
 					mlog(MLOG_NORMAL,
 					      statline[i]);
 				}
@@ -1054,7 +1054,7 @@ preemptchk(int flg)
 			char **statline;
 			ix_t i;
 			statlinecnt = content_statline(&statline);
-			for (i = 0 ; i < statlinecnt ; i++) {
+			for (i = 0; i < statlinecnt; i++) {
 				mlog(MLOG_NORMAL,
 				      statline[i]);
 			}
@@ -1217,7 +1217,7 @@ loadoptfile(int *argcp, char ***argvp)
 	 * skip the GETOPT_OPTFILE option which put us here!
 	 */
 	sz = 0;
-	for (i =  0 ; i < *argcp ; i++) {
+	for (i =  0; i < *argcp; i++) {
 		if (i == (int)optfileix) {
 			i++; /* to skip option argument */
 			continue;
@@ -1261,7 +1261,7 @@ loadoptfile(int *argcp, char ***argvp)
 
 	/* copy the remaining command line args into the buffer
 	 */
-	for (; i < *argcp ; i++) {
+	for (; i < *argcp; i++) {
 		if (i == (int)optfileix) {
 			i++; /* to skip option argument */
 			continue;
@@ -1277,7 +1277,7 @@ loadoptfile(int *argcp, char ***argvp)
 
 	/* change newlines and carriage returns into spaces
 	 */
-	for (p = argbuf ; *p ; p++) {
+	for (p = argbuf; *p; p++) {
 		if (strchr("\n\r", (int)(*p))) {
 			*p = ' ';
 		}
@@ -1287,7 +1287,7 @@ loadoptfile(int *argcp, char ***argvp)
 	 */
 	tokencnt = 0;
 	p = argbuf;
-	for (; ;) {
+	for (;;) {
 		/* start at the first non-separator character
 		 */
 		while (*p && strchr(sep, (int)(*p))) {
@@ -1331,7 +1331,7 @@ loadoptfile(int *argcp, char ***argvp)
 	 * extracting quotes and escapes
 	 */
 	p = argbuf;
-	for (i = 0 ; ; i++) {
+	for (i = 0;; i++) {
 		char *endp = 0;
 
 		/* start at the first non-separator character
@@ -1547,7 +1547,7 @@ sigint_dialog(void)
 	preamblestr[preamblecnt++] = fold;
 	preamblestr[preamblecnt++] = "\n";
 	preamblestr[preamblecnt++] = "\n";
-	for (i = 0 ; i < statlinecnt ; i++) {
+	for (i = 0; i < statlinecnt; i++) {
 		preamblestr[preamblecnt++] = statline[i];
 	}
 	if (stop_in_progress) {
@@ -1649,7 +1649,7 @@ sigint_dialog(void)
 		choicecnt = 0;
 		/* number of lines must match number of subsystems
 		 */
-		for (choicecnt = 0 ; choicecnt < MLOG_SS_CNT ; choicecnt++) {
+		for (choicecnt = 0; choicecnt < MLOG_SS_CNT; choicecnt++) {
 			choicestr[choicecnt] = mlog_ss_names[choicecnt];
 		}
 		allix = choicecnt;
@@ -1732,9 +1732,9 @@ sigint_dialog(void)
 					ix_t ssix;
 					assert(ssselected == -1);
 					for (ssix = 0
-					      ;
+					     ;
 					      ssix < MLOG_SS_CNT
-					      ;
+					     ;
 					      ssix++) {
 						mlog_level_ss[ssix] =
 							(int)responseix;
@@ -2264,7 +2264,7 @@ sig_numstring(int num)
 			       (sizeof(sig_printmap)
 			         /
 			         sizeof(sig_printmap[0]));
-	for (; p < endp ; p++) {
+	for (; p < endp; p++) {
 		if (p->num == num) {
 			return p->string;
 		}
@@ -2279,7 +2279,7 @@ strpbrkquotes(char *p, const char *sep)
 	bool_t prevcharwasbackslash = BOOL_FALSE;
 	bool_t inquotes = BOOL_FALSE;
 
-	for (; ; p++) {
+	for (;; p++) {
 		if (*p == 0) {
 			return 0;
 		}
@@ -2337,7 +2337,7 @@ stripquotes(char *p)
 	endp = p + len;
 	justremovedbackslash = BOOL_FALSE;
 
-	for (nextp = p ; nextp < endp ;) {
+	for (nextp = p; nextp < endp;) {
 		if (*nextp == '\\' && ! justremovedbackslash) {
 			shiftleftby1(nextp, endp);
 			endp--;
@@ -2354,7 +2354,7 @@ stripquotes(char *p)
 static void
 shiftleftby1(char *p, char *endp)
 {
-	for (; p < endp ; p++) {
+	for (; p < endp; p++) {
 		*p = p[1];
 	}
 }
diff --git a/common/media.c b/common/media.c
index 15c0478..2337a84 100644
--- a/common/media.c
+++ b/common/media.c
@@ -144,7 +144,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 	mediacnt = dsp->ds_drivecnt;
 	mediapp = (media_t **)calloc(mediacnt, sizeof(media_t *));
 	assert(mediapp);
-	for (mediaix = 0 ; mediaix < mediacnt ; mediaix++) {
+	for (mediaix = 0; mediaix < mediacnt; mediaix++) {
 		mediapp[mediaix] = media_alloc(dsp->ds_drivep[mediaix],
 					 	  medialabel);
 	}
@@ -156,7 +156,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 	 * media_strategy_t as well as the write headers.
 	 */
 	chosen_sp = 0;
-	for (id = 0 ; spp < epp ; spp++, id++) {
+	for (id = 0; spp < epp; spp++, id++) {
 		(*spp)->ms_id = id;
 		if (! chosen_sp) {
 			/* lend the media_t array to the strategy
@@ -164,7 +164,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 			(*spp)->ms_mediap = mediapp;
 			(*spp)->ms_dsp = dsp;
 			(*spp)->ms_mediacnt = mediacnt;
-			for (mediaix = 0 ; mediaix < mediacnt ; mediaix++) {
+			for (mediaix = 0; mediaix < mediacnt; mediaix++) {
 				media_t *mediap = mediapp[mediaix];
 				mediap->m_strategyp = *spp;
 				mediap->m_writehdrp->mh_strategyid = id;
@@ -191,7 +191,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 
 	/* give the media_t array to the chosen strategy
 	 */
-	for (mediaix = 0 ; mediaix < mediacnt ; mediaix++) {
+	for (mediaix = 0; mediaix < mediacnt; mediaix++) {
 		media_t *mediap = mediapp[mediaix];
 		mediap->m_strategyp = chosen_sp;
 		mediap->m_writehdrp->mh_strategyid = chosen_sp->ms_id;
diff --git a/common/mlog.c b/common/mlog.c
index db38290..e09c16c 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -138,7 +138,7 @@ mlog_init0(void)
 	 */
 	mlog_streamcnt = 1;
 
-	for(i = 0 ; i < MLOG_SS_CNT ; i++) {
+	for(i = 0; i < MLOG_SS_CNT; i++) {
 		mlog_level_ss[i] = MLOG_VERBOSE;
 	}
 }
@@ -160,12 +160,12 @@ mlog_init1(int argc, char *argv[])
 	suboptstrs = (char **)calloc(MLOG_SS_CNT + vsymcnt + 1,
 					sizeof(char *));
 	assert(suboptstrs);
-	for (soix = 0 ; soix < MLOG_SS_CNT ; soix++) {
+	for (soix = 0; soix < MLOG_SS_CNT; soix++) {
 		assert(strlen(mlog_ss_names[soix]) <= MLOG_SS_NAME_MAX);
 			/* unrelated, but opportunity to chk */
 		suboptstrs[soix] = mlog_ss_names[soix];
 	}
-	for (; soix < MLOG_SS_CNT + vsymcnt ; soix++) {
+	for (; soix < MLOG_SS_CNT + vsymcnt; soix++) {
 		suboptstrs[soix] = mlog_sym[soix - MLOG_SS_CNT].sym;
 	}
 	suboptstrs[soix] = 0;
@@ -174,7 +174,7 @@ mlog_init1(int argc, char *argv[])
 	 * subsystems where explicitly called out. those which weren't will
 	 * be given the "general" level.
 	 */
-	for (ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++) {
+	for (ssix = 0; ssix < MLOG_SS_CNT; ssix++) {
 		mlog_level_ss[ssix] = -1;
 	}
 	mlog_level_ss[MLOG_SS_GEN] = MLOG_VERBOSE;
@@ -273,7 +273,7 @@ mlog_init1(int argc, char *argv[])
 
 	/* give subsystems not explicitly called out the "general" verbosity
 	 */
-	for (ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++) {
+	for (ssix = 0; ssix < MLOG_SS_CNT; ssix++) {
 		if (mlog_level_ss[ssix] < 0) {
 			assert(mlog_level_ss[ssix] == -1);
 			assert(mlog_level_ss[MLOG_SS_GEN] >= 0);
@@ -350,7 +350,7 @@ mlog_override_level(int levelarg)
 	ss = (ix_t)((levelarg & MLOG_SS_MASK) >> MLOG_SS_SHIFT);
 
 	if (ss == MLOG_SS_GEN) { /* do level for all subsys */
-	    for (ss = 0 ; ss < MLOG_SS_CNT ; ss++) {
+	    for (ss = 0; ss < MLOG_SS_CNT; ss++) {
 		mlog_level_ss[ss] = level;
 	    }
 	}
@@ -792,7 +792,7 @@ mlog_sym_lookup(char *sym)
 			 +
 			 sizeof(mlog_sym) / sizeof(mlog_sym[0]);
 
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (! strcmp(sym, p->sym)) {
 			return p->level;
 		}
@@ -827,7 +827,7 @@ fold_init(fold_t fold, char *infostr, char c)
 
 	assert(p < endp);
 	*p++ = ' ';
-	for (cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++) {
+	for (cnt = 0; cnt < predashlen && p < endp; cnt++, p++) {
 		*p = c;
 	}
 	assert(p < endp);
@@ -839,7 +839,7 @@ fold_init(fold_t fold, char *infostr, char c)
 	assert(p < endp);
 	*p++ = ' ';
 	assert(p < endp);
-	for (cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++) {
+	for (cnt = 0; cnt < postdashlen && p < endp; cnt++, p++) {
 		*p = c;
 	}
 	assert(p <= endp);
diff --git a/common/path.c b/common/path.c
index ea97ee9..1c275e4 100644
--- a/common/path.c
+++ b/common/path.c
@@ -64,7 +64,7 @@ path_diff(char *path, char *base)
 		return 0;
 	}
 
-	for (; *base && *path == *base ; path++, base++)
+	for (; *base && *path == *base; path++, base++)
 		;
 
 	if (*path == 0) {
@@ -202,7 +202,7 @@ pem_next(pem_t *pemp)
 	/* if end of string encountered, place next next at end of string
 	 */
 	if (! nextnext) {
-		for (nextnext = pemp->pem_next ; *nextnext ; nextnext++)
+		for (nextnext = pemp->pem_next; *nextnext; nextnext++)
 			;
 	}
 
@@ -246,7 +246,7 @@ pa_free(pa_t *pap)
 {
 	int i;
 
-	for (i = 0 ; i < pap->pa_cnt ; i++) {
+	for (i = 0; i < pap->pa_cnt; i++) {
 		free((void *)pap->pa_array[i]);
 	}
 
@@ -288,7 +288,7 @@ pa_gen(pa_t *pap)
 	char *p;
 
 	sz = 0;
-	for (i = 0 ; i < pap->pa_cnt ; i++) {
+	for (i = 0; i < pap->pa_cnt; i++) {
 		sz += strlen(pap->pa_array[i]) + 1;
 	}
 	if (i == 0)
@@ -302,7 +302,7 @@ pa_gen(pa_t *pap)
 		sprintf(retp, "/");
 	} else {
 		p = retp;
-		for (i = 0 ; i < pap->pa_cnt ; i++) {
+		for (i = 0; i < pap->pa_cnt; i++) {
 			sprintf(p, "/%s", pap->pa_array[i]);
 			p += strlen(p);
 		}
diff --git a/common/ring.c b/common/ring.c
index d1fbcb7..faef34f 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -90,7 +90,7 @@ ring_create(size_t ringlen,
 
 	/* allocate the buffers and initialize the messages
 	 */
-	for (mix = 0 ; mix < ringlen ; mix++) {
+	for (mix = 0; mix < ringlen; mix++) {
 		ring_msg_t *msgp = &ringp->r_msgp[mix];
 		msgp->rm_mix = mix;
 		msgp->rm_op = RING_OP_NONE;
@@ -264,7 +264,7 @@ ring_reset(ring_t *ringp, ring_msg_t *msgp)
 	ringp->r_active_out_ix = 0;
 	ringp->r_client_cnt = 0;
 	ringp->r_slave_cnt = 0;
-	for (mix = 0 ; mix < ringp->r_len ; mix++) {
+	for (mix = 0; mix < ringp->r_len; mix++) {
 		ring_msg_t *msgp = &ringp->r_msgp[mix];
 		msgp->rm_mix = mix;
 		msgp->rm_op = RING_OP_NONE;
@@ -420,7 +420,7 @@ ring_slave_entry(void *ringctxp)
 
 	/* loop reading and precessing messages until told to die
 	 */
-	for (loopmode = LOOPMODE_NORMAL ; loopmode != LOOPMODE_DIE ;) {
+	for (loopmode = LOOPMODE_NORMAL; loopmode != LOOPMODE_DIE;) {
 		ring_msg_t *msgp;
 		int rval;
 
diff --git a/common/stream.c b/common/stream.c
index 67a3c81..f7a0cce 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -69,7 +69,7 @@ stream_register(pthread_t tid, int streamix)
 	assert(streamix < STREAM_SIMMAX);
 
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (p->s_state == S_FREE) {
 			p->s_state = S_RUNNING;
 			break;
@@ -94,7 +94,7 @@ stream_dead(pthread_t tid)
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
 
-	for (; p < ep ; p++)
+	for (; p < ep; p++)
 		if (pthread_equal(p->s_tid, tid) ) {
 			p->s_state = S_ZOMBIE;
 			break;
@@ -109,7 +109,7 @@ stream_free(pthread_t tid)
 	spm_t *ep = spm + N(spm);
 
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (pthread_equal(p->s_tid, tid) ) {
 			(void) memset((void *) p, 0, sizeof(spm_t));
 			p->s_state = S_FREE;
@@ -154,7 +154,7 @@ stream_find(pthread_t tid, stream_state_t s[], int nstates)
 	assert(nstates > 0);
 
 	/* note we don't lock the stream array in this function */
-	for (; p < ep ; p++)
+	for (; p < ep; p++)
 		if (pthread_equal(p->s_tid, tid) ) {
 			/* check state */
 			for (i = 0; i < nstates; i++)
@@ -279,7 +279,7 @@ stream_cnt(void)
 	assert(sizeof(ixmap) * NBBY >= STREAM_SIMMAX);
 
 	lock();
-	for (; p < ep ; p++) {
+	for (; p < ep; p++) {
 		if (p->s_state == S_RUNNING) {
 			ixmap |= (size_t)1 << p->s_ix;
 		}
@@ -287,7 +287,7 @@ stream_cnt(void)
 	unlock();
 
 	ixcnt = 0;
-	for (bitix = 0 ; bitix < STREAM_SIMMAX ; bitix++) {
+	for (bitix = 0; bitix < STREAM_SIMMAX; bitix++) {
 		if (ixmap & ((size_t)1 << bitix)) {
 			ixcnt++;
 		}
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 9e4ae4c..9b31d25 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -146,7 +146,7 @@ struct	mtget_sgi	{
 	int	mt_blkno;	/* block number of current position */
 };
 
-/* old mtget structure , still keep it around for compatibility reason */
+/* old mtget structure, still keep it around for compatibility reason */
 /* the librmt and /etc/rmt code uses it */
 struct	old_mtget	{
 	short	mt_type;	/* type of magtape device */
diff --git a/common/util.c b/common/util.c
index 4a7826a..621d340 100644
--- a/common/util.c
+++ b/common/util.c
@@ -175,7 +175,7 @@ bigstat_iter(jdm_fshandle_t *fshandlep,
 		      "bulkstat returns buflen %d ino %llu\n",
 		      buflenout,
 		      buf->bs_ino);
-		for (p = buf, endp = buf + buflenout ; p < endp ; p++) {
+		for (p = buf, endp = buf + buflenout; p < endp; p++) {
 			int rval;
 
 			if (p->bs_ino == 0)
@@ -308,7 +308,7 @@ inogrp_iter(int fsfd,
 			free(igrp);
 			return 0;
 		}
-		for (p = igrp, endp = igrp + inogrpcnt ; p < endp ; p++) {
+		for (p = igrp, endp = igrp + inogrpcnt; p < endp; p++) {
 			int rval;
 
 			rval = (* fp)(arg1, fsfd, p);
@@ -388,7 +388,7 @@ diriter(jdm_fshandle_t *fshandlep,
 	 */
 	scrval = 0;
 	cbrval = 0;
-	for (gdcnt = 1 ; ; gdcnt++) {
+	for (gdcnt = 1;; gdcnt++) {
 		struct dirent *p;
 		int nread;
 		register size_t reclen;
@@ -421,9 +421,9 @@ diriter(jdm_fshandle_t *fshandlep,
 		 */
 		for (p = gdp,
 		      reclen = (size_t)p->d_reclen
-		      ;
+		     ;
 		      nread > 0
-		      ;
+		     ;
 		      nread -= (int)reclen,
 		      assert(nread >= 0),
 		      p = (struct dirent *)((char *)p + reclen),
diff --git a/dump/content.c b/dump/content.c
index 81159ee..7627b8a 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -888,7 +888,7 @@ content_init(int argc,
 			return BOOL_FALSE;
 		}
 		strcnt =  (ix_t)sessp->s_nstreams;
-		for (strix = 0 ; strix < strcnt ; strix++) {
+		for (strix = 0; strix < strcnt; strix++) {
 			bsp = &sessp->s_streams[strix];
 			if (bsp->st_interrupted) {
 				interruptedpr = BOOL_TRUE;
@@ -908,7 +908,7 @@ content_init(int argc,
 			sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
 								sizeof(drange_t));
 			assert(sc_resumerangep);
-			for (strmix = 0 ; strmix < sc_resumerangecnt ; strmix++) {
+			for (strmix = 0; strmix < sc_resumerangecnt; strmix++) {
 				inv_stream_t *bsp;
 				inv_stream_t *esp;
 				drange_t *p = &sc_resumerangep[strmix];
@@ -1009,7 +1009,7 @@ content_init(int argc,
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
 			strcnt =  (ix_t)sessp->s_nstreams;
-			for (strix = 0 ; strix < strcnt ; strix++) {
+			for (strix = 0; strix < strcnt; strix++) {
 				bsp = &sessp->s_streams[strix];
 				if (bsp->st_interrupted) {
 					underinterruptedpr = BOOL_TRUE;
@@ -1054,7 +1054,7 @@ content_init(int argc,
 		sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
 						        sizeof(drange_t));
 		assert(sc_resumerangep);
-		for (strmix = 0 ; strmix < sc_resumerangecnt ; strmix++) {
+		for (strmix = 0; strmix < sc_resumerangecnt; strmix++) {
 			inv_stream_t *bsp;
 			inv_stream_t *esp;
 			drange_t *p = &sc_resumerangep[strmix];
@@ -1578,7 +1578,7 @@ baseuuidbypass:
 	 */
 	sc_contextp = (context_t *)calloc(drivecnt, sizeof(context_t));
 	assert(sc_contextp);
-	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+	for (strmix = 0; strmix < drivecnt; strmix++) {
 		context_t *contextp = &sc_contextp[strmix];
 
 		contextp->cc_filehdrp =
@@ -1720,7 +1720,7 @@ baseuuidbypass:
 		ix_t endix = sizeof(sc_mcflag)
 			     /
 			     sizeof(sc_mcflag[0]);
-		for (ix = 0 ; ix < endix ; ix++) {
+		for (ix = 0; ix < endix; ix++) {
 			sc_mcflag[ix] = BOOL_FALSE;
 		}
 	}
@@ -1730,7 +1730,7 @@ baseuuidbypass:
 	 */
 	{
 		ix_t driveix;
-		for (driveix = 0 ; driveix < STREAM_SIMMAX ; driveix++) {
+		for (driveix = 0; driveix < STREAM_SIMMAX; driveix++) {
 			sc_stat_pds[driveix].pds_phase = PDS_NULL;
 		}
 	}
@@ -1756,7 +1756,7 @@ content_statline(char **linespp[])
 
 	/* build and supply the line array
 	 */
-	for (i = 0 ; i < STREAM_SIMMAX + 1 ; i++) {
+	for (i = 0; i < STREAM_SIMMAX + 1; i++) {
 		statline[i] = &statlinebuf[i][0];
 	}
 	*linespp = statline;
@@ -1864,7 +1864,7 @@ content_statline(char **linespp[])
 	/* optionally create stat lines for each drive
 	 */
 	statlinecnt = 1;
-	for (i = 0 ; i < drivecnt ; i++) {
+	for (i = 0; i < drivecnt; i++) {
 		pds_t *pdsp = &sc_stat_pds[i];
 		if (pdsp->pds_phase == PDS_NULL
 		     ||
@@ -1968,7 +1968,7 @@ create_inv_session(
 	sc_inv_stmtokenp = (inv_stmtoken_t *)
 				calloc(drivecnt, sizeof(inv_stmtoken_t));
 	assert(sc_inv_stmtokenp);
-	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+	for (strmix = 0; strmix < drivecnt; strmix++) {
 		drive_t *drivep = drivepp[strmix];
 		char *drvpath;
 
@@ -2195,7 +2195,7 @@ content_stream_dump(ix_t strmix)
 	 * The current startpoint will be updated each time a media mark
 	 * is committed.
 	 */
-	for (; ;) {
+	for (;;) {
 		xfs_ino_t startino;
 		bool_t stop_requested;
 		bool_t hit_eom;
@@ -2747,7 +2747,7 @@ content_mediachange_query(void)
 	querystr[querycnt++] = "select a drive to acknowledge media change\n";
 	choicecnt = 0;
 	maxdrvchoiceix = 0;
-	for (thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++) {
+	for (thrdix = 0; thrdix < STREAM_SIMMAX; thrdix++) {
 		if (sc_mcflag[thrdix]) {
 			choicetothrdmap[choicecnt].thrdix = thrdix;
 			sprintf(choicetothrdmap[choicecnt].choicestr,
@@ -2819,7 +2819,7 @@ dump_dirs(ix_t strmix,
 	/* begin iteration at ino zero
 	 */
 	lastino = 0;
-	for (bulkstatcallcnt = 0 ; ; bulkstatcallcnt++) {
+	for (bulkstatcallcnt = 0;; bulkstatcallcnt++) {
 		xfs_bstat_t *p;
 		xfs_bstat_t *endp;
 		__s32 buflenout;
@@ -2873,9 +2873,9 @@ dump_dirs(ix_t strmix,
 		 * appropriate
 		 */
 		for (p = bstatbufp, endp = bstatbufp + buflenout
-		      ;
+		     ;
 		      p < endp
-		      ;
+		     ;
 		      p++) {
 			rv_t rv;
 
@@ -3024,7 +3024,7 @@ dump_dir(ix_t strmix,
 	/* dump dirents - lots of buffering done here, to achieve OS-
 	 * independence. if proves to be to much overhead, can streamline.
 	 */
-	for (gdcnt = 1, rv = RV_OK ; rv == RV_OK ; gdcnt++) {
+	for (gdcnt = 1, rv = RV_OK; rv == RV_OK; gdcnt++) {
 		struct dirent *p;
 		int nread;
 		register size_t reclen;
@@ -3061,9 +3061,9 @@ dump_dir(ix_t strmix,
 		 */
 		for (p = gdp,
 		      reclen = (size_t)p->d_reclen
-		      ;
+		     ;
 		      nread > 0
-		      ;
+		     ;
 		      nread -= (int)reclen,
 		      assert(nread >= 0),
 		      p = (struct dirent *)((char *)p + reclen),
@@ -3295,7 +3295,7 @@ dump_extattr_list(drive_t *drivep,
 	 */
 	dumpbufp = contextp->cc_extattrdumpbufp;
 	endp = dumpbufp;
-	for (nameix = 0 ; nameix < listlen ;) {
+	for (nameix = 0; nameix < listlen;) {
 		ix_t rtrvix;
 		size_t rtrvcnt;
 
@@ -3382,7 +3382,7 @@ dump_extattr_list(drive_t *drivep,
 				return RV_OK;
 			}
 
-			for (rtrvix = 0 ; rtrvix < rtrvcnt ; rtrvix++) {
+			for (rtrvix = 0; rtrvix < rtrvcnt; rtrvix++) {
 				attr_multiop_t *opp;
 				opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
 				if (opp->am_error) {
@@ -3976,7 +3976,7 @@ dump_file_reg(drive_t *drivep,
 		size_t drangecnt = sc_resumerangecnt;
 		size_t drangeix;
 
-		for (drangeix = 0 ; drangeix < drangecnt ; drangeix++) {
+		for (drangeix = 0; drangeix < drangecnt; drangeix++) {
 			drange_t *rp = &drangep[drangeix];
 			if (statp->bs_ino == rp->dr_begin.sp_ino) {
 				register time32_t mtime = statp->bs_mtime.tv_sec;
@@ -4051,7 +4051,7 @@ dump_file_reg(drive_t *drivep,
 	cmpltflg = BOOL_FALSE;
 
 	rv = RV_OK;
-	for (; ;) {
+	for (;;) {
 		off64_t bytecnt = 0;
 		off64_t bc;
 
@@ -4377,7 +4377,7 @@ dump_extent_group(drive_t *drivep,
 	bytecnt = 0;
 	assert((nextoffset & (BBSIZE - 1)) == 0);
 
-	for (; ;) {
+	for (;;) {
 		off64_t offset;
 		off64_t extsz;
 
@@ -4829,7 +4829,7 @@ dump_extent_group(drive_t *drivep,
 				     ((s.f_flag & ST_LOCAL) != 0))
 				   mlog(MLOG_NORMAL, _(
 		"can't read ino %llu at offset %d (act=%d req=%d) rt=%d\n"),
-		statp->bs_ino, new_off, actualsz , reqsz, isrealtime);
+		statp->bs_ino, new_off, actualsz, reqsz, isrealtime);
 #endif /* HIDDEN */
 
 				nread = 0;
@@ -5240,7 +5240,7 @@ dump_session_inv(drive_t *drivep,
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
-	for (done = BOOL_FALSE ; ! done ;) {
+	for (done = BOOL_FALSE; ! done;) {
 		uuid_t mediaid;
 		char medialabel[GLOBAL_HDR_STRING_SZ];
 		bool_t partial;
@@ -5390,7 +5390,7 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
-	for (done = BOOL_FALSE ; ! done ;) {
+	for (done = BOOL_FALSE; ! done;) {
 		bool_t partial;
 		rv_t rv;
 
@@ -5504,9 +5504,9 @@ inv_cleanup(void)
 		for (strmix = 0,
 		      inv_stmtp = sc_inv_stmtokenp,
 		      contextp = sc_contextp
-		      ;
+		     ;
 		      strmix < drivecnt
-		      ;
+		     ;
 		      strmix++,
 		      inv_stmtp++,
 		      contextp++) {
@@ -5626,7 +5626,7 @@ position:
 	 * be concatenated but not jumbled. a dump stream must be virtually
 	 * contiguous.
 	 */
-	for (; ;) {
+	for (;;) {
 		/* check if a stop has been requested
 		 */
 		if (intr_allowed && cldmgr_stop_requested()) {
@@ -5963,7 +5963,7 @@ changemedia:
 		return RV_QUIT; /* this return value will cause approp. msg */
 	}
 
-	/* If an alert program has been specified , run it
+	/* If an alert program has been specified, run it
 	 */
 	if (media_change_alert_program != NULL)
 	   system(media_change_alert_program);
@@ -6549,7 +6549,7 @@ clr_mcflag(ix_t thrdix)
 {
 	lock();
 	sc_mcflag[thrdix] = BOOL_FALSE;
-	for (thrdix = 0 ; thrdix < drivecnt ; thrdix++) {
+	for (thrdix = 0; thrdix < drivecnt; thrdix++) {
 		if (sc_mcflag[thrdix]) {
 			unlock();
 			return;
@@ -6565,7 +6565,7 @@ check_complete_flags(void)
 	ix_t strmix;
 	bool_t completepr = BOOL_TRUE;
 
-	for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+	for (strmix = 0; strmix < drivecnt; strmix++) {
 		context_t *contextp = &sc_contextp[strmix];
 		if (! contextp->cc_completepr) {
 			completepr = BOOL_FALSE;
diff --git a/dump/inomap.c b/dump/inomap.c
index 75e26e2..182d99e 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -363,7 +363,7 @@ inomap_build(jdm_fshandle_t *fshandlep,
 
 	if (startptcnt > 1) {
 		ix_t startptix;
-		for (startptix = 0 ; startptix < startptcnt ; startptix++) {
+		for (startptix = 0; startptix < startptcnt; startptix++) {
 			startpt_t *p;
 			startpt_t *ep;
 
@@ -643,7 +643,7 @@ cb_inoinresumerange(xfs_ino_t ino)
 {
 	register size_t streamix;
 
-	for (streamix = 0 ; streamix < cb_resumerangecnt ; streamix++) {
+	for (streamix = 0; streamix < cb_resumerangecnt; streamix++) {
 		register drange_t *rp = &cb_resumerangep[streamix];
 		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
 		     &&
@@ -668,7 +668,7 @@ cb_inoresumed(xfs_ino_t ino)
 {
 	size_t streamix;
 
-	for (streamix = 0 ; streamix < cb_resumerangecnt ; streamix++) {
+	for (streamix = 0; streamix < cb_resumerangecnt; streamix++) {
 		drange_t *rp = &cb_resumerangep[streamix];
 		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
 		     &&
@@ -1283,7 +1283,7 @@ inomap_iter(void *contextp, int statemask)
 
 			ino = segp->base + addrp->inooff;
 			endino = segp->base + INOPERSEG;
-			for (; ino < endino ; ino++, addrp->inooff++) {
+			for (; ino < endino; ino++, addrp->inooff++) {
 				int st;
 				st = SEG_GET_BITS(segp, ino);
 				if (statemask & (1 << st)) {
@@ -1427,8 +1427,8 @@ inomap_dump(drive_t *drivep)
 
 	/* use write_buf to dump the hunks
 	 */
-	for (addr.hnkoff = 0 ;
-	      addr.hnkoff <= inomap.lastseg.hnkoff ;
+	for (addr.hnkoff = 0;
+	      addr.hnkoff <= inomap.lastseg.hnkoff;
 	      addr.hnkoff++) {
 		int rval;
 		rv_t rv;
@@ -1484,7 +1484,7 @@ subtreelist_parse(jdm_fshandle_t *fshandlep,
 
 	/* do a recursive descent for each subtree specified
 	 */
-	for (subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++) {
+	for (subtreeix = 0; subtreeix < subtreecnt; subtreeix++) {
 		int cbrval = 0;
 		char *currentpath = subtreebuf[subtreeix];
 		assert(*currentpath != '/');
@@ -1658,7 +1658,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 		return 0;
 	}
 
-	for (; ;) {
+	for (;;) {
 		int eix;
 		int rval;
 
@@ -1678,7 +1678,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 			return offset_next;
 		}
 
-		for (eix = 1 ; eix <= bmap[0].bmv_entries ; eix++) {
+		for (eix = 1; eix <= bmap[0].bmv_entries; eix++) {
 			getbmapx_t *bmapp = &bmap[eix];
 			off64_t qty_new;
 			if (bmapp->bmv_block == -1) {
diff --git a/include/swab.h b/include/swab.h
index abfeeb6..234e7d8 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -61,13 +61,13 @@
  * provide defaults when no architecture-specific optimization is detected
  */
 #ifndef __arch__swab16
-#  define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
+#  define __arch__swab16(x) ({ __u16 __tmp = (x); ___swab16(__tmp); })
 #endif
 #ifndef __arch__swab32
-#  define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
+#  define __arch__swab32(x) ({ __u32 __tmp = (x); ___swab32(__tmp); })
 #endif
 #ifndef __arch__swab64
-#  define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
+#  define __arch__swab64(x) ({ __u64 __tmp = (x); ___swab64(__tmp); })
 #endif
 
 #ifndef __arch__swab16p
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 6473811..b9ff239 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -301,7 +301,7 @@ inv_stream_open(
 	 * starting/ending inodes or offsets. This can be misleading.
 	 * See bug #463702 for an example.
 	 */
-	memset((void *)&stream, 0 , sizeof(invt_stream_t));
+	memset((void *)&stream, 0, sizeof(invt_stream_t));
 
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_TRUE; /* fix for 353197 */
@@ -706,7 +706,7 @@ inv_lastsession_level_equalto(
 /*----------------------------------------------------------------------*/
 /* inv_getsession_byuuid                                                */
 /*                                                                      */
-/* Given a file system uuid and a session uuid , ses is populated with	*/
+/* Given a file system uuid and a session uuid, ses is populated with	*/
 /* the session that contains the matching system uuid.			*/
 /*									*/
 /* Returns FALSE on an error, TRUE if the session was found.		*/
@@ -903,7 +903,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 			switch (c) {
 			case GETOPT_INVPRINT:
 				prctx->depth = 0;
-				rval |= I_IFOUND ;
+				rval |= I_IFOUND;
 				break;
 			}
 		}
@@ -915,7 +915,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 		switch (c) {
 		case GETOPT_INVPRINT:
-			rval |= I_IFOUND ;
+			rval |= I_IFOUND;
 			if ((options = optarg) == NULL)
 				break;
 
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 7b36cd6..313cb70 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -191,7 +191,7 @@ idx_put_newentry(
 				  sizeof(invt_counter_t) ) < 0) ) {
 			/* XXX delete the stobj that we just created */
 
-			memset(ient->ie_filename, 0 , INV_STRLEN);
+			memset(ient->ie_filename, 0, INV_STRLEN);
 			free(idxarr);
 			return -1;
 		}
@@ -263,7 +263,7 @@ idx_create(char *fname, inv_oflag_t forwhat)
 	   the db for SEARCH_ONLY. */
 	assert(forwhat != INV_SEARCH_ONLY);
 
-	if ((fd = open (fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
+	if ((fd = open (fname, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
 		INV_PERROR (fname);
 		return INV_TOKEN_NULL;
 	}
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 70fc634..d2f1515 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -432,7 +432,7 @@ oref_resolve_new_invidx(
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
-	if ((fd = open (fname , O_RDWR | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
+	if ((fd = open (fname, O_RDWR | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
 		INV_PERROR (fname);
 		return INV_ERR;
 	}
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 235e621..022e9b2 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -909,7 +909,7 @@ stobj_getsession_bylabel(
 bool_t
 stobj_delete_mobj(int fd,
 		  invt_seshdr_t *hdr,
-		  void *arg ,
+		  void *arg,
 		  void **buf)
 {
 	/* XXX fd needs to be locked EX, not SH */
@@ -977,7 +977,7 @@ stobj_delete_mobj(int fd,
 				       mfiles[j-1].mf_nextmf = mf->mf_nextmf;
 
 				if (j == nmfiles - 1)
-				       strms[i].st_lastmfile = ;
+				       strms[i].st_lastmfile =;
 */
 			}
 
@@ -1026,7 +1026,7 @@ stobj_unpack_sessinfo(
 	/* skip the cookie */
 	p += strlen(INVTSESS_COOKIE) * sizeof(char);
 
-	/* Check the packing version number. In version 1 , this was the only version number.
+	/* 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) {
@@ -1040,15 +1040,15 @@ stobj_unpack_sessinfo(
 		/* 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
 		 * bcopy the remaining part of bufp to a new malloc'ed area
-		 * which will be 64 bit aligned. This is a memory leak , but not much.
+		 * which will be 64 bit aligned. This is a memory leak, but not much.
 		 * Have to do this because xfsrestore does another round of
-		 * unpack later , so can't disturb the original data.
+		 * unpack later, so can't disturb the original data.
 		 * This is fixed in PACKED_INV_VERSION_2 by adding another (inv_version_t) to
 		 * have the INV_VERSION. This makes everything 64 bit aligned.
 		 */
 
 		tempsz = bufsz - (strlen(INVTSESS_COOKIE) * sizeof(char))
-			       - sizeof(inv_version_t) ;
+			       - sizeof(inv_version_t);
 		temp_p = calloc(1, tempsz);
 		bcopy(p, temp_p, tempsz);
 		p = temp_p;
@@ -1056,7 +1056,7 @@ stobj_unpack_sessinfo(
 	        mlog(MLOG_DEBUG | MLOG_INV,"INV: packed inventory version = 2\n");
 
 		p += sizeof(inv_version_t); /* skip the packed inventory version */
-		/* At this point , don't care about the INV_VERSION. Maybe in future */
+		/* At this point, don't care about the INV_VERSION. Maybe in future */
 		p += sizeof(inv_version_t); /* skip the inventory version */
 	} else {
 	        mlog(MLOG_NORMAL | MLOG_INV, _(
@@ -1303,7 +1303,7 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 	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,
@@ -1377,7 +1377,7 @@ check_for_mobj (inv_session_t *ses, invt_mobjinfo_t *mobj)
 	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 (j = 0; j < ses->s_streams[i].st_nmediafiles; j++) {
 			mfp = &ses->s_streams[i].st_mediafiles[j];
 			if (mobj_eql(mfp, mobj))
 				return BOOL_TRUE;
@@ -1453,7 +1453,7 @@ DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 		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) )
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 242574f..a002d56 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -260,7 +260,7 @@ main(int argc, char *argv[])
     }
     else if (session_option) {
 	CheckAndPruneFstab(
-		    inventory_path, BOOL_FALSE , mntPoint, &uuid,
+		    inventory_path, BOOL_FALSE, mntPoint, &uuid,
 		    &session, (time32_t)0, r_mf_label);
     }
     else if (uuid_option || mntpnt_option) {
@@ -272,7 +272,7 @@ main(int argc, char *argv[])
 	}
 	else {
 	    CheckAndPruneFstab(
-		    inventory_path, BOOL_FALSE , mntPoint, &uuid,
+		    inventory_path, BOOL_FALSE, mntPoint, &uuid,
 		    &session, timeSecs, r_mf_label);
 	}
     }
@@ -496,9 +496,9 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
     {
 	removeflag = BOOL_FALSE;
 
-	printf("   Found entry for %s\n" , fstabentry[i].ft_mountpt);
+	printf("   Found entry for %s\n", fstabentry[i].ft_mountpt);
 
-	for (j = i +1 ; j < counter->ic_curnum ; j++) {
+	for (j = i +1; j < counter->ic_curnum; j++) {
 	    if (uuid_compare(fstabentry[i].ft_uuid, fstabentry[j].ft_uuid) == 0)
 	    {
 		printf("     duplicate fstab entry\n");
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 8bfaea7..7c21219 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -73,7 +73,7 @@ _rmt_fstat(int fildes, char *arg)
 
 	/* adjust read count to prevent overflow */
 
-	adj_rc = (rc > sizeof(struct stat)) ? sizeof(struct stat) : rc ;
+	adj_rc = (rc > sizeof(struct stat)) ? sizeof(struct stat) : rc;
 	rc -= adj_rc;
 
 	for (; adj_rc > 0; adj_rc -= cnt, arg += cnt)
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index 84932a5..536069c 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -391,7 +391,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			if (status & IRIX_MT_FMK)
 			    dstp->mt_gstat |= GMT_EOF(0xffffffff);
 			if (status & IRIX_MT_EW)
-			    ;/* No GMT_ to map it to */
+			   ;/* No GMT_ to map it to */
 		}
 		else if (islinux32) {
 			struct mtget *dstp = (struct mtget *)arg;
diff --git a/restore/bag.c b/restore/bag.c
index d35f8b8..8a8bda4 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -111,9 +111,9 @@ bag_find(bag_t *bagp,
 	register bagelem_t *p;
 
 	for (p = bagp->b_headp
-	      ;
+	     ;
 	      p && p->be_nextp != bagp->b_headp && p->be_key != key
-	      ;
+	     ;
 	      p = p->be_nextp)
 		;
 
diff --git a/restore/content.c b/restore/content.c
index ac76028..8da57ed 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -344,7 +344,7 @@ typedef struct stdesc stdesc_t;
 struct bytespan {
 	off64_t	offset;
 	off64_t	endoffset;
-} ;
+};
 
 typedef struct bytespan bytespan_t;
 
@@ -1902,7 +1902,7 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		ix_t endix = sizeof(mcflag)
 			     /
 			     sizeof(mcflag[0]);
-		for (ix = 0 ; ix < endix ; ix++) {
+		for (ix = 0; ix < endix; ix++) {
 			mcflag[ix] = BOOL_FALSE;
 		}
 	}
@@ -2715,7 +2715,7 @@ content_statline(char **linespp[])
 
 	/* build and supply the line array
 	 */
-	for (i = 0 ; i < 1 ; i++) {
+	for (i = 0; i < 1; i++) {
 		statline[i] = &statlinebuf[i][0];
 	}
 	*linespp = statline;
@@ -2868,7 +2868,7 @@ content_mediachange_query(void)
 		_("select a drive to acknowledge media change\n");
 	choicecnt = 0;
 	maxdrvchoiceix = 0;
-	for (thrdix = 0 ; thrdix < STREAM_SIMMAX ; thrdix++) {
+	for (thrdix = 0; thrdix < STREAM_SIMMAX; thrdix++) {
 		if (mcflag[thrdix]) {
 			choicetothrdmap[choicecnt].thrdix = thrdix;
 			sprintf(choicetothrdmap[choicecnt].choicestr,
@@ -3050,12 +3050,12 @@ applydirdump(drive_t *drivep,
 				return RV_INTR;
 			}
 
-			/* if in a pipeline , call preemptchk() to
+			/* if in a pipeline, call preemptchk() to
 			 * print status reports
 			 */
 			if (pipeline)
 			{
-				mlog(MLOG_DEBUG ,
+				mlog(MLOG_DEBUG,
 					"preemptchk()\n");
 				preemptchk();
 			}
@@ -3091,7 +3091,7 @@ 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;
 				register size_t namelen;
@@ -3247,7 +3247,7 @@ eatdirdump(drive_t *drivep,
 		 * we can tell when we are done
 		 * by looking for a null dirent.
 		 */
-		for (; ;) {
+		for (;;) {
 			register direnthdr_t *dhdrp =
 					    (direnthdr_t *)direntbuf;
 			/* REFERENCED */
@@ -3354,9 +3354,9 @@ treepost(char *path1, char *path2)
 		 */
 		for (stix = 0,
 		      stdescp = (stdesc_t *)((char *)persp + perssz)
-		      ;
+		     ;
 		      stix < persp->a.stcnt
-		      ;
+		     ;
 		      stix++,
 		      stdescp = (stdesc_t *)((char *)stdescp
 						+
@@ -3448,7 +3448,7 @@ applynondirdump(drive_t *drivep,
 	strctxp->sc_ownerset = BOOL_FALSE;
 
 
-	for (; ;) {
+	for (;;) {
 		drive_ops_t *dop = drivep->d_opsp;
 		drive_mark_t drivemark;
 		bstat_t *bstatp = &fhdrp->fh_stat;
@@ -3590,12 +3590,12 @@ applynondirdump(drive_t *drivep,
 				       fhdrp->fh_offset);
 		}
 
-		/* if in a pipeline , call preemptchk() to
+		/* if in a pipeline, call preemptchk() to
 		 * print status reports
 		 */
 		if (pipeline)
 		{
-			mlog(MLOG_DEBUG ,
+			mlog(MLOG_DEBUG,
 				"preemptchk()\n");
 			preemptchk();
 		}
@@ -3936,7 +3936,7 @@ Media_mfile_next(Media_t *Mediap,
 	/* loop searching for an acceptable media file.
 	 * change media as necessary.
 	 */
-	for (; ;) {
+	for (;;) {
 		bool_t emptypr; /* begin_read says drive empty */
 		bool_t partofdumppr;
 		bool_t hassomepr;
@@ -4791,7 +4791,7 @@ newmedia:
 		 * which may contain useful media files
 		 */
 		if (dlog_allowed()) {
-			/* If an alert program has been specified , run it.
+			/* If an alert program has been specified, run it.
 			 */
 			if (media_change_alert_program != NULL)
 				system(media_change_alert_program);
@@ -4966,9 +4966,9 @@ pi_allocdesc(dh_t *deschp)
 		}
 		persp->s.descfreeh = (dh_t)(olddescpgcnt * pgsz + 1);
 		for (descix = 0, desch = persp->s.descfreeh
-		      ;
+		     ;
 		      descix < (DAU * descppg) - 1
-		      ;
+		     ;
 		      descix++, desch += PERS_DESCSZ) {
 			DH2D(desch)->d_nexth = desch + PERS_DESCSZ;
 		}
@@ -5026,7 +5026,7 @@ pi_insertfile(ix_t drivecnt,
 	/* first alloc stream descriptors if needed
 	 */
 	if (persp->s.strmheadh == DH_NULL) {
-		for (strmix = 0 ; strmix < drivecnt ; strmix++) {
+		for (strmix = 0; strmix < drivecnt; strmix++) {
 			ok = pi_allocdesc(&strmh);
 			if (! ok) {
 				pi_unlock();
@@ -5041,9 +5041,9 @@ pi_insertfile(ix_t drivecnt,
 	 */
 	for (strmix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmix < driveix
-	      ;
+	     ;
 	      strmix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -5053,7 +5053,7 @@ pi_insertfile(ix_t drivecnt,
 	 * object list, up to the desired object
 	 */
 	objh = prevobjh = DH_NULL;
-	for (objix = 0 ; objix <= mediaix ; objix++) {
+	for (objix = 0; objix <= mediaix; objix++) {
 		prevobjh = objh;
 		if (objix == 0) {
 			objh = DH2S(strmh)->s_cldh;
@@ -5171,7 +5171,7 @@ 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;
@@ -5516,7 +5516,7 @@ pi_transcribe(inv_session_t *sessp)
 	/* traverse inventory, transcribing into pers inv.
 	 */
 	strmcnt =  (size_t)sessp->s_nstreams;
-	for (strmix = 0 ; strmix < strmcnt ; strmix++) {
+	for (strmix = 0; strmix < strmcnt; strmix++) {
 		inv_stream_t *strmp;
 		size_t fileix;
 		size_t filecnt;
@@ -5535,7 +5535,7 @@ pi_transcribe(inv_session_t *sessp)
 		/* 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;
 
@@ -5604,20 +5604,20 @@ pi_preclean(void)
 	dh_t fileh;
 
 	for (strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL
-	      ;
+	     ;
 	      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
-			      ;
+			     ;
 			      fileh != DH_NULL
-			      ;
+			     ;
 			      fileh = DH2F(fileh)->f_nexth) {
 				DH2F(fileh)->f_underheadpr = BOOL_FALSE;
 			}
@@ -5637,23 +5637,23 @@ pi_driveempty(ix_t driveix)
 	pi_lock();
 
 	for (strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL
-	      ;
+	     ;
 	      strmh = DH2S(strmh)->s_nexth) {
 		for (objh = DH2S(strmh)->s_cldh
-		      ;
+		     ;
 		      objh != DH_NULL
-		      ;
+		     ;
 		      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
-				      ;
+				     ;
 				      fileh != DH_NULL
-				      ;
+				     ;
 				      fileh = DH2F(fileh)->f_nexth) {
 					DH2F(fileh)->f_underheadpr =
 								    BOOL_FALSE;
@@ -5676,14 +5676,14 @@ pi_note_indrive(ix_t driveix, uuid_t media_id)
 	pi_lock();
 
 	for (strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL
-	      ;
+	     ;
 	      strmh = DH2S(strmh)->s_nexth) {
 		for (objh = DH2S(strmh)->s_cldh
-		      ;
+		     ;
 		      objh != DH_NULL
-		      ;
+		     ;
 		      objh = DH2O(objh)->o_nexth) {
 			if (DH2O(objh)->o_idlabvalpr
 			     &&
@@ -5717,9 +5717,9 @@ pi_note_underhead(dh_t thisobjh, dh_t thisfileh)
 	}
 
 	for (fileh = DH2O(thisobjh)->o_cldh
-	      ;
+	     ;
 	      fileh != DH_NULL
-	      ;
+	     ;
 	      fileh = DH2F(fileh)->f_nexth) {
 		if (fileh != thisfileh) {
 			DH2F(fileh)->f_underheadpr = BOOL_FALSE;
@@ -5743,9 +5743,9 @@ pi_seestrmend(ix_t strmix)
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL && ix < strmix
-	      ;
+	     ;
 	      ix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -5781,9 +5781,9 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL && ix < strmix
-	      ;
+	     ;
 	      ix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -5801,9 +5801,9 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	 */
 	for (ix = 0,
 	      objh = DH2S(strmh)->s_cldh
-	      ;
+	     ;
 	      objh != DH_NULL && ix < mediaix
-	      ;
+	     ;
 	      ix++,
 	      objh = DH2O(objh)->o_nexth)
 		;
@@ -5840,23 +5840,23 @@ pi_scanfileendino(dh_t fileh)
 	/* traverse the pi tree, looking for the next media file after
 	 */
 	for (strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL
-	      ;
+	     ;
 	      strmh = DH2S(strmh)->s_nexth) {
 	    dh_t objh;
 
 	    for (objh = DH2S(strmh)->s_cldh
-		  ;
+		 ;
 		  objh != DH_NULL
-		  ;
+		 ;
 		  objh = DH2O(objh)->o_nexth) {
 		dh_t nexth;
 
 		for (nexth = DH2O(objh)->o_cldh
-		      ;
+		     ;
 		      nexth != DH_NULL
-		      ;
+		     ;
 		      nexth = DH2F(nexth)->f_nexth) {
 
 		    switch(mode) {
@@ -5908,23 +5908,23 @@ pi_bracketneededegrps(dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp)
 	assert(DH2F(thisfileh)->f_valpr);
 
 	for (strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL
-	      ;
+	     ;
 	      strmh = DH2S(strmh)->s_nexth) {
 	    dh_t objh;
 
 	    for (objh = DH2S(strmh)->s_cldh
-		  ;
+		 ;
 		  objh != DH_NULL
-		  ;
+		 ;
 		  objh = DH2O(objh)->o_nexth) {
 		dh_t fileh;
 
 		for (fileh = DH2O(objh)->o_cldh
-		      ;
+		     ;
 		      fileh != DH_NULL
-		      ;
+		     ;
 		      fileh = DH2F(fileh)->f_nexth) {
 		    if (! thisfoundpr) {
 			if (fileh == thisfileh) {
@@ -6441,9 +6441,9 @@ pi_hiteod(ix_t strmix, ix_t objix)
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL && ix < strmix
-	      ;
+	     ;
 	      ix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -6452,9 +6452,9 @@ pi_hiteod(ix_t strmix, ix_t objix)
 	/* get index to last object in stream
 	 */
 	for (objcnt = 0, objh = DH2S(strmh)->s_cldh
-	      ;
+	     ;
 	      objh != DH_NULL
-	      ;
+	     ;
 	      objh = DH2O(objh)->o_nexth, objcnt++)
 		;
 	assert(objcnt != 0);
@@ -6504,9 +6504,9 @@ pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL && ix < strmix
-	      ;
+	     ;
 	      ix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -6515,9 +6515,9 @@ pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 	/* get index to last object in stream
 	 */
 	for (objcnt = 0, objh = DH2S(strmh)->s_cldh
-	      ;
+	     ;
 	      objh != DH_NULL
-	      ;
+	     ;
 	      objh = DH2O(objh)->o_nexth, objcnt++)
 		;
 	assert(objcnt != 0);
@@ -6563,9 +6563,9 @@ pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL && ix < strmix
-	      ;
+	     ;
 	      ix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -6574,9 +6574,9 @@ pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 	/* get handle to indexed object
 	 */
 	for (ix = 0, objh = DH2S(strmh)->s_cldh
-	      ;
+	     ;
 	      objh != DH_NULL && ix < objix
-	      ;
+	     ;
 	      ix++,
 	      objh = DH2O(objh)->o_nexth)
 		;
@@ -6593,9 +6593,9 @@ pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 	 * return FALSE.
 	 */
 	for (fileh = DH2O(objh)->o_cldh
-	      ;
+	     ;
 	      fileh != DH_NULL
-	      ;
+	     ;
 	      fileh = DH2F(fileh)->f_nexth) {
 		if (DH2F(fileh)->f_flags & PF_INV) {
 			continue;
@@ -6641,9 +6641,9 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
-	      ;
+	     ;
 	      strmh != DH_NULL && ix < strmix
-	      ;
+	     ;
 	      ix++,
 	      strmh = DH2S(strmh)->s_nexth)
 		;
@@ -6653,9 +6653,9 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 	 */
 	for (ix = 0,
 	      objh = DH2S(strmh)->s_cldh
-	      ;
+	     ;
 	      objh != DH_NULL && ix < objix
-	      ;
+	     ;
 	      ix++,
 	      objh = DH2O(objh)->o_nexth)
 		;
@@ -6673,9 +6673,9 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 	 */
 	for (ix = 0,
 	      fileh = DH2O(objh)->o_cldh
-	      ;
+	     ;
 	      fileh != DH_NULL
-	      ;
+	     ;
 	      ix++,
 	      fileh = DH2F(fileh)->f_nexth) {
 		if (ix <= fileix) {
@@ -7579,7 +7579,7 @@ 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);
@@ -8557,11 +8557,11 @@ restore_extent(filehdr_t *fhdrp,
 				      tries = 0,
 				      remaining = ntowrite,
 				      tmp_off = off
-				      ;
+				     ;
 				      nwritten < (int)ntowrite
 				      &&
 				      tries < WRITE_TRIES_MAX
-				      ;
+				     ;
 				      nwritten += rval,
 				      tries++,
 				      remaining -= (size_t)rval,
@@ -8734,7 +8734,7 @@ restore_extattr(drive_t *drivep,
 
 	/* peel off extattrs until null hdr hit
 	 */
-	for (; ;) {
+	for (;;) {
 		size_t recsz;
 		/* REFERENCED */
 		int nread;
@@ -9274,7 +9274,7 @@ clr_mcflag(ix_t thrdix)
 {
 	lock();
 	mcflag[thrdix] = BOOL_FALSE;
-	for (thrdix = 0 ; thrdix < drivecnt ; thrdix++) {
+	for (thrdix = 0; thrdix < drivecnt; thrdix++) {
 		if (mcflag[thrdix]) {
 			unlock();
 			return;
@@ -9340,9 +9340,9 @@ pi_show_nomloglock(void)
 	/* iterate over all streams
 	 */
 	for (strmh = persp->s.strmheadh, strmix = 0
-	      ;
+	     ;
 	      strmh != DH_NULL
-	      ;
+	     ;
 	      strmh = DH2S(strmh)->s_nexth, strmix++) {
 		dh_t objh;
 		int objix;
@@ -9358,9 +9358,9 @@ pi_show_nomloglock(void)
 		/* iterate over all objects
 		 */
 		for (objh = DH2S(strmh)->s_cldh, objix = 0
-		      ;
+		     ;
 		      objh != DH_NULL
-		      ;
+		     ;
 		      objh = DH2O(objh)->o_nexth, objix++) {
 			dh_t fileh;
 			ix_t fileix;
@@ -9425,9 +9425,9 @@ pi_show_nomloglock(void)
 			/* iterate over all files
 			 */
 			for (fileh = DH2O(objh)->o_cldh, fileix = 0
-			      ;
+			     ;
 			      fileh != DH_NULL
-			      ;
+			     ;
 			      fileh = DH2F(fileh)->f_nexth, fileix++) {
 			    mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 				  _("\n        media file %u"),
diff --git a/restore/dirattr.c b/restore/dirattr.c
index 5368664..864facb 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -268,9 +268,9 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 		      successpr = BOOL_FALSE,
 		      ioctlcmd = XFS_IOC_RESVSP64,
 		      loglevel = MLOG_VERBOSE
-		      ;
+		     ;
 		      ! successpr && trycnt < 2
-		      ;
+		     ;
 		      trycnt++,
 		      ioctlcmd = XFS_IOC_ALLOCSP64,
 		      loglevel = max(MLOG_NORMAL, loglevel - 1)) {
@@ -1114,7 +1114,7 @@ calcdixcum(dix_t dix)
 
 	nibcnt = (sizeof(dah_t) / HDLSUMCNT) - 1;
 	sum = 0;
-	for (nibix = 0 ; nibix < nibcnt ; nibix++) {
+	for (nibix = 0; nibix < nibcnt; nibix++) {
 		sum += (uint16_t)(dix & HDLSUMLOMASK);
 		dix >>= HDLSUMCNT;
 	}
diff --git a/restore/inomap.c b/restore/inomap.c
index 1b03779..8ab588d 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -410,9 +410,9 @@ inomap_sync_pers(char *hkdir)
 	/* correct the next pointers
 	 */
 	for (hnkp = roothnkp
-	      ;
+	     ;
 	      hnkp < roothnkp + (int)hnkcnt - 1
-	      ;
+	     ;
 	      hnkp++) {
 		hnkp->nextp = hnkp + 1;
 	}
@@ -454,23 +454,23 @@ inomap_sanitize(void)
 	/* step through all hunks, segs, and inos
 	 */
 	for (hnkp = roothnkp
-	      ;
+	     ;
 	      hnkp != 0
-	      ;
+	     ;
 	      hnkp = hnkp->nextp) {
 		for (segp = hnkp->seg
-		      ;
+		     ;
 		      segp < hnkp->seg + SEGPERHNK
-		      ;
+		     ;
 		      segp++) {
 			xfs_ino_t ino;
 			if (hnkp == tailhnkp && segp > lastsegp) {
 				return;
 			}
 			for (ino = segp->base
-			      ;
+			     ;
 			      ino < segp->base + INOPERSEG
-			      ;
+			     ;
 			      ino++) {
 				int state;
 				if (ino > last_ino_added) {
@@ -527,11 +527,11 @@ inomap_rst_needed(xfs_ino_t firstino, xfs_ino_t lastino)
 
 	/* find the hunk/seg containing first ino or any ino beyond
 	 */
-	for (hnkp = roothnkp ; hnkp != 0 ; hnkp = hnkp->nextp) {
+	for (hnkp = roothnkp; hnkp != 0; hnkp = hnkp->nextp) {
 		if (firstino > hnkp->maxino) {
 			continue;
 		}
-		for (segp = hnkp->seg; segp < hnkp->seg + SEGPERHNK ; segp++){
+		for (segp = hnkp->seg; segp < hnkp->seg + SEGPERHNK; segp++){
 			if (hnkp == tailhnkp && segp > lastsegp) {
 				return BOOL_FALSE;
 			}
@@ -545,13 +545,13 @@ inomap_rst_needed(xfs_ino_t firstino, xfs_ino_t lastino)
 begin:
 	/* search until at least one ino is needed or until beyond last ino
 	 */
-	for (; ;) {
+	for (;;) {
 		xfs_ino_t ino;
 
 		if (segp->base > lastino) {
 			return BOOL_FALSE;
 		}
-		for (ino = segp->base ; ino < segp->base + INOPERSEG ; ino++){
+		for (ino = segp->base; ino < segp->base + INOPERSEG; ino++){
 			int state;
 			if (ino < firstino) {
 				continue;
@@ -594,23 +594,23 @@ inomap_cbiter(int statemask,
 	/* step through all hunks, segs, and inos
 	 */
 	for (hnkp = roothnkp
-	      ;
+	     ;
 	      hnkp != 0
-	      ;
+	     ;
 	      hnkp = hnkp->nextp) {
 		for (segp = hnkp->seg
-		      ;
+		     ;
 		      segp < hnkp->seg + SEGPERHNK
-		      ;
+		     ;
 		      segp++) {
 			xfs_ino_t ino;
 			if (hnkp == tailhnkp && segp > lastsegp) {
 				return;
 			}
 			for (ino = segp->base
-			      ;
+			     ;
 			      ino < segp->base + INOPERSEG
-			      ;
+			     ;
 			      ino++) {
 				int state;
 				if (ino > last_ino_added) {
diff --git a/restore/namreg.c b/restore/namreg.c
index 45c8099..b6c4724 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -183,9 +183,9 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 		      successpr = BOOL_FALSE,
 		      ioctlcmd = XFS_IOC_RESVSP64,
 		      loglevel = MLOG_VERBOSE
-		      ;
+		     ;
 		      ! successpr && trycnt < 2
-		      ;
+		     ;
 		      trycnt++,
 		      ioctlcmd = XFS_IOC_ALLOCSP64,
 		      loglevel = max(MLOG_NORMAL, loglevel - 1)) {
diff --git a/restore/node.c b/restore/node.c
index 3d0e0b4..b7f2b1b 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -513,7 +513,7 @@ node_alloc(void)
 		return NH_NULL;
 	}
 #ifdef NODECHK
-	node_map_internal(nh , (void **)&p);
+	node_map_internal(nh, (void **)&p);
 	if (p == NULL)
 		abort();
 	hkpp = p + (int)node_hdrp->nh_nodehkix;
diff --git a/restore/tree.c b/restore/tree.c
index 0e5ae71..58b88ff 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -1769,7 +1769,7 @@ tree_cb_links(xfs_ino_t ino,
 	/* 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;
@@ -2811,7 +2811,7 @@ restart:
          * any selected directories and return */
 	if (cmdp == tsi_cmd_quit) {
 		mlog(MLOG_NORMAL, _("Unmark and quit\n"));
-		selsubtree(persp->p_rooth , BOOL_FALSE);
+		selsubtree(persp->p_rooth, BOOL_FALSE);
 	}
 
 	return BOOL_TRUE;
@@ -3149,7 +3149,7 @@ tsi_cmd_match(void)
 		return 0;
 	}
 
-	for (; tblp < tblendp ; tblp++) {
+	for (; tblp < tblendp; tblp++) {
 		if (! strncmp(tranp->t_inter.i_argv[0],
 				tblp->tct_pattern,
 				strlen(tranp->t_inter.i_argv[0]))) {
@@ -3187,7 +3187,7 @@ tsi_cmd_help(void *ctxp,
 				 sizeof(tsi_cmd_tbl[0]);
 
 	(* pcb)(pctxp, _("the following commands are available:\n"));
-	for (; tblp < tblendp ; tblp++) {
+	for (; tblp < tblendp; tblp++) {
 		(* pcb)(pctxp,
 			   "\t%s %s\n",
 			   tblp->tct_pattern,
@@ -3259,7 +3259,7 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 	 *	isdirpr - TRUE if named node is a directory;
 	 *	cldh - the first child in the named node's cld list.
 	 */
-	for (; ;) {
+	for (;;) {
 		size_t namelen;
 		char *strpatchp;
 		nh_t sibh;
@@ -3796,9 +3796,9 @@ selsubtree_recurse_down(nh_t nh, bool_t sensepr)
 				nh_t nh;
 				bool_t neededpr = BOOL_FALSE;
 				for (nh = link_hardh(ino, gen)
-				      ;
+				     ;
 				      nh != NH_NULL
-				      ;
+				     ;
 				      nh = link_nexth(nh)) {
 					node_t *np;
 					u_char_t flags;
@@ -4134,9 +4134,9 @@ hash_init(size64_t vmsz,
 	hashlen = min(hashlen, hashlenmax);
 
 	for (loghashlen = 0
-	      ;
+	     ;
 	      ((size64_t)1 << loghashlen) <= hashlen
-	      ;
+	     ;
 	      loghashlen++)
 		;
 	assert(loghashlen > 0);
@@ -4168,7 +4168,7 @@ hash_init(size64_t vmsz,
 
 	/* initialize the hash array to all NULL node handles
 	 */
-	for (hix = 0 ; hix < (ix_t)hashlen ; hix++) {
+	for (hix = 0; hix < (ix_t)hashlen; hix++) {
 		tranp->t_hashp[hix] = NH_NULL;
 	}
 
@@ -4374,7 +4374,7 @@ hash_iter(bool_t (* cbfp)(void *contextp, nh_t hashh), void *contextp)
 	ix_t hix;
 	size64_t hashlen = persp->p_hashsz / sizeof(nh_t);
 
-	for (hix = 0 ; hix < (ix_t)hashlen ; hix++) {
+	for (hix = 0; hix < (ix_t)hashlen; hix++) {
 		nh_t nh = tranp->t_hashp[hix];
 
 		while (nh != NH_NULL) {
@@ -4491,7 +4491,7 @@ tree_chk(void)
 
 	okaccum = BOOL_TRUE;
 
-	for (hix = 0 ; hix < (ix_t)hashlen ; hix++) {
+	for (hix = 0; hix < (ix_t)hashlen; hix++) {
 		nh_t hashh = tranp->t_hashp[hix];
 
 		mlog(MLOG_NITTY + 1 | MLOG_TREE,
@@ -4653,7 +4653,7 @@ parse(int slotcnt, char **slotbuf, char *string)
 	/* pass 1: collapse escape sequences, identifying characters which
 	 * are to be interpreted literally
 	 */
-	for (s = string, l = liter ; *s ; s++, l++) {
+	for (s = string, l = liter; *s; s++, l++) {
 		if (*s == '\\' && ! *l) {
 			fix_escape(s, l);
 		}
@@ -4662,7 +4662,7 @@ parse(int slotcnt, char **slotbuf, char *string)
 	/* pass 2: collapse quoted spans, identifying characters which
 	 * are to be interpreted literally
 	 */
-	for (s = string, l = liter ; *s ; s++, l++) {
+	for (s = string, l = liter; *s; s++, l++) {
 		if (*s == '\"' && ! *l) {
 			fix_quoted_span(s, l);
 		}
@@ -4670,7 +4670,7 @@ parse(int slotcnt, char **slotbuf, char *string)
 
 	/* pass 3: collapse white space spans into a single space
 	 */
-	for (s = string, l = liter ; *s ; s++, l++) {
+	for (s = string, l = liter; *s; s++, l++) {
 		if (is_white(*s) && ! *l) {
 			collapse_white(s, l);
 		}
@@ -4737,7 +4737,7 @@ fix_escape(char *string, char *liter)
 	endep = escape_table + (sizeof(escape_table)
 			         /
 			         sizeof(escape_table[0]));
-	for (; ep < endep ; ep++) {
+	for (; ep < endep; ep++) {
 		if (string[1] == ep->sequence) {
 			string[0] = ep->substitute;
 			liter[0] = (char)1;
@@ -4763,9 +4763,9 @@ fix_escape(char *string, char *liter)
 		size_t accum;
 		accum = 0;
 		for (hexlen = 0
-		      ;
+		     ;
 		      hexlen < 2 && is_hex(string[2 + hexlen])
-		      ;
+		     ;
 		      hexlen++) {
 			accum *= 16;
 			accum += hex_to_size(string[2 + hexlen]);
@@ -4786,9 +4786,9 @@ fix_escape(char *string, char *liter)
 		size_t accum;
 		accum = octal_to_size(string[1]);
 		for (octallen = 1
-		      ;
+		     ;
 		      octallen < 3 && is_octal(string[1 + octallen])
-		      ;
+		     ;
 		      octallen++) {
 			accum *= 8;
 			accum += octal_to_size(string[1 + octallen]);
@@ -4821,7 +4821,7 @@ fix_quoted_span(char *string, char *liter)
 	/* scan for the next non-literal quote, marking all
 	 * characters in between as literal
 	 */
-	for (s = string, l = liter ; *s && (*s != '\"' || *l) ; s++, l++) {
+	for (s = string, l = liter; *s && (*s != '\"' || *l); s++, l++) {
 		*l = (char)1;
 	}
 
@@ -4839,7 +4839,7 @@ collapse_white(char *string, char *liter)
 	size_t cnt;
 
 	cnt = 0;
-	for (s = string, l = liter ; is_white(*s) && ! *l ; s++, l++) {
+	for (s = string, l = liter; is_white(*s) && ! *l; s++, l++) {
 		cnt++;
 	}
 
@@ -4856,7 +4856,7 @@ distance_to_space(char *s, char *l)
 {
 	size_t cnt;
 
-	for (cnt = 0 ; *s && (! is_white(*s) || *l) ; s++, l++) {
+	for (cnt = 0; *s && (! is_white(*s) || *l); s++, l++) {
 		cnt++;
 	}
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 08/24] xfsdump: (style) remove a space in ptr dereferences
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (4 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 07/24] xfsdump: (style) remove a space in front of comma/semicolon Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 09/24] xfsdump: add a space after comma and semicolon where was none Jan Tulak
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Created by this script:

#!/usr/bin/env bash
# remove spaces from dereferences

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/(\* /(*/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/cldmgr.c       |  6 ++---
 common/cldmgr.h       |  2 +-
 common/cleanup.c      | 12 ++++-----
 common/dlog.c         |  2 +-
 common/dlog.h         |  4 +--
 common/drive.c        | 14 +++++------
 common/drive.h        | 50 ++++++++++++++++++-------------------
 common/drive_simple.c |  2 +-
 common/global.c       |  2 +-
 common/main.c         | 14 +++++------
 common/media.c        |  8 +++---
 common/ring.h         |  4 +--
 common/util.c         | 14 +++++------
 common/util.h         |  8 +++---
 dump/content.c        | 26 +++++++++----------
 dump/var.c            |  2 +-
 inventory/inv_mgr.c   |  2 +-
 invutil/cmenu.h       | 24 +++++++++---------
 restore/content.c     | 58 +++++++++++++++++++++----------------------
 restore/dirattr.c     |  4 +--
 restore/dirattr.h     |  2 +-
 restore/inomap.c      |  2 +-
 restore/inomap.h      |  2 +-
 restore/tree.c        | 52 +++++++++++++++++++-------------------
 restore/tree.h        |  4 +--
 25 files changed, 160 insertions(+), 160 deletions(-)

diff --git a/common/cldmgr.c b/common/cldmgr.c
index ebe9101..c7f8a45 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -47,7 +47,7 @@ struct cld {
 	int c_exit_code;
 	pthread_t c_tid;
 	ix_t c_streamix;
-	int (* c_entry)(void *arg1);
+	int (*c_entry)(void *arg1);
 	void * c_arg1;
 };
 
@@ -73,7 +73,7 @@ cldmgr_init(void)
 }
 
 bool_t
-cldmgr_create(int (* entry)(void *arg1),
+cldmgr_create(int (*entry)(void *arg1),
 	       ix_t streamix,
 	       char *descstr,
 	       void *arg1)
@@ -234,7 +234,7 @@ cldmgr_entry(void *arg1)
 	      "thread %lu created for stream %d\n",
 	      tid,
 	      cldp->c_streamix);
-	cldp->c_exit_code = (* cldp->c_entry)(cldp->c_arg1);
+	cldp->c_exit_code = (*cldp->c_entry)(cldp->c_arg1);
 
 	pthread_cleanup_pop(1);
 
diff --git a/common/cldmgr.h b/common/cldmgr.h
index ce3a382..3dc74a6 100644
--- a/common/cldmgr.h
+++ b/common/cldmgr.h
@@ -29,7 +29,7 @@ extern bool_t cldmgr_init(void);
 /* cldmgr_create - creates a child thread. returns FALSE if trouble
  * encountered
  */
-extern bool_t cldmgr_create(int (* entry)(void *arg1),
+extern bool_t cldmgr_create(int (*entry)(void *arg1),
 			     ix_t streamix,
 			     char *descstr,
 			     void *arg1);
diff --git a/common/cleanup.c b/common/cleanup.c
index 572355f..8c7fa80 100644
--- a/common/cleanup.c
+++ b/common/cleanup.c
@@ -22,7 +22,7 @@
 #include "cleanup.h"
 
 struct cu {
-	void (* cu_funcp)(void *arg1, void *arg2);
+	void (*cu_funcp)(void *arg1, void *arg2);
 	void *cu_arg1;
 	void *cu_arg2;
 	int  cu_flags;
@@ -45,7 +45,7 @@ cleanup_init(void)
 }
 
 static cleanup_t *
-cleanup_register_base(void (* funcp)(void *arg1, void *arg2),
+cleanup_register_base(void (*funcp)(void *arg1, void *arg2),
 		  void *arg1,
 		  void *arg2)
 {
@@ -64,7 +64,7 @@ cleanup_register_base(void (* funcp)(void *arg1, void *arg2),
 }
 
 cleanup_t *
-cleanup_register(void (* funcp)(void *arg1, void *arg2),
+cleanup_register(void (*funcp)(void *arg1, void *arg2),
 		  void *arg1,
 		  void *arg2)
 {
@@ -76,7 +76,7 @@ cleanup_register(void (* funcp)(void *arg1, void *arg2),
 }
 
 cleanup_t *
-cleanup_register_early(void (* funcp)(void *arg1, void *arg2),
+cleanup_register_early(void (*funcp)(void *arg1, void *arg2),
 		  void *arg1,
 		  void *arg2)
 {
@@ -118,7 +118,7 @@ cleanup(void)
 {
 	while (cu_rootp) {
 		cu_t *p = cu_rootp;
-		(* p->cu_funcp)(p->cu_arg1, p->cu_arg2);
+		(*p->cu_funcp)(p->cu_arg1, p->cu_arg2);
 		cu_rootp = p->cu_nextp;
 		free((void *)p);
 	}
@@ -136,7 +136,7 @@ cleanup_early(void)
 		cu_t *cunextp = cuptr->cu_nextp;
 
 		if (cuptr->cu_flags & CU_EARLY) {
-			(* cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2);
+			(*cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2);
 			free((void *)cuptr);
 			if (cuprevp)  {
 				cuprevp->cu_nextp = cunextp;
diff --git a/common/dlog.c b/common/dlog.c
index f62f374..d5b0443 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -303,7 +303,7 @@ dlog_string_query(dlog_ucbp_t ucb, /* user's print func */
 	/* call the caller's callback with his context, print context, and
 	 * print operator
 	 */
-	(* ucb)(uctxp, dlog_string_query_print, 0);
+	(*ucb)(uctxp, dlog_string_query_print, 0);
 
 	/* if called for, print the timeout and a newline.
 	 * if not, print just a newline
diff --git a/common/dlog.h b/common/dlog.h
index 7f0e41d..4c76f31 100644
--- a/common/dlog.h
+++ b/common/dlog.h
@@ -78,8 +78,8 @@ extern void dlog_multi_ack(char *ackstr[], size_t ackcnt);
  * received, sigquitix if SIGQUIT received. if any of the exception indices
  * are set to IXMAX by the caller, those events will be ignored.
  */
-typedef void (* dlog_pcbp_t)(void *pctxp, char *s, ...);
-typedef void (* dlog_ucbp_t)(void *uctxp, dlog_pcbp_t pcb, void *pctxp);
+typedef void (*dlog_pcbp_t)(void *pctxp, char *s, ...);
+typedef void (*dlog_ucbp_t)(void *uctxp, dlog_pcbp_t pcb, void *pctxp);
 extern ix_t dlog_string_query(dlog_ucbp_t ucb, /* user's print func */
 			       void *uctxp,	/* user's context for above */
 			       char *bufp,	/* typed string returned in */
diff --git a/common/drive.c b/common/drive.c
index 17aae6c..02a0f1f 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -210,7 +210,7 @@ drive_init1(int argc, char *argv[])
 		for (six = 0; six < scnt; six++) {
 			drive_strategy_t *sp = strategypp[six];
 			int score;
-			score = (* sp->ds_match)(argc,
+			score = (*sp->ds_match)(argc,
 						    argv,
 						    drivep);
 			if (! bestsp || score > bestscore) {
@@ -225,7 +225,7 @@ drive_init1(int argc, char *argv[])
 		mlog(MLOG_VERBOSE,
 		      _("using %s strategy\n"),
 		      bestsp->ds_description);
-		ok = (* bestsp->ds_instantiate)(argc,
+		ok = (*bestsp->ds_instantiate)(argc,
 						   argv,
 						   drivep);
 		if (! ok) {
@@ -255,7 +255,7 @@ drive_init2(int argc,
 		bool_t ok;
 
 		drive_allochdrs(drivep, gwhdrtemplatep, driveix);
-		ok = (* drivep->d_opsp->do_init)(drivep);
+		ok = (*drivep->d_opsp->do_init)(drivep);
 		if (! ok) {
 			return BOOL_FALSE;
 		}
@@ -277,7 +277,7 @@ drive_init3(void)
 		drive_t *drivep = drivepp[driveix];
 		bool_t ok;
 
-		ok = (* drivep->d_opsp->do_sync)(drivep);
+		ok = (*drivep->d_opsp->do_sync)(drivep);
 		if (! ok) {
 			return BOOL_FALSE;
 		}
@@ -303,7 +303,7 @@ drive_mark_commit(drive_t *drivep, off64_t ncommitted)
 	;
 	) {
 		drivep->d_markrecheadp = dmp->dm_nextp;
-		(* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_TRUE);
+		(*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_TRUE);
 		dmp = drivep->d_markrecheadp;
 	}
 }
@@ -323,7 +323,7 @@ drive_mark_discard(drive_t *drivep)
 	;
 	drivep->d_markrecheadp = dmp->dm_nextp, dmp = dmp->dm_nextp) {
 
-		(* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_FALSE);
+		(*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_FALSE);
 	}
 }
 
@@ -339,7 +339,7 @@ drive_display_metrics(void)
 		drive_t *drivep = drivepp[driveix];
 		drive_ops_t *dop = drivep->d_opsp;
 		if (dop->do_display_metrics) {
-			(* dop->do_display_metrics)(drivep);
+			(*dop->do_display_metrics)(drivep);
 		}
 	}
 }
diff --git a/common/drive.h b/common/drive.h
index 4b4fcf8..adecaab 100644
--- a/common/drive.h
+++ b/common/drive.h
@@ -138,13 +138,13 @@ struct drive_strategy {
 	char *ds_description;
 		    /* a short char string describing strategy
 		     */
-	int (* ds_match)(int argc,
+	int (*ds_match)(int argc,
 				 char *argv[],
 				 struct drive *drivep);
 		    /* returns degree of match. drivep has been pre-allocated
 		     * and initialized with generic info.
 		     */
-	bool_t (* ds_instantiate)(int argc,
+	bool_t (*ds_instantiate)(int argc,
 				     char *argv[],
 				     struct drive *drivep);
 		    /* creates a drive manager instance, by filling in the
@@ -186,7 +186,7 @@ typedef off64_t drive_mark_t;
  * was NOT committed.
  */
 struct drive_markrec; /* forward decl */
-typedef void (* drive_mcbfp_t)(void *context_t,
+typedef void (*drive_mcbfp_t)(void *context_t,
 				  struct drive_markrec *markrecp,
 				  bool_t committed);
 
@@ -257,17 +257,17 @@ struct drive {
 typedef struct drive drive_t;
 
 struct drive_ops {
-	bool_t (* do_init)(drive_t *drivep);
+	bool_t (*do_init)(drive_t *drivep);
 				/* initializes drive, and begins async
 				 * determination of media object presence
 				 * returns FALSE if session should be aborted.
 				 */
-	bool_t (* do_sync)(drive_t *drivep);
+	bool_t (*do_sync)(drive_t *drivep);
 				/* synchronizes with the activity kicked off
 				 * by do_init. returns FALSE if session should
 				 * be aborted.
 				 */
-	int (* do_begin_read)(drive_t *drivep);
+	int (*do_begin_read)(drive_t *drivep);
 				/* prepares the drive manager for reading.
 				 * if the media is positioned at BOM or just
 				 * after a file mark, current media file is
@@ -306,7 +306,7 @@ struct drive_ops {
 				 * begin_read. if successful, caller MUST call
 				 * end_read prior to next begin_read.
 				 */
-	char * (* do_read)(drive_t *drivep,
+	char * (*do_read)(drive_t *drivep,
 			      size_t wanted_bufsz,
 			      size_t *actual_bufszp,
 			      int *statp);
@@ -341,7 +341,7 @@ struct drive_ops {
 				 * valid data (although the buffer size may
 				 * be zero!).
 				 */
-	void (* do_return_read_buf)(drive_t *drivep,
+	void (*do_return_read_buf)(drive_t *drivep,
 				       char *bufp,
 				       size_t bufsz);
 				/* returns the buffer obtained
@@ -349,14 +349,14 @@ struct drive_ops {
 				 * the entire buffer must be returned
 				 * in one shot.
 				 */
-	void (* do_get_mark)(drive_t *drivep,
+	void (*do_get_mark)(drive_t *drivep,
 				drive_mark_t *drivemarkp);
 				/* returns (by reference) a mark corresponding
 				 * to the next byte which will be read by a
 				 * call to do_read(). will be used in a later
 				 * session to seek to that position.
 				 */
-	int (* do_seek_mark)(drive_t *drivep,
+	int (*do_seek_mark)(drive_t *drivep,
 				     drive_mark_t *drivemarkp);
 				/* searches for the specified mark within the
 				 * current file. returns zero if the mark
@@ -367,7 +367,7 @@ struct drive_ops {
 				 *	CORRUPTION - encountered corrupt data;
 				 *	DEVICE - device error;
 				 */
-	int (* do_next_mark)(drive_t *drivep);
+	int (*do_next_mark)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_NEXTMARK set,
 				 * drive has the capability to
 				 * seek forward to the next mark. returns
@@ -385,7 +385,7 @@ struct drive_ops {
 				 * will position the media at the next media
 				 * file.
 				 */
-	int (* do_begin_write)(drive_t *drivep);
+	int (*do_begin_write)(drive_t *drivep);
 				/* begins a write media file for writing.
 				 * asserts the media is positioned at BOM or
 				 * just after a file mark. write header will
@@ -396,7 +396,7 @@ struct drive_ops {
 				 *	DEVICE - device error;
 				 *	CORE  - driver error
 				 */
-	void (* do_set_mark)(drive_t *drivep,
+	void (*do_set_mark)(drive_t *drivep,
 				drive_mcbfp_t cbfuncp,
 				void *cbcontextp,
 				drive_markrec_t *markrecp);
@@ -426,7 +426,7 @@ struct drive_ops {
 				 * last committed marked point in the write
 				 * stream.
 				 */
-	char * (* do_get_write_buf)(drive_t *drivep,
+	char * (*do_get_write_buf)(drive_t *drivep,
 				       size_t wanted_bufsz,
 				       size_t *actual_bufszp);
 				/* asks the drive manager for a buffer.
@@ -443,7 +443,7 @@ struct drive_ops {
 				 * be larger or smaller than the wanted bufsz,
 				 * but will be at least 1 byte in length.
 				 */
-	int (* do_write)(drive_t *drivep,
+	int (*do_write)(drive_t *drivep,
 				 char *bufp,
 				 size_t bufsz);
 				/* asks the drive manager to write bufsz
@@ -473,7 +473,7 @@ struct drive_ops {
 				 * instead, the caller must get another buffer
 				 * using do_get_write_buf().
 				 */
-	size_t (* do_get_align_cnt)(drive_t *drivep);
+	size_t (*do_get_align_cnt)(drive_t *drivep);
 				/* used during writing. returns the number
 				 * of bytes which should be written to
 				 * page-align the next do_get_write_buf()
@@ -481,7 +481,7 @@ struct drive_ops {
 				 * alignment will be maintained after the
 				 * initial alignment done using this info.
 				 */
-	int (* do_end_write)(drive_t *drivep, off64_t *ncommittedp);
+	int (*do_end_write)(drive_t *drivep, off64_t *ncommittedp);
 				/* terminates a media file write sequence.
 				 * flushes any buffered data not yet committed
 				 * to media, and calls callbacks for all marks
@@ -502,7 +502,7 @@ struct drive_ops {
 				 * an error, do_end_write will not do any
 				 * I/O, and will return 0.
 				 */
-	int (* do_fsf)(drive_t *drivep,
+	int (*do_fsf)(drive_t *drivep,
 			      int count,
 			      int *statp);
 				/* if d_capabilities has DRIVE_CAP_FSF set,
@@ -528,7 +528,7 @@ struct drive_ops {
 				 * behaves as if position is at most recent
 				 * file mark or BOT.
 				 */
-	int (* do_bsf)(drive_t *drivep,
+	int (*do_bsf)(drive_t *drivep,
 			       int count,
 			       int *statp);
 				/* if d_capabilities has DRIVE_CAP_BSF set,
@@ -554,35 +554,35 @@ struct drive_ops {
 				 *	BOM - hit beginning of recorded data;
 				 *	DEVICE - device error;
 				 */
-	int (* do_rewind)(drive_t *drivep);
+	int (*do_rewind)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_REWIND set,
 				 * drive has the capability to
 				 * position at beginning of recorded data
 				 *	DEVICE - device error;
 				 */
-	int (* do_erase)(drive_t *drivep);
+	int (*do_erase)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_ERASE set,
 				 * drive has the capability to
 				 * erase: all content of media object is
 				 * eradicated.
 				 *	DEVICE - device error;
 				 */
-	int (* do_eject_media)(drive_t *drivep);
+	int (*do_eject_media)(drive_t *drivep);
 				/* if d_capabilities has DRIVE_CAP_EJECT set,
 				 * drive has capability
 				 * to eject media, and will do so when called.
 				 *	DEVICE - device error;
 				 */
-	int (* do_get_device_class)(drive_t *drivep);
+	int (*do_get_device_class)(drive_t *drivep);
 				/* returns the media class of the device
 				 * (see below).
 				 */
-	void (* do_display_metrics)(drive_t *drivep);
+	void (*do_display_metrics)(drive_t *drivep);
 				/* use BARE mlog to print useful throughput
 				 * and performance info. set to NULL if
 				 * nothing to say.
 				 */
-	void (* do_quit)(drive_t * drivep);
+	void (*do_quit)(drive_t * drivep);
 				/* tells the drive manager to de-allocate
 				 * resources, INCLUDING the slave process.
 				 */
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 697a597..f71a2cf 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -1155,7 +1155,7 @@ do_set_mark(drive_t *drivep,
 	 */
 	if (contextp->dc_nextp == contextp->dc_buf) {
 		assert(drivep->d_markrecheadp == 0);
-		(* cbfuncp)(cbcontextp, markrecp, BOOL_TRUE);
+		(*cbfuncp)(cbcontextp, markrecp, BOOL_TRUE);
 		return;
 	} else {
 		markrecp->dm_cbfuncp = cbfuncp;
diff --git a/common/global.c b/common/global.c
index 42bfc3d..5ba237f 100644
--- a/common/global.c
+++ b/common/global.c
@@ -308,7 +308,7 @@ prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
 	/* query: ask for a dump label
 	 */
-	(* pcb)(pctxp,
+	(*pcb)(pctxp,
 		   _("please enter label for this dump session"));
 }
 
diff --git a/common/main.c b/common/main.c
index 3f3ce0c..7d40b48 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1222,7 +1222,7 @@ loadoptfile(int *argcp, char ***argvp)
 			i++; /* to skip option argument */
 			continue;
 		}
-		sz += strlen((* argvp)[i]) + 1;
+		sz += strlen((*argvp)[i]) + 1;
 	}
 
 	/* add in the size of the option file (plus one byte in case
@@ -1239,8 +1239,8 @@ loadoptfile(int *argcp, char ***argvp)
 	 */
 	p = argbuf;
 	i = 0;
-	sprintf(p, "%s ", (* argvp)[i]);
-	p += strlen((* argvp)[i]) + 1;
+	sprintf(p, "%s ", (*argvp)[i]);
+	p += strlen((*argvp)[i]) + 1;
 	i++;
 
 	/* copy the options file into the buffer after the given args
@@ -1266,8 +1266,8 @@ loadoptfile(int *argcp, char ***argvp)
 			i++; /* to skip option argument */
 			continue;
 		}
-		sprintf(p, "%s ", (* argvp)[i]);
-		p += strlen((* argvp)[i]) + 1;
+		sprintf(p, "%s ", (*argvp)[i]);
+		p += strlen((*argvp)[i]) + 1;
 	}
 
 	/* null-terminate the entire buffer
@@ -1468,7 +1468,7 @@ childmain(void *arg1)
 	/* let the drive manager shut down its slave thread
 	 */
 	drivep = drivepp[stix];
-	(* drivep->d_opsp->do_quit)(drivep);
+	(*drivep->d_opsp->do_quit)(drivep);
 
 	return exitcode;
 }
@@ -1480,7 +1480,7 @@ prompt_prog_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
 	/* query: ask for a dump label
 	 */
-	(* pcb)(pctxp,
+	(*pcb)(pctxp,
 		   progrpt_enabledpr
 		   ?
 		   _("please enter seconds between progress reports, "
diff --git a/common/media.c b/common/media.c
index 2337a84..bc1fbbd 100644
--- a/common/media.c
+++ b/common/media.c
@@ -169,7 +169,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 				mediap->m_strategyp = *spp;
 				mediap->m_writehdrp->mh_strategyid = id;
 			}
-			if ((* (*spp)->ms_match)(argc, argv, dsp)) {
+			if ((*(*spp)->ms_match)(argc, argv, dsp)) {
 				chosen_sp = *spp;
 			}
 		}
@@ -200,7 +200,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 	/* initialize the strategy. this will cause each of the managers
 	 * to be initialized as well. if error, return 0.
 	 */
-	ok = (* chosen_sp->ms_create)(chosen_sp, argc, argv);
+	ok = (*chosen_sp->ms_create)(chosen_sp, argc, argv);
 	if (! ok) {
 		return 0;
 	}
@@ -215,7 +215,7 @@ media_init(media_strategy_t *msp, int argc, char *argv[])
 {
 	bool_t ok;
 
-	ok = (* msp->ms_init)(msp, argc, argv);
+	ok = (*msp->ms_init)(msp, argc, argv);
 
 	return ok;
 }
@@ -223,7 +223,7 @@ media_init(media_strategy_t *msp, int argc, char *argv[])
 void
 media_complete(media_strategy_t *msp)
 {
-	(* msp->ms_complete)(msp);
+	(*msp->ms_complete)(msp);
 }
 
 /* media_get_upper_hdrs - supply pointers to portion of media file headers
diff --git a/common/ring.h b/common/ring.h
index be4ae69..6535af8 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -168,8 +168,8 @@ extern ring_t *ring_create(size_t ringlen,
 			    size_t bufsz,
 			    bool_t pinpr,
 			    ix_t drive_index,
-			    int (* readfunc)(void *clientctxp, char *bufp),
-			    int (* writefunc)(void *clientctxp, char *bufp),
+			    int (*readfunc)(void *clientctxp, char *bufp),
+			    int (*writefunc)(void *clientctxp, char *bufp),
 			    void *clientctxp,
 			    int *rvalp);
 
diff --git a/common/util.c b/common/util.c
index 621d340..7ca5fbe 100644
--- a/common/util.c
+++ b/common/util.c
@@ -58,7 +58,7 @@ write_buf(char *bufp,
 		} else {
 			(void)memset((void *)mbufp, 0, mbufsz);
 		}
-		rval = (* write_funcp)(contextp, mbufp, mbufsz);
+		rval = (*write_funcp)(contextp, mbufp, mbufsz);
 		if (rval) {
 			return rval;
 		}
@@ -86,7 +86,7 @@ read_buf(char *bufp,
 	nread = 0;
 	*statp = 0;
 	while (bufsz) {
-		mbufp = (* read_funcp)(contextp, bufsz, &mbufsz, statp);
+		mbufp = (*read_funcp)(contextp, bufsz, &mbufsz, statp);
 		if (*statp) {
 			break;
 		}
@@ -97,7 +97,7 @@ read_buf(char *bufp,
 		}
 		bufsz -= mbufsz;
 		nread += (int)mbufsz;
-		(* return_read_buf_funcp)(contextp, mbufp, mbufsz);
+		(*return_read_buf_funcp)(contextp, mbufp, mbufsz);
 	}
 
 	return nread;
@@ -210,7 +210,7 @@ bigstat_iter(jdm_fshandle_t *fshandlep,
 					continue;
 				}
 			}
-			rval = (* fp)(cb_arg1, fshandlep, fsfd, p);
+			rval = (*fp)(cb_arg1, fshandlep, fsfd, p);
 			if (rval) {
 				*statp = rval;
 				return 0;
@@ -272,7 +272,7 @@ bigstat_one(int fsfd,
 #define INOGRPLEN	256
 int
 inogrp_iter(int fsfd,
-	     int (* fp)(void *arg1,
+	     int (*fp)(void *arg1,
 				int fsfd,
 				xfs_inogrp_t *inogrp),
 	     void * arg1,
@@ -311,7 +311,7 @@ inogrp_iter(int fsfd,
 		for (p = igrp, endp = igrp + inogrpcnt; p < endp; p++) {
 			int rval;
 
-			rval = (* fp)(arg1, fsfd, p);
+			rval = (*fp)(arg1, fsfd, p);
 			if (rval) {
 				*statp = rval;
 				free(igrp);
@@ -476,7 +476,7 @@ diriter(jdm_fshandle_t *fshandlep,
 
 			/* invoke the callback
 			 */
-			cbrval = (* cbfp)(arg1,
+			cbrval = (*cbfp)(arg1,
 					     fshandlep,
 					     fsfd,
 					     &statbuf,
diff --git a/common/util.h b/common/util.h
index ab43739..cba4ca8 100644
--- a/common/util.h
+++ b/common/util.h
@@ -32,8 +32,8 @@
  *
  * if bufp is null, writes bufsz zeros.
  */
-typedef char * (* gwbfp_t)(void *contextp, size_t wantedsz, size_t *szp);
-typedef int (* wfp_t)(void *contextp, char *bufp, size_t bufsz);
+typedef char * (*gwbfp_t)(void *contextp, size_t wantedsz, size_t *szp);
+typedef int (*wfp_t)(void *contextp, char *bufp, size_t bufsz);
 
 extern int write_buf(char *bufp,
 			   size_t bufsz,
@@ -57,7 +57,7 @@ extern int write_buf(char *bufp,
  * *statp will be zero.
  */
 typedef char * (*rfp_t)(void *contextp, size_t wantedsz, size_t *szp, int *statp);
-typedef void (* rrbfp_t)(void *contextp, char *bufp, size_t bufsz);
+typedef void (*rrbfp_t)(void *contextp, char *bufp, size_t bufsz);
 
 extern int read_buf(char *bufp,
 			  size_t bufsz,
@@ -110,7 +110,7 @@ extern int bigstat_one(int fsfd,
 			     xfs_bstat_t *statp);
 
 extern int inogrp_iter(int fsfd,
-			     int (* fp)(void *arg1,
+			     int (*fp)(void *arg1,
 				     		int fsfd,
 						xfs_inogrp_t *inogrp),
 			     void * arg1,
diff --git a/dump/content.c b/dump/content.c
index 7627b8a..5743cf7 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -2014,7 +2014,7 @@ mark_set(drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags)
 	markp->startpt.sp_ino = ino;
 	markp->startpt.sp_offset = offset;
 	markp->startpt.sp_flags = flags;
-	(* dop->do_set_mark)(drivep,
+	(*dop->do_set_mark)(drivep,
 				mark_callback,
 				(void *)drivep->d_index,
 				(drive_markrec_t *)markp);
@@ -4734,7 +4734,7 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (isrealtime || extsz >= PGALIGNTHRESH * PGSZ) {
 			size_t cnt_to_align;
-			cnt_to_align = (* dop->do_get_align_cnt)(drivep);
+			cnt_to_align = (*dop->do_get_align_cnt)(drivep);
 			if ((size_t)cnt_to_align < 2*sizeof(extenthdr_t)) {
 				cnt_to_align += PGSZ;
 			}
@@ -4807,7 +4807,7 @@ dump_extent_group(drive_t *drivep,
 				INTGENMAX
 				:
 				(size_t)extsz;
-			bufp = (* dop->do_get_write_buf)(drivep,
+			bufp = (*dop->do_get_write_buf)(drivep,
 							    reqsz,
 							    &actualsz);
 			assert(actualsz <= reqsz);
@@ -4853,7 +4853,7 @@ dump_extent_group(drive_t *drivep,
 					actualsz - (size_t)nread);
 			}
 
-			rval = (* dop->do_write)(drivep,
+			rval = (*dop->do_write)(drivep,
 						    bufp,
 						    actualsz);
 			switch (rval) {
@@ -5635,7 +5635,7 @@ position:
 
 		/* do a begin_read to see the disposition of the drive/media.
 		 */
-		rval = (* dop->do_begin_read)(drivep);
+		rval = (*dop->do_begin_read)(drivep);
 
 		/* update cc_Media_useterminatorpr after every begin_read,
 		 * since begin_read will cause some unknown drive params
@@ -5679,7 +5679,7 @@ position:
 			 * media object a virgin.
 			 * also, check for erase option.
 			 */
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 
 			switch(Media_erasechk(drivep,
 						dcaps,
@@ -5712,7 +5712,7 @@ position:
 				assert(contextp->cc_Media_useterminatorpr);
 				assert(dcaps & DRIVE_CAP_BSF); /* redundant */
 				status = 0;
-				rval = (* dop->do_bsf)(drivep, 0, &status);
+				rval = (*dop->do_bsf)(drivep, 0, &status);
 				assert(rval == 0);
 				if (status == DRIVE_ERROR_DEVICE) {
 					mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
@@ -5768,7 +5768,7 @@ position:
 				      "repositioning to overwrite\n"));
 				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
-				rval = (* dop->do_bsf)(drivep, 0, &status);
+				rval = (*dop->do_bsf)(drivep, 0, &status);
 				assert(rval == 0);
 				if (status == DRIVE_ERROR_DEVICE) {
 					return RV_DRIVE;
@@ -5904,7 +5904,7 @@ position:
 				mlog_exit_hint(RV_CORRUPT);
 				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
-				rval = (* dop->do_bsf)(drivep, 0, &status);
+				rval = (*dop->do_bsf)(drivep, 0, &status);
 				assert(rval == 0);
 				if (status == DRIVE_ERROR_DEVICE) {
 					return RV_DRIVE;
@@ -5928,7 +5928,7 @@ position:
 erasemedia:
 	mlog(MLOG_VERBOSE | MLOG_WARNING | MLOG_MEDIA, _(
 	      "erasing media\n"));
-	rval = (* dop->do_erase)(drivep);
+	rval = (*dop->do_erase)(drivep);
 	if (rval) {
 		return RV_DRIVE;
 	}
@@ -5950,7 +5950,7 @@ changemedia:
 	assert(mediapresentpr != BOOL_UNKNOWN);
 	if (mediapresentpr == BOOL_TRUE) {
 		if (dcaps & DRIVE_CAP_EJECT) {
-			rval = (* dop->do_eject_media)(drivep);
+			rval = (*dop->do_eject_media)(drivep);
 			if (rval) {
 				return RV_DRIVE;
 			}
@@ -6129,7 +6129,7 @@ write:
 	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
 	}
-	rval = (* dop->do_begin_write)(drivep);
+	rval = (*dop->do_begin_write)(drivep);
 	switch(rval) {
 	case 0:
 		return RV_OK;
@@ -6444,7 +6444,7 @@ Media_prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 
 	/* query: ask for a label
 	 */
-	(* pcb)(pctxp,
+	(*pcb)(pctxp,
 		   "please enter label for media in "
 		   "drive %u",
 		   drivep->d_index);
diff --git a/dump/var.c b/dump/var.c
index c9f251a..8ea38af 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -132,7 +132,7 @@ var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 	      "excluding %s from dump\n",
 	      base);
 
-	(* cb)(statbuf.st_ino);
+	(*cb)(statbuf.st_ino);
 
 	if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
 		return;
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 078798f..7e73667 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -310,7 +310,7 @@ search_invt(
 					continue;
 			}
 
-			found = (* do_chkcriteria)(fd, &harr[j], arg, buf);
+			found = (*do_chkcriteria)(fd, &harr[j], arg, buf);
 			if (! found) continue;
 
 			/* we found what we need; just return */
diff --git a/invutil/cmenu.h b/invutil/cmenu.h
index f3c205f..075bcf3 100644
--- a/invutil/cmenu.h
+++ b/invutil/cmenu.h
@@ -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 {
diff --git a/restore/content.c b/restore/content.c
index 8da57ed..47a9c21 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -3502,7 +3502,7 @@ applynondirdump(drive_t *drivep,
 			rv = RV_OK;
 			goto applynondirdump_out;
 		case RV_CORRUPT:
-			rval = (* dop->do_next_mark)(drivep);
+			rval = (*dop->do_next_mark)(drivep);
 			if (rval) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
 				      "unable to resync media file: "
@@ -3545,7 +3545,7 @@ applynondirdump(drive_t *drivep,
 		do {
 			/* get a mark for the next read, in case we restart here
 			 */
-			(* dop->do_get_mark)(drivep, &drivemark);
+			(*dop->do_get_mark)(drivep, &drivemark);
 
 			/* read the file header.
 			 */
@@ -3557,7 +3557,7 @@ applynondirdump(drive_t *drivep,
 				rv = RV_OK;
 				goto applynondirdump_out;
 			case RV_CORRUPT:
-				rval = (* dop->do_next_mark)(drivep);
+				rval = (*dop->do_next_mark)(drivep);
 				if (rval) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
 					      "unable to resync media file: "
@@ -3926,7 +3926,7 @@ Media_mfile_next(Media_t *Mediap,
 		     Mediap->M_pos == POS_INDIR
 		     ||
 		     Mediap->M_pos == POS_ATNONDIR) {
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 		}
@@ -4031,7 +4031,7 @@ Media_mfile_next(Media_t *Mediap,
 			}
 			mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 			      "rewinding\n"));
-			(* drivep->d_opsp->do_rewind)(drivep);
+			(*drivep->d_opsp->do_rewind)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			if (cldmgr_stop_requested()) {
 				return RV_INTR;
@@ -4050,7 +4050,7 @@ Media_mfile_next(Media_t *Mediap,
 		 * bail if catastrophic. also, tell pi about EOD/EOM
 		 * if appropriate.
 		 */
-		rval = (* drivep->d_opsp->do_begin_read)(drivep);
+		rval = (*drivep->d_opsp->do_begin_read)(drivep);
 		switch (rval) {
 		case 0:
 			mlog_lock();
@@ -4154,7 +4154,7 @@ validate:
 			     Mediap->M_pos == POS_INDIR
 			     ||
 			     Mediap->M_pos == POS_ATNONDIR) {
-				(* dop->do_end_read)(drivep);
+				(*dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 			}
@@ -4286,7 +4286,7 @@ validate:
 		      &&
 		      Mediap->M_lmfix > Mediap->M_fsfix) {
 			if (pi_alldone()) {
-				(* dop->do_end_read)(drivep);
+				(*dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 				return RV_NOMORE;
@@ -4302,13 +4302,13 @@ validate:
 		     Mediap->M_fsfixvalpr
 		     &&
 		     Mediap->M_fmfix <= Mediap->M_fsfix) {
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 			if (dcaps & DRIVE_CAP_REWIND) {
 				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 				  "rewinding\n"));
-				(* drivep->d_opsp->do_rewind)(drivep);
+				(*drivep->d_opsp->do_rewind)(drivep);
 				continue;
 			} else {
 				goto newmedia;
@@ -4319,7 +4319,7 @@ validate:
 		 * and the above conditions were not met, then keep looking
 		 */
 		if (! partofdumppr) {
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 			continue;
@@ -4363,7 +4363,7 @@ validate:
 		/* if purp is nondir, we may be done.
 		 */
 		if (purp == PURP_NONDIR && pi_alldone()) {
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			return RV_NOMORE;
 		}
@@ -4376,7 +4376,7 @@ validate:
 			     Mediap->M_fmfix <= Mediap->M_fsfix
 			     &&
 			     Mediap->M_lmfix < Mediap->M_fmfix) {
-				(* dop->do_end_read)(drivep);
+				(*dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 				goto newmedia;
@@ -4386,7 +4386,7 @@ validate:
 			     Mediap->M_pmfix < Mediap->M_fmfix
 			     &&
 			     Mediap->M_lmfix > Mediap->M_fmfix) {
-				(* dop->do_end_read)(drivep);
+				(*dop->do_end_read)(drivep);
 				Mediap->M_pos = POS_UNKN;
 				fileh = DH_NULL;
 				goto newmedia;
@@ -4404,7 +4404,7 @@ validate:
 		     scrhdrp->cih_mediafiletype
 		     ==
 		     CIH_MEDIAFILETYPE_INVENTORY) {
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 			if (pi_know_no_more_on_object(purp,
@@ -4418,7 +4418,7 @@ validate:
 				pi_note_underhead(objh, DH_NULL);
 				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 					"rewinding\n"));
-				(* drivep->d_opsp->do_rewind)(drivep);
+				(*drivep->d_opsp->do_rewind)(drivep);
 				continue;
 			}
 			goto newmedia;
@@ -4433,7 +4433,7 @@ validate:
 		     (Mediap->M_pos != POS_ATHDR
 		       ||
 		       DH2F(fileh)->f_dirtriedpr)) {
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 			if (pi_know_no_more_beyond_on_object(purp,
@@ -4451,7 +4451,7 @@ validate:
 					pi_note_underhead(objh, DH_NULL);
 					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 						"rewinding\n"));
-					(* drivep->d_opsp->do_rewind)(drivep);
+					(*drivep->d_opsp->do_rewind)(drivep);
 					continue;
 				}
 				goto newmedia;
@@ -4498,7 +4498,7 @@ validate:
 				DH2F(fileh)->f_nondirdonepr = BOOL_TRUE;
 			}
 			pi_unlock();
-			(* dop->do_end_read)(drivep);
+			(*dop->do_end_read)(drivep);
 			Mediap->M_pos = POS_UNKN;
 			fileh = DH_NULL;
 			if (pi_know_no_more_beyond_on_object(purp,
@@ -4516,7 +4516,7 @@ validate:
 					pi_note_underhead(objh, DH_NULL);
 					mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 						"rewinding\n"));
-					(* drivep->d_opsp->do_rewind)(drivep);
+					(*drivep->d_opsp->do_rewind)(drivep);
 					continue;
 				}
 				goto newmedia;
@@ -4564,7 +4564,7 @@ validate:
 			    mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 				  "seeking past portion of media file "
 				  "already restored\n"));
-			    rval = (* dop->do_seek_mark)(drivep,
+			    rval = (*dop->do_seek_mark)(drivep,
 							    &chkpnt);
 			    if (! rval) {
 				    rv_t rv;
@@ -4583,7 +4583,7 @@ validate:
 			    mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 				  "seeking past media file "
 				  "directory dump\n"));
-			    rval = (* dop->do_next_mark)(drivep);
+			    rval = (*dop->do_next_mark)(drivep);
 			    if (! rval) {
 				    rv_t rv;
 				    rv = read_filehdr(drivep,
@@ -4650,7 +4650,7 @@ validate:
 		 * media files on this object? if so, continue; if not, get
 		 * more media.
 		 */
-		(* dop->do_end_read)(drivep);
+		(*dop->do_end_read)(drivep);
 		Mediap->M_pos = POS_UNKN;
 		fileh = DH_NULL;
 		assert(purp == PURP_NONDIR);
@@ -4669,7 +4669,7 @@ validate:
 				pi_note_underhead(objh, DH_NULL);
 				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
 					"rewinding\n"));
-				(* drivep->d_opsp->do_rewind)(drivep);
+				(*drivep->d_opsp->do_rewind)(drivep);
 				continue;
 			}
 			goto newmedia;
@@ -4701,7 +4701,7 @@ newmedia:
 
 		/* if media not removable, just return
 		 */
-		if ((* dop->do_get_device_class)(drivep)
+		if ((*dop->do_get_device_class)(drivep)
 		     ==
 		     DEVICE_NONREMOVABLE)
 		{
@@ -4770,7 +4770,7 @@ newmedia:
 				}
 			}
 			if (dcaps & DRIVE_CAP_EJECT) {
-				(* dop->do_eject_media)(drivep);
+				(*dop->do_eject_media)(drivep);
 			}
 		}
 
@@ -4863,7 +4863,7 @@ Media_end(Media_t *Mediap)
 	     Mediap->M_pos == POS_INDIR
 	     ||
 	     Mediap->M_pos == POS_ATNONDIR) {
-		(* dop->do_end_read)(drivep);
+		(*dop->do_end_read)(drivep);
 		Mediap->M_pos = POS_UNKN;
 	}
 }
@@ -8494,7 +8494,7 @@ restore_extent(filehdr_t *fhdrp,
 		size_t ntowrite;
 
 		req_bufsz = (size_t)min((off64_t)INTGENMAX, sz);
-		bufp = (* dop->do_read)(drivep, req_bufsz, &sup_bufsz, &rval);
+		bufp = (*dop->do_read)(drivep, req_bufsz, &sup_bufsz, &rval);
 		if (rval) {
 			rv_t rv;
 			char *reasonstr;
@@ -8639,7 +8639,7 @@ restore_extent(filehdr_t *fhdrp,
 		} else {
 			nwritten = 0;
 		}
-		(* dop->do_return_read_buf)(drivep, bufp, sup_bufsz);
+		(*dop->do_return_read_buf)(drivep, bufp, sup_bufsz);
 		if ((size_t)nwritten != ntowrite) {
 			if (nwritten < 0) {
 				mlog(MLOG_NORMAL, _(
diff --git a/restore/dirattr.c b/restore/dirattr.c
index 864facb..36b60dc 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -621,7 +621,7 @@ dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp)
 
 bool_t
 dirattr_cb_extattr(dah_t dah,
-		    bool_t (* cbfunc)(extattrhdr_t *ahdrp,
+		    bool_t (*cbfunc)(extattrhdr_t *ahdrp,
 				         void *ctxp),
 		    extattrhdr_t *ahdrp,
 		    void *ctxp)
@@ -735,7 +735,7 @@ dirattr_cb_extattr(dah_t dah,
 
 		/* call the callback func
 		 */
-		ok = (* cbfunc)(ahdrp, ctxp);
+		ok = (*cbfunc)(ahdrp, ctxp);
 		if (! ok) {
 			return BOOL_FALSE;
 		}
diff --git a/restore/dirattr.h b/restore/dirattr.h
index dd37a98..232822e 100644
--- a/restore/dirattr.h
+++ b/restore/dirattr.h
@@ -83,7 +83,7 @@ extern void dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp);
  * else returns TRUE.
  */
 extern bool_t dirattr_cb_extattr(dah_t dah,
-				  bool_t (* cbfunc)(extattrhdr_t *ahdrp,
+				  bool_t (*cbfunc)(extattrhdr_t *ahdrp,
 						       void *ctxp),
 				  extattrhdr_t *ahdrp,
 				  void *ctxp);
diff --git a/restore/inomap.c b/restore/inomap.c
index 8ab588d..22142cd 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -585,7 +585,7 @@ begin:
  */
 void
 inomap_cbiter(int statemask,
-	       bool_t (* cbfunc)(void *ctxp, xfs_ino_t ino),
+	       bool_t (*cbfunc)(void *ctxp, xfs_ino_t ino),
 	       void *ctxp)
 {
 	hnk_t *hnkp;
diff --git a/restore/inomap.h b/restore/inomap.h
index 93f982c..55f9d07 100644
--- a/restore/inomap.h
+++ b/restore/inomap.h
@@ -80,7 +80,7 @@ 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),
+			   bool_t (*cbfunc)(void *ctxp, xfs_ino_t ino),
 			   void *ctxp);
 
 #endif /* INOMAP_H */
diff --git a/restore/tree.c b/restore/tree.c
index 58b88ff..024e26b 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -287,7 +287,7 @@ 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),
+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);
@@ -302,7 +302,7 @@ 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),
+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,
@@ -1744,7 +1744,7 @@ 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),
@@ -1876,7 +1876,7 @@ tree_cb_links(xfs_ino_t ino,
 			      ino,
 			      gen);
 		}
-		ok = (* funcp)(contextp, path == path2, path1, path2);
+		ok = (*funcp)(contextp, path == path2, path1, path2);
 		if (! ok) {
 			return RV_NOTOK;
 		}
@@ -1929,7 +1929,7 @@ tree_cb_links(xfs_ino_t ino,
 				      "discarding %llu %u\n",
 				      ino,
 				      gen);
-				ok = (* funcp)(contextp, BOOL_FALSE, 0, 0);
+				ok = (*funcp)(contextp, BOOL_FALSE, 0, 0);
 				if (! ok) {
 					return RV_NOTOK;
 				}
@@ -1947,7 +1947,7 @@ 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,
+				ok = (*funcp)(contextp, path == path2,
 					path1, path2);
 				if (! ok) {
 					return RV_NOTOK;
@@ -1974,7 +1974,7 @@ tree_cb_links(xfs_ino_t ino,
 			adopt(persp->p_orphh, nh, NRH_NULL);
 			ok = Node2path(nh, path1, _("orphan"));
 			assert(ok);
-			(void)(* funcp)(contextp, BOOL_FALSE, path1,path2);
+			(void)(*funcp)(contextp, BOOL_FALSE, path1,path2);
 		}
 	}
 	return RV_OK;
@@ -2035,12 +2035,12 @@ tree_adjref_recurse(nh_t cldh,
 
 static bool_t tree_extattr_recurse(nh_t parh,
 				    nh_t cldh,
-				    bool_t (* cbfunc)(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;
@@ -2057,7 +2057,7 @@ tree_extattr(bool_t (* cbfunc)(char *path, dah_t dah), char *path)
 static bool_t
 tree_extattr_recurse(nh_t parh,
 		      nh_t cldh,
-		      bool_t (* cbfunc)(char *path, dah_t dah),
+		      bool_t (*cbfunc)(char *path, dah_t dah),
 		      char *path)
 {
 	node_t *parp;
@@ -2113,7 +2113,7 @@ tree_extattr_recurse(nh_t parh,
 		return BOOL_TRUE;
 	}
 	if (dah != DAH_NULL) {
-		ok = (* cbfunc)(path, dah);
+		ok = (*cbfunc)(path, dah);
 	} else {
 		ok = BOOL_TRUE;
 	}
@@ -2833,14 +2833,14 @@ tsi_cmd_pwd(void *ctxp,
 	/* special case root
 	 */
 	if (tranp->t_inter.i_cwdh == persp->p_rooth) {
-		(* pcb)(pctxp, "cwd is fs root\n");
+		(*pcb)(pctxp, "cwd is fs root\n");
 		return;
 	}
 
 	/* ascend tree recursively, print path on way back
 	 */
 	tsi_cmd_pwd_recurse(ctxp, pcb, pctxp, tranp->t_inter.i_cwdh);
-	(* pcb)(pctxp, "\n");
+	(*pcb)(pctxp, "\n");
 }
 
 static void
@@ -2864,14 +2864,14 @@ tsi_cmd_pwd_recurse(void *ctxp,
 	if (parh != persp->p_rooth) {
 		tsi_cmd_pwd_recurse(ctxp, pcb, pctxp, parh);
 			/* RECURSION */
-		(* pcb)(pctxp, "/");
+		(*pcb)(pctxp, "/");
 	}
 	assert(nrh != NRH_NULL);
 	namelen = namreg_get(nrh,
 			      tranp->t_inter.i_name,
 			      sizeof(tranp->t_inter.i_name));
 	assert(namelen > 0);
-	(* pcb)(pctxp, tranp->t_inter.i_name);
+	(*pcb)(pctxp, tranp->t_inter.i_name);
 }
 
 /* ARGSUSED */
@@ -2912,7 +2912,7 @@ tsi_cmd_ls(void *ctxp,
 	/* if named is not a dir, just display named
 	 */
 	if (! isdirpr) {
-		(* pcb)(pctxp,
+		(*pcb)(pctxp,
 			   "    %s %10llu %s%s\n",
 			   isselpr ? "*" : " ",
 			   ino,
@@ -2943,7 +2943,7 @@ tsi_cmd_ls(void *ctxp,
 					      tranp->t_inter.i_name,
 					      sizeof(tranp->t_inter.i_name));
 			assert(namelen > 0);
-			(* pcb)(pctxp,
+			(*pcb)(pctxp,
 				   "    %s %10llu %s%s\n",
 				   isselpr ? "*" : " ",
 				   ino,
@@ -2993,7 +2993,7 @@ tsi_cmd_cd(void *ctxp,
 	 */
 	if (! isdirpr) {
 		assert(arg);
-		(* pcb)(pctxp,
+		(*pcb)(pctxp,
 			   _("%s is not a directory\n"),
 			   arg);
 
@@ -3186,9 +3186,9 @@ tsi_cmd_help(void *ctxp,
 				 /
 				 sizeof(tsi_cmd_tbl[0]);
 
-	(* pcb)(pctxp, _("the following commands are available:\n"));
+	(*pcb)(pctxp, _("the following commands are available:\n"));
 	for (; tblp < tblendp; tblp++) {
-		(* pcb)(pctxp,
+		(*pcb)(pctxp,
 			   "\t%s %s\n",
 			   tblp->tct_pattern,
 			   tblp->tct_help);
@@ -3304,7 +3304,7 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 		 */
 		if (! isdirpr) {
 			if (pcb) {
-				(* pcb)(pctxp, _(
+				(*pcb)(pctxp, _(
 					   "parent of %s is not a directory\n"),
 					   arg);
 			}
@@ -3325,7 +3325,7 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 		if (! strcmp(nbuf, "..")) {
 			if (parh == NH_NULL) {
 				if (pcb) {
-					(* pcb)(pctxp, _(
+					(*pcb)(pctxp, _(
 						   "%s above root\n"),
 						   arg);
 				}
@@ -3379,7 +3379,7 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 		 */
 		if (sibh == NH_NULL) {
 			if (pcb) {
-				(* pcb)(pctxp, _(
+				(*pcb)(pctxp, _(
 					   "%s not found\n"),
 					   arg);
 			}
@@ -3999,7 +3999,7 @@ link_out(nh_t nh)
  * iteration aborted if callback returns FALSE
  */
 static void
-link_headiter(bool_t (* cbfp)(void *contextp, nh_t hardh), void *contextp)
+link_headiter(bool_t (*cbfp)(void *contextp, nh_t hardh), void *contextp)
 {
 	hash_iter(cbfp, contextp);
 }
@@ -4369,7 +4369,7 @@ hash_find(xfs_ino_t ino, gen_t gen)
  * must figure next node prior to calling callback.
  */
 static void
-hash_iter(bool_t (* cbfp)(void *contextp, nh_t hashh), void *contextp)
+hash_iter(bool_t (*cbfp)(void *contextp, nh_t hashh), void *contextp)
 {
 	ix_t hix;
 	size64_t hashlen = persp->p_hashsz / sizeof(nh_t);
@@ -4386,7 +4386,7 @@ hash_iter(bool_t (* cbfp)(void *contextp, nh_t hashh), void *contextp)
 			nexth = np->n_hashh;
 			Node_unmap(nh, &np);
 
-			ok = (* cbfp)(contextp, nh);
+			ok = (*cbfp)(contextp, nh);
 			if (! ok) {
 				return;
 			}
diff --git a/restore/tree.h b/restore/tree.h
index 6c9551b..4f9ffe8 100644
--- a/restore/tree.h
+++ b/restore/tree.h
@@ -97,7 +97,7 @@ extern rv_t tree_cb_links(xfs_ino_t ino,
 			   gen_t gen,
 			   int32_t ctime,
 			   int32_t mtime,
-			   bool_t (* funcp)(void *contextp,
+			   bool_t (*funcp)(void *contextp,
 					       bool_t linkpr,
 					       char *path1,
 					       char *path2),
@@ -115,7 +115,7 @@ extern bool_t tree_setattr(char *path);
 extern bool_t tree_delorph(void);
 extern bool_t tree_subtree_inter(void);
 
-extern bool_t tree_extattr(bool_t (* cbfunc)(char *path, dah_t dah),
+extern bool_t tree_extattr(bool_t (*cbfunc)(char *path, dah_t dah),
 			    char *path);
 	/* does a depthwise bottom-up traversal of the tree, calling
 	 * the supplied callback for all directories with a non-NULL dirattr
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 09/24] xfsdump: add a space after comma and semicolon where was none
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (5 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 08/24] xfsdump: (style) remove a space in ptr dereferences Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 10/24] xfsdump: (style) insert a newline between type and fnt name in definitions Jan Tulak
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

x,y -> x, y

Created by this script:

#!/usr/bin/env bash
#  add a space after , and ; where there is none

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/\([,;]\)\([-.*_&a-zA-Z0-9]\)/\1 \2/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/arch_xlate.c     |  2 +-
 common/content_inode.h  |  2 +-
 common/drive_minrmt.c   | 10 +++++-----
 common/drive_scsitape.c | 10 +++++-----
 common/getdents.c       |  2 +-
 common/inventory.h      |  2 +-
 common/main.c           |  8 ++++----
 common/ts_mtio.h        |  2 +-
 common/util.h           |  2 +-
 dump/content.c          | 10 +++++-----
 include/swap.h          | 18 +++++++++---------
 inventory/inv_api.c     |  4 ++--
 inventory/inv_idx.c     |  8 ++++----
 inventory/inv_oref.h    |  2 +-
 inventory/inv_priv.h    |  6 +++---
 inventory/inv_stobj.c   |  4 ++--
 inventory/inventory.h   |  2 +-
 inventory/testmain.c    |  6 +++---
 invutil/cmenu.h         | 10 +++++-----
 invutil/fstab.c         |  2 +-
 invutil/invidx.c        |  4 ++--
 invutil/invutil.c       |  4 ++--
 librmt/rmtopen.c        |  2 +-
 restore/content.c       |  2 +-
 restore/tree.c          |  6 +++---
 restore/win.c           |  2 +-
 26 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index 99b1d00..46d525f 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -35,7 +35,7 @@
 #include "inv_priv.h"
 #include "mlog.h"
 
-#define IXLATE(a1,a2,MEMBER)	\
+#define IXLATE(a1, a2, MEMBER)	\
 	INT_XLATE((a1)->MEMBER, (a2)->MEMBER, dir, ARCH_CONVERT)
 #define BXLATE(MEMBER)		\
 	bcopy(&(ptr1)->MEMBER, &(ptr2)->MEMBER, sizeof((ptr1)->MEMBER))
diff --git a/common/content_inode.h b/common/content_inode.h
index e1885fd..fa10649 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -75,7 +75,7 @@ struct content_inode_hdr {
 	char pad1[4];					/*   4  10 */
 		/* alignment */
 	time32_t cih_last_time;				/*   4  14 */
-		/* if an incremental,time of previous dump at a lesser level */
+		/* if an incremental, time of previous dump at a lesser level */
 	time32_t cih_resume_time;			/*   4  18 */
 		/* if a resumed dump, time of interrupted dump */
 	xfs_ino_t cih_rootino;				/*   8  20 */
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index d0d1e09..c5c9e56 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -62,11 +62,11 @@
 /* remote tape protocol debug
  */
 #ifdef RMTDBG
-#define	open(p,f)		dbgrmtopen(p,f)
+#define	open(p, f)		dbgrmtopen(p, f)
 #define	close(fd)		dbgrmtclose(fd)
-#define	ioctl(fd,op,arg)	dbgrmtioctl(fd,op,arg)
-#define	read(fd,p,sz)		dbgrmtread(fd,p,sz)
-#define	write(fd,p,sz)		dbgrmtwrite(fd,p,sz)
+#define	ioctl(fd, op, arg)	dbgrmtioctl(fd, op, arg)
+#define	read(fd, p, sz)		dbgrmtread(fd, p, sz)
+#define	write(fd, p, sz)		dbgrmtwrite(fd, p, sz)
 #else /* RMTDBG */
 #define	open rmtopen
 #define	close rmtclose
@@ -2661,7 +2661,7 @@ validate_media_file_hdr(drive_t *drivep)
 
 	/* check the magic number
 	 */
-	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ)) {
 	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "missing magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index c9ba0cf..54bbb9f 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -58,11 +58,11 @@
 /* remote tape protocol debug
  */
 #ifdef RMTDBG
-#define	open(p,f)		dbgrmtopen(p,f)
+#define	open(p, f)		dbgrmtopen(p, f)
 #define	close(fd)		dbgrmtclose(fd)
-#define	ioctl(fd,op,arg)	dbgrmtioctl(fd,op,arg)
-#define	read(fd,p,sz)		dbgrmtread(fd,p,sz)
-#define	write(fd,p,sz)		dbgrmtwrite(fd,p,sz)
+#define	ioctl(fd, op, arg)	dbgrmtioctl(fd, op, arg)
+#define	read(fd, p, sz)		dbgrmtread(fd, p, sz)
+#define	write(fd, p, sz)		dbgrmtwrite(fd, p, sz)
 #else /* RMTDBG */
 #define	open rmtopen
 #define	close rmtclose
@@ -3071,7 +3071,7 @@ validate_media_file_hdr(drive_t *drivep)
 
 	/* check the magic number
 	 */
-	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ)) {
 	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "missing magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
diff --git a/common/getdents.c b/common/getdents.c
index 957bb5a..7f79101 100644
--- a/common/getdents.c
+++ b/common/getdents.c
@@ -17,7 +17,7 @@
  */
 
 /*
- * Copyright (C) 1993, 95, 96, 97, 98, 99,2000,2001 Free Software Foundation, Inc.
+ * Copyright (C) 1993, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
  * This file is based almost entirely on getdents.c in the GNU C Library.
  */
 
diff --git a/common/inventory.h b/common/inventory.h
index 599fc25..a87baae 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -144,7 +144,7 @@ typedef struct invt_strdesc_entry	*inv_stmtoken_t;
 extern inv_idbtoken_t
 inv_open(
 	 inv_predicate_t bywhat, /* BY_UUID, BY_MOUNTPT, BY_DEVPATH */
-	 void 		 *pred);/* uuid_t *,char * mntpt, or char *dev */
+	 void 		 *pred);/* uuid_t *, char * mntpt, or char *dev */
 
 
 extern bool_t
diff --git a/common/main.c b/common/main.c
index 7d40b48..795068d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -980,7 +980,7 @@ usage(void)
 	ULO(_("(interactive)"),				GETOPT_INTERACTIVE);
 	ULO(_("(force usage of minimal rmt)"),		GETOPT_MINRMT);
 	ULO(_("<file> (restore only if newer than)"),	GETOPT_NEWER);
-	ULO(_("(restore owner/group even if not root)"),GETOPT_OWNER);
+	ULO(_("(restore owner/group even if not root)"), GETOPT_OWNER);
 	ULO(_("<seconds between progress reports>"),	GETOPT_PROGRESS);
 	ULO(_("<use QIC tape settings>"),		GETOPT_QIC);
 	ULO(_("(cumulative restore)"),			GETOPT_CUMULATIVE);
@@ -988,7 +988,7 @@ usage(void)
 	ULO(_("(contents only)"),			GETOPT_TOC);
 	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY);
 	ULO(_("(use small tree window)"),		GETOPT_SMALLWINDOW);
-	ULO(_("(don't restore extended file attributes)"),GETOPT_NOEXTATTR);
+	ULO(_("(don't restore extended file attributes)"), GETOPT_NOEXTATTR);
 	ULO(_("(restore root dir owner/permissions)"),	GETOPT_ROOTPERM);
 	ULO(_("(restore DMAPI event settings)"),	GETOPT_SETDM);
 #ifdef REVEAL
@@ -998,7 +998,7 @@ usage(void)
 	ULO(_("(don't prompt)"),			GETOPT_FORCE);
 	ULO(_("(display dump inventory)"),		GETOPT_INVPRINT);
 	ULO(_("(inhibit inventory update)"),		GETOPT_NOINVUPDATE);
-	ULO(_("(force use of format 2 generation numbers)"),GETOPT_FMT2COMPAT);
+	ULO(_("(force use of format 2 generation numbers)"), GETOPT_FMT2COMPAT);
 	ULO(_("<session label>"),			GETOPT_DUMPLABEL);
 #ifdef REVEAL
 	ULO(_("(timestamp messages)"),			GETOPT_TIMESTAMP);
@@ -1007,7 +1007,7 @@ usage(void)
 #ifdef REVEAL
 	ULO(_("(pin down I/O buffers)"),		GETOPT_RINGPIN);
 #endif /* REVEAL */
-	ULO(_("(force interrupted session completion)"),GETOPT_SESSCPLT);
+	ULO(_("(force interrupted session completion)"), GETOPT_SESSCPLT);
 	ULO(_("(resume)"),				GETOPT_RESUME);
 	ULO(_("<session id>"),				GETOPT_SESSIONID);
 	ULO(_("(don't timeout dialogs)"),		GETOPT_NOTIMEOUTS);
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 9b31d25..e50c9c1 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -676,7 +676,7 @@ struct mt_fpmsg {
 			char   msg1[8];	        /* message 1 */
 			char   msg2[8];	        /* message 2 */
 		} ibm3590;
-		struct {		/* Format for Fujitsu Diana 1,2,3 */
+		struct {		/* Format for Fujitsu Diana 1, 2, 3 */
 			char   display_mode:3,
 		               display_len:1,
 		               flash:1,
diff --git a/common/util.h b/common/util.h
index cba4ca8..33b63f8 100644
--- a/common/util.h
+++ b/common/util.h
@@ -151,7 +151,7 @@ extern int diriter(jdm_fshandle_t *fshandlep,
 /*
  * Align pointer up to alignment
  */
-#define	ALIGN_PTR(p,a)	\
+#define	ALIGN_PTR(p, a)	\
 	(((intptr_t)(p) & ((a)-1)) ? \
 		((void *)(((intptr_t)(p) + ((a)-1)) & ~((a)-1))) : \
 		((void *)(p)))
diff --git a/dump/content.c b/dump/content.c
index 5743cf7..341a9ae 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -5694,7 +5694,7 @@ position:
 			}
 
 			if ((int32_t)mwhdrp->mh_mediaix >= 0) {
-				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "cannot interleave dump streams: "
 				      "must supply a blank media object\n"));
 				goto changemedia;
@@ -5829,7 +5829,7 @@ position:
 			}
 
 			if (contextp->cc_Media_useterminatorpr) {
-				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "encountered EOD but expecting a media "
 				      "stream terminator: "
 				      "assuming full media\n"));
@@ -5882,7 +5882,7 @@ position:
 			}
 
 			if (contextp->cc_Media_useterminatorpr) {
-				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "encountered corrupt or foreign data "
 				      "but expecting a media "
 				      "stream terminator: "
@@ -5890,7 +5890,7 @@ position:
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
 			} else if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
-				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "encountered corrupt or foreign data: "
 				      "unable to overwrite: "
 				      "assuming corrupted media\n"));
@@ -5898,7 +5898,7 @@ position:
 				goto changemedia;
 			} else {
 				int status;
-				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "encountered corrupt or foreign data: "
 				      "repositioning to overwrite\n"));
 				mlog_exit_hint(RV_CORRUPT);
diff --git a/include/swap.h b/include/swap.h
index ae575ee..63e210e 100644
--- a/include/swap.h
+++ b/include/swap.h
@@ -35,21 +35,21 @@
 #endif
 
 #ifndef HAVE_SWABMACROS
-#define INT_SWAP16(type,var) ((typeof(type))(__swab16((__u16)(var))))
-#define INT_SWAP32(type,var) ((typeof(type))(__swab32((__u32)(var))))
-#define INT_SWAP64(type,var) ((typeof(type))(__swab64((__u64)(var))))
+#define INT_SWAP16(type, var) ((typeof(type))(__swab16((__u16)(var))))
+#define INT_SWAP32(type, var) ((typeof(type))(__swab32((__u32)(var))))
+#define INT_SWAP64(type, var) ((typeof(type))(__swab64((__u64)(var))))
 #endif
 
 #define INT_SWAP(type, var) \
-	((sizeof(type) == 8) ? INT_SWAP64(type,var) : \
-	((sizeof(type) == 4) ? INT_SWAP32(type,var) : \
-	((sizeof(type) == 2) ? INT_SWAP16(type,var) : \
+	((sizeof(type) == 8) ? INT_SWAP64(type, var) : \
+	((sizeof(type) == 4) ? INT_SWAP32(type, var) : \
+	((sizeof(type) == 2) ? INT_SWAP16(type, var) : \
 	(var))))
 
-#define INT_GET(ref,arch) \
+#define INT_GET(ref, arch) \
 	(((arch) == ARCH_NOCONVERT) ? (ref) : INT_SWAP((ref),(ref)))
 
-#define INT_SET(ref,arch,valueref) \
+#define INT_SET(ref, arch, valueref) \
 	(__builtin_constant_p(valueref) ? \
 	(void)((ref) = (((arch) != ARCH_NOCONVERT) ? \
 	  		   (INT_SWAP((ref),(valueref))) : (valueref))) : \
@@ -57,7 +57,7 @@
 			(((arch) != ARCH_NOCONVERT) ? \
 			   (ref) = INT_SWAP((ref),(ref)) : 0) ))
 
-#define INT_XLATE(buf,p,dir,arch) \
+#define INT_XLATE(buf, p, dir, arch) \
 	((dir > 0) ? ((p) = INT_GET((buf),(arch))) : INT_SET((buf),(arch),(p)))
 
 #endif /* SWAP_H */
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index b9ff239..3a9cc5a 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -920,7 +920,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 				break;
 
 			while (*options != '\0') {
-				d = getsubopt(&options,(constpp)myopts,&value);
+				d = getsubopt(&options,(constpp)myopts, &value);
 				if (value == NULL && d != OPT_FSTAB &&
 				     d != OPT_INVIDX && d != OPT_INVCHECK)
 					continue;
@@ -1007,7 +1007,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 
 	if (npreds > 1) {
 		mlog(MLOG_NORMAL | MLOG_INV, _(
-		     "INV: Only one of mnt=,dev= and fsid=value can be used.\n")
+		     "INV: Only one of mnt=, dev= and fsid=value can be used.\n")
 		     );
 		rval |= I_IERR;
 	}
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 313cb70..28e402d 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -57,7 +57,7 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 	/* If time period of the new entry is before our first invindex,
 	   we have to insert a new invindex in the first slot */
 	if (iarr[0].ie_timeperiod.tp_start > tm) {
-		/* *stobjfd = idx_put_newentry(fd, 0, iarr, icnt, &ient);*/
+		/* *stobjfd = idx_put_newentry(fd, 0, iarr, icnt, &ient); */
 		*stobjfd = open(iarr[0].ie_filename, INV_OFLAG(forwhat));
 		return 0;
 	}
@@ -67,7 +67,7 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 		   period, hellalujah */
 		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm) ) {
 #ifdef INVT_DEBUG
-			mlog(MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n",i);
+			mlog(MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n", i);
 #endif
 			*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			return i;
@@ -110,7 +110,7 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 				   insert the new entry and write back
 				   icnt and invindex entry */
 				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
-							     icnt, &ient);*/
+							     icnt, &ient); */
 			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			      return i;
 			}
@@ -132,7 +132,7 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 				   one. Then insert the new entry and write
 				   back icnt and invindex entries */
 				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
-							     icnt, &ient);*/
+							     icnt, &ient); */
 			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 				return i;
 			}
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 836ce82..3118b38 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -125,7 +125,7 @@ typedef struct invt_oref {
 				       (oref)->lockflag == LOCK_UN)
 
 #define OREF_LOCK(oref, mode) \
-        { if (! OREF_LOCKMODE_EQL(oref,mode)) \
+        { if (! OREF_LOCKMODE_EQL(oref, mode)) \
 	      { INVLOCK((oref)->fd, mode); \
 		(oref)->lockflag = mode; } \
 	}
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 7199920..554c983 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -85,8 +85,8 @@
 			       (size_t) nhdrs * sizeof(invt_seshdr_t) + \
 			       (size_t) nsess * sizeof(invt_session_t) )
 
-#define STREQL(n,m)		(strcmp((n),(m)) == 0)
-#define UUID_EQL(n,m,t)	(uuid_compare(n, m, t) == 0)
+#define STREQL(n, m)		(strcmp((n),(m)) == 0)
+#define UUID_EQL(n, m, t)	(uuid_compare(n, m, t) == 0)
 #define IS_PARTIAL_SESSION(h) ((h)->sh_flag & INVT_PARTIAL)
 #define IS_RESUMED_SESSION(h) ((h)->sh_flag & INVT_RESUMED)
 #define SC_EOF_INITIAL_POS	(off64_t) (sizeof(invt_sescounter_t) + \
@@ -94,7 +94,7 @@
 					 (sizeof(invt_seshdr_t) + \
 					   sizeof(invt_session_t) ))
 
-#define INV_PERROR(s)  	mlog(MLOG_NORMAL,"INV: %s %s\n", s,strerror(errno))
+#define INV_PERROR(s)  	mlog(MLOG_NORMAL,"INV: %s %s\n", s, strerror(errno))
 #define INV_OFLAG(f)    (f == INV_SEARCH_ONLY) ? O_RDONLY: O_RDWR
 
 /*----------------------------------------------------------------------*/
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 022e9b2..2b86376 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -445,7 +445,7 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 	off64_t off  = hdr->sh_streams_off;
 	off64_t mfileoff = off + (off64_t)(nstm * sizeof(invt_stream_t) );
 	uint nmfiles = 0;
-	uint i,j;
+	uint i, j;
 
 	/* fix the offsets in streams */
 	for (i = 0; i < nstm; i++) {
@@ -636,7 +636,7 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 
 	/* 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>
+	   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)
diff --git a/inventory/inventory.h b/inventory/inventory.h
index ad27205..e81f153 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -189,7 +189,7 @@ 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
diff --git a/inventory/testmain.c b/inventory/testmain.c
index c4003fd..07f4ae3 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -202,7 +202,7 @@ query_test(int level)
 	invt_pr_ctx_t prctx;
 
 	if (level == -2) {
-		printf("mount pt %s\n",sesfile);
+		printf("mount pt %s\n", sesfile);
 		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile);
 		if (! tok) return -1;
 		idx_DEBUG_print (tok->d_invindex_fd);
@@ -251,7 +251,7 @@ query_test(int level)
 int
 write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 {
-	int i,j,k,m,fd;
+	int i, j, k, m, fd;
 	unsigned int stat;
 	uuid_t *fsidp;
 	inv_idbtoken_t tok1;
@@ -301,7 +301,7 @@ write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 	for (i = 0; i < nsess; i++) {
 		j = i % 8;
 		/*mnt = mnt_str[j];
-		dev = dev_str[7-j];*/
+		dev = dev_str[7-j]; */
 		mnt = mnt_str[0];
 		dev = dev_str[7];
 		fsidp = &fsidarr[0]; /* j */
diff --git a/invutil/cmenu.h b/invutil/cmenu.h
index 075bcf3..4adfc8e 100644
--- a/invutil/cmenu.h
+++ b/invutil/cmenu.h
@@ -26,16 +26,16 @@
 /* number of lines for info window */
 #define INFO_SIZE 4
 
-#define put_header(m,a)		put_line(stdscr, 0, m, A_REVERSE | A_BOLD, a)
-#define put_footer(m,a)		put_line(stdscr, LINES - 1, m, A_REVERSE | A_BOLD, a)
+#define put_header(m, a)		put_line(stdscr, 0, m, A_REVERSE | A_BOLD, a)
+#define put_footer(m, a)		put_line(stdscr, LINES - 1, m, A_REVERSE | A_BOLD, a)
 #define put_error(m)		put_line(stdscr, LINES - 1, m, A_REVERSE | A_BOLD, ALIGN_LEFT);\
 					beep();\
 					wrefresh(stdscr);\
 					sleep(2)
 #define put_info_header(m)	put_line(infowin, 0, m, A_REVERSE|A_BOLD, ALIGN_LEFT)
-#define put_info_line(l,m)	put_line(infowin, l, m, 0, ALIGN_LEFT)
-#define put_option(w,l,t,a)	put_line(w, l, t, a, ALIGN_LEFT)
-#define clear_line(w,l)		wmove(w, l, 0); wclrtoeol(w);
+#define put_info_line(l, m)	put_line(infowin, l, m, 0, ALIGN_LEFT)
+#define put_option(w, l, t, a)	put_line(w, l, t, a, ALIGN_LEFT)
+#define clear_line(w, l)		wmove(w, l, 0); wclrtoeol(w);
 
 typedef enum {
     ALIGN_LEFT,
diff --git a/invutil/fstab.c b/invutil/fstab.c
index 3319a5c..88d849e 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -44,7 +44,7 @@ int fstab_numfiles;
 menu_ops_t fstab_ops = {
     NULL,
     NULL,
-    NULL, /*fstab_saveall,*/
+    NULL, /*fstab_saveall, */
     fstab_select,
     NULL,
     NULL,
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 9944bd0..c8caa48 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -463,7 +463,7 @@ update_invidx_entry(int fd, char *filename, int stobj_fd)
     read_n_bytes(stobj_fd, &sescnt, sizeof(sescnt), "stobj file");
 
     memset(&hdr, 0, sizeof(hdr));
-    first_offset = STOBJ_OFFSET(0,0);
+    first_offset = STOBJ_OFFSET(0, 0);
     lseek(stobj_fd, first_offset, SEEK_SET);
     read_n_bytes(stobj_fd, &hdr, sizeof(hdr), "stobj file");
     start_time = hdr.sh_time;
@@ -632,7 +632,7 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
     off64_t	off	= hdr->sh_streams_off;
     off64_t	mfileoff= off + (off64_t)(nstm * sizeof(invt_stream_t) );
     uint	nmfiles = 0;
-    uint	i,j;
+    uint	i, j;
 
     /* fix the offsets in streams */
      for (i = 0; i < nstm; i++) {
diff --git a/invutil/invutil.c b/invutil/invutil.c
index a002d56..a744d58 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -460,7 +460,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
     int		j;
     bool_t	removeflag;
     invt_fstab_t *fstabentry;
-    invt_counter_t *counter,cnt;
+    invt_counter_t *counter, cnt;
 
     if (mountPt == NULL && uuid_is_null(*uuidp) && uuid_is_null(*sessionp)) {
 	fprintf(stderr, "%s: mountpoint, uuid or session "
@@ -613,7 +613,7 @@ CheckAndPruneInvIndexFile(bool_t checkonly,
     invt_counter_t header;
 
     printf("      processing index file \n"
-	   "       %s\n",idxFileName);
+	   "       %s\n", idxFileName);
 
     fd = open_and_lock(idxFileName,
 			FILE_WRITE,
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index a091c72..2f46324 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -50,7 +50,7 @@ struct uname_table
 };
 
 struct uname_table uname_table[] =
-{ {UNAME_LINUX, "Linux"}, {UNAME_IRIX, "IRIX"}, {0,0} };
+{ {UNAME_LINUX, "Linux"}, {UNAME_IRIX, "IRIX"}, {0, 0} };
 
 
 /*
diff --git a/restore/content.c b/restore/content.c
index 47a9c21..e3217e7 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -2207,7 +2207,7 @@ content_stream_restore(ix_t thrdix)
 		if (fileh == DH_NULL) {
 			return mlog_exit(EXIT_FAULT, RV_ERROR);
 		}
-		uuid_copy(persp->s.dumpid,grhdrp->gh_dumpid);
+		uuid_copy(persp->s.dumpid, grhdrp->gh_dumpid);
 		persp->s.begintime = time(0);
 		tranp->t_dumpidknwnpr = BOOL_TRUE;
 		tranp->t_sync2 = SYNC_DONE;
diff --git a/restore/tree.c b/restore/tree.c
index 024e26b..7612634 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -1974,7 +1974,7 @@ tree_cb_links(xfs_ino_t ino,
 			adopt(persp->p_orphh, nh, NRH_NULL);
 			ok = Node2path(nh, path1, _("orphan"));
 			assert(ok);
-			(void)(*funcp)(contextp, BOOL_FALSE, path1,path2);
+			(void)(*funcp)(contextp, BOOL_FALSE, path1, path2);
 		}
 	}
 	return RV_OK;
@@ -3130,7 +3130,7 @@ static tsi_cmd_tbl_t tsi_cmd_tbl[] = {
 	{ "cd",		"[<path>]",			tsi_cmd_cd,	1, 2 },
 	{ "add",	"[<path>]",			tsi_cmd_add,	1, 2 },
 	{ "delete",	"[<path>]",			tsi_cmd_delete,	1, 2 },
-	{ "extract",	"",				tsi_cmd_extract,1, 1 },
+	{ "extract",	"",				tsi_cmd_extract, 1, 1 },
 	{ "quit",	"",				tsi_cmd_quit,	1, 1 },
 	{ "help",	"",				tsi_cmd_help,	1, 1 },
 };
@@ -3610,7 +3610,7 @@ adopt(nh_t parh, nh_t cldh, nrh_t nrh)
 
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE,
-	   "adopt(parent=%llu,child=%llu,node=%llu): \n",
+	   "adopt(parent=%llu, child=%llu, node=%llu): \n",
 	   parh, cldh, nrh);
 #endif
 
diff --git a/restore/win.c b/restore/win.c
index 53ca9b8..d3fe4dc 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -187,7 +187,7 @@ win_map(segix_t segix, void **pp)
 
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
-	     "win_map(segix=%u,addr=%p)\n", segix, pp);
+	     "win_map(segix=%u, addr=%p)\n", segix, pp);
 #endif
 	/* resize the array if necessary */
 	if (segix >= tranp->t_segmaplen)
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 10/24] xfsdump: (style) insert a newline between type and fnt name in definitions
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (6 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 09/24] xfsdump: add a space after comma and semicolon where was none Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 11/24] xfsdump: (style) add a space after if, switch, for, do, while Jan Tulak
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

The xfs style we want to have after this patch is:

int

foo(...)

This patch only changes .c files. .h files use one-line style for
declarations, as is the custom in xfsprogs.

int foo(...)

Created by this script:

#!/usr/bin/env bash
# add a newline between type and function name on definitions
# (so skip .h files for this)

find . -name '*.c' ! -type d -exec bash -c '
sed -i \
    -e "s/^\([_a-zA-Z0-9][_a-zA-Z0-9 	]\+\) \([_a-zA-Z0-9]\+\)(\([^;]\+\)$/\1
\2(\3/" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/dlog.c           |  3 +-
 common/drive.c          |  3 +-
 common/drive_minrmt.c   | 12 +++++---
 common/drive_scsitape.c | 15 ++++++----
 common/getdents.c       |  3 +-
 common/stream.c         |  9 ++++--
 dump/content.c          | 60 ++++++++++++++++++++++++++-------------
 dump/inomap.c           | 18 ++++++++----
 inventory/testmain.c    |  3 +-
 librmt/rmtabort.c       |  3 +-
 librmt/rmtclose.c       |  3 +-
 librmt/rmtcommand.c     |  3 +-
 librmt/rmtlseek.c       |  3 +-
 librmt/rmtread.c        |  3 +-
 librmt/rmtstatus.c      |  3 +-
 librmt/rmtwrite.c       |  3 +-
 restore/content.c       | 63 +++++++++++++++++++++++++++--------------
 restore/tree.c          | 42 ++++++++++++++++++---------
 18 files changed, 168 insertions(+), 84 deletions(-)

diff --git a/common/dlog.c b/common/dlog.c
index d5b0443..acbf8bf 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -42,7 +42,8 @@ static char *promptstr = " -> ";
 
 static sigset_t dlog_registered_sigs;
 
-static bool_t promptinput(char *buf,
+static bool_t
+promptinput(char *buf,
 			   size_t bufsz,
 			   ix_t *exceptionixp,
 			   time32_t timeout,
diff --git a/common/drive.c b/common/drive.c
index 02a0f1f..e19390f 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -56,7 +56,8 @@ extern drive_strategy_t drive_strategy_rmt;
 /* forward declarations of locally defined static functions ******************/
 
 static drive_t *drive_alloc(char *, size_t);
-static void drive_allochdrs(drive_t *drivep,
+static void
+drive_allochdrs(drive_t *drivep,
 			     global_hdr_t *gwhdrtemplatep,
 			     ix_t driveix);
 
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index c5c9e56..89d3f5e 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -303,22 +303,26 @@ static bool_t get_tpcaps(drive_t *);
 static int prepare_drive(drive_t *drivep);
 static bool_t Open(drive_t *drivep);
 static void Close(drive_t *drivep);
-static int Read(drive_t *drivep,
+static int
+Read(drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
 		      int *errnop);
-static int Write(drive_t *drivep,
+static int
+Write(drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
 		       int *saved_errnop);
-static int record_hdr_validate(drive_t *drivep,
+static int
+record_hdr_validate(drive_t *drivep,
 				     char *bufp,
 				     bool_t chkoffpr);
 static int ring_read(void *clientctxp, char *bufp);
 static int ring_write(void *clientctxp, char *bufp);
 static double percent64(off64_t num, off64_t denom);
 static int getrec(drive_t *drivep);
-static int write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
+static int
+write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
                               bool_t xlatepr);
 static ring_msg_t * Ring_get(ring_t *ringp);
 static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 54bbb9f..54a6797 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -350,25 +350,30 @@ static bool_t set_fixed_blksz(drive_t *, size_t);
 static int prepare_drive(drive_t *drivep);
 static bool_t Open(drive_t *drivep);
 static void Close(drive_t *drivep);
-static int Read(drive_t *drivep,
+static int
+Read(drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
 		      int *errnop);
-static int Write(drive_t *drivep,
+static int
+Write(drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
 		       int *saved_errnop);
-static int quick_backup(drive_t *drivep,
+static int
+quick_backup(drive_t *drivep,
 			      drive_context_t *contextp,
 			      ix_t skipcnt);
-static int record_hdr_validate(drive_t *drivep,
+static int
+record_hdr_validate(drive_t *drivep,
 				     char *bufp,
 				     bool_t chkoffpr);
 static int ring_read(void *clientctxp, char *bufp);
 static int ring_write(void *clientctxp, char *bufp);
 static double percent64(off64_t num, off64_t denom);
 static int getrec(drive_t *drivep);
-static int write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
+static int
+write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
                               bool_t xlatepr);
 static ring_msg_t * Ring_get(ring_t *ringp);
 static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
diff --git a/common/getdents.c b/common/getdents.c
index 7f79101..f3d967e 100644
--- a/common/getdents.c
+++ b/common/getdents.c
@@ -51,7 +51,8 @@ struct kernel_dirent64 {
    reasonable number of bytes to read.  If we should be wrong, we can
    reset the file descriptor.  In practice the kernel is limiting the
    amount of data returned much more then the reduced buffer size.  */
-int getdents_wrap(int fd, char *buf, size_t nbytes)
+int
+getdents_wrap(int fd, char *buf, size_t nbytes)
 {
 	struct dirent *dp;
 	struct kernel_dirent64 *kdp;
diff --git a/common/stream.c b/common/stream.c
index f7a0cce..0bc6a34 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -222,17 +222,20 @@ stream_getix(pthread_t tid)
 	if (p) p->s_exit_ ## field_name = (value);			\
 	unlock();
 
-void stream_set_code(pthread_t tid, int exit_code)
+void
+stream_set_code(pthread_t tid, int exit_code)
 {
 	stream_set(code, tid, exit_code);
 }
 
-void stream_set_return(pthread_t tid, rv_t rv)
+void
+stream_set_return(pthread_t tid, rv_t rv)
 {
 	stream_set(return, tid, rv);
 }
 
-void stream_set_hint(pthread_t tid, rv_t rv)
+void
+stream_set_hint(pthread_t tid, rv_t rv)
 {
 	stream_set(hint, tid, rv);
 }
diff --git a/dump/content.c b/dump/content.c
index 341a9ae..0f46563 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -261,51 +261,61 @@ extern size_t pgsz;
 
 /* file dumpers
  */
-static rv_t dump_dirs(ix_t strmix,
+static rv_t
+dump_dirs(ix_t strmix,
 		       xfs_bstat_t *bstatbufp,
 		       size_t bstatbuflen,
 		       void *inomap_contextp);
-static rv_t dump_dir(ix_t strmix,
+static rv_t
+dump_dir(ix_t strmix,
 		      jdm_fshandle_t *,
 		      int,
 		      xfs_bstat_t *);
-static rv_t dump_file(void *,
+static rv_t
+dump_file(void *,
 		       jdm_fshandle_t *,
 		       int,
 		       xfs_bstat_t *);
-static rv_t dump_file_reg(drive_t *drivep,
+static rv_t
+dump_file_reg(drive_t *drivep,
 			   context_t *contextp,
 			   content_inode_hdr_t *scwhdrp,
 			   jdm_fshandle_t *,
 			   xfs_bstat_t *,
 			   bool_t *);
-static rv_t dump_file_spec(drive_t *drivep,
+static rv_t
+dump_file_spec(drive_t *drivep,
 			    context_t *contextp,
 			    jdm_fshandle_t *,
 			    xfs_bstat_t *);
-static rv_t dump_filehdr(drive_t *drivep,
+static rv_t
+dump_filehdr(drive_t *drivep,
 			  context_t *contextp,
 			  xfs_bstat_t *,
 			  off64_t,
 			  int);
-static rv_t dump_extenthdr(drive_t *drivep,
+static rv_t
+dump_extenthdr(drive_t *drivep,
 			    context_t *contextp,
 			    int32_t,
 			    int32_t,
 			    off64_t,
 			    off64_t);
-static rv_t dump_dirent(drive_t *drivep,
+static rv_t
+dump_dirent(drive_t *drivep,
 			 context_t *contextp,
 			 xfs_bstat_t *,
 			 xfs_ino_t,
 			 gen_t,
 			 char *,
 			 size_t);
-static rv_t init_extent_group_context(jdm_fshandle_t *,
+static rv_t
+init_extent_group_context(jdm_fshandle_t *,
 				       xfs_bstat_t *,
 				       extent_group_context_t *);
 static void cleanup_extent_group_context(extent_group_context_t *);
-static rv_t dump_extent_group(drive_t *drivep,
+static rv_t
+dump_extent_group(drive_t *drivep,
 			       context_t *contextp,
 			       xfs_bstat_t *,
 			       extent_group_context_t *,
@@ -315,7 +325,8 @@ static rv_t dump_extent_group(drive_t *drivep,
 			       off64_t *,
 			       off64_t *,
 			       bool_t *);
-static bool_t dump_session_inv(drive_t *drivep,
+static bool_t
+dump_session_inv(drive_t *drivep,
 			        context_t *contextp,
 			        media_hdr_t *mwhdrp,
 			        content_inode_hdr_t *scwhdrp);
@@ -324,36 +335,43 @@ static rv_t write_pad(drive_t *drivep, size_t);
 static void mark_callback(void *, drive_markrec_t *, bool_t);
 
 static void inv_cleanup(void);
-static void dump_terminator(drive_t *drivep,
+static void
+dump_terminator(drive_t *drivep,
 			     context_t *contextp,
 			     media_hdr_t *mwhdrp);
-static rv_t Media_mfile_begin(drive_t *drivep,
+static rv_t
+Media_mfile_begin(drive_t *drivep,
 			       context_t *contextp,
 			       bool_t intr_allowed);
-static rv_t Media_mfile_end(drive_t *drivep,
+static rv_t
+Media_mfile_end(drive_t *drivep,
 			     context_t *contextp,
 			     media_hdr_t *mwhdrp,
 			     off64_t *ncommittedp,
 			     bool_t hit_eom);
 static bool_t Media_prompt_overwrite(drive_t *drivep);
-static rv_t Media_erasechk(drive_t *drivep,
+static rv_t
+Media_erasechk(drive_t *drivep,
 			    int dcaps,
 			    bool_t intr_allowed,
 			    bool_t prevmediapresentpr);
 static bool_t Media_prompt_erase(drive_t *drivep);
 static char *Media_prompt_label(drive_t *drivep, char *bufp, size_t bufsz);
-static void update_cc_Media_useterminatorpr(drive_t *drivep,
+static void
+update_cc_Media_useterminatorpr(drive_t *drivep,
 					     context_t *contextp);
 static void set_mcflag(ix_t thrdix);
 static void clr_mcflag(ix_t thrdix);
 
 static bool_t check_complete_flags(void);
 
-static rv_t dump_extattrs(drive_t *drivep,
+static rv_t
+dump_extattrs(drive_t *drivep,
 			   context_t *contextp,
 	       		   jdm_fshandle_t *fshandlep,
 			   xfs_bstat_t *statp);
-static rv_t dump_extattr_list(drive_t *drivep,
+static rv_t
+dump_extattr_list(drive_t *drivep,
 			       context_t *contextp,
 	       		       jdm_fshandle_t *fshandlep,
 			       xfs_bstat_t *statp,
@@ -367,7 +385,8 @@ static char *dump_extattr_buildrecord(xfs_bstat_t *statp,
 				       uint32_t valuesz,
 				       int flag,
 				       char **valuepp);
-static rv_t dump_extattrhdr(drive_t *drivep,
+static rv_t
+dump_extattrhdr(drive_t *drivep,
 			     context_t *contextp,
 			     xfs_bstat_t *statp,
 			     size_t recsz,
@@ -375,7 +394,8 @@ static rv_t dump_extattrhdr(drive_t *drivep,
 			     ix_t flags,
 			     uint32_t valsz);
 
-static bool_t save_quotas(char *mntpnt,
+static bool_t
+save_quotas(char *mntpnt,
 			   quota_info_t *quotainfo);
 static int getxfsqstat(char *fsdev);
 
diff --git a/dump/inomap.c b/dump/inomap.c
index 182d99e..b6acd3c 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -67,7 +67,8 @@ extern bool_t allowexcludefiles_pr;
 
 /* inomap construction callbacks
  */
-static int cb_context(bool_t last,
+static int
+cb_context(bool_t last,
 			    time32_t,
 			    bool_t,
 			    time32_t,
@@ -86,11 +87,13 @@ static bool_t cb_inoinresumerange(xfs_ino_t);
 static bool_t cb_inoresumed(xfs_ino_t);
 static void cb_accuminit_sz(void);
 static void cb_spinit(void);
-static int cb_startpt(void *,
+static int
+cb_startpt(void *,
 			    jdm_fshandle_t *,
 			    int,
 			    xfs_bstat_t *);
-static int supprt_prune(void *,
+static int
+supprt_prune(void *,
 			      jdm_fshandle_t *,
 			      int,
 			      xfs_bstat_t *,
@@ -107,17 +110,20 @@ static void inomap_set_gen(void *, xfs_ino_t, gen_t);
 
 /* subtree abstraction
  */
-static int subtree_descend_cb(void *,
+static int
+subtree_descend_cb(void *,
 				    jdm_fshandle_t *,
 				    int fsfd,
 				    xfs_bstat_t *,
 				    char *);
-static int subtreelist_parse_cb(void *,
+static int
+subtreelist_parse_cb(void *,
 				      jdm_fshandle_t *,
 				      int fsfd,
 				      xfs_bstat_t *,
 				      char *);
-static int subtreelist_parse(jdm_fshandle_t *,
+static int
+subtreelist_parse(jdm_fshandle_t *,
 				   int,
 				   xfs_bstat_t *,
 				   char *[],
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 07f4ae3..09b9bd6 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -359,7 +359,8 @@ write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 }
 
 
-void usage(void)
+void
+usage(void)
 {
 	printf("(%s ./inv w|r|q -v <verbosity> -s <nsess>"
 	       "-t <strms> -m <nmediafiles> \n", optarg);
diff --git a/librmt/rmtabort.c b/librmt/rmtabort.c
index a7db4b1..bd61b25 100644
--- a/librmt/rmtabort.c
+++ b/librmt/rmtabort.c
@@ -28,7 +28,8 @@
  *	abort --- close off a remote tape connection
  */
 
-void _rmt_abort(int fildes)
+void
+_rmt_abort(int fildes)
 {
 	close(READ(fildes));
 	close(WRITE(fildes));
diff --git a/librmt/rmtclose.c b/librmt/rmtclose.c
index 97f53c7..b15a459 100644
--- a/librmt/rmtclose.c
+++ b/librmt/rmtclose.c
@@ -49,7 +49,8 @@ int fildes;
  *	_rmt_close --- close a remote magtape unit and shut down
  */
 
-static int _rmt_close(int fildes)
+static int
+_rmt_close(int fildes)
 {
 	int rc;
 
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index b5726d9..5811d50 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -32,7 +32,8 @@
  *	_rmt_command --- attempt to perform a remote tape command
  */
 
-int _rmt_command(fildes, buf)
+int
+_rmt_command(fildes, buf)
 int fildes;
 char *buf;
 {
diff --git a/librmt/rmtlseek.c b/librmt/rmtlseek.c
index bf8c0fa..7278921 100644
--- a/librmt/rmtlseek.c
+++ b/librmt/rmtlseek.c
@@ -52,7 +52,8 @@ int whence;
  *	_rmt_lseek --- perform an imitation lseek operation remotely
  */
 
-static off_t _rmt_lseek(int fildes, off_t offset, int whence)
+static off_t
+_rmt_lseek(int fildes, off_t offset, int whence)
 {
 	char buffer[BUFMAGIC];
 
diff --git a/librmt/rmtread.c b/librmt/rmtread.c
index 3456901..7531b69 100644
--- a/librmt/rmtread.c
+++ b/librmt/rmtread.c
@@ -53,7 +53,8 @@ unsigned int nbyte;
  *	_rmt_read --- read a buffer from a remote tape
  */
 
-static int _rmt_read(int fildes, char *buf, unsigned int nbyte)
+static int
+_rmt_read(int fildes, char *buf, unsigned int nbyte)
 {
 	int rc, i;
 	char buffer[BUFMAGIC];
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index f141395..91ad308 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -31,7 +31,8 @@
  *	_rmt_status --- retrieve the status from the pipe
  */
 
-int _rmt_status(fildes)
+int
+_rmt_status(fildes)
 int fildes;
 {
 	int i;
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index 9b4cc50..c53aeea 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -53,7 +53,8 @@ unsigned int nbyte;
  *	_rmt_write --- write a buffer to the remote tape
  */
 
-static int _rmt_write(int fildes, char *buf, unsigned int nbyte)
+static int
+_rmt_write(int fildes, char *buf, unsigned int nbyte)
 {
 	char buffer[BUFMAGIC];
 
diff --git a/restore/content.c b/restore/content.c
index e3217e7..5b45906 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -695,7 +695,8 @@ 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 rv_t
+Media_mfile_next(Media_t *Mediap,
 			      purp_t purp,
 			      sync_t *donesyncp,
 			      dh_t  *filehp,
@@ -707,29 +708,34 @@ static rv_t Media_mfile_next(Media_t *Mediap,
 			      drive_t **drivepp,
 			      filehdr_t *fhdr);
 static void Media_end(Media_t *Mediap);
-static bool_t Media_prompt_change(drive_t *drivep,
+static bool_t
+Media_prompt_change(drive_t *drivep,
 				   purp_t purp,
 				   bag_t *bagp,
 				   bool_t knownholespr,
 				   bool_t maybeholespr);
 
 static bool_t Inv_validate_cmdline(void);
-static bool_t dumpcompat(bool_t resumepr,
+static bool_t
+dumpcompat(bool_t resumepr,
 			  ix_t level,
 			  uuid_t baseid,
 			  bool_t logpr);
-static bool_t promptdumpmatch(ix_t thrdix,
+static bool_t
+promptdumpmatch(ix_t thrdix,
 			       global_hdr_t *grhdrp,
 			       media_hdr_t *mrhdrp,
 			       content_hdr_t *crhdrp,
 			       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,
+static dh_t
+pi_addfile(Media_t *Mediap,
 			global_hdr_t *grhdrp,
 			drive_hdr_t *drhdrp,
 			media_hdr_t *mrhdrp,
@@ -746,7 +752,8 @@ static bag_t * pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 					   bool_t showobjindrivepr,
 					   bool_t markskippr);
 static void pi_neededobjs_free(bag_t *bagp);
-static void pi_bracketneededegrps(dh_t thisfileh,
+static void
+pi_bracketneededegrps(dh_t thisfileh,
 				   egrp_t *first_egrp,
 				   egrp_t *next_egrp);
 static void pi_update_stats(off64_t sz);
@@ -754,7 +761,8 @@ 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,
+static bool_t
+pi_know_no_more_beyond_on_object(purp_t purp,
 					        ix_t strmix,
 					        ix_t objix,
 					        ix_t fileix);
@@ -765,12 +773,14 @@ static void pi_note_underhead(dh_t thisobjh, dh_t thisfileh);
 static void pi_lock(void);
 static void pi_unlock(void);
 
-static rv_t applydirdump(drive_t *drivep,
+static rv_t
+applydirdump(drive_t *drivep,
 			  dh_t fileh,
 			  content_inode_hdr_t *scrhdrp,
 			  filehdr_t *fhdrp);
 static rv_t treepost(char *path1, char *path2);
-static rv_t applynondirdump(drive_t *drivep,
+static rv_t
+applynondirdump(drive_t *drivep,
 			     dh_t fileh,
 			     content_inode_hdr_t *scrhdrp,
 			     char *path1,
@@ -780,17 +790,20 @@ 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
+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,
+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,
+static bool_t
+restore_extent_group(drive_t *drivep,
 				    filehdr_t *fhdrp,
 				    char *path,
 				    int fd,
@@ -798,26 +811,30 @@ static bool_t restore_extent_group(drive_t *drivep,
 				    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_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,
+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,
+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,
+static void
+addobj(bag_t *bagp,
 		    uuid_t *objidp,
 		    label_t objlabel,
 		    bool_t indrivepr,
@@ -826,14 +843,16 @@ 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,
+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,
+static void
+display_needed_objects(purp_t purp,
 				    bag_t *bagp,
 				    bool_t knownholespr,
 				    bool_t maybeholespr);
@@ -844,7 +863,8 @@ static void pi_show_nomloglock(void);
 
 static bool_t extattr_init(size_t drivecnt);
 static char * get_extattrbuf(ix_t which);
-static rv_t restore_extattr(drive_t *drivep,
+static rv_t
+restore_extattr(drive_t *drivep,
 			     filehdr_t *fhdrp,
 			     char *path,
 			     bool_t ahcs,
@@ -854,7 +874,8 @@ static rv_t restore_extattr(drive_t *drivep,
 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,
+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);
diff --git a/restore/tree.c b/restore/tree.c
index 7612634..87e6be3 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -268,7 +268,8 @@ 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,
@@ -276,7 +277,8 @@ static nh_t Node_alloc(xfs_ino_t ino,
 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,
+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);
@@ -287,13 +289,16 @@ 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),
+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,
+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,
+static bool_t
+hash_init(size64_t vmsz,
 			 size64_t dircnt,
 			 size64_t nondircnt,
 			 char *perspath);
@@ -302,16 +307,19 @@ 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),
+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 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,
+static void
+tsi_cmd_pwd_recurse(void *ctxp,
 				 dlog_pcbp_t pcb,
 				 void *pctxp,
 				 nh_t nh);
@@ -1173,21 +1181,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);
 
-static bool_t mkdirs_recurse(nh_t parh,
+static bool_t
+mkdirs_recurse(nh_t parh,
 			      nh_t cldh,
 			      char *path);
 
-static bool_t rename_dirs(nh_t cldh,
+static bool_t
+rename_dirs(nh_t cldh,
 			   char *path1,
 			   char *path2);
 
-static bool_t proc_hardlinks(char *path1,
+static bool_t
+proc_hardlinks(char *path1,
 			      char *path2);
 
 bool_t
@@ -1991,7 +2003,8 @@ 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);
 
@@ -2033,7 +2046,8 @@ tree_adjref_recurse(nh_t cldh,
 	}
 }
 
-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),
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 11/24] xfsdump: (style) add a space after if, switch, for, do, while
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (7 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 10/24] xfsdump: (style) insert a newline between type and fnt name in definitions Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 13/24] xfsdump: (2/4)(style) add first empty line for multiline comments Jan Tulak
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

There should be a space in "if(" -> "if (", etc...

Created by this script:

#!/usr/bin/env bash
# add a space after some keywords: for, while, ... so we get 'for (' instead of 'for('

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/\(for\|while\|if\|switch\)(/\1 (/g" \
    -e "s/do{/do {/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/arch_xlate.c     |   2 +-
 common/drive_minrmt.c   |   8 +--
 common/drive_scsitape.c |  10 +--
 common/drive_simple.c   |   4 +-
 common/hsmapi.c         |   2 +-
 common/mlog.c           |   2 +-
 common/ring.c           |   2 +-
 common/util.c           |   2 +-
 dump/content.c          |  56 +++++++--------
 dump/inomap.c           |   2 +-
 inventory/inv_api.c     |   2 +-
 inventory/inv_mgr.c     |   4 +-
 inventory/inv_stobj.c   |   2 +-
 inventory/testmain.c    |   2 +-
 invutil/cmenu.c         | 106 +++++++++++++--------------
 invutil/fstab.c         |  72 +++++++++----------
 invutil/invidx.c        | 154 ++++++++++++++++++++--------------------
 invutil/invutil.c       |  28 ++++----
 invutil/list.c          |  34 ++++-----
 invutil/menu.c          |  70 +++++++++---------
 invutil/screen.c        |   6 +-
 invutil/stobj.c         |  82 ++++++++++-----------
 librmt/rmtopen.c        |   2 +-
 restore/content.c       |  34 ++++-----
 restore/inomap.c        |   8 +--
 25 files changed, 348 insertions(+), 348 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index 46d525f..1844836 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -290,7 +290,7 @@ xlate_hnk(hnk_t *h1, hnk_t *h2, int dir)
 
 	mlog(MLOG_NITTY, "pre - xlate_hnk\n");
 
-	for(i = 0; i < SEGPERHNK; i++) {
+	for (i = 0; i < SEGPERHNK; i++) {
 		IXLATE(h1, h2, seg[i].base);
 		IXLATE(h1, h2, seg[i].lobits);
 		IXLATE(h1, h2, seg[i].mebits);
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 89d3f5e..01bbd74 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -1914,7 +1914,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)
 		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 		last_rec_wrtn_wo_err = contextp->dc_msgp->rm_user;
-		switch(contextp->dc_msgp->rm_stat) {
+		switch (contextp->dc_msgp->rm_stat) {
 		case RING_STAT_OK:
 		case RING_STAT_INIT:
 			rval = 0;
@@ -2087,7 +2087,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)
 				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
-			switch(contextp->dc_msgp->rm_stat) {
+			switch (contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				rval = 0;
@@ -2132,7 +2132,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)
 			if (contextp->dc_msgp->rm_op == RING_OP_TRACE) {
 				break;
 			}
-			switch(contextp->dc_msgp->rm_stat) {
+			switch (contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				assert(rval == 0);
@@ -3719,7 +3719,7 @@ getrec(drive_t *drivep)
 			}
 		} else {
 			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
-			switch(contextp->dc_msgp->rm_stat) {
+			switch (contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 				contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 				break;
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 54a6797..79a21f2 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -2065,7 +2065,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)
 		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 		last_rec_wrtn_wo_err = contextp->dc_msgp->rm_user;
-		switch(contextp->dc_msgp->rm_stat) {
+		switch (contextp->dc_msgp->rm_stat) {
 		case RING_STAT_OK:
 		case RING_STAT_INIT:
 			rval = 0;
@@ -2238,7 +2238,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)
 				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
-			switch(contextp->dc_msgp->rm_stat) {
+			switch (contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				rval = 0;
@@ -2283,7 +2283,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)
 			if (contextp->dc_msgp->rm_op == RING_OP_TRACE) {
 				break;
 			}
-			switch(contextp->dc_msgp->rm_stat) {
+			switch (contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				assert(rval == 0);
@@ -2585,7 +2585,7 @@ do_bsf(drive_t *drivep, int count, int *statp)
 	/* finally, move to the right side of the file mark
 	 */
 	mtstat = fsf_and_verify(drivep);
-	if(IS_EOT(mtstat)) {
+	if (IS_EOT(mtstat)) {
 		*statp = DRIVE_ERROR_EOM;
 	}
 	if (! IS_FMK(mtstat)) {
@@ -4999,7 +4999,7 @@ getrec(drive_t *drivep)
 			}
 		} else {
 			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
-			switch(contextp->dc_msgp->rm_stat) {
+			switch (contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 				contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 				break;
diff --git a/common/drive_simple.c b/common/drive_simple.c
index f71a2cf..28e6e5b 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -309,7 +309,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)
 			oflags = O_RDWR | O_CREAT;
 
 		} else {
-			switch(statbuf.st_mode & S_IFMT) {
+			switch (statbuf.st_mode & S_IFMT) {
 			case S_IFREG:
 				drivep->d_capabilities |= DRIVE_CAP_ERASE;
 				drivep->d_capabilities |= DRIVE_CAP_REWIND;
@@ -345,7 +345,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)
 
 		}
 		oflags = O_RDONLY;
-		switch(statbuf.st_mode & S_IFMT) {
+		switch (statbuf.st_mode & S_IFMT) {
 		case S_IFREG:
 		case S_IFCHR:
 		case S_IFBLK:
diff --git a/common/hsmapi.c b/common/hsmapi.c
index e3e18a7..2762aa4 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -505,7 +505,7 @@ const	xfs_bstat_t	*statp)
 	if (dmfattrp->fsys != FSYS_TYPE_XFS)
 		return 0; /* unsupported filesystem version */
 
-	switch(dmfattrp->version) {
+	switch (dmfattrp->version) {
 	case DMF_ATTR_FORMAT_0:
 		if (dmf_f_ctxtp->attrlen != sizeof(XFSattrvalue0_t))
 			return 0; /* wrong size */
diff --git a/common/mlog.c b/common/mlog.c
index e09c16c..5dc8dd9 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -138,7 +138,7 @@ mlog_init0(void)
 	 */
 	mlog_streamcnt = 1;
 
-	for(i = 0; i < MLOG_SS_CNT; i++) {
+	for (i = 0; i < MLOG_SS_CNT; i++) {
 		mlog_level_ss[i] = MLOG_VERBOSE;
 	}
 }
diff --git a/common/ring.c b/common/ring.c
index faef34f..1b3b51b 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -427,7 +427,7 @@ ring_slave_entry(void *ringctxp)
 		msgp = ring_slave_get(ringp);
 		msgp->rm_rval = 0;
 
-		switch(msgp->rm_op) {
+		switch (msgp->rm_op) {
 		case RING_OP_READ:
 			if (loopmode == LOOPMODE_IGNORE) {
 				msgp->rm_stat = RING_STAT_IGNORE;
diff --git a/common/util.c b/common/util.c
index 7ca5fbe..6443489 100644
--- a/common/util.c
+++ b/common/util.c
@@ -187,7 +187,7 @@ bigstat_iter(jdm_fshandle_t *fshandlep,
 				      "ino %llu needed second bulkstat\n",
 				      p->bs_ino);
 
-				if(bigstat_one(fsfd, p->bs_ino, p) < 0) {
+				if (bigstat_one(fsfd, p->bs_ino, p) < 0) {
 				    mlog(MLOG_WARNING,
 					  _("failed to get bulkstat information for inode %llu\n"),
 					  p->bs_ino);
diff --git a/dump/content.c b/dump/content.c
index 0f46563..f351e78 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -831,16 +831,16 @@ content_init(int argc,
 	uuid_copy(cwhdrtemplatep->ch_fsid, fsid);
 
 	/* write quota information */
-	if(sc_savequotas) {
+	if (sc_savequotas) {
 
 		sc_savequotas = BOOL_FALSE;
-		for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
+		for (i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
 			quotas[i].savequotas = BOOL_FALSE;
 			qstat = getxfsqstat(fsdevice);
 			if (qstat > 0 && (qstat & quotas[i].statflag)) {
 				sprintf(quotas[i].quotapath, "%s/%s", mntpnt, quotas[i].quotafile);
-				if(save_quotas(mntpnt, &quotas[i])) {
-					if(subtreecnt) {
+				if (save_quotas(mntpnt, &quotas[i])) {
+					if (subtreecnt) {
 						subtreecnt++;
 						subtreep = (char **) realloc(subtreep,
 								subtreecnt * sizeof(char *));
@@ -1897,7 +1897,7 @@ content_statline(char **linespp[])
 				 "drive %u: ",
 				 (unsigned int)i);
 		}
-		switch(pdsp->pds_phase) {
+		switch (pdsp->pds_phase) {
 		case PDS_INOMAP:
 			strcat(statline[statlinecnt],
 				"dumping inomap");
@@ -2701,9 +2701,9 @@ content_complete(void)
 	      sc_stat_datadone);
 
 	if (completepr) {
-		if(sc_savequotas) {
-			for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
-				if(quotas[i].savequotas && unlink(quotas[i].quotapath) < 0) {
+		if (sc_savequotas) {
+			for (i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
+				if (quotas[i].savequotas && unlink(quotas[i].quotapath) < 0) {
 					mlog(MLOG_ERROR, _(
 					"unable to remove %s: %s\n"),
 					quotas[i].quotapath,
@@ -3857,7 +3857,7 @@ dump_file(void *arg1,
 
 	/* pass on to specific dump function
 	 */
-	switch(statp->bs_mode & S_IFMT) {
+	switch (statp->bs_mode & S_IFMT) {
 	case S_IFREG:
 		/* ordinary file
 		 */
@@ -5046,7 +5046,7 @@ dump_extenthdr(drive_t *drivep,
 	rv_t rv;
 	char typestr[20];
 
-	switch(type)  {
+	switch (type)  {
 		case EXTENTHDR_TYPE_LAST:
 			strcpy(typestr, "LAST");
 			break;
@@ -5273,7 +5273,7 @@ dump_session_inv(drive_t *drivep,
 
 		partial = BOOL_FALSE;
 		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
-		switch(rv) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_TIMEOUT:
@@ -5331,7 +5331,7 @@ dump_session_inv(drive_t *drivep,
 				      mwhdrp,
 				      &ncommitted,
 				      partial);
-		switch(rv) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_EOM:
@@ -5419,7 +5419,7 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 
 		partial = BOOL_FALSE;
 		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
-		switch(rv) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_TIMEOUT:
@@ -5453,7 +5453,7 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 				      mwhdrp,
 				      &ncommitted,
 				      BOOL_FALSE);
-		switch(rv) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_EOM:
@@ -5663,7 +5663,7 @@ position:
 		 */
 		update_cc_Media_useterminatorpr(drivep, contextp);
 
-		switch(rval) {
+		switch (rval) {
 		case 0:
 			mlog_lock();
 			mlog(MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
@@ -5701,7 +5701,7 @@ position:
 			 */
 			(*dop->do_end_read)(drivep);
 
-			switch(Media_erasechk(drivep,
+			switch (Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
 						prevmediapresentpr)) {
@@ -5755,7 +5755,7 @@ position:
 			      "at beginning of media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
-			switch(Media_erasechk(drivep,
+			switch (Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
 						prevmediapresentpr)) {
@@ -5836,7 +5836,7 @@ position:
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
-			switch(Media_erasechk(drivep,
+			switch (Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
 						prevmediapresentpr)) {
@@ -5864,7 +5864,7 @@ position:
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 			      "encountered EOM: media is full\n"));
 
-			switch(Media_erasechk(drivep,
+			switch (Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
 						prevmediapresentpr)) {
@@ -5889,7 +5889,7 @@ position:
 			      "assuming corrupted media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
-			switch(Media_erasechk(drivep,
+			switch (Media_erasechk(drivep,
 						dcaps,
 						intr_allowed,
 						prevmediapresentpr)) {
@@ -6150,7 +6150,7 @@ write:
 		return RV_INTR;
 	}
 	rval = (*dop->do_begin_write)(drivep);
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		return RV_OK;
 	case DRIVE_ERROR_EOM:
@@ -6194,7 +6194,7 @@ Media_mfile_end(drive_t *drivep,
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
 	}
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		contextp->cc_Media_begin_entrystate = BES_ENDOK;
 		return RV_OK;
@@ -6601,7 +6601,7 @@ is_quota_file(ino_t ino)
 {
 	int i;
 
-	for(i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
+	for (i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
 		if (quotas[i].savequotas && ino == quotas[i].quotaino)
 			return BOOL_TRUE;
 	}
@@ -6622,11 +6622,11 @@ save_quotas(char *mntpnt, quota_info_t *quotainfo)
         mlog(MLOG_VERBOSE, _(
 		"saving %s information for: %s\n"), quotainfo->desc, mntpnt);
 
-        if(unlink(quotainfo->quotapath) == 0) {
+        if (unlink(quotainfo->quotapath) == 0) {
             mlog(MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
         }
         else {
-            if(errno != ENOENT) {
+            if (errno != ENOENT) {
                 mlog(MLOG_ERROR, _(
                       "unable to remove %s: %s\n"),
                       quotainfo->quotapath,
@@ -6645,20 +6645,20 @@ save_quotas(char *mntpnt, quota_info_t *quotainfo)
         mlog(MLOG_NITTY, "saving quotas: %s\n", buf);
 
         sts = system(buf);
-        if(sts != 0) {
+        if (sts != 0) {
             mlog(MLOG_ERROR, _(
                   "%s failed with exit status: %d\n"), REPQUOTA,
 		  sts == -1 ? -1 : WEXITSTATUS(sts));
             return BOOL_FALSE;
         }
-        if((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
+        if ((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
             mlog(MLOG_ERROR, _(
                   "open failed %s: %s\n"),
                   quotainfo->quotapath,
                   strerror(errno));
             return BOOL_FALSE;
         }
-        if(fstat(fd, &statb) < 0) {
+        if (fstat(fd, &statb) < 0) {
             mlog(MLOG_ERROR, _(
                   "stat failed %s: %s\n"),
                   quotainfo->quotapath,
diff --git a/dump/inomap.c b/dump/inomap.c
index b6acd3c..ca287d8 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -980,7 +980,7 @@ SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 	relino = ino - segp->base;
 	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
-	switch(state) {
+	switch (state) {
 	case 0:
 		segp->lobits &= clrmask;
 		segp->mebits &= clrmask;
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 3a9cc5a..f34b92a 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -924,7 +924,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 				if (value == NULL && d != OPT_FSTAB &&
 				     d != OPT_INVIDX && d != OPT_INVCHECK)
 					continue;
-				switch(d) {
+				switch (d) {
 					/* process mntpt option */
 				      case OPT_MNT:
 					bywhat = (inv_predicate_t) INV_BY_MOUNTPT;
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 7e73667..b2664ab 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -396,7 +396,7 @@ invmgr_inv_print(
 			continue;
 		}
 		free (scnt);
-		for(s = 0; s < nsess; s++) {
+		for (s = 0; s < nsess; s++) {
 			/* fd is kept locked until we return from the
 			   callback routine */
 
@@ -485,7 +485,7 @@ invmgr_inv_check(
 			       i+1,
 			       iarr[i].ie_timeperiod.tp_start,
 			       iarr[i].ie_timeperiod.tp_end);
-			for(s = 0; s < nsess; s++) {
+			for (s = 0; s < nsess; s++) {
 				printf(_("tm (%d)\t%d\n"), s, harr[s].sh_time);
 			}
 		}
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 2b86376..f86c978 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -75,7 +75,7 @@ stobj_insert_session(invt_idxinfo_t *idx,
 			return -1;
 		}
 
-		for(i = 0; i <  sescnt->ic_curnum; i++) {
+		for (i = 0; i <  sescnt->ic_curnum; i++) {
 			if (uuid_compare(sessions[i].s_sesid,
 					   s->ses->s_sesid) == 0)
 				break;
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 09b9bd6..273fe37 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -428,7 +428,7 @@ main(int argc, char *argv[])
 	optind = 1;
 	optarg = 0;
 
-	while((cc = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+	while ((cc = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 		switch (cc) {
 		      case 'w':
 			op = WRI;
diff --git a/invutil/cmenu.c b/invutil/cmenu.c
index e60fd22..a1704ed 100644
--- a/invutil/cmenu.c
+++ b/invutil/cmenu.c
@@ -60,7 +60,7 @@ menukey_t keyv[] = {
 void
 signal_handler(int s)
 {
-    switch(s) {
+    switch (s) {
     case SIGWINCH:
 	signal(SIGWINCH, signal_handler);
 	delwin(mainmenu);
@@ -88,9 +88,9 @@ menu_commit(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
 
     n = list;
-    while(n != NULL && n->data != NULL) {
+    while (n != NULL && n->data != NULL) {
 	d = n->data;
-	if(d->ops != NULL && d->ops->op_commit != NULL && d->commited == BOOL_FALSE) {
+	if (d->ops != NULL && d->ops->op_commit != NULL && d->commited == BOOL_FALSE) {
 	    d->ops->op_commit(win, n, list);
 	    d->commited = BOOL_TRUE;
 	}
@@ -98,7 +98,7 @@ menu_commit(WINDOW *win, node_t *current, node_t *list)
     }
 
     n = list;
-    while(n != NULL) {
+    while (n != NULL) {
 	next = n->next;
 	node_free(list_del(n));
 	n = next;
@@ -110,7 +110,7 @@ menu_commit(WINDOW *win, node_t *current, node_t *list)
 node_t *
 get_lastnode(node_t *node)
 {
-    while(node->next != NULL) {
+    while (node->next != NULL) {
 	node = node->next;
     }
 
@@ -126,36 +126,36 @@ menu_import(WINDOW *win, node_t *current, node_t *list)
     char *fstabname;
     data_t *d;
 
-    for(;;) {
+    for (;;) {
 	inv_path[0] = '\0';
 
-	if(get_string(win, "Path to inventory to be imported: ", inv_path, MAXPATHLEN) == ERR) {
+	if (get_string(win, "Path to inventory to be imported: ", inv_path, MAXPATHLEN) == ERR) {
 	    put_error("Error: invalid input");
 	    continue;
 	}
-	if(strlen(inv_path) == 0) {
+	if (strlen(inv_path) == 0) {
 	    clear_line(stdscr, LINES - 1);
 	    return BOOL_FALSE;
 	}
-	if(stat(inv_path, &s) < 0 || !S_ISDIR(s.st_mode)) {
+	if (stat(inv_path, &s) < 0 || !S_ISDIR(s.st_mode)) {
 	    put_error("Error: invalid path");
 	    continue;
 	}
 	clear_line(stdscr, LINES - 1);
 
 	fstabname = GetFstabFullPath(inv_path);
-	if(fstabname == NULL) {
+	if (fstabname == NULL) {
 	    put_footer("internal memory error: import inventory", ALIGN_LEFT);
 	    exit(1);
 	}
 
-	while(current->next != NULL) {
+	while (current->next != NULL) {
 	    current = current->next;
 	}
 	generate_fstab_menu(inv_path, current, 0, fstabname);
 	free(fstabname);
 
-	while(current->next != NULL) {
+	while (current->next != NULL) {
 	    current = current->next;
 	    d = current->data;
 	    d->text[1] = 'I';
@@ -182,12 +182,12 @@ menu_select(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = (data_t *)(current->data);
 
-    if(d->ops != NULL && d->ops->op_select != NULL) {
+    if (d->ops != NULL && d->ops->op_select != NULL) {
 	return d->ops->op_select(win, current, list);
     }
 
@@ -201,14 +201,14 @@ expand_node(node_t *node)
     int i;
     data_t *d;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return NULL;
     }
     d = node->data;
 
     d->expanded = BOOL_TRUE;
 
-    for(i = 0; i < d->nbr_children; i++) {
+    for (i = 0; i < d->nbr_children; i++) {
 	((data_t *)(d->children[i]->data))->hidden = BOOL_FALSE;
     }
 
@@ -220,12 +220,12 @@ menu_expand(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = current->data;
 
-    if(d->ops != NULL && d->ops->op_expand != NULL) {
+    if (d->ops != NULL && d->ops->op_expand != NULL) {
 	return d->ops->op_expand(win, current, list);
     }
 
@@ -242,7 +242,7 @@ expand_tree(node_t *node)
     int i;
     data_t *d;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return NULL;
     }
     d = node->data;
@@ -250,7 +250,7 @@ expand_tree(node_t *node)
     d->hidden = BOOL_FALSE;
     d->expanded = BOOL_TRUE;
 
-    for(i = 0; i < d->nbr_children; i++) {
+    for (i = 0; i < d->nbr_children; i++) {
 	expand_tree(d->children[i]);
     }
 
@@ -262,12 +262,12 @@ menu_expandall(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = (data_t *)(current->data);
 
-    if(d->ops != NULL && d->ops->op_expandall != NULL) {
+    if (d->ops != NULL && d->ops->op_expandall != NULL) {
 	return d->ops->op_expandall(win, current, list);
     }
 
@@ -284,17 +284,17 @@ collapse_node(node_t *node)
     int i;
     data_t *d;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return NULL;
     }
     d = node->data;
 
-    if(d->expanded == BOOL_FALSE)
+    if (d->expanded == BOOL_FALSE)
 	return node;
 
     d->expanded = BOOL_FALSE;
 
-    for(i = 0; i < d->nbr_children; i++) {
+    for (i = 0; i < d->nbr_children; i++) {
 	((data_t *)(d->children[i]->data))->hidden = BOOL_TRUE;
 	collapse_node(d->children[i]);
     }
@@ -307,12 +307,12 @@ menu_collapse(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = current->data;
 
-    if(d->ops != NULL && d->ops->op_collapse != NULL) {
+    if (d->ops != NULL && d->ops->op_collapse != NULL) {
 	return d->ops->op_collapse(win, current, list);
     }
 
@@ -329,17 +329,17 @@ menu_collapseall(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
     node_t *n;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = current->data;
 
-    if(d->ops != NULL && d->ops->op_collapseall != NULL) {
+    if (d->ops != NULL && d->ops->op_collapseall != NULL) {
 	return d->ops->op_collapseall(win, current, list);
     }
 
     n = current;
-    while(d->parent != NULL) {
+    while (d->parent != NULL) {
 	n = d->parent;
 	d = n->data;
     }
@@ -356,12 +356,12 @@ menu_delete(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = (data_t *)(current->data);
 
-    if(d->ops != NULL && d->ops->op_delete != NULL) {
+    if (d->ops != NULL && d->ops->op_delete != NULL) {
 	return d->ops->op_delete(win, current, list);
     }
 
@@ -376,12 +376,12 @@ menu_undelete(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
     d = (data_t *)(current->data);
 
-    if(d->ops != NULL && d->ops->op_undelete != NULL) {
+    if (d->ops != NULL && d->ops->op_undelete != NULL) {
 	return d->ops->op_undelete(win, current, list);
     }
 
@@ -397,12 +397,12 @@ menu_saveexit(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_TRUE;
     }
     d = (data_t *)(current->data);
 
-    if(d->ops != NULL && d->ops->op_saveexit != NULL) {
+    if (d->ops != NULL && d->ops->op_saveexit != NULL) {
 	return d->ops->op_saveexit(win, current, list);
     }
 
@@ -415,7 +415,7 @@ delete_node(node_t *node)
     int i;
     data_t *d;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return NULL;
     }
     d = node->data;
@@ -423,7 +423,7 @@ delete_node(node_t *node)
     d->deleted = BOOL_TRUE;
     d->text[0] = 'D';
 
-    for(i = 0; i < d->nbr_children; i++) {
+    for (i = 0; i < d->nbr_children; i++) {
 	delete_node(d->children[i]);
     }
 
@@ -434,7 +434,7 @@ delete_node(node_t *node)
 int
 list_delete(node_t *current, node_t *list)
 {
-    if(current == NULL && current->data == NULL) {
+    if (current == NULL && current->data == NULL) {
 	return 0;
     }
 
@@ -448,7 +448,7 @@ undelete_node(node_t *node)
 {
     data_t *d;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return NULL;
     }
     d = node->data;
@@ -456,7 +456,7 @@ undelete_node(node_t *node)
     d->deleted = BOOL_FALSE;
     d->text[0] = ' ';
 
-    if(d->parent != NULL) {
+    if (d->parent != NULL) {
 	undelete_node(d->parent);
     }
 
@@ -467,7 +467,7 @@ undelete_node(node_t *node)
 void
 list_undelete(node_t *current, node_t *list)
 {
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return;
     }
 
@@ -481,12 +481,12 @@ list_prune(node_t *menulist, char *mountpt, uuid_t *uuidp, time32_t prunetime)
     data_t *d;
 
     n = menulist;
-    while(n != NULL) {
+    while (n != NULL) {
 	d = (data_t *)(n->data);
 
-	if(d != NULL && d->ops != NULL && d->ops->op_prune != NULL) {
-	    if(d->ops->op_prune(mountpt, uuidp, prunetime, n, menulist) == BOOL_TRUE) {
-		if(d->ops->op_delete == NULL) {
+	if (d != NULL && d->ops != NULL && d->ops->op_prune != NULL) {
+	    if (d->ops->op_prune(mountpt, uuidp, prunetime, n, menulist) == BOOL_TRUE) {
+		if (d->ops->op_delete == NULL) {
 		    list_delete(n, menulist);
 		}
 		else {
@@ -494,7 +494,7 @@ list_prune(node_t *menulist, char *mountpt, uuid_t *uuidp, time32_t prunetime)
 		}
 	    }
 	    else {
-		if(d->ops->op_undelete == NULL) {
+		if (d->ops->op_undelete == NULL) {
 		    list_undelete(n, menulist);
 		}
 		else {
@@ -515,7 +515,7 @@ generate_menu(char *inv_path)
     node_t *list;
 
     fstabname = GetFstabFullPath(inv_path);
-    if(fstabname == NULL) {
+    if (fstabname == NULL) {
 	fprintf(stderr, "%s: internal memory error: general_menu\n",
 		g_programName);
 	exit(1);
@@ -538,7 +538,7 @@ create_windows()
     keypad(stdscr, TRUE);
     signal(SIGWINCH, signal_handler);
 
-    if(LINES < 7) {
+    if (LINES < 7) {
 	endwin();
 	fprintf(stderr, "%s: window too small for curses interactive mode: LINES = %d\n",
 		g_programName, LINES);
@@ -550,7 +550,7 @@ create_windows()
     notimeout(mainmenu, TRUE);
 
     menusize = (LINES - 2) - INFO_SIZE;
-    if(menusize <= 0)
+    if (menusize <= 0)
 	menusize = 1;
 
     prefresh(mainmenu,
@@ -559,7 +559,7 @@ create_windows()
 	     menusize, COLS - 1);
 
     infosize = INFO_SIZE;
-    if(infosize <= 0)
+    if (infosize <= 0)
 	infosize = 1;
 
     infowin = newwin(infosize, COLS, menusize + 1, 0);
@@ -576,12 +576,12 @@ invutil_interactive(char *inv_path, char *mountpt, uuid_t *uuidp, time32_t timeS
     node_t	*menulist;
 
     menulist = generate_menu(inv_path);
-    if(menulist == NULL) {
+    if (menulist == NULL) {
 	fprintf(stderr, "%s: abnormal termination\n", g_programName);
 	exit(1);
     }
 
-    if(timeSecs > 0) {
+    if (timeSecs > 0) {
 	list_prune(menulist, mountpt, uuidp, timeSecs);
     }
 
diff --git a/invutil/fstab.c b/invutil/fstab.c
index 88d849e..3dcb9bf 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -68,15 +68,15 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
     int fstabentry_idx;
 
     n = current;
-    if(n == NULL || n->data == NULL)
+    if (n == NULL || n->data == NULL)
 	return 0;
 
     d = ((data_t *)(n->data));
     fidx = d->file_idx;
     fstabentry = fstab_file[fidx].data[d->data_idx];
 
-    if(d->deleted == BOOL_TRUE && d->imported == BOOL_FALSE) {
-	for(i = 0; i < d->nbr_children; i++) {
+    if (d->deleted == BOOL_TRUE && d->imported == BOOL_FALSE) {
+	for (i = 0; i < d->nbr_children; i++) {
 	    invidx_commit(win, d->children[i], list);
 	}
 	mark_all_children_commited(current);
@@ -90,26 +90,26 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
 
 	    fstab_file[fidx].data[d->data_idx] = NULL;
 
-	    for(i = d->data_idx + 1; i < fstab_file[fidx].numrecords; i++) {
-		if(fstab_file[fidx].data[i] != NULL)
+	    for (i = d->data_idx + 1; i < fstab_file[fidx].numrecords; i++) {
+		if (fstab_file[fidx].data[i] != NULL)
 		    fstab_file[fidx].data[i]--;
 	    }
 	}
 	fstab_file[fidx].counter->ic_curnum--;
     }
-    else if(d->imported == BOOL_TRUE) {
+    else if (d->imported == BOOL_TRUE) {
 	invt_fstab_t *dest;
 
-	for(i = 0; i < d->nbr_children; i++) {
+	for (i = 0; i < d->nbr_children; i++) {
 	    invidx_commit(win, d->children[i], list);
 	}
 	mark_all_children_commited(current);
 
-	if(find_matching_fstab(0, fstabentry) >= 0) {
+	if (find_matching_fstab(0, fstabentry) >= 0) {
 	    return 0;
 	}
 
-	if(fstab_file[0].counter->ic_curnum < fstab_file[0].nEntries) {
+	if (fstab_file[0].counter->ic_curnum < fstab_file[0].nEntries) {
 	    dest = fstab_file[0].data[fstab_file[0].counter->ic_curnum - 1] + 1;
 	}
 	else {
@@ -133,12 +133,12 @@ fstab_select(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
 
-    if(d->expanded == TRUE) {
+    if (d->expanded == TRUE) {
 	return menu_collapse(win, current, list);
     }
 
@@ -154,7 +154,7 @@ fstab_highlight(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
     invt_fstab_t *fstabentry;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -181,17 +181,17 @@ fstab_prune(char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, node
     data_t		*d;
     invt_fstab_t	*fstabentry;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return BOOL_FALSE;
     }
 
     d = (data_t *)(node->data);
     fstabentry = fstab_file[d->file_idx].data[d->data_idx];
 
-    if(mountpt != NULL && mntpnt_equal(mountpt, fstabentry->ft_mountpt)) {
+    if (mountpt != NULL && mntpnt_equal(mountpt, fstabentry->ft_mountpt)) {
 	return BOOL_TRUE;
     }
-    if((!uuid_is_null(*uuidp))
+    if ((!uuid_is_null(*uuidp))
        && (uuid_compare(*uuidp, fstabentry->ft_uuid) == 0)) {
 	return BOOL_TRUE;
     }
@@ -202,9 +202,9 @@ fstab_prune(char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, node
 int
 add_fstab_data(int fidx, invt_fstab_t *data)
 {
-    if(fstab_file[fidx].numrecords == 0) {
+    if (fstab_file[fidx].numrecords == 0) {
 	fstab_file[fidx].data = malloc(sizeof(*fstab_file[fidx].data));
-	if(fstab_file[fidx].data == NULL) {
+	if (fstab_file[fidx].data == NULL) {
 	    fprintf(stderr, "%s: internal memory error: fstab data allocation\n", g_programName);
 	    exit(1);
 	}
@@ -213,7 +213,7 @@ add_fstab_data(int fidx, invt_fstab_t *data)
 	fstab_file[fidx].data = realloc(fstab_file[fidx].data,
 					sizeof(*fstab_file[fidx].data)
 					* (fstab_file[fidx].numrecords + 1));
-	if(fstab_file[fidx].data == NULL) {
+	if (fstab_file[fidx].data == NULL) {
 	    fprintf(stderr, "%s: internal memory error: fstab data reallocation\n", g_programName);
 	    exit(1);
 	}
@@ -236,16 +236,16 @@ generate_fstab_menu(char * inv_path, node_t *startnode, int level, char *fstabna
     node_t	*n;
     invt_fstab_t *fstab_entry;
 
-    if((idx = open_fstab(fstabname)) < 0) {
+    if ((idx = open_fstab(fstabname)) < 0) {
 	return NULL;
     }
     fstab_entry = (invt_fstab_t *)(fstab_file[idx].mapaddr + sizeof(invt_counter_t));
 
     n = startnode;
-    for(i=0; i < fstab_file[idx].counter->ic_curnum; i++) {
+    for (i=0; i < fstab_file[idx].counter->ic_curnum; i++) {
 	len = strlen(fstab_entry[i].ft_mountpt) + strlen(fstab_entry[i].ft_devpath) + 40;
 	txt = malloc(len);
-	if(txt == NULL) {
+	if (txt == NULL) {
 	    fprintf(stderr, "%s: internal memory error: fstab_text\n", g_programName);
 	    exit(1);
 	}
@@ -262,10 +262,10 @@ generate_fstab_menu(char * inv_path, node_t *startnode, int level, char *fstabna
 				    NULL,	/* children */
 				    0,		/* nbr_children */
 				    i));	/* data_idx */
-	if(i == 0) {
+	if (i == 0) {
 	    list = n;
 	}
-	if(n == NULL) {
+	if (n == NULL) {
 	    fprintf(stderr, "%s: internal memory error: list_add: node_create: fstab\n", g_programName);
 	    exit(1);
 	}
@@ -284,19 +284,19 @@ add_fstab(char *name, int fd, int nEntries, char *mapaddr, invt_counter_t *count
 {
     static int highwatermark = 10;
 
-    if(fstab_numfiles == 0) {
+    if (fstab_numfiles == 0) {
 	fstab_file = malloc(sizeof(*fstab_file) * highwatermark);
-	if(fstab_file == NULL) {
+	if (fstab_file == NULL) {
 	    fprintf(stderr, "%s: internal memory error: malloc fstab_file\n", g_programName);
 	    exit(1);
 	}
     }
     else {
-	if(fstab_numfiles >= highwatermark - 1) {
+	if (fstab_numfiles >= highwatermark - 1) {
 	    highwatermark += highwatermark;
 
 	    fstab_file = realloc(fstab_file, sizeof(*fstab_file) * highwatermark);
-	    if(fstab_file == NULL) {
+	    if (fstab_file == NULL) {
 		fprintf(stderr, "%s: internal memory error: realloc fstab\n", g_programName);
 		exit(1);
 	    }
@@ -319,13 +319,13 @@ add_fstab(char *name, int fd, int nEntries, char *mapaddr, invt_counter_t *count
 int
 fstab_equal(invt_fstab_t *f1, invt_fstab_t *f2)
 {
-    if(strcmp(f1->ft_mountpt, f2->ft_mountpt) != 0)
+    if (strcmp(f1->ft_mountpt, f2->ft_mountpt) != 0)
 	return BOOL_FALSE;
 
-    if(strcmp(f1->ft_devpath, f2->ft_devpath) != 0)
+    if (strcmp(f1->ft_devpath, f2->ft_devpath) != 0)
 	return BOOL_FALSE;
 
-    if(uuid_compare(f1->ft_uuid, f2->ft_uuid) != 0)
+    if (uuid_compare(f1->ft_uuid, f2->ft_uuid) != 0)
 	return BOOL_FALSE;
 
     return BOOL_TRUE;
@@ -336,8 +336,8 @@ find_matching_fstab(int fidx, invt_fstab_t *fstabentry)
 {
     int i;
 
-    for(i = 0; i < fstab_file[fidx].numrecords; i++) {
-	if(fstab_equal(fstab_file[fidx].data[i], fstabentry) == BOOL_TRUE) {
+    for (i = 0; i < fstab_file[fidx].numrecords; i++) {
+	if (fstab_equal(fstab_file[fidx].data[i], fstabentry) == BOOL_TRUE) {
 	    return i;
 	}
     }
@@ -374,8 +374,8 @@ remmap_fstab(int fidx, int num)
 
     /* regenerate the data index for the file given the new mapping */
     fstab_entry = (invt_fstab_t *)(fstab_file[fidx].mapaddr + sizeof(invt_counter_t));
-    for(i=0; i < nEntries; i++) {
-    	if(i >= fstab_file[fidx].numrecords) {
+    for (i=0; i < nEntries; i++) {
+    	if (i >= fstab_file[fidx].numrecords) {
 	    add_fstab_data(fidx, &(fstab_entry[i]));
 	}
 	else {
@@ -402,7 +402,7 @@ open_fstab(char *fstabname)
     }
 
     name = strdup(fstabname);
-    if(name == NULL) {
+    if (name == NULL) {
 	fprintf(stderr, "%s: internal memory error:  strdup fstabname\n", g_programName);
 	exit(1);
     }
@@ -451,7 +451,7 @@ close_all_fstab()
 {
     int i;
 
-    for(i = 0; i < fstab_numfiles; i++) {
+    for (i = 0; i < fstab_numfiles; i++) {
 	close_fstab(i);
     }
 
diff --git a/invutil/invidx.c b/invutil/invidx.c
index c8caa48..e723110 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -77,7 +77,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
     invt_entry_t *inv_entry;
 
     n = current;
-    if(n == NULL || n->data == NULL)
+    if (n == NULL || n->data == NULL)
 	return 0;
 
     d = ((data_t *)(n->data));
@@ -87,9 +87,9 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
     idx = (int)(((long)inv_entry - (long)invidx_file[fidx].mapaddr - sizeof(invt_counter_t)) / sizeof(invt_entry_t));
 
 
-    if(d->deleted == BOOL_TRUE && d->imported == BOOL_FALSE) {
+    if (d->deleted == BOOL_TRUE && d->imported == BOOL_FALSE) {
 	/* shortcut - just close and unlink stobj files */
-	for(i = 0; i < d->nbr_children; i++) {
+	for (i = 0; i < d->nbr_children; i++) {
 	    close_stobj_file(((data_t *)(d->children[i]->data))->file_idx, BOOL_TRUE);
 	}
 	mark_all_children_commited(current);
@@ -100,14 +100,14 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		    (sizeof(invt_entry_t) * (invidx_file[fidx].counter->ic_curnum - idx - 1)));
 
 	    invidx_file[fidx].data[idx]=NULL;
-	    for(i = idx + 1; i < invidx_file[fidx].numrecords; i++) {
-		if(invidx_file[fidx].data[i] != NULL)
+	    for (i = idx + 1; i < invidx_file[fidx].numrecords; i++) {
+		if (invidx_file[fidx].data[i] != NULL)
 		    invidx_file[fidx].data[i]--;
 	    }
 	}
 	invidx_file[fidx].counter->ic_curnum--;
     }
-    else if(d->imported == BOOL_TRUE) {
+    else if (d->imported == BOOL_TRUE) {
 	int dst_fileidx;
 	int dst_invpos;
 	int dst_invidx;
@@ -120,10 +120,10 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 	snprintf(dst_idxfile, sizeof(dst_idxfile), "%s/%s", inventory_path, basename(invidx_file[fidx].name));
 
 	/* append if we have the target open already, else write to a possibly new file */
-	if((dst_fileidx = find_matching_invidxfile(dst_idxfile)) >= 0) {
+	if ((dst_fileidx = find_matching_invidxfile(dst_idxfile)) >= 0) {
 	    invt_entry_t *dest = NULL;
 
-	    if((dst_invidx = find_overlapping_invidx(dst_fileidx, inv_entry)) >= 0) {
+	    if ((dst_invidx = find_overlapping_invidx(dst_fileidx, inv_entry)) >= 0) {
 	    	char *stobj_filename = NULL;
 		int stobj_fd = -1;
 		int stobj_fileidx;
@@ -140,7 +140,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		last_dst_invidx = -1;
 		i = d->nbr_children - 1;
 		do {
-		    if(dst_invidx != last_dst_invidx) {
+		    if (dst_invidx != last_dst_invidx) {
 			stobj_fileidx = find_matching_stobjfile(invidx_file[dst_fileidx].data[dst_invidx]->ie_filename);
 			stobj_filename = stobj_file[stobj_fileidx].name;
 			stobj_fd = stobj_file[stobj_fileidx].fd;
@@ -167,10 +167,10 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 
 		    free(hdr); free(ses); free(strms); free(mfiles);
 
-		    if(--i < 0)
+		    if (--i < 0)
 		    	break;
 		}
-		while((dst_invidx = find_overlapping_invidx(dst_fileidx, inv_entry)) >= 0);
+		while ((dst_invidx = find_overlapping_invidx(dst_fileidx, inv_entry)) >= 0);
 
 		mark_all_children_commited(current);
 
@@ -178,13 +178,13 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		/* find node for dst_fileidx */
 		dst_n = find_invidx_node(list, dst_fileidx);
 		tmp_parent = ((data_t *)(dst_n->data))->parent;
-		while(dst_n != NULL) {
+		while (dst_n != NULL) {
 		    node_t *tmp_n1;
 
 		    dst_d = dst_n->data;
 
 		    /* close affected invidx file and stobj files */
-		    for(i = 0; i < dst_d->nbr_children; i++) {
+		    for (i = 0; i < dst_d->nbr_children; i++) {
 		        close_stobj_file(((data_t *)(dst_d->children[i]->data))->file_idx, BOOL_FALSE);
 		    }
 
@@ -199,7 +199,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		/* generate invidx menu for the parent node */
 		dst_n = generate_invidx_menu(inventory_path, tmp_parent, 1, dst_idxfile);
 
-		if(dst_n != tmp_parent) {
+		if (dst_n != tmp_parent) {
 		    /* mark all its children commited */
 		    mark_all_children_commited(dst_n);
 		}
@@ -208,12 +208,12 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 	    }
 	    else {
 		/* insert new invidx entry, and copy over stobj file */
-		if(invidx_file[dst_fileidx].counter->ic_curnum >= invidx_file[dst_fileidx].nEntries) {
+		if (invidx_file[dst_fileidx].counter->ic_curnum >= invidx_file[dst_fileidx].nEntries) {
 		    dest = remmap_invidx(dst_fileidx, 1);
 		}
 
 		dst_invpos = find_invidx_insert_pos(dst_fileidx, inv_entry);
-		if(dst_invpos >= 0) {
+		if (dst_invpos >= 0) {
 		    memmove(invidx_file[dst_fileidx].data[dst_invpos + 1],
 			    invidx_file[dst_fileidx].data[dst_invpos],
 			    sizeof(*inv_entry) * (invidx_file[dst_fileidx].counter->ic_curnum - dst_invpos));
@@ -232,15 +232,15 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 
 		/* shortcut - just copy stobj file over */
 		stobjfile = get_inventry_stobjfile(d);
-		if(stobjfile == NULL) {
+		if (stobjfile == NULL) {
 		    put_error("Error: unable to work out stobj filename");
 		    return 0;
 		}
 
 		snprintf(dst_stobjfile, sizeof(dst_stobjfile), "%s/%s", inventory_path, basename(stobjfile));
 
-		if(stat(dst_stobjfile, &s) < 0) {
-		    if(errno != ENOENT) {
+		if (stat(dst_stobjfile, &s) < 0) {
+		    if (errno != ENOENT) {
 			put_error("Error: unable to copy stobj file: stat error");
 			return 0;
 		    }
@@ -251,7 +251,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 		}
 
 		snprintf(cmd, sizeof(cmd), "cp %s %s", stobjfile, dst_stobjfile);
-		if(system(cmd) != 0) {
+		if (system(cmd) != 0) {
 		    put_error("Error: unable to copy stobj file: cp failed");
 		    return 0;
 		}
@@ -272,8 +272,8 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 
 	    mark_all_children_commited(current);
 
-	    if(stat(dst_idxfile, &s) < 0) {
-		if(errno != ENOENT) {
+	    if (stat(dst_idxfile, &s) < 0) {
+		if (errno != ENOENT) {
 		    put_error("Error: unable to stat inventory index file");
 		    return 0;
 		}
@@ -284,7 +284,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 	    }
 
 	    new_fd = open(dst_idxfile, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
-	    if(new_fd < 0) {
+	    if (new_fd < 0) {
 		put_error("Error: unable to open inventory index file");
 		return 0;
 	    }
@@ -302,15 +302,15 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 
 	    /* shortcut - just copy stobj file over */
 	    stobjfile = get_inventry_stobjfile(d);
-	    if(stobjfile == NULL) {
+	    if (stobjfile == NULL) {
 		put_error("Error: unable to work out stobj filename");
 		return 0;
 	    }
 
 	    snprintf(dst_stobjfile, sizeof(dst_stobjfile), "%s/%s", inventory_path, basename(stobjfile));
 
-	    if(stat(dst_stobjfile, &s) < 0) {
-		if(errno != ENOENT) {
+	    if (stat(dst_stobjfile, &s) < 0) {
+		if (errno != ENOENT) {
 		    put_error("Error: unable to copy stobj file: stat error");
 		    return 0;
 		}
@@ -321,7 +321,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 	    }
 
 	    snprintf(cmd, sizeof(cmd), "cp %s %s", stobjfile, dst_stobjfile);
-	    if(system(cmd) != 0) {
+	    if (system(cmd) != 0) {
 		put_error("Error: unable to copy stobj file: cp failed");
 		return 0;
 	    }
@@ -369,17 +369,17 @@ read_stobj_info(int fd, int idx, invt_seshdr_t **out_hdr,
     ses = malloc(sizeof(*ses));
     read_n_bytes(fd, (char *)ses, sizeof(*ses), "stobj file");
 
-    if(ses->s_cur_nstreams > 0) {
+    if (ses->s_cur_nstreams > 0) {
 	lseek(fd, hdr->sh_streams_off, SEEK_SET);
 	strms = malloc(sizeof(*strms) * ses->s_cur_nstreams);
 	read_n_bytes(fd, (char *)strms, sizeof(*strms) * ses->s_cur_nstreams, "stobj file");
 
 	nmfiles = 0;
-	for(i = 0; i < ses->s_cur_nstreams; i++) {
+	for (i = 0; i < ses->s_cur_nstreams; i++) {
 	    nmfiles += strms[i].st_nmediafiles;
 	}
 
-	if(nmfiles > 0) {
+	if (nmfiles > 0) {
 	    mfiles = malloc(sizeof(*mfiles) * nmfiles);
 	    read_n_bytes(fd, (char *)mfiles, sizeof(*mfiles) * nmfiles, "stobj file");
 	}
@@ -435,9 +435,9 @@ find_stobj_insert_point(int fd, invt_seshdr_t *hdr)
     lseek(fd, 0, SEEK_SET);
     read_n_bytes(fd, (char *)&sescnt, sizeof(sescnt), "stobj file");
 
-    for(i = 0; i < sescnt.ic_curnum; i++) {
+    for (i = 0; i < sescnt.ic_curnum; i++) {
 	read_n_bytes(fd, (char *)&tmphdr, sizeof(tmphdr), "stobj file");
-	if(hdr->sh_time <= tmphdr.sh_time) {
+	if (hdr->sh_time <= tmphdr.sh_time) {
 	    break;
 	}
     }
@@ -477,10 +477,10 @@ update_invidx_entry(int fd, char *filename, int stobj_fd)
     lseek(fd, 0, SEEK_SET);
     read_n_bytes(fd, &cnt, sizeof(cnt), "invidx file");
 
-    for(i = 0; i < cnt.ic_curnum; i++) {
+    for (i = 0; i < cnt.ic_curnum; i++) {
     	lseek(fd, IDX_HDR_OFFSET(i), SEEK_SET);
 	read_n_bytes(fd, &entry, sizeof(entry), "invidx file");
-	if(strcmp(entry.ie_filename, filename) == 0) {
+	if (strcmp(entry.ie_filename, filename) == 0) {
 	    entry.ie_timeperiod.tp_start = start_time;
 	    entry.ie_timeperiod.tp_end = end_time;
 	    lseek(fd, IDX_HDR_OFFSET(i), SEEK_SET);
@@ -513,7 +513,7 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
     char *buf;
     int invidx_fd = invidx_file[invidx_fileidx].fd;
 
-    if(hdr == NULL || ses == NULL || strms == NULL || mfiles == NULL)
+    if (hdr == NULL || ses == NULL || strms == NULL || mfiles == NULL)
 	return 0;
 
     lseek(fd, 0, SEEK_SET);
@@ -522,7 +522,7 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
     pos = find_stobj_insert_point(fd, hdr);
 
     /* if stobj file is full, we need to split it */
-    if(sescnt.ic_curnum >= sescnt.ic_maxnum) {
+    if (sescnt.ic_curnum >= sescnt.ic_maxnum) {
 	int new_fd;
 	char new_filename[INV_STRLEN];
 	invt_seshdr_t *s_hdr;
@@ -532,7 +532,7 @@ insert_stobj_into_stobjfile(int invidx_fileidx, char *filename, int fd,
 
 	new_fd = create_stobjfile(invidx_fileidx, new_filename, sizeof(new_filename), hdr, ses, strms, mfiles);
 
-	for(i = pos; i < sescnt.ic_curnum; i++) {
+	for (i = pos; i < sescnt.ic_curnum; i++) {
 	    read_stobj_info(fd, i, &s_hdr, &s_ses, &s_strms, &s_mfiles);
 
 	    insert_stobj_into_stobjfile(invidx_fileidx, new_filename, new_fd, s_hdr, s_ses, s_strms, s_mfiles);
@@ -672,12 +672,12 @@ invidx_select(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
 
-    if(d->expanded == TRUE) {
+    if (d->expanded == TRUE) {
 	return menu_collapse(win, current, list);
     }
 
@@ -692,7 +692,7 @@ invidx_highlight(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
     invt_entry_t *invtentry;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -723,7 +723,7 @@ invidx_undelete(WINDOW *win, node_t *current, node_t *list)
     node_t *n;
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
 
@@ -731,7 +731,7 @@ invidx_undelete(WINDOW *win, node_t *current, node_t *list)
 
     d = ((data_t *)(current->data));
     n = current->next;
-    while(n != NULL && n->data != NULL && ((data_t *)(n->data))->level > d->level) {
+    while (n != NULL && n->data != NULL && ((data_t *)(n->data))->level > d->level) {
 	((data_t *)(n->data))->deleted = BOOL_FALSE;
 	((data_t *)(n->data))->text[0] = ' ';
 	n = n->next;
@@ -749,17 +749,17 @@ invidx_prune(char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, nod
     data_t *d;
     invt_entry_t *invidx_entry;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return BOOL_FALSE;
     }
     d = ((data_t *)(node->data));
 
     invidx_entry = invidx_file[d->file_idx].data[d->data_idx];
-    if(invidx_entry == NULL) {
+    if (invidx_entry == NULL) {
 	return BOOL_FALSE;
     }
 
-    if(invidx_entry->ie_timeperiod.tp_start < prunetime) {
+    if (invidx_entry->ie_timeperiod.tp_start < prunetime) {
 	return BOOL_TRUE;
     }
 
@@ -773,11 +773,11 @@ find_invidx_node(node_t *list, int inv_fileidx)
     data_t *d;
 
     n = list;
-    while(n != NULL && n->data != NULL) {
+    while (n != NULL && n->data != NULL) {
     	d = n->data;
 	/* is this an invidx entry we're looking at? */
-	if(d->ops == &invidx_ops) {
-	    if(d->file_idx == inv_fileidx) {
+	if (d->ops == &invidx_ops) {
+	    if (d->file_idx == inv_fileidx) {
 	    	return n;
 	    }
 	}
@@ -792,7 +792,7 @@ get_inventry_stobjfile(data_t *d)
 {
     data_t *child_data;
 
-    if(d->nbr_children <= 0) {
+    if (d->nbr_children <= 0) {
 	return NULL;
     }
 
@@ -810,9 +810,9 @@ find_overlapping_invidx(int fidx, invt_entry_t *inv_entry)
     int i = 0;
     invt_entry_t *entry;
 
-    for(i = 0; i < invidx_file[fidx].numrecords; i++) {
+    for (i = 0; i < invidx_file[fidx].numrecords; i++) {
 	entry = invidx_file[fidx].data[i];
-	if(entry->ie_timeperiod.tp_end < inv_entry->ie_timeperiod.tp_start
+	if (entry->ie_timeperiod.tp_end < inv_entry->ie_timeperiod.tp_start
 	   || entry->ie_timeperiod.tp_start > inv_entry->ie_timeperiod.tp_end) {
 	    continue;
 	}
@@ -829,11 +829,11 @@ find_invidx_insert_pos(int fidx, invt_entry_t *inv_entry)
     invt_entry_t *entry;
     invt_entry_t *next_entry;
 
-    for(i = 0; i < invidx_file[fidx].numrecords - 1; i++) {
+    for (i = 0; i < invidx_file[fidx].numrecords - 1; i++) {
 	entry = invidx_file[fidx].data[i];
 	next_entry = invidx_file[fidx].data[i+1];
 
-	if(inv_entry->ie_timeperiod.tp_start > entry->ie_timeperiod.tp_end
+	if (inv_entry->ie_timeperiod.tp_start > entry->ie_timeperiod.tp_end
 	   && inv_entry->ie_timeperiod.tp_end < next_entry->ie_timeperiod.tp_start) {
 	    return i;
 	}
@@ -847,10 +847,10 @@ find_matching_stobjfile(char *filename)
 {
     int i = 0;
 
-    for(i = 0; i < stobj_numfiles; i++) {
-	if(stobj_file[i].name == NULL)
+    for (i = 0; i < stobj_numfiles; i++) {
+	if (stobj_file[i].name == NULL)
 	    continue;
-	if(strcmp(stobj_file[i].name, filename) == 0) {
+	if (strcmp(stobj_file[i].name, filename) == 0) {
 	    return i;
 	}
     }
@@ -863,10 +863,10 @@ find_matching_invidxfile(char *filename)
 {
     int i = 0;
 
-    for(i = 0; i < invidx_numfiles; i++) {
-	if(invidx_file[i].name == NULL)
+    for (i = 0; i < invidx_numfiles; i++) {
+	if (invidx_file[i].name == NULL)
 	    continue;
-	if(strcmp(invidx_file[i].name, filename) == 0) {
+	if (strcmp(invidx_file[i].name, filename) == 0) {
 	    return i;
 	}
     }
@@ -877,9 +877,9 @@ find_matching_invidxfile(char *filename)
 int
 add_invidx_data(int fidx, invt_entry_t *data)
 {
-    if(invidx_file[fidx].numrecords == 0) {
+    if (invidx_file[fidx].numrecords == 0) {
 	invidx_file[fidx].data = malloc(sizeof(*invidx_file[fidx].data));
-	if(invidx_file[fidx].data == NULL) {
+	if (invidx_file[fidx].data == NULL) {
 	    fprintf(stderr, "%s: internal memory error: invidx data allocation\n",
 		    g_programName);
 	    exit(1);
@@ -889,7 +889,7 @@ add_invidx_data(int fidx, invt_entry_t *data)
 	invidx_file[fidx].data = realloc(invidx_file[fidx].data,
 					 sizeof(*invidx_file[fidx].data)
 					 * (invidx_file[fidx].numrecords + 1));
-	if(invidx_file[fidx].data == NULL) {
+	if (invidx_file[fidx].data == NULL) {
 	    fprintf(stderr, "%s: internal memory error: invidx data reallocation\n",
 		    g_programName);
 	    exit(1);
@@ -912,7 +912,7 @@ generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFil
     invt_entry_t	*invidx_entry;
     char		*stobjname;
 
-    if((idx = open_invidx(idxFileName)) < 0) {
+    if ((idx = open_invidx(idxFileName)) < 0) {
 	return startnode;
     }
 
@@ -922,7 +922,7 @@ generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFil
     for (i=0; i < invidx_file[idx].counter->ic_curnum; i++) {
 	len = strlen(invidx_entry[i].ie_filename) + 54;
 	txt = malloc(len);
-	if(txt == NULL) {
+	if (txt == NULL) {
 	    fprintf(stderr, "%s: internal memory error: invidx_text\n", g_programName);
 	    exit(1);
 	}
@@ -939,7 +939,7 @@ generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFil
 				    NULL,	/* children */
 				    0,		/* nbr_children */
 				    i));	/* data_idx */
-	if(n == NULL) {
+	if (n == NULL) {
 	    fprintf(stderr, "%s: internal memory error: list_add: node_create: invidx\n",
 		    g_programName);
 	    exit(1);
@@ -959,19 +959,19 @@ add_invidx(char *name, int fd, int nEntries, char *mapaddr, invt_counter_t *coun
 {
     static int highwatermark = 10;
 
-    if(invidx_numfiles == 0) {
+    if (invidx_numfiles == 0) {
 	invidx_file = malloc(sizeof(*invidx_file) * highwatermark);
-	if(invidx_file == NULL) {
+	if (invidx_file == NULL) {
 	    fprintf(stderr, "%s: internal memory error: malloc invidx_file\n", g_programName);
 	    exit(1);
 	}
     }
     else {
-	if(invidx_numfiles >= highwatermark - 1) {
+	if (invidx_numfiles >= highwatermark - 1) {
 	    highwatermark += highwatermark;
 
 	    invidx_file = realloc(invidx_file, sizeof(*invidx_file) * highwatermark);
-	    if(invidx_file == NULL) {
+	    if (invidx_file == NULL) {
 		fprintf(stderr, "%s: internal memory error: realloc invidx\n", g_programName);
 		exit(1);
 	    }
@@ -1020,8 +1020,8 @@ remmap_invidx(int fidx, int num)
 
     /* regenerate the data index for the file given the new mapping */
     inv_entry = (invt_entry_t *)(invidx_file[fidx].mapaddr + sizeof(invt_counter_t));
-    for(i=0; i < nEntries; i++) {
-    	if(i >= invidx_file[fidx].numrecords) {
+    for (i=0; i < nEntries; i++) {
+    	if (i >= invidx_file[fidx].numrecords) {
 	    add_invidx_data(fidx, &(inv_entry[i]));
 	}
 	else {
@@ -1048,7 +1048,7 @@ open_invidx(char *idxFileName)
     }
 
     name = strdup(idxFileName);
-    if(name == NULL) {
+    if (name == NULL) {
 	fprintf(stderr, "%s: internal memory error:  strdup idxFileName\n", g_programName);
 	exit(1);
     }
@@ -1071,21 +1071,21 @@ close_invidx(int idx)
 {
     int nEntries;
 
-    if(idx >= invidx_numfiles || invidx_file[idx].fd < 0)
+    if (idx >= invidx_numfiles || invidx_file[idx].fd < 0)
 	return 0;
 
     nEntries = invidx_file[idx].counter->ic_curnum;
     munmap(invidx_file[idx].mapaddr,
 	    (invidx_file[idx].nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
-    if(nEntries != 0 && nEntries != invidx_file[idx].nEntries) {
+    if (nEntries != 0 && nEntries != invidx_file[idx].nEntries) {
 	ftruncate(invidx_file[idx].fd,
 		  sizeof(invt_counter_t) + (nEntries * sizeof(invt_entry_t)));
     }
 
     close(invidx_file[idx].fd);
 
-    if(nEntries == 0) {
+    if (nEntries == 0) {
 	unlink(invidx_file[idx].name);
     }
     free(invidx_file[idx].name);
@@ -1103,8 +1103,8 @@ close_all_invidx()
 {
     int i;
 
-    for(i = 0; i < invidx_numfiles; i++) {
-	if(invidx_file[i].fd < 0)
+    for (i = 0; i < invidx_numfiles; i++) {
+	if (invidx_file[i].fd < 0)
 	    continue;
 	close_invidx(i);
     }
diff --git a/invutil/invutil.c b/invutil/invutil.c
index a744d58..26fb630 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -78,8 +78,8 @@ main(int argc, char *argv[])
     uuid_clear(uuid);
     uuid_clear(session);
 
-    while((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
-	switch(c) {
+    while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+	switch (c) {
 	case GETOPT_DEBUG:
 	    debug = BOOL_TRUE;
 	    break;
@@ -297,7 +297,7 @@ get_mntpnt(char *txt)
     char *p;
 
     p = strchr(txt, ':');
-    if(p == NULL)
+    if (p == NULL)
         return txt;
 
     return p+1;
@@ -306,7 +306,7 @@ get_mntpnt(char *txt)
 int
 mntpnt_equal(char *s1, char *s2)
 {
-    if(strchr(s1, ':') == NULL || strchr(s2, ':') == NULL) {
+    if (strchr(s1, ':') == NULL || strchr(s2, ':') == NULL) {
         s1 = get_mntpnt(s1);
         s2 = get_mntpnt(s2);
     }
@@ -520,16 +520,16 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 #endif
 
 	    if (checkonly == BOOL_FALSE) {
-		if(mountPt != NULL && strcmp(mountPt, fstabentry[i].ft_mountpt) == 0) {
+		if (mountPt != NULL && strcmp(mountPt, fstabentry[i].ft_mountpt) == 0) {
 		    printf("     Match on hostname and path\n");
 		    IdxCheckOnly = BOOL_FALSE;
 		}
-		else if((!uuid_is_null(*uuidp))
+		else if ((!uuid_is_null(*uuidp))
 		   && (uuid_compare(*uuidp, fstabentry[i].ft_uuid) == 0)) {
 		    printf("     Match on UUID only\n");
 		    IdxCheckOnly = BOOL_FALSE;
 		}
-		else if(mountPt != NULL && mntpnt_equal(mountPt, fstabentry[i].ft_mountpt)) {
+		else if (mountPt != NULL && mntpnt_equal(mountPt, fstabentry[i].ft_mountpt)) {
 		    printf("     Match on directory name only: %s\n", mountPt);
 		    IdxCheckOnly = BOOL_FALSE;
 		}
@@ -570,7 +570,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	    (nEntries*sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
 
     if ((fstabEntries != 0)  && (fstabEntries != nEntries)) {
-	if(debug) {
+	if (debug) {
 	    printf("ftruncate fstab from %d to %d (%ld bytes)\n",
 		   nEntries,
 		   fstabEntries,
@@ -585,7 +585,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 
     if (fstabEntries == 0)
     {
-	if(debug) {
+	if (debug) {
 	    printf("unlink fstab file %s\n", fstabname);
 	}
 	unlink(fstabname);
@@ -676,7 +676,7 @@ CheckAndPruneInvIndexFile(bool_t checkonly,
     munmap(temp, (nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
     if ((validEntries != 0)  && (validEntries != nEntries)) {
-	if(debug) {
+	if (debug) {
 	    printf("ftruncate idx from %d to %d (%ld bytes)\n",
 		   nEntries,
 		   validEntries,
@@ -697,7 +697,7 @@ CheckAndPruneInvIndexFile(bool_t checkonly,
 
     if (validEntries == 0)
     {
-	if(debug) {
+	if (debug) {
 	    printf("unlink idx file %s\n", idxFileName);
 	}
 	unlink(idxFileName);
@@ -844,7 +844,7 @@ CheckAndPruneStObjFile(bool_t checkonly,
 
 	    uuid_unparse(StObjses->s_sesid, str);
 
-	    if(force) {
+	    if (force) {
 		printf("-------------------------------------------------\n");
 		printf("Pruning this matching entry:\n");
 		printf("UUID\t\t:\t%s\nMOUNT POINT\t:\t%s\n"
@@ -994,7 +994,7 @@ inv_DEBUG_lock_str(int c)
     };
 
     for (i = 0; lockinfo[i].str; i++) {
-	if(lockinfo[i].cmd == c) {
+	if (lockinfo[i].cmd == c) {
 	    return lockinfo[i].str;
 	}
     }
@@ -1088,7 +1088,7 @@ open_and_lock(char * path, Open_t open_type, uint lock_wait_flag)
     if (debug) {
 	char    *lstr;
 
-	switch(lock_mode) {
+	switch (lock_mode) {
 	case LOCK_EX: lstr = inv_DEBUG_lock_str(lock_mode); break;
 	default:       lstr = "NO_LOCK";
 	}
diff --git a/invutil/list.c b/invutil/list.c
index 46fb291..f8e1b07 100644
--- a/invutil/list.c
+++ b/invutil/list.c
@@ -28,7 +28,7 @@ parent_add_child(node_t *parent, node_t *child)
 {
     data_t *d;
 
-    if(parent == NULL || child == NULL)
+    if (parent == NULL || child == NULL)
 	return parent;
 
     d = parent->data;
@@ -48,11 +48,11 @@ node_create(int hidden, int expanded, int level, int deleted, int file_idx, char
     data_t *newdata;
 
     newnode = malloc(sizeof(*newnode));
-    if(newnode == NULL)
+    if (newnode == NULL)
 	return NULL;
 
     newdata = malloc(sizeof(*newdata));
-    if(newdata == NULL)
+    if (newdata == NULL)
 	return NULL;
 
     newdata->hidden = hidden;
@@ -69,7 +69,7 @@ node_create(int hidden, int expanded, int level, int deleted, int file_idx, char
     newdata->commited = BOOL_FALSE;
     newdata->imported = BOOL_FALSE;
 
-    if(deleted == BOOL_TRUE) {
+    if (deleted == BOOL_TRUE) {
 	newdata->text[0] = 'D';
     }
 
@@ -83,9 +83,9 @@ node_create(int hidden, int expanded, int level, int deleted, int file_idx, char
 void
 node_free(node_t *node)
 {
-    if(node != NULL) {
-	if(node->data != NULL) {
-	    if(((data_t *)(node->data))->text != NULL) {
+    if (node != NULL) {
+	if (node->data != NULL) {
+	    if (((data_t *)(node->data))->text != NULL) {
 	        free(((data_t *)(node->data))->text);
 	        free(((data_t *)(node->data))->children);
 	    }
@@ -98,15 +98,15 @@ node_free(node_t *node)
 node_t *
 list_add(node_t *prevnode, node_t *newnode)
 {
-    if(newnode == NULL)
+    if (newnode == NULL)
 	return NULL;
 
-    if(prevnode != NULL) {
+    if (prevnode != NULL) {
 	newnode->next = prevnode->next;
 	prevnode->next = newnode;
 
 	newnode->prev = prevnode;
-	if(newnode->next != NULL) {
+	if (newnode->next != NULL) {
 	    newnode->next->prev = newnode;
 	}
     }
@@ -115,7 +115,7 @@ list_add(node_t *prevnode, node_t *newnode)
 	newnode->prev = NULL;
     }
 
-    if(((data_t *)(newnode->data))->parent != NULL) {
+    if (((data_t *)(newnode->data))->parent != NULL) {
 	parent_add_child(((data_t *)(newnode->data))->parent, newnode);
     }
 
@@ -125,10 +125,10 @@ list_add(node_t *prevnode, node_t *newnode)
 node_t *
 list_del(node_t *node)
 {
-    if(node->prev != NULL) {
+    if (node->prev != NULL) {
 	node->prev->next = node->next;
     }
-    if(node->next != NULL) {
+    if (node->next != NULL) {
 	node->next->prev = node->prev;
     }
     node->next = NULL;
@@ -143,12 +143,12 @@ free_all_children(node_t *node)
     int i;
     data_t *d;
 
-    if(node == NULL || node->data == NULL)
+    if (node == NULL || node->data == NULL)
 	return NULL;
 
     d = (data_t *)(node->data);
 
-    for(i = 0; i < d->nbr_children; i++) {
+    for (i = 0; i < d->nbr_children; i++) {
 	node_free(list_del(free_all_children(d->children[i])));
     }
     d->children = NULL;
@@ -164,12 +164,12 @@ mark_all_children_commited(node_t *node)
     int i;
     data_t *d;
 
-    if(node == NULL || node->data == NULL)
+    if (node == NULL || node->data == NULL)
 	return NULL;
 
     d = (data_t *)(node->data);
 
-    for(i = 0; i < d->nbr_children; i++) {
+    for (i = 0; i < d->nbr_children; i++) {
 	mark_all_children_commited(d->children[i]);
     }
     d->commited = BOOL_TRUE;
diff --git a/invutil/menu.c b/invutil/menu.c
index 81baa42..c167bf1 100644
--- a/invutil/menu.c
+++ b/invutil/menu.c
@@ -36,13 +36,13 @@ put_all_options(WINDOW *win, node_t *list, node_t *current)
 
     i = 0;
     node = list;
-    while(node != NULL) {
+    while (node != NULL) {
 	d = ((data_t *)(node->data));
-	if(d->hidden == BOOL_TRUE) {
+	if (d->hidden == BOOL_TRUE) {
 	    node = node->next;
 	    continue;
 	}
-	if(node == current) {
+	if (node == current) {
 	    attr = A_REVERSE;
         }
         else {
@@ -65,7 +65,7 @@ put_helpscreen(int keyc, menukey_t *keyv)
     WINDOW *helpscreen;
 
     winline = LINES - (keyc + 5);
-    if(winline < 0)
+    if (winline < 0)
 	winline = 0;
 
     helpscreen = newwin(keyc + 4, 29, winline, COLS - 30);
@@ -78,8 +78,8 @@ put_helpscreen(int keyc, menukey_t *keyv)
     wmove(helpscreen, 2, 0);
     waddstr(helpscreen, "|                           |");
     l = 3;
-    for(k = 0; k < keyc + 1; k++) {
-	if(keyv[k].text == NULL)
+    for (k = 0; k < keyc + 1; k++) {
+	if (keyv[k].text == NULL)
 	    continue;
 	wmove(helpscreen, l, 0);
 	waddstr(helpscreen, keyv[k].text);
@@ -117,17 +117,17 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
     redraw_screen = BOOL_TRUE;
 
     quit = BOOL_FALSE;
-    while(quit != BOOL_TRUE) {
-	if(current == NULL && current->data == NULL) {
+    while (quit != BOOL_TRUE) {
+	if (current == NULL && current->data == NULL) {
 	    current = list;
 	}
 	d = (data_t *)(current->data);
 
-	if(redraw_screen == BOOL_TRUE) {
+	if (redraw_screen == BOOL_TRUE) {
 	    wclear(win);
 	    snprintf(txt, sizeof(txt), "%s: %s", g_programName, g_programVersion);
 	    put_header(txt, ALIGN_LEFT);
-	    if(d->hidden == BOOL_TRUE) {
+	    if (d->hidden == BOOL_TRUE) {
 		current = list;
 		current_line = 0;
 		d = (data_t *)(current->data);
@@ -135,7 +135,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 	    put_all_options(win, list, current);
 	    redraw_screen = BOOL_FALSE;
 
-	    if(d->ops != NULL && d->ops->op_highlight != NULL) {
+	    if (d->ops != NULL && d->ops->op_highlight != NULL) {
 		quit = d->ops->op_highlight(win, current, list);
 	    }
 	}
@@ -145,11 +145,11 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 
 	    redraw_options = BOOL_FALSE;
 
-	    if(((data_t *)(last->data))->ops != NULL
+	    if (((data_t *)(last->data))->ops != NULL
 	       && ((data_t *)(last->data))->ops->op_unhighlight != NULL) {
 		quit = ((data_t *)(last->data))->ops->op_unhighlight(win, current, list);
 	    }
-	    if(d->ops != NULL && d->ops->op_highlight != NULL) {
+	    if (d->ops != NULL && d->ops->op_highlight != NULL) {
 		quit = d->ops->op_highlight(win, current, list);
 	    }
 	}
@@ -165,11 +165,11 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		 line, col,
 		 size, COLS - 1);
 
-	if(quit == BOOL_TRUE)
+	if (quit == BOOL_TRUE)
 	    continue;
 
 	c=wgetch(win);
-	switch(c) {
+	switch (c) {
         case '?':
 	case KEY_F(1):
 	    /* online help */
@@ -183,18 +183,18 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		data_t *d;
 		node_t *n = current->prev;
 
-		while(n != NULL) {
+		while (n != NULL) {
 		    d = ((data_t *)(n->data));
-		    if(d == NULL) {
+		    if (d == NULL) {
 			n = n->prev;
 			continue;
 		    }
-		    if(d->hidden == BOOL_FALSE) {
+		    if (d->hidden == BOOL_FALSE) {
 			break;
 		    }
 		    n = n->prev;
 		}
-		if(n != NULL) {
+		if (n != NULL) {
 		    current = n;
 		    current_line--;
 		}
@@ -207,18 +207,18 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		data_t *d;
 		node_t *n = current->next;
 
-		while(n != NULL) {
+		while (n != NULL) {
 		    d = ((data_t *)(n->data));
-		    if(d == NULL) {
+		    if (d == NULL) {
 			n = n->next;
 			continue;
 		    }
-		    if(d->hidden == BOOL_FALSE) {
+		    if (d->hidden == BOOL_FALSE) {
 			break;
 		    }
 		    n = n->next;
 		}
-		if(n != NULL) {
+		if (n != NULL) {
 		    current = n;
 		    current_line++;
 		}
@@ -231,12 +231,12 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		node_t *n = current->next;
 		int l;
 
-		if(current != NULL && ((data_t *)(current->data)) == NULL) {
+		if (current != NULL && ((data_t *)(current->data)) == NULL) {
 		    break;
 		}
 		l = ((data_t *)(current->data))->level;
-		if(n != NULL && ((data_t *)(n->data)) != NULL && ((data_t *)(n->data))->level > l) {
-		    if(((data_t *)(n->data))->hidden == BOOL_TRUE) {
+		if (n != NULL && ((data_t *)(n->data)) != NULL && ((data_t *)(n->data))->level > l) {
+		    if (((data_t *)(n->data))->hidden == BOOL_TRUE) {
 			menu_expand(win, current, list);
 		    }
 		    current = n;
@@ -253,41 +253,41 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		int l = 0;
 		int i;
 
-		if(current != NULL && ((data_t *)(current->data)) != NULL) {
+		if (current != NULL && ((data_t *)(current->data)) != NULL) {
 		    l = ((data_t *)(current->data))->level;
 		}
 		i = current_line - 1;
-		while(n != NULL) {
+		while (n != NULL) {
 		    d = ((data_t *)(n->data));
-		    if(d == NULL) {
+		    if (d == NULL) {
 			n = n->prev;
 			continue;
 		    }
-		    if(d->hidden == BOOL_TRUE) {
+		    if (d->hidden == BOOL_TRUE) {
 			n = n->prev;
 			continue;
 		    }
-		    if(d->level < l) {
+		    if (d->level < l) {
 			break;
 		    }
 		    n = n->prev;
 		    i--;
 		}
-		if(n != NULL) {
+		if (n != NULL) {
 		    current = n;
 		    current_line = i;;
 		}
 	    }
 	    break;
 	case ERR:
-	    if(errno == EINTR) {
+	    if (errno == EINTR) {
 		/* mainmenu window has been recreated - use new one */
 		win = mainmenu;
 	    }
 	    break;
 	default:
-	    for(k = 0; k < keyc; k++) {
-		if(c == keyv[k].key || tolower(c) == keyv[k].key) {
+	    for (k = 0; k < keyc; k++) {
+		if (c == keyv[k].key || tolower(c) == keyv[k].key) {
 		    if (keyv[k].fn != NULL) {
 			quit = keyv[k].fn(win, current, list);
 			break;
diff --git a/invutil/screen.c b/invutil/screen.c
index 5e478c9..923552a 100644
--- a/invutil/screen.c
+++ b/invutil/screen.c
@@ -36,14 +36,14 @@ put_line(WINDOW *win, int line, char *msg, int attr, alignment_t alignment)
 
     cols = getmaxx(win);
     cols--;
-    if(cols > 255) {
+    if (cols > 255) {
 	cols = 255;
     }
     msglen = strlen(msg);
-    if(msglen > cols)
+    if (msglen > cols)
 	msglen = cols;
 
-    switch(alignment) {
+    switch (alignment) {
     case ALIGN_CENTRE:
 	c = (cols - msglen) / 2;
 	break;
diff --git a/invutil/stobj.c b/invutil/stobj.c
index 2912e0c..2931ddc 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -92,7 +92,7 @@ stobjmed_commit(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -106,7 +106,7 @@ stobjstrm_commit(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -120,7 +120,7 @@ stobjmed_delete(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -134,7 +134,7 @@ stobjstrm_delete(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -149,7 +149,7 @@ stobjsess_commit(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
     invt_seshdr_t *stobjhdr;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -157,7 +157,7 @@ stobjsess_commit(WINDOW *win, node_t *current, node_t *list)
 
     mark_all_children_commited(current);
 
-    if(d->deleted == BOOL_TRUE) {
+    if (d->deleted == BOOL_TRUE) {
 	stobjhdr->sh_pruned = 1;
     }
     else {
@@ -177,7 +177,7 @@ stobjsess_highlight(WINDOW *win, node_t *current, node_t *list)
     invt_seshdr_t *stobjhdr;
     invt_session_t *stobjses;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -214,7 +214,7 @@ stobjstrm_highlight(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
     invt_stream_t *stobjstrm;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -251,7 +251,7 @@ stobjmed_highlight(WINDOW *win, node_t *current, node_t *list)
     data_t *d;
     invt_mediafile_t *stobjmed;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
@@ -284,12 +284,12 @@ stobj_select(WINDOW *win, node_t *current, node_t *list)
 {
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return 0;
     }
     d = (data_t *)(current->data);
 
-    if(d->expanded == TRUE) {
+    if (d->expanded == TRUE) {
 	return menu_collapse(win, current, list);
     }
 
@@ -305,7 +305,7 @@ stobj_prune(char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, node
     invt_seshdr_t *stobj_header;
     invt_session_t *stobj_session;
 
-    if(node == NULL || node->data == NULL) {
+    if (node == NULL || node->data == NULL) {
 	return BOOL_FALSE;
     }
     d = (data_t *)(node->data);
@@ -313,17 +313,17 @@ stobj_prune(char *mountpt, uuid_t *uuidp, time32_t prunetime, node_t *node, node
     stobj_header = stobj->header;
     stobj_session = stobj->session;
 
-    if(stobj_header == NULL || stobj_session == NULL) {
+    if (stobj_header == NULL || stobj_session == NULL) {
 	return BOOL_FALSE;
     }
-    if(stobj_header->sh_pruned) {
+    if (stobj_header->sh_pruned) {
 	return BOOL_TRUE;
     }
-    if(stobj_header->sh_time < prunetime) {
-	if(mountpt != NULL && mntpnt_equal(mountpt, stobj_session->s_mountpt)) {
+    if (stobj_header->sh_time < prunetime) {
+	if (mountpt != NULL && mntpnt_equal(mountpt, stobj_session->s_mountpt)) {
 	    return BOOL_TRUE;
 	}
-	if((!uuid_is_null(*uuidp))
+	if ((!uuid_is_null(*uuidp))
 	   && (uuid_compare(*uuidp, stobj_session->s_fsid) == 0)) {
 	    return BOOL_TRUE;
 	}
@@ -339,7 +339,7 @@ stobj_undelete(WINDOW *win, node_t *current, node_t *list)
     node_t *n;
     data_t *d;
 
-    if(current == NULL || current->data == NULL) {
+    if (current == NULL || current->data == NULL) {
 	return BOOL_FALSE;
     }
 
@@ -347,7 +347,7 @@ stobj_undelete(WINDOW *win, node_t *current, node_t *list)
 
     d = ((data_t *)(current->data));
     n = current->next;
-    while(n != NULL && n->data != NULL && ((data_t *)(n->data))->level > d->level) {
+    while (n != NULL && n->data != NULL && ((data_t *)(n->data))->level > d->level) {
 	((data_t *)(n->data))->deleted = BOOL_FALSE;
 	((data_t *)(n->data))->text[0] = ' ';
 	n = n->next;
@@ -361,9 +361,9 @@ stobj_undelete(WINDOW *win, node_t *current, node_t *list)
 int
 add_stobj_data(int fidx, void *data)
 {
-    if(stobj_file[fidx].numrecords == 0) {
+    if (stobj_file[fidx].numrecords == 0) {
 	stobj_file[fidx].data = malloc(sizeof(*stobj_file[fidx].data));
-	if(stobj_file[fidx].data == NULL) {
+	if (stobj_file[fidx].data == NULL) {
 	    fprintf(stderr, "%s: internal memory error: stobj data allocation\n",
 		    g_programName);
 	    exit(1);
@@ -373,7 +373,7 @@ add_stobj_data(int fidx, void *data)
 	stobj_file[fidx].data = realloc(stobj_file[fidx].data,
 					sizeof(*stobj_file[fidx].data)
 					* (stobj_file[fidx].numrecords + 1));
-	if(stobj_file[fidx].data == NULL) {
+	if (stobj_file[fidx].data == NULL) {
 	    fprintf(stderr, "%s: internal memory error: stobj data reallocation\n",
 		    g_programName);
 	    exit(1);
@@ -405,7 +405,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
     invt_stream_t	*StObjstrm;
     invt_mediafile_t	*StObjmed;
 
-    if((idx = open_stobj(StObjFileName)) < 0) {
+    if ((idx = open_stobj(StObjFileName)) < 0) {
 	return startnode;
     }
 
@@ -416,7 +416,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
     n = startnode;
     for (i=0; i < stobj_file[idx].counter->ic_curnum;) {
 	session = malloc(sizeof(*session));
-	if(session == NULL) {
+	if (session == NULL) {
 	    fprintf(stderr, "%s: internal memory error: session malloc\n", g_programName);
 	    exit(1);
 	}
@@ -425,7 +425,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 	len = 60+strlen(session->session->s_label);
 	txt = malloc(len);
-	if(txt == NULL) {
+	if (txt == NULL) {
 	    fprintf(stderr, "%s: internal memory error: invidx_text\n", g_programName);
 	    exit(1);
 	}
@@ -444,7 +444,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 				    NULL,	/* children */
 				    0,		/* nbr_children */
 				    data_idx));
-	if(n == NULL) {
+	if (n == NULL) {
 	    fprintf(stderr, "%s: internal memory error: list_add: node_create: session\n", g_programName);
 	    exit(1);
 	}
@@ -460,7 +460,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 	    len = strlen(StObjstrm->st_cmdarg) + 33;
 	    txt = malloc(len);
-	    if(txt == NULL) {
+	    if (txt == NULL) {
 		fprintf(stderr, "%s: internal memory error: invidx_text\n", g_programName);
 		exit(1);
 	    }
@@ -477,7 +477,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 					NULL,		/* children */
 					0,		/* nbr_children */
 					data_idx));
-	    if(n == NULL) {
+	    if (n == NULL) {
 		fprintf(stderr, "%s: internal memory error: list_add: node_create: StObjstrm\n", g_programName);
 		exit(1);
 	    }
@@ -493,7 +493,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 		len = strlen(StObjmed->mf_label) + 26;
 		txt = malloc(len);
-		if(txt == NULL) {
+		if (txt == NULL) {
 		    fprintf(stderr, "%s: internal memory error: invidx_text\n", g_programName);
 		    exit(1);
 		}
@@ -510,7 +510,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 					    NULL,	/* children */
 					    0,		/* nbr_children */
 					    data_idx));
-		if(n == NULL) {
+		if (n == NULL) {
 		    fprintf(stderr, "%s: internal memory error: list_add: node_create: StObjmed\n", g_programName);
 		    exit(1);
 		}
@@ -535,19 +535,19 @@ add_stobj(char *name, int fd, off_t size, char *mapaddr, invt_sescounter_t *coun
 {
     static int highwatermark = 20;
 
-    if(stobj_numfiles == 0) {
+    if (stobj_numfiles == 0) {
 	stobj_file     = malloc(sizeof(*stobj_file) * highwatermark);
-	if(stobj_file == NULL) {
+	if (stobj_file == NULL) {
 	    fprintf(stderr, "%s: internal memory error: malloc stobj_file\n", g_programName);
 	    exit(1);
 	}
     }
     else {
-	if(stobj_numfiles >= highwatermark - 1) {
+	if (stobj_numfiles >= highwatermark - 1) {
 	    highwatermark += highwatermark;
 
 	    stobj_file = realloc(stobj_file, sizeof(*stobj_file) * highwatermark);
-	    if(stobj_file == NULL) {
+	    if (stobj_file == NULL) {
 		fprintf(stderr, "%s: internal memory error: realloc stobj_file\n", g_programName);
 		exit(1);
 	    }
@@ -596,7 +596,7 @@ open_stobj(char *StObjFileName)
     mapaddr = mmap_n_bytes(fd, size, BOOL_FALSE, StObjFileName);
 
     name = strdup(StObjFileName);
-    if(name == NULL) {
+    if (name == NULL) {
 	fprintf(stderr, "%s: internal memory error: strdup stobj_name\n", g_programName);
 	exit(1);
     }
@@ -607,14 +607,14 @@ open_stobj(char *StObjFileName)
 int
 close_stobj_file(int fidx, int unlink_ok)
 {
-    if(fidx >= stobj_numfiles || stobj_file[fidx].fd < 0)
+    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);
     stobj_file[fidx].fd = -1;
 
-    if(unlink_ok == BOOL_TRUE) {
+    if (unlink_ok == BOOL_TRUE) {
 	unlink(stobj_file[fidx].name);
     }
 
@@ -635,15 +635,15 @@ close_all_stobj()
     invt_seshdr_t *StObjhdr;
     int unlink_ok;
 
-    for(i = 0; i < stobj_numfiles; i++) {
+    for (i = 0; i < stobj_numfiles; i++) {
 
-	if(stobj_file[i].fd < 0)
+	if (stobj_file[i].fd < 0)
 	    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;) {
-	    if(StObjhdr->sh_pruned != 1) {
+	for (j = 0; j < stobj_file[i].counter->ic_curnum;) {
+	    if (StObjhdr->sh_pruned != 1) {
 		unlink_ok = BOOL_FALSE;
 		break;
 	    }
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 2f46324..ea6e218 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -197,7 +197,7 @@ static int _rmt_open (char *path, int oflag, int mode)
 		    uname[len-1] = '\0'; /* chomp the '\n' */
 	    }
 
-	    for(p = &uname_table[0]; p->name != 0; p++) {
+	    for (p = &uname_table[0]; p->name != 0; p++) {
 		if (strncmp(p->name, uname, strlen(p->name)) == 0)
 		    break;
 	    }
diff --git a/restore/content.c b/restore/content.c
index 5b45906..b616eda 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -1812,7 +1812,7 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		void	*fshanp;
 		size_t	fshlen=0;
 
-		if(path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) {
+		if (path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) {
 			mlog(MLOG_NORMAL,
 				_("unable to construct a file "
 				  "system handle for %s: %s\n"),
@@ -3516,7 +3516,7 @@ applynondirdump(drive_t *drivep,
 					      &rv);
 		}
 
-		switch(rv) {
+		switch (rv) {
 		case RV_OK:
 			break;
 		case RV_EOD:
@@ -3571,7 +3571,7 @@ applynondirdump(drive_t *drivep,
 			/* read the file header.
 			 */
 			rv = read_filehdr(drivep, fhdrp, fhcs);
-			switch(rv) {
+			switch (rv) {
 			case RV_OK:
 				break;
 			case RV_EOD:
@@ -4578,7 +4578,7 @@ validate:
 		       :
 		       BOOL_FALSE;
 		canseeknextpr = dcaps & DRIVE_CAP_NEXTMARK;
-		switch(Mediap->M_pos) {
+		switch (Mediap->M_pos) {
 		case POS_ATHDR:
 		case POS_INDIR:
 			if (resumepr) {
@@ -4741,7 +4741,7 @@ newmedia:
 
 		/* check if we are done.
 		 */
-		switch(purp) {
+		switch (purp) {
 		case PURP_SEARCH:
 			knownholespr = BOOL_TRUE;
 			maybeholespr = BOOL_FALSE;
@@ -5458,7 +5458,7 @@ pi_addfile(Media_t *Mediap,
 						  (rfp_t)dop->do_read,
 					    (rrbfp_t)dop->do_return_read_buf,
 						  &rval);
-				switch(rval) {
+				switch (rval) {
 				case 0:
 					assert(nread == (int)bufszincr);
 					buflen += (size_t)nread;
@@ -5880,7 +5880,7 @@ pi_scanfileendino(dh_t fileh)
 		     ;
 		      nexth = DH2F(nexth)->f_nexth) {
 
-		    switch(mode) {
+		    switch (mode) {
 		    case 0:
 			if (nexth == fileh) {
 				mode = 1;
@@ -7309,7 +7309,7 @@ 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);
 			if (!ok)
@@ -8014,7 +8014,7 @@ restore_symlink(drive_t *drivep,
 			  (rrbfp_t)dop->do_return_read_buf,
 			  &rval);
 	if (rval) {
-		switch(rval) {
+		switch (rval) {
 		case DRIVE_ERROR_EOF:
 		case DRIVE_ERROR_EOD:
 		case DRIVE_ERROR_EOM:
@@ -8120,7 +8120,7 @@ read_filehdr(drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs)
 			  &rval);
 	xlate_filehdr(&tmpfh, fhdrp, 1);
 
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8179,7 +8179,7 @@ read_extenthdr(drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs)
 			  &rval);
 	xlate_extenthdr(&tmpeh, ehdrp, 1);
 
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8247,7 +8247,7 @@ read_dirent(drive_t *drivep,
 			  (rrbfp_t)
 			  dop->do_return_read_buf,
 			  &rval);
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8324,7 +8324,7 @@ read_dirent(drive_t *drivep,
 				  (rrbfp_t)
 				  dop->do_return_read_buf,
 				  &rval);
-		switch(rval) {
+		switch (rval) {
 		case 0:
 			break;
 		case DRIVE_ERROR_EOD:
@@ -8364,7 +8364,7 @@ read_extattrhdr(drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs)
 			  &rval);
 	xlate_extattrhdr(&tmpah, ahdrp, 1);
 
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		break;
 	case DRIVE_ERROR_EOD:
@@ -8433,7 +8433,7 @@ discard_padding(size_t sz, drive_t *drivep)
 			  (rfp_t)dop->do_read,
 			  (rrbfp_t)dop->do_return_read_buf,
 			  &rval);
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		assert((size_t)nread == sz);
 		return RV_OK;
@@ -8519,7 +8519,7 @@ restore_extent(filehdr_t *fhdrp,
 		if (rval) {
 			rv_t rv;
 			char *reasonstr;
-			switch(rval) {
+			switch (rval) {
 			case DRIVE_ERROR_EOF:
 				rv = RV_EOD;
 				reasonstr = _("end of media file");
@@ -8780,7 +8780,7 @@ restore_extattr(drive_t *drivep,
 				  (rfp_t)dop->do_read,
 				  (rrbfp_t)dop->do_return_read_buf,
 				  &rval);
-		switch(rval) {
+		switch (rval) {
 		case 0:
 			break;
 		case DRIVE_ERROR_EOD:
diff --git a/restore/inomap.c b/restore/inomap.c
index 22142cd..44083ca 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -111,7 +111,7 @@ SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 	relino = ino - segp->base;
 	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
-	switch(state) {
+	switch (state) {
 	case 0:
 		segp->lobits &= clrmask;
 		segp->mebits &= clrmask;
@@ -261,7 +261,7 @@ inomap_restore_pers(drive_t *drivep,
 			  &rval);
 
 	pershnkp = (hnk_t *)((char *)persp + PERSSZ);
-	for(i = 0; i < hnkcnt; i++) {
+	for (i = 0; i < hnkcnt; i++) {
 		xlate_hnk(&tmphnkp[i], &pershnkp[i], 1);
 	}
 	free(tmphnkp);
@@ -282,7 +282,7 @@ inomap_restore_pers(drive_t *drivep,
 
 	/* check the return code from read
 	 */
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		assert((size_t)nread == sizeof(hnk_t) * (size_t)hnkcnt);
 		ok = inomap_sync_pers(hkdir);
@@ -329,7 +329,7 @@ inomap_discard(drive_t *drivep, content_inode_hdr_t *scrhdrp)
 			  &rval);
 	/* check the return code from read
 	 */
-	switch(rval) {
+	switch (rval) {
 	case 0:
 		assert((size_t)nread == sizeof(hnk_t) * (size_t)hnkcnt);
 		return RV_OK;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 13/24] xfsdump: (2/4)(style) add first empty line for multiline comments
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (8 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 11/24] xfsdump: (style) add a space after if, switch, for, do, while Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 14/24] xfsdump: (3/4)(style) " Jan Tulak
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Change the multiline comment style from /* foo to /*
 * foo

Created by this script:

#!/usr/bin/env bash
# change the multiline comment style from /* foo to /*
 * foo

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/^\(\s*\)\/\* \(.\+[^*][^/]\)$/\1\/*
\1 * \2/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 dump/content.c | 885 ++++++++++++++++++++++++++++++++-----------------
 dump/getopt.h  |   3 +-
 dump/inomap.c  | 168 ++++++----
 dump/inomap.h  |  27 +-
 dump/var.c     |   9 +-
 5 files changed, 728 insertions(+), 364 deletions(-)

diff --git a/dump/content.c b/dump/content.c
index f351e78..fe52a70 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -71,16 +71,19 @@
 #include "getdents.h"
 #include "arch_xlate.h"
 
-/* max "unsigned long long int"
+/*
+ * max "unsigned long long int"
  */
 #define ULONGLONG_MAX	18446744073709551615LLU
 
-/* legal range of dump levels
+/*
+ * legal range of dump levels
  */
 #define LEVEL_DEFAULT	0
 #define LEVEL_MAX	9
 
-/* ordinary files as big or bigger than this many pages will be
+/*
+ * ordinary files as big or bigger than this many pages will be
  * preceeded in the dump by enough padding to align the first byte
  * of that file's data to a page boundary
  */
@@ -89,15 +92,18 @@
 
 /* structure definitions used locally ****************************************/
 
-/* number of bstats bstat_iter fetches at a time
+/*
+ * number of bstats bstat_iter fetches at a time
  */
 #define BSTATBUFLEN	4096
 
-/* if the source file system type can't be determined, assume it is this
+/*
+ * if the source file system type can't be determined, assume it is this
  */
 #define FS_DEFAULT	"xfs"
 
-/* marks consist of a opaque drive layer cookie and a startpoint.
+/*
+ * marks consist of a opaque drive layer cookie and a startpoint.
  * the drive layer requires that it be passed a pointer to a drive_markrec_t.
  * we tack on content-specific baggage (startpt_t). this works because we
  * allocate and free mark_t's here.
@@ -109,7 +115,8 @@ struct mark {
 
 typedef struct mark mark_t;
 
-/* Media_mfile_begin() entry state.
+/*
+ * Media_mfile_begin() entry state.
  */
 enum bes { BES_INIT,	/* in the beginning */
 	   BES_ENDOK,   /* last media file successfully flushed to media */
@@ -118,81 +125,100 @@ enum bes { BES_INIT,	/* in the beginning */
 
 typedef enum bes bes_t;
 
-/* per-stream context
+/*
+ * per-stream context
  */
 struct context {
 	filehdr_t *cc_filehdrp;
-			/* pre-allocated buffer: heads each dumped file
+			/*
+			 * pre-allocated buffer: heads each dumped file
 			 */
 	extenthdr_t *cc_extenthdrp;
-			/* pre-allocated buffer: heads each dumped file extent
+			/*
+			 * pre-allocated buffer: heads each dumped file extent
 			 */
 	void *cc_inomap_contextp;
-			/* pre-allocated context to speed inomap iteration
+			/*
+			 * pre-allocated context to speed inomap iteration
 			 */
 	char *cc_getdentsbufp;
 	size_t cc_getdentsbufsz;
-			/* pre-allocated buffer for getdents() syscall
+			/*
+			 * pre-allocated buffer for getdents() syscall
 			 */
 	char *cc_mdirentbufp;
 	size_t cc_mdirentbufsz;
-			/* pre-allocated buffer for on-media dirent
+			/*
+			 * pre-allocated buffer for on-media dirent
 			 */
 	char *cc_extattrlistbufp;
 	size_t cc_extattrlistbufsz;
-			/* pre-allocated buffer for retrieving a
+			/*
+			 * pre-allocated buffer for retrieving a
 			 * list of extended file attributes
 			 */
 	attr_multiop_t *cc_extattrrtrvarrayp;
 	size_t cc_extattrrtrvarraylen;
-			/* pre-allocated array of ops for retrieving the
+			/*
+			 * pre-allocated array of ops for retrieving the
 			 * values for a list of extended file attributes
 			 */
 	char *cc_extattrdumpbufp;
 	size_t cc_extattrdumpbufsz;
-			/* pre-allocated buffer for dumping the names and
+			/*
+			 * pre-allocated buffer for dumping the names and
 			 * values for a list of extended file attributes
 			 */
 	hsm_f_ctxt_t *cc_hsm_f_ctxtp;
-			/* pre-allocated HSM context used for holding HSM
+			/*
+			 * pre-allocated HSM context used for holding HSM
 			   state information about a file across subroutine
 			   calls.
 			*/
 	char *cc_readlinkbufp;
 	size_t cc_readlinkbufsz;
-			/* pre-allocated buffer for readlink()
+			/*
+			 * pre-allocated buffer for readlink()
 			 */
 	off64_t cc_mfilesz;
-			/* total bytes dumped to media file
+			/*
+			 * total bytes dumped to media file
 			 */
 	size_t cc_markscommitted;
-			/* number of marks committed in mfile. only useful
+			/*
+			 * number of marks committed in mfile. only useful
 			 * info is if greater than zero.
 			 */
 	xfs_ino_t cc_stat_lastino;
-			/* monotonic strm nondir ino dumped
+			/*
+			 * monotonic strm nondir ino dumped
 			 */
 	bool_t cc_completepr;
-			/* set if stream completely dumped. useful for
+			/*
+			 * set if stream completely dumped. useful for
 			 * determining if dump was interrupted
 			 */
 	bool_t cc_Media_useterminatorpr;
-			/* true if stream terminators are expected and
+			/*
+			 * true if stream terminators are expected and
 			 * will be used
 			 */
 	char *cc_Media_firstlabel;
-			/* optional command line media label. only used
+			/*
+			 * optional command line media label. only used
 			 * for first media object in stream, and only if
 			 * media object does not already have a label
 			 */
 	bes_t cc_Media_begin_entrystate;
-			/* Media_mfile_begin context entry state
+			/*
+			 * Media_mfile_begin context entry state
 			 */
 };
 
 typedef struct context context_t;
 
-/* extent group context, used by dump_file()
+/*
+ * extent group context, used by dump_file()
  */
 #define BMAP_LEN	512
 
@@ -208,29 +234,34 @@ struct extent_group_context {
 typedef struct extent_group_context extent_group_context_t;
 
 
-/* minimum getdents() buffer size
+/*
+ * minimum getdents() buffer size
  */
 #define GETDENTSBUF_SZ_MIN	(2 * pgsz)
 
 
-/* minimum sizes for extended attributes buffers
+/*
+ * minimum sizes for extended attributes buffers
  */
 #define EXTATTR_LISTBUF_SZ	(XATTR_LIST_MAX)
 #define EXTATTR_RTRVARRAY_LEN	(1 * pgsz)
 #define EXTATTR_DUMPBUF_SZ	(4 * pgsz)
 
-/* for printing ext attr namespace
+/*
+ * for printing ext attr namespace
  */
 #define EXTATTR_NAMESPACE(flag)	(((flag) & ATTR_ROOT) ? _("root") : \
 				(((flag) & ATTR_SECURE) ? _("secure") : \
 				  _("non-root")) )
 
-/* for printing file type
+/*
+ * for printing file type
  */
 #define FILETYPE(statp)		(((statp)->bs_mode & S_IFMT) == S_IFDIR \
 				  ? _("dir") : _("nondir"))
 
-/* per-drive status descriptor
+/*
+ * per-drive status descriptor
  */
 struct pds {
 	enum { PDS_NULL,		/* per-drive activity not begun */
@@ -259,7 +290,8 @@ extern size_t pgsz;
 
 /* forward declarations of locally defined static functions ******************/
 
-/* file dumpers
+/*
+ * file dumpers
  */
 static rv_t
 dump_dirs(ix_t strmix,
@@ -413,28 +445,35 @@ bool_t allowexcludefiles_pr = BOOL_FALSE;
 /* definition of locally defined static variables *****************************/
 
 static bool_t sc_preerasepr = BOOL_FALSE;
-	/* pre-erase media
+	/*
+	 * pre-erase media
 	 */
 static inv_idbtoken_t sc_inv_idbtoken = INV_TOKEN_NULL;
-	/* handle to inventory
+	/*
+	 * handle to inventory
 	 */
 static inv_sestoken_t sc_inv_sestoken = INV_TOKEN_NULL;
-	/* handle to inventory session
+	/*
+	 * handle to inventory session
 	 */
 static inv_stmtoken_t *sc_inv_stmtokenp = 0;
-	/* array of inventory session stream handles
+	/*
+	 * array of inventory session stream handles
 	 */
 static bool_t sc_inv_updatepr = BOOL_TRUE;
-	/* set if ok to update online inventory with stats of this dump
+	/*
+	 * set if ok to update online inventory with stats of this dump
 	 */
 static ix_t sc_level = LEVEL_DEFAULT;
-	/* dump level requested
+	/*
+	 * dump level requested
 	 */
 static bool_t sc_incrpr = BOOL_FALSE;
 static time32_t sc_incrbasetime;
 static ix_t sc_incrbaselevel;
 static uuid_t sc_incrbaseid;
-	/* if an incremental dump, the base, level and time of the incremental
+	/*
+	 * if an incremental dump, the base, level and time of the incremental
 	 * base dump. TRICKY: if resuming an incremental dump, this is the
 	 * base of the original incremental.
 	 */
@@ -443,75 +482,95 @@ static time32_t sc_resumebasetime = 0;
 static uuid_t sc_resumebaseid;
 static size_t sc_resumerangecnt = 0;
 static drange_t *sc_resumerangep = 0;
-	/* if a resumed dump, the id, time and undumped ino/offset ranges
+	/*
+	 * if a resumed dump, the id, time and undumped ino/offset ranges
 	 * of the interrupted dump being resumed.
 	 */
 static jdm_fshandle_t *sc_fshandlep = 0;
-	/* dmi file system handle
+	/*
+	 * dmi file system handle
 	 */
 static int sc_fsfd = -1;
-	/* open file descriptor for root directory
+	/*
+	 * open file descriptor for root directory
 	 */
 static xfs_bstat_t *sc_rootxfsstatp = 0;
-	/* pointer to loaded bulkstat for root directory
+	/*
+	 * pointer to loaded bulkstat for root directory
 	 */
 static startpt_t *sc_startptp = 0;
-	/* an array of stream ino/offset start points
+	/*
+	 * an array of stream ino/offset start points
 	 */
 static time32_t sc_stat_starttime = 0;
-	/* for cacluating elapsed time
+	/*
+	 * for cacluating elapsed time
 	 */
 static ix_t sc_stat_inomapphase = 0;
 static ix_t sc_stat_inomappass = 0;
 static size64_t sc_stat_inomapcnt;
 static size64_t sc_stat_inomapdone;
 static size64_t sc_stat_dircnt = 0;
-	/* total number of directory inodes to be dumped (strm 0)
+	/*
+	 * total number of directory inodes to be dumped (strm 0)
 	 */
 static pds_t sc_stat_pds[STREAM_SIMMAX];
-	/* per-drive stream status
+	/*
+	 * per-drive stream status
 	 */
 static size64_t sc_stat_nondircnt = 0;
-	/* total number of non-directory inodes to be dumped (all strms)
+	/*
+	 * total number of non-directory inodes to be dumped (all strms)
 	 */
 static size64_t sc_stat_nondirdone = 0;
-	/* total number of non-directory inodes dumped (all strms)
+	/*
+	 * total number of non-directory inodes dumped (all strms)
 	 */
 static size64_t sc_stat_datasz = 0;
-	/* total size in bytes of non-dirs to be dumped (all strms)
+	/*
+	 * total size in bytes of non-dirs to be dumped (all strms)
 	 */
 static size64_t sc_stat_datadone = 0;
-	/* total size in bytes of non-dirs dumped (all strms)
+	/*
+	 * total size in bytes of non-dirs dumped (all strms)
 	 */
 static size_t sc_thrdsarrivedcnt = 0;
-	/* each thread checks in by bumping this count under lock.
+	/*
+	 * each thread checks in by bumping this count under lock.
 	 * used to decide when its ok to begin waiting for all threads
 	 * to arrive at sync pt for session inventory dump.
 	 */
 static size_t sc_thrdsdonecnt = 0;
-	/* number of threads which are ready to dump the session inventory.
+	/*
+	 * number of threads which are ready to dump the session inventory.
 	 * when equal to the number of streams remaining (stream_cnt()),
 	 * can proceed with inventory dumps
 	 */
 static context_t *sc_contextp;
-	/* an array of per-stream context descriptors
+	/*
+	 * an array of per-stream context descriptors
 	 */
 static bool_t sc_mcflag[STREAM_SIMMAX];
-	/* media change flag
+	/*
+	 * media change flag
 	 */
 static bool_t sc_dumpextattrpr = BOOL_TRUE;
-	/* dump extended attributes
+	/*
+	 * dump extended attributes
 	 */
 static bool_t sc_dumpasoffline = BOOL_FALSE;
-	/* dump dual-residency HSM files as offline
+	/*
+	 * dump dual-residency HSM files as offline
 	 */
 static bool_t sc_use_old_direntpr = BOOL_FALSE;
-	/* dump dirents as dirent_v1_t instead of dirent_t
+	/*
+	 * dump dirents as dirent_v1_t instead of dirent_t
 	 * (for compat with dump format 2)
 	 */
 
 static bool_t sc_savequotas = BOOL_TRUE;
-/* save quota information in dump
+/*
+ * save quota information in dump
  */
 static quota_info_t quotas[] = {
 	{ "user quota",		BOOL_TRUE,	CONTENT_QUOTAFILE,	"", "-uf", XFS_QUOTA_UDQ_ACCT, 0 },
@@ -584,7 +643,8 @@ content_init(int argc,
 	uint64_t filesz;
 	uint64_t size_estimate;
 
-	/* basic sanity checks
+	/*
+	 * basic sanity checks
 	 */
 	assert(sizeof(mode_t) == MODE_SZ);
 	assert(sizeof(timestruct_t) == TIMESTRUCT_SZ);
@@ -599,7 +659,8 @@ content_init(int argc,
 		sizeof(content_inode_hdr_t));
 	assert(sizeof(extattrhdr_t) == EXTATTRHDR_SZ);
 
-	/* calculate offsets of portions of the write hdr template
+	/*
+	 * calculate offsets of portions of the write hdr template
 	 */
 	dwhdrtemplatep = (drive_hdr_t *)gwhdrtemplatep->gh_upper;
 	mwhdrtemplatep = (media_hdr_t *)dwhdrtemplatep->dh_upper;
@@ -610,7 +671,8 @@ content_init(int argc,
 		sc_use_old_direntpr = BOOL_TRUE;
 	}
 
-	/* process command line args
+	/*
+	 * process command line args
 	 */
 	optind = 1;
 	opterr = 0;
@@ -736,7 +798,8 @@ content_init(int argc,
 		return BOOL_FALSE;
 	}
 
-	/* the user may specify stdout as the destination, by a single
+	/*
+	 * the user may specify stdout as the destination, by a single
 	 * dash ('-') with no option letter. This must appear between
 	 * all lettered arguments and the source file system pathname.
 	 */
@@ -744,7 +807,8 @@ content_init(int argc,
 		optind++;
 	}
 
-	/* the last argument must be either the mount point or a
+	/*
+	 * the last argument must be either the mount point or a
 	 * device pathname of the file system to be dumped.
 	 */
 	if (optind >= argc) {
@@ -760,7 +824,8 @@ content_init(int argc,
 		return BOOL_FALSE;
 	}
 
-	/* allocate space for the subtree pointer array and load it
+	/*
+	 * allocate space for the subtree pointer array and load it
 	 */
 	if (subtreecnt) {
 		subtreep = (char **)calloc(subtreecnt, sizeof(char *));
@@ -782,7 +847,8 @@ content_init(int argc,
 		subtreep = 0;
 	}
 
-	/* call a magic function to figure out if the last argument is
+	/*
+	 * call a magic function to figure out if the last argument is
 	 * a mount point or a device pathname, and retrieve the file
 	 * system type, full pathname of the character special device
 	 * containing the file system, the latest mount point, and the file
@@ -806,7 +872,8 @@ content_init(int argc,
 		return BOOL_FALSE;
 	}
 
-	/* verify that the file system is mounted. This must be enhanced
+	/*
+	 * verify that the file system is mounted. This must be enhanced
 	 * to mount an unmounted file system on a temporary mount point,
 	 * if it is not currently mounted.
 	 */
@@ -817,7 +884,8 @@ content_init(int argc,
 		return BOOL_FALSE;
 	}
 
-	/* place the fs info in the write hdr template
+	/*
+	 * place the fs info in the write hdr template
 	 */
 	(void)strncpyterm(cwhdrtemplatep->ch_mntpnt,
 			     mntpnt,
@@ -859,11 +927,13 @@ content_init(int argc,
 	}
 
 
-	/* create my /var directory if it doesn't already exist.
+	/*
+	 * create my /var directory if it doesn't already exist.
 	 */
 	var_create();
 
-	/* get two session descriptors from the inventory: one for the last
+	/*
+	 * get two session descriptors from the inventory: one for the last
 	 * dump at this level, and one for the last dump at a lower level.
 	 * the former will be used to check if the last dump at this level
 	 * was prematurely terminated; if so, for those inos already dumped
@@ -875,14 +945,16 @@ content_init(int argc,
 		return BOOL_FALSE;
 	}
 
-	/* briefly open the online dump inventory, so it can be used
+	/*
+	 * briefly open the online dump inventory, so it can be used
 	 * to calculate incremental and resumed dumps.
 	 */
 	inv_idbt = inv_open((inv_predicate_t)INV_BY_UUID,
 			     INV_SEARCH_ONLY,
 			     (void *)&fsid);
 
-	/* if a based request, look for the indicated session.
+	/*
+	 * if a based request, look for the indicated session.
 	 * if found, and not interrupted, this will be used as an
 	 * incremental base. if interrupted, will be used as
 	 * resume base.
@@ -966,7 +1038,8 @@ content_init(int argc,
 						      p->dr_begin.sp_offset);
 					}
 				} else {
-					/* set the range start pt's END flag to
+					/*
+					 * set the range start pt's END flag to
 					 * indicate the range was not interrupted.
 					 */
 					p->dr_begin.sp_flags = STARTPT_FLAGS_END;
@@ -998,7 +1071,8 @@ content_init(int argc,
 		goto baseuuidbypass;
 	}
 
-	/* look for the most recent dump at a level less than the level
+	/*
+	 * look for the most recent dump at a level less than the level
 	 * of this dump. extract the time, level, id, and predicates partial
 	 * and interrupted.
 	 */
@@ -1042,7 +1116,8 @@ content_init(int argc,
 		}
 	}
 
-	/* look for the most recent dump at a level equal to the level
+	/*
+	 * look for the most recent dump at a level equal to the level
 	 * of this dump. extract the time, level, id, and predicates partial
 	 * and interrupted, and for each stream the range of ino/offset
 	 * values not dumped.
@@ -1112,7 +1187,8 @@ content_init(int argc,
 					      p->dr_begin.sp_offset);
 				}
 			} else {
-				/* set the range start pt's END flag to
+				/*
+				 * set the range start pt's END flag to
 				 * indicate the range was not interrupted.
 				 */
 				p->dr_begin.sp_flags = STARTPT_FLAGS_END;
@@ -1125,7 +1201,8 @@ content_init(int argc,
 
 baseuuidbypass:
 
-	/* now determine the incremental and resume bases, if any.
+	/*
+	 * now determine the incremental and resume bases, if any.
 	 */
 	if (samefoundpr && ! sameinterruptedpr) {
 		free((void *)sc_resumerangep);
@@ -1292,7 +1369,8 @@ baseuuidbypass:
 		}
 	}
 
-	/* don't allow interrupted dumps of a lesser level to be bases
+	/*
+	 * don't allow interrupted dumps of a lesser level to be bases
 	 */
 	if (sc_incrpr && underinterruptedpr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
@@ -1303,7 +1381,8 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* reject if resume (-R) specified, but base was not interrupted
+	/*
+	 * reject if resume (-R) specified, but base was not interrupted
 	 */
 	if (! sc_resumepr && resumereqpr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
@@ -1313,7 +1392,8 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* announce the dump characteristics
+	/*
+	 * announce the dump characteristics
 	 */
 	if (sc_incrpr) {
 		if (sc_resumepr) {
@@ -1366,13 +1446,15 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* announce the dump time
+	/*
+	 * announce the dump time
 	 */
 	mlog(MLOG_VERBOSE, _(
 	      "dump date: %s\n"),
 	      ctimennl(&gwhdrtemplatep->gh_timestamp));
 
-	/* display the session UUID
+	/*
+	 * display the session UUID
 	 */
 	{
 		char string_uuid[UUID_STR_LEN + 1];
@@ -1382,13 +1464,15 @@ baseuuidbypass:
 		      string_uuid);
 	}
 
-	/* display the session label
+	/*
+	 * display the session label
 	 */
 	mlog(MLOG_VERBOSE, _(
 	      "session label: \"%s\"\n"),
 	      gwhdrtemplatep->gh_dumplabel);
 
-	/* get a file descriptor for the file system. any file
+	/*
+	 * get a file descriptor for the file system. any file
 	 * contained in the file system will do; use the mntpnt.
 	 * needed by bigstat.
 	 */
@@ -1401,7 +1485,8 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* figure out the ino for the root directory of the fs
+	/*
+	 * figure out the ino for the root directory of the fs
 	 * and get its xfs_bstat_t for inomap_build().  This could
 	 * be a bind mount; don't ask for the mount point inode,
 	 * find the actual lowest inode number in the filesystem.
@@ -1441,7 +1526,8 @@ baseuuidbypass:
 			         sc_rootxfsstatp->bs_ino, rootstat.st_ino);
 	}
 
-	/* alloc a file system handle, to be used with the jdm_open()
+	/*
+	 * alloc a file system handle, to be used with the jdm_open()
 	 * functions.
 	 */
 	sc_fshandlep = jdm_getfshandle(mntpnt);
@@ -1457,7 +1543,8 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* If GETOPT_DUMPASOFFLINE was specified, allocate a filesystem context
+	/*
+	 * If GETOPT_DUMPASOFFLINE was specified, allocate a filesystem context
 	 * for use by the HSM routines.
 	 */
 
@@ -1465,11 +1552,13 @@ baseuuidbypass:
 		hsm_fs_ctxtp = HsmInitFsysContext(mntpnt, HSM_API_VERSION_1);
 	}
 
-	/* set now so statline can be displayed
+	/*
+	 * set now so statline can be displayed
 	 */
 	sc_stat_starttime = gwhdrtemplatep->gh_timestamp;
 
-	/* allocate storage for the stream startpoints, and build inomap.
+	/*
+	 * allocate storage for the stream startpoints, and build inomap.
 	 * inomap_build() also fills in the start points. storage only needed
 	 * until the startpoints are copied into each streams header. will
 	 * be freed at the end of this function.
@@ -1502,12 +1591,14 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* ask var to ask inomap to skip files under var if var is in
+	/*
+	 * ask var to ask inomap to skip files under var if var is in
 	 * the fs being dumped
 	 */
 	var_skip(&fsid, inomap_skip);
 
-	/* fill in write header template content info. always produce
+	/*
+	 * fill in write header template content info. always produce
 	 * an inomap for each media file. the dirdump flag will be set
 	 * in content_stream_dump() for streams which dump the directories.
 	 */
@@ -1548,7 +1639,8 @@ baseuuidbypass:
 	scwhdrtemplatep->cih_rootino = sc_rootxfsstatp->bs_ino;
 	inomap_writehdr(scwhdrtemplatep);
 
-	/* log the dump size. just a rough approx.
+	/*
+	 * log the dump size. just a rough approx.
 	 */
 	dircnt = scwhdrtemplatep->cih_inomap_dircnt;
 	nondircnt = scwhdrtemplatep->cih_inomap_nondircnt;
@@ -1587,14 +1679,16 @@ baseuuidbypass:
 	      GLOBAL_HDR_SZ, inomapsz, direntsz,
 	      filesz, datasz);
 
-	/* extract the progress stat denominators from the write hdr
+	/*
+	 * extract the progress stat denominators from the write hdr
 	 * template. placed there by inomap_writehdr()
 	 */
 	sc_stat_dircnt = scwhdrtemplatep->cih_inomap_dircnt;
 	sc_stat_nondircnt = scwhdrtemplatep->cih_inomap_nondircnt;
 	sc_stat_datasz = scwhdrtemplatep->cih_inomap_datasz;
 
-	/* allocate and populate per-stream context descriptors
+	/*
+	 * allocate and populate per-stream context descriptors
 	 */
 	sc_contextp = (context_t *)calloc(drivecnt, sizeof(context_t));
 	assert(sc_contextp);
@@ -1660,7 +1754,8 @@ baseuuidbypass:
 		contextp->cc_inomap_contextp = inomap_alloc_context();
 	}
 
-	/* look for command line media labels. these will be assigned
+	/*
+	 * look for command line media labels. these will be assigned
 	 * to each stream as found. this label is only for the media
 	 * object currently in the drive. subsequently inserted media
 	 * objects must get a label via prompting.
@@ -1709,7 +1804,8 @@ baseuuidbypass:
 		return BOOL_FALSE;
 	}
 
-	/* open the dump inventory and a dump inventory write session
+	/*
+	 * open the dump inventory and a dump inventory write session
 	 * if an inventory update is to be done.
 	 */
 	if (sc_inv_updatepr) {
@@ -1733,7 +1829,8 @@ baseuuidbypass:
 		}
 	}
 
-	/* set media change flags to FALSE;
+	/*
+	 * set media change flags to FALSE;
 	 */
 	{
 		ix_t ix;
@@ -1746,7 +1843,8 @@ baseuuidbypass:
 	}
 	content_media_change_needed = BOOL_FALSE;
 
-	/* initialize the per-drive status
+	/*
+	 * initialize the per-drive status
 	 */
 	{
 		ix_t driveix;
@@ -1774,7 +1872,8 @@ content_statline(char **linespp[])
 	struct tm *tmp;
 	ix_t i;
 
-	/* build and supply the line array
+	/*
+	 * build and supply the line array
 	 */
 	for (i = 0; i < STREAM_SIMMAX + 1; i++) {
 		statline[i] = &statlinebuf[i][0];
@@ -1782,22 +1881,26 @@ content_statline(char **linespp[])
 	*linespp = statline;
 	statlinecnt = 0;
 
-	/* if start time not initialized, return no strings
+	/*
+	 * if start time not initialized, return no strings
 	 */
 	if (! sc_stat_starttime) {
 		return 0;
 	}
 
-	/* calculate the elapsed time
+	/*
+	 * calculate the elapsed time
 	 */
 	now = time(0);
 	elapsed = now - sc_stat_starttime;
 
-	/* get local time
+	/*
+	 * get local time
 	 */
 	tmp = localtime(&now);
 
-	/* if inomap phase indicated, report on that
+	/*
+	 * if inomap phase indicated, report on that
 	 */
 	if (sc_stat_inomapphase && sc_stat_inomapcnt) {
 		if (sc_stat_inomappass) {
@@ -1833,7 +1936,8 @@ content_statline(char **linespp[])
 		return 1;
 	}
 
-	/* get the accumulated totals for non-dir inos and data bytes dumped
+	/*
+	 * get the accumulated totals for non-dir inos and data bytes dumped
 	 */
 	lock();
 	nondirdone = sc_stat_nondirdone;
@@ -1842,7 +1946,8 @@ content_statline(char **linespp[])
 
 	/* non-dir dump phase */
 	if (nondirdone || datadone) {
-		/* calculate percentage of data dumped
+		/*
+		 * calculate percentage of data dumped
 		*/
 		if (sc_stat_datasz) {
 			percent = (double)datadone
@@ -1856,7 +1961,8 @@ content_statline(char **linespp[])
 			percent = 100.0;
 		}
 
-		/* format the status line in a local static buffer (non-re-entrant!)
+		/*
+		 * format the status line in a local static buffer (non-re-entrant!)
 		*/
 		sprintf(statline[0],
 				"status at %02d:%02d:%02d: %llu/%llu files dumped, "
@@ -1881,7 +1987,8 @@ content_statline(char **linespp[])
 
 	assert(strlen(statline[0]) < STATLINESZ);
 
-	/* optionally create stat lines for each drive
+	/*
+	 * optionally create stat lines for each drive
 	 */
 	statlinecnt = 1;
 	for (i = 0; i < drivecnt; i++) {
@@ -1983,7 +2090,8 @@ create_inv_session(
 		return BOOL_FALSE;
 	}
 
-	/* open an inventory stream for each stream
+	/*
+	 * open an inventory stream for each stream
 	*/
 	sc_inv_stmtokenp = (inv_stmtoken_t *)
 				calloc(drivecnt, sizeof(inv_stmtoken_t));
@@ -2043,7 +2151,8 @@ mark_set(drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags)
 static void
 mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 {
-	/* get context
+	/*
+	 * get context
 	 */
 	ix_t strmix = (ix_t)p;
 	context_t *contextp = &sc_contextp[strmix];
@@ -2055,21 +2164,25 @@ mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 				       (void *)
 				       cwhdrp->ch_specific;
 
-	/* this is really a mark_t, allocated by mark_set()
+	/*
+	 * this is really a mark_t, allocated by mark_set()
 	 */
 	mark_t *markp = (mark_t *)dmp;
 
 	if (committed) {
-		/* bump the per-mfile mark committed count
+		/*
+		 * bump the per-mfile mark committed count
 		 */
 		contextp->cc_markscommitted++;
 
-		/* copy the mark into the write header: this establishes the
+		/*
+		 * copy the mark into the write header: this establishes the
 		 * starting point should we need to retry the non-dir portion
 		 * of the dump
 		 */
 
-		/* log the mark commit
+		/*
+		 * log the mark commit
 		 */
 		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
 			mlog(MLOG_DEBUG,
@@ -2100,7 +2213,8 @@ mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 			scwhdrp->cih_startpt = markp->startpt;
 		}
 	} else {
-		/* note the mark was not committed
+		/*
+		 * note the mark was not committed
 		 */
 		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
 			mlog(MLOG_DEBUG,
@@ -2117,12 +2231,14 @@ mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 		}
 	}
 
-	/* get rid of this mark (it was allocated by mark_set())
+	/*
+	 * get rid of this mark (it was allocated by mark_set())
 	 */
 	free((void *)markp);
 }
 
-/* begin - called by stream process to invoke the dump stream
+/*
+ * begin - called by stream process to invoke the dump stream
  */
 int
 content_stream_dump(ix_t strmix)
@@ -2144,11 +2260,13 @@ content_stream_dump(ix_t strmix)
 	int rval;
 	rv_t rv;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(RV_OK == 0); /* bigstat_iter depends on this */
 
-	/* allocate a buffer for use by bstat_iter
+	/*
+	 * allocate a buffer for use by bstat_iter
 	 */
 	bstatbufp = (xfs_bstat_t *)calloc(bstatbuflen,
 					     sizeof(xfs_bstat_t));
@@ -2158,18 +2276,21 @@ content_stream_dump(ix_t strmix)
 	inomap_contextp = inomap_alloc_context();
 	assert(inomap_contextp);
 
-	/* determine if stream terminators will be used and are expected.
+	/*
+	 * determine if stream terminators will be used and are expected.
 	 * this will be revised each time a new media file is begun.
 	 */
 	update_cc_Media_useterminatorpr(drivep, contextp);
 
-	/* check in
+	/*
+	 * check in
 	 */
 	lock();
 	sc_thrdsarrivedcnt++;
 	unlock();
 
-	/* fill in write hdr stream start and end points
+	/*
+	 * fill in write hdr stream start and end points
 	 */
 	scwhdrp->cih_startpt = sc_startptp[strmix];
 	if (strmix < drivecnt - 1) {
@@ -2183,25 +2304,30 @@ content_stream_dump(ix_t strmix)
 		scwhdrp->cih_dumpattr |= CIH_DUMPATTR_DIRDUMP;
 	}
 
-	/* fill in inomap fields of write hdr
+	/*
+	 * fill in inomap fields of write hdr
 	 */
 	inomap_writehdr(scwhdrp);
 
-	/* used to decide if any non-dirs not yet on media
+	/*
+	 * used to decide if any non-dirs not yet on media
 	 */
 	all_nondirs_committed = BOOL_FALSE;
 
-	/* used to guarantee we don't count the same ino more than once
+	/*
+	 * used to guarantee we don't count the same ino more than once
 	 * in the progress stats
 	 */
 	contextp->cc_stat_lastino = 0;
 
-	/* used to detect generation of an empty media file;
+	/*
+	 * used to detect generation of an empty media file;
 	 * contains at most an inomap and dirdump and null file hdr.
 	 */
 	empty_mediafile = BOOL_FALSE;
 
-	/* get the inventory stream token
+	/*
+	 * get the inventory stream token
 	 */
 	if (sc_inv_stmtokenp) {
 		inv_stmt = sc_inv_stmtokenp[strmix];
@@ -2209,7 +2335,8 @@ content_stream_dump(ix_t strmix)
 		inv_stmt = INV_TOKEN_NULL;
 	}
 
-	/* loop, dumping media files, until the entire stream is dumped.
+	/*
+	 * loop, dumping media files, until the entire stream is dumped.
 	 * each time we hit EOM/EOF, repeat the inomap and directory dump.
 	 * dump the non-dirs beginning with the current startpoint.
 	 * The current startpoint will be updated each time a media mark
@@ -2225,37 +2352,44 @@ content_stream_dump(ix_t strmix)
 		off64_t ncommitted;
 		bool_t done;
 
-		/* used to decide whether or not to go back for more.
+		/*
+		 * used to decide whether or not to go back for more.
 		 */
 		stop_requested = BOOL_FALSE;
 
-		/* TRUE if hit EOM while dumping
+		/*
+		 * TRUE if hit EOM while dumping
 		 */
 		hit_eom = BOOL_FALSE;
 
-		/* used to decide if the media file contains all
+		/*
+		 * used to decide if the media file contains all
 		 * of the inomap and dirdump.
 		 */
 		all_dirs_committed = BOOL_FALSE;
 
-		/* used to decide if all non-dirs were sent (not necessarily
+		/*
+		 * used to decide if all non-dirs were sent (not necessarily
 		 * committed)
 		 */
 		all_nondirs_sent = BOOL_FALSE;
 
-		/* always clear the NULL flag from the stream startpoint
+		/*
+		 * always clear the NULL flag from the stream startpoint
 		 * before beginning the media file. allows detection
 		 * of null file hdr commit.
 		 */
 		scwhdrp->cih_startpt.sp_flags &= ~STARTPT_FLAGS_NULL;
 
-		/* save the original start points, to be given to
+		/*
+		 * save the original start points, to be given to
 		 * the inventory at the end of each media file.
 		 */
 		startino = scwhdrp->cih_startpt.sp_ino;
 		startoffset = scwhdrp->cih_startpt.sp_offset;
 
-		/* set the accumulated file size to zero.
+		/*
+		 * set the accumulated file size to zero.
 		 * this will be monitored by dump_file() to decide
 		 * if the current dump file is too long. if so,
 		 * it will set a startpoint and spoof an EOF.
@@ -2264,7 +2398,8 @@ content_stream_dump(ix_t strmix)
 		 */
 		contextp->cc_mfilesz = 0;
 
-		/* tell the Media abstraction to position a media object
+		/*
+		 * tell the Media abstraction to position a media object
 		 * and begin a new media file. This will dump the media
 		 * file header if successful.
 		 */
@@ -2302,7 +2437,8 @@ content_stream_dump(ix_t strmix)
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
-		/* sync up here with other streams if reasonable
+		/*
+		 * sync up here with other streams if reasonable
 		 */
 		mlog(MLOG_VERBOSE, _(
 		      "creating dump session media file %u "
@@ -2311,12 +2447,14 @@ content_stream_dump(ix_t strmix)
 		      mwhdrp->mh_mediaix,
 		      mwhdrp->mh_mediafileix);
 
-		/* initialize the count of marks committed in the media file.
+		/*
+		 * initialize the count of marks committed in the media file.
 		 * will be bumped by mark_callback().
 		 */
 		contextp->cc_markscommitted = 0;
 
-		/* first dump the inomap
+		/*
+		 * first dump the inomap
 		 */
 		mlog(MLOG_VERBOSE, _(
 		      "dumping ino map\n"));
@@ -2348,7 +2486,8 @@ content_stream_dump(ix_t strmix)
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
-		/* now dump the directories, if this is a stream that dumps
+		/*
+		 * now dump the directories, if this is a stream that dumps
 		 * directories. use the bigstat iterator capability to call
 		 * my dump_dir function for each directory in the bitmap.
 		 */
@@ -2385,7 +2524,8 @@ content_stream_dump(ix_t strmix)
 			}
 		}
 
-		/* finally, dump the non-directory files beginning with this
+		/*
+		 * finally, dump the non-directory files beginning with this
 		 * stream's startpoint. Note that dump_file will set one or
 		 * more media marks; the callback will update the hdr's
 		 * startpoint; thus each time a demarcated portion of a
@@ -2445,7 +2585,8 @@ content_stream_dump(ix_t strmix)
 			}
 		}
 
-		/* if we got here, all files were sent without hitting
+		/*
+		 * if we got here, all files were sent without hitting
 		 * the end of the current media object, or hitting the
 		 * media file size limit. send the special END mark.
 		 * this is only send at the end of the last media file in the
@@ -2461,7 +2602,8 @@ content_stream_dump(ix_t strmix)
 			  STARTPT_FLAGS_END);
 
 decision_more:
-		/* write a null file hdr, to let restore recognize
+		/*
+		 * write a null file hdr, to let restore recognize
 		 * the end of the media file. the flags indicate
 		 * whether or not this is intended to be the last
 		 * media file in the stream. don't bother if we hit
@@ -2492,7 +2634,8 @@ decision_more:
 				return mlog_exit(EXIT_ERROR, rv);
 			}
 
-			/* send a mark to detect if the null file header made
+			/*
+			 * send a mark to detect if the null file header made
 			 * it. mark callback will adjust start pt before this
 			 * call returns if the null file header made it.
 			 */
@@ -2506,7 +2649,8 @@ decision_more:
 				  STARTPT_FLAGS_NULL);
 		}
 
-		/* tell the Media abstraction to end the media file.
+		/*
+		 * tell the Media abstraction to end the media file.
 		 * this is done before the inventory update, to
 		 * see how much was actually committed to media.
 		 * will invoke drive end_write, which will flush
@@ -2532,12 +2676,14 @@ decision_more:
 		      "media file size %lld bytes\n"),
 		      ncommitted);
 
-		/* if at least one mark committed, we know all of
+		/*
+		 * if at least one mark committed, we know all of
 		 * the inomap and dirdump was committed.
 		 */
 		all_dirs_committed = (contextp->cc_markscommitted > 0);
 
-		/* at this point we can check the new start point
+		/*
+		 * at this point we can check the new start point
 		 * to determine if all nondirs have been committed.
 		 * if this flag was already set, then this is a
 		 * inomap and dirdump-only media file.
@@ -2549,13 +2695,15 @@ decision_more:
 			all_nondirs_committed = BOOL_TRUE;
 		}
 
-		/* we are done if all nondirs have been committed.
+		/*
+		 * we are done if all nondirs have been committed.
 		 * it is not necessary for the null file header to have
 		 * been committed.
 		 */
 		done = all_nondirs_committed;
 
-		/* tell the inventory about the media file
+		/*
+		 * tell the inventory about the media file
 		 */
 		if (inv_stmt != INV_TOKEN_NULL) {
 			bool_t ok;
@@ -2596,7 +2744,8 @@ decision_more:
 				       scwhdrp->cih_startpt.sp_offset);
 			}
 
-			/* already thread-safe, don't need to lock
+			/*
+			 * already thread-safe, don't need to lock
 			 */
 			ok = inv_put_mediafile(inv_stmt,
 						&mwhdrp->mh_mediaid,
@@ -2618,24 +2767,28 @@ decision_more:
 		}
 		if (done) {
 			contextp->cc_completepr = BOOL_TRUE;
-			    /* so inv_end_stream and main will know
+			    /*
+			     * so inv_end_stream and main will know
 			     */
 		}
 
-		/* don't go back for more if done or stop was requested
+		/*
+		 * don't go back for more if done or stop was requested
 		 */
 		if (done || stop_requested) {
 			break;
 		}
 	} /* end main dump loop */
 
-	/* check in
+	/*
+	 * check in
 	 */
 	lock();
 	sc_thrdsdonecnt++;
 	unlock();
 
-	/* dump the session inventory and terminator here, if the drive
+	/*
+	 * dump the session inventory and terminator here, if the drive
 	 * supports multiple media files. must wait until all
 	 * streams have completed or given up, so all media files
 	 * from all streams have been registered.
@@ -2648,17 +2801,20 @@ decision_more:
 			sc_stat_pds[strmix].pds_phase = PDS_INVSYNC;
 		}
 
-		/* first be sure all threads have begun
+		/*
+		 * first be sure all threads have begun
 		*/
 		while (sc_thrdsarrivedcnt < drivecnt) {
 			sleep(1);
 		}
-		/* now wait for survivors to checkin
+		/*
+		 * now wait for survivors to checkin
 		*/
 		while (sc_thrdsdonecnt < stream_cnt()) {
 			sleep(1);
 		}
-		/* proceeed
+		/*
+		 * proceeed
 		 */
 		sc_stat_pds[strmix].pds_phase = PDS_INVDUMP;
 		if (dump_session_inv(drivep, contextp, mwhdrp, scwhdrp)) {
@@ -2680,7 +2836,8 @@ decision_more:
 	return mlog_exit(EXIT_NORMAL, rv);
 }
 
-/* indicates if the dump was complete.
+/*
+ * indicates if the dump was complete.
  * easy to tell: initially contextp->cc_completepr is false for each stream.
  * only set true if stream complete. if any stream NOT complete,
  * dump is not complete.
@@ -2836,7 +2993,8 @@ dump_dirs(ix_t strmix,
 
 	inomap_reset_context(inomap_contextp);
 
-	/* begin iteration at ino zero
+	/*
+	 * begin iteration at ino zero
 	 */
 	lastino = 0;
 	for (bulkstatcallcnt = 0;; bulkstatcallcnt++) {
@@ -2851,13 +3009,15 @@ dump_dirs(ix_t strmix,
 		}
 		sc_stat_pds[strmix].pds_phase = PDS_DIRDUMP;
 
-		/* check for interruption
+		/*
+		 * check for interruption
 		 */
 		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
-		/* get a bunch of bulkstats
+		/*
+		 * get a bunch of bulkstats
 		 */
 		mlog(MLOG_NITTY,
 		      "dump_dirs SGI_FS_BULKSTAT %u buf len %u\n",
@@ -2883,13 +3043,15 @@ dump_dirs(ix_t strmix,
 		      "dump_dirs SGI_FS_BULKSTAT returns %d entries\n",
 		      buflenout);
 
-		/* check if done
+		/*
+		 * check if done
 		 */
 		if (buflenout == 0) {
 			return RV_OK;
 		}
 
-		/* step through each node, dumping if
+		/*
+		 * step through each node, dumping if
 		 * appropriate
 		 */
 		for (p = bstatbufp, endp = bstatbufp + buflenout
@@ -2961,24 +3123,28 @@ dump_dir(ix_t strmix,
 	gen_t gen;
 	rv_t rv;
 
-	/* no way this can be non-dir, but check anyway
+	/*
+	 * no way this can be non-dir, but check anyway
 	 */
 	assert((statp->bs_mode & S_IFMT) == S_IFDIR);
 	if ((statp->bs_mode & S_IFMT) != S_IFDIR) {
 		return RV_OK;
 	}
 
-	/* skip if no links
+	/*
+	 * skip if no links
 	 */
 	if (statp->bs_nlink < 1) {
 		return RV_OK;
 	}
 
-	/* see what the inomap says about this ino
+	/*
+	 * see what the inomap says about this ino
 	 */
 	state = inomap_get_state(inomap_contextp, statp->bs_ino);
 
-	/* skip if not in inomap
+	/*
+	 * skip if not in inomap
 	 */
 	if (state == MAP_INO_UNUSED
 	     ||
@@ -2994,7 +3160,8 @@ dump_dir(ix_t strmix,
 		return RV_OK;
 	}
 
-	/* note if map says a non-dir
+	/*
+	 * note if map says a non-dir
 	 */
 	if (state == MAP_NDR_CHANGE) {
 		mlog(MLOG_DEBUG,
@@ -3004,11 +3171,13 @@ dump_dir(ix_t strmix,
 		return RV_OK;
 	}
 
-	/* bump the stats now. a bit early, but fewer lines of code
+	/*
+	 * bump the stats now. a bit early, but fewer lines of code
 	 */
 	sc_stat_pds[strmix].pds_dirdone++;
 
-        /* if bulkstat ino# occupied more than 32 bits and
+        /*
+         * if bulkstat ino# occupied more than 32 bits and
          * linux ino# for getdents is 32 bits then
          * warn and skip.
          */
@@ -3023,7 +3192,8 @@ dump_dir(ix_t strmix,
 	      "dumping directory ino %llu\n",
 	      statp->bs_ino);
 
-	/* open the directory named by statp
+	/*
+	 * open the directory named by statp
 	 */
 	fd = jdm_open(fshandlep, statp, O_RDONLY);
 	if (fd < 0) {
@@ -3033,7 +3203,8 @@ dump_dir(ix_t strmix,
 		return RV_OK; /* continue anyway */
 	}
 
-	/* dump the file header.
+	/*
+	 * dump the file header.
 	 */
 	rv = dump_filehdr(drivep, contextp, statp, 0, 0);
 	if (rv != RV_OK) {
@@ -3041,7 +3212,8 @@ dump_dir(ix_t strmix,
 		return rv;
 	}
 
-	/* dump dirents - lots of buffering done here, to achieve OS-
+	/*
+	 * dump dirents - lots of buffering done here, to achieve OS-
 	 * independence. if proves to be to much overhead, can streamline.
 	 */
 	for (gdcnt = 1, rv = RV_OK; rv == RV_OK; gdcnt++) {
@@ -3051,7 +3223,8 @@ dump_dir(ix_t strmix,
 
 		nread = getdents_wrap(fd, (char *)gdp, gdsz);
 
-		/* negative count indicates something very bad happened;
+		/*
+		 * negative count indicates something very bad happened;
 		 * try to gracefully end this dir.
 		 */
 		if (nread < 0) {
@@ -3061,7 +3234,8 @@ dump_dir(ix_t strmix,
 			      gdcnt,
 			      statp->bs_ino,
 			      strerror(errno));
-			/* !!! curtis looked at this, and pointed out that
+			/*
+			 * !!! curtis looked at this, and pointed out that
 			 * we could take some recovery action here. if the
 			 * errno is appropriate, lseek64 to the value of
 			 * doff field of the last dirent successfully
@@ -3070,13 +3244,15 @@ dump_dir(ix_t strmix,
 			nread = 0; /* pretend we are done */
 		}
 
-		/* no more directory entries: break;
+		/*
+		 * no more directory entries: break;
 		 */
 		if (nread == 0) {
 			break;
 		}
 
-		/* translate and dump each entry: skip "." and ".."
+		/*
+		 * translate and dump each entry: skip "." and ".."
 		 * and null entries.
 		 */
 		for (p = gdp,
@@ -3096,14 +3272,16 @@ dump_dir(ix_t strmix,
 						    offsetofmember(struct dirent,
 								    d_name);
 
-			/* getdents(2) guarantees that the string will
+			/*
+			 * getdents(2) guarantees that the string will
 			 * be null-terminated, but the record may have
 			 * padding after the null-termination.
 			 */
 			assert(namelen < nameszmax);
 #endif
 
-			/* skip "." and ".."
+			/*
+			 * skip "." and ".."
 			 */
 			if (*(p->d_name + 0) == '.'
 			     &&
@@ -3126,7 +3304,8 @@ dump_dir(ix_t strmix,
 				continue;
 			}
 
-			/* lookup the gen number in the ino-to-gen map.
+			/*
+			 * lookup the gen number in the ino-to-gen map.
 			 * if it's not there, we have to get it the slow way.
 			 */
 			if (inomap_get_gen(NULL, p->d_ino, &gen)) {
@@ -3164,7 +3343,8 @@ dump_dir(ix_t strmix,
 		}
 	}
 
-	/* write a null dirent hdr, unless trouble encountered in the loop
+	/*
+	 * write a null dirent hdr, unless trouble encountered in the loop
 	 */
 	if (rv == RV_OK) {
 		rv = dump_dirent(drivep, contextp, statp, 0, 0, 0, 0);
@@ -3180,7 +3360,8 @@ dump_dir(ix_t strmix,
 
 	close(fd);
 
-	/* if an error occurred, just return the error
+	/*
+	 * if an error occurred, just return the error
 	 */
 	return rv;
 }
@@ -3197,7 +3378,8 @@ dump_extattrs(drive_t *drivep,
 	rv_t rv;
 	bool_t abort;
 
-	/* dump a file header specially marked as heading extended attributes
+	/*
+	 * dump a file header specially marked as heading extended attributes
 	 */
 	mlog(MLOG_NITTY,
 	      "dumping %s ino %llu extended attributes filehdr\n",
@@ -3209,7 +3391,8 @@ dump_extattrs(drive_t *drivep,
 		return rv;
 	}
 
-	/* loop three times: once for the non-root, once for root, and
+	/*
+	 * loop three times: once for the non-root, once for root, and
 	 * again for the secure attributes.
 	 */
 	for (pass = 0; pass < 3; pass++) {
@@ -3228,7 +3411,8 @@ dump_extattrs(drive_t *drivep,
 		      FILETYPE(statp),
 		      statp->bs_ino);
 
-		/* loop dumping the extended attributes from the namespace
+		/*
+		 * loop dumping the extended attributes from the namespace
 		 * selected by the outer loop
 		 */
 		memset(&cursor, 0, sizeof(cursor));
@@ -3270,7 +3454,8 @@ dump_extattrs(drive_t *drivep,
 		} while (more && !abort);
 	}
 
-	/* finally, dump a dummy extattr hdr so restore will know
+	/*
+	 * finally, dump a dummy extattr hdr so restore will know
 	 * we're done.
 	 */
 	/*DBG*/mlog(MLOG_NITTY,
@@ -3305,11 +3490,13 @@ dump_extattr_list(drive_t *drivep,
 			    +
 			    contextp->cc_extattrdumpbufsz;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(listp->al_count >= 0);
 
-	/* fill up a retrieve array and build a dump buffer;
+	/*
+	 * fill up a retrieve array and build a dump buffer;
 	 * can run out of entries in the name list, space in the
 	 * retrieve buffer, or space in the dump buffer
 	 */
@@ -3328,7 +3515,8 @@ dump_extattr_list(drive_t *drivep,
 			entp = ATTR_ENTRY(listp, nameix);
 			opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
 
-			/* Offer the HSM a chance to avoid dumping certain
+			/*
+			 * Offer the HSM a chance to avoid dumping certain
 			 * attributes.
 			 */
 
@@ -3378,7 +3566,8 @@ dump_extattr_list(drive_t *drivep,
 			nameix++;
 		}
 
-		/* Either the retrieve buffer is full, the dump buffer is full,
+		/*
+		 * Either the retrieve buffer is full, the dump buffer is full,
 		 * or we just put the last attribute into the dump buffer.  In
 		 * any case, fill in the values for any attributes added so far.
 		 */
@@ -3408,7 +3597,8 @@ dump_extattr_list(drive_t *drivep,
 				if (opp->am_error) {
 					if (opp->am_error == ENOATTR &&
 					     flag & ATTR_SECURE) {
-				/* Security attributes are supported by
+				/*
+				 * Security attributes are supported by
 				 * the kernel but jdm_attr_multi() returns
 				 * ENOATTR for every 'user' space attribute
 				 * during the 'security' pass of the extended
@@ -3433,7 +3623,8 @@ dump_extattr_list(drive_t *drivep,
 			}
 		}
 
-		/* The values for all attributes in the dump buffer have been
+		/*
+		 * The values for all attributes in the dump buffer have been
 		 * filled in.  If the dump buffer isn't full yet, let's wait
 		 * and put some more attributes in.
 		 */
@@ -3473,7 +3664,8 @@ dump_extattr_list(drive_t *drivep,
 		endp = dumpbufp;
 	}
 
-	/* All existing attributes are in the dump buffer.  See if the HSM
+	/*
+	 * All existing attributes are in the dump buffer.  See if the HSM
 	 * needs to add any addtional attributes.
 	 */
 
@@ -3553,7 +3745,8 @@ dump_extattr_list(drive_t *drivep,
 		}
 	}
 
-	/* If any attributes remain unwritten in the dump buffer, write them
+	/*
+	 * If any attributes remain unwritten in the dump buffer, write them
 	 * now.
 	 */
 
@@ -3720,7 +3913,8 @@ dump_extattrhdr(drive_t *drivep,
 	return rv;
 }
 
-/* this function is called by the bigstat iterator for all non-directory
+/*
+ * this function is called by the bigstat iterator for all non-directory
  * files. it passes the buck to file type-specific dump functions.
  * return value is RV_EOF if the media file is getting too big,
  * RV_... if trouble encountered with the media/drive,
@@ -3749,7 +3943,8 @@ dump_file(void *arg1,
 	int state;
 	rv_t rv;
 
-	/* skip if no links
+	/*
+	 * skip if no links
 	 */
 	if (statp->bs_nlink < 1) {
 		if (statp->bs_ino > contextp->cc_stat_lastino) {
@@ -3760,7 +3955,8 @@ dump_file(void *arg1,
 		return RV_OK;
 	}
 
-	/* skip if prior to startpoint
+	/*
+	 * skip if prior to startpoint
 	 */
 	if (statp->bs_ino < startptp->sp_ino) {
 		if (statp->bs_ino > contextp->cc_stat_lastino) {
@@ -3771,7 +3967,8 @@ dump_file(void *arg1,
 		return RV_OK;
 	}
 
-	/* skip if at or beyond next startpoint. return non-zero to
+	/*
+	 * skip if at or beyond next startpoint. return non-zero to
 	 * abort iteration.
 	 */
 	if (! (endptp->sp_flags & STARTPT_FLAGS_END)) {
@@ -3796,11 +3993,13 @@ dump_file(void *arg1,
 		}
 	}
 
-	/* see what the inomap says about this ino
+	/*
+	 * see what the inomap says about this ino
 	 */
 	state = inomap_get_state(contextp->cc_inomap_contextp, statp->bs_ino);
 
-	/* skip if not in inomap
+	/*
+	 * skip if not in inomap
 	 */
 	if (state == MAP_INO_UNUSED
 	     ||
@@ -3823,7 +4022,8 @@ dump_file(void *arg1,
 		return RV_OK;
 	}
 
-	/* note if map says a dir
+	/*
+	 * note if map says a dir
 	 */
 	if (state == MAP_DIR_CHANGE || state == MAP_DIR_SUPPRT) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
@@ -3837,7 +4037,8 @@ dump_file(void *arg1,
 		      "map says unchanged dir");
 	}
 
-	/* if GETOPT_DUMPASOFFLINE was specified, initialize the HSM's file
+	/*
+	 * if GETOPT_DUMPASOFFLINE was specified, initialize the HSM's file
 	 * context for use in other routines.  If the context can't be
 	 * initialized, don't dump the file.
 	 */
@@ -3855,14 +4056,17 @@ dump_file(void *arg1,
 		}
 	}
 
-	/* pass on to specific dump function
+	/*
+	 * pass on to specific dump function
 	 */
 	switch (statp->bs_mode & S_IFMT) {
 	case S_IFREG:
-		/* ordinary file
+		/*
+		 * ordinary file
 		 */
 
-		/* filter out any files that have grown beyond the
+		/*
+		 * filter out any files that have grown beyond the
 		 * max file size since the initial scan.
 		 */
 		if (maxdumpfilesize) {
@@ -3908,7 +4112,8 @@ dump_file(void *arg1,
 #endif
 	case S_IFLNK:
 	case S_IFSOCK:
-		/* only need a filehdr_t; no data
+		/*
+		 * only need a filehdr_t; no data
 		 */
 		rv = dump_file_spec(drivep, contextp, fshandlep, statp);
 		if (statp->bs_ino > contextp->cc_stat_lastino) {
@@ -3920,7 +4125,8 @@ dump_file(void *arg1,
 		break; /* drop out of switch to extattr dump */
 	case S_IFDIR:
 	default:
-		/* don't know how to dump these
+		/*
+		 * don't know how to dump these
 		 */
 		mlog(MLOG_VERBOSE, _(
 		      "don't know how to dump ino %llu: mode %08x\n"),
@@ -3933,7 +4139,8 @@ dump_file(void *arg1,
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		return RV_OK;
-	/* not yet implemented
+	/*
+	 * not yet implemented
 	case S_IFMNT:
 	 */
 	}
@@ -3951,7 +4158,8 @@ dump_file(void *arg1,
 	return rv;
 }
 
-/* a regular file may be broken into several portions if its size
+/*
+ * a regular file may be broken into several portions if its size
  * is large. Each portion begins with a filehdr_t and is followed by
  * several extents. each extent begins with an extenthdr_t. returns RV_OK
  * if all extents dumped, RV_... on drive errors, or RV_INTR if
@@ -3975,7 +4183,8 @@ dump_file_reg(drive_t *drivep,
 	off64_t maxextentcnt;
 	rv_t rv;
 
-	/* determine the offset within the file where the dump should begin.
+	/*
+	 * determine the offset within the file where the dump should begin.
 	 * it must have been aligned to the basic fs block size by the
 	 * startpoint calculations done during strategy initialization.
 	 */
@@ -3986,7 +4195,8 @@ dump_file_reg(drive_t *drivep,
 		offset = 0;
 	}
 
-	/* if this is a resumed dump and the resumption begins somewhere
+	/*
+	 * if this is a resumed dump and the resumption begins somewhere
 	 * within this file, and that point is greater than offset set
 	 * above, and that file hasn't changed since the resumed dump,
 	 * modify offset.
@@ -4013,7 +4223,8 @@ dump_file_reg(drive_t *drivep,
 		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
 	}
 
-	/* determine the offset within the file where the dump should end.
+	/*
+	 * determine the offset within the file where the dump should end.
 	 * only significant if this is an inode spanning a startpoint.
 	 */
 	if (endptp->sp_flags & STARTPT_FLAGS_END) {
@@ -4037,13 +4248,15 @@ dump_file_reg(drive_t *drivep,
 	      sosig ? stopoffset : statp->bs_size,
 	      statp->bs_size);
 
-	/* calculate the maximum extent group size. files larger than this
+	/*
+	 * calculate the maximum extent group size. files larger than this
 	 * will be broken into multiple extent groups, each with its own
 	 * filehdr_t.
 	 */
 	maxextentcnt = drivep->d_recmarksep;
 
-	/* initialize the extent group context. if fails, just return,
+	/*
+	 * initialize the extent group context. if fails, just return,
 	 * pretending the dump succeeded.
 	 */
 	rv = init_extent_group_context(fshandlep,
@@ -4060,7 +4273,8 @@ dump_file_reg(drive_t *drivep,
 		return RV_OK;
 	}
 
-	/* loop here, dumping marked groups of extents. each extent group
+	/*
+	 * loop here, dumping marked groups of extents. each extent group
 	 * is preceeded by a filehdr_t. this is required so that the
 	 * recovery side can identify the fs file at each marked point
 	 * in the stream. it sets by reference offset, bytecnt, and cmpltflg.
@@ -4075,21 +4289,24 @@ dump_file_reg(drive_t *drivep,
 		off64_t bytecnt = 0;
 		off64_t bc;
 
-		/* see if we are done.
+		/*
+		 * see if we are done.
 		 */
 		if (cmpltflg) {
 			assert(rv == RV_OK);
 			break;
 		}
 
-		/* set a mark - important to do this now, before deciding
+		/*
+		 * set a mark - important to do this now, before deciding
 		 * the media file is to big or the operator asked to
 		 * interrupt the dump. this mark, if committed, indicates
 		 * the previous fs file / extent group was completely dumped.
 		 */
 		mark_set(drivep, statp->bs_ino, offset, 0);
 
-		/* spoof EOF if the media file size is getting too big.
+		/*
+		 * spoof EOF if the media file size is getting too big.
 		 * note that the most we can go over is d_recmarksep.
 		 */
 		if (contextp->cc_mfilesz >= drivep->d_recmfilesz){
@@ -4097,7 +4314,8 @@ dump_file_reg(drive_t *drivep,
 			break;
 		}
 
-		/* check if the operator has requested to interrupt the dump.
+		/*
+		 * check if the operator has requested to interrupt the dump.
 		 */
 		if (cldmgr_stop_requested()) {
 			mlog(MLOG_NORMAL, _(
@@ -4109,7 +4327,8 @@ dump_file_reg(drive_t *drivep,
 			break;
 		}
 
-		/* dump the file header
+		/*
+		 * dump the file header
 		 */
 		mlog(MLOG_DEBUG,
 		      "dumping extent group ino %llu offset %lld\n",
@@ -4121,7 +4340,8 @@ dump_file_reg(drive_t *drivep,
 		}
 		bytecnt += sizeof(filehdr_t);
 
-		/* dump a group of extents. returns by reference
+		/*
+		 * dump a group of extents. returns by reference
 		 * the offset of the next extent group (to be placed
 		 * in the next mark), the total number of bytes written
 		 * to media (headers and all), and a flag indicating
@@ -4144,13 +4364,15 @@ dump_file_reg(drive_t *drivep,
 			break;
 		}
 
-		/* update global stat
+		/*
+		 * update global stat
 		 */
 		lock();
 		sc_stat_datadone += (size64_t)bc;
 		unlock();
 
-		/* dump LAST extent hdr. one of these is placed at the
+		/*
+		 * dump LAST extent hdr. one of these is placed at the
 		 * end of each dumped file. necessary to detect the
 		 * end of the file.
 		 */
@@ -4165,7 +4387,8 @@ dump_file_reg(drive_t *drivep,
 		}
 		bytecnt += sizeof(extenthdr_t);
 
-		/* update the media file size
+		/*
+		 * update the media file size
 		 */
 		contextp->cc_mfilesz += bytecnt;
 
@@ -4175,7 +4398,8 @@ dump_file_reg(drive_t *drivep,
 	return rv;
 }
 
-/* dumps character, block, and fifo - special files. no data, just meta-data,
+/*
+ * dumps character, block, and fifo - special files. no data, just meta-data,
  * all contained within the filehdr_t. also handles symbolic link files:
  * appends a variable-length string after the filehdr_t.
  */
@@ -4193,24 +4417,28 @@ dump_file_spec(drive_t *drivep,
 	      statp->bs_ino,
 	      statp->bs_mode);
 
-	/* set a mark - important to do this now, before deciding
+	/*
+	 * set a mark - important to do this now, before deciding
 	 * the media file is to big. this mark, if committed,
 	 * indicates the previous fs file was completely dumped.
 	 */
 	mark_set(drivep, statp->bs_ino, 0, 0);
 
-	/* dump the file header
+	/*
+	 * dump the file header
 	 */
 	rv = dump_filehdr(drivep, contextp, statp, 0, 0);
 	if (rv != RV_OK) {
 		return rv;
 	}
 
-	/* update the media file size
+	/*
+	 * update the media file size
 	 */
 	contextp->cc_mfilesz += sizeof(filehdr_t);
 
-	/* if a symbolic link, also dump the link pathname.
+	/*
+	 * if a symbolic link, also dump the link pathname.
 	 * use an extent header to represent the pathname. the
 	 * extent sz will always be a multiple of SYMLINK_ALIGN.
 	 * the symlink pathname char string will always  be NULL-terminated.
@@ -4219,7 +4447,8 @@ dump_file_spec(drive_t *drivep,
 		int nread;
 		size_t extentsz;
 
-		/* read the link path. if error, dump a zero-length
+		/*
+		 * read the link path. if error, dump a zero-length
 		 * extent. in any case, nread will contain the number of
 		 * bytes to dump, and contextp->cc_direntbufp will contain
 		 * the bytes.
@@ -4235,12 +4464,14 @@ dump_file_spec(drive_t *drivep,
 			nread = 0;
 		}
 
-		/* null-terminate the string
+		/*
+		 * null-terminate the string
 		 */
 		assert((size_t)nread < contextp->cc_readlinkbufsz);
 		contextp->cc_readlinkbufp[nread] = 0;
 
-		/* calculate the extent size - be sure to include room
+		/*
+		 * calculate the extent size - be sure to include room
 		 * for the null-termination.
 		 */
 		extentsz = ((size_t)nread + 1 + (SYMLINK_ALIGN - 1))
@@ -4248,7 +4479,8 @@ dump_file_spec(drive_t *drivep,
 			   ~ (SYMLINK_ALIGN - 1);
 		assert(extentsz <= contextp->cc_readlinkbufsz);
 
-		/* dump an extent header
+		/*
+		 * dump an extent header
 		 */
 		rv = dump_extenthdr(drivep,
 				     contextp,
@@ -4260,7 +4492,8 @@ dump_file_spec(drive_t *drivep,
 			return rv;
 		}
 
-		/* dump the link path extent
+		/*
+		 * dump the link path extent
 		 */
 		rval = write_buf(contextp->cc_readlinkbufp,
 				  extentsz,
@@ -4291,7 +4524,8 @@ dump_file_spec(drive_t *drivep,
 	return RV_OK;
 }
 
-/* contrives the initial state of the extent group context such that
+/*
+ * contrives the initial state of the extent group context such that
  * dump_extent_group() will fetch some extents from the kernel before it
  * does anything else.
  */
@@ -4323,7 +4557,8 @@ init_extent_group_context(jdm_fshandle_t *fshandlep,
 		return RV_ERROR;
 	}
 
-	/* Check if a mandatory lock is set on the file to try and
+	/*
+	 * Check if a mandatory lock is set on the file to try and
 	 * avoid blocking indefinitely on the reads later. Note that
 	 * someone could still set a mandatory lock and hose xfsdump
 	 * after this check but before all reads have completed.
@@ -4391,7 +4626,8 @@ dump_extent_group(drive_t *drivep,
 		}
 	}
 
-	/* dump extents until the recommended extent length is achieved
+	/*
+	 * dump extents until the recommended extent length is achieved
 	 */
 	nextoffset = *nextoffsetp;
 	bytecnt = 0;
@@ -4401,7 +4637,8 @@ dump_extent_group(drive_t *drivep,
 		off64_t offset;
 		off64_t extsz;
 
-		/* if we've dumped to the stop point return.
+		/*
+		 * if we've dumped to the stop point return.
 		 */
 		if (sosig && nextoffset >= stopoffset) {
 			mlog(MLOG_NITTY,
@@ -4412,7 +4649,8 @@ dump_extent_group(drive_t *drivep,
 			return RV_OK;
 		}
 
-		/* if we've dumped the entire file, return
+		/*
+		 * if we've dumped the entire file, return
 		 */
 		if (nextoffset >= statp->bs_size) {
 			mlog(MLOG_NITTY,
@@ -4423,7 +4661,8 @@ dump_extent_group(drive_t *drivep,
 			return RV_OK;
 		}
 
-		/* if we've exceeded the desired per-extent group byte count,
+		/*
+		 * if we've exceeded the desired per-extent group byte count,
 		 * call it quits. we'll be called back for more because the
 		 * completion flag is set FALSE.
 		 */
@@ -4436,7 +4675,8 @@ dump_extent_group(drive_t *drivep,
 			return RV_OK;
 		}
 
-		/* if we are not looking at a valid bmap entry,
+		/*
+		 * if we are not looking at a valid bmap entry,
 		 * get one.
 		 */
 		if (gcp->eg_nextbmapp >= gcp->eg_endbmapp) {
@@ -4444,7 +4684,8 @@ dump_extent_group(drive_t *drivep,
 
 			assert(gcp->eg_nextbmapp == gcp->eg_endbmapp);
 
-			/* get a new extent block
+			/*
+			 * get a new extent block
 			 */
 			mlog(MLOG_NITTY,
 			      "calling getbmapx for ino %llu\n",
@@ -4482,7 +4723,8 @@ dump_extent_group(drive_t *drivep,
 				return RV_OK;
 			}
 
-			/* The F_GETBMAPX call succeeded.  Give the HSM a chance
+			/*
+			 * The F_GETBMAPX call succeeded.  Give the HSM a chance
 			 * to massage the extents.  (It can change the number
 			 * of extents remaining, even setting them to zero.
 			 */
@@ -4525,14 +4767,16 @@ dump_extent_group(drive_t *drivep,
 		      gcp->eg_nextbmapp->bmv_offset,
 		      gcp->eg_nextbmapp->bmv_length);
 
-		/* if the next bmap entry represents a hole, go to the next
+		/*
+		 * if the next bmap entry represents a hole, go to the next
 		 * one in the bmap, and rescan to check above assumptions.
 		 * bump nextoffset to after the hole, if beyond current value.
 		 */
 		if (gcp->eg_nextbmapp->bmv_block == -1) {
 			off64_t tmpoffset;
 
-			/* extract the offset and extent size from this
+			/*
+			 * extract the offset and extent size from this
 			 * entry
 			 */
 			offset = gcp->eg_nextbmapp->bmv_offset
@@ -4544,7 +4788,8 @@ dump_extent_group(drive_t *drivep,
 			      "hole extent offset = %lld size = %lld\n",
 			      offset, extsz);
 
-			/* Encode the hole - dump the extent header
+			/*
+			 * Encode the hole - dump the extent header
 			 * with the right extent type.
 			 */
 			rv = dump_extenthdr(drivep,
@@ -4574,7 +4819,8 @@ dump_extent_group(drive_t *drivep,
 			continue;
 		}
 
-		/* if the next bmap entry has a zero size, go to the next
+		/*
+		 * if the next bmap entry has a zero size, go to the next
 		 * one in the bmap, and rescan to check above assumptions.
 		 */
 		if (gcp->eg_nextbmapp->bmv_length <= 0) {
@@ -4593,7 +4839,8 @@ dump_extent_group(drive_t *drivep,
 			continue;
 		}
 
-		/* extract the offset and extent size from this
+		/*
+		 * extract the offset and extent size from this
 		 * entry
 		 */
 		offset = gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE;
@@ -4604,7 +4851,8 @@ dump_extent_group(drive_t *drivep,
 		      extsz,
 		      nextoffset);
 
-		/* if the new bmap entry begins below the stop offset
+		/*
+		 * if the new bmap entry begins below the stop offset
 		 * but does not contain any data above the current
 		 * offset, go to the next one and rescan.
 		 */
@@ -4618,7 +4866,8 @@ dump_extent_group(drive_t *drivep,
 			}
 		}
 
-		/* if the new bmap entry begins beyond the end of the file,
+		/*
+		 * if the new bmap entry begins beyond the end of the file,
 		 * we are done.
 		 */
 		if (offset >= statp->bs_size) {
@@ -4630,7 +4879,8 @@ dump_extent_group(drive_t *drivep,
 			return RV_OK;
 		}
 
-		/* if the new bmap entry begins at or above the stop offset,
+		/*
+		 * if the new bmap entry begins at or above the stop offset,
 		 * stop. we are done.
 		 */
 		if (sosig && offset >= stopoffset) {
@@ -4642,7 +4892,8 @@ dump_extent_group(drive_t *drivep,
 			return RV_OK;
 		}
 
-		/* if the new entry begins below the range of
+		/*
+		 * if the new entry begins below the range of
 		 * interest, modify offset to begin at the
 		 * beginning of the range of interest, and shorten
 		 * extsz accordingly.
@@ -4659,7 +4910,8 @@ dump_extent_group(drive_t *drivep,
 		}
 		assert(extsz > 0);
 
-		/* if the resultant extent would put us over maxcnt,
+		/*
+		 * if the resultant extent would put us over maxcnt,
 		 * shorten it, and round up to the next BBSIZE (round
 		 * upto d_miniosz for realtime).
 		 */
@@ -4684,7 +4936,8 @@ dump_extent_group(drive_t *drivep,
 			      maxcnt);
 		}
 
-		/* if the shortened extent is too small, return; we'll
+		/*
+		 * if the shortened extent is too small, return; we'll
 		 * pick it up next time around. exception: if the file
 		 * size is zero, indicate we are done.
 		 * !!! I don't believe this rule can ever fire!
@@ -4705,7 +4958,8 @@ dump_extent_group(drive_t *drivep,
 			return RV_OK;
 		}
 
-		/* if the resultant extent extends beyond the end of the
+		/*
+		 * if the resultant extent extends beyond the end of the
 		 * file, shorten the extent to the nearest BBSIZE alignment
 		 * at or beyond EOF.  (Shorten to d_miniosz for realtime
 		 * files).
@@ -4731,7 +4985,8 @@ dump_extent_group(drive_t *drivep,
 			      statp->bs_size);
 		}
 
-		/* if the extent extends beyond the stop offset,
+		/*
+		 * if the extent extends beyond the stop offset,
 		 * shorten it to the stop offset.
 		 */
 		if (sosig && (extsz > stopoffset - offset)) {
@@ -4747,7 +5002,8 @@ dump_extent_group(drive_t *drivep,
 			      statp->bs_size);
 		}
 
-		/* I/O performance is better if we align the media write
+		/*
+		 * I/O performance is better if we align the media write
 		 * buffer to a page boundary. do this if the extent is
 		 * at least a page in length. Also, necessary for real time
 		 * files
@@ -4759,7 +5015,8 @@ dump_extent_group(drive_t *drivep,
 				cnt_to_align += PGSZ;
 			}
 
-			/* account for the DATA header following the alignment
+			/*
+			 * account for the DATA header following the alignment
 			 */
 			cnt_to_align -= sizeof(extenthdr_t);
 
@@ -4789,13 +5046,15 @@ dump_extent_group(drive_t *drivep,
 			}
 			bytecnt += (off64_t)cnt_to_align;
 		}
-		/* adjust the next offset
+		/*
+		 * adjust the next offset
 		 */
 		assert((offset & (off64_t)(BBSIZE - 1)) == 0);
 		assert((extsz & (off64_t)(BBSIZE - 1)) == 0);
 		nextoffset = offset + extsz;
 
-		/* dump the extent header
+		/*
+		 * dump the extent header
 		 */
 		rv = dump_extenthdr(drivep,
 				     contextp,
@@ -4811,7 +5070,8 @@ dump_extent_group(drive_t *drivep,
 		}
 		bytecnt += sizeof(extenthdr_t);
 
-		/* dump the extent. if read fails to return all
+		/*
+		 * dump the extent. if read fails to return all
 		 * asked for, pad out the extent with zeros. necessary
 		 * because the extent hdr is already out there!
 		 */
@@ -4862,7 +5122,8 @@ dump_extent_group(drive_t *drivep,
 			      actualsz,
 			      nread);
 
-			/* must return entire buffer supplied by call to
+			/*
+			 * must return entire buffer supplied by call to
 			 * do_get_write_buf; so pad end with zeros. below
 			 * we assume the short read implies EOF, so will
 			 * then pad out remainder of extent as well.
@@ -4902,7 +5163,8 @@ dump_extent_group(drive_t *drivep,
 			extsz -= (off64_t)actualsz;
 			offset += (off64_t)actualsz;
 
-			/* if we got a short read, assume we are at the
+			/*
+			 * if we got a short read, assume we are at the
 			 * end of the file; pad out the remainder of the
 			 * extent to match the header.
 			 */
@@ -4931,7 +5193,8 @@ dump_extent_group(drive_t *drivep,
 			}
 		}
 
-		/* made it! advance to the next extent if the current
+		/*
+		 * made it! advance to the next extent if the current
 		 * extent is completely dumped.
 		 * !!! not be necessary, taken care of near the
 		 * !!! top of the loop.
@@ -5231,7 +5494,8 @@ dump_session_inv(drive_t *drivep,
 	bool_t ok;
 	bool_t done;
 
-	/* if the inventory session token is null, skip
+	/*
+	 * if the inventory session token is null, skip
 	 */
 	if (sc_inv_sestoken == INV_TOKEN_NULL) {
 		return BOOL_TRUE;
@@ -5240,7 +5504,8 @@ dump_session_inv(drive_t *drivep,
 	mlog(MLOG_VERBOSE, _(
 	      "dumping session inventory\n"));
 
-	/* get a buffer from the inventory manager
+	/*
+	 * get a buffer from the inventory manager
 	 */
 	inv_sbufp = 0;
 	inv_sbufsz = 0;
@@ -5252,11 +5517,13 @@ dump_session_inv(drive_t *drivep,
 	}
 	assert(inv_sbufp);
 
-	/* modify the write header to indicate the media file type.
+	/*
+	 * modify the write header to indicate the media file type.
 	 */
 	scwhdrp->cih_mediafiletype = CIH_MEDIAFILETYPE_INVENTORY;
 
-	/* loop attempting to write a complete media file,
+	/*
+	 * loop attempting to write a complete media file,
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
@@ -5393,7 +5660,8 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 	off64_t ncommitted;
 	bool_t done;
 
-	/* if the drive doesn't support use of stream terminators, don't bother
+	/*
+	 * if the drive doesn't support use of stream terminators, don't bother
 	 */
 	if (! contextp->cc_Media_useterminatorpr) {
 		return;
@@ -5402,11 +5670,13 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 	mlog(MLOG_VERBOSE, _(
 	      "writing stream terminator\n"));
 
-	/* modify the write header to indicate a terminator
+	/*
+	 * modify the write header to indicate a terminator
 	 */
 	MEDIA_TERMINATOR_SET(mwhdrp);
 
-	/* loop attempting to write a complete media file header
+	/*
+	 * loop attempting to write a complete media file header
 	 * until we are successful or until the media layer
 	 * tells us to give up.
 	 */
@@ -5556,7 +5826,8 @@ inv_cleanup(void)
 	}
 }
 
-/* This function returns with the proper media positioned at the proper place
+/*
+ * This function returns with the proper media positioned at the proper place
  * in the specified drive, with a write header layed down. The caller can
  * immediately dump. The caller is expected to call Media_mfile_end when
  * the media file is complete or EOM is encountered.
@@ -5584,14 +5855,16 @@ Media_mfile_begin(drive_t *drivep, context_t *contextp, bool_t intr_allowed)
 	int rval;
 	bool_t ok;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(BES_INIT == 0);
 
 	mlog(MLOG_DEBUG | MLOG_MEDIA,
 	      "Media op: begin media file\n");
 
-	/* the command line-specified media label is good only for the
+	/*
+	 * the command line-specified media label is good only for the
 	 * first media object written to. after that, the operator will
 	 * be prompted for a label. To enforce this, cc_Media_firstlabel
 	 * is saved in a temp var and NULLed.
@@ -5599,7 +5872,8 @@ Media_mfile_begin(drive_t *drivep, context_t *contextp, bool_t intr_allowed)
 	cmdlinemedialabel = contextp->cc_Media_firstlabel;
 	contextp->cc_Media_firstlabel = 0;
 
-	/* dispatch based on entry state. invalidate entry state to assert
+	/*
+	 * dispatch based on entry state. invalidate entry state to assert
 	 * each Media_mfile_begin is followed by and Media_mfile_end.
 	 */
 	prevmediapresentpr = BOOL_UNKNOWN;
@@ -5638,7 +5912,8 @@ Media_mfile_begin(drive_t *drivep, context_t *contextp, bool_t intr_allowed)
 	}
 
 position:
-	/* loop until we are positioned either at end of recorded data
+	/*
+	 * loop until we are positioned either at end of recorded data
 	 * or at a terminator, as appropriate, of some media object, or hit EOM.
 	 * goto write or changemedia to get out of loop (or return on
 	 * catastrophic condition). ensure that all but the first media file
@@ -5647,17 +5922,20 @@ position:
 	 * contiguous.
 	 */
 	for (;;) {
-		/* check if a stop has been requested
+		/*
+		 * check if a stop has been requested
 		 */
 		if (intr_allowed && cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
-		/* do a begin_read to see the disposition of the drive/media.
+		/*
+		 * do a begin_read to see the disposition of the drive/media.
 		 */
 		rval = (*dop->do_begin_read)(drivep);
 
-		/* update cc_Media_useterminatorpr after every begin_read,
+		/*
+		 * update cc_Media_useterminatorpr after every begin_read,
 		 * since begin_read will cause some unknown drive params
 		 * to be resolved.
 		 */
@@ -5681,7 +5959,8 @@ position:
 			      mrhdrp->mh_mediaix);
 			mlog_unlock();
 
-			/* successfully read media file header.
+			/*
+			 * successfully read media file header.
 			 * we know media must be present in drive, and
 			 * contains at least one valid xfsdump, hence
 			 * is not virgin.
@@ -5690,7 +5969,8 @@ position:
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
-			/* do an end_read. the next begin_read will
+			/*
+			 * do an end_read. the next begin_read will
 			 * position in preparation for appending.
 			 * if terminator, back up, we'll overwrite it.
 			 * also be sure we can append dumps.
@@ -5959,13 +6239,15 @@ erasemedia:
 	goto position;
 
 changemedia:
-	/* if the drive does not support media change, quit.
+	/*
+	 * if the drive does not support media change, quit.
 	 */
 	if (! (dcaps & DRIVE_CAP_REMOVABLE)) {
 		return RV_ERROR;
 	}
 
-	/* first eject the current media object if capability supported
+	/*
+	 * first eject the current media object if capability supported
 	 */
 	assert(mediapresentpr != BOOL_UNKNOWN);
 	if (mediapresentpr == BOOL_TRUE) {
@@ -5977,18 +6259,21 @@ changemedia:
 		}
 	}
 
-	/* if dialogs not allowed, we are done.
+	/*
+	 * if dialogs not allowed, we are done.
 	 */
 	if (! dlog_allowed()) {
 		return RV_QUIT; /* this return value will cause approp. msg */
 	}
 
-	/* If an alert program has been specified, run it
+	/*
+	 * If an alert program has been specified, run it
 	 */
 	if (media_change_alert_program != NULL)
 	   system(media_change_alert_program);
 
-	/* if media change prompt declined or times out,
+	/*
+	 * if media change prompt declined or times out,
 	 * we are done
 	 */
 	if (drivecnt > 1 && ! stdoutpiped) {
@@ -6017,7 +6302,8 @@ changemedia:
 		return RV_QUIT;
 	}
 
-	/* we know nothing about the media after a media change
+	/*
+	 * we know nothing about the media after a media change
 	 */
 	prevmediapresentpr = mediapresentpr;
 	mediapresentpr = BOOL_UNKNOWN;
@@ -6034,7 +6320,8 @@ write:
 		return RV_INTR;
 	}
 
-	/* bump the media header indices here. NOTE: will rescind these
+	/*
+	 * bump the media header indices here. NOTE: will rescind these
 	 * if the subsequent do_begin_write fails. this will be done by
 	 * making a copy of the global write header, and copying it
 	 * back on failure.
@@ -6071,7 +6358,8 @@ write:
 	assert(mwhdrp->mh_mediaix != (uint32_t)(-1));
 	assert(mwhdrp->mh_dumpfileix != (uint32_t)(-1));
 
-	/* do not allow interleaving of media files from different xfsdumps.
+	/*
+	 * do not allow interleaving of media files from different xfsdumps.
 	 */
 	if (mwhdrp->mh_mediaix != 0
 	     &&
@@ -6085,7 +6373,8 @@ write:
 		goto changemedia;
 	}
 
-	/* update the media object previous id and label
+	/*
+	 * update the media object previous id and label
 	 */
 	if (! mediawrittentopr && mwhdrp->mh_dumpfileix != 0) {
 		uuid_copy(mwhdrp->mh_prevmediaid, mwhdrp->mh_mediaid);
@@ -6094,7 +6383,8 @@ write:
 				     sizeof(mwhdrp->mh_medialabel));
 	}
 
-	/* update the media object current id and label
+	/*
+	 * update the media object current id and label
 	 */
 	if (! mediawrittentopr) {
 		if (mwhdrp->mh_mediafileix == 0) {
@@ -6144,7 +6434,8 @@ write:
 
 	mediawrittentopr = BOOL_TRUE;
 
-	/* write hdr is prepared. place it on media
+	/*
+	 * write hdr is prepared. place it on media
 	 */
 	if (intr_allowed && cldmgr_stop_requested()) {
 		return RV_INTR;
@@ -6185,7 +6476,8 @@ Media_mfile_end(drive_t *drivep,
 
 	assert(contextp->cc_Media_begin_entrystate == BES_INVAL);
 
-	/* call drive's end_write op to flush the tail of the media file
+	/*
+	 * call drive's end_write op to flush the tail of the media file
 	 * if has previously hit EOM, this is moot.
 	 */
 	rval = (dop->do_end_write)(drivep, ncommittedp);
@@ -6245,7 +6537,8 @@ retry:
 	assert(preamblecnt <= PREAMBLEMAX);
 	dlog_begin(preamblestr, preamblecnt);
 
-	/* query: ask if overwrite ok
+	/*
+	 * query: ask if overwrite ok
 	 */
 	sprintf(question,
 		 "overwrite data on media in "
@@ -6383,7 +6676,8 @@ retry:
 	assert(preamblecnt <= PREAMBLEMAX);
 	dlog_begin(preamblestr, preamblecnt);
 
-	/* query: ask if overwrite ok
+	/*
+	 * query: ask if overwrite ok
 	 */
 	sprintf(question,
 		 "pre-erase (-%c) option specified "
@@ -6462,7 +6756,8 @@ Media_prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 {
 	drive_t *drivep = (drive_t *)uctxp;
 
-	/* query: ask for a label
+	/*
+	 * query: ask for a label
 	 */
 	(*pcb)(pctxp,
 		   "please enter label for media in "
diff --git a/dump/getopt.h b/dump/getopt.h
index dd798d8..06c9ab0 100644
--- a/dump/getopt.h
+++ b/dump/getopt.h
@@ -18,7 +18,8 @@
 #ifndef GETOPT_H
 #define GETOPT_H
 
-/* getopt.h	common getopt  command string
+/*
+ * getopt.h	common getopt  command string
  *
  * several modules parse the command line looking for arguments specific to
  * that module. Unfortunately, each of the getopt(3) calls needs the
diff --git a/dump/inomap.c b/dump/inomap.c
index ca287d8..7280ad4 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -48,11 +48,13 @@
 /* structure definitions used locally ****************************************/
 
 #define BSTATBUFLEN	pgsz
-	/* length (in bstat_t's) of buf passed to bigstat_iter
+	/*
+	 * length (in bstat_t's) of buf passed to bigstat_iter
 	 */
 
 #define GETDENTBUFSZ	pgsz
-	/* size (in bytes) of buf passed to diriter (when not recursive)
+	/*
+	 * size (in bytes) of buf passed to diriter (when not recursive)
 	 */
 
 /* declarations of externally defined global symbols *************************/
@@ -65,7 +67,8 @@ extern bool_t allowexcludefiles_pr;
 
 /* forward declarations of locally defined static functions ******************/
 
-/* inomap construction callbacks
+/*
+ * inomap construction callbacks
  */
 static int
 cb_context(bool_t last,
@@ -101,14 +104,16 @@ supprt_prune(void *,
 static off64_t quantity2offset(jdm_fshandle_t *, xfs_bstat_t *, off64_t);
 static off64_t estimate_dump_space(xfs_bstat_t *);
 
-/* inomap primitives
+/*
+ * inomap primitives
  */
 static int inomap_init(int igrpcnt);
 static void inomap_add(void *, xfs_ino_t ino, gen_t gen, int);
 static int inomap_set_state(void *, xfs_ino_t ino, int);
 static void inomap_set_gen(void *, xfs_ino_t, gen_t);
 
-/* subtree abstraction
+/*
+ * subtree abstraction
  */
 static int
 subtree_descend_cb(void *,
@@ -142,7 +147,8 @@ static uint64_t inomap_exclude_skipattr = 0;
 
 /* definition of locally defined global functions ****************************/
 
-/* inomap_build - build an in-core image of the inode map for the
+/*
+ * inomap_build - build an in-core image of the inode map for the
  * specified file system. identify startpoints in the non-dir inodes,
  * such that the total dump media required is divided into startptcnt segments.
  */
@@ -174,7 +180,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	int stat;
 	int rval;
 
-        /* do a sync so that bulkstat will pick up inode changes
+        /*
+         * do a sync so that bulkstat will pick up inode changes
          * that are currently in the inode cache. this is necessary
          * for incremental dumps in order to have the dump time
          * accurately reflect what inodes were included in this dump.
@@ -182,13 +189,15 @@ inomap_build(jdm_fshandle_t *fshandlep,
          */
 	sync();
 
-	/* copy stat ptrs
+	/*
+	 * copy stat ptrs
 	 */
 	inomap_statphasep = statphasep;
 	inomap_statpassp = statpassp;
 	inomap_statdonep = statdonep;
 
-	/* allocate a bulkstat buf
+	/*
+	 * allocate a bulkstat buf
 	 */
 	bstatbuflen = BSTATBUFLEN;
 	bstatbufp = (xfs_bstat_t *)memalign(pgsz,
@@ -197,7 +206,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
 					       sizeof(xfs_bstat_t));
 	assert(bstatbufp);
 
-	/* count the number of inode groups, which will serve as a
+	/*
+	 * count the number of inode groups, which will serve as a
 	 * starting point for the size of the inomap.
 	 */
 	rval = inogrp_iter(fsfd, cb_count_inogrp, (void *)&igrpcnt, &stat);
@@ -206,7 +216,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
 		return BOOL_FALSE;
 	}
 
-	/* initialize the callback context
+	/*
+	 * initialize the callback context
 	 */
 	rval = cb_context(last,
 			   lasttime,
@@ -224,7 +235,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
  		return BOOL_FALSE;
  	}
 
-	/* the inode map requires that inodes are added in increasing
+	/*
+	 * the inode map requires that inodes are added in increasing
 	 * ino order. in the case of a subtree dump, inodes would be
 	 * added in whatever order they were discovered when walking the
 	 * subtrees. so pre-populate the inomap with all the inode groups
@@ -238,7 +250,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
  		return BOOL_FALSE;
  	}
 
-	/* construct the ino map, based on the last dump time, resumed
+	/*
+	 * construct the ino map, based on the last dump time, resumed
 	 * dump info, and subtree list. place all unchanged directories
 	 * in the "needed for children" state (MAP_DIR_SUPPRT). these will be
 	 * dumped even though they have not changed. a later pass will move
@@ -297,7 +310,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
 		      inomap_exclude_skipattr);
 	}
 
-	/* prune directories unchanged since the last dump and containing
+	/*
+	 * prune directories unchanged since the last dump and containing
 	 * no children needing dumping.
 	 */
 	if (pruneneeded) {
@@ -329,11 +343,13 @@ inomap_build(jdm_fshandle_t *fshandlep,
 		      "skipping (no pruning necessary)\n"));
 	}
 
-	/* initialize the callback context for startpoint calculation
+	/*
+	 * initialize the callback context for startpoint calculation
 	 */
 	cb_spinit();
 
-	/* identify dump stream startpoints
+	/*
+	 * identify dump stream startpoints
 	 */
 	if (startptcnt > 1) {
 		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
@@ -424,7 +440,8 @@ inomap_skip(xfs_ino_t ino)
 
 /* definition of locally defined static functions ****************************/
 
-/* callback context and operators - inomap_build makes extensive use
+/*
+ * callback context and operators - inomap_build makes extensive use
  * of iterators. below are the callbacks given to these iterators.
  */
 static bool_t cb_last;		/* set by cb_context() */
@@ -447,7 +464,8 @@ static off64_t cb_nondircnt;	/* number of non-dirs CHANGED */
 static bool_t *cb_pruneneededp; /* set by cb_context() */
 static bool_t cb_skip_unchanged_dirs;	/* set by cb_context() */
 
-/* cb_context - initializes the call back context for the add and prune
+/*
+ * cb_context - initializes the call back context for the add and prune
  * phases of inomap_build().
  */
 static int
@@ -501,7 +519,8 @@ cb_count_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 	return 0;
 }
 
-/* cb_add - called for all inodes in the file system. checks
+/*
+ * cb_add - called for all inodes in the file system. checks
  * mod and create times to decide if should be dumped. sets all
  * unmodified directories to be dumped for supprt. notes if any
  * files or directories have not been modified.
@@ -524,13 +543,15 @@ cb_add(void *arg1,
 
 	(*inomap_statdonep)++;
 
-	/* skip if no links
+	/*
+	 * skip if no links
 	 */
 	if (statp->bs_nlink == 0) {
 		return 0;
 	}
 
-	/* if no portion of this ino is in the resume range,
+	/*
+	 * if no portion of this ino is in the resume range,
 	 * then only dump it if it has changed since the interrupted
 	 * dump.
 	 *
@@ -555,7 +576,8 @@ cb_add(void *arg1,
 		changed = BOOL_TRUE;
 	}
 
-	/* this is redundant: make sure any ino partially dumped
+	/*
+	 * this is redundant: make sure any ino partially dumped
 	 * is completed.
 	 */
 	if (cb_resume && cb_inoresumed(ino)) {
@@ -574,7 +596,8 @@ cb_add(void *arg1,
 		} else {
 			estimated_size = estimate_dump_space(statp);
 
-			/* skip if size is greater than prune size. quota
+			/*
+			 * skip if size is greater than prune size. quota
 			 * files are exempt from the check.
 			 */
 			if (maxdumpfilesize > 0 &&
@@ -688,7 +711,8 @@ cb_inoresumed(xfs_ino_t ino)
 	return BOOL_FALSE;
 }
 
-/* supprt_prune -  does supprt directory entry pruning.
+/*
+ * supprt_prune -  does supprt directory entry pruning.
  * recurses downward looking for modified inodes, & clears supprt
  * (-> nochng) on the way back up after examining all descendents.
  */
@@ -781,7 +805,8 @@ cb_accuminit_sz(void)
 	cb_hdrsz = 0;
 }
 
-/* cb_spinit - initializes context for the startpoint calculation phase of
+/*
+ * cb_spinit - initializes context for the startpoint calculation phase of
  * inomap_build. cb_startptix is the index of the next startpoint to
  * record. cb_incr is the dump space distance between each startpoint.
  * cb_target is the target accum value for the next startpoint.
@@ -796,7 +821,8 @@ cb_spinit(void)
 	cb_accum = 0;
 }
 
-/* cb_startpt - called for each non-directory inode. accumulates the
+/*
+ * cb_startpt - called for each non-directory inode. accumulates the
  * require dump space, and notes startpoints. encodes a heuristic for
  * selecting startpoints. decides for each file whether to include it
  * in the current stream, start a new stream beginning with that file,
@@ -829,13 +855,15 @@ cb_startpt(void *arg1,
 
 	(*inomap_statdonep)++;
 
-	/* skip if no links
+	/*
+	 * skip if no links
 	 */
 	if (statp->bs_nlink == 0) {
 		return 0;
 	}
 
-	/* skip if not in inomap or not a non-dir
+	/*
+	 * skip if not in inomap or not a non-dir
 	 */
 	state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
 	if (state != MAP_NDR_CHANGE) {
@@ -847,13 +875,15 @@ cb_startpt(void *arg1,
 	estimate = estimate_dump_space(statp);
 	cb_accum += estimate + (EXTENTHDR_SZ * (statp->bs_extents + 1));
 
-	/* loop until no new start points found. loop is necessary
+	/*
+	 * loop until no new start points found. loop is necessary
 	 * to handle the pathological case of a huge file so big it
 	 * spans several streams.
 	 */
 	action = (action_t)HOLD; /* irrelevant, but demanded by lint */
 	do {
-		/* decide what to do: hold, bump, or split. there are
+		/*
+		 * decide what to do: hold, bump, or split. there are
 		 * 8 valid cases to consider:
 		 * 1) accum prior to this file is way too short of the
 		 *    target, and accum incl. this file is also shy: HOLD;
@@ -907,7 +937,8 @@ cb_startpt(void *arg1,
 			}
 		}
 
-		/* perform the action selected above
+		/*
+		 * perform the action selected above
 		 */
 		switch (action) {
 		case (action_t)HOLD:
@@ -947,10 +978,12 @@ cb_startpt(void *arg1,
 	return 0;
 }
 
-/* map context and operators
+/*
+ * map context and operators
  */
 
-/* define structure for ino to gen mapping.
+/*
+ * define structure for ino to gen mapping.
  */
 struct i2gseg {
 	uint64_t s_valid;
@@ -1047,14 +1080,16 @@ SEG_GET_BITS(seg_t *segp, xfs_ino_t ino)
 	return state;
 }
 
-/* context for inomap construction - initialized by map_init
+/*
+ * context for inomap construction - initialized by map_init
  */
 static int
 inomap_init(int igrpcnt)
 {
 	assert(sizeof(hnk_t) == HNKSZ);
 
-	/* lastseg must be initialized with -1 offsets since
+	/*
+	 * lastseg must be initialized with -1 offsets since
 	 * no segments have been added yet */
 	inomap.lastseg.hnkoff = -1;
 	inomap.lastseg.segoff = -1;
@@ -1118,7 +1153,8 @@ inomap_lastseg(int hnkoff)
 		return SEGPERHNK - 1;
 }
 
-/* called for every inode group in the filesystem in increasing inode
+/*
+ * called for every inode group in the filesystem in increasing inode
  * order. adds a new segment to the inomap and ino-to-gen map.
  */
 static int
@@ -1167,7 +1203,8 @@ cb_add_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 	return 0;
 }
 
-/* called for every ino to be added to the map.
+/*
+ * called for every ino to be added to the map.
  */
 static void
 inomap_add(void *contextp, xfs_ino_t ino, gen_t gen, int state)
@@ -1200,7 +1237,8 @@ inomap_free_context(void *p)
 	free(p);
 }
 
-/* use binary search to find the hunk containing the given inode.
+/*
+ * use binary search to find the hunk containing the given inode.
  * use the supplied addr as the starting point for the search.
  */
 static bool_t
@@ -1230,7 +1268,8 @@ inomap_find_hnk(seg_addr_t *addrp, xfs_ino_t ino)
 	return BOOL_FALSE;
 }
 
-/* use binary search to find the hunk containing the given
+/*
+ * use binary search to find the hunk containing the given
  * inode, and then binary search the hunk to find the correct
  * segment, if any. use the supplied addr as the starting
  * point for the search.
@@ -1413,7 +1452,8 @@ inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen)
 void
 inomap_writehdr(content_inode_hdr_t *scwhdrp)
 {
-	/* update the inomap info in the content header
+	/*
+	 * update the inomap info in the content header
 	 */
 	scwhdrp->cih_inomap_hnkcnt = inomap.lastseg.hnkoff + 1;
 	scwhdrp->cih_inomap_segcnt = inomap_addr2segix(&inomap.lastseg) + 1;
@@ -1431,7 +1471,8 @@ inomap_dump(drive_t *drivep)
 	hnk_t *hnkp;
 	hnk_t tmphnkp;
 
-	/* use write_buf to dump the hunks
+	/*
+	 * use write_buf to dump the hunks
 	 */
 	for (addr.hnkoff = 0;
 	      addr.hnkoff <= inomap.lastseg.hnkoff;
@@ -1484,11 +1525,13 @@ subtreelist_parse(jdm_fshandle_t *fshandlep,
 {
 	ix_t subtreeix;
 
-	/* add the root ino to the dump
+	/*
+	 * add the root ino to the dump
 	 */
 	cb_add(NULL, fshandlep, fsfd, rootstatp);
 
-	/* do a recursive descent for each subtree specified
+	/*
+	 * do a recursive descent for each subtree specified
 	 */
 	for (subtreeix = 0; subtreeix < subtreecnt; subtreeix++) {
 		int cbrval = 0;
@@ -1524,18 +1567,21 @@ subtreelist_parse_cb(void *arg1,
 {
 	int cbrval = 0;
 
-	/* arg1 is used to carry the tail of the subtree path
+	/*
+	 * arg1 is used to carry the tail of the subtree path
 	 */
 	char *subpath = (char *)arg1;
 
-	/* temporarily terminate the subpath at the next slash
+	/*
+	 * temporarily terminate the subpath at the next slash
 	 */
 	char *nextslash = strchr(subpath, '/');
 	if (nextslash) {
 		*nextslash = 0;
 	}
 
-	/* if the first element of the subpath doesn't match this
+	/*
+	 * if the first element of the subpath doesn't match this
 	 * directory entry, try the next entry.
 	 */
 	if (strcmp(subpath, name)) {
@@ -1545,13 +1591,15 @@ subtreelist_parse_cb(void *arg1,
 		return 0;
 	}
 
-	/* it matches, so add ino to list and continue down the path
+	/*
+	 * it matches, so add ino to list and continue down the path
 	 */
 	cb_add(NULL, fshandlep, fsfd, statp);
 
 	if (nextslash) {
 
-		/* if we're not at the end of the path, yet the current
+		/*
+		 * if we're not at the end of the path, yet the current
 		 * path element is not a directory, complain and abort the
 		 * iteration in a way which terminates the application
 		 */
@@ -1560,11 +1608,13 @@ subtreelist_parse_cb(void *arg1,
 			return 2;
 		}
 
-		/* repair the subpath
+		/*
+		 * repair the subpath
 		*/
 		*nextslash = '/';
 
-		/* peel the first element of the subpath and recurse
+		/*
+		 * peel the first element of the subpath and recurse
 		*/
 		(void)diriter(fshandlep,
 				 fsfd,
@@ -1577,7 +1627,8 @@ subtreelist_parse_cb(void *arg1,
 		return cbrval;
 
 	} else {
-		/* we've reached the specified subpath, so if we're
+		/*
+		 * we've reached the specified subpath, so if we're
 		 * at a directory, recurse down and add all children
 		 * to the inomap.
 		 */
@@ -1624,7 +1675,8 @@ subtree_descend_cb(void *arg1,
 	return cbrval;
 }
 
-/* uses the extent map to figure the first offset in the file
+/*
+ * uses the extent map to figure the first offset in the file
  * with qty real (non-hole) bytes behind it
  */
 #define BMAP_LEN	512
@@ -1638,7 +1690,8 @@ quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 	off64_t offset_next;
 	off64_t qty_accum;
 
-	/* If GETOPT_DUMPASOFFLINE was specified and the HSM provided an
+	/*
+	 * If GETOPT_DUMPASOFFLINE was specified and the HSM provided an
 	 * estimate, then use it.
 	 */
 
@@ -1709,14 +1762,16 @@ estimate_dump_space(xfs_bstat_t *statp)
 {
 	switch (statp->bs_mode & S_IFMT) {
 	case S_IFREG:
-		/* very rough: must improve this.  If GETOPT_DUMPASOFFLINE was
+		/*
+		 * very rough: must improve this.  If GETOPT_DUMPASOFFLINE was
 		 * specified and the HSM provided an estimate, then use it.
 		 */
 		if (hsm_fs_ctxtp) {
 			off64_t	bytes;
 			int accurate;
 
-			/* if -z or multiple streams are being used,
+			/*
+			 * if -z or multiple streams are being used,
 			 * we need an accurate estimate. otherwise a
 			 * quick estimate will do.
 			 */
@@ -1735,7 +1790,8 @@ estimate_dump_space(xfs_bstat_t *statp)
 	case S_IFBLK:
 	case S_IFSOCK:
 	case S_IFLNK:
-	/* not yet
+	/*
+	 * not yet
 	case S_IFUUID:
 	*/
 		return 0;
diff --git a/dump/inomap.h b/dump/inomap.h
index 64b769a..b9619f6 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -18,7 +18,8 @@
 #ifndef INOMAP_H
 #define INOMAP_H
 
-/* inomap.[hc] - inode map abstraction
+/*
+ * inomap.[hc] - inode map abstraction
  *
  * an inode map describes the inode numbers (inos) in a file system dump.
  * the map identifies which inos are in-use by the fs, which of those are
@@ -31,7 +32,8 @@
  */
 struct xfs_bstat;
 
-/* inomap_build - this function allocates and constructs an in-memory
+/*
+ * inomap_build - this function allocates and constructs an in-memory
  * representation of the bitmap. it prunes from the map inos of files not
  * changed since the last dump, inos not identified by the subtree list,
  * and directories not needed to represent a hierarchy containing
@@ -68,25 +70,29 @@ extern bool_t inomap_build(void *fshandlep,
 
 extern uint64_t inomap_getsz(void);
 
-/* inomap_skip - tell inomap about inodes to skip in the dump
+/*
+ * inomap_skip - tell inomap about inodes to skip in the dump
  */
 extern void inomap_skip(xfs_ino_t ino);
 
 
-/* inomap_writehdr - updates the write header with inomap-private info
+/*
+ * inomap_writehdr - updates the write header with inomap-private info
  * to be communicated to the restore side
  */
 extern void inomap_writehdr(content_inode_hdr_t *scwhdrp);
 
 
-/* inomap_dump - dumps the map to media - content-abstraction-knowledgable
+/*
+ * inomap_dump - dumps the map to media - content-abstraction-knowledgable
  *
  * returns error from media write op
  */
 extern rv_t inomap_dump(drive_t *drivep);
 
 
-/* map state values
+/*
+ * map state values
  */
 #define MAP_INO_UNUSED	0       /* ino not in use by fs */
 #define MAP_DIR_NOCHNG	1       /* dir, ino in use by fs, but not dumped */
@@ -97,7 +103,8 @@ extern rv_t inomap_dump(drive_t *drivep);
 #define MAP_RESERVED1	6       /* this state currently not used */
 #define MAP_RESERVED2	7       /* this state currently not used */
 
-/* the inomap is implemented as a linked list of chunks. each chunk contains
+/*
+ * the inomap is implemented as a linked list of chunks. each chunk contains
  * an array of map segments. a map segment contains a start ino and a
  * bitmap of 64 3-bit state values (see MAP_... in inomap.h). the SEG_macros
  * index and manipulate the 3-bit state values.
@@ -125,7 +132,8 @@ struct hnk {
 
 typedef struct hnk hnk_t;
 
-/* functions to get state and gen information from the inomap.
+/*
+ * functions to get state and gen information from the inomap.
  * requires a pointer to a context block, obtained from
  * inomap_alloc_context(), and released by inomap_free_context().
  */
@@ -136,7 +144,8 @@ extern int inomap_get_state(void *contextp, xfs_ino_t ino);
 extern int inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen);
 
 
-/* generators returning the next dir or non-dir ino selected in this dump.
+/*
+ * generators returning the next dir or non-dir ino selected in this dump.
  * returns INO64MAX when no more inos.
  * requires a pointer to a context block, obtained from
  * inomap_alloc_context(), and released by inomap_free_context().
diff --git a/dump/var.c b/dump/var.c
index 8ea38af..a195693 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -85,7 +85,8 @@ var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino))
 	uuid_t fsid;
 	int rval;
 
-	/* see if the fs uuid's match
+	/*
+	 * see if the fs uuid's match
 	 */
 	rval = fs_getid(XFSDUMP_DIRPATH, &fsid);
 	if (rval) {
@@ -105,7 +106,8 @@ var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino))
 		return;
 	}
 
-	/* traverse the xfsdump directory, getting inode numbers of it
+	/*
+	 * traverse the xfsdump directory, getting inode numbers of it
 	 * and all of its children, and reporting those to the callback.
 	 */
 	var_skip_recurse(XFSDUMP_DIRPATH, cb);
@@ -149,7 +151,8 @@ var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 	while ((direntp = readdir(dirp)) != NULL) {
 		char *path;
 
-		/* skip "." and ".."
+		/*
+		 * skip "." and ".."
 		 */
 		if (*(direntp->d_name + 0) == '.'
 		     &&
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 14/24] xfsdump: (3/4)(style) add first empty line for multiline comments
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (9 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 13/24] xfsdump: (2/4)(style) add first empty line for multiline comments Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 15/24] xfsdump: (4/4)(style) " Jan Tulak
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Change the multiline comment style from /* foo to /*
 * foo

Created by this script:

#!/usr/bin/env bash
# change the multiline comment style from /* foo to /*
 * foo

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/^\(\s*\)\/\* \(.\+[^*][^/]\)$/\1\/*
\1 * \2/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 restore/bag.c     |    9 +-
 restore/bag.h     |   27 +-
 restore/content.c | 1368 ++++++++++++++++++++++++++++++---------------
 restore/dirattr.c |  156 ++++--
 restore/dirattr.h |   30 +-
 restore/getopt.h  |    3 +-
 restore/inomap.c  |  132 +++--
 restore/inomap.h  |    9 +-
 restore/namreg.c  |   99 ++--
 restore/namreg.h  |   21 +-
 restore/node.c    |  135 +++--
 restore/node.h    |   21 +-
 restore/tree.c    |  762 ++++++++++++++++---------
 restore/tree.h    |   33 +-
 restore/win.c     |   93 ++-
 restore/win.h     |   12 +-
 16 files changed, 1940 insertions(+), 970 deletions(-)

diff --git a/restore/bag.c b/restore/bag.c
index 8a8bda4..e209bfc 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -146,18 +146,21 @@ bagiter_next(bagiter_t *iterp, void **payloadpp)
 {
 	bagelem_t *returnp;
 
-	/* termination condition
+	/*
+	 * termination condition
 	 */
 	if (! iterp->bi_nextp) {
 		*payloadpp = 0;
 		return 0;
 	}
 
-	/* save the element to be returned
+	/*
+	 * save the element to be returned
 	 */
 	returnp = iterp->bi_nextp;
 
-	/* calculate next. if returning last, set next to NULL
+	/*
+	 * calculate next. if returning last, set next to NULL
 	 */
 	if (iterp->bi_nextp == iterp->bi_lastp) {
 		iterp->bi_nextp = 0;
diff --git a/restore/bag.h b/restore/bag.h
index c2aef2c..67ba30c 100644
--- a/restore/bag.h
+++ b/restore/bag.h
@@ -18,7 +18,8 @@
 #ifndef BAG_H
 #define BAG_H
 
-/* bag.[hc] - bag abstraction
+/*
+ * bag.[hc] - bag abstraction
  *
  * user embeds a bagelem_t into items to be bagged. the element contains
  * an element key, and a user-specified pointer. items can be inserted
@@ -43,11 +44,13 @@ struct bag {
 
 typedef struct bag bag_t;
 
-/* creates a new bag
+/*
+ * creates a new bag
  */
 extern bag_t *bag_alloc(void);
 
-/* insert the item into the bag. the caller supplies a search key
+/*
+ * insert the item into the bag. the caller supplies a search key
  * and arbitrary payload.
  */
 extern void bag_insert(bag_t *bagp,
@@ -55,7 +58,8 @@ extern void bag_insert(bag_t *bagp,
 			size64_t key,
 			void *payloadp);
 
-/* remove the item from the bag. the key and payload originally supplied
+/*
+ * remove the item from the bag. the key and payload originally supplied
  * to the insert operator are returned by reference.
  */
 extern void bag_remove(bag_t *bagp,
@@ -63,7 +67,8 @@ extern void bag_remove(bag_t *bagp,
 			size64_t *keyp,
 			void **payloadpp);
 
-/* search by key for an element in the bag.
+/*
+ * search by key for an element in the bag.
  * returns the element pointer if a matching item is found, as well as
  * the payload (by reference). if the item is not in the bag, returns
  * a null pointer and (by reference) payload.
@@ -72,7 +77,8 @@ extern bagelem_t *bag_find(bag_t *bagp,
 			    size64_t key,
 			    void **payloadpp);
 
-/* private bag iterator
+/*
+ * private bag iterator
  */
 struct bagiter {
 	bag_t *bi_bagp;
@@ -82,16 +88,19 @@ struct bagiter {
 
 typedef struct bagiter bagiter_t;
 
-/* initializes a bag iterator
+/*
+ * initializes a bag iterator
  */
 extern void bagiter_init(bag_t *bagp, bagiter_t *iterp);
 
-/* returns the next element in the bag. caller may remove the element
+/*
+ * returns the next element in the bag. caller may remove the element
  * prior to the next call.
  */
 extern bagelem_t * bagiter_next(bagiter_t *iterp, void **payloadpp);
 
-/* destroys the bag.
+/*
+ * destroys the bag.
  */
 extern void bag_free(bag_t *bagp);
 
diff --git a/restore/content.c b/restore/content.c
index b616eda..a97d9e3 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -71,60 +71,74 @@
 #include "win.h"
 #include "hsmapi.h"
 
-/* content.c - manages restore content
+/*
+ * content.c - manages restore content
  */
 
 /* structure definitions used locally ****************************************/
 
 #define HOUSEKEEPING_MAGIC	0x686b6d61
-	/* "hkma" - see the housekeeping_magic field of pers_t below.
+	/*
+	 * "hkma" - see the housekeeping_magic field of pers_t below.
 	 */
 #define HOUSEKEEPING_VERSION	2
-	/* see the housekeeping_version field of pers_t below.
+	/*
+	 * see the housekeeping_version field of pers_t below.
 	 * version 2 changed the size of a gen_t, which caused node_t
 	 * to change in size. also p_truncategenpr was added to treepers_t.
 	 */
 
 #define WRITE_TRIES_MAX	3
-	/* retry loop tuning for write(2) workaround
+	/*
+	 * retry loop tuning for write(2) workaround
 	 */
 typedef enum { SYNC_INIT, SYNC_BUSY, SYNC_DONE } sync_t;
-	/* for lock-step synchronization
+	/*
+	 * for lock-step synchronization
 	 */
 typedef struct { xfs_ino_t eg_ino; off64_t eg_off; } egrp_t;
-	/* extent group descriptor
+	/*
+	 * extent group descriptor
 	 */
 typedef char label_t[GLOBAL_HDR_STRING_SZ];
-	/* dump or mobj label
+	/*
+	 * dump or mobj label
 	 */
 typedef enum { PURP_SEARCH, PURP_DIR, PURP_NONDIR } purp_t;
-	/* to describe purpose for a media file request. may be for
+	/*
+	 * to describe purpose for a media file request. may be for
 	 * searching for a dump to restore, for dir restore, or non-dir
 	 */
 typedef off_t dh_t;
-	/* handles for descriptors in persistent state inventory
+	/*
+	 * handles for descriptors in persistent state inventory
 	 * 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)
-	/* NULL inv. descriptor handles, to terminate linked descriptor lists.
+	/*
+	 * 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)))
-	/* convert file, object, and stream inv. descriptor handle into
+	/*
+	 * convert file, object, and stream inv. descriptor handle into
 	 * descriptor pointers
 	 */
 #define DAU		1
-	/* number of descriptor pages to allocate when free list exhausted
+	/*
+	 * number of descriptor pages to allocate when free list exhausted
 	 */
 #define IBPGINCR	32
-	/* session inv. restore retry buffer increment
+	/*
+	 * session inv. restore retry buffer increment
 	 */
 
-/* Media state abstraction
+/*
+ * Media state abstraction
  */
 struct Media {
 	drive_t *M_drivep;
@@ -142,7 +156,8 @@ struct Media {
 	       POS_USELESS,	/* current object contains nothing useful */
 	       POS_BLANK	/* like useless */
 	} M_pos;
-		/* media positioning info. initially UNKN, set back to
+		/*
+		 * media positioning info. initially UNKN, set back to
 		 * unkn whenever end_read op called.
 		 */
 	ix_t M_fmfix;
@@ -151,7 +166,8 @@ struct Media {
 	bool_t M_pmfixvalpr;
 	purp_t M_mfixpurp;
 	bool_t M_flmfixvalpr;
-		/* the indices within the current media object of the first
+		/*
+		 * the indices within the current media object of the first
 		 * and last media files seen, as well as previous last.
 		 * invalidated whenever purpose changes or media is changed.
 		 * previous (pmfix) not valid until second media file seen.
@@ -160,7 +176,8 @@ struct Media {
 	ix_t M_fsoix;
 	ix_t M_fssix;
 	bool_t M_fsfixvalpr;
-		/* index within the current media object of the first
+		/*
+		 * index within the current media object of the first
 		 * media file that is part of dump being restored,
 		 * and indices of the obj and stream containing that mfile.
 		 * invalidated on media change.
@@ -170,155 +187,192 @@ struct Media {
 typedef struct Media Media_t;
 
 
-/* persistent state - mmapped, has linked lists of dump streams, media
+/*
+ * persistent state - mmapped, has linked lists of dump streams, media
  * objects, and media files. descriptors for each fit into PERS_DESCSZ
  * bytes, and are allocated from a common free pool.
  */
 
-/* persistent media file descriptor
+/*
+ * persistent media file descriptor
  */
 struct pers_file {
 	dh_t f_nexth;
-		/* singly-linked list of files withing object
+		/*
+		 * singly-linked list of files withing object
 		 */
 	dh_t f_parh;
-		/* parent object
+		/*
+		 * parent object
 		 */
 	bool_t f_szvalpr;
 	off64_t f_sz;
-		/* if this info came from an inventory (on-line or on-media),
+		/*
+		 * if this info came from an inventory (on-line or on-media),
 		 * we know the media file size
 		 */
 	bool_t f_dirtriedpr;
-		/* set if attempted to restore dirs from this media file.
+		/*
+		 * set if attempted to restore dirs from this media file.
 		 * says nothing about success or failure. prevents us from
 		 * trying to restore dirs from this media file again.
 		 */
 	bool_t f_valpr;
-		/* following three fields are valid
+		/*
+		 * following three fields are valid
 		 */
 	egrp_t f_firstegrp;
-		/* first extent group in this media file
+		/*
+		 * first extent group in this media file
 		 */
 	egrp_t f_curegrp;
-		/* next extent group to be restored from this media file.
+		/*
+		 * next extent group to be restored from this media file.
 		 * initially equals f_firstegrp.
 		 */
 	drive_mark_t f_curmark;
-		/* drive manager mark for seeking to current extent group
+		/*
+		 * drive manager mark for seeking to current extent group
 		 */
 	bool_t f_nondirdonepr;
-		/* TRUE when non-dirs from this media file completely restored,
+		/*
+		 * TRUE when non-dirs from this media file completely restored,
 		 * or as restored as they can be (some or all lost due to
 		 * media corruption).
 		 */
 	bool_t f_nondirskippr;
-		/* no non-dirs are needed from this nmedia file (due to
+		/*
+		 * no non-dirs are needed from this nmedia file (due to
 		 * subtree or interactive selections)
 		 */
 	int f_flags;
-		/* mark terminators and inventories
+		/*
+		 * mark terminators and inventories
 		 */
 	bool_t f_underheadpr;
-		/* the drive is currently positioned at or in this media file
+		/*
+		 * the drive is currently positioned at or in this media file
 		 */
 };
 
-/* f_flags
+/*
+ * f_flags
  */
 #define PF_INV	(1 << 0)
 #define PF_TERM	(1 << 1)
 
 typedef struct pers_file pers_file_t;
 
-/* persistent media object descriptor
+/*
+ * persistent media object descriptor
  */
 struct pers_obj {
 	dh_t o_nexth;
-		/* singly-linked list of objects in stream
+		/*
+		 * singly-linked list of objects in stream
 		 */
 	dh_t o_parh;
-		/* parent dump stream descriptor
+		/*
+		 * parent dump stream descriptor
 		 */
 	dh_t o_cldh;
-		/* head of list of pertinent media files contained in
+		/*
+		 * head of list of pertinent media files contained in
 		 * this media object
 		 */
 	bool_t o_idlabvalpr;
-		/* id and label fields are valid
+		/*
+		 * id and label fields are valid
 		 */
 	uuid_t o_id;
-		/* uuid of media object
+		/*
+		 * uuid of media object
 		 */
 	label_t o_lab;
-		/* label of media object
+		/*
+		 * label of media object
 		 */
 	ix_t o_fmfmix;
 	bool_t o_fmfmixvalpr;
-		/* 0-based index into this mobj's mfiles of first
+		/*
+		 * 0-based index into this mobj's mfiles of first
 		 * mfile in the mobj that is part of the dump stream.
 		 */
 	ix_t o_fmfsix;
 	bool_t o_fmfsixvalpr;
-		/* 0-based index into this dump stream's mfiles of first
+		/*
+		 * 0-based index into this dump stream's mfiles of first
 		 * mfile in the mobj that is part of the dump stream.
 		 */
 	bool_t o_lmfknwnpr;
-		/* TRUE if last media file on object is represented in
+		/*
+		 * TRUE if last media file on object is represented in
 		 * children list.
 		 */
 	bool_t o_indrivepr;
 	ix_t o_indriveix;
-		/* TRUE if this object is in a drive, and which drive it is
+		/*
+		 * TRUE if this object is in a drive, and which drive it is
 		 * in.
 		 */
 };
 
 typedef struct pers_obj pers_obj_t;
 
-/* media dump stream descriptor
+/*
+ * media dump stream descriptor
  */
 struct pers_strm {
 	dh_t s_nexth;
-		/* singly-linked list of streams generated by dump
+		/*
+		 * singly-linked list of streams generated by dump
 		 */
 	dh_t s_cldh;
-		/* head of list of mobjs containing this dstrm's mfiles
+		/*
+		 * head of list of mobjs containing this dstrm's mfiles
 		 */
 	bool_t s_lastobjknwnpr;
-		/* TRUE if if last object in the stream is represented in
+		/*
+		 * TRUE if if last object in the stream is represented in
 		 * children list.
 		 */
 };
 
 typedef struct pers_strm pers_strm_t;
 
-/* media descriptor allocation object (for free list)
+/*
+ * media descriptor allocation object (for free list)
  */
 union pers_desc {
 	dh_t d_nexth;
-		/* singly-linked free list of descriptors
+		/*
+		 * singly-linked free list of descriptors
 		 */
 	pers_file_t d_file;
-		/* media file descriptor overlay;
+		/*
+		 * media file descriptor overlay;
 		 */
 	pers_obj_t d_obj;
-		/* media object descriptor overlay;
+		/*
+		 * media object descriptor overlay;
 		 */
 	pers_strm_t d_strm;
-		/* media stream descriptor overlay;
+		/*
+		 * media stream descriptor overlay;
 		 */
 };
 
 typedef union pers_desc pers_desc_t;
 
 #define PERS_DESCSZ	512
-	/* size of media object, media file, and media stream descriptors.
+	/*
+	 * size of media object, media file, and media stream descriptors.
 	 * need to fit integral number into a page, single allocator
 	 * used allocate and free all types .
 	 */
 
-/* subtree descriptor - the subtree command line arguments are transcribed
+/*
+ * subtree descriptor - the subtree command line arguments are transcribed
  * into variable-length descriptors and placed in an integral number of
  * pages after the persistent header, and before the media descriptor free list.
  */
@@ -326,20 +380,24 @@ typedef union pers_desc pers_desc_t;
 
 struct stdesc {
 	bool_t std_sensepr;
-		/* TRUE if this is a subtree to INCLUDE, FALSE if EXCLUDE
+		/*
+		 * TRUE if this is a subtree to INCLUDE, FALSE if EXCLUDE
 		 */
 	off_t std_nextoff;
-		/* offset to next descriptor, in bytes relative to this
+		/*
+		 * offset to next descriptor, in bytes relative to this
 		 */
 	char std_path[1];
-		/* first character of a NULL-terminated string containing the
+		/*
+		 * first character of a NULL-terminated string containing the
 		 * the relative subtree pathname
 		 */
 };
 
 typedef struct stdesc stdesc_t;
 
-/* byte span descriptor - registers a span of a file restored.
+/*
+ * byte span descriptor - registers a span of a file restored.
  */
 struct bytespan {
 	off64_t	offset;
@@ -348,14 +406,16 @@ struct bytespan {
 
 typedef struct bytespan bytespan_t;
 
-/* partial restore descriptor - Keeps track of different byte spans restored
+/*
+ * partial restore descriptor - Keeps track of different byte spans restored
  * for a specific inode.  Used to sync operations between restore streams.
  */
 struct partial_rest {
 	xfs_ino_t	is_ino;
 		/* inode number */
 	bytespan_t is_bs[STREAM_SIMMAX];
-		/* each stream could conceivably be writing to a single
+		/*
+		 * each stream could conceivably be writing to a single
 		 * file simultaneously if one file spans all device streams.
 		 * Need a record for each possible place in the file.
 		 */
@@ -381,14 +441,16 @@ struct stream_context {
 
 typedef struct stream_context stream_context_t;
 
-/* persistent state file header - on-disk format information plus
+/*
+ * persistent state file header - on-disk format information plus
  * accumulation state (which spans several sessions) and session state.
  * the latter two have a valid bit, and their fields are not valid until
  * the valid bit is set. all elements defined such that a bzero results
  * in a valid initial state.
  */
 struct pers {
-	/* on-disk format information used to verify that xfsrestore
+	/*
+	 * on-disk format information used to verify that xfsrestore
 	 * can make sense of the data in xfsrestorehousekeepingdir
 	 * when running in cumulative mode or when resuming a restore.
 	 *
@@ -398,7 +460,8 @@ struct pers {
 	 */
 	struct {
 		size32_t housekeeping_magic;
-			/* used to determine if this struct has been
+			/*
+			 * used to determine if this struct has been
 			 * initialized, and whether the machine's
 			 * endianness is the same as the previous
 			 * invocation. (data written to xfsrestore's
@@ -407,23 +470,27 @@ struct pers {
 			 * for the life of one or more restore sessions.)
 			 */
 		size32_t housekeeping_version;
-			/* version of the data structures used in the
+			/*
+			 * version of the data structures used in the
 			 * state files in housekeepingdir. this must be
 			 * bumped whenever the on-disk format changes.
 			 */
 		size64_t pagesize;
-			/* headers in the persistent state files
+			/*
+			 * headers in the persistent state files
 			 * are aligned on page size boundaries, so
 			 * this cannot change betweeen invocations.
 			 */
 	} v;
 
-	/* command line arguments from first session, and session
+	/*
+	 * command line arguments from first session, and session
 	 * history.
 	 */
 	struct {
 		bool_t valpr;
-			/* not set until a BASE dump has been identified
+			/*
+			 * not set until a BASE dump has been identified
 			 * and validated for restoral, and an attempt has
 			 * been made to load the dump inventory into persistent
 			 * state, and the namreg and tree abstractions
@@ -431,66 +498,84 @@ struct pers {
 			 * has been initialized and validated.
 			 */
 		char dstdir[MAXPATHLEN];
-			/* absolute pathname of the destination directory
+			/*
+			 * absolute pathname of the destination directory
 			 */
 		bool_t dstdirisxfspr;
-			/* destination directory is an xfs filesystem; xfs-specific
+			/*
+			 * destination directory is an xfs filesystem; xfs-specific
 			 * calls can be made when needed.
 			 */
 		ix_t dumpcnt;
-			/* how many dumps have been applied completedly (A1)
+			/*
+			 * how many dumps have been applied completedly (A1)
 			 */
 		uuid_t lastdumpid;
-			/* uuid of the last dump completely restored (A1)
+			/*
+			 * uuid of the last dump completely restored (A1)
 			 */
 		label_t lastdumplab;
-			/* label of the last dump completely restored (A1)
+			/*
+			 * label of the last dump completely restored (A1)
 			 */
 		bool_t cumpr;
-			/* is a cumulative restore (-r)
+			/*
+			 * is a cumulative restore (-r)
 			 */
 		bool_t interpr;
-			/* interactive mode specified on command line (-i)
+			/*
+			 * interactive mode specified on command line (-i)
 			 */
 		bool_t existpr;
-			/* existing files may not be overwritten (-e)
+			/*
+			 * existing files may not be overwritten (-e)
 			 */
 		bool_t changepr;
-			/* only missing or old files may be overwritten (-E)
+			/*
+			 * only missing or old files may be overwritten (-E)
 			 */
 		bool_t newerpr;
 		time32_t newertime;
-			/* only files older than example may be overwritten (-n)
+			/*
+			 * only files older than example may be overwritten (-n)
 			 */
 		bool_t ownerpr;
-			/* attempt to restore owner/group (-o)
+			/*
+			 * attempt to restore owner/group (-o)
 			 */
 		ix_t stcnt;
-			/* how many subtree args (both inclusive and exclusive)
+			/*
+			 * how many subtree args (both inclusive and exclusive)
 			 * are recorded in the subtree pages (-s)
 			 */
 		bool_t firststsensepr;
 		bool_t firststsenseprvalpr;
-			/* sense of first subtree arg
+			/*
+			 * sense of first subtree arg
 			 */
 		ix_t stpgcnt;
-			/* how many pages following the header page are reserved
+			/*
+			 * how many pages following the header page are reserved
 			 * for the subtree descriptors
 			 */
 		bool_t restoredmpr;
-			/* restore DMAPI event settings
+			/*
+			 * restore DMAPI event settings
 			 */
 		bool_t restoreextattrpr;
-			/* restore extended attributes
+			/*
+			 * restore extended attributes
 			 */
 
 		ix_t parrestcnt;
-			/* Count of partialy restored files.  Used to speed
+			/*
+			 * Count of partialy restored files.  Used to speed
 			 * up searches in parrest.
 			 */
 
 		partial_rest_t parrest[STREAM_SIMMAX * 2 - 2];
-			/* record of bytes restored to partially restored files.
+			/*
+			 * 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
 			 * last drive will never leave a file for another to
@@ -498,11 +583,13 @@ struct pers {
 			 */
 	} a;
 
-	/* session state.
+	/*
+	 * session state.
 	 */
 	struct {
 		bool_t valpr;
-			/* until this is true, a resume will ignore (and bzero)
+			/*
+			 * until this is true, a resume will ignore (and bzero)
 			 * this structure. validate just prior to applying
 			 * the directory dump, and after all fields marked (A2)
 			 * are correct. invalidate as soon as the session is
@@ -511,163 +598,206 @@ struct pers {
 			 * initialized prior to setting this.
 			 */
 		time32_t accumtime;
-			/* for measuring elapsed time of restore
+			/*
+			 * for measuring elapsed time of restore
 			 */
 		uuid_t dumpid;
-			/* id of dump currently being applied
+			/*
+			 * id of dump currently being applied
 			 */
 		label_t dumplab;
-			/* label of the dump being applied (A2)
+			/*
+			 * label of the dump being applied (A2)
 			 */
 		time32_t begintime;
-			/* set when session begun and each time resumed
+			/*
+			 * set when session begun and each time resumed
 			 */
 		bool_t stat_valpr;
-			/* the following stats are not valid until the
+			/*
+			 * the following stats are not valid until the
 			 * first media file header has been read.
 			 */
 		uint64_t stat_inocnt;
-			/* number of non-dir inos to restore during session
+			/*
+			 * number of non-dir inos to restore during session
 			 */
 		uint64_t stat_inodone;
-			/* number of non-dir inos restored so far
+			/*
+			 * number of non-dir inos restored so far
 			 */
 		off64_t stat_datacnt;
-			/* bytes of ordinary files to restore during session
+			/*
+			 * bytes of ordinary files to restore during session
 			 */
 		off64_t stat_datadone;
-			/* bytes of ordinary files restored so far
+			/*
+			 * bytes of ordinary files restored so far
 			 */
 		ix_t descpgcnt;
-			/* number of pages mapped for pers. media descriptors
+			/*
+			 * number of pages mapped for pers. media descriptors
 			 */
 		dh_t descfreeh;
-			/* linked list of free media descriptor alloc objs (A2)
+			/*
+			 * linked list of free media descriptor alloc objs (A2)
 			 */
 		dh_t strmheadh;
-			/* head of singly-linked list of stream descriptors (A2)
+			/*
+			 * head of singly-linked list of stream descriptors (A2)
 			 */
 		bool_t fullinvpr;
-			/* have discovered and incorporated a full inventory
+			/*
+			 * have discovered and incorporated a full inventory
 			 * description into pers. may come from online or a
 			 * inventory media file.
 			 */
 		bool_t marknorefdonepr;
-			/* have marked tree nodes as unreferenced by directory
+			/*
+			 * have marked tree nodes as unreferenced by directory
 			 * entries, and nulled  dirattr handles.
 			 */
 		bool_t dirdonepr;
-			/* have applied all directories from a dirdump.
+			/*
+			 * have applied all directories from a dirdump.
 			 */
 		bool_t adjrefdonepr;
-			/* have adjusted marking of nodes no longer referenced
+			/*
+			 * have adjusted marking of nodes no longer referenced
 			 * by directory entries.
 			 */
 		bool_t inomapsanitizedonepr;
-			/* the inomap needs to b sanitized prior to subtree
+			/*
+			 * the inomap needs to b sanitized prior to subtree
 			 * or interactive selections
 			 */
 		bool_t stdonepr;
-			/* have applied subtree selections
+			/*
+			 * have applied subtree selections
 			 */
 		bool_t interdonepr;
-			/* have completed interactive subtree dialog
+			/*
+			 * have completed interactive subtree dialog
 			 */
 		bool_t treepostdonepr;
-			/* all of the above treep ost-processing steps have
+			/*
+			 * all of the above treep ost-processing steps have
 			 * been completed.
 			 */
 			/*
 			 * nondir restore done here
 			 */
 		bool_t dirattrdonepr;
-			/* directory attributes have been restored and
+			/*
+			 * directory attributes have been restored and
 			 * directory attributes registry has been deleted
 			 */
 		bool_t orphdeltriedpr;
-			/* removed (or tried to remove) orphanage
+			/*
+			 * removed (or tried to remove) orphanage
 			 */
 		bool_t inomapdelpr;
-			/* deleted session ino map
+			/*
+			 * deleted session ino map
 			 */
 	} s;
 };
 
 typedef struct pers pers_t;
 
-/* transient state. re-generated during each restore session
+/*
+ * transient state. re-generated during each restore session
  */
 
 struct tran {
 	time32_t t_starttime;
-		/* for measuring elapsed time of restore session
+		/*
+		 * for measuring elapsed time of restore session
 		 */
 	size64_t t_dircnt;
 	size64_t t_dirdonecnt;
 	size64_t t_direntcnt;
-		/* for displaying stats on directory reconstruction
+		/*
+		 * for displaying stats on directory reconstruction
 		 */
 	size64_t t_vmsz;
-		/* how much vm may be used. recorded here from main,
+		/*
+		 * how much vm may be used. recorded here from main,
 		 * passed to tree_init() once we have a valid media
 		 * file header
 		 */
 	bool_t t_toconlypr;
-		/* just display table of contents; don't restore files
+		/*
+		 * just display table of contents; don't restore files
 		 */
 	bool_t t_noinvupdatepr;
-		/* true if inventory is NOT to be updated when on-media
+		/*
+		 * true if inventory is NOT to be updated when on-media
 		 * inventory encountered.
 		 */
 	bool_t t_dumpidknwnpr;
-		/* determined during initialization; if false, set during
+		/*
+		 * determined during initialization; if false, set during
 		 * per-stream init
 		 */
 	bool_t t_dirattrinitdonepr;
 	bool_t t_namreginitdonepr;
 	bool_t t_treeinitdonepr;
-		/* determinied during initialization, used during
+		/*
+		 * determinied during initialization, used during
 		 * per-stream restore
 		 */
 	uuid_t t_reqdumpid;
 	bool_t t_reqdumpidvalpr;
-		/* uuid of the dump as requested on cmd line
+		/*
+		 * uuid of the dump as requested on cmd line
 		 */
 	char * t_reqdumplab;
 	bool_t t_reqdumplabvalpr;
-		/* label of the dump as requested on cmd line
+		/*
+		 * label of the dump as requested on cmd line
 		 */
 	char *t_hkdir;
-		/* absolute pathname of housekeeping directory
+		/*
+		 * absolute pathname of housekeeping directory
 		 */
 	int t_persfd;
-		/* file descriptor of the persistent state file
+		/*
+		 * file descriptor of the persistent state file
 		 */
 	size64_t t_dirdumps;
-		/* bitset of streams which contain a directory dump
+		/*
+		 * bitset of streams which contain a directory dump
 		 */
 	bool_t t_truncategenpr;
-		/* force use of truncated generation numbers
+		/*
+		 * force use of truncated generation numbers
 		 */
 	sync_t t_sync1;
-		/* to single-thread attempt to validate command line
+		/*
+		 * to single-thread attempt to validate command line
 		 * selection of dump with online inventory
 		 */
 	sync_t t_sync2;
-		/* to single-thread dump selection by media scan
+		/*
+		 * to single-thread dump selection by media scan
 		 */
 	sync_t t_sync3;
-		/* to single-thread attempt to apply dirdump to tree
+		/*
+		 * to single-thread attempt to apply dirdump to tree
 		 */
 	sync_t t_sync4;
-		/* to single-thread attempt to do tree post-processing
+		/*
+		 * to single-thread attempt to do tree post-processing
 		 * prior to non-directory restore
 		 */
 	sync_t t_sync5;
-		/* to single-thread cleanup after applying non-dir restore
+		/*
+		 * to single-thread cleanup after applying non-dir restore
 		 */
 	qlockh_t t_pilockh;
-		/* to establish critical regions while updating pers
+		/*
+		 * to establish critical regions while updating pers
 		 * inventory
 		 */
 };
@@ -932,12 +1062,14 @@ content_init(int argc, char *argv[], size64_t vmsz)
 	int rval;
 	bool_t fullpr;
 
-	/* Calculate the size needed for the persistent inventory
+	/*
+	 * Calculate the size needed for the persistent inventory
 	 */
 	for (perssz = pgsz; perssz < sizeof(pers_t); perssz += pgsz)
 		;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(sizeof(pers_desc_t) <= PERS_DESCSZ);
 	assert(PERS_DESCSZ <= pgsz);
@@ -952,24 +1084,29 @@ content_init(int argc, char *argv[], size64_t vmsz)
 	      "sizeof(pers_desc_t) == %d, pgsz == %d, perssz == %d \n",
 	      sizeof(pers_desc_t), pgsz, perssz);
 
-	/* allocate transient state
+	/*
+	 * allocate transient state
 	 */
 	tranp = (tran_t *)calloc(1, sizeof(tran_t));
 	assert(tranp);
 
-	/* allocate a qlock for establishing pi critical regions
+	/*
+	 * allocate a qlock for establishing pi critical regions
 	 */
 	tranp->t_pilockh = qlock_alloc(QLOCK_ORD_PI);
 
-	/* record vmsz; will be used later to init tree abstraction
+	/*
+	 * record vmsz; will be used later to init tree abstraction
 	 */
 	tranp->t_vmsz = vmsz;
 
-	/* record the start time for stats display
+	/*
+	 * record the start time for stats display
 	 */
 	tranp->t_starttime = time(0);
 
-	/* get command line options
+	/*
+	 * get command line options
 	 */
 	cumpr = BOOL_FALSE;
 	resumepr = BOOL_FALSE;
@@ -1213,7 +1350,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		}
 	}
 
-	/* command line option error checking
+	/*
+	 * command line option error checking
 	 */
 	if (cumpr && tranp->t_toconlypr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
@@ -1232,13 +1370,15 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* assume all streams contain a directory dump. streams will remove
+	/*
+	 * 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;
 
-	/* the user may specify stdin as the restore source stream,
+	/*
+	 * 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.
@@ -1247,7 +1387,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		optind++;
 	}
 
-	/* the last argument must be the destination directory. not
+	/*
+	 * the last argument must be the destination directory. not
 	 * required if table-of-contents display, or if a resumed restore
 	 * or a delta restore.
 	 */
@@ -1305,7 +1446,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		dstdir = ".";
 	}
 
-	/* generate a full pathname for the housekeeping dir.
+	/*
+	 * generate a full pathname for the housekeeping dir.
 	 * the housekeeping dir will by default be placed in the
 	 * destination directory, unless this is a toc, in which case
 	 * it will be placed in the current directory. in either case, an
@@ -1335,7 +1477,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 	}
 	tranp->t_hkdir = open_pathalloc(tranp->t_hkdir, hkdirname, pid);
 
-	/* if this is a table-of-contents only restore, register an
+	/*
+	 * 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!
 	 */
@@ -1343,7 +1486,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		atexit(toconly_cleanup);
 	}
 
-	/* create housekeeping dir if not present
+	/*
+	 * create housekeeping dir if not present
 	 */
 	rval = mkdir(tranp->t_hkdir, S_IRWXU);
 	if (rval && errno != EEXIST) {
@@ -1354,12 +1498,14 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* build a full pathname to pers. state file
+	/*
+	 * build a full pathname to pers. state file
 	 */
 	assert(! perspath);
 	perspath = open_pathalloc(tranp->t_hkdir, persname, 0);
 
-	/* open, creating if non-existent
+	/*
+	 * open, creating if non-existent
 	 */
 	tranp->t_persfd = open(perspath,
 				O_CREAT | O_RDWR,
@@ -1372,7 +1518,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* temporarily mmap just the header, and validate the command line
+	/*
+	 * temporarily mmap just the header, and validate the command line
 	 * arguments. three cases: no dumps applied so far, or one or more
 	 * dumps applied completely, or restore session was interrupted
 	 */
@@ -1386,17 +1533,20 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* but first setup or verify the on-disk format information
+	/*
+	 * but first setup or verify the on-disk format information
 	 */
 	if (! persp->a.valpr) {
-		/* this is the first restore session
+		/*
+		 * this is the first restore session
 		 */
 		persp->v.housekeeping_magic = HOUSEKEEPING_MAGIC;
 		persp->v.housekeeping_version = HOUSEKEEPING_VERSION;
 		persp->v.pagesize = pgsz;
 
 	} else {
-		/* cumulative or resuming a restore, verify the header
+		/*
+		 * cumulative or resuming a restore, verify the header
 		 */
 		if (persp->v.housekeeping_magic != HOUSEKEEPING_MAGIC) {
 			mlog(MLOG_NORMAL | MLOG_ERROR, _(
@@ -1610,11 +1760,13 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		}
 	}
 
-	/* force owner option if root
+	/*
+	 * force owner option if root
 	 */
 	ownerpr = (geteuid() == 0) ? BOOL_TRUE : ownerpr;
 
-	/* force completion of interrupted restore if asked to do so
+	/*
+	 * force completion of interrupted restore if asked to do so
 	 */
 	if (sesscpltpr) {
 		char *path1;
@@ -1649,7 +1801,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 			return BOOL_FALSE;
 		}
 
-		/* This is only a full restore if we're doing a level
+		/*
+		 * This is only a full restore if we're doing a level
 		 * 0 restore.
 		 */
 		if (persp->a.dumpcnt == 0) {
@@ -1682,7 +1835,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		}
 	}
 
-	/* for the three cases, calculate old and new mapping params
+	/*
+	 * for the three cases, calculate old and new mapping params
 	 * and wipe partial state
 	 */
 	if (! persp->a.valpr) {
@@ -1707,7 +1861,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		persp->s.begintime = time(0);
 	}
 
-	/* unmap temp mapping of hdr, truncate, and remap hdr/subtrees
+	/*
+	 * unmap temp mapping of hdr, truncate, and remap hdr/subtrees
 	 */
 	rval = munmap((void *)persp, perssz);
 	assert(! rval);
@@ -1728,7 +1883,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* if first restore session, record cmd line args and subtrees
+	/*
+	 * if first restore session, record cmd line args and subtrees
 	 * and start time.
 	 */
 	if (! persp->a.valpr) {
@@ -1795,7 +1951,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		assert(stcnt == 0);
 	}
 
-	/* initialize the local extattr abstraction. must be done even if
+	/*
+	 * initialize the local extattr abstraction. must be done even if
 	 * we don't intend to restore extended attributes
 	 */
 	ok = extattr_init(drivecnt);
@@ -1803,7 +1960,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* effectively initialize libhandle on this filesystem by
+	/*
+	 * effectively initialize libhandle on this filesystem by
 	 * allocating a file system handle. this needs to be done
 	 * before any open_by_handle() calls (and possibly other
 	 * libhandle calls).
@@ -1824,7 +1982,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		free_handle(fshanp, fshlen);
 	}
 
-	/* map in pers. inv. descriptors, if any. NOTE: this ptr is to be
+	/*
+	 * map in pers. inv. descriptors, if any. NOTE: this ptr is to be
 	 * referenced ONLY via the macros provided; the descriptors will be
 	 * occasionally remapped, causing the ptr to change.
 	 */
@@ -1848,7 +2007,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		pi_preclean();
 	}
 
-	/* if resuming an interrupted restore, indicate we know the id
+	/*
+	 * 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.
 	 */
@@ -1857,7 +2017,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		tranp->t_dumpidknwnpr = BOOL_TRUE;
 	}
 
-	/* sync up with the directory attributes registry.
+	/*
+	 * sync up with the directory attributes registry.
 	 * starts fresh with each dump session restored.
 	 * determine if full init needed instead.
 	 */
@@ -1869,7 +2030,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		tranp->t_dirattrinitdonepr = BOOL_TRUE;
 	}
 
-	/* sync up with the name registry. created by the
+	/*
+	 * sync up with the name registry. created by the
 	 * first session, retained by subsequent sessions.
 	 * determine if full init needed instead.
 	 */
@@ -1881,7 +2043,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		tranp->t_namreginitdonepr = BOOL_TRUE;
 	}
 
-	/* sync up with the inomap abstraction. created anew with each fresh
+	/*
+	 * sync up with the inomap abstraction. created anew with each fresh
 	 * restore session, but persistent after tree updated with dirdump.
 	 * determine if full init needed instead.
 	 */
@@ -1890,13 +2053,15 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		return BOOL_FALSE;
 	}
 
-	/* sync up with the tree abstraction. created by the
+	/*
+	 * 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
 	 * when a valid media file header is at hand.
 	 */
 	if (persp->a.valpr) {
-		/* This is only a full restore if we're doing a level
+		/*
+		 * This is only a full restore if we're doing a level
 		 * 0 restore.
 		 */
 		if (persp->a.dumpcnt == 0) {
@@ -1916,7 +2081,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		tranp->t_treeinitdonepr = BOOL_TRUE;
 	}
 
-	/* set media change flags to FALSE;
+	/*
+	 * set media change flags to FALSE;
 	 */
 	{
 		ix_t ix;
@@ -1933,7 +2099,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 	return BOOL_TRUE;
 }
 
-/* stream thread entry point - returns exit code
+/*
+ * stream thread entry point - returns exit code
  */
 int
 content_stream_restore(ix_t thrdix)
@@ -1956,14 +2123,16 @@ content_stream_restore(ix_t thrdix)
 	bool_t ok;
 	int rval;
 
-	/* allocate two path buffers
+	/*
+	 * allocate two path buffers
 	 */
 	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
+	/*
+	 * set the current directory to dstdir. the tree abstraction
 	 * depends on the current directory being the root of the
 	 * destination file system.
 	 */
@@ -1976,12 +2145,14 @@ content_stream_restore(ix_t thrdix)
 		return mlog_exit(EXIT_ERROR, RV_ERROR);
 	}
 
-	/* set my file creation mask to zero, to avoid modifying the
+	/*
+	 * set my file creation mask to zero, to avoid modifying the
 	 * dumped mode bits
 	 */
 	(void)umask(0);
 
-	/* initialize the Media abstraction
+	/*
+	 * initialize the Media abstraction
 	 */
 	Mediap = Media_create(thrdix);
 
@@ -1999,7 +2170,8 @@ content_stream_restore(ix_t thrdix)
 	strctxp->sc_fd = -1;
 	Mediap->M_drivep->d_strmcontextp = (void *)strctxp;
 
-	/* if we don't know the dump session id to restore,
+	/*
+	 * if we don't know the dump session id to restore,
 	 * first see if command line options can be validated
 	 * against the online inventory to identify it. only
 	 * one stream needs to do this; the others just wait.
@@ -2028,7 +2200,8 @@ content_stream_restore(ix_t thrdix)
 		mlog(MLOG_DEBUG,
 		      "checking and validating command line dump id/label\n");
 		ok = Inv_validate_cmdline();
-		    /* side-effect - searches for and incorporates online inv
+		    /*
+		     * side-effect - searches for and incorporates online inv
 		     * into pi, and makes persp->s.dumpid valid.
 		     */
 		if (ok == BOOL_ERROR) {
@@ -2038,7 +2211,8 @@ content_stream_restore(ix_t thrdix)
 		tranp->t_sync1 = SYNC_DONE;
 	}
 
-	/* if we still don't know the session to restore, search the
+	/*
+	 * if we still don't know the session to restore, search the
 	 * media for a match either to the command line arguments or
 	 * until the operator selects a media file from the desired
 	 * dump.
@@ -2201,7 +2375,8 @@ content_stream_restore(ix_t thrdix)
 			     sizeof(persp->s.dumplab));
 		sessp = 0;
 
-		/* don't look at the online inventory if the input is piped
+		/*
+		 * don't look at the online inventory if the input is piped
 		 */
 		if (! drivep->d_isnamedpipepr
 		     &&
@@ -2222,7 +2397,8 @@ content_stream_restore(ix_t thrdix)
 				    mrhdrp,
 				    scrhdrp,
 				    drivep);
-			/* done here because Media_mfile_next doesn't know
+			/*
+			 * done here because Media_mfile_next doesn't know
 			 * if this is a match
 			 */
 		if (fileh == DH_NULL) {
@@ -2234,7 +2410,8 @@ content_stream_restore(ix_t thrdix)
 		tranp->t_sync2 = SYNC_DONE;
 	}
 
-	/* all drives coordinate in attempt to apply session dir dump.
+	/*
+	 * all drives coordinate in attempt to apply session dir dump.
 	 * only one actually completes.
 	 */
 	if (persp->s.dirdonepr) {
@@ -2306,7 +2483,8 @@ content_stream_restore(ix_t thrdix)
 			continue;
 		}
 		if (!(scrhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP)) {
-			/* if no streams have a directory dump, issue a
+			/*
+			 * 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.
@@ -2404,7 +2582,8 @@ content_stream_restore(ix_t thrdix)
 			}
 		}
 
-		/* commit the session and accumulative state
+		/*
+		 * commit the session and accumulative state
 		 */
 		persp->s.valpr = BOOL_TRUE;
 		persp->a.valpr = BOOL_TRUE;
@@ -2438,7 +2617,8 @@ content_stream_restore(ix_t thrdix)
 		}
 	}
 
-	/* now let one thread do all tree post-processing prior to
+	/*
+	 * now let one thread do all tree post-processing prior to
 	 * non-dir restore
 	 */
 	if (persp->s.treepostdonepr) {
@@ -2499,7 +2679,8 @@ content_stream_restore(ix_t thrdix)
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 
-		/* now that we have a tree and inomap, scan the
+		/*
+		 * now that we have a tree and inomap, scan the
 		 * pi to see what media files can be skipped.
 		 * this func has cancer: too many flags and
 		 * side-effects!
@@ -2517,12 +2698,14 @@ content_stream_restore(ix_t thrdix)
 		}
 		}
 
-		/* release exclusion
+		/*
+		 * release exclusion
 		 */
 		tranp->t_sync4 = SYNC_DONE;
 	}
 
-	/* now all are free to do concurrent non-dir restore!
+	/*
+	 * now all are free to do concurrent non-dir restore!
 	 * apply media files until there are no more, or we are interrupted
 	 */
 	for (;;) {
@@ -2600,7 +2783,8 @@ content_stream_restore(ix_t thrdix)
 		}
 	}
 
-	/* finally, choose one thread to do final processing
+	/*
+	 * finally, choose one thread to do final processing
 	 * and cleanup. the winner waits, the losers all exit.
 	 * once the losers exit, the winner can perform cleanup.
 	 */
@@ -2633,7 +2817,8 @@ content_stream_restore(ix_t thrdix)
 	return mlog_exit(rval, rv);
 }
 
-/* called after all threads have exited. scans state to decide
+/*
+ * called after all threads have exited. scans state to decide
  * if interrupted or not.
  */
 bool_t
@@ -2703,7 +2888,8 @@ content_complete(void)
 		      GETOPT_RESUME);
 	}
 
-	/* accumulate total elapsed time
+	/*
+	 * accumulate total elapsed time
 	 */
 	if (persp) {
 		persp->s.accumtime = elapsed;
@@ -2734,7 +2920,8 @@ content_statline(char **linespp[])
 	struct tm *tmp;
 	ix_t i;
 
-	/* build and supply the line array
+	/*
+	 * build and supply the line array
 	 */
 	for (i = 0; i < 1; i++) {
 		statline[i] = &statlinebuf[i][0];
@@ -2745,13 +2932,15 @@ content_statline(char **linespp[])
 		return 0;
 	}
 
-	/* calculate the elapsed time
+	/*
+	 * calculate the elapsed time
 	 */
 	elapsed = persp->s.accumtime
 		  +
 		  (time(0) - tranp->t_starttime);
 
-	/* get local time
+	/*
+	 * get local time
 	 */
 	now = time(0);
 	tmp = localtime(&now);
@@ -2784,7 +2973,8 @@ content_statline(char **linespp[])
 		return 1;
 	}
 
-	/* get the accumulated totals for non-dir inos and data bytes dumped.
+	/*
+	 * get the accumulated totals for non-dir inos and data bytes dumped.
 	 * not under lock!
 	 */
 	inodone = persp->s.stat_inodone;
@@ -2792,7 +2982,8 @@ content_statline(char **linespp[])
 	inocnt = persp->s.stat_inocnt;
 	datacnt = persp->s.stat_datacnt;
 
-	/* calculate percentage of data dumped
+	/*
+	 * calculate percentage of data dumped
 	 */
 	if (datacnt) {
 		percent = (double)datadone
@@ -2806,7 +2997,8 @@ content_statline(char **linespp[])
 		percent = 100.0;
 	}
 
-	/* format the status line in a local static buffer (non-re-entrant!)
+	/*
+	 * format the status line in a local static buffer (non-re-entrant!)
 	 */
 	sprintf(statline[0], _(
 		 "status at %02d:%02d:%02d: %llu/%llu files restored, "
@@ -2821,7 +3013,8 @@ content_statline(char **linespp[])
 		 elapsed);
 	assert(strlen(statline[0]) < STATLINESZ);
 
-	/* return buffer to caller
+	/*
+	 * return buffer to caller
 	 */
 	return 1;
 }
@@ -2853,7 +3046,8 @@ content_showremainingobjects(void)
 	}
 }
 
-/* dlog_begin already called; this is a second-level dialog.
+/*
+ * dlog_begin already called; this is a second-level dialog.
  * prompt for each thread currently waiting for confirmation,
  * as well as an info prompt.
  */
@@ -2969,7 +3163,8 @@ content_mediachange_query(void)
 
 /* definition of locally defined static functions ****************************/
 
-/* does all pre-processing leading up to applying the dirdump,
+/*
+ * does all pre-processing leading up to applying the dirdump,
  * then applies the dirdump. updates pers progress flags along the way.
  * does NOT do any post-processing!
  */
@@ -3043,14 +3238,16 @@ applydirdump(drive_t *drivep,
 		for (;;) {
 			nh_t dirh;
 
-			/* read the file header
+			/*
+			 * read the file header
 			 */
 			rv = read_filehdr(drivep, fhdrp, fhcs);
 			if (rv) {
 				return rv;
 			}
 
-			/* if this is a null file hdr, we're done
+			/*
+			 * if this is a null file hdr, we're done
 			 * reading dirs, and there are no nondirs.
 			 * done.
 			 */
@@ -3058,20 +3255,23 @@ applydirdump(drive_t *drivep,
 				break;
 			}
 
-			/* if its not a directory, must be the
+			/*
+			 * if its not a directory, must be the
 			 * first non-dir file. done.
 			 */
 			if ((fhdrp->fh_stat.bs_mode & S_IFMT) != S_IFDIR) {
 				break;
 			}
 
-			/* if stop requested bail out gracefully
+			/*
+			 * if stop requested bail out gracefully
 			 */
 			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)
@@ -3081,7 +3281,8 @@ applydirdump(drive_t *drivep,
 				preemptchk();
 			}
 
-			/* may be an extended attributes file hdr
+			/*
+			 * may be an extended attributes file hdr
 			 */
 			if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
 				rv = restore_extattr(drivep,
@@ -3097,7 +3298,8 @@ applydirdump(drive_t *drivep,
 				continue;
 			}
 
-			/* add the directory to the tree. save the
+			/*
+			 * add the directory to the tree. save the
 			 * returned tree node id, to associate with
 			 * the directory entries. get the dirattr handle,
 			 * so that any extattr following will be associated
@@ -3108,7 +3310,8 @@ applydirdump(drive_t *drivep,
 			if (dirh == NH_NULL)
 			    return RV_ERROR;
 
-			/* read the directory entries, and populate the
+			/*
+			 * read the directory entries, and populate the
 			 * tree with them. we can tell when we are done
 			 * by looking for a null dirent.
 			 */
@@ -3125,7 +3328,8 @@ applydirdump(drive_t *drivep,
 					return rv;
 				}
 
-				/* if null, we're done with this dir.
+				/*
+				 * if null, we're done with this dir.
 				 * break out of this inner loop and
 				 * move on th the next dir.
 				 */
@@ -3135,7 +3339,8 @@ applydirdump(drive_t *drivep,
 				namelen = strlen(dhdrp->dh_name);
 				assert(namelen <= NAME_MAX);
 
-				/* add this dirent to the tree.
+				/*
+				 * add this dirent to the tree.
 				 */
 				rv = tree_addent(dirh,
 					     dhdrp->dh_ino,
@@ -3170,7 +3375,8 @@ applydirdump(drive_t *drivep,
 	return RV_OK;
 }
 
-/* like applydirdump, but just eats up the inomap/dirdump portion of the
+/*
+ * like applydirdump, but just eats up the inomap/dirdump portion of the
  * dump, doesn't use it. the first non-dir filehdr_t is copied into supplied
  * buffer. returns integer error code from drive ops used.
  */
@@ -3220,14 +3426,16 @@ eatdirdump(drive_t *drivep,
 	mlog(MLOG_DEBUG,
 	      "discarding directories \n");
 	for (;;) {
-		/* read the file header
+		/*
+		 * read the file header
 		 */
 		rv = read_filehdr(drivep, fhdrp, fhcs);
 		if (rv) {
 			return rv;
 		}
 
-		/* if this is a null file hdr, we're done
+		/*
+		 * if this is a null file hdr, we're done
 		 * reading dirs, and there are no nondirs.
 		 * done.
 		 */
@@ -3235,20 +3443,23 @@ eatdirdump(drive_t *drivep,
 			break;
 		}
 
-		/* if its not a directory, must be the
+		/*
+		 * if its not a directory, must be the
 		 * first non-dir file. done.
 		 */
 		if ((fhdrp->fh_stat.bs_mode & S_IFMT) != S_IFDIR) {
 			break;
 		}
 
-		/* if stop requested bail out gracefully
+		/*
+		 * if stop requested bail out gracefully
 		 */
 		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
-		/* may be an extended attributes file hdr
+		/*
+		 * may be an extended attributes file hdr
 		 */
 		if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
 			rv = restore_extattr(drivep,
@@ -3264,7 +3475,8 @@ eatdirdump(drive_t *drivep,
 			continue;
 		}
 
-		/* read the directory entries.
+		/*
+		 * read the directory entries.
 		 * we can tell when we are done
 		 * by looking for a null dirent.
 		 */
@@ -3282,7 +3494,8 @@ eatdirdump(drive_t *drivep,
 				return rv;
 			}
 
-			/* if null, we're done with this dir.
+			/*
+			 * if null, we're done with this dir.
 			 * break out of this inner loop and
 			 * move on th the next dir.
 			 */
@@ -3297,7 +3510,8 @@ eatdirdump(drive_t *drivep,
 	return RV_OK;
 }
 
-/* does all post-processing of the tree required prior to restoral of
+/*
+ * does all post-processing of the tree required prior to restoral of
  * the non-directory portion of the dump. only one thread at a time,
  * so no locking needed. since the steps are interdependent, loops
  * until no point in doing so.
@@ -3308,7 +3522,8 @@ treepost(char *path1, char *path2)
 	bool_t ok;
 
 #ifdef TREE_CHK
-	/* first scan the tree for corruption
+	/*
+	 * first scan the tree for corruption
 	 */
 	mlog(MLOG_DEBUG | MLOG_TREE,
 	      "checking tree for consistency\n");
@@ -3317,7 +3532,8 @@ treepost(char *path1, char *path2)
 	}
 #endif /* TREE_CHK */
 
-	/* adjust ref flags based on what dirs were dumped
+	/*
+	 * adjust ref flags based on what dirs were dumped
 	 */
 	if (! persp->s.adjrefdonepr) {
 		mlog(MLOG_DEBUG | MLOG_TREE,
@@ -3329,7 +3545,8 @@ treepost(char *path1, char *path2)
 		persp->s.adjrefdonepr = BOOL_TRUE;
 	}
 
-	/* if a subtree or interactive restore, sanitize the inomap
+	/*
+	 * if a subtree or interactive restore, sanitize the inomap
 	 * so only inos selected by subtree or interactive cmds will
 	 * be present in inomap.
 	 */
@@ -3344,7 +3561,8 @@ treepost(char *path1, char *path2)
 		persp->s.inomapsanitizedonepr = BOOL_TRUE;
 	}
 
-	/* apply subtree selections
+	/*
+	 * apply subtree selections
 	 */
 	if (! persp->s.stdonepr) {
 		ix_t stix;
@@ -3353,7 +3571,8 @@ treepost(char *path1, char *path2)
 		mlog(MLOG_DEBUG | MLOG_TREE,
 		      "applying subtree selections\n");
 
-		/* if first subtree selection is inclusive in sense,
+		/*
+		 * if first subtree selection is inclusive in sense,
 		 * first mark the entire tree as unselected. otherwise,
 		 * select all (no subtree selections or first was excluding).
 		 */
@@ -3371,7 +3590,8 @@ treepost(char *path1, char *path2)
 			tree_markallsubtree(BOOL_TRUE);
 		}
 
-		/* now apply all subtree commands from command line
+		/*
+		 * now apply all subtree commands from command line
 		 */
 		for (stix = 0,
 		      stdescp = (stdesc_t *)((char *)persp + perssz)
@@ -3394,7 +3614,8 @@ treepost(char *path1, char *path2)
 		persp->s.stdonepr = BOOL_TRUE;
 	}
 
-	/* next engage interactive subtree selection
+	/*
+	 * next engage interactive subtree selection
 	 */
 	if (! persp->s.interdonepr) {
 		if (persp->a.interpr) {
@@ -3438,7 +3659,8 @@ applynondirdump(drive_t *drivep,
 	egrp_t next_egrp;
 	stream_context_t *strctxp = (stream_context_t *)drivep->d_strmcontextp;
 
-	/* determine if file header and/or extent heade checksums present
+	/*
+	 * determine if file header and/or extent heade checksums present
 	 */
 	fhcs = (scrhdrp->cih_dumpattr & CIH_DUMPATTR_FILEHDR_CHECKSUM)
 	       ?
@@ -3456,12 +3678,14 @@ applynondirdump(drive_t *drivep,
 	       :
 	       BOOL_FALSE;
 
-	/* determine the first and next egrps needed from this media file.
+	/*
+	 * determine the first and next egrps needed from this media file.
 	 * used to decide if stats should be updated
 	 */
 	pi_bracketneededegrps(fileh, &first_egrp, &next_egrp);
 
-	/* initialize the stream context
+	/*
+	 * initialize the stream context
 	 */
 	memset(&strctxp->sc_bstat, 0, sizeof(bstat_t));
 	strctxp->sc_path[0] = '\0';
@@ -3476,14 +3700,16 @@ applynondirdump(drive_t *drivep,
 		bool_t resyncpr = BOOL_FALSE;
 		int rval;
 
-		/* if a null file header, break
+		/*
+		 * if a null file header, break
 		 */
 		if (fhdrp->fh_flags & FILEHDR_FLAGS_NULL) {
 			rv = RV_OK;
 			goto applynondirdump_out;
 		}
 
-		/* if working on a different file than we were previously,
+		/*
+		 * if working on a different file than we were previously,
 		 * complete the old one and begin the new one.
 		 */
 		if (bstatp->bs_ino != strctxp->sc_bstat.bs_ino) {
@@ -3538,7 +3764,8 @@ applynondirdump(drive_t *drivep,
 			goto applynondirdump_out;
 		}
 
-		/* update stats if appropriate
+		/*
+		 * update stats if appropriate
 		 */
 		if (((bstatp->bs_mode & S_IFMT) == S_IFREG)
 		     &&
@@ -3564,11 +3791,13 @@ applynondirdump(drive_t *drivep,
 		}
 
 		do {
-			/* get a mark for the next read, in case we restart here
+			/*
+			 * get a mark for the next read, in case we restart here
 			 */
 			(*dop->do_get_mark)(drivep, &drivemark);
 
-			/* read the file header.
+			/*
+			 * read the file header.
 			 */
 			rv = read_filehdr(drivep, fhdrp, fhcs);
 			switch (rv) {
@@ -3602,7 +3831,8 @@ applynondirdump(drive_t *drivep,
 			}
 		} while (resyncpr);
 
-		/* checkpoint into persistent state if not a null file hdr
+		/*
+		 * checkpoint into persistent state if not a null file hdr
 		 */
 		if (! (fhdrp->fh_flags & FILEHDR_FLAGS_NULL)) {
 			pi_checkpoint(fileh,
@@ -3611,7 +3841,8 @@ applynondirdump(drive_t *drivep,
 				       fhdrp->fh_offset);
 		}
 
-		/* if in a pipeline, call preemptchk() to
+		/*
+		 * if in a pipeline, call preemptchk() to
 		 * print status reports
 		 */
 		if (pipeline)
@@ -3624,7 +3855,8 @@ applynondirdump(drive_t *drivep,
 
 applynondirdump_out:
 
-	/* We've hit the end of this media file or encountered corruption.
+	/*
+	 * We've hit the end of this media file or encountered corruption.
 	 * In either case, we may not be back to complete the metadata for
 	 * this file, so attempt to complete it now.
 	 */
@@ -3641,7 +3873,8 @@ finalize(char *path1, char *path2)
 
 	if (! tranp->t_toconlypr) {
 
-		/* restore directory attributes
+		/*
+		 * restore directory attributes
 		 */
 		if (! persp->s.dirattrdonepr) {;
 			ok = tree_setattr(path1);
@@ -3651,7 +3884,8 @@ finalize(char *path1, char *path2)
 			persp->s.dirattrdonepr = BOOL_TRUE;
 		}
 
-		/* remove orphanage if empty
+		/*
+		 * remove orphanage if empty
 		 */
 		if (! persp->s.orphdeltriedpr) {;
 			ok = tree_delorph();
@@ -3661,7 +3895,8 @@ finalize(char *path1, char *path2)
 			persp->s.orphdeltriedpr = BOOL_TRUE;
 		}
 
-		/* delete the persistent ino map
+		/*
+		 * delete the persistent ino map
 		 */
 		if (! persp->s.inomapdelpr) {
 			inomap_del_pers(tranp->t_hkdir);
@@ -3669,13 +3904,15 @@ finalize(char *path1, char *path2)
 		}
 	}
 
-	/* at this point, all session-only persistent state has been deleted.
+	/*
+	 * at this point, all session-only persistent state has been deleted.
 	 * if this is a cumulative restore, just update the pers cum state and
 	 * invalidate the pers session state. otherwise, invalidate the
 	 * persistent state. content_complete will remove housekeeping dir.
 	 */
 	if (persp->a.cumpr) {
-		/* following must be atomic!
+		/*
+		 * following must be atomic!
 		 */
 		persp->a.dumpcnt++;
 		uuid_copy(persp->a.lastdumpid, persp->s.dumpid);
@@ -3749,7 +3986,8 @@ wipepersstate(void)
 
 /* Inv abstraction ***********************************************************/
 
-/* attempt to validate id or label against online inventory.
+/*
+ * attempt to validate id or label against online inventory.
  * sets pers id/label and pers idvalpr etc as side-effect (does NOT set valpr!)
  */
 static bool_t
@@ -3829,7 +4067,8 @@ Media_create(ix_t thrdix)
 	return Mediap;
 }
 
-/* these calls allow the Media users to clue Media in to fine position changes
+/*
+ * these calls allow the Media users to clue Media in to fine position changes
  * within the current media file
  */
 static void
@@ -3850,7 +4089,8 @@ Media_atnondir(Media_t *Mediap)
 	Mediap->M_pos = POS_ATNONDIR;
 }
 
-/* supplies pertinent media files to the caller. if purpose is search,
+/*
+ * supplies pertinent media files to the caller. if purpose is search,
  * returns all media files. otherwise, returns only media files with the
  * dump ID. smart enough to know that if purpose was search but is now dir,
  * current media file can be returned again. same for other transitions.
@@ -3901,7 +4141,8 @@ Media_mfile_next(Media_t *Mediap,
 	      purp,
 	      Mediap->M_pos);
 
-	/* pass back hdr and drive ptrs
+	/*
+	 * pass back hdr and drive ptrs
 	 */
 	*grhdrpp =  grhdrp;
 	*drhdrpp =  drhdrp;
@@ -3910,17 +4151,20 @@ Media_mfile_next(Media_t *Mediap,
 	*scrhdrpp =  scrhdrp;
 	*drivepp = drivep;
 
-	/* if ref return for pers mfile desc supplied, pre-zero
+	/*
+	 * if ref return for pers mfile desc supplied, pre-zero
 	 */
 	if (filehp) {
 		*filehp = DH_NULL;
 	}
 
-	/* keep a close eye on the validity of fileh
+	/*
+	 * keep a close eye on the validity of fileh
 	 */
 	fileh = DH_NULL;
 
-	/* if purpose has changed, invalidate first, last, and previous indices
+	/*
+	 * if purpose has changed, invalidate first, last, and previous indices
 	 */
 	if (Mediap->M_flmfixvalpr) {
 		if (purp != Mediap->M_mfixpurp) {
@@ -3929,14 +4173,16 @@ Media_mfile_next(Media_t *Mediap,
 		}
 	}
 
-	/* use a local variable to keep track of dump sessions seen on
+	/*
+	 * use a local variable to keep track of dump sessions seen on
 	 * media. if not in search mode, each time we see a different
 	 * dump session, log a message to keep the user informed.
 	 * invalidated each time we change media or rewind.
 	 */
 	uuid_clear(prevmfiledumpid);
 
-	/* if restore is complete, return indication. be sure to end read
+	/*
+	 * if restore is complete, return indication. be sure to end read
 	 * if active.
 	 */
 	if (purp == PURP_NONDIR
@@ -3954,7 +4200,8 @@ Media_mfile_next(Media_t *Mediap,
 		return RV_NOMORE;
 	}
 
-	/* loop searching for an acceptable media file.
+	/*
+	 * loop searching for an acceptable media file.
 	 * change media as necessary.
 	 */
 	for (;;) {
@@ -3975,7 +4222,8 @@ Media_mfile_next(Media_t *Mediap,
 
 		emptypr = BOOL_FALSE;
 
-		/* check if no point in going on
+		/*
+		 * check if no point in going on
 		 */
 		if (cldmgr_stop_requested()) {
 			return RV_INTR;
@@ -3989,7 +4237,8 @@ Media_mfile_next(Media_t *Mediap,
 			return RV_NOMORE;
 		}
 
-		/* if we have a useless media object, get another one
+		/*
+		 * if we have a useless media object, get another one
 		 */
 		if (Mediap->M_pos == POS_USELESS
 		     ||
@@ -3997,7 +4246,8 @@ Media_mfile_next(Media_t *Mediap,
 			goto newmedia;
 		}
 
-		/* if the purpose if to search, and we already have
+		/*
+		 * if the purpose if to search, and we already have
 		 * a media file, that media file has already been
 		 * searched, so set pos to cause another begin read
 		 */
@@ -4011,7 +4261,8 @@ Media_mfile_next(Media_t *Mediap,
 			}
 		}
 
-		/* if already have a media file, skip the begin_read
+		/*
+		 * if already have a media file, skip the begin_read
 		 */
 		if (Mediap->M_pos == POS_ATHDR
 		     ||
@@ -4021,7 +4272,8 @@ Media_mfile_next(Media_t *Mediap,
 			goto validate;
 		}
 
-		/* see if the indices say we've seen all there is to see
+		/*
+		 * see if the indices say we've seen all there is to see
 		 */
 		if (Mediap->M_flmfixvalpr) {
 			if (Mediap->M_pos == POS_UNKN) {
@@ -4041,7 +4293,8 @@ Media_mfile_next(Media_t *Mediap,
 			}
 		}
 
-		/* if we are at the end, do a rewind, or get new media
+		/*
+		 * if we are at the end, do a rewind, or get new media
 		 * if rewinds not possible. this may take a while, so
 		 * afterwards check for interrupt or if someone else
 		 * has finished the job.
@@ -4067,7 +4320,8 @@ Media_mfile_next(Media_t *Mediap,
 			}
 		}
 
-		/* begin a new media file, and determine new position.
+		/*
+		 * begin a new media file, and determine new position.
 		 * bail if catastrophic. also, tell pi about EOD/EOM
 		 * if appropriate.
 		 */
@@ -4152,7 +4406,8 @@ Media_mfile_next(Media_t *Mediap,
 		}
 
 validate:
-		/* update the positional indices
+		/*
+		 * update the positional indices
 		 */
 		if (Mediap->M_pos == POS_ATHDR
 		     ||
@@ -4167,7 +4422,8 @@ validate:
 			Mediap->M_lmfix = mrhdrp->mh_mediafileix;
 		}
 
-		/* check for interrupt. be sure to end_read if necessary
+		/*
+		 * check for interrupt. be sure to end_read if necessary
 		 */
 		if (cldmgr_stop_requested()) {
 			if (Mediap->M_pos == POS_ATHDR
@@ -4182,14 +4438,16 @@ validate:
 			return RV_INTR;
 		}
 
-		/* check if another thread has finished job (for this purpose).
+		/*
+		 * check if another thread has finished job (for this purpose).
 		 * don't end_read, we will be back.
 		 */
 		if (donesyncp && *donesyncp == SYNC_DONE) {
 			return RV_DONE;
 		}
 
-		/* we may be done due to the actions of other threads.
+		/*
+		 * we may be done due to the actions of other threads.
 		 * if so, return indicating so
 		 */
 		if (purp == PURP_NONDIR
@@ -4198,7 +4456,8 @@ validate:
 			return RV_NOMORE;
 		}
 
-		/* if the media object is useless, go get more
+		/*
+		 * if the media object is useless, go get more
 		 */
 		if (Mediap->M_pos == POS_USELESS
 		     ||
@@ -4206,7 +4465,8 @@ validate:
 			goto newmedia;
 		}
 
-		/* if we hit the end, this is not a search, and we've
+		/*
+		 * if we hit the end, this is not a search, and we've
 		 * seen at least one media file pertaining to the dump,
 		 * ask the inventory if there is any point in examining
 		 * the beginning of the object.
@@ -4223,21 +4483,24 @@ validate:
 			goto newmedia;
 		}
 
-		/* if we hit the end, go back to the top, where
+		/*
+		 * if we hit the end, go back to the top, where
 		 * we will decide if we should rewind or get new media.
 		 */
 		if (Mediap->M_pos == POS_END) {
 			continue;
 		}
 
-		/* if the purpose is to search, return this media file
+		/*
+		 * if the purpose is to search, return this media file
 		 */
 		if (purp == PURP_SEARCH) {
 			assert(Mediap->M_pos == POS_ATHDR);
 			return RV_OK;
 		}
 
-		/* see if this media file is part of the desired dump session
+		/*
+		 * see if this media file is part of the desired dump session
 		 */
 		partofdumppr = (bool_t)(uuid_compare(persp->s.dumpid,
 						     grhdrp->gh_dumpid) == 0);
@@ -4253,7 +4516,8 @@ validate:
 			  inv_string_uuid, gh_string_uuid);
 		}
 
-		/* if media file dump id is different from the preceeding
+		/*
+		 * if media file dump id is different from the preceeding
 		 * media file, print something useful at TRACE verbosity.
 		 */
 		if (uuid_compare(prevmfiledumpid,
@@ -4279,7 +4543,8 @@ validate:
 			uuid_copy(prevmfiledumpid, grhdrp->gh_dumpid);
 		}
 
-		/* if this media file is not part of the desired dump session,
+		/*
+		 * if this media file is not part of the desired dump session,
 		 * and a preceeding media file on this object was part of the
 		 * dump, we know we have hit the end of the stream. tell the
 		 * persistent inventory.
@@ -4294,7 +4559,8 @@ validate:
 					Mediap->M_lmfix);
 		}
 
-		/* if this media file is not part of the desired dump session,
+		/*
+		 * if this media file is not part of the desired dump session,
 		 * we are doing non-dir, and the preceeding media file on this
 		 * object was part of the dump, we know we have hit the end of
 		 * the stream. check if we are done.
@@ -4314,7 +4580,8 @@ validate:
 			}
 		}
 
-		/* if this media file is not part of the desired dump session,
+		/*
+		 * if this media file is not part of the desired dump session,
 		 * and preceeding media files on this object were, decide if
 		 * we need to rewind and look at the beginning of the object.
 		 */
@@ -4336,7 +4603,8 @@ validate:
 			}
 		}
 
-		/* if this media file is not part of the desired dump session,
+		/*
+		 * if this media file is not part of the desired dump session,
 		 * and the above conditions were not met, then keep looking
 		 */
 		if (! partofdumppr) {
@@ -4346,7 +4614,8 @@ validate:
 			continue;
 		}
 
-		/* record the index within this media object of the first
+		/*
+		 * record the index within this media object of the first
 		 * media file in the dump stream
 		 */
 		if (! Mediap->M_fsfixvalpr) {
@@ -4359,7 +4628,8 @@ validate:
 			Mediap->M_fsfixvalpr = BOOL_TRUE;
 		}
 
-		/* this media file is part of the dump. add it to the
+		/*
+		 * this media file is part of the dump. add it to the
 		 * persistent inventory and get a file handle.
 		 */
 		fileh = pi_addfile(Mediap,
@@ -4381,7 +4651,8 @@ validate:
 
 		pi_note_underhead(objh, fileh);
 
-		/* if purp is nondir, we may be done.
+		/*
+		 * if purp is nondir, we may be done.
 		 */
 		if (purp == PURP_NONDIR && pi_alldone()) {
 			(*dop->do_end_read)(drivep);
@@ -4389,7 +4660,8 @@ validate:
 			return RV_NOMORE;
 		}
 
-		/* check for a wraparound
+		/*
+		 * check for a wraparound
 		 */
 		if (Mediap->M_flmfixvalpr) {
 			if (Mediap->M_fsfixvalpr
@@ -4414,7 +4686,8 @@ validate:
 			}
 		}
 
-		/* if this media file is an inventory or a terminator,
+		/*
+		 * if this media file is an inventory or a terminator,
 		 * we have hit the end of the stream. don't tell the persistent
 		 * inventory; it already knows because of a pi_addfile.
 		 * decide if any preceeding media files are useful and if so
@@ -4445,7 +4718,8 @@ validate:
 			goto newmedia;
 		}
 
-		/* if the purpose is dir, but this media file is not positioned
+		/*
+		 * if the purpose is dir, but this media file is not positioned
 		 * at the hdr or has already been tried, get another one.
 		 * use the persistent inventory to do this intelligently.
 		 */
@@ -4481,7 +4755,8 @@ validate:
 			}
 		}
 
-		/* if the purpose is dir, give it to the caller
+		/*
+		 * if the purpose is dir, give it to the caller
 		 */
 		if (purp == PURP_DIR) {
 			assert(Mediap->M_pos == POS_ATHDR);
@@ -4492,11 +4767,13 @@ validate:
 			return RV_OK;
 		}
 
-		/* if we made it this far, the purpose is NONDIR and this
+		/*
+		 * if we made it this far, the purpose is NONDIR and this
 		 * is a valid media file from the desired dump session.
 		 */
 
-		/* see if this media file contains any inodes not yet restored
+		/*
+		 * see if this media file contains any inodes not yet restored
 		 */
 		assert(fileh != DH_NULL);
 		pi_lock();
@@ -4505,7 +4782,8 @@ validate:
 		endino = pi_scanfileendino(fileh);
 		hassomepr = inomap_rst_needed(begino, endino);
 
-		/* if we have already given up on this media file or
+		/*
+		 * if we have already given up on this media file or
 		 * it doesn't contains anything not yet restored,
 		 * or it can be skipped, move on. force the done flag on,
 		 * so we don't check it again.
@@ -4546,12 +4824,14 @@ validate:
 			}
 		}
 
-		/* so the purpose is NONDIR and we like this media file.
+		/*
+		 * so the purpose is NONDIR and we like this media file.
 		 * be sure we are positioned at the beginning of the
 		 * non-dir filehdr not yet restored, and supply to caller.
 		 */
 
-		/* need to position just after the first
+		/*
+		 * need to position just after the first
 		 * non-dir filehdr_t not yet restored.
 		 * may be a problem if we are currently positioned
 		 * in the middle of the dir dump and have no
@@ -4648,7 +4928,8 @@ validate:
 		    break;
 		}
 
-		/* if error encountered during fine positioning,
+		/*
+		 * if error encountered during fine positioning,
 		 * mark file so we won't try it again
 		 */
 		if (rval) {
@@ -4657,7 +4938,8 @@ validate:
 			Mediap->M_pos = POS_ATNONDIR;
 		}
 
-		/* if no error during fine positioning, return.
+		/*
+		 * if no error during fine positioning, return.
 		 */
 		if (! rval) {
 			if (filehp) {
@@ -4667,7 +4949,8 @@ validate:
 			return RV_OK;
 		}
 
-		/* an error occurred during fine positioning. any other useful
+		/*
+		 * an error occurred during fine positioning. any other useful
 		 * media files on this object? if so, continue; if not, get
 		 * more media.
 		 */
@@ -4700,12 +4983,14 @@ validate:
 		/* fall through */
 
 newmedia:
-		/* invalidate prev id, so we log a TRACE msg for first
+		/*
+		 * invalidate prev id, so we log a TRACE msg for first
 		 * media file seen on new media
 		 */
 		uuid_clear(prevmfiledumpid);
 
-		/* if we are searching and some other thread completed
+		/*
+		 * if we are searching and some other thread completed
 		 * the search, don't pop the media unless it is useless
 		 */
 		if (purp == PURP_SEARCH
@@ -4720,26 +5005,30 @@ newmedia:
 			return RV_DONE;
 		}
 
-		/* if media not removable, just return
+		/*
+		 * if media not removable, just return
 		 */
 		if ((*dop->do_get_device_class)(drivep)
 		     ==
 		     DEVICE_NONREMOVABLE)
 		{
-		    /* if no error has already been detected then don't log
+		    /*
+		     * if no error has already been detected then don't log
 		       a failure */
 		    if (mlog_get_hint() == RV_NONE)
 			mlog_exit_hint(RV_OK);
 		    return RV_QUIT;
 		}
 
-		/* check for an interrupt
+		/*
+		 * check for an interrupt
 		 */
 		if (cldmgr_stop_requested()) {
 			return RV_INTR;
 		}
 
-		/* check if we are done.
+		/*
+		 * check if we are done.
 		 */
 		switch (purp) {
 		case PURP_SEARCH:
@@ -4766,14 +5055,16 @@ newmedia:
 		}
 
 		if (! bagp && ! knownholespr && ! maybeholespr) {
-			/* if PURP_DIR, this may be a problem
+			/*
+			 * if PURP_DIR, this may be a problem
 			 */
 			if (purp == PURP_NONDIR) {
 				return RV_NOMORE;
 			}
 		}
 
-		/* eject media if drive not already empty
+		/*
+		 * eject media if drive not already empty
 		 */
 		if (! emptypr) {
 			int dcaps = drivep->d_capabilities;
@@ -4795,11 +5086,13 @@ newmedia:
 			}
 		}
 
-		/* tell the persistent inventory this drive is now empty
+		/*
+		 * tell the persistent inventory this drive is now empty
 		 */
 		pi_driveempty(drivep->d_index);
 
-		/* invalidate all positional descriptors
+		/*
+		 * invalidate all positional descriptors
 		 */
 		Mediap->M_pos = POS_UNKN;
 		Mediap->M_flmfixvalpr = BOOL_FALSE;
@@ -4808,11 +5101,13 @@ newmedia:
 		fileh = DH_NULL;
 
 
-		/* ask for a media change: supply a list of media objects
+		/*
+		 * ask for a media change: supply a list of media objects
 		 * which may contain useful media files
 		 */
 		if (dlog_allowed()) {
-			/* If an alert program has been specified, run it.
+			/*
+			 * If an alert program has been specified, run it.
 			 */
 			if (media_change_alert_program != NULL)
 				system(media_change_alert_program);
@@ -4867,7 +5162,8 @@ newmedia:
 	/* NOTREACHED */
 }
 
-/* figures out and calls if needed do_end_read().
+/*
+ * figures out and calls if needed do_end_read().
  */
 static void
 Media_end(Media_t *Mediap)
@@ -4891,7 +5187,8 @@ Media_end(Media_t *Mediap)
 
 /* Persistent inventory operators *******************************************/
 
-/* the persistent inventory is an mmap()ed file containing a hierarchical
+/*
+ * the persistent inventory is an mmap()ed file containing a hierarchical
  * representation of all the media files generated by a dump session. it
  * is useful for asking questions about how much of the dump remains to
  * be restored.
@@ -4924,7 +5221,8 @@ pi_unlock(void)
 	qlock_unlock(tranp->t_pilockh);
 }
 
-/* sets check point in media file descriptor
+/*
+ * sets check point in media file descriptor
  */
 static void
 pi_checkpoint(dh_t fileh, drive_mark_t *drivemarkp, xfs_ino_t ino, off64_t off)
@@ -4936,7 +5234,8 @@ pi_checkpoint(dh_t fileh, drive_mark_t *drivemarkp, xfs_ino_t ino, off64_t off)
 	pi_unlock();
 }
 
-/* lock must be held by caller
+/*
+ * lock must be held by caller
  */
 static bool_t
 pi_allocdesc(dh_t *deschp)
@@ -4952,7 +5251,8 @@ pi_allocdesc(dh_t *deschp)
 		/* REFERENCED */
 		int rval;
 
-		/* first unmap if any existing descriptors
+		/*
+		 * first unmap if any existing descriptors
 		 */
 		if (descp) {
 			assert(olddescpgcnt > 0);
@@ -4964,7 +5264,8 @@ pi_allocdesc(dh_t *deschp)
 			assert(olddescpgcnt == 0);
 		}
 
-		/* remap with DAU more pages of descriptors
+		/*
+		 * remap with DAU more pages of descriptors
 		 */
 		assert(stpgcnt <= (ix_t)INTGENMAX);
 		assert(newdescpgcnt > 0);
@@ -5005,7 +5306,8 @@ pi_allocdesc(dh_t *deschp)
 	return BOOL_TRUE;
 }
 
-/* inserts the indexed file into the given stream. ensures that all
+/*
+ * inserts the indexed file into the given stream. ensures that all
  * previous files are represented as well. if dmfix is not valid, only
  * adds objects.
  */
@@ -5044,7 +5346,8 @@ pi_insertfile(ix_t drivecnt,
 
 	pi_lock();
 
-	/* first alloc stream descriptors if needed
+	/*
+	 * first alloc stream descriptors if needed
 	 */
 	if (persp->s.strmheadh == DH_NULL) {
 		for (strmix = 0; strmix < drivecnt; strmix++) {
@@ -5058,7 +5361,8 @@ pi_insertfile(ix_t drivecnt,
 		}
 	}
 
-	/* get handle to this stream
+	/*
+	 * get handle to this stream
 	 */
 	for (strmix = 0,
 	      strmh = persp->s.strmheadh
@@ -5070,7 +5374,8 @@ pi_insertfile(ix_t drivecnt,
 		;
 	assert(strmh != DH_NULL);
 
-	/* get handle to this object by walking/constructing this stream's
+	/*
+	 * get handle to this object by walking/constructing this stream's
 	 * object list, up to the desired object
 	 */
 	objh = prevobjh = DH_NULL;
@@ -5096,7 +5401,8 @@ pi_insertfile(ix_t drivecnt,
 		}
 	}
 
-	/* update the object fields if not yet valid
+	/*
+	 * update the object fields if not yet valid
 	 */
 	if (idlabvalpr
 	     &&
@@ -5124,7 +5430,8 @@ pi_insertfile(ix_t drivecnt,
 		DH2O(objh)->o_fmfsixvalpr = BOOL_TRUE;
 	}
 
-	/* record the previous object's id and label if not yet valid
+	/*
+	 * record the previous object's id and label if not yet valid
 	 */
 	if (prevobjh != DH_NULL
 	     &&
@@ -5138,7 +5445,8 @@ pi_insertfile(ix_t drivecnt,
 		DH2O(prevobjh)->o_idlabvalpr = BOOL_TRUE;
 	}
 
-	/* if the dump file and dump media file indices are valid,
+	/*
+	 * if the dump file and dump media file indices are valid,
 	 * and the previous object has at least one media file with its
 	 * dump file index valid, can infer the index of the last media
 	 * file on the previous dump object.
@@ -5180,7 +5488,8 @@ pi_insertfile(ix_t drivecnt,
 		pi_lock();
 	}
 
-	/* if don't know dump stream media file index, can't add any media files
+	/*
+	 * if don't know dump stream media file index, can't add any media files
 	 */
 	if (! dmfixvalpr) {
 		pi_unlock();
@@ -5188,7 +5497,8 @@ pi_insertfile(ix_t drivecnt,
 		return DH_NULL;
 	}
 
-	/* get handle to this file by walking/constructing this object's
+	/*
+	 * get handle to this file by walking/constructing this object's
 	 * file list, up to the desired file
 	 */
 	fileh = DH_NULL;
@@ -5214,7 +5524,8 @@ pi_insertfile(ix_t drivecnt,
 		}
 	}
 
-	/* update the media file fields not yet valid
+	/*
+	 * update the media file fields not yet valid
 	 */
 	if (egrpvalpr && ! DH2F(fileh)->f_valpr) {
 		assert(! (DH2F(fileh)->f_flags & PF_INV));
@@ -5225,11 +5536,13 @@ pi_insertfile(ix_t drivecnt,
 		DH2F(fileh)->f_valpr = BOOL_TRUE;
 	}
 
-	/* set flags
+	/*
+	 * set flags
 	 */
 	DH2F(fileh)->f_flags = flags;
 
-	/* if we know the file size,
+	/*
+	 * if we know the file size,
 	 * update it
 	 */
 	if (fileszvalpr) {
@@ -5242,7 +5555,8 @@ pi_insertfile(ix_t drivecnt,
 	return fileh;
 }
 
-/* add pers file desc if not already present. will automatically
+/*
+ * add pers file desc if not already present. will automatically
  * update/alloc pers obj and strm descriptors. If given a session inventory,
  * attempt to incorporate into pi. also, initializes completion stats.
  */
@@ -5266,7 +5580,8 @@ pi_addfile(Media_t *Mediap,
 		persp->s.stat_valpr = BOOL_TRUE;
 	}
 
-	/* if we see a terminator, we know we have seen the end of
+	/*
+	 * if we see a terminator, we know we have seen the end of
 	 * a stream.
 	 */
 	if (MEDIA_TERMINATOR_CHK(mrhdrp)) {
@@ -5299,10 +5614,12 @@ pi_addfile(Media_t *Mediap,
 		return fileh;
 	}
 
-	/* data file
+	/*
+	 * data file
 	 */
 	if (scrhdrp->cih_mediafiletype == CIH_MEDIAFILETYPE_DATA) {
-		/* tell the inventory about this media file
+		/*
+		 * tell the inventory about this media file
 		 */
 		fileh = pi_insertfile(drhdrp->dh_drivecnt,
 				       drhdrp->dh_driveix,
@@ -5330,7 +5647,8 @@ pi_addfile(Media_t *Mediap,
 		}
 		assert(drhdrp->dh_drivecnt > 0);
 		if (drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1) {
-			/* if this is not in the last stream, we know
+			/*
+			 * 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
 			 */
@@ -5357,7 +5675,8 @@ pi_addfile(Media_t *Mediap,
 					       (off64_t)0);
 		}
 		if (! (drivep->d_capabilities & DRIVE_CAP_FILES)) {
-			/* if drive does not support multiple files,
+			/*
+			 * if drive does not support multiple files,
 			 * we know this is end of object and stream
 			 */
 			pi_seestrmend(drhdrp->dh_driveix);
@@ -5367,7 +5686,8 @@ pi_addfile(Media_t *Mediap,
 		return fileh;
 	}
 
-	/* inventory file
+	/*
+	 * inventory file
 	 */
 	if (scrhdrp->cih_mediafiletype == CIH_MEDIAFILETYPE_INVENTORY) {
 		fileh = pi_insertfile(drhdrp->dh_drivecnt,
@@ -5432,17 +5752,20 @@ pi_addfile(Media_t *Mediap,
 			bool_t ok;
 			bool_t donepr;
 
-			/* read inventory into buffer
+			/*
+			 * read inventory into buffer
 			 */
 			bufszincr = IBPGINCR * PGSZ;
-				/* use 4096, no need to be correlated
+				/*
+				 * use 4096, no need to be correlated
 				 * with system page size
 				 */
 			bufsz = bufszincr;
 			buflen = 0;
 			bufp = (char *)malloc(bufsz);
 
-			/* need to read until we hit EOF/EOD. that's the only
+			/*
+			 * need to read until we hit EOF/EOD. that's the only
 			 * way to know how big the inventory is. mark the Media
 			 * current media file as no longer at hdr.
 			 */
@@ -5478,7 +5801,8 @@ pi_addfile(Media_t *Mediap,
 				}
 			}
 
-			/* ask inventory to convert buffer into session
+			/*
+			 * ask inventory to convert buffer into session
 			 * desc.
 			 */
 			sessp = 0;
@@ -5498,7 +5822,8 @@ pi_addfile(Media_t *Mediap,
 				      "on-media session "
 				      "inventory corrupt\n"));
 			} else {
-				/* if root, update online inventory.
+				/*
+				 * if root, update online inventory.
 				 */
 				if (! geteuid()
 				     &&
@@ -5510,7 +5835,8 @@ pi_addfile(Media_t *Mediap,
 					inv_put_sessioninfo(&sessinfo);
 				}
 
-				/* convert into pi format
+				/*
+				 * convert into pi format
 				 */
 				mlog(MLOG_VERBOSE | MLOG_MEDIA,
 				      "using on-media session inventory\n");
@@ -5526,7 +5852,8 @@ pi_addfile(Media_t *Mediap,
 	return DH_NULL;
 }
 
-/* translate a session inventory into a pi
+/*
+ * translate a session inventory into a pi
  */
 static bool_t
 pi_transcribe(inv_session_t *sessp)
@@ -5534,7 +5861,8 @@ pi_transcribe(inv_session_t *sessp)
 	ix_t strmcnt;
 	ix_t strmix;
 
-	/* traverse inventory, transcribing into pers inv.
+	/*
+	 * traverse inventory, transcribing into pers inv.
 	 */
 	strmcnt =  (size_t)sessp->s_nstreams;
 	for (strmix = 0; strmix < strmcnt; strmix++) {
@@ -5553,7 +5881,8 @@ pi_transcribe(inv_session_t *sessp)
 		mediaix = 0;
 		dumpmediafileix = 0;
 
-		/* insert all media files from this stream. note that
+		/*
+		 * insert all media files from this stream. note that
 		 * the media object representation is inverted
 		 */
 		for (fileix = 0; fileix < filecnt; fileix++) {
@@ -5614,7 +5943,8 @@ pi_transcribe(inv_session_t *sessp)
 	return BOOL_TRUE;
 }
 
-/* clean up pers. inv: initially no media objects in drives. flags may
+/*
+ * clean up pers. inv: initially no media objects in drives. flags may
  * be set from previously interrupted invocation.
  */
 static void
@@ -5646,7 +5976,8 @@ pi_preclean(void)
 	}
 }
 
-/* tell pi no media objects are in this drive
+/*
+ * tell pi no media objects are in this drive
  */
 static void
 pi_driveempty(ix_t driveix)
@@ -5686,7 +6017,8 @@ pi_driveempty(ix_t driveix)
 	pi_unlock();
 }
 
-/* tell pi this media object is in the drive
+/*
+ * tell pi this media object is in the drive
  */
 static void
 pi_note_indrive(ix_t driveix, uuid_t media_id)
@@ -5720,7 +6052,8 @@ done:
 	pi_unlock();
 }
 
-/* tell pi this media file is under the head of the drive containing the object
+/*
+ * 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)
@@ -5750,7 +6083,8 @@ pi_note_underhead(dh_t thisobjh, dh_t thisfileh)
 	pi_unlock();
 }
 
-/* mark the pi stream indicating all objects in that stream are known.
+/*
+ * mark the pi stream indicating all objects in that stream are known.
  */
 static void
 pi_seestrmend(ix_t strmix)
@@ -5760,7 +6094,8 @@ pi_seestrmend(ix_t strmix)
 
 	pi_lock();
 
-	/* get handle to the indexed stream
+	/*
+	 * get handle to the indexed stream
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
@@ -5771,7 +6106,8 @@ pi_seestrmend(ix_t strmix)
 	      strmh = DH2S(strmh)->s_nexth)
 		;
 
-	/* if an empty stream (can happen when dump interrupted),
+	/*
+	 * if an empty stream (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
 	if (strmh == DH_NULL) {
@@ -5779,7 +6115,8 @@ pi_seestrmend(ix_t strmix)
 		return;
 	}
 
-	/* set stream flag and object and file counts
+	/*
+	 * set stream flag and object and file counts
 	 */
 	DH2S(strmh)->s_lastobjknwnpr = BOOL_TRUE;
 
@@ -5787,7 +6124,8 @@ pi_seestrmend(ix_t strmix)
 	pi_show(" after pi_seestrmend");
 }
 
-/* mark pi indicating all media files in object are known
+/*
+ * mark pi indicating all media files in object are known
  */
 static void
 pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
@@ -5798,7 +6136,8 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 
 	pi_lock();
 
-	/* get handle to the indexed stream
+	/*
+	 * get handle to the indexed stream
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
@@ -5809,7 +6148,8 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	      strmh = DH2S(strmh)->s_nexth)
 		;
 
-	/* if an empty stream (can happen when dump interrupted),
+	/*
+	 * if an empty stream (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
 	if (strmh == DH_NULL) {
@@ -5818,7 +6158,8 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	}
 
 
-	/* get handle to indexed object in stream
+	/*
+	 * get handle to indexed object in stream
 	 */
 	for (ix = 0,
 	      objh = DH2S(strmh)->s_cldh
@@ -5829,7 +6170,8 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	      objh = DH2O(objh)->o_nexth)
 		;
 
-	/* if an empty object (can happen when dump interrupted),
+	/*
+	 * if an empty object (can happen when dump interrupted),
 	 * nothing need be done, so return
 	 */
 	if (objh == DH_NULL) {
@@ -5838,7 +6180,8 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	}
 
 
-	/* set object flag
+	/*
+	 * set object flag
 	 */
 	DH2O(objh)->o_lmfknwnpr = BOOL_TRUE;
 
@@ -5846,7 +6189,8 @@ pi_seeobjstrmend(ix_t strmix, ix_t mediaix)
 	pi_show(" after pi_seeobjstrmend");
 }
 
-/* scans pi to determine ino of last file wholly or partially contained on
+/*
+ * scans pi to determine ino of last file wholly or partially contained on
  * this mfile. must err on the high side if partial info.
  * NOTE: assumes caller locks pi!
  */
@@ -5858,7 +6202,8 @@ pi_scanfileendino(dh_t fileh)
 
 	assert(fileh != DH_NULL);
 
-	/* traverse the pi tree, looking for the next media file after
+	/*
+	 * traverse the pi tree, looking for the next media file after
 	 */
 	for (strmh = persp->s.strmheadh
 	     ;
@@ -5909,7 +6254,8 @@ pi_scanfileendino(dh_t fileh)
 	return INO64MAX;
 }
 
-/* used to detemine range of extent groups still to be restored
+/*
+ * used to detemine range of extent groups still to be restored
  * from media file. *--o
  */
 static void
@@ -5923,7 +6269,8 @@ pi_bracketneededegrps(dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp)
 
 	assert(thisfileh != DH_NULL);
 
-	/* traverse the pi tree, looking for fileh
+	/*
+	 * traverse the pi tree, looking for fileh
 	 */
 	pi_lock();
 	assert(DH2F(thisfileh)->f_valpr);
@@ -5969,13 +6316,15 @@ done:
 
 	assert(thisfoundpr);
 
-	/* initially the lower bracket is this file descriptor's
+	/*
+	 * 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;
 
-	/* if the closest valid preceeding media file's current egrp is
+	/*
+	 * if the closest valid preceeding media file's current egrp is
 	 * greater, use it as the lower bracket
 	 */
 	if (prech != DH_NULL
@@ -5984,7 +6333,8 @@ done:
 		*first_egrp = DH2F(prech)->f_curegrp;
 	}
 
-	/* the upper bracket is initially the end of the world.
+	/*
+	 * the upper bracket is initially the end of the world.
 	 * if we found a valid following file descriptor describing a
 	 * media file which has already been at least restored, use
 	 * its first egrp as an upper bracket.
@@ -6012,7 +6362,8 @@ pi_update_stats(off64_t sz)
 	pi_unlock();
 }
 
-/* pi_iterator - each invocation of the iterator advances to the next media file
+/*
+ * pi_iterator - each invocation of the iterator advances to the next media file
  * in the dump session, walking the media file hierarchy depth-wise. if
  * an object's file list is exhausted and the first media file in the next
  * object is returned and the exhausted object's last media file has not yet
@@ -6124,7 +6475,8 @@ pi_iter_nextfileh(pi_iter_t *iterp,
 	return iterp->fileh;
 }
 
-/* produces a list of media objects needed. also indicates if we know
+/*
+ * produces a list of media objects needed. also indicates if we know
  * some unidentified media objects are needed, and if it is possible
  * that we need some unidentifed objects, but don't know for sure.
  * if markskippr is set, set the f_nondirskipr flag if the media file
@@ -6159,7 +6511,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 	dh_t lastobjaddedh;
 	int objlistlen;
 
-	/* no point in proceeding if pi not begun
+	/*
+	 * no point in proceeding if pi not begun
 	 */
 	if (persp->s.strmheadh == DH_NULL) {
 		*knownholesprp = BOOL_TRUE;
@@ -6167,17 +6520,20 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 		return 0;
 	}
 
-	/* to hold a list of media object handles: caller must free
+	/*
+	 * to hold a list of media object handles: caller must free
 	 * using pi_neededobjs_free().
 	 */
 	bagp = bag_alloc();
 
-	/* allocate two iterators to scan pi
+	/*
+	 * allocate two iterators to scan pi
 	 */
 	tailiterp = pi_iter_alloc();
 	headiterp = pi_iter_alloc();
 
-	/* set the handle to the last file added to the list to NULL.
+	/*
+	 * 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,
 	 * preventing the same object from being added more than once.
 	 * this works because the media files for a given object will
@@ -6186,7 +6542,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 	lastobjaddedh = DH_NULL;
 	objlistlen = 0;
 
-	/* these will be set TRUE if the tail iterator ever indicates
+	/*
+	 * these will be set TRUE if the tail iterator ever indicates
 	 * we crossed an object or stream boundary and did not see a
 	 * valid last file  or last object respectively. can accumulate
 	 * the booleans, since iterator never sets FALSE, just TRUE.
@@ -6194,7 +6551,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 	maybeobjmissingpr = BOOL_FALSE;
 	maybefilemissingpr = BOOL_FALSE;
 
-	/* this will be set TRUE if we see a needed media file but the
+	/*
+	 * this will be set TRUE if we see a needed media file but the
 	 * object containing the media file has not been IDed.
 	 */
 	knownobjmissingpr = BOOL_FALSE;
@@ -6204,7 +6562,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 
 	tailh = DH_NULL;
 
-	/* lock up the inventory during the scan
+	/*
+	 * lock up the inventory during the scan
 	 */
 	pi_lock();
 
@@ -6212,7 +6571,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 		egrp_t headegrp;
 		bool_t foundgappr;
 
-		/* advance the head until we see the next media file which has
+		/*
+		 * advance the head until we see the next media file which has
 		 * a valid egrp, or until we run out of media files.
 		 */
 		do {
@@ -6231,7 +6591,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 			headegrp = DH2F(headh)->f_firstegrp;
 		}
 
-		/* see if the range of egrps from head up to but not including
+		/*
+		 * see if the range of egrps from head up to but not including
 		 * tail needed according to ino map
 		 */
 		if (gapneeded(&tailegrp, &headegrp)) {
@@ -6240,12 +6601,14 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 			foundgappr = BOOL_FALSE;
 		}
 
-		/* now bring tail up to head, adding objects and setting flags
+		/*
+		 * now bring tail up to head, adding objects and setting flags
 		 * along the way. note special handling of NULL tailh. possible
 		 * only first time through: ignore. also, ignore inv and term.
 		 */
 		do {
-		    /* if requested, mark media files not needed
+		    /*
+		     * if requested, mark media files not needed
 		     */
 		    if (markskippr
 			 &&
@@ -6261,7 +6624,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 			    DH2F(tailh)->f_nondirskippr = BOOL_TRUE;
 		    }
 
-		    /* build up list of needed objects
+		    /*
+		     * build up list of needed objects
 		     */
 		    if (foundgappr
 			 &&
@@ -6296,7 +6660,8 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 			    }
 		    }
 
-		    /* pull the tail up to the next media file
+		    /*
+		     * pull the tail up to the next media file
 		     */
 		    tailh = pi_iter_nextfileh(tailiterp,
 					       &maybeobjmissingpr,
@@ -6309,12 +6674,14 @@ pi_neededobjs_nondir_alloc(bool_t *knownholesprp,
 
 	pi_unlock();
 
-	/* free the iterators
+	/*
+	 * free the iterators
 	 */
 	pi_iter_free(tailiterp);
 	pi_iter_free(headiterp);
 
-	/* free the bag and return NULL if object list empty
+	/*
+	 * free the bag and return NULL if object list empty
 	 */
 	if (objlistlen == 0) {
 		bag_free(bagp);
@@ -6412,7 +6779,8 @@ pi_neededobjs_free(bag_t *bagp)
 	bag_free(bagp);
 }
 
-/* a macro predicate to indicate if we know we are done. if we are not
+/*
+ * 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
@@ -6443,7 +6811,8 @@ pi_alldone(void)
 	}
 }
 
-/* tells the persistent inventory we hit end-of-data while examining the
+/*
+ * tells the persistent inventory we hit end-of-data while examining the
  * object specified by the index param. this tells us we've seen the end
  * of the stream as well as the end of the object.
  */
@@ -6458,7 +6827,8 @@ pi_hiteod(ix_t strmix, ix_t objix)
 
 	pi_lock();
 
-	/* get handle to the indexed stream
+	/*
+	 * get handle to the indexed stream
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
@@ -6470,7 +6840,8 @@ pi_hiteod(ix_t strmix, ix_t objix)
 		;
 	assert(strmh != DH_NULL);
 
-	/* get index to last object in stream
+	/*
+	 * get index to last object in stream
 	 */
 	for (objcnt = 0, objh = DH2S(strmh)->s_cldh
 	     ;
@@ -6483,7 +6854,8 @@ pi_hiteod(ix_t strmix, ix_t objix)
 
 	pi_unlock();
 
-	/* can't possibly happen, but check for case where pi indicates
+	/*
+	 * can't possibly happen, but check for case where pi indicates
 	 * other media objects beyond this one.
 	 */
 	if (objix != lastobjix) {
@@ -6500,7 +6872,8 @@ pi_hiteod(ix_t strmix, ix_t objix)
 	pi_seeobjstrmend(strmix, lastobjix);
 }
 
-/* tells the persistent inventory we hit end-of-media while examining the
+/*
+ * tells the persistent inventory we hit end-of-media while examining the
  * object specified by the index param. this tells us we've seen the end
  * of the object.
  */
@@ -6521,7 +6894,8 @@ pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 
 	pi_lock();
 
-	/* get handle to the indexed stream
+	/*
+	 * get handle to the indexed stream
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
@@ -6533,7 +6907,8 @@ pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 		;
 	assert(strmh != DH_NULL);
 
-	/* get index to last object in stream
+	/*
+	 * get index to last object in stream
 	 */
 	for (objcnt = 0, objh = DH2S(strmh)->s_cldh
 	     ;
@@ -6546,7 +6921,8 @@ pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 
 	pi_unlock();
 
-	/* can't possibly happen, but check for case where pi indicates
+	/*
+	 * can't possibly happen, but check for case where pi indicates
 	 * other media objects beyond this one.
 	 */
 	if (objix != lastobjix) {
@@ -6564,7 +6940,8 @@ pi_hitnextdump(ix_t strmix, ix_t objix, ix_t lastfileix)
 	pi_seeobjstrmend(strmix, lastobjix);
 }
 
-/* returns TRUE if pi is certain no more useful media files remaining
+/*
+ * returns TRUE if pi is certain no more useful media files remaining
  * on object. if any doubt, such as not knowing the last media file on
  * the object, returns FALSE.
  */
@@ -6580,7 +6957,8 @@ pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 
 	pi_lock();
 
-	/* get handle to the indexed stream
+	/*
+	 * get handle to the indexed stream
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
@@ -6592,7 +6970,8 @@ pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 		;
 	assert(strmh != DH_NULL);
 
-	/* get handle to indexed object
+	/*
+	 * get handle to indexed object
 	 */
 	for (ix = 0, objh = DH2S(strmh)->s_cldh
 	     ;
@@ -6603,14 +6982,16 @@ pi_know_no_more_on_object(purp_t purp, ix_t strmix, ix_t objix)
 		;
 	assert(objh != DH_NULL);
 
-	/* if don't know last media file on object, return FALSE
+	/*
+	 * if don't know last media file on object, return FALSE
 	 */
 	if (! DH2O(objh)->o_lmfknwnpr) {
 		pi_unlock();
 		return BOOL_FALSE;
 	}
 
-	/* check all media files on object. if any are not marked done,
+	/*
+	 * check all media files on object. if any are not marked done,
 	 * return FALSE.
 	 */
 	for (fileh = DH2O(objh)->o_cldh
@@ -6658,7 +7039,8 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 
 	pi_lock();
 
-	/* get handle to the indexed stream
+	/*
+	 * get handle to the indexed stream
 	 */
 	for (ix = 0,
 	      strmh = persp->s.strmheadh
@@ -6670,7 +7052,8 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 		;
 	assert(strmh != DH_NULL);
 
-	/* get handle to indexed object
+	/*
+	 * get handle to indexed object
 	 */
 	for (ix = 0,
 	      objh = DH2S(strmh)->s_cldh
@@ -6682,14 +7065,16 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 		;
 	assert(objh != DH_NULL);
 
-	/* if don't know last media file on object, return FALSE
+	/*
+	 * if don't know last media file on object, return FALSE
 	 */
 	if (! DH2O(objh)->o_lmfknwnpr) {
 		pi_unlock();
 		return BOOL_FALSE;
 	}
 
-	/* check all files on object after indexed file. if any are not marked
+	/*
+	 * check all files on object after indexed file. if any are not marked
 	 * done, return FALSE. skip inventory and terminator files.
 	 */
 	for (ix = 0,
@@ -6727,7 +7112,8 @@ pi_know_no_more_beyond_on_object(purp_t purp,
 	return BOOL_TRUE;
 }
 
-/* indicates if the given extent group range is called for by the
+/*
+ * indicates if the given extent group range is called for by the
  * ino map. *---o (endpoint not inclusive)
  */
 static bool_t
@@ -6804,7 +7190,8 @@ cntobj(bag_t *bagp)
 
 /* misc. static functions ***************************************************/
 
-/* queries inventory for the base of the given session. if the given session
+/*
+ * queries inventory for the base of the given session. if the given session
  * was a resumed dump, then must be last dump of same level. otherwise,
  * must be last dump of a lesser level
  */
@@ -6820,13 +7207,15 @@ askinvforbaseof(uuid_t baseid, inv_session_t *sessp)
 	level = (ix_t)sessp->s_level;
 	resumedpr = sessp->s_isresumed;
 
-	/* don't look for base if level 0 and not resumed
+	/*
+	 * don't look for base if level 0 and not resumed
 	 */
 	if (level == 0 && ! resumedpr) {
 		return BOOL_TRUE;
 	}
 
-	/* open the inventory for this file system
+	/*
+	 * open the inventory for this file system
 	 */
 	invtok = inv_open(INV_BY_UUID,
 			   INV_SEARCH_ONLY,
@@ -6837,7 +7226,8 @@ askinvforbaseof(uuid_t baseid, inv_session_t *sessp)
 		return BOOL_FALSE;
 	}
 
-	/* get the base session
+	/*
+	 * get the base session
 	 */
 	if (resumedpr) {
 		ok = inv_lastsession_level_equalto(&sessp->s_fsid,
@@ -6857,16 +7247,19 @@ askinvforbaseof(uuid_t baseid, inv_session_t *sessp)
 		return BOOL_FALSE;
 	}
 
-	/* close the inventory
+	/*
+	 * close the inventory
 	 */
 	ok = inv_close(invtok);
 	assert(ok);
 
-	/* return id of base session
+	/*
+	 * return id of base session
 	 */
         uuid_copy(baseid, basesessp->s_sesid);
 
-	/* free the base session descriptor
+	/*
+	 * free the base session descriptor
 	 */
 	inv_free_session(&basesessp);
 
@@ -6924,7 +7317,8 @@ dumpcompat(bool_t resumepr, ix_t level, uuid_t baseid, bool_t logpr)
 	return BOOL_TRUE;
 }
 
-/* prompts for a new media object. supplies list of media objects still
+/*
+ * prompts for a new media object. supplies list of media objects still
  * needed, and indicates if there are or may be unidentified media objects
  * still needed/available
  */
@@ -6963,7 +7357,8 @@ retry:
 	assert(preamblecnt <= PREAMBLEMAX);
 	dlog_begin(preamblestr, preamblecnt);
 
-	/* query: ask if media changed or declined
+	/*
+	 * query: ask if media changed or declined
 	 */
 	if (drivecnt > 1) {
 		sprintf(question, _(
@@ -7083,7 +7478,8 @@ retry:
 	return responseix == doix;
 }
 
-/* prompts the operator, asking if the current media file header describes
+/*
+ * prompts the operator, asking if the current media file header describes
  * the dump to be restored
  */
 static bool_t
@@ -7119,7 +7515,8 @@ retry:
 	assert(preamblecnt <= PREAMBLEMAX);
 	dlog_begin(preamblestr, preamblecnt);
 
-	/* display vital stats and ask if this one should be restored
+	/*
+	 * display vital stats and ask if this one should be restored
 	 */
 	if (drivecnt > 0) {
 		sprintf(introstring, _(
@@ -7216,7 +7613,8 @@ retry:
 	return responseix == doix;
 }
 
-/* restore_file - knows how to restore non-directory files
+/*
+ * restore_file - knows how to restore non-directory files
  *
  * uses the tree's callback iterator, which will call me for each
  * link to the specified inode.
@@ -7247,7 +7645,8 @@ restore_file(drive_t *drivep,
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	cb_context_t context;
 
-	/* ask the tree to call me back for each link to this inode.
+	/*
+	 * ask the tree to call me back for each link to this inode.
 	 * my callback will restore the file the first time it is
 	 * invoked, and create a hard link in subsequent calls.
 	 */
@@ -7272,7 +7671,8 @@ restore_file(drive_t *drivep,
 	    return rv;
 }
 
-/* called for each link to the file described by fhdr. the first
+/*
+ * called for each link to the file described by fhdr. the first
  * call is detected by noting linkpr is FALSE, and is used to create/
  * update the first link to the file, using path1. subsequent calls have
  * linkpr set false, and should link path1 to path2. if path1 is ever null,
@@ -7301,13 +7701,15 @@ restore_file_cb(void *cp, bool_t linkpr, char *path1, char *path2)
 
 	if (! linkpr) {
 		if (path1) {
-			/* cache the path for use in restoring attributes
+			/*
+			 * cache the path for use in restoring attributes
 			 * and extended attributes
 			 */
 			strcpy(strctxp->sc_path, path1);
 		}
 
-		/* call type-specific function to create the file
+		/*
+		 * call type-specific function to create the file
 		 */
 		switch (bstatp->bs_mode & S_IFMT) {
 		case S_IFREG:
@@ -7448,7 +7850,8 @@ done:
 	return 0;
 }
 
-/* called to begin a regular file. if no path given, or if just toc,
+/*
+ * called to begin a regular file. if no path given, or if just toc,
  * don't actually write, just read. also get into that situation if
  * cannot prepare destination. fd == -1 signifies no write. *statp
  * is set to indicate drive errors. returns FALSE if should abort
@@ -7547,7 +7950,8 @@ restore_reg(drive_t *drivep,
 
 	if (persp->a.dstdirisxfspr) {
 
-		/* set the extended inode flags, except those which must
+		/*
+		 * set the extended inode flags, except those which must
 		 * be set only after all data has been restored.
 		 */
 		assert(bstatp->bs_extsize >= 0);
@@ -7579,7 +7983,8 @@ restore_reg(drive_t *drivep,
 	return BOOL_TRUE;
 }
 
-/* called to peel a regular file's extent groups from the media.
+/*
+ * called to peel a regular file's extent groups from the media.
  * if no path given, or if just toc, don't actually write, just
  * read. fd == -1 signifies no write. *rvp is set to indicate
  * drive errors. returns FALSE if should abort this iteration.
@@ -7598,10 +8003,12 @@ restore_extent_group(drive_t *drivep,
 	off64_t bytesread;
 	rv_t rv;
 
-	/* copy data extents from media to the file
+	/*
+	 * copy data extents from media to the file
 	 */
 	for (;;) {
-		/* read the extent header
+		/*
+		 * read the extent header
 		 */
 		rv = read_extenthdr(drivep, &ehdr, ehcs);
 		if (rv != RV_OK) {
@@ -7615,11 +8022,13 @@ restore_extent_group(drive_t *drivep,
 		      ehdr.eh_sz,
 		      ehdr.eh_flags);
 
-		/* if we see the specially marked last extent hdr,
+		/*
+		 * if we see the specially marked last extent hdr,
 		 * we are done.
 		 */
 		if (ehdr.eh_type == EXTENTHDR_TYPE_LAST) {
-			/* For a wholly sparse file, there is no HOLE
+			/*
+			 * For a wholly sparse file, there is no HOLE
 			 * record; advance restoredsz to EOF.
 			 */
 			if (!restoredsz)
@@ -7627,7 +8036,8 @@ restore_extent_group(drive_t *drivep,
 			break;
 		}
 
-		/* if its an ALIGNment extent, discard the extent.
+		/*
+		 * if its an ALIGNment extent, discard the extent.
 		 */
 		if (ehdr.eh_type == EXTENTHDR_TYPE_ALIGN) {
 			size_t sz;
@@ -7641,19 +8051,22 @@ restore_extent_group(drive_t *drivep,
 			continue;
 		}
 
-		/* Add up extents restored to later check if the file
+		/*
+		 * Add up extents restored to later check if the file
 		 * is done.
 		 */
 		restoredsz += ehdr.eh_sz;  /* Increments of block size (usually 512) */
 
-		/* Holes do not need to be restored since we now
+		/*
+		 * 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) {
 			continue;
 		}
 
-		/* real data
+		/*
+		 * real data
 		 */
 		assert(ehdr.eh_type == EXTENTHDR_TYPE_DATA);
 		bytesread = 0;
@@ -7674,7 +8087,8 @@ restore_extent_group(drive_t *drivep,
 		}
 	}
 
-	/* The extent group has been restored.  If the file is not
+	/*
+	 * The extent group has been restored.  If the file is not
 	 * complete, we may need to co-ordinate with other restore
 	 * streams to time the restoration of extended attributes
 	 * and certain extended inode flags. Register the portion
@@ -7691,7 +8105,8 @@ restore_extent_group(drive_t *drivep,
 	return BOOL_TRUE;
 }
 
-/* apply the attributes that can only go on now that all data
+/*
+ * apply the attributes that can only go on now that all data
  * and extended attributes have been applied. fd == -1 signifies
  * no write, due to unknown path or toc only.
  */
@@ -7716,7 +8131,8 @@ restore_complete_reg(stream_context_t *strcxtp)
 		return BOOL_TRUE;
 	}
 
-	/* set the access and modification times
+	/*
+	 * set the access and modification times
 	 */
 	utimbuf.actime = (time32_t)bstatp->bs_atime.tv_sec;
 	utimbuf.modtime = (time32_t)bstatp->bs_mtime.tv_sec;
@@ -7729,7 +8145,8 @@ restore_complete_reg(stream_context_t *strcxtp)
 		      strerror(errno));
 	}
 
-	/* set the owner and group (if enabled)
+	/*
+	 * set the owner and group (if enabled)
 	 */
 	if (strcxtp->sc_ownerset == BOOL_FALSE && persp->a.ownerpr) {
 		rval = set_file_owner(path, &fd, strcxtp);
@@ -7737,7 +8154,8 @@ restore_complete_reg(stream_context_t *strcxtp)
 			return BOOL_TRUE;
 	}
 
-	/* set the permissions/mode
+	/*
+	 * set the permissions/mode
 	 */
 	rval = fchmod(fd, (mode_t)bstatp->bs_mode);
 	if (rval) {
@@ -7767,7 +8185,8 @@ restore_complete_reg(stream_context_t *strcxtp)
 		HsmEndRestoreFile(path, fd, &strcxtp->sc_hsmflags);
 	}
 
-	/* set any extended inode flags that couldn't be set
+	/*
+	 * 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) {
@@ -7897,7 +8316,8 @@ restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path)
 			(void)close(sockfd);
 
 		} else {
-			/* create the node
+			/*
+			 * create the node
 			*/
 			rval = mknod(path,
 				      (mode_t)bstatp->bs_mode,
@@ -7914,7 +8334,8 @@ restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path)
 			}
 		}
 
-		/* set the owner and group (if enabled)
+		/*
+		 * set the owner and group (if enabled)
 		 */
 		if (persp->a.ownerpr) {
 			rval = chown(path,
@@ -7931,7 +8352,8 @@ restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path)
 			}
 		}
 
-		/* set the permissions/mode
+		/*
+		 * set the permissions/mode
 		 */
 		rval = chmod(path, (mode_t)fhdrp->fh_stat.bs_mode);
 		if (rval) {
@@ -7941,7 +8363,8 @@ restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path)
 			      strerror(errno));
 		}
 
-		/* set the access and modification times
+		/*
+		 * set the access and modification times
 		 */
 		utimbuf.actime = (time32_t)bstatp->bs_atime.tv_sec;
 		utimbuf.modtime = (time32_t)bstatp->bs_mtime.tv_sec;
@@ -7988,7 +8411,8 @@ restore_symlink(drive_t *drivep,
 		}
 	}
 
-	/* read the extent header
+	/*
+	 * read the extent header
 	 */
 	rv = read_extenthdr(drivep, &ehdr, ehcs);
 	if (rv != RV_OK) {
@@ -7996,11 +8420,13 @@ restore_symlink(drive_t *drivep,
 		return BOOL_FALSE;
 	}
 
-	/* symlinks always have one extent
+	/*
+	 * symlinks always have one extent
 	 */
 	assert(ehdr.eh_type == EXTENTHDR_TYPE_DATA);
 
-	/* read the link path extent
+	/*
+	 * read the link path extent
 	 */
 	if (ehdr.eh_sz < (off64_t)(2 * MAXPATHLEN)) {
 		scratch = scratchpath;
@@ -8046,9 +8472,11 @@ restore_symlink(drive_t *drivep,
 	}
 	scratchpath[nread] = 0;
 	if (! tranp->t_toconlypr && path) {
-		/* create the symbolic link
+		/*
+		 * create the symbolic link
 		 */
-		/* NOTE: There is no direct way to set mode for
+		/*
+		 * NOTE: There is no direct way to set mode for
 		 * sym links. Do it using umask.
 		 * No way of setting times for sym links.
 		 */
@@ -8069,7 +8497,8 @@ restore_symlink(drive_t *drivep,
 			return BOOL_TRUE;
 		}
 
-		/* set the owner and group (if enabled)
+		/*
+		 * set the owner and group (if enabled)
 		 */
 		if (persp->a.ownerpr) {
 			rval = lchown(path,
@@ -8238,7 +8667,8 @@ read_dirent(drive_t *drivep,
 	assert(sizeof(direnthdr_t) == DIRENTHDR_SZ);
 	assert(sizeof(direnthdr_v1_t) == DIRENTHDR_SZ);
 
-	/* read the head of the dirent
+	/*
+	 * read the head of the dirent
 	 */
 	nread = read_buf((char *)&tmpdh,
 			  DIRENTHDR_SZ,
@@ -8303,14 +8733,16 @@ read_dirent(drive_t *drivep,
 		return RV_CORRUPT;
 	}
 
-	/* if null, return
+	/*
+	 * if null, return
 	 */
 	if (dhdrp->dh_ino == 0) {
 		assert((size_t)dhdrp->dh_sz == sizeof(direnthdr_t));
 		return RV_OK;
 	}
 
-	/* read the remainder of the dirent.
+	/*
+	 * read the remainder of the dirent.
 	 */
 	assert((size_t)dhdrp->dh_sz <= direntbufsz);
 	assert((size_t)dhdrp->dh_sz >= sizeof(direnthdr_t));
@@ -8398,7 +8830,8 @@ read_extattrhdr(drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs)
 				return RV_CORRUPT;
 			}
 		} else if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_OLD_CHECKSUM) {
-			/* possibly a corrupt header, but most likely an old
+			/*
+			 * possibly a corrupt header, but most likely an old
 			 * header, which cannot be verified due to a bug in how
 			 * its checksum was calculated.
 			 */
@@ -8472,7 +8905,8 @@ restore_extent(filehdr_t *fhdrp,
 
 	if (fd != -1) {
 		assert(path);
-		/* seek to the beginning of the extent.
+		/*
+		 * seek to the beginning of the extent.
 		 * must be on a basic fs blksz boundary.
 		 */
 		assert((off & (off64_t)(BBSIZE - 1)) == 0);
@@ -8504,7 +8938,8 @@ restore_extent(filehdr_t *fhdrp,
 			isrealtime = BOOL_TRUE;
 	}
 
-	/* move from media to fs.
+	/*
+	 * move from media to fs.
 	 */
 	while (sz) {
 		char *bufp;
@@ -8681,7 +9116,8 @@ restore_extent(filehdr_t *fhdrp,
 				      off,
 				      nwritten);
 			}
-			/* stop attempting to write, but complete reads
+			/*
+			 * stop attempting to write, but complete reads
 			 */
 			fd = -1;
 			assert(ntowrite <= (size_t)INTGENMAX);
@@ -8753,7 +9189,8 @@ restore_extattr(drive_t *drivep,
 	if (! isdirpr)
 		isfilerestored = partial_check(bstatp->bs_ino,  bstatp->bs_size);
 
-	/* peel off extattrs until null hdr hit
+	/*
+	 * peel off extattrs until null hdr hit
 	 */
 	for (;;) {
 		size_t recsz;
@@ -8805,7 +9242,8 @@ restore_extattr(drive_t *drivep,
 		if (onlydoreadpr || tranp->t_toconlypr)
 			continue;
 
-		/* NOTE: In the cases below, if we get errors then we issue warnings
+		/*
+		 * NOTE: In the cases below, if we get errors then we issue warnings
 		 * but we do not stop the restoration.
 		 * We can still restore the file possibly without the
 		 * extended attributes.
@@ -8846,7 +9284,8 @@ restore_dir_extattr_cb(char *path, dah_t dah)
 	extattrhdr_t *ahdrp = (extattrhdr_t *)get_extattrbuf(0);
 	bool_t ok;
 
-	/* ask the dirattr abstraction to call me back for each
+	/*
+	 * ask the dirattr abstraction to call me back for each
 	 * extended dirattr associated with this dah.
 	 */
 	ok = dirattr_cb_extattr(dah,
@@ -8879,7 +9318,8 @@ setextattr(char *path, extattrhdr_t *ahdrp)
 	isdmpr = (isrootpr &&
 		   !strncmp((char *)(&ahdrp[1]), dmiattr, sizeof(dmiattr)-1));
 
-	/* If restoreextattrpr not set, then we are here because -D was
+	/*
+	 * If restoreextattrpr not set, then we are here because -D was
 	 * specified. So return unless it looks like a root DMAPI attribute.
 	 */
 	if (!persp->a.restoreextattrpr && !isdmpr)
@@ -8958,7 +9398,8 @@ dump_partials(void)
 }
 
 
-/* There can only be at most 2 partials for a given stream.
+/*
+ * There can only be at most 2 partials for a given stream.
  * An unfinished one from a split and the current one from
  * a multiple group extent or another split.
  * If there are more than 2, then there is an internal error.
@@ -9008,7 +9449,8 @@ check_valid_partials(void)
 }
 #endif
 
-/* partial_reg - Registers files that are only partially restored by
+/*
+ * partial_reg - Registers files that are only partially restored by
  * a dump stream into the persistent state.
  *
  * This is done because DMAPI extended attributes must not be set until
@@ -9043,7 +9485,8 @@ partial_reg(ix_t d_index,
 
 	pi_lock();
 
-	/* Search for a matching inode.  Gaps can exist so we must search
+	/*
+	 * Search for a matching inode.  Gaps can exist so we must search
 	 * all entries.
 	 */
 	for (i=0; i < partialmax; i++) {
@@ -9066,7 +9509,8 @@ partial_reg(ix_t d_index,
 				isptr->is_ino = ino;
 				persp->a.parrestcnt++;
 
-				/* Clear all endoffsets (this value is
+				/*
+				 * Clear all endoffsets (this value is
 				 * used to decide if an entry is used or
 				 * not
 				 */
@@ -9103,7 +9547,8 @@ found:
 	} else {
 		bool_t ret;
 
-		/* entry exists for this drive, just extend the endoffset, the
+		/*
+		 * entry exists for this drive, just extend the endoffset, the
 		 * records will be sequential for any given drive.
 		 */
 		bsptr->endoffset = endoffset;
@@ -9124,7 +9569,8 @@ found:
 }
 
 
-/* Checks the registry of files that are only partially restored by
+/*
+ * Checks the registry of files that are only partially restored by
  * any given dump stream to see if the remainder of the file has
  * been restored by another dump stream.
  */
@@ -9146,7 +9592,8 @@ partial_check (xfs_ino_t ino, off64_t fsize)
 		return BOOL_TRUE;
 	}
 
-	/* Search for the inode.  Gaps can exist so we must search
+	/*
+	 * Search for the inode.  Gaps can exist so we must search
 	 * all entries.
 	 */
 	for (i=0; i < partialmax; i++) {
@@ -9187,7 +9634,8 @@ partial_check2(partial_rest_t *isptr, off64_t fsize)
 	int i;
 
 gapsearch:
-	/* Search the entire set of bytespan records to see if the next
+	/*
+	 * Search the entire set of bytespan records to see if the next
 	 * span has been restored.  Bytespans are not necessarily in order
 	 * so the search is repeated from the start each time.
 	 */
@@ -9240,7 +9688,8 @@ content_overwrite_ok(char *path,
 
 	*exists = BOOL_TRUE;
 
-	/* if file doesn't exist, allow
+	/*
+	 * if file doesn't exist, allow
 	 */
 
 	if (lstat(path, &statbuf)) {
@@ -9251,14 +9700,16 @@ content_overwrite_ok(char *path,
 		return BOOL_TRUE;
 	}
 
-	/* if overwrites absolutely inhibited, disallow
+	/*
+	 * if overwrites absolutely inhibited, disallow
 	 */
 	if (persp->a.existpr) {
 		*reasonstrp = _("overwrites inhibited");
 		return BOOL_FALSE;
 	}
 
-	/* if newer time specified, compare
+	/*
+	 * if newer time specified, compare
 	 */
 	if (persp->a.newerpr) {
 		if ((time32_t)ctime < persp->a.newertime) {
@@ -9267,7 +9718,8 @@ content_overwrite_ok(char *path,
 		}
 	}
 
-	/* don't overwrite changed files
+	/*
+	 * don't overwrite changed files
 	 */
 	if (persp->a.changepr) {
 		if (statbuf.st_ctime >= (time32_t)ctime) {
@@ -9347,7 +9799,8 @@ pi_show_nomloglock(void)
 	int strmix;
 
 
-	/* no point in proceeding if pi not begun
+	/*
+	 * no point in proceeding if pi not begun
 	 */
 	if (persp->s.strmheadh == DH_NULL) {
 		mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA, _(
@@ -9358,7 +9811,8 @@ pi_show_nomloglock(void)
 	mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA, _(
 	      "session inventory display\n"));
 
-	/* iterate over all streams
+	/*
+	 * iterate over all streams
 	 */
 	for (strmh = persp->s.strmheadh, strmix = 0
 	     ;
@@ -9376,7 +9830,8 @@ pi_show_nomloglock(void)
 			      _("\n    media objects not yet identified\n"));
 			continue;
 		}
-		/* iterate over all objects
+		/*
+		 * iterate over all objects
 		 */
 		for (objh = DH2S(strmh)->s_cldh, objix = 0
 		     ;
@@ -9443,7 +9898,8 @@ pi_show_nomloglock(void)
 				continue;
 			}
 
-			/* iterate over all files
+			/*
+			 * iterate over all files
 			 */
 			for (fileh = DH2O(objh)->o_cldh, fileix = 0
 			     ;
diff --git a/restore/dirattr.c b/restore/dirattr.c
index 36b60dc..803a966 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -57,11 +57,13 @@
 
 /* structure definitions used locally ****************************************/
 
-/* node handle limits
+/*
+ * node handle limits
  */
 #ifdef DIRATTRCHK
 
-/* macros for manipulating dirattr handles when handle consistency
+/*
+ * macros for manipulating dirattr handles when handle consistency
  * checking is enabled. the upper bits of a handle will be loaded
  * with a handle checksum.
  */
@@ -83,7 +85,8 @@
 					  ((int)d & HDLDIXMASK)))
 #define DIX_MAX			((off64_t)HDLDIXMASK)
 
-/* each dirattr will hold two check fields: a handle checksum, and unique
+/*
+ * each dirattr will hold two check fields: a handle checksum, and unique
  * pattern, to differentiate a valid dirattr from random file contents.
  */
 #define DIRATTRUNQ		0xa116
@@ -100,7 +103,8 @@
 
 #endif /* DIRATTRCHK */
 
-/* dirattr definition
+/*
+ * dirattr definition
  */
 struct dirattr {
 #ifdef DIRATTRCHK
@@ -125,7 +129,8 @@ typedef struct dirattr dirattr_t;
 
 #define DIRATTR_EXTATTROFFNULL	((off64_t)OFF64MAX)
 
-/* dirattr persistent context definition
+/*
+ * dirattr persistent context definition
  */
 struct dirattr_pers {
 	off64_t dp_appendoff;
@@ -135,7 +140,8 @@ typedef struct dirattr_pers dirattr_pers_t;
 
 #define DIRATTR_PERS_SZ	pgsz
 
-/* dirattr transient context definition
+/*
+ * dirattr transient context definition
  */
 
 #define	DIRATTR_BUFSIZE	32768
@@ -156,7 +162,8 @@ struct dirattr_tran {
 typedef struct dirattr_tran dirattr_tran_t;
 
 
-/* a dirattr is identified internally by its index into the backing store.
+/*
+ * a dirattr is identified internally by its index into the backing store.
  * this index is the offset of the dirattr (relative to the end of the dirattr
  * persistent state hdr) into the backing store divided by the size of a
  * dirattr. a special index is reserved to represent the null index. a type
@@ -205,13 +212,15 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 		return BOOL_TRUE;
 	}
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(sizeof(dirattr_pers_t) <= DIRATTR_PERS_SZ);
 	assert(! dtp);
 	assert(! dpp);
 
-	/* allocate and initialize context
+	/*
+	 * allocate and initialize context
 	 */
 	dtp = (dirattr_tran_t *)calloc(1, sizeof(dirattr_tran_t));
 	assert(dtp);
@@ -219,14 +228,17 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 	dtp->dt_fd = -1;
 	dtp->dt_extattrfd = -1;
 
-	/* generate a string containing the pathname of the dirattr file
+	/*
+	 * generate a string containing the pathname of the dirattr file
 	 */
 	dtp->dt_pathname = open_pathalloc(hkdir, dirattrfile, 0);
 
-	/* open the dirattr file
+	/*
+	 * open the dirattr file
 	 */
 	if (resume) {
-		/* open existing file
+		/*
+		 * open existing file
 		 */
 		dtp->dt_fd = open(dtp->dt_pathname, O_RDWR);
 		if (dtp->dt_fd < 0) {
@@ -238,7 +250,8 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 			return BOOL_FALSE;
 		}
 	} else {
-		/* create the dirattr file, first unlinking any older version
+		/*
+		 * create the dirattr file, first unlinking any older version
 		 * laying around
 		 */
 		(void)unlink(dtp->dt_pathname);
@@ -254,7 +267,8 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 			return BOOL_FALSE;
 		}
 
-		/* reserve space for the backing store. try to use RESVSP64.
+		/*
+		 * reserve space for the backing store. try to use RESVSP64.
 		 * if doesn't work, try ALLOCSP64. the former is faster, as
 		 * it does not zero the space.
 		 */
@@ -312,7 +326,8 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 		}
 	}
 
-	/* mmap the persistent descriptor
+	/*
+	 * mmap the persistent descriptor
 	 */
 	assert(! (DIRATTR_PERS_SZ % pgsz));
 	dpp = (dirattr_pers_t *)mmap_autogrow(DIRATTR_PERS_SZ,
@@ -327,17 +342,20 @@ dirattr_init(char *hkdir, bool_t resume, uint64_t dircnt)
 		return BOOL_FALSE;
 	}
 
-	/* initialize persistent state
+	/*
+	 * initialize persistent state
 	 */
 	if (! resume) {
 		dpp->dp_appendoff = (off64_t)DIRATTR_PERS_SZ;
 	}
 
-	/* initialize transient state
+	/*
+	 * initialize transient state
 	 */
 	dtp->dt_at_endpr = BOOL_FALSE;
 
-	/* calculate the dir extattr pathname, and set the fd to -1.
+	/*
+	 * 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);
@@ -396,12 +414,14 @@ dirattr_add(filehdr_t *fhdrp)
 #endif /* DIRATTRCHK */
 	dah_t dah;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(dtp);
 	assert(dpp);
 
-	/* make sure file pointer is positioned to write at end of file
+	/*
+	 * make sure file pointer is positioned to write at end of file
 	 */
 	if (! dtp->dt_at_endpr) {
 		off64_t newoff;
@@ -422,13 +442,15 @@ dirattr_add(filehdr_t *fhdrp)
 		}
 	}
 
-	/* calculate the index of this dirattr
+	/*
+	 * calculate the index of this dirattr
 	 */
 	oldoff = dpp->dp_appendoff;
 	dix = OFF2DIX(oldoff);
 	assert(dix <= DIX_MAX);
 
-	/* populate a dirattr
+	/*
+	 * populate a dirattr
 	 */
 	dirattr.d_mode = (mode_t)fhdrp->fh_stat.bs_mode;
 	dirattr.d_uid = (uid_t)fhdrp->fh_stat.bs_uid;
@@ -448,12 +470,14 @@ dirattr_add(filehdr_t *fhdrp)
 #endif /* DIRATTRCHK */
 	dirattr.d_extattroff = DIRATTR_EXTATTROFFNULL;
 
-	/* write the entry into our buffer
+	/*
+	 * write the entry into our buffer
 	 */
 	memcpy(dtp->dt_buf + dtp->dt_off, (void *)&dirattr, sizeof(dirattr_t));
 	dtp->dt_off += sizeof(dirattr_t);
 
-	/* update the next write offset
+	/*
+	 * update the next write offset
 	 */
 	assert(dpp->dp_appendoff <= OFF64MAX - (off64_t)sizeof(dirattr_t));
 	dpp->dp_appendoff += (off64_t)sizeof(dirattr_t);
@@ -477,11 +501,13 @@ dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp)
 	int nread;
 	int nwritten;
 
-	/* pull the selected dir attributes into the cache
+	/*
+	 * pull the selected dir attributes into the cache
 	 */
 	dirattr_get(dah);
 
-	/* open/create extended attributes file if not yet done
+	/*
+	 * open/create extended attributes file if not yet done
 	 */
 	if (dtp->dt_extattrfd < 0) {
 		if (dtp->dt_extattrfdbadpr) {
@@ -503,7 +529,8 @@ dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp)
 		}
 	}
 
-	/* seek to the end of the dir extattr list
+	/*
+	 * seek to the end of the dir extattr list
 	 */
 	off = dtp->dt_cached_dirattr.d_extattroff;
 	oldoff = DIRATTR_EXTATTROFFNULL;
@@ -540,7 +567,8 @@ dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp)
 		}
 	}
 
-	/* append the extended attributes
+	/*
+	 * append the extended attributes
 	 */
 	off = lseek64(dtp->dt_extattrfd, 0, SEEK_END);
 	if (off < 0) {
@@ -582,7 +610,8 @@ dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp)
 		return;
 	}
 
-	/* fill in the offset of the extended attributes into the
+	/*
+	 * fill in the offset of the extended attributes into the
 	 * linked list
 	 */
 	if (oldoff == DIRATTR_EXTATTROFFNULL) {
@@ -628,11 +657,13 @@ dirattr_cb_extattr(dah_t dah,
 {
 	off64_t off;
 
-	/* pull the selected dir attributes into the cache
+	/*
+	 * pull the selected dir attributes into the cache
 	 */
 	dirattr_get(dah);
 
-	/* open/create extended attributes file if not yet done
+	/*
+	 * open/create extended attributes file if not yet done
 	 */
 	if (dtp->dt_extattrfd < 0) {
 		if (dtp->dt_extattrfdbadpr) {
@@ -654,7 +685,8 @@ dirattr_cb_extattr(dah_t dah,
 		}
 	}
 
-	/* walk through the dirattr list for this dah
+	/*
+	 * walk through the dirattr list for this dah
 	 */
 	off = dtp->dt_cached_dirattr.d_extattroff;
 	while (off != DIRATTR_EXTATTROFFNULL) {
@@ -664,7 +696,8 @@ dirattr_cb_extattr(dah_t dah,
 		size_t recsz;
 		bool_t ok;
 
-		/* seek to the extattr
+		/*
+		 * seek to the extattr
 		 */
 		seekoff = lseek64(dtp->dt_extattrfd, off, SEEK_SET);
 		if (seekoff < 0) {
@@ -680,7 +713,8 @@ dirattr_cb_extattr(dah_t dah,
 		}
 		assert(seekoff == off);
 
-		/* peel off the next offset
+		/*
+		 * peel off the next offset
 		 */
 		nread = read(dtp->dt_extattrfd,
 			      (void *)&nextoff,
@@ -697,7 +731,8 @@ dirattr_cb_extattr(dah_t dah,
 			return BOOL_TRUE;
 		}
 
-		/* read the extattr hdr
+		/*
+		 * read the extattr hdr
 		 */
 		nread = read(dtp->dt_extattrfd,
 			      (void *)ahdrp,
@@ -714,7 +749,8 @@ dirattr_cb_extattr(dah_t dah,
 			return BOOL_TRUE;
 		}
 
-		/* read the remainder of the extattr
+		/*
+		 * read the remainder of the extattr
 		 */
 		recsz = (size_t)ahdrp->ah_sz;
 		assert(recsz >= EXTATTRHDR_SZ);
@@ -733,14 +769,16 @@ dirattr_cb_extattr(dah_t dah,
 			return BOOL_TRUE;
 		}
 
-		/* call the callback func
+		/*
+		 * call the callback func
 		 */
 		ok = (*cbfunc)(ahdrp, ctxp);
 		if (! ok) {
 			return BOOL_FALSE;
 		}
 
-		/* go th the next one
+		/*
+		 * go th the next one
 		 */
 		off = nextoff;
 	}
@@ -760,7 +798,8 @@ dirattr_update(dah_t dah, filehdr_t *fhdrp)
 	dirattr_t dirattr;
 	int nwritten;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(dtp);
 	assert(dpp);
@@ -795,7 +834,8 @@ dirattr_update(dah_t dah, filehdr_t *fhdrp)
 		}
 	}
 
-	/* seek to the dirattr
+	/*
+	 * seek to the dirattr
 	 */
 	newoff = lseek64(dtp->dt_fd, argoff, SEEK_SET);
 	if (newoff == (off64_t)-1) {
@@ -806,7 +846,8 @@ dirattr_update(dah_t dah, filehdr_t *fhdrp)
 	}
 	assert(newoff == argoff);
 
-	/* populate a dirattr
+	/*
+	 * populate a dirattr
 	 */
 	dirattr.d_mode = (mode_t)fhdrp->fh_stat.bs_mode;
 	dirattr.d_uid = (uid_t)fhdrp->fh_stat.bs_uid;
@@ -821,7 +862,8 @@ dirattr_update(dah_t dah, filehdr_t *fhdrp)
 	dirattr.d_dmstate = (uint32_t)fhdrp->fh_stat.bs_dmstate;
 	dirattr.d_extattroff = DIRATTR_EXTATTROFFNULL;
 
-	/* write the dirattr
+	/*
+	 * write the dirattr
 	 */
 	nwritten = write(dtp->dt_fd, (void *)&dirattr, sizeof(dirattr));
 	if ((size_t)nwritten != sizeof(dirattr)) {
@@ -923,12 +965,14 @@ dirattr_flush()
 {
 	ssize_t nwritten;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	*/
 	assert (dtp);
 
 	if (dtp->dt_off) {
-		/* write the accumulated dirattr entries
+		/*
+		 * write the accumulated dirattr entries
 		*/
 		nwritten = write(dtp->dt_fd, (void *)dtp->dt_buf, dtp->dt_off);
 		if (nwritten != dtp->dt_off) {
@@ -963,14 +1007,16 @@ dirattr_get(dah_t dah)
 	uint16_t sum;
 #endif /* DIRATTRCHK */
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(dtp);
 	assert(dpp);
 
 	assert(dah != DAH_NULL);
 
-	/* if we are already holding this dirattr in cache,
+	/*
+	 * if we are already holding this dirattr in cache,
 	 * just return
 	 */
 	if (dtp->dt_cachedh == dah) {
@@ -998,7 +1044,8 @@ dirattr_get(dah_t dah)
 		}
 	}
 
-	/* seek to the dirattr
+	/*
+	 * seek to the dirattr
 	 */
 	newoff = lseek64(dtp->dt_fd, argoff, SEEK_SET);
 	if (newoff == (off64_t)-1) {
@@ -1009,7 +1056,8 @@ dirattr_get(dah_t dah)
 	}
 	assert(newoff == argoff);
 
-	/* read the dirattr
+	/*
+	 * read the dirattr
 	 */
 	nread = read(dtp->dt_fd,
 		      (void *)&dtp->dt_cached_dirattr,
@@ -1042,12 +1090,14 @@ dirattr_cacheflush(void)
 	off64_t newoff;
 	int nwritten;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(dtp);
 	assert(dpp);
 
-	/* if nothing in the cache, ignore
+	/*
+	 * if nothing in the cache, ignore
 	 */
 	dah = dtp->dt_cachedh;
 	assert(dah != DAH_NULL);
@@ -1075,7 +1125,8 @@ dirattr_cacheflush(void)
 	assert(argoff >= (off64_t)DIRATTR_PERS_SZ);
 	assert(argoff <= dpp->dp_appendoff - (off64_t)sizeof(dirattr_t));
 
-	/* seek to the dirattr
+	/*
+	 * seek to the dirattr
 	 */
 	newoff = lseek64(dtp->dt_fd, argoff, SEEK_SET);
 	if (newoff == (off64_t)-1) {
@@ -1086,7 +1137,8 @@ dirattr_cacheflush(void)
 	}
 	assert(newoff == argoff);
 
-	/* write the dirattr
+	/*
+	 * write the dirattr
 	 */
 	nwritten = write(dtp->dt_fd,
 			  (void *)&dtp->dt_cached_dirattr,
diff --git a/restore/dirattr.h b/restore/dirattr.h
index 232822e..51b7ae2 100644
--- a/restore/dirattr.h
+++ b/restore/dirattr.h
@@ -18,7 +18,8 @@
 #ifndef DIRATTR_H
 #define DIRATTR_H
 
-/* dah_t - handle to registered directory attributes
+/*
+ * dah_t - handle to registered directory attributes
  * a special handle is reserved for the caller's convenience,
  * to indicate no directory attributes have been registered.
  */
@@ -26,7 +27,8 @@ typedef size32_t dah_t;
 #define	DAH_NULL	SIZE32MAX
 
 
-/* dirattr_init - creates the directory attributes registry.
+/*
+ * dirattr_init - creates the directory attributes registry.
  * resync indicates if an existing context should be re-opened.
  * returns FALSE if an error encountered. if NOT resync,
  * dircnt hints at number of directories to expect.
@@ -36,25 +38,30 @@ extern bool_t dirattr_init(char *housekeepingdir,
 			    uint64_t dircnt);
 
 
-/* dirattr_cleanup - removes all traces
+/*
+ * dirattr_cleanup - removes all traces
  */
 extern void dirattr_cleanup(void);
 
 
-/* dirattr_add - registers a directory's attributes. knows how to interpret
+/*
+ * dirattr_add - registers a directory's attributes. knows how to interpret
  * the filehdr. returns handle for use with dirattr_get_...().
  */
 extern dah_t dirattr_add(filehdr_t *fhdrp);
 
-/* dirattr_update - modifies existing registered attributes
+/*
+ * dirattr_update - modifies existing registered attributes
  */
 extern void dirattr_update(dah_t dah, filehdr_t *fhdrp);
 
-/* dirattr_del - frees dirattr no longer needed
+/*
+ * dirattr_del - frees dirattr no longer needed
  */
 extern void dirattr_del(dah_t dah);
 
-/* dirattr_get_... - retrieve various attributes
+/*
+ * dirattr_get_... - retrieve various attributes
  */
 mode_t dirattr_get_mode(dah_t dah);
 uid_t dirattr_get_uid(dah_t dah);
@@ -68,17 +75,20 @@ uint32_t dirattr_get_projid(dah_t dah);
 uint32_t dirattr_get_dmevmask(dah_t dah);
 uint32_t dirattr_get_dmstate(dah_t dah);
 
-/* dirattr_flush - flush dirattr I/O buffer.  Returns 0 if successful.
+/*
+ * dirattr_flush - flush dirattr I/O buffer.  Returns 0 if successful.
  */
 extern rv_t dirattr_flush(void);
 
-/* dirattr_addextattr - record an extended attribute. second argument is
+/*
+ * dirattr_addextattr - record an extended attribute. second argument is
  * ptr to extattrhdr_t, with extattr name and value appended as
  * described by hdr.
  */
 extern void dirattr_addextattr(dah_t dah, extattrhdr_t *ahdrp);
 
-/* dirattr_cb_extattr - calls back for every extended attribute associated with
+/*
+ * dirattr_cb_extattr - calls back for every extended attribute associated with
  * the given dah. stops iteration and returnd FALSE if cbfunc returns FALSE,
  * else returns TRUE.
  */
diff --git a/restore/getopt.h b/restore/getopt.h
index b5bc004..10eab6b 100644
--- a/restore/getopt.h
+++ b/restore/getopt.h
@@ -18,7 +18,8 @@
 #ifndef GETOPT_H
 #define GETOPT_H
 
-/* getopt.h	common getopt  command string
+/*
+ * getopt.h	common getopt  command string
  *
  * several modules parse the command line looking for arguments specific to
  * that module. Unfortunately, each of the getopt(3) calls needs the
diff --git a/restore/inomap.c b/restore/inomap.c
index 44083ca..c8adf9b 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -48,18 +48,22 @@
 
 /* structure definitions used locally ****************************************/
 
-/* restores the inomap into a file
+/*
+ * restores the inomap into a file
  */
 #define PERS_NAME	"inomap"
 
-/* reserve the first page for persistent state
+/*
+ * reserve the first page for persistent state
  */
 struct pers {
 	size64_t hnkcnt;
-		/* number of hunks in map
+		/*
+		 * number of hunks in map
 		 */
 	size64_t segcnt;
-		/* number of segments
+		/*
+		 * number of segments
 		 */
 	xfs_ino_t last_ino_added;
 };
@@ -75,7 +79,8 @@ extern size_t pgsz;
 
 /* forward declarations of locally defined static functions ******************/
 
-/* inomap primitives
+/*
+ * inomap primitives
  */
 static int map_getset(xfs_ino_t, int, bool_t);
 static int map_set(xfs_ino_t ino, int);
@@ -87,10 +92,12 @@ static seg_t * map_getsegment(xfs_ino_t ino);
 /* definition of locally defined static variables *****************************/
 
 static int pers_fd = -1;
-	/* file descriptor for persistent inomap backing store
+	/*
+	 * file descriptor for persistent inomap backing store
 	 */
 
-/* context for inomap construction - initialized by inomap_restore_pers
+/*
+ * context for inomap construction - initialized by inomap_restore_pers
  */
 static uint64_t hnkcnt;
 static uint64_t segcnt;
@@ -99,7 +106,8 @@ static hnk_t *tailhnkp;
 static seg_t *lastsegp;
 static xfs_ino_t last_ino_added;
 
-/* map context and operators
+/*
+ * map context and operators
  */
 
 static inline void
@@ -199,19 +207,22 @@ inomap_restore_pers(drive_t *drivep,
 	int i;
 	bool_t ok;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(INOPERSEG == (sizeof(((seg_t *)0)->lobits) * NBBY));
 	assert(sizeof(hnk_t) == HNKSZ);
 	assert(sizeof(pers_t) <= PERSSZ);
 
-	/* get inomap info from media hdr
+	/*
+	 * get inomap info from media hdr
 	 */
 	hnkcnt = scrhdrp->cih_inomap_hnkcnt;
 	segcnt = scrhdrp->cih_inomap_segcnt;
 	last_ino_added = scrhdrp->cih_inomap_lastino;
 
-	/* truncate and open the backing store
+	/*
+	 * truncate and open the backing store
 	 */
 	perspath = open_pathalloc(hkdir, PERS_NAME, 0);
 	(void)unlink(perspath);
@@ -226,7 +237,8 @@ inomap_restore_pers(drive_t *drivep,
 		return RV_ERROR;
 	}
 
-	/* mmap the persistent hdr and space for the map
+	/*
+	 * mmap the persistent hdr and space for the map
 	 */
 	persp = (pers_t *) mmap_autogrow(
 				     PERSSZ
@@ -242,7 +254,8 @@ inomap_restore_pers(drive_t *drivep,
 		return RV_ERROR;
 	}
 
-	/* load the pers hdr
+	/*
+	 * load the pers hdr
 	 */
 	persp->hnkcnt = hnkcnt;
 	persp->segcnt = segcnt;
@@ -251,7 +264,8 @@ inomap_restore_pers(drive_t *drivep,
 	tmphnkp = (hnk_t *)calloc((size_t)hnkcnt, sizeof(hnk_t));
 	assert(tmphnkp);
 
-	/* read the map in from media
+	/*
+	 * read the map in from media
 	 */
 	nread = read_buf((char *)tmphnkp,
 			  sizeof(hnk_t) * (size_t)hnkcnt,
@@ -268,7 +282,8 @@ inomap_restore_pers(drive_t *drivep,
 
 	mlog(MLOG_NITTY, "inomap_restore_pers: pre-munmap\n");
 
-	/* close up
+	/*
+	 * close up
 	 */
 	rval1 = munmap((void *)persp,
 		        PERSSZ
@@ -280,7 +295,8 @@ inomap_restore_pers(drive_t *drivep,
 
 	mlog(MLOG_NITTY, "inomap_restore_pers: post-munmap\n");
 
-	/* check the return code from read
+	/*
+	 * check the return code from read
 	 */
 	switch (rval) {
 	case 0:
@@ -304,7 +320,8 @@ inomap_restore_pers(drive_t *drivep,
 	}
 }
 
-/* peels inomap from media
+/*
+ * peels inomap from media
  */
 rv_t
 inomap_discard(drive_t *drivep, content_inode_hdr_t *scrhdrp)
@@ -315,11 +332,13 @@ inomap_discard(drive_t *drivep, content_inode_hdr_t *scrhdrp)
 	int nread;
 	int rval;
 
-	/* get inomap info from media hdr
+	/*
+	 * get inomap info from media hdr
 	 */
 	tmphnkcnt = scrhdrp->cih_inomap_hnkcnt;
 
-	/* read the map in from media
+	/*
+	 * read the map in from media
 	 */
 	nread = read_buf(0,
 			  sizeof(hnk_t) * (size_t)tmphnkcnt,
@@ -327,7 +346,8 @@ inomap_discard(drive_t *drivep, content_inode_hdr_t *scrhdrp)
 			  (rfp_t)dop->do_read,
 			  (rrbfp_t)dop->do_return_read_buf,
 			  &rval);
-	/* check the return code from read
+	/*
+	 * check the return code from read
 	 */
 	switch (rval) {
 	case 0:
@@ -354,17 +374,20 @@ inomap_sync_pers(char *hkdir)
 	pers_t *persp;
 	hnk_t *hnkp;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(sizeof(hnk_t) == HNKSZ);
 
-	/* only needed once per session
+	/*
+	 * only needed once per session
 	 */
 	if (pers_fd >= 0) {
 		return BOOL_TRUE;
 	}
 
-	/* open the backing store. if not present, ok, hasn't been created yet
+	/*
+	 * open the backing store. if not present, ok, hasn't been created yet
 	 */
 	perspath = open_pathalloc(hkdir, PERS_NAME, 0);
 	pers_fd = open(perspath, O_RDWR);
@@ -372,7 +395,8 @@ inomap_sync_pers(char *hkdir)
 		return BOOL_TRUE;
 	}
 
-	/* mmap the persistent hdr
+	/*
+	 * mmap the persistent hdr
 	 */
 	persp = (pers_t *) mmap_autogrow(
 				     PERSSZ,
@@ -386,13 +410,15 @@ inomap_sync_pers(char *hkdir)
 		return BOOL_FALSE;
 	}
 
-	/* read the pers hdr
+	/*
+	 * read the pers hdr
 	 */
 	hnkcnt = persp->hnkcnt;
 	segcnt = persp->segcnt;
 	last_ino_added = persp->last_ino_added;
 
-	/* mmap the pers inomap
+	/*
+	 * mmap the pers inomap
 	 */
 	assert(hnkcnt * sizeof(hnk_t) <= (size64_t)INT32MAX);
 	roothnkp = (hnk_t *) mmap_autogrow(
@@ -407,7 +433,8 @@ inomap_sync_pers(char *hkdir)
 		return BOOL_FALSE;
 	}
 
-	/* correct the next pointers
+	/*
+	 * correct the next pointers
 	 */
 	for (hnkp = roothnkp
 	     ;
@@ -418,7 +445,8 @@ inomap_sync_pers(char *hkdir)
 	}
 	hnkp->nextp = 0;
 
-	/* calculate the tail pointers
+	/*
+	 * calculate the tail pointers
 	 */
 	tailhnkp = hnkp;
 	assert(hnkcnt > 0);
@@ -428,12 +456,14 @@ inomap_sync_pers(char *hkdir)
 						 -
 						 1)];
 
-	/* now all inomap operators will work
+	/*
+	 * now all inomap operators will work
 	 */
 	return BOOL_TRUE;
 }
 
-/* de-allocate the persistent inomap
+/*
+ * de-allocate the persistent inomap
  */
 void
 inomap_del_pers(char *hkdir)
@@ -443,7 +473,8 @@ inomap_del_pers(char *hkdir)
 	free((void *)perspath);
 }
 
-/* mark all included non-dirs as MAP_NDR_NOREST
+/*
+ * mark all included non-dirs as MAP_NDR_NOREST
  */
 void
 inomap_sanitize(void)
@@ -451,7 +482,8 @@ inomap_sanitize(void)
 	hnk_t *hnkp;
 	seg_t *segp;
 
-	/* step through all hunks, segs, and inos
+	/*
+	 * step through all hunks, segs, and inos
 	 */
 	for (hnkp = roothnkp
 	     ;
@@ -486,7 +518,8 @@ inomap_sanitize(void)
 	}
 }
 
-/* called to mark a non-dir ino as TO be restored
+/*
+ * called to mark a non-dir ino as TO be restored
  */
 void
 inomap_rst_add(xfs_ino_t ino)
@@ -495,7 +528,8 @@ inomap_rst_add(xfs_ino_t ino)
 		(void)map_set(ino, MAP_NDR_CHANGE);
 }
 
-/* called to mark a non-dir ino as NOT to be restored
+/*
+ * called to mark a non-dir ino as NOT to be restored
  */
 void
 inomap_rst_del(xfs_ino_t ino)
@@ -504,7 +538,8 @@ inomap_rst_del(xfs_ino_t ino)
 		(void)map_set(ino, MAP_NDR_NOREST);
 }
 
-/* called to ask if any inos in the given range need to be restored.
+/*
+ * called to ask if any inos in the given range need to be restored.
  * range is inclusive
  */
 bool_t
@@ -513,19 +548,22 @@ inomap_rst_needed(xfs_ino_t firstino, xfs_ino_t lastino)
 	hnk_t *hnkp;
 	seg_t *segp;
 
-	/* if inomap not restored/resynced, just say yes
+	/*
+	 * if inomap not restored/resynced, just say yes
 	 */
 	if (! roothnkp) {
 		return BOOL_TRUE;
 	}
 
-	/* may be completely out of range
+	/*
+	 * may be completely out of range
 	 */
 	if (firstino > last_ino_added) {
 		return BOOL_FALSE;
 	}
 
-	/* find the hunk/seg containing first ino or any ino beyond
+	/*
+	 * find the hunk/seg containing first ino or any ino beyond
 	 */
 	for (hnkp = roothnkp; hnkp != 0; hnkp = hnkp->nextp) {
 		if (firstino > hnkp->maxino) {
@@ -543,7 +581,8 @@ inomap_rst_needed(xfs_ino_t firstino, xfs_ino_t lastino)
 	return BOOL_FALSE;
 
 begin:
-	/* search until at least one ino is needed or until beyond last ino
+	/*
+	 * search until at least one ino is needed or until beyond last ino
 	 */
 	for (;;) {
 		xfs_ino_t ino;
@@ -579,7 +618,8 @@ begin:
 	/* NOTREACHED */
 }
 
-/* calls the callback for all inos with an inomap state included
+/*
+ * calls the callback for all inos with an inomap state included
  * in the state mask. stops iteration when inos exhaused or cb
  * returns FALSE.
  */
@@ -591,7 +631,8 @@ inomap_cbiter(int statemask,
 	hnk_t *hnkp;
 	seg_t *segp;
 
-	/* step through all hunks, segs, and inos
+	/*
+	 * step through all hunks, segs, and inos
 	 */
 	for (hnkp = roothnkp
 	     ;
@@ -631,7 +672,8 @@ inomap_cbiter(int statemask,
 
 /* definition of locally defined static functions ****************************/
 
-/* map_getset - locates and gets the state of the specified ino,
+/*
+ * map_getset - locates and gets the state of the specified ino,
  * and optionally sets the state to a new value.
  */
 static int
@@ -659,7 +701,8 @@ map_getsegment(xfs_ino_t ino)
 	uint64_t hnk;
 	uint64_t seg;
 
-	/* Use binary search to find the hunk that contains the inode number,
+	/*
+	 * Use binary search to find the hunk that contains the inode number,
 	 * if any.  This counts on the fact that all the hunks are contiguous
 	 * in memory and therefore can be treated as an array instead of a
 	 * list.
@@ -684,7 +727,8 @@ map_getsegment(xfs_ino_t ino)
 		return NULL;	/* inode number fell between hunks */
 	}
 
-	/* Use binary search to find the segment within the hunk that contains
+	/*
+	 * Use binary search to find the segment within the hunk that contains
 	 * the inode number, if any.
 	 */
 
diff --git a/restore/inomap.h b/restore/inomap.h
index 55f9d07..2211cb0 100644
--- a/restore/inomap.h
+++ b/restore/inomap.h
@@ -18,7 +18,8 @@
 #ifndef INOMAP_H
 #define INOMAP_H
 
-/* inomap.[hc] - inode map abstraction
+/*
+ * inomap.[hc] - inode map abstraction
  *
  * an inode map describes the inode numbers (inos) in a file system dump.
  * the map identifies which inos are in-use by the fs, which of those are
@@ -30,7 +31,8 @@
  * for each ino.
  */
 
-/* map state values
+/*
+ * map state values
  */
 #define MAP_INO_UNUSED	0       /* ino not in use by fs */
 #define MAP_DIR_NOCHNG	1       /* dir, ino in use by fs, but not dumped */
@@ -41,7 +43,8 @@
 #define MAP_NDR_NOREST	6       /* was MAP_NDR_CHANGE, but not to be restored */
 #define MAP_RESERVED2	7       /* this state currently not used */
 
-/* the inomap is implemented as a linked list of chunks. each chunk contains
+/*
+ * the inomap is implemented as a linked list of chunks. each chunk contains
  * an array of map segments. a map segment contains a start ino and a
  * bitmap of 64 3-bit state values (see MAP_... in inomap.h). the SEG_macros
  * index and manipulate the 3-bit state values.
diff --git a/restore/namreg.c b/restore/namreg.c
index b6c4724..5e99536 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -42,7 +42,8 @@
 
 #define NAMREG_AVGLEN	10
 
-/* persistent context for a namreg - placed in first page
+/*
+ * persistent context for a namreg - placed in first page
  * of the namreg file by namreg_init if not a sync
  */
 struct namreg_pers {
@@ -53,7 +54,8 @@ typedef struct namreg_pers namreg_pers_t;
 
 #define NAMREG_PERS_SZ	pgsz
 
-/* transient context for a namreg - allocated by namreg_init()
+/*
+ * transient context for a namreg - allocated by namreg_init()
  */
 
 #define	NAMREG_BUFSIZE	32768
@@ -72,7 +74,8 @@ typedef struct namreg_tran namreg_tran_t;
 
 #ifdef NAMREGCHK
 
-/* macros for manipulating namreg handles when handle consistency
+/*
+ * macros for manipulating namreg handles when handle consistency
  * checking is enabled.
  */
 #define CHKBITCNT		2
@@ -122,26 +125,31 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 		return BOOL_TRUE;
 	}
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(! ntp);
 	assert(! npp);
 
 	assert(sizeof(namreg_pers_t) <= NAMREG_PERS_SZ);
 
-	/* allocate and initialize context
+	/*
+	 * allocate and initialize context
 	 */
 	ntp = (namreg_tran_t *)calloc(1, sizeof(namreg_tran_t));
 	assert(ntp);
 
-	/* generate a string containing the pathname of the namreg file
+	/*
+	 * generate a string containing the pathname of the namreg file
 	 */
 	ntp->nt_pathname = open_pathalloc(hkdir, namregfile, 0);
 
-	/* open the namreg file
+	/*
+	 * open the namreg file
 	 */
 	if (resume) {
-		/* open existing file
+		/*
+		 * open existing file
 		 */
 		ntp->nt_fd = open(ntp->nt_pathname, O_RDWR);
 		if (ntp->nt_fd < 0) {
@@ -153,7 +161,8 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 			return BOOL_FALSE;
 		}
 	} else {
-		/* create the namreg file, first unlinking any older version
+		/*
+		 * create the namreg file, first unlinking any older version
 		 * laying around
 		 */
 		(void)unlink(ntp->nt_pathname);
@@ -169,7 +178,8 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 			return BOOL_FALSE;
 		}
 
-		/* reserve space for the backing store. try to use RESVSP64.
+		/*
+		 * reserve space for the backing store. try to use RESVSP64.
 		 * if doesn't work, try ALLOCSP64. the former is faster, as
 		 * it does not zero the space.
 		 */
@@ -227,7 +237,8 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 		}
 	}
 
-	/* mmap the persistent descriptor
+	/*
+	 * mmap the persistent descriptor
 	 */
 	assert(! (NAMREG_PERS_SZ % pgsz));
 	npp = (namreg_pers_t *) mmap_autogrow(
@@ -242,13 +253,15 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 		return BOOL_FALSE;
 	}
 
-	/* initialize persistent state
+	/*
+	 * initialize persistent state
 	 */
 	if (! resume) {
 		npp->np_appendoff = (off64_t)NAMREG_PERS_SZ;
 	}
 
-	/* initialize transient state
+	/*
+	 * initialize transient state
 	 */
 	ntp->nt_at_endpr = BOOL_FALSE;
 
@@ -262,13 +275,15 @@ namreg_add(char *name, size_t namelen)
 	unsigned char c;
 	nrh_t nrh;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(ntp);
 	assert(npp);
 	assert(!ntp->nt_map);
 
-	/* make sure file pointer is positioned to append
+	/*
+	 * make sure file pointer is positioned to append
 	 */
 	if (! ntp->nt_at_endpr) {
 		off64_t newoff;
@@ -290,17 +305,20 @@ namreg_add(char *name, size_t namelen)
 		}
 	}
 
-	/* save the current offset
+	/*
+	 * save the current offset
 	 */
 	oldoff = npp->np_appendoff;
 
-	/* write a one byte unsigned string length into the buffer.
+	/*
+	 * write a one byte unsigned string length into the buffer.
 	 */
 	assert(namelen < 256);
 	c = (unsigned char)(namelen & 0xff);
 	ntp->nt_buf[ntp->nt_off++] = c;
 
-	/* write the name string into the buffer.
+	/*
+	 * write the name string into the buffer.
 	 */
 	memcpy(ntp->nt_buf + ntp->nt_off, name, namelen);
 	ntp->nt_off += namelen;
@@ -310,7 +328,8 @@ namreg_add(char *name, size_t namelen)
 
 #ifdef NAMREGCHK
 
-	/* encode the lsb of the len plus the first character into the handle.
+	/*
+	 * encode the lsb of the len plus the first character into the handle.
 	 */
 	nrh = CHKMKHDL((nrh_t)namelen + (nrh_t)*name, (nrh_t)oldoff);
 
@@ -327,7 +346,8 @@ namreg_add(char *name, size_t namelen)
 void
 namreg_del(nrh_t nrh)
 {
-	/* currently not implemented - grows, never shrinks
+	/*
+	 * currently not implemented - grows, never shrinks
 	 */
 }
 
@@ -336,13 +356,15 @@ namreg_flush(void)
 {
 	ssize_t nwritten;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	*/
 	assert(ntp);
 
 	if (ntp->nt_off) {
 
-		/* write the accumulated name strings.
+		/*
+		 * write the accumulated name strings.
 		*/
 		nwritten = write(ntp->nt_fd, (void *)ntp->nt_buf, ntp->nt_off);
 		if (nwritten != ntp->nt_off) {
@@ -379,16 +401,19 @@ namreg_get(nrh_t nrh,
 	nrh_t chkbit;
 #endif /* NAMREGCHK */
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(ntp);
 	assert(npp);
 
-	/* make sure we aren't being given a NULL handle
+	/*
+	 * make sure we aren't being given a NULL handle
 	 */
 	assert(nrh != NRH_NULL);
 
-	/* convert the handle into the offset
+	/*
+	 * convert the handle into the offset
 	 */
 #ifdef NAMREGCHK
 
@@ -401,7 +426,8 @@ namreg_get(nrh_t nrh,
 
 #endif /* NAMREGCHK */
 
-	/* do sanity check on offset
+	/*
+	 * do sanity check on offset
 	 */
 	assert(newoff <= HDLMAX);
 	assert(newoff < npp->np_appendoff);
@@ -422,7 +448,8 @@ namreg_get(nrh_t nrh,
 			}
 		}
 
-		/* seek to the name
+		/*
+		 * seek to the name
 		*/
 		newoff = lseek64(ntp->nt_fd, newoff, SEEK_SET);
 		if (newoff == (off64_t)-1) {
@@ -434,7 +461,8 @@ namreg_get(nrh_t nrh,
 		}
 		ntp->nt_at_endpr = BOOL_FALSE;
 
-		/* read the name length and the name itself in one call
+		/*
+		 * read the name length and the name itself in one call
 		 * NOTE: assumes read_buf is big enough for the longest
 		 * allowed name (255 chars) plus one byte for length.
 		 */
@@ -451,7 +479,8 @@ namreg_get(nrh_t nrh,
 		in_bufp = read_buf;
 	}
 
-	/* deal with a short caller-supplied buffer
+	/*
+	 * deal with a short caller-supplied buffer
 	 */
 	len = (size_t)in_bufp[0];
 	if (bufsz < len + 1) {
@@ -459,13 +488,15 @@ namreg_get(nrh_t nrh,
 		return -1;
 	}
 
-	/* copy the name into the caller-supplied buffer.
+	/*
+	 * copy the name into the caller-supplied buffer.
 	 */
 	strncpy(bufp, in_bufp+1, len);
 
 #ifdef NAMREGCHK
 
-	/* validate the checkbit
+	/*
+	 * validate the checkbit
 	 */
 	assert(chkbit
 		==
@@ -473,7 +504,8 @@ namreg_get(nrh_t nrh,
 
 #endif /* NAMREGCHK */
 
-	/* null-terminate the string if room
+	/*
+	 * null-terminate the string if room
 	 */
 	bufp[len] = 0;
 
@@ -497,7 +529,8 @@ namreg_map(void)
 					ntp->nt_fd,
 					NAMREG_PERS_SZ);
 
-	/* it's okay if this fails, just fall back to (the much slower)
+	/*
+	 * it's okay if this fails, just fall back to (the much slower)
 	 * seek-and-read lookups.
 	 */
 	if (ntp->nt_map == (char *)-1) {
diff --git a/restore/namreg.h b/restore/namreg.h
index bd014e2..159dac3 100644
--- a/restore/namreg.h
+++ b/restore/namreg.h
@@ -18,19 +18,22 @@
 #ifndef NAMREG_H
 #define NAMREG_H
 
-/* namreg.[hc] - directory entry registry
+/*
+ * namreg.[hc] - directory entry registry
  *
  * provides unique directory entry ID's and storage for the entry
  * name.
  */
 
-/* nrh_t - handle to a registered name
+/*
+ * nrh_t - handle to a registered name
  */
 typedef size64_t nrh_t;
 #define NRH_NULL	SIZE64MAX
 
 
-/* namreg_init - creates the name registry. resync is TRUE if the
+/*
+ * namreg_init - creates the name registry. resync is TRUE if the
  * registry should already exist, and we are resynchronizing.
  * if NOT resync, inocnt hints at how many names will be held
  */
@@ -39,23 +42,27 @@ extern bool_t namreg_init(char *housekeepingdir,
 			   uint64_t inocnt);
 
 
-/* namreg_add - registers a name. name does not need to be null-terminated.
+/*
+ * 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);
 
 
-/* namreg_del - remove a name from the registry
+/*
+ * namreg_del - remove a name from the registry
  */
 extern void namreg_del(nrh_t nrh);
 
-/* namreg_map - mmap the name registry, allowing for much
+/*
+ * 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);
 
-/* namreg_get - retrieves the name identified by the index.
+/*
+ * namreg_get - retrieves the name identified by the index.
  * fills the buffer with the null-terminated name from the registry.
  * returns the strlen() of the name. returns -1 if the buffer is too
  * small to fit the null-terminated name. return -2 if the name
diff --git a/restore/node.c b/restore/node.c
index b7f2b1b..423f4f6 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -38,11 +38,13 @@
 extern size_t pgsz;
 extern size_t pgmask;
 
-/* node handle limits
+/*
+ * node handle limits
  */
 #ifdef NODECHK
 
-/* macros for manipulating node handles when handle consistency
+/*
+ * macros for manipulating node handles when handle consistency
  * checking is enabled. the upper bits of a handle will be loaded
  * with the node gen count, described below. this should not be
  * used for production code, it cuts into the number of dirents
@@ -65,7 +67,8 @@ extern size_t pgmask;
 					  ((int)n & HDLMASK)))
 #define NH_MAX			(HDLMASK)
 
-/* the housekeeping byte of each node will hold two check fields:
+/*
+ * the housekeeping byte of each node will hold two check fields:
  * a gen count, initialized to 0 and incremented each time a node
  * is allocated, to catch re-use of stale handles; and unique pattern, to
  * differentiate a valid node from random memory. two unique patterns will
@@ -91,7 +94,8 @@ extern size_t pgmask;
 				    |					\
 				    ((int)u & HKPUNQMASK)))
 
-/* simple patterns for detecting a node
+/*
+ * simple patterns for detecting a node
  */
 #define NODEUNQFREE			0x9
 #define NODEUNQALCD			0x6
@@ -102,12 +106,14 @@ extern size_t pgmask;
 
 #endif /* NODECHK */
 
-/* window constraints
+/*
+ * window constraints
  */
 #define NODESPERSEG_MIN	1048576
 #define WINMAP_MIN	4
 
-/* reserve the firstpage for a header to save persistent context
+/*
+ * reserve the firstpage for a header to save persistent context
  */
 #define NODE_HDRSZ	pgsz
 
@@ -115,40 +121,51 @@ typedef int relnix_t;
 
 struct node_hdr {
 	size_t nh_nodesz;
-		/* internal node size - user may see something smaller
+		/*
+		 * internal node size - user may see something smaller
 		 */
 	ix_t nh_nodehkix;
-		/* index of byte in each node the user has reserved
+		/*
+		 * index of byte in each node the user has reserved
 		 * for use by me
 		 */
 	nh_t nh_nodesperseg;
-		/* an integral number of internal nodes must fit into a
+		/*
+		 * an integral number of internal nodes must fit into a
 		 * segment
 		 */
 	size64_t nh_segsz;
-		/* the backing store is partitoned into segment, which
+		/*
+		 * the backing store is partitoned into segment, which
 		 * can be mapped into VM windows  by the win abstraction
 		 */
 	size_t nh_winmapmax;
-		/* maximum number of windows which can be mapped
+		/*
+		 * maximum number of windows which can be mapped
 		 */
 	size_t nh_nodealignsz;
-		/* user's constraint on node alignment
+		/*
+		 * user's constraint on node alignment
 		 */
 	nh_t nh_freenh;
-		/* handle of first node of singly-linked list of free nodes
+		/*
+		 * handle of first node of singly-linked list of free nodes
 		 */
 	off64_t nh_firstsegoff;
-		/* offset into backing store of the first segment
+		/*
+		 * offset into backing store of the first segment
 		 */
 	nh_t nh_virgnh;
-		/* handle of next virgin node
+		/*
+		 * handle of next virgin node
 		 */
 	int nh_segixshift;
-		/* bitshift used to extract the segment index from an nh_t
+		/*
+		 * bitshift used to extract the segment index from an nh_t
 		 */
 	relnix_t nh_relnixmask;
-		/* bitmask used to extract the node index from an nh_t
+		/*
+		 * bitmask used to extract the node index from an nh_t
 		 * (relative to the start of a segment)
 		 */
 };
@@ -197,7 +214,8 @@ node_unmap_internal(nh_t nh, void **pp, bool_t freepr)
 	assert(*pp);
 	assert(nh != NH_NULL);
 
-	/* convert the handle into an index
+	/*
+	 * convert the handle into an index
 	 */
 #ifdef NODECHK
 	hdlgen = HDLGETGEN(nh);
@@ -220,7 +238,8 @@ node_unmap_internal(nh_t nh, void **pp, bool_t freepr)
 	}
 #endif /* NODECHK */
 
-	/* unmap the window containing the node
+	/*
+	 * unmap the window containing the node
 	 */
 	win_unmap(nh2segix(nh), pp); /* zeros *pp */
 }
@@ -243,7 +262,8 @@ node_init(int fd,
 	size_t segcount;
 	int segixshift;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(sizeof(node_hdr_t) <= NODE_HDRSZ);
 	assert(sizeof(nh_t) < sizeof(off64_t));
@@ -251,19 +271,23 @@ node_init(int fd,
 	assert(sizeof(nh_t) <= sizeof(relnix_t));
 	assert(nodehkix < usrnodesz);
 	assert(usrnodesz >= sizeof(char *) + 1);
-		/* so node is at least big enough to hold
+		/*
+		 * so node is at least big enough to hold
 		 * the free list linkage and the housekeeping byte
 		 */
 	assert(nodehkix > sizeof(char *));
-		/* since beginning of each node is used to
+		/*
+		 * since beginning of each node is used to
 		 * link it in the free list.
 		 */
 
-	/* adjust the user's node size to meet user's alignment constraint
+	/*
+	 * adjust the user's node size to meet user's alignment constraint
 	*/
 	nodesz = (usrnodesz + nodealignsz - 1) & ~(nodealignsz - 1);
 
-	/* Calculate the node table params based on the number of inodes in the
+	/*
+	 * Calculate the node table params based on the number of inodes in the
 	 * dump, since that's all we know. Ideally we'd base this on the number
 	 * of dirents in the dump instead as there's a node per dirent.
 	 *
@@ -298,7 +322,8 @@ node_init(int fd,
 		return BOOL_FALSE;
 	}
 
-	/* This is checked as nodes are allocated as well (remember that
+	/*
+	 * This is checked as nodes are allocated as well (remember that
 	 * dirs_nondirs_cnt may be less than the number of nodes/dirents).
 	 * Checking this here prevents potential overflow in the logic below.
 	 */
@@ -328,13 +353,15 @@ node_init(int fd,
 
 		segsz = nodesperseg * nodesz;
 
-		/* max number of segments that will fit in virtual memory,
+		/*
+		 * max number of segments that will fit in virtual memory,
 		 * capped at the max possible number of segments
 		 */
 		winmapmax = min(vmsz / segsz, max_segments);
 	}
 
-	/* map the abstraction header
+	/*
+	 * map the abstraction header
 	 */
 	assert((NODE_HDRSZ & pgmask) == 0);
 	assert(! (NODE_HDRSZ % pgsz));
@@ -352,7 +379,8 @@ node_init(int fd,
 	    return BOOL_FALSE;
 	}
 
-	/* initialize and save persistent context.
+	/*
+	 * initialize and save persistent context.
 	 */
 	node_hdrp->nh_nodesz = nodesz;
 	node_hdrp->nh_nodehkix = nodehkix;
@@ -366,18 +394,21 @@ node_init(int fd,
 	node_hdrp->nh_segixshift = segixshift;
 	node_hdrp->nh_relnixmask = nodesperseg - 1;
 
-	/* save transient context
+	/*
+	 * save transient context
 	 */
 	node_fd = fd;
 
-	/* initialize the window abstraction
+	/*
+	 * initialize the window abstraction
 	 */
 	win_init(fd,
 		  node_hdrp->nh_firstsegoff,
 		  segsz,
 		  winmapmax);
 
-	/* announce the results
+	/*
+	 * announce the results
 	 */
 	mlog(MLOG_DEBUG | MLOG_TREE,
 	      "node_init:"
@@ -397,11 +428,13 @@ node_init(int fd,
 bool_t
 node_sync(int fd, off64_t off)
 {
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(sizeof(node_hdr_t) <= NODE_HDRSZ);
 
-	/* map the abstraction header
+	/*
+	 * map the abstraction header
 	 */
 	assert((NODE_HDRSZ & pgmask) == 0);
 	assert(off <= (off64_t)OFF64MAX);
@@ -418,11 +451,13 @@ node_sync(int fd, off64_t off)
 		return BOOL_FALSE;
 	}
 
-	/* save transient context
+	/*
+	 * save transient context
 	 */
 	node_fd = fd;
 
-	/* initialize the window abstraction
+	/*
+	 * initialize the window abstraction
 	 */
 	win_init(fd,
 		  node_hdrp->nh_firstsegoff,
@@ -443,7 +478,8 @@ node_alloc(void)
 	u_char_t unq;
 #endif /* NODECHK */
 
-	/* if there's a node available on the free list, use it.
+	/*
+	 * if there's a node available on the free list, use it.
 	 * otherwise get the next one from the current virgin segment,
 	 * or allocate a new virgin segment if the current one is depleted.
 	 */
@@ -503,7 +539,8 @@ node_alloc(void)
 		nh = node_hdrp->nh_virgnh++;
 	}
 
-	/* build a handle for node
+	/*
+	 * build a handle for node
 	 */
 	if (nh > NH_MAX) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
@@ -538,7 +575,8 @@ node_map(nh_t nh)
 
 	assert(nh != NH_NULL);
 
-	/* convert the handle into an index
+	/*
+	 * convert the handle into an index
 	 */
 #ifdef NODECHK
 	hdlgen = HDLGETGEN(nh);
@@ -547,7 +585,8 @@ node_map(nh_t nh)
 
 	assert(nh <= NH_MAX);
 
-	/* map in
+	/*
+	 * map in
 	 */
 	p = 0; /* keep lint happy */
 	node_map_internal(nh, (void **)&p);
@@ -589,7 +628,8 @@ node_free(nh_t *nhp)
 	nh = *nhp;
 	assert(nh != NH_NULL);
 
-	/* convert the handle into an index
+	/*
+	 * convert the handle into an index
 	 */
 #ifdef NODECHK
 	hdlgen = HDLGETGEN(nh);
@@ -598,7 +638,8 @@ node_free(nh_t *nhp)
 
 	assert(nh <= NH_MAX);
 
-	/* map in
+	/*
+	 * map in
 	 */
 	p = (u_char_t *)node_map(nh);
 	if (p == NULL){
@@ -607,7 +648,8 @@ node_free(nh_t *nhp)
 	}
 
 #ifdef NODECHK
-	/* fix up unique field
+	/*
+	 * fix up unique field
 	 */
 	hkpp = p + node_hdrp->nh_nodehkix;
 	nodegen = HKPGETGEN(*hkpp);
@@ -618,17 +660,20 @@ node_free(nh_t *nhp)
 	*hkpp = HKPMKHKP(nodegen, NODEUNQFREE);
 #endif /* NODECHK */
 
-	/* put node on free list
+	/*
+	 * put node on free list
 	 */
 	linkagep = (nh_t *)p;
 	*linkagep = node_hdrp->nh_freenh;
 	node_hdrp->nh_freenh = nh;
 
-	/* map out
+	/*
+	 * map out
 	 */
 	node_unmap_internal(nh, (void **)&p, BOOL_TRUE);
 
-	/* invalidate caller's handle
+	/*
+	 * invalidate caller's handle
 	 */
 	*nhp = NH_NULL;
 }
diff --git a/restore/node.h b/restore/node.h
index 5b5efda..6faf8ad 100644
--- a/restore/node.h
+++ b/restore/node.h
@@ -18,7 +18,8 @@
 #ifndef NODE_H
 #define NODE_H
 
-/* node.[ch] - abstract pool of nodes
+/*
+ * node.[ch] - abstract pool of nodes
  *
  * operators alloc, free, map, and unmap nodes.
  */
@@ -26,7 +27,8 @@
 typedef size32_t nh_t;
 #define NH_NULL	SIZE32MAX
 
-/* node_init - creates a new node abstraction.
+/*
+ * node_init - creates a new node abstraction.
  * user reserves one byte per node for use by the node abstraction
  */
 extern bool_t node_init(int fd,		/* backing store */
@@ -37,26 +39,31 @@ extern bool_t node_init(int fd,		/* backing store */
 		         size64_t vmsz,		/* abstractions's share of VM */
 		         size64_t dir_nondir);	/* num of dirs + nondirs */
 
-/* node_sync - syncs up with existing node abstraction persistent state
+/*
+ * node_sync - syncs up with existing node abstraction persistent state
  */
 extern bool_t node_sync(int fd, off64_t off);
 
-/* node_alloc - allocates a node, returning a handle.
+/*
+ * node_alloc - allocates a node, returning a handle.
  * returns NULL handle if no space left.
  */
 extern nh_t node_alloc(void);
 
-/* node_map - returns a pointer to the node identified by the node handle.
+/*
+ * node_map - returns a pointer to the node identified by the node handle.
  * pointer remains valid until node_unmap called.
  */
 extern void *node_map(nh_t node_handle);
 
-/* node_unmap - unmaps the node.
+/*
+ * node_unmap - unmaps the node.
  * SIDE-EFFECT: sets *nodepp to 0.
  */
 extern void node_unmap(nh_t node_handle, void **nodepp);
 
-/* node_free - frees a previously allocated node.
+/*
+ * node_free - frees a previously allocated node.
  * SIDE-EFFECT: sets *node_handlep to NODE_HANDLE_NULL.
  */
 extern void node_free(nh_t *node_handlep);
diff --git a/restore/tree.c b/restore/tree.c
index 87e6be3..d2637ce 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -65,54 +65,68 @@
 
 /* structure definitions used locally ****************************************/
 
-/* name of persistent state file
+/*
+ * name of persistent state file
  */
 #define PERS_NAME	"tree"
 
-/* orphanage specifics. ino must be otherwise unused in the dump source fs.
+/*
+ * orphanage specifics. ino must be otherwise unused in the dump source fs.
  * zero works.
  */
 #define ORPH_INO	0
 #define ORPH_NAME	"orphanage"
 
 
-/* VM budgeting - give hash array one sixteenth, rest goes to node array
+/*
+ * VM budgeting - give hash array one sixteenth, rest goes to node array
  */
 #define HASHSZ_PERVM	16
 
-/* reserve the first page for persistent state
+/*
+ * reserve the first page for persistent state
  */
 struct treePersStorage {
 	xfs_ino_t p_rootino;
-		/* ino of root
+		/*
+		 * ino of root
 		 */
 	nh_t p_rooth;
-		/* handle of root node
+		/*
+		 * handle of root node
 		 */
 	nh_t p_orphh;
-		/* handle to orphanage node
+		/*
+		 * handle to orphanage node
 		 */
 	size64_t p_hashsz;
-		/* size of hash array (private to hash abstraction)
+		/*
+		 * size of hash array (private to hash abstraction)
 		 */
 	size_t p_hashmask;
-		/* hash mask (private to hash abstraction)
+		/*
+		 * hash mask (private to hash abstraction)
 		 */
 	bool_t p_ownerpr;
-		/* restore directory owner/group attributes
+		/*
+		 * restore directory owner/group attributes
 		 */
 	bool_t p_fullpr;
-		/* restoring a full level 0 non-resumed dump (can skip
+		/*
+		 * restoring a full level 0 non-resumed dump (can skip
 		 * some steps)
 		 */
 	bool_t p_ignoreorphpr;
-		/* set if positive subtree or interactive
+		/*
+		 * set if positive subtree or interactive
 		 */
 	bool_t p_restoredmpr;
-		/* restore DMI event settings
+		/*
+		 * restore DMI event settings
 		 */
 	bool_t p_truncategenpr;
-		/* truncate inode generation number (for compatibility
+		/*
+		 * truncate inode generation number (for compatibility
 		 * with xfsdump format 2 and earlier)
 		 */
 };
@@ -122,7 +136,8 @@ typedef struct treePersStorage treepers_t;
 #define PERSSZ	perssz
 
 
-/* interactive dialog transient state
+/*
+ * interactive dialog transient state
  */
 #define INTER_ARGMAX	10	/* max number of args to interactive cmds */
 struct inter {
@@ -134,47 +149,59 @@ struct inter {
 
 typedef struct inter inter_t;
 
-/* transient state
+/*
+ * transient state
  */
 struct tran {
 	bool_t t_toconlypr;
-		/* just display table of contents; don't restore files
+		/*
+		 * just display table of contents; don't restore files
 		 */
 	char *t_hkdir;
-		/* full absolute pathname of housekeeping directory
+		/*
+		 * full absolute pathname of housekeeping directory
 		 */
 	char *t_dstdir;
-		/* full absolute pathname of destination directory
+		/*
+		 * full absolute pathname of destination directory
 		 */
 	bool_t t_dstdirisxfspr;
-		/* destination directory is an xfs filesystem; xfs-specific
+		/*
+		 * destination directory is an xfs filesystem; xfs-specific
 		 * calls can be made when needed.
 		 */
 	char *t_orphdir;
-		/* full absolute pathname of orphanage directory
+		/*
+		 * full absolute pathname of orphanage directory
 		 */
 	char *t_hksubtree;
-		/* if non-NULL, is path of hkdir relative to dstdir.
+		/*
+		 * if non-NULL, is path of hkdir relative to dstdir.
 		 * don't restore there.
 		 */
 	int t_persfd;
-		/* file descriptor of the persistent state file
+		/*
+		 * file descriptor of the persistent state file
 		 */
 	nh_t *t_hashp;
-		/* pointer to mapped hash array (private to hash abstraction)
+		/*
+		 * pointer to mapped hash array (private to hash abstraction)
 		 */
 	char t_namebuf[NAME_MAX + 1];
-		/* to hold names temporarily retrieved from name registry
+		/*
+		 * to hold names temporarily retrieved from name registry
 		 */
 	inter_t t_inter;
-		/* context for interactive subtree selection
+		/*
+		 * context for interactive subtree selection
 		 */
 };
 
 typedef struct tran tran_t;
 
 
-/* node structure. each node represents a directory entry
+/*
+ * node structure. each node represents a directory entry
  */
 #define NODESZ	56
 
@@ -197,14 +224,17 @@ struct node {
 typedef struct node node_t;
 
 #define NF_REAL		(1 << 0)
-	/* set when the corresponding file/dir has been created in
+	/*
+	 * set when the corresponding file/dir has been created in
 	 * the restore destination.
 	 */
 #define NF_SUBTREE	(1 << 1)
-	/* marks nodes in the selected subtrees.
+	/*
+	 * marks nodes in the selected subtrees.
 	 */
 #define NF_REFED	(1 << 2)
-	/* indicates node is still referenced according to incremental/resumed
+	/*
+	 * 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
 	 * restoral, it is set. it may also be set during the adjustment
@@ -212,15 +242,18 @@ typedef struct node node_t;
 	 * orphanage NEVER have this flag set.
 	 */
 #define NF_WRITTEN	(1 << 3)
-	/* set as soon as a non-dir node restore is begun. allows
+	/*
+	 * 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)
-	/* indicates this node is a directory. set when a directory is taken
+	/*
+	 * indicates this node is a directory. set when a directory is taken
 	 * from the dirdump.
 	 */
 #define NF_DUMPEDDIR	(1 << 5)
-	/* indicates this node is a directory present in the current dirdump.
+	/*
+	 * 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
 	 * is set from the corresponding node. this allows adjustments to
@@ -230,7 +263,8 @@ typedef struct node node_t;
 	 * are referenced as well.
 	 */
 #define NF_NEWORPH	(1 << 6)
-	/* cleared from all nodes in the orphanage before a dump is applied.
+	/*
+	 * 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.
 	 * set if a nondir is seen in the nondir dump but no node exists for
@@ -240,7 +274,8 @@ typedef struct node node_t;
 	 * old orphans had better be adopted, otherwise they will be unlinked.
 	 */
 
-/* link list iterator context
+/*
+ * link list iterator context
  */
 struct link_iter_context {
 	nh_t li_headh;          /* head of hard link list */
@@ -250,7 +285,8 @@ struct link_iter_context {
 };
 typedef struct link_iter_context link_iter_context_t;
 
-/* used for caching parent pathname from previous Node2path result
+/*
+ * used for caching parent pathname from previous Node2path result
  */
 struct path_cache {
 	nh_t nh;
@@ -366,7 +402,8 @@ tree_init(char *hkdir,
 	bool_t ok;
 	int rval;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(! (PERSSZ % pgsz));
 	assert(sizeof(persp) <= PERSSZ);
@@ -374,7 +411,8 @@ tree_init(char *hkdir,
 	assert(! persp);
 	assert(! tranp);
 
-	/* allocate transient state
+	/*
+	 * allocate transient state
 	 */
 	tranp = (tran_t *)calloc(1, sizeof(tran_t));
 	assert(tranp);
@@ -384,14 +422,16 @@ tree_init(char *hkdir,
 	tranp->t_dstdir = dstdir;
 	tranp->t_dstdirisxfspr = dstdirisxfspr;
 
-	/* allocate a char string buffer to hold the abs. pathname
+	/*
+	 * 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,
 					   orphname,
 					   0);
 
-	/* determine if housekeeping dir is within the destination.
+	/*
+	 * determine if housekeeping dir is within the destination.
 	 * generate a relative path containing the difference,
 	 * else null. will not restore into there.
 	 */
@@ -401,7 +441,8 @@ tree_init(char *hkdir,
 		tranp->t_hksubtree = 0;
 	}
 
-	/* create an orphanage, if it already exists, complain.
+	/*
+	 * create an orphanage, if it already exists, complain.
 	 * not needed if just a table-of-contents restore.
 	 */
 	if (! tranp->t_toconlypr) {
@@ -422,11 +463,13 @@ tree_init(char *hkdir,
 		}
 	}
 
-	/* build a full pathname to pers. state file
+	/*
+	 * build a full pathname to pers. state file
 	 */
 	perspath = open_pathalloc(tranp->t_hkdir, persname, 0);
 
-	/* create the persistent state file
+	/*
+	 * create the persistent state file
 	 */
 	(void)unlink(perspath);
 	tranp->t_persfd = open(perspath,
@@ -440,7 +483,8 @@ tree_init(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* mmap the persistent state
+	/*
+	 * mmap the persistent state
 	 */
 	assert(! (PERSSZ % pgsz));
 	persp = (treepers_t *) mmap_autogrow(
@@ -455,7 +499,8 @@ tree_init(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* create the hash abstraction. it will map more of the
+	/*
+	 * create the hash abstraction. it will map more of the
 	 * persistent state file.
 	 */
 	ok = hash_init(vmsz / HASHSZ_PERVM, dircnt, nondircnt, perspath);
@@ -463,7 +508,8 @@ tree_init(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* initialize the node abstraction. let it's use of backing store
+	/*
+	 * initialize the node abstraction. let it's use of backing store
 	 * begin immediately after the hash abstraction. give it the remainder
 	 * of vm.
 	 */
@@ -481,7 +527,8 @@ tree_init(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* extract the root ino and allocate a node for
+	/*
+	 * extract the root ino and allocate a node for
 	 * the root and for the orphanage. place both nodes
 	 * in the hash list. make the orphanage a child of
 	 * root, and indicate he is real.
@@ -508,19 +555,23 @@ tree_init(char *hkdir,
 	link_in(persp->p_orphh);
 	adopt(persp->p_rooth, persp->p_orphh, NRH_NULL);
 
-	/* record if we should attempt to restore original owner/group
+	/*
+	 * record if we should attempt to restore original owner/group
 	 */
 	persp->p_ownerpr = ownerpr;
 
-	/* record if this is a full dump. can skip link processing if so
+	/*
+	 * record if this is a full dump. can skip link processing if so
 	 */
 	persp->p_fullpr = fullpr;
 
-	/* record if DMI event settings should be restored
+	/*
+	 * record if DMI event settings should be restored
 	 */
 	persp->p_restoredmpr = restoredmpr;
 
-	/* record if truncated generation numbers are required
+	/*
+	 * record if truncated generation numbers are required
 	 */
 	if (dumpformat < GLOBAL_HDR_VERSION_3) {
 		persp->p_truncategenpr = BOOL_TRUE;
@@ -554,7 +605,8 @@ tree_sync(char *hkdir,
 		return BOOL_TRUE;
 	}
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(! (PERSSZ % pgsz));
 	assert(sizeof(persp) <= PERSSZ);
@@ -562,7 +614,8 @@ tree_sync(char *hkdir,
 	assert(! persp);
 	assert(! tranp);
 
-	/* allocate transient state
+	/*
+	 * allocate transient state
 	 */
 	tranp = (tran_t *)calloc(1, sizeof(tran_t));
 	assert(tranp);
@@ -572,14 +625,16 @@ tree_sync(char *hkdir,
 	tranp->t_dstdir = dstdir;
 	tranp->t_dstdirisxfspr = dstdirisxfspr;
 
-	/* allocate a char string buffer to hold the abs. pathname
+	/*
+	 * 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,
 					   orphname,
 					   0);
 
-	/* determine if housekeeping dir is within the destination.
+	/*
+	 * determine if housekeeping dir is within the destination.
 	 * generate a relative path containing the difference,
 	 * else null. will not restore into there.
 	 */
@@ -589,7 +644,8 @@ tree_sync(char *hkdir,
 		tranp->t_hksubtree = 0;
 	}
 
-	/* re-create the orphanage (in case someone rmdir'ed it)
+	/*
+	 * re-create the orphanage (in case someone rmdir'ed it)
 	 */
 	rval = mkdir(tranp->t_orphdir, S_IRWXU);
 	if (rval && errno != EEXIST) {
@@ -600,11 +656,13 @@ tree_sync(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* build a full pathname to pers. state file
+	/*
+	 * build a full pathname to pers. state file
 	 */
 	perspath = open_pathalloc(tranp->t_hkdir, persname, 0);
 
-	/* re-open the persistent state file
+	/*
+	 * re-open the persistent state file
 	 */
 	tranp->t_persfd = open(perspath, O_RDWR);
 	if (tranp->t_persfd < 0) {
@@ -615,7 +673,8 @@ tree_sync(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* mmap the persistent state
+	/*
+	 * mmap the persistent state
 	 */
 	assert(! (PERSSZ % pgsz));
 	persp = (treepers_t *) mmap_autogrow(
@@ -630,12 +689,14 @@ tree_sync(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* update the fullpr field of the persistent state to match
+	/*
+	 * update the fullpr field of the persistent state to match
 	 * the input of our caller.
 	 */
 	persp->p_fullpr = fullpr;
 
-	/* regardless of the format of this dump, if the previously applied
+	/*
+	 * 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) {
@@ -644,7 +705,8 @@ tree_sync(char *hkdir,
 		      "compatibility with previously applied restore\n"));
 	}
 
-	/* rsynchronize with the hash abstraction. it will map more of the
+	/*
+	 * rsynchronize with the hash abstraction. it will map more of the
 	 * persistent state file.
 	 */
 	ok = hash_sync(perspath);
@@ -652,7 +714,8 @@ tree_sync(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* synchronize with the node abstraction.
+	/*
+	 * synchronize with the node abstraction.
 	 */
 	assert(persp->p_hashsz <= (size64_t)(OFF64MAX - (off64_t)PERSSZ));
 	nodeoff = (off64_t)PERSSZ + (off64_t)persp->p_hashsz;
@@ -661,7 +724,8 @@ tree_sync(char *hkdir,
 		return BOOL_FALSE;
 	}
 
-	/* extract the root ino and allocate a node for
+	/*
+	 * extract the root ino and allocate a node for
 	 * the root and for the orphanage. place both nodes
 	 * in the hash list. make the orphanage a child of
 	 * root, and indicate he is real.
@@ -687,7 +751,8 @@ tree_check_dump_format(uint32_t dumpformat)
 	return BOOL_TRUE;
 }
 
-/* recursively descend the tree clearing REFED and DIRDUMPED and NEWORPH
+/*
+ * recursively descend the tree clearing REFED and DIRDUMPED and NEWORPH
  * flags. force the orphanage to be refed and dumped, so we won't try
  * to orphan it, and so things added to it won't look like they are
  * referenced during ref adj. also null dirattr handles, since they are
@@ -755,22 +820,26 @@ tree_begindir(filehdr_t *fhdrp, dah_t *dahp)
 		gen = BIGGEN2GEN(gen);
 	}
 
-	/* sanity check - orphino is supposed to be an unused ino!
+	/*
+	 * sanity check - orphino is supposed to be an unused ino!
 	 */
 	assert(ino != orphino);
 
-	/* lookup head of hardlink list
+	/*
+	 * lookup head of hardlink list
 	 */
 	hardh = link_hardh(ino, gen);
 	assert(ino != persp->p_rootino || hardh == persp->p_rooth);
 
-	/* already present
+	/*
+	 * already present
 	 */
 	if (hardh != NH_NULL) {
 		node_t *hardp;
 		hardp = Node_map(hardh);
 		if (! (hardp->n_flags & NF_ISDIR)) {
-			/* case 1: previously seen as dirent, now know is dir
+			/*
+			 * case 1: previously seen as dirent, now know is dir
 			 */
 			mlog(MLOG_TRACE | MLOG_TREE,
 			      "directory %llu %u (%u): "
@@ -783,7 +852,8 @@ tree_begindir(filehdr_t *fhdrp, dah_t *dahp)
 				hardp->n_dah = dirattr_add(fhdrp);
 			}
 		} else if (! tranp->t_toconlypr && hardp->n_dah == DAH_NULL) {
-			/* case 2: node is a dir, but had thrown away dirattr
+			/*
+			 * case 2: node is a dir, but had thrown away dirattr
 			 */
 			mlog(MLOG_TRACE | MLOG_TREE,
 			      "directory %llu %u (%u): "
@@ -793,7 +863,8 @@ tree_begindir(filehdr_t *fhdrp, dah_t *dahp)
 			      fhdrp->fh_stat.bs_gen);
 			hardp->n_dah = dirattr_add(fhdrp);
 		} else {
-			/* case 3: already has dirattr; must be restart
+			/*
+			 * case 3: already has dirattr; must be restart
 			 */
 			mlog(MLOG_TRACE | MLOG_TREE,
 			      "directory %llu %u (%u): "
@@ -807,7 +878,8 @@ tree_begindir(filehdr_t *fhdrp, dah_t *dahp)
 		*dahp = hardp->n_dah;
 		Node_unmap(hardh, &hardp);
 	} else {
-		/* case 4: first time seen
+		/*
+		 * case 4: first time seen
 		 */
 		mlog(MLOG_TRACE | MLOG_TREE,
 		      "directory %llu %u (%u): "
@@ -844,11 +916,13 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 		gen = BIGGEN2GEN(gen);
 	}
 
-	/* sanity check - orphino is supposed to be an unused ino!
+	/*
+	 * sanity check - orphino is supposed to be an unused ino!
 	 */
 	assert(ino != orphino);
 
-	/* don't allow entries named "orphanage" under root to be added
+	/*
+	 * don't allow entries named "orphanage" under root to be added
 	 */
 	if (parh == persp->p_rooth && !strcmp(name, orphname)) {
 		mlog(MLOG_DEBUG | MLOG_TREE,
@@ -860,7 +934,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 		return RV_OK;
 	}
 
-	/* if the parent is null, just ignore
+	/*
+	 * if the parent is null, just ignore
 	 */
 	if (parh == NH_NULL) {
 		mlog(MLOG_DEBUG | MLOG_TREE,
@@ -872,7 +947,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 		return RV_OK;
 	}
 
-	/* see if one or more links to this ino already exist.
+	/*
+	 * see if one or more links to this ino already exist.
 	 */
 	hardh = link_hardh(ino, gen);
 
@@ -887,7 +963,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 
 			hardp->n_flags |= NF_REFED;
 			if (hardp->n_parh == persp->p_orphh) {
-				/* dir now seen as entry
+				/*
+				 * dir now seen as entry
 				 * if in orph but REAL, must be pending rename
 				 */
 				if ((hardp->n_flags & NF_REAL)
@@ -985,10 +1062,12 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 				if (hardp->n_parh == parh
 				     &&
 				     ! strcmp(tranp->t_namebuf, name)) {
-					/* dir seen as entry again
+					/*
+					 * dir seen as entry again
 					 */
 					if (hardp->n_lnkh != NH_NULL) {
-						/* rescind rename
+						/*
+						 * rescind rename
 						 */
 						mlog(MLOG_DEBUG | MLOG_TREE,
 						      "dirent %s %llu %u: "
@@ -1006,7 +1085,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 						      gen);
 					}
 				} else {
-					/* dir rename
+					/*
+					 * dir rename
 					 */
 					nh_t renameh;
 					node_t *renamep;
@@ -1040,7 +1120,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 					renamep = Node_map(renameh);
 					assert(hardp->n_parh != NH_NULL);
 					if (hardp->n_parh != parh) {
-						/* different parent
+						/*
+						 * different parent
 						 */
 						renamep->n_parh = parh;
 						mlog(MLOG_DEBUG | MLOG_TREE,
@@ -1051,7 +1132,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 						      gen);
 					}
 					if (strcmp(tranp->t_namebuf, name)) {
-						/* different name
+						/*
+						 * different name
 						 */
 						renamep->n_nrh =
 						    namreg_add(name, namelen);
@@ -1069,7 +1151,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 			nh_t matchh;
 			matchh = link_matchh(hardh, parh, name);
 			if (matchh != NH_NULL) {
-				/* entry already exists
+				/*
+				 * entry already exists
 				 */
 				node_t *matchp;
 				matchp = Node_map(matchh);
@@ -1082,7 +1165,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 				      ino,
 				      gen);
 			} else {
-				/* case 5: new hard link
+				/*
+				 * case 5: new hard link
 				 */
 				nrh_t nrh;
 				nh_t linkh;
@@ -1106,7 +1190,8 @@ tree_addent(nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen)
 		}
 		Node_unmap(hardh, &hardp);
 	} else {
-		/* case 6: new entry
+		/*
+		 * case 6: new entry
 		 */
 		nrh_t nrh;
 		nrh = namreg_add(name, namelen);
@@ -1146,7 +1231,8 @@ tree_subtree_parse(bool_t sensepr, char *path)
 	bool_t isselpr;
 	bool_t ok;
 
-	/* walk the tree down this relative pathname from the root.
+	/*
+	 * walk the tree down this relative pathname from the root.
 	 */
 	ok = tsi_walkpath(path,
 			   NH_NULL,
@@ -1163,7 +1249,8 @@ tree_subtree_parse(bool_t sensepr, char *path)
 		return BOOL_FALSE;
 	}
 
-	/* set or clear flag in this node and all of its children,
+	/*
+	 * set or clear flag in this node and all of its children,
 	 * and ajust parentage flags.
 	 */
 	selsubtree(namedh, sensepr);
@@ -1171,7 +1258,8 @@ tree_subtree_parse(bool_t sensepr, char *path)
 	return BOOL_TRUE;
 }
 
-/* tree_post - called after the dirdump has been applied.
+/*
+ * tree_post - called after the dirdump has been applied.
  * first phase is to eliminate all unreferenced dirents.
  * done by recursive depth-wise descent of the tree. on the way
  * up, unlink or orphan unreferenced nondirs, unlink unreferenced
@@ -1210,7 +1298,8 @@ tree_post(char *path1, char *path2)
 	nh_t cldh;
 	bool_t ok;
 
-	/* eliminate unreferenced dirents
+	/*
+	 * eliminate unreferenced dirents
 	 */
 	if (! persp->p_fullpr) {
 		mlog(MLOG_DEBUG | MLOG_TREE,
@@ -1228,7 +1317,8 @@ tree_post(char *path1, char *path2)
 		}
 	}
 
-	/* make new directories
+	/*
+	 * make new directories
 	 */
 	mlog(MLOG_DEBUG | MLOG_TREE,
 	      "making new directories\n");
@@ -1244,7 +1334,8 @@ tree_post(char *path1, char *path2)
 	assert(tree_chk());
 #endif /* TREE_CHK */
 
-	/* rename directories
+	/*
+	 * rename directories
 	 */
 	if (! persp->p_fullpr) {
 		mlog(MLOG_DEBUG | MLOG_TREE,
@@ -1262,7 +1353,8 @@ tree_post(char *path1, char *path2)
 	assert(tree_chk());
 #endif /* TREE_CHK */
 
-	/* process hard links
+	/*
+	 * process hard links
 	 */
 	if (! persp->p_fullpr) {
 		mlog(MLOG_DEBUG | MLOG_TREE,
@@ -1436,7 +1528,8 @@ noref_elim_recurse(nh_t parh,
 				Node_unmap(cldh, &cldp);
 			}
 		} else  {
-			/* determine if we can unlink this node.
+			/*
+			 * determine if we can unlink this node.
 			 * if its not real, and not refed, simple.
 			 * if real and not refed and there is at least
 			 * one unreal refed node and no other real
@@ -1460,7 +1553,8 @@ noref_elim_recurse(nh_t parh,
 				assert(hardh != NH_NULL);
 				canunlinkpr = BOOL_FALSE;
 				neededpr = BOOL_FALSE;
-				/* tes@sgi.com:
+				/*
+				 * tes@sgi.com:
 				 * This loop seems to assume that
 				 * REAL files come before NON-REALs
 				 * so that we will break out first
@@ -1580,7 +1674,8 @@ noref_elim_recurse(nh_t parh,
 			}
 		}
 
-		/* next!
+		/*
+		 * next!
 		 */
 		cldh = nextcldh;
 	}
@@ -1610,7 +1705,8 @@ mkdirs_recurse(nh_t parh, nh_t cldh, char *path)
 		nextcldh = cldp->n_sibh;
 		Node_unmap(cldh, &cldp);
 
-		/* if needed, create a directory and update real flag
+		/*
+		 * if needed, create a directory and update real flag
 		 */
 		if (isdirpr && ! isrealpr && isrefpr && isselpr) {
 			int rval;
@@ -1641,7 +1737,8 @@ mkdirs_recurse(nh_t parh, nh_t cldh, char *path)
 			}
 		}
 
-		/* if a real selected directory, recurse
+		/*
+		 * if a real selected directory, recurse
 		 */
 		if (isdirpr && isrealpr && isselpr) {
 			bool_t ok;
@@ -1652,7 +1749,8 @@ mkdirs_recurse(nh_t parh, nh_t cldh, char *path)
 			}
 		}
 
-		/* next!
+		/*
+		 * next!
 		 */
 		cldh = nextcldh;
 	}
@@ -1740,7 +1838,8 @@ rename_dirs(nh_t cldh,
 			Node_free(&renameh);
 		}
 
-		/* next!
+		/*
+		 * next!
 		 */
 		cldh = nextcldh;
 	}
@@ -1748,7 +1847,8 @@ rename_dirs(nh_t cldh,
 	return BOOL_TRUE;
 }
 
-/* will call funcp for all links to be created. will abort if funcp
+/*
+ * will call funcp for all links to be created. will abort if funcp
  * ever returns FALSE;
  */
 rv_t
@@ -1774,11 +1874,13 @@ tree_cb_links(xfs_ino_t ino,
 		gen = BIGGEN2GEN(gen);
 	}
 
-	/* find the hardhead
+	/*
+	 * find the hardhead
 	 */
 	hardh = link_hardh(ino, gen);
 
-	/* loop through all hard links, attempting to restore/link
+	/*
+	 * loop through all hard links, attempting to restore/link
 	 */
 	path = path1;
 	for (nh = hardh; nh != NH_NULL; nh = link_nexth(nh)) {
@@ -1786,20 +1888,23 @@ tree_cb_links(xfs_ino_t ino,
 		u_char_t flags;
 		char *reasonstr;
 
-		/* get the node flags
+		/*
+		 * get the node flags
 		 */
 		np = Node_map(nh);
 		flags = np->n_flags;
 		Node_unmap(nh, &np);
 
-		/* build a pathname
+		/*
+		 * build a pathname
 		 */
 		ok = Node2path(nh, path, _("restore"));
 		if (! ok) {
 			continue;
 		}
 
-		/* skip if not in selected subtree
+		/*
+		 * skip if not in selected subtree
 		 */
 		if (! (flags & NF_SUBTREE)) {
 			mlog((MLOG_NITTY + 1) | MLOG_TREE,
@@ -1811,7 +1916,8 @@ tree_cb_links(xfs_ino_t ino,
 			continue;
 		}
 
-		/* don't restore into the housekeeping directory
+		/*
+		 * don't restore into the housekeeping directory
 		 */
 		if (path_beginswith(path, tranp->t_hkdir)) {
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
@@ -1824,7 +1930,8 @@ tree_cb_links(xfs_ino_t ino,
 			continue;
 		}
 
-		/* check if ok to overwrite: don't check if we've already
+		/*
+		 * check if ok to overwrite: don't check if we've already
 		 * been here and decided overwrite ok. if ok, set flag
 		 * so we won't check again. in fact, can't check again
 		 * since restore changes the answer.
@@ -1871,7 +1978,8 @@ tree_cb_links(xfs_ino_t ino,
 			}
 		}
 
-		/* call callback to restore file / create hard link.
+		/*
+		 * call callback to restore file / create hard link.
 		 * returns !ok if should abort.
 		 */
 		if (path == path2) {
@@ -1893,19 +2001,22 @@ tree_cb_links(xfs_ino_t ino,
 			return RV_NOTOK;
 		}
 
-		/* set flag, indicating node is now real
+		/*
+		 * set flag, indicating node is now real
 		 */
 		np = Node_map(nh);
 		np->n_flags |= NF_REAL;
 		Node_unmap(nh, &np);
 
-		/* switch to second path buffer, for link paths
+		/*
+		 * switch to second path buffer, for link paths
 		 */
 		path = path2;
 	}
 
 
-	/* if not yet peeled from tape, do so: place in orphanage if
+	/*
+	 * if not yet peeled from tape, do so: place in orphanage if
 	 * no references found (i.e., hard link list empty).
 	 */
 	if (path == path1) {
@@ -1992,7 +2103,8 @@ tree_cb_links(xfs_ino_t ino,
 	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
@@ -2078,7 +2190,8 @@ tree_extattr_recurse(nh_t parh,
 	dah_t dah;
 	bool_t ok;
 
-	/* first update all children
+	/*
+	 * first update all children
 	 */
 	while (cldh != NH_NULL) {
 		node_t *cldp;
@@ -2096,7 +2209,8 @@ tree_extattr_recurse(nh_t parh,
 		nextcldh = cldp->n_sibh;
 		Node_unmap(cldh, &cldp);
 
-		/* if a real selected directory, recurse
+		/*
+		 * if a real selected directory, recurse
 		 */
 		if (isdirpr && isrealpr && isselpr) {
 			bool_t ok;
@@ -2110,12 +2224,14 @@ tree_extattr_recurse(nh_t parh,
 			}
 		}
 
-		/* next!
+		/*
+		 * next!
 		 */
 		cldh = nextcldh;
 	}
 
-	/* now update self
+	/*
+	 * now update self
 	 */
 	parp = Node_map(parh);
 	dah = parp->n_dah;
@@ -2150,7 +2266,8 @@ proc_hardlinks(char *path1, char *path2)
 {
 	phcb_t phcb;
 
-	/* have callback invoked for all hardheads
+	/*
+	 * have callback invoked for all hardheads
 	 */
 	phcb.path1 = path1;
 	phcb.path2 = path2;
@@ -2159,7 +2276,8 @@ proc_hardlinks(char *path1, char *path2)
 	return phcb.ok;
 }
 
-/* called for every hard head
+/*
+ * called for every hard head
  *
  * tes@sgi.com:
  * This code processes the hardlinks, extracting out a
@@ -2194,7 +2312,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 	bool_t ok;
 	int rval;
 
-	/* skip directories
+	/*
+	 * skip directories
 	 */
 	hardheadp = Node_map(hardheadh);
 	ino = hardheadp->n_ino;
@@ -2210,7 +2329,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 	      ino,
 	      gen);
 
-	/* first pass through hard link list: for each node, leave on
+	/*
+	 * first pass through hard link list: for each node, leave on
 	 * list, unlink and place on rename src list, unlink and place on
 	 * rename dst list, or unlink and discard. note a node available
 	 * to link from, in case we need it.
@@ -2226,7 +2346,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		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 unrefed, unreal, free node etc. (sel doesn't matter)
 		 */
 		if (! isrealpr && ! isrefpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
@@ -2239,7 +2360,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 			continue;
 		}
 
-		/* not real, refed, but not selected, can't help
+		/*
+		 * not real, refed, but not selected, can't help
 		 */
 		if (! isrealpr &&   isrefpr && ! isselpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
@@ -2249,7 +2371,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 			continue;
 		}
 
-		/* if unreal, refed, sel, add to dst list,
+		/*
+		 * if unreal, refed, sel, add to dst list,
 		 */
 		if (! isrealpr &&   isrefpr &&   isselpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
@@ -2263,7 +2386,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 			continue;
 		}
 
-		/* if real, unrefed, sel, add to src list
+		/*
+		 * if real, unrefed, sel, add to src list
 		 */
 		if (isrealpr && ! isrefpr &&   isselpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
@@ -2276,7 +2400,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 			continue;
 		}
 
-		/* would like to get rid of but not selected, or
+		/*
+		 * would like to get rid of but not selected, or
 		 * real and referenced, leave alone (sel doesn't matter).
 		 * consider as a lnk src, since real and not going away.
 		 */
@@ -2297,7 +2422,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		assert(0);
 	}
 
-	/* now pass through dst list, doing renames if src list not empty,
+	/*
+	 * 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
 	 */
@@ -2312,7 +2438,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		dstp->n_lnkh = NH_NULL;
 		Node_unmap(dsth, &dstp);
 
-		/* build pathname to dst
+		/*
+		 * build pathname to dst
 		 */
 		ok = Node2path(dsth, phcbp->path2, _("rename to"));
 		if (! ok) {
@@ -2332,7 +2459,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 			srcp->n_lnkh = NH_NULL;
 			Node_unmap(srch, &srcp);
 
-			/* build a path to src
+			/*
+			 * build a path to src
 			 */
 			ok = Node2path(srch, phcbp->path1, _("rename from"));
 			if (! ok) {
@@ -2370,7 +2498,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 			successpr = BOOL_TRUE;
 		}
 
-		/* tes@sgi.com: note: loop of one iteration only
+		/*
+		 * tes@sgi.com: note: loop of one iteration only
 		 */
 		while (! successpr && lnsrch != NH_NULL) {
 			ok = Node2path(lnsrch, phcbp->path1, _("link"));
@@ -2419,7 +2548,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		link_in(dsth);
 	}
 
-	/* finally, pass through remaining src list, unlinking/disowning.
+	/*
+	 * finally, pass through remaining src list, unlinking/disowning.
 	 * tes@sgi.com: don't believe this will happen as this step
 	 * should now be done in noref_elim_recurse().
 	 */
@@ -2467,7 +2597,8 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 	return BOOL_TRUE;
 }
 
-/* traverse tree depth-wise bottom-up for dirs no longer referenced.
+/*
+ * traverse tree depth-wise bottom-up for dirs no longer referenced.
  * if non-empty, move children to orphanage
  */
 bool_t
@@ -2497,7 +2628,8 @@ tree_setattr_recurse(nh_t parh, char *path)
 	while (cldh != NH_NULL) {
 		nh_t nextcldh;
 
-		/* get the node attributes
+		/*
+		 * get the node attributes
 		 */
 		node_t *cldp = Node_map(cldh);
 		bool_t isdirpr = (cldp->n_flags & NF_ISDIR);
@@ -2505,12 +2637,14 @@ tree_setattr_recurse(nh_t parh, char *path)
 		bool_t isrealpr = (cldp->n_flags & NF_REAL);
 		dah_t dah = cldp->n_dah;
 
-		/* get next cld
+		/*
+		 * get next cld
 		 */
 		nextcldh = cldp->n_sibh;
 		Node_unmap(cldh, &cldp);
 
-		/* if is a real selected dir, go ahead.
+		/*
+		 * if is a real selected dir, go ahead.
 		 */
 		if (isdirpr && isselpr && isrealpr) {
 			bool_t ok;
@@ -2571,7 +2705,8 @@ setdirattr(dah_t dah, char *path)
 		fssetdm.fsd_padding = 0;	/* not used */
 		fssetdm.fsd_dmstate = (uint16_t)dirattr_get_dmstate(dah);
 
-		/* restore DMAPI event settings etc.
+		/*
+		 * restore DMAPI event settings etc.
 		 */
 		rval = ioctl(fd,
 			      XFS_IOC_FSSETDM,
@@ -2621,7 +2756,8 @@ setdirattr(dah_t dah, char *path)
 		      strerror(errno));
 	}
 
-	/* set the extended inode flags
+	/*
+	 * set the extended inode flags
 	 */
 	if (!tranp->t_dstdirisxfspr)
 		return;
@@ -2652,7 +2788,8 @@ setdirattr(dah_t dah, char *path)
 	(void)close(fd);
 }
 
-/* deletes orphanage if empty, else warns
+/*
+ * deletes orphanage if empty, else warns
  */
 bool_t
 tree_delorph(void)
@@ -2712,11 +2849,13 @@ tree_subtree_inter(void)
 	dlog_ucbp_t cmdp;
 
 restart:
-	/* make the current working directory the root of the fs
+	/*
+	 * make the current working directory the root of the fs
 	 */
 	tranp->t_inter.i_cwdh = persp->p_rooth;
 
-	/* begin the dialog
+	/*
+	 * begin the dialog
 	 */
 	preamblecnt = 0;
 	fold_init(fold, _("subtree selection dialog"), '=');
@@ -2726,7 +2865,8 @@ restart:
 	assert(preamblecnt <= PREAMBLEMAX);
 	dlog_begin(preamblestr, preamblecnt);
 
-	/* execute commands until time to extract or quit. always begin with
+	/*
+	 * execute commands until time to extract or quit. always begin with
 	 * an implicit instructions command. if see SIGINT, give main thread
 	 * dialog a chance to decide if a session interrupt is wanted.
 	 */
@@ -2738,7 +2878,8 @@ restart:
 		const ix_t okix = 3;
 		ix_t responseix;
 
-		/* execute command and get response
+		/*
+		 * execute command and get response
 		 */
 		responseix = dlog_string_query(cmdp,
 					        0,
@@ -2751,7 +2892,8 @@ restart:
 						abortix,  /* sigquit ix */
 						okix);   /* ok ix */
 
-		/* ack the response
+		/*
+		 * ack the response
 		 */
 		ackcnt = 0;
 		if (responseix == sigintix) {
@@ -2765,10 +2907,12 @@ restart:
 		dlog_string_ack(ackstr,
 				 ackcnt);
 
-		/* exception handling
+		/*
+		 * exception handling
 		 */
 		if (responseix != okix) {
-			/* if exception, end the dialog. may restart
+			/*
+			 * if exception, end the dialog. may restart
 			 * if operator decidesd not to intr.
 			 */
 			postamblecnt = 0;
@@ -2779,13 +2923,15 @@ restart:
 			assert(postamblecnt <= POSTAMBLEMAX);
 			dlog_end(postamblestr, postamblecnt);
 
-			/* if sighup or sigquit, immediately quit
+			/*
+			 * if sighup or sigquit, immediately quit
 			 */
 			if (responseix == abortix) {
 				return BOOL_FALSE;
 			}
 
-			/* if sigint, allow main thread to decide if
+			/*
+			 * if sigint, allow main thread to decide if
 			 * operator really wants to quit
 			 */
 			assert(responseix == sigintix);
@@ -2820,7 +2966,8 @@ restart:
 	assert(postamblecnt <= POSTAMBLEMAX);
 	dlog_end(postamblestr, postamblecnt);
 
-	/* pv 773569 - quit is not a reason to consider session
+	/*
+	 * pv 773569 - quit is not a reason to consider session
          * to be interrupted (we haven't started yet) so just unmark
          * any selected directories and return */
 	if (cmdp == tsi_cmd_quit) {
@@ -2844,14 +2991,16 @@ tsi_cmd_pwd(void *ctxp,
 	     dlog_pcbp_t pcb,
 	     void *pctxp)
 {
-	/* special case root
+	/*
+	 * special case root
 	 */
 	if (tranp->t_inter.i_cwdh == persp->p_rooth) {
 		(*pcb)(pctxp, "cwd is fs root\n");
 		return;
 	}
 
-	/* ascend tree recursively, print path on way back
+	/*
+	 * ascend tree recursively, print path on way back
 	 */
 	tsi_cmd_pwd_recurse(ctxp, pcb, pctxp, tranp->t_inter.i_cwdh);
 	(*pcb)(pctxp, "\n");
@@ -2905,7 +3054,8 @@ tsi_cmd_ls(void *ctxp,
 	bool_t isdirpr;
 	bool_t isselpr;
 
-	/* walk the tree according to the path argument, to get
+	/*
+	 * walk the tree according to the path argument, to get
 	 * the named node.
 	 */
 	ok = tsi_walkpath(arg,
@@ -2923,7 +3073,8 @@ tsi_cmd_ls(void *ctxp,
 		return;
 	}
 
-	/* if named is not a dir, just display named
+	/*
+	 * if named is not a dir, just display named
 	 */
 	if (! isdirpr) {
 		(*pcb)(pctxp,
@@ -2936,7 +3087,8 @@ tsi_cmd_ls(void *ctxp,
 		return;
 	}
 
-	/* iterate through the directory, printing all matching entries.
+	/*
+	 * iterate through the directory, printing all matching entries.
 	 * hide the orphanage.
 	 */
 	while (cldh != NH_NULL) {
@@ -2985,7 +3137,8 @@ tsi_cmd_cd(void *ctxp,
 	bool_t isselpr;
 	bool_t ok;
 
-	/* walk the tree according to the path argument, to get
+	/*
+	 * walk the tree according to the path argument, to get
 	 * the named node.
 	 */
 	ok = tsi_walkpath(arg,
@@ -3003,7 +3156,8 @@ tsi_cmd_cd(void *ctxp,
 		return;
 	}
 
-	/* if named is not a dir, complain
+	/*
+	 * if named is not a dir, complain
 	 */
 	if (! isdirpr) {
 		assert(arg);
@@ -3014,7 +3168,8 @@ tsi_cmd_cd(void *ctxp,
 		return;
 	}
 
-	/* change the current working directory
+	/*
+	 * change the current working directory
 	 */
 	tranp->t_inter.i_cwdh = namedh;
 }
@@ -3036,7 +3191,8 @@ tsi_cmd_add(void *ctxp,
 	bool_t isselpr;
 	bool_t ok;
 
-	/* walk the tree according to the path argument, to get
+	/*
+	 * walk the tree according to the path argument, to get
 	 * the named node.
 	 */
 	ok = tsi_walkpath(arg,
@@ -3074,7 +3230,8 @@ tsi_cmd_delete(void *ctxp,
 	bool_t isselpr;
 	bool_t ok;
 
-	/* walk the tree according to the path argument, to get
+	/*
+	 * walk the tree according to the path argument, to get
 	 * the named node.
 	 */
 	ok = tsi_walkpath(arg,
@@ -3209,7 +3366,8 @@ tsi_cmd_help(void *ctxp,
 	}
 }
 
-/* walks the tree following the given path.
+/*
+ * walks the tree following the given path.
  * returns FALSE if syntax error encountered.
  * returns by reference handles to the named node, its parent,
  * the first child in its cld list, its ino, if it is a directory,
@@ -3233,17 +3391,20 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 	bool_t isselpr;
 
 
-	/* correct arg if ends with slash (if arg is "/", ok)
+	/*
+	 * correct arg if ends with slash (if arg is "/", ok)
 	 */
 	if (arg && strlen(arg) > 1 && arg[strlen(arg) - 1] == '/') {
 		arg[strlen(arg) - 1] = 0;
 	}
 
-	/* use path to walk down the path argument
+	/*
+	 * use path to walk down the path argument
 	 */
 	path = arg;
 
-	/* walk the tree beginning either at the root node
+	/*
+	 * walk the tree beginning either at the root node
 	 * or at the current working directory
 	 */
 	if (path && *path == '/') {
@@ -3255,7 +3416,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 		namedh = cwdh;
 	}
 
-	/* get the parent of the starting point, and its cld list
+	/*
+	 * get the parent of the starting point, and its cld list
 	 */
 	namedp = Node_map(namedh);
 	parh = namedp->n_parh;
@@ -3266,7 +3428,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 	Node_unmap(namedh, &namedp);
 	isdirpr = BOOL_TRUE;
 
-	/* walk the tree from the starting point following the path arg.
+	/*
+	 * walk the tree from the starting point following the path arg.
 	 * on leaving this loop, the following will be valid:
 	 *	namedh  - the handle of the node named by path arg;
 	 *	parh - the parent of the named node;
@@ -3278,26 +3441,30 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 		char *strpatchp;
 		nh_t sibh;
 
-		/* if no path arg, break
+		/*
+		 * if no path arg, break
 		 */
 		if (! path) {
 			break;
 		}
 
-		/* clean out leading slashes. these can occur if the
+		/*
+		 * clean out leading slashes. these can occur if the
 		 * path arg is ".../////..." or "////..."
 		 */
 		while (*path == '/') {
 			path++;
 		}
 
-		/* if empty path arg, break
+		/*
+		 * if empty path arg, break
 		 */
 		if (! strlen(path)) {
 			break;
 		}
 
-		/* copy the first name from the path, and advance
+		/*
+		 * copy the first name from the path, and advance
 		 * the path pointer.
 		 */
 		namelen = strcspn(path, "/");
@@ -3314,7 +3481,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			strpatchp = 0;
 		}
 
-		/* be sure the named node is a dir
+		/*
+		 * be sure the named node is a dir
 		 */
 		if (! isdirpr) {
 			if (pcb) {
@@ -3325,7 +3493,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			return BOOL_FALSE;
 		}
 
-		/* special case "."
+		/*
+		 * special case "."
 		 */
 		if (! strcmp(nbuf, ".")) {
 			if (strpatchp) {
@@ -3334,7 +3503,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			continue;
 		}
 
-		/* special case ".."
+		/*
+		 * special case ".."
 		 */
 		if (! strcmp(nbuf, "..")) {
 			if (parh == NH_NULL) {
@@ -3358,7 +3528,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			continue;
 		}
 
-		/* look for child with right name
+		/*
+		 * look for child with right name
 		 */
 		sibh = cldh;
 		while (sibh != NH_NULL) {
@@ -3389,7 +3560,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			sibh = nextsibh;
 		}
 
-		/* if no match, complain
+		/*
+		 * if no match, complain
 		 */
 		if (sibh == NH_NULL) {
 			if (pcb) {
@@ -3400,7 +3572,8 @@ tsi_walkpath(char *arg, nh_t rooth, nh_t cwdh,
 			return BOOL_FALSE;
 		}
 
-		/* continue search. cldh, ino and isdirpr
+		/*
+		 * continue search. cldh, ino and isdirpr
 		 * set in inner loop above
 		 */
 		parh = namedh;
@@ -3493,7 +3666,8 @@ Node_unmap(nh_t nh, node_t **npp)
 	node_unmap(nh, (void **)npp);
 }
 
-/* builds a pathname for the specified node, relative to root
+/*
+ * builds a pathname for the specified node, relative to root
  * returns FALSE if pathname too long
  */
 static bool_t
@@ -3520,7 +3694,8 @@ Node2path(nh_t nh, char *path, char *errmsg)
 	}
 }
 
-/* returns how much of the buffer remains, assuming the buffer size is
+/*
+ * returns how much of the buffer remains, assuming the buffer size is
  * MAXPATHLEN. always null-terminates, but null char not counted in return.
  * works because the buffer size is secretly 2 * MAXPATHLEN.
  */
@@ -3537,13 +3712,15 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 	int oldbufsz;
 	int namelen;
 
-	/* recursion termination
+	/*
+	 * recursion termination
 	 */
 	if (nh == persp->p_rooth) {
 		return bufsz;
 	}
 
-	/* if we have a cache hit, no need to recurse any further
+	/*
+	 * if we have a cache hit, no need to recurse any further
 	 */
 	if (nh == cache.nh) {
 		assert(bufsz > cache.len);
@@ -3551,7 +3728,8 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 		return bufsz - cache.len;
 	}
 
-	/* extract useful node members
+	/*
+	 * extract useful node members
 	 */
 	np = Node_map(nh);
 	parh = np->n_parh;
@@ -3560,7 +3738,8 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 	nrh = np->n_nrh;
 	Node_unmap(nh, &np);
 
-	/* build path to parent
+	/*
+	 * build path to parent
 	 */
 	oldbuf = buf;
 	oldbufsz = bufsz;
@@ -3570,7 +3749,8 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 	}
 	buf += oldbufsz - bufsz;
 
-	/* insert slash if parent not root
+	/*
+	 * insert slash if parent not root
 	 */
 	if (parh != persp->p_rooth) {
 		assert(bufsz + MAXPATHLEN >= 2);
@@ -3582,7 +3762,8 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 		}
 	}
 
-	/* append entry name: special case if in orphanage
+	/*
+	 * append entry name: special case if in orphanage
 	 */
 	if (parh == persp->p_orphh) {
 		namelen = sprintf(buf, "%llu.%u", (unsigned long long)ino, gen);
@@ -3594,12 +3775,14 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 		assert(namelen > 0);
 	}
 
-	/* update remaining buffer size
+	/*
+	 * update remaining buffer size
 	 */
 	bufsz -= namelen;
 	assert(bufsz + MAXPATHLEN > 0);
 
-	/* update the cache if we're the target's parent
+	/*
+	 * update the cache if we're the target's parent
 	 * (and the pathname is not too long)
 	 */
 	if (level == 1 && bufsz > 0) {
@@ -3608,7 +3791,8 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 		cache.len = oldbufsz - bufsz;
 	}
 
-	/* return remaining buffer size
+	/*
+	 * return remaining buffer size
 	 */
 	return bufsz;
 }
@@ -3714,7 +3898,8 @@ disown(nh_t cldh)
 	return nrh;
 }
 
-/* recursively marks all nodes in subtree as selected or not selected
+/*
+ * recursively marks all nodes in subtree as selected or not selected
  * for subtree restoral. adjusts ancestors flags accordingly. also adjusts
  * inomap, which will be used by content.c to see if a media file contains
  * any nondirs which might need to be restored.
@@ -3725,17 +3910,20 @@ selsubtree(nh_t nh, bool_t sensepr)
 	node_t *np;
 	nh_t parh;
 
-	/* first mark the subtree
+	/*
+	 * first mark the subtree
 	 */
 	selsubtree_recurse_down(nh, sensepr);
 
-	/* get parent
+	/*
+	 * get parent
 	 */
 	np = Node_map(nh);
 	parh = np->n_parh;
 	Node_unmap(nh, &np);
 
-	/* next adjust ancestory
+	/*
+	 * next adjust ancestory
 	 */
 	while (parh != NH_NULL) {
 		node_t *parp;
@@ -3767,7 +3955,8 @@ selsubtree(nh_t nh, bool_t sensepr)
 			}
 			if (! atleastonechildselpr) {
 				parp->n_flags &= ~NF_SUBTREE;
-				/* DBG could break out here (remember to unmap!)
+				/*
+				 * DBG could break out here (remember to unmap!)
 				 */
 			}
 		}
@@ -3782,7 +3971,8 @@ selsubtree_recurse_down(nh_t nh, bool_t sensepr)
 {
 	nh_t cldh;
 
-	/* first mark the node indicated, and get head of cld list
+	/*
+	 * first mark the node indicated, and get head of cld list
 	 */
 	{
 		node_t *np;
@@ -3805,7 +3995,8 @@ selsubtree_recurse_down(nh_t nh, bool_t sensepr)
 			if (sensepr) {
 				inomap_rst_add(ino);
 			} else {
-				/* check hardlist: don't del unless none needed
+				/*
+				 * check hardlist: don't del unless none needed
 				 */
 				nh_t nh;
 				bool_t neededpr = BOOL_FALSE;
@@ -3831,7 +4022,8 @@ selsubtree_recurse_down(nh_t nh, bool_t sensepr)
 		}
 	}
 
-	/* then mark all of its children. be sure to skip the orphanage!!!
+	/*
+	 * then mark all of its children. be sure to skip the orphanage!!!
 	 */
 	while (cldh != NH_NULL) {
 		node_t *cldp;
@@ -3850,7 +4042,8 @@ selsubtree_recurse_down(nh_t nh, bool_t sensepr)
 
 /* link abstraction *********************************************************/
 
-/* returns handle to head of hard link list
+/*
+ * returns handle to head of hard link list
  */
 static nh_t
 link_hardh(xfs_ino_t ino, gen_t gen)
@@ -3858,7 +4051,8 @@ link_hardh(xfs_ino_t ino, gen_t gen)
 	return hash_find(ino, gen);
 }
 
-/* returns following node in hard link list
+/*
+ * returns following node in hard link list
  */
 static nh_t
 link_nexth(nh_t nh)
@@ -3872,7 +4066,8 @@ link_nexth(nh_t nh)
 	return nexth;
 }
 
-/* searches hard link list for exact match.
+/*
+ * searches hard link list for exact match.
  * returns hard link list head
  */
 static nh_t
@@ -3914,17 +4109,20 @@ link_in(nh_t nh)
 	    "link_in(%llu): map in node\n", nh);
 #endif
 
-	/* map in the node to read ino and gen
+	/*
+	 * map in the node to read ino and gen
 	 */
 	np = Node_map(nh);
 	ino = np->n_ino;
 	gen = np->n_gen;
 
-	/* see if one or more links already hashed.
+	/*
+	 * see if one or more links already hashed.
 	 */
 	hardh = hash_find(ino, gen);
 
-	/* if not hashed, just hash it. otherwise put at end
+	/*
+	 * if not hashed, just hash it. otherwise put at end
 	 * of hard link (lnk) list.
 	 */
 	if (hardh == NH_NULL) {
@@ -3950,7 +4148,8 @@ link_in(nh_t nh)
 		Node_unmap(prevh, &prevp);
 	}
 
-	/* since always put at end of hard link list, make node's
+	/*
+	 * since always put at end of hard link list, make node's
 	 * lnk member terminate list.
 	 */
 	np->n_lnkh = NH_NULL;
@@ -3969,18 +4168,21 @@ link_out(nh_t nh)
 	gen_t gen;
 	nh_t hardh;
 
-	/* map in the node to read ino and gen
+	/*
+	 * map in the node to read ino and gen
 	 */
 	np = Node_map(nh);
 	ino = np->n_ino;
 	gen = np->n_gen;
 
-	/* get head of hard link list
+	/*
+	 * get head of hard link list
 	 */
 	hardh = hash_find(ino, gen);
 	assert(hardh != NH_NULL);
 
-	/* if node is at head of hard link list, hash it out and
+	/*
+	 * if node is at head of hard link list, hash it out and
 	 * hash in the following node in link list, if there is one.
 	 * otherwise, unlink from hardlink list.
 	 */
@@ -4004,12 +4206,14 @@ link_out(nh_t nh)
 	}
 	np->n_lnkh = NH_NULL;
 
-	/* release the mapping
+	/*
+	 * release the mapping
 	 */
 	Node_unmap(nh, &np);
 }
 
-/* invokes callback for all hardheads
+/*
+ * invokes callback for all hardheads
  * iteration aborted if callback returns FALSE
  */
 static void
@@ -4018,7 +4222,8 @@ link_headiter(bool_t (*cbfp)(void *contextp, nh_t hardh), void *contextp)
 	hash_iter(cbfp, contextp);
 }
 
-/* iterator for a hard link list. allows deletion of the last node
+/*
+ * iterator for a hard link list. allows deletion of the last node
  * returned.
  */
 static void
@@ -4036,24 +4241,28 @@ link_iter_next(link_iter_context_t *link_iter_contextp)
 	node_t *lastp;
 	nh_t tmplasth;
 
-	/* if already done, return
+	/*
+	 * if already done, return
 	 */
 	if (link_iter_contextp->li_donepr == BOOL_TRUE) {
 		return NH_NULL;
 	}
 
-	/* if no hardhead, done
+	/*
+	 * if no hardhead, done
 	 */
 	if (link_iter_contextp->li_headh == NH_NULL) {
 		link_iter_contextp->li_donepr = BOOL_TRUE;
 		return NH_NULL;
 	}
 
-	/* make tmp copy of last
+	/*
+	 * make tmp copy of last
 	 */
 	tmplasth = link_iter_contextp->li_lasth;
 
-	/* if no last, must be first call
+	/*
+	 * if no last, must be first call
 	 */
 	if (tmplasth == NH_NULL) {
 		assert(link_iter_contextp->li_prevh == NH_NULL);
@@ -4061,20 +4270,23 @@ link_iter_next(link_iter_context_t *link_iter_contextp)
 		return link_iter_contextp->li_lasth;
 	}
 
-	/* slide last into prev
+	/*
+	 * slide last into prev
 	 */
 	link_iter_contextp->li_prevh = tmplasth;
 	lastp = Node_map(tmplasth);
 	link_iter_contextp->li_lasth = lastp->n_lnkh;
 	Node_unmap(tmplasth, &lastp);
 
-	/* if NULL, flag done
+	/*
+	 * if NULL, flag done
 	 */
 	if (link_iter_contextp->li_lasth == NH_NULL) {
 		link_iter_contextp->li_donepr = BOOL_TRUE;
 	}
 
-	/* return the last handle
+	/*
+	 * return the last handle
 	 */
 	return link_iter_contextp->li_lasth;
 }
@@ -4086,12 +4298,14 @@ link_iter_unlink(link_iter_context_t *link_iter_contextp, nh_t nh)
 	node_t *lastp;
 	nh_t nexth;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(link_iter_contextp->li_lasth != NH_NULL);
 	assert(nh == link_iter_contextp->li_lasth);
 
-	/* get the next node in list
+	/*
+	 * get the next node in list
 	 */
 	lastp = Node_map(link_iter_contextp->li_lasth);
 	nexth = lastp->n_lnkh;
@@ -4133,11 +4347,13 @@ hash_init(size64_t vmsz,
 	size64_t hashlenmax;
 	ix_t hix;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(pgsz % sizeof(nh_t) == 0);
 
-	/* calculate the size of the hash array. must be a power of two,
+	/*
+	 * calculate the size of the hash array. must be a power of two,
 	 * and a multiple of the page size. don't use more than the available
 	 * vm. but enforce a minimum.
 	 */
@@ -4159,11 +4375,13 @@ hash_init(size64_t vmsz,
 		hashlen >>= 1;
 	assert(hashlen <= hashlenmax);
 
-	/* record hash size in persistent state
+	/*
+	 * record hash size in persistent state
 	 */
 	persp->p_hashsz = hashlen * sizeof(nh_t);
 
-	/* map the hash array just after the persistent state header
+	/*
+	 * map the hash array just after the persistent state header
 	 */
 	assert(persp->p_hashsz <= SIZEMAX);
 	assert(! (persp->p_hashsz % (size64_t)pgsz));
@@ -4180,13 +4398,15 @@ hash_init(size64_t vmsz,
 		return BOOL_FALSE;
 	}
 
-	/* initialize the hash array to all NULL node handles
+	/*
+	 * initialize the hash array to all NULL node handles
 	 */
 	for (hix = 0; hix < (ix_t)hashlen; hix++) {
 		tranp->t_hashp[hix] = NH_NULL;
 	}
 
-	/* build a hash mask. this works because hashlen is a power of two.
+	/*
+	 * build a hash mask. this works because hashlen is a power of two.
 	 * record in persistent state.
 	 */
 	assert(hashlen - 1 <= SIZEMAX);
@@ -4200,16 +4420,19 @@ hash_sync(char *perspath)
 {
 	size64_t hashsz;
 
-	/* sanity checks
+	/*
+	 * sanity checks
 	 */
 	assert(pgsz % sizeof(nh_t) == 0);
 
-	/* retrieve the hash size from the persistent state
+	/*
+	 * retrieve the hash size from the persistent state
 	 */
 	hashsz = persp->p_hashsz;
 	assert(! (hashsz % sizeof(nh_t)));
 
-	/* map the hash array just after the persistent state header
+	/*
+	 * map the hash array just after the persistent state header
 	 */
 	assert(hashsz <= SIZEMAX);
 	assert(! (hashsz % (size64_t)pgsz));
@@ -4249,33 +4472,40 @@ hash_in(nh_t nh)
 	size_t hix;
 	nh_t *entryp;
 
-	/* get a mapping to the node
+	/*
+	 * get a mapping to the node
 	 */
 	np = Node_map(nh);
 
-	/* get ino from node
+	/*
+	 * get ino from node
 	 */
 	ino = np->n_ino;
 
-	/* assert not already in
+	/*
+	 * assert not already in
 	 */
 	assert(hash_find(np->n_ino, np->n_gen) == NH_NULL);
 
-	/* calculate the hash index
+	/*
+	 * calculate the hash index
 	 */
 	hix = hash_val(ino, persp->p_hashmask);
 
-	/* get a pointer to the indexed hash array entry
+	/*
+	 * get a pointer to the indexed hash array entry
 	 */
 	entryp = &tranp->t_hashp[hix];
 
-	/* insert into the list, at the head
+	/*
+	 * insert into the list, at the head
 	 */
 	assert(np->n_hashh == NH_NULL);
 	np->n_hashh = *entryp;
 	*entryp = nh;
 
-	/* release the mapping
+	/*
+	 * release the mapping
 	 */
 	Node_unmap(nh, &np);
 }
@@ -4289,25 +4519,30 @@ hash_out(nh_t nh)
 	size_t hix;
 	nh_t *entryp;
 
-	/* get a mapping to the node
+	/*
+	 * get a mapping to the node
 	 */
 	np = Node_map(nh);
 
-	/* get the ino
+	/*
+	 * get the ino
 	 */
 	ino = np->n_ino;
 
-	/* get a pointer to the hash array entry
+	/*
+	 * get a pointer to the hash array entry
 	 */
 	hix = hash_val(ino, persp->p_hashmask);
 	entryp = &tranp->t_hashp[hix];
 
-	/* get the handle of the first node in the appropriate hash array
+	/*
+	 * get the handle of the first node in the appropriate hash array
 	 */
 	hashheadh = *entryp;
 	assert(hashheadh != NH_NULL);
 
-	/* if node is first in list, replace entry with following node.
+	/*
+	 * if node is first in list, replace entry with following node.
 	 * otherwise, walk the list until found.
 	 */
 	if (hashheadh == nh) {
@@ -4327,7 +4562,8 @@ hash_out(nh_t nh)
 	}
 	np->n_hashh = NH_NULL;
 
-	/* release the mapping
+	/*
+	 * release the mapping
 	 */
 	Node_unmap(nh, &np);
 }
@@ -4339,12 +4575,14 @@ hash_find(xfs_ino_t ino, gen_t gen)
 	node_t *np;
 	size_t hix;
 
-	/* get handle to first node in appropriate hash array
+	/*
+	 * get handle to first node in appropriate hash array
 	 */
 	hix = hash_val(ino, persp->p_hashmask);
 	nh = tranp->t_hashp[hix];
 
-	/* if list empty, return null handle
+	/*
+	 * if list empty, return null handle
 	 */
 	if (nh == NH_NULL) {
 		return NH_NULL;
@@ -4356,7 +4594,8 @@ hash_find(xfs_ino_t ino, gen_t gen)
 		ino, gen);
 #endif
 
-	/* walk the list until found.
+	/*
+	 * walk the list until found.
 	 */
 	np = Node_map(nh);
 	while (np->n_ino != ino || np->n_gen != gen) {
@@ -4377,7 +4616,8 @@ hash_find(xfs_ino_t ino, gen_t gen)
 	return nh;
 }
 
-/* invokes callback for all hashed nodes
+/*
+ * invokes callback for all hashed nodes
  * iteration aborted if callback returns FALSE
  * call back may hash out and free the node, so
  * must figure next node prior to calling callback.
@@ -4413,7 +4653,8 @@ hash_iter(bool_t (*cbfp)(void *contextp, nh_t hashh), void *contextp)
 /* misc static functions *****************************************************/
 
 #ifdef TREE_CHK
-/* use hash array to iterate through all nodes. check
+/*
+ * use hash array to iterate through all nodes. check
  * each node's hash, hardlink, namreg, dirattr, parent,
  * and sibling handles.
  */
@@ -4652,11 +4893,13 @@ parse(int slotcnt, char **slotbuf, char *string)
 	char *l;
 	size_t wordcnt;
 
-	/* sanity checkcs
+	/*
+	 * sanity checkcs
 	 */
 	assert(slotcnt >= 0);
 
-	/* allocate a companion to the input string for identifying
+	/*
+	 * allocate a companion to the input string for identifying
 	 * characters which are to be interpreted literally.
 	 */
 	liter = (char *)calloc(1, strlen(string) + 1);
@@ -4664,7 +4907,8 @@ parse(int slotcnt, char **slotbuf, char *string)
 		return -1;
 	}
 
-	/* pass 1: collapse escape sequences, identifying characters which
+	/*
+	 * pass 1: collapse escape sequences, identifying characters which
 	 * are to be interpreted literally
 	 */
 	for (s = string, l = liter; *s; s++, l++) {
@@ -4673,7 +4917,8 @@ parse(int slotcnt, char **slotbuf, char *string)
 		}
 	}
 
-	/* pass 2: collapse quoted spans, identifying characters which
+	/*
+	 * pass 2: collapse quoted spans, identifying characters which
 	 * are to be interpreted literally
 	 */
 	for (s = string, l = liter; *s; s++, l++) {
@@ -4682,7 +4927,8 @@ parse(int slotcnt, char **slotbuf, char *string)
 		}
 	}
 
-	/* pass 3: collapse white space spans into a single space
+	/*
+	 * pass 3: collapse white space spans into a single space
 	 */
 	for (s = string, l = liter; *s; s++, l++) {
 		if (is_white(*s) && ! *l) {
@@ -4690,7 +4936,8 @@ parse(int slotcnt, char **slotbuf, char *string)
 		}
 	}
 
-	/* pass 4: identify and null-terminate words
+	/*
+	 * pass 4: identify and null-terminate words
 	 */
 	wordcnt = 0;
 	s = string;
@@ -4745,7 +4992,8 @@ fix_escape(char *string, char *liter)
 	escape_table_t *ep;
 	escape_table_t *endep;
 
-	/* first look for special escapes described in table
+	/*
+	 * first look for special escapes described in table
 	 */
 	ep = escape_table;
 	endep = escape_table + (sizeof(escape_table)
@@ -4761,7 +5009,8 @@ fix_escape(char *string, char *liter)
 		}
 	}
 
-	/* detect white space escapes
+	/*
+	 * detect white space escapes
 	 */
 	if (is_white(string[1])) {
 		liter[0] = (char)1;
@@ -4770,7 +5019,8 @@ fix_escape(char *string, char *liter)
 		return;
 	}
 
-	/* detect hex escapes (don't allow null)
+	/*
+	 * detect hex escapes (don't allow null)
 	 */
 	if (string[1] == 'x') {
 		size_t hexlen;
@@ -4793,7 +5043,8 @@ fix_escape(char *string, char *liter)
 		}
 	}
 
-	/* detect octal escapes (don't allow null)
+	/*
+	 * detect octal escapes (don't allow null)
 	 */
 	if (is_octal(string[1])) {
 		size_t octallen;
@@ -4816,7 +5067,8 @@ fix_escape(char *string, char *liter)
 		}
 	}
 
-	/* didn't match any escape sequences, so assume literal
+	/*
+	 * didn't match any escape sequences, so assume literal
 	 */
 	liter[0] = (char)1;
 }
@@ -4827,12 +5079,14 @@ fix_quoted_span(char *string, char *liter)
 	char *s;
 	char *l;
 
-	/* first cover the leading quote
+	/*
+	 * first cover the leading quote
 	 */
 	shrink(string, 1);
 	shrink(liter, 1);
 
-	/* scan for the next non-literal quote, marking all
+	/*
+	 * scan for the next non-literal quote, marking all
 	 * characters in between as literal
 	 */
 	for (s = string, l = liter; *s && (*s != '\"' || *l); s++, l++) {
diff --git a/restore/tree.h b/restore/tree.h
index 4f9ffe8..69086bf 100644
--- a/restore/tree.h
+++ b/restore/tree.h
@@ -18,7 +18,8 @@
 #ifndef TREE_H
 #define TREE_H
 
-/* tree_init - creates a new tree abstraction.
+/*
+ * tree_init - creates a new tree abstraction.
  */
 extern bool_t tree_init(char *hkdir,
 			 char *dstdir,
@@ -36,7 +37,8 @@ extern bool_t tree_init(char *hkdir,
 			 uint32_t dumpformat,
 			 bool_t truncategenpr);
 
-/* tree_sync - synchronizes with an existing tree abstraction
+/*
+ * tree_sync - synchronizes with an existing tree abstraction
  */
 extern bool_t tree_sync(char *hkdir,
 			 char *dstdir,
@@ -44,7 +46,8 @@ extern bool_t tree_sync(char *hkdir,
 			 bool_t fullpr,
 			 bool_t dstdirisxfspr);
 
-/* tree_check_dump_format - detect the rare case where a
+/*
+ * tree_check_dump_format - detect the rare case where a
  * cumulative restore begins with a format 3 (or newer)
  * dump, and a later restore in the series encounters
  * a format 2 dump. the restore will fail unless the
@@ -53,13 +56,15 @@ extern bool_t tree_sync(char *hkdir,
 extern bool_t tree_check_dump_format(uint32_t dumpformat);
 
 
-/* tree_begindir - begins application of dumped directory to tree.
+/*
+ * tree_begindir - begins application of dumped directory to tree.
  * returns handle to dir node. returns by reference the dirattr
  * handle if new. caller must pre-zero (DAH_NULL).
  */
 extern nh_t tree_begindir(filehdr_t *fhdrp, dah_t *dahp);
 
-/* tree_addent - adds a directory entry; takes dirh from above call
+/*
+ * tree_addent - adds a directory entry; takes dirh from above call
  */
 extern rv_t tree_addent(nh_t dirh,
 			 xfs_ino_t ino,
@@ -67,25 +72,29 @@ extern rv_t tree_addent(nh_t dirh,
 			 char *name,
 			 size_t namelen);
 
-/* ends application of dir
+/*
+ * ends application of dir
  */
 extern void tree_enddir(nh_t dirh);
 
 #ifdef TREE_CHK
-/* tree_chk - do a sanity check of the tree prior to post-processing and
+/*
+ * tree_chk - do a sanity check of the tree prior to post-processing and
  * non-dir restoral. returns FALSE if corruption detected.
  */
 extern bool_t tree_chk(void);
 #endif /* TREE_CHK */
 
-/* tree_marknoref - mark all nodes as no reference, not dumped dirs, and
+/*
+ * tree_marknoref - mark all nodes as no reference, not dumped dirs, and
  * clear all directory attribute handles. done at the beginning
  * of the restoral of a dump session, in order to detect directory entries
  * no longer needed.
  */
 extern void tree_marknoref(void);
 
-/* mark all nodes in tree as either selected or unselected, depending on sense
+/*
+ * mark all nodes in tree as either selected or unselected, depending on sense
  */
 extern void tree_markallsubtree(bool_t sensepr);
 
@@ -105,7 +114,8 @@ extern rv_t tree_cb_links(xfs_ino_t ino,
 			   char *path1,
 			   char *path2);
 
-/* called after all dirs have been restored. adjusts the ref flags,
+/*
+ * called after all dirs have been restored. adjusts the ref flags,
  * by noting that dirents not refed because their parents were not dumped
  * are virtually reffed if their parents are refed.
  */
@@ -117,7 +127,8 @@ extern bool_t tree_subtree_inter(void);
 
 extern bool_t tree_extattr(bool_t (*cbfunc)(char *path, dah_t dah),
 			    char *path);
-	/* does a depthwise bottom-up traversal of the tree, calling
+	/*
+	 * does a depthwise bottom-up traversal of the tree, calling
 	 * the supplied callback for all directories with a non-NULL dirattr
 	 * handle. The callback will get called with the directory's pathname
 	 * and it dirattr handle. the traversal will be aborted if the
diff --git a/restore/win.c b/restore/win.c
index d3fe4dc..27d0d4f 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -35,7 +35,8 @@
 extern size_t pgsz;
 extern size_t pgmask;
 
-/* number of entries to add to the segmap if
+/*
+ * number of entries to add to the segmap if
  * it needs to be resized
  */
 #define SEGMAP_INCR	16
@@ -46,70 +47,89 @@ extern size_t pgmask;
 #define CRITICAL_BEGIN()  if (!locksoffpr) qlock_lock(tranp->t_qlockh)
 #define CRITICAL_END()    if (!locksoffpr) qlock_unlock(tranp->t_qlockh)
 
-/* window descriptor
+/*
+ * window descriptor
  */
 struct win {
 	segix_t w_segix;
-		/* index of segment mapped by this window
+		/*
+		 * index of segment mapped by this window
 		 */
 	void *w_p;
-		/* window virtual address
+		/*
+		 * window virtual address
 		 */
 	size_t w_refcnt;
-		/* reference count
+		/*
+		 * reference count
 		 */
 	struct win *w_nextp;
-		/* LRU list forward linkage
+		/*
+		 * LRU list forward linkage
 		 */
 	struct win *w_prevp;
-		/* LRU list backward linkage
+		/*
+		 * LRU list backward linkage
 		 */
 };
 
 typedef struct win win_t;
 
-/* forward declarations
+/*
+ * forward declarations
  */
 static void win_segmap_resize(segix_t segix);
 
-/* transient state
+/*
+ * transient state
  */
 struct tran {
 	int t_fd;
-		/* file descriptor of backing store to be windowed
+		/*
+		 * file descriptor of backing store to be windowed
 		 */
 	off64_t t_firstoff;
-		/* offset of first seg within backing store (for mmap())
+		/*
+		 * offset of first seg within backing store (for mmap())
 		 */
 	size64_t t_segsz;
-		/* backing store segment / window size
+		/*
+		 * backing store segment / window size
 		 */
 	size_t t_winmax;
-		/* maximum number of windows to allocate
+		/*
+		 * maximum number of windows to allocate
 		 */
 	size_t t_wincnt;
-		/* number of windows allocated
+		/*
+		 * number of windows allocated
 		 */
 	size_t t_winmmaps;
-		/* number of window mmap calls made
+		/*
+		 * number of window mmap calls made
 		 */
 	win_t *t_lruheadp;
-		/* LRU head (re-use from this end)
+		/*
+		 * LRU head (re-use from this end)
 		 */
 	win_t *t_lrutailp;
-		/* LRU tail (put here when no refs)
+		/*
+		 * LRU tail (put here when no refs)
 		 */
 	win_t **t_segmap;
-		/* mapping from segment index to window. an entry
+		/*
+		 * mapping from segment index to window. an entry
 		 * points to a win_t struct if segment is currently
 		 * mapped, otherwise the entry is NULL.
 		 */
 	size_t	t_segmaplen;
-		/* number of segments currently represented in
+		/*
+		 * number of segments currently represented in
 		 * t_segmap array.
 		 */
 	qlockh_t t_qlockh;
-		/* for establishing critical regions
+		/*
+		 * for establishing critical regions
 		 */
 };
 
@@ -151,12 +171,14 @@ win_init(int fd,
 	  size64_t segsz,
 	  size_t winmax)
 {
-	/* validate parameters
+	/*
+	 * validate parameters
 	 */
 	assert((firstoff & (off64_t)pgmask) == 0);
 	assert((segsz & pgmask) == 0);
 
-	/* allocate and initialize transient state
+	/*
+	 * allocate and initialize transient state
 	 */
 	assert(tranp == 0);
 	tranp = (tran_t *)calloc(1, sizeof(tran_t));
@@ -172,7 +194,8 @@ win_init(int fd,
 	calloc(tranp->t_segmaplen, sizeof(win_t *));
 	assert(tranp->t_segmap);
 
-	/* initialize critical region enforcer
+	/*
+	 * initialize critical region enforcer
 	 */
 	tranp->t_qlockh = qlock_alloc(QLOCK_ORD_WIN);
 }
@@ -193,7 +216,8 @@ win_map(segix_t segix, void **pp)
 	if (segix >= tranp->t_segmaplen)
 		win_segmap_resize(segix);
 
-	/* see if segment already mapped. if ref cnt zero,
+	/*
+	 * see if segment already mapped. if ref cnt zero,
 	 * remove from LRU list.
 	 */
 	winp = tranp->t_segmap[segix];
@@ -234,7 +258,8 @@ win_map(segix_t segix, void **pp)
 		return;
 	}
 
-	/* Allocate a new descriptor if we haven't yet hit the maximum,
+	/*
+	 * Allocate a new descriptor if we haven't yet hit the maximum,
 	 * otherwise reuse any descriptor on the LRU list.
 	 */
 	if (tranp->t_wincnt < tranp->t_winmax) {
@@ -273,11 +298,13 @@ win_map(segix_t segix, void **pp)
 		return;
 	}
 
-	/* calculate offset of segment
+	/*
+	 * calculate offset of segment
 	 */
 	segoff = segix * (off64_t)tranp->t_segsz;
 
-	/* map the window
+	/*
+	 * map the window
 	 */
 	assert(tranp->t_segsz >= 1);
 	assert(tranp->t_firstoff
@@ -333,20 +360,23 @@ win_unmap(segix_t segix, void **pp)
 
 	CRITICAL_BEGIN();
 
-	/* verify window mapped
+	/*
+	 * verify window mapped
 	 */
 	assert(segix < tranp->t_segmaplen);
 	winp = tranp->t_segmap[segix];
 	assert(winp);
 
-	/* validate p
+	/*
+	 * validate p
 	 */
 	assert(pp);
 	assert(*pp);
 	assert(*pp >= winp->w_p);
 	assert(*pp < (void *)((char *)(winp->w_p) + tranp->t_segsz));
 
-	/* decrement the reference count. if zero, place at tail of LRU list.
+	/*
+	 * decrement the reference count. if zero, place at tail of LRU list.
 	 */
 	assert(winp->w_refcnt > 0);
 	winp->w_refcnt--;
@@ -367,7 +397,8 @@ win_unmap(segix_t segix, void **pp)
 		assert(! winp->w_nextp);
 	}
 
-	/* zero the caller's pointer
+	/*
+	 * zero the caller's pointer
 	 */
 	*pp = 0;
 
diff --git a/restore/win.h b/restore/win.h
index 2d52b56..5ade429 100644
--- a/restore/win.h
+++ b/restore/win.h
@@ -18,24 +18,28 @@
 #ifndef WIN_H
 #define WIN_H
 
-/* win.[ch] - windows into a very large file
+/*
+ * win.[ch] - windows into a very large file
  */
 
 typedef int segix_t;
 
-/* initialize the window abstraction
+/*
+ * initialize the window abstraction
  */
 void win_init(int fd,
 	       off64_t rngoff,		/* offset into file of windowing */
 	       size64_t winsz,		/* window size */
 	       size_t wincntmax);	/* max number of windows to manage */
 
-/* supply a pointer to the portion of the file identified by segix.
+/*
+ * supply a pointer to the portion of the file identified by segix.
  */
 void win_map(segix_t segix,		/* segment index to be mapped */
 	      void **pp);		/* returns pointer by reference */
 
-/* invalidate the pointer previously supplied. SIDE-EFFECT: zeros
+/*
+ * invalidate the pointer previously supplied. SIDE-EFFECT: zeros
  * by reference the caller's pointer.
  */
 void win_unmap(segix_t segix,		/* must match win_map param */
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 15/24] xfsdump: (4/4)(style) add first empty line for multiline comments
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (10 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 14/24] xfsdump: (3/4)(style) " Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 16/24] xfsdump: (style) curly brackets should wrap with one space Jan Tulak
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Change the multiline comment style from /* foo to /*
 * foo

Created by this script:

#!/usr/bin/env bash
# change the multiline comment style from /* foo to /*
 * foo

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/^\(\s*\)\/\* \(.\+[^*][^/]\)$/\1\/*
\1 * \2/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 include/swab.h        |  3 +-
 inventory/getopt.h    |  3 +-
 inventory/inv_api.c   | 36 ++++++++++++++-------
 inventory/inv_core.c  |  3 +-
 inventory/inv_files.c |  3 +-
 inventory/inv_fstab.c |  6 ++--
 inventory/inv_idx.c   | 45 +++++++++++++++++---------
 inventory/inv_mgr.c   | 33 ++++++++++++-------
 inventory/inv_oref.c  |  9 ++++--
 inventory/inv_oref.h  |  3 +-
 inventory/inv_priv.h  |  3 +-
 inventory/inv_stobj.c | 75 ++++++++++++++++++++++++++++---------------
 inventory/inventory.h | 15 ++++++---
 invutil/invidx.c      |  6 ++--
 invutil/invutil.c     | 15 ++++++---
 librmt/rmtioctl.c     |  3 +-
 16 files changed, 174 insertions(+), 87 deletions(-)

diff --git a/include/swab.h b/include/swab.h
index 234e7d8..ce183bf 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -1,7 +1,8 @@
 #ifndef SWAB_H
 #define SWAB_H
 
-/* casts are necessary for constants, because we never know how for sure
+/*
+ * casts are necessary for constants, because we never know how for sure
  * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
  */
 #define ___swab16(x) \
diff --git a/inventory/getopt.h b/inventory/getopt.h
index 4ae23e4..8df7a03 100644
--- a/inventory/getopt.h
+++ b/inventory/getopt.h
@@ -18,7 +18,8 @@
 #ifndef GETOPT_H
 #define GETOPT_H
 
-/* getopt.h	common getopt  command string
+/*
+ * getopt.h	common getopt  command string
  *
  * several modules parse the command line looking for arguments specific to
  * that module. Unfortunately, each of the getopt(3) calls needs the
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index f34b92a..1ebd982 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -61,7 +61,8 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 	if (retval == I_DONE)
 		return tok;
 
-	/* if we just want to search the db, all we need is the invidx.
+	/*
+	 * if we just want to search the db, all we need is the invidx.
 	   at this point, we know that a tok wasnt created in init_idb() */
 	if (forwhat == INV_SEARCH_ONLY) {
 		/* fd == I_EMPTYINV or fd == valid fd */
@@ -70,7 +71,8 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 		return tok;
 	}
 
-	/* XXX also, see if it is too full. if so, make another and leave a
+	/*
+	 * XXX also, see if it is too full. if so, make another and leave a
 	   reference to the new file in the old one */
 
 	stobjfd = idx_get_stobj(fd, forwhat, &index);
@@ -92,7 +94,8 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 		return INV_TOKEN_NULL;
 	}
 
-	/* create another storage object (and, an inv_index entry for it
+	/*
+	 * create another storage object (and, an inv_index entry for it
 	   too) if we've filled this one up */
 
 	if ((uint) num >= sescnt->ic_maxnum) {
@@ -212,7 +215,8 @@ inv_writesession_open(
 
 	sestok = get_sesstoken(tok);
 
-	/* we need to put the new session in the appropriate place in
+	/*
+	 * we need to put the new session in the appropriate place in
 	   storage object. So first find out howmany sessions are there */
 
 	INVLOCK(fd, LOCK_EX);
@@ -222,7 +226,8 @@ inv_writesession_open(
 		return INV_TOKEN_NULL;
 	}
 
-	/* create the writesession, and get ready for the streams to come
+	/*
+	 * create the writesession, and get ready for the streams to come
 	   afterwards */
 	rval = stobj_create_session(sestok, fd, sescnt, &ses, &hdr);
 	assert (rval > 0);
@@ -296,7 +301,8 @@ inv_stream_open(
 
 	assert (tok != INV_TOKEN_NULL);
 
-	/* this memset is needed as a dump interrupted/crashed very soon
+	/*
+	 * this memset is needed as a dump interrupted/crashed very soon
 	 * after starting results in an inventory with exteremely large
 	 * starting/ending inodes or offsets. This can be misleading.
 	 * See bug #463702 for an example.
@@ -393,7 +399,8 @@ inv_stream_close(
 			dowrite = BOOL_TRUE;
 		}
 
-		/* get the last media file to figure out what our last
+		/*
+		 * get the last media file to figure out what our last
 		   ino was. we have a pointer to that in the stream token */
 		if (tok->md_lastmfile){
 			if (strm.st_endino.ino !=
@@ -471,7 +478,8 @@ inv_put_mediafile(
 	if (isgood)
 		mf->mf_flag |= INVT_MFILE_GOOD;
 
-	/* This flag is used to indicate the media file that contains the
+	/*
+	 * This flag is used to indicate the media file that contains the
 	   dump of the sessioninfo structure that contains all but this
 	   media file */
 	if (isinvdump)
@@ -481,7 +489,8 @@ inv_put_mediafile(
 	rval = stobj_put_mediafile(tok, mf);
 	INVLOCK(tok->md_sesstok->sd_invtok->d_stobj_fd, LOCK_UN);
 
-	/* we dont free the mfile here. we always keep the last mfile
+	/*
+	 * we dont free the mfile here. we always keep the last mfile
 	   around, inside the inv_stmtoken, and when we add a new mfile,
 	   we free the previous one. The last one is freed in stream_close()
 	   */
@@ -526,7 +535,8 @@ inv_get_sessioninfo(
 
 	INVLOCK(fd, LOCK_SH);
 
-	/* Next we get the session header, and the session information. Then
+	/*
+	 * Next we get the session header, and the session information. Then
 	   we can figure out how much space to allocate */
 	if (stobj_get_sessinfo(tok, &hdr, &ses) <= 0) {
 		INVLOCK(fd, LOCK_UN);
@@ -762,7 +772,8 @@ inv_delete_mediaobj(uuid_t *moid)
 {
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 
-	/* forall fsids (fs) in fstab {
+	/*
+	 * forall fsids (fs) in fstab {
 	       open invindex table (t)
 	       forall indices (i) in t {
 	          open stobj (st)
@@ -1021,7 +1032,8 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 		 && ! prctx->fstab && ! prctx->invcheck) {
 		inv_idbtoken_t tok;
 
-		/* A filesystem could be backed up, mkfs'ed then restored
+		/*
+		 * A filesystem could be backed up, mkfs'ed then restored
 		 * to a new UUID value.  Therefore, we can't simply stop
 		 * when we find the first matching mount point (pv564234).
 		 * This code loops through all filesystems and does the
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 006b41b..1a711fd 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -218,7 +218,8 @@ get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 		return -1;
 	}
 
-	/* if there's space anywhere at all, then it must be in the last
+	/*
+	 * if there's space anywhere at all, then it must be in the last
 	   entry */
 	*ent = malloc(hdrsz);
 	pos = (char *) arr + ((uint)nindices - 1) * hdrsz;
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index ae4642d..ebc8035 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -102,7 +102,8 @@ inv_setup_base(void)
 	else
 		inv_base = old_inv_base;
 
-	/* also setup the dependent paths now
+	/*
+	 * also setup the dependent paths now
 	 */
 	strcpy(inv_dirpathp, inv_base);
 	strcat(inv_dirpathp, MGR_DIRPATH);
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 5afec57..f9bf2b3 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -72,7 +72,8 @@ fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 	mlog(MLOG_NITTY | MLOG_INV, "INV: number of filesystems in fstab %d\n",
 	      *numfs);
 #endif
-	/* fstab is left locked EX on exit. The caller takes does
+	/*
+	 * fstab is left locked EX on exit. The caller takes does
 	   the unlocking */
 	return fd;
 }
@@ -137,7 +138,8 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 	    free (arr);
 	}
 
-	/* make a new fstab entry and insert it at the end. the table
+	/*
+	 * make a new fstab entry and insert it at the end. the table
 	   is locked EXclusively at this point */
 	{
 		invt_fstab_t ent;
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 28e402d..b29bcdc 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -54,7 +54,8 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 /*	invt_entry_t ient;
 	ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = tm; */
 
-	/* If time period of the new entry is before our first invindex,
+	/*
+	 * If time period of the new entry is before our first invindex,
 	   we have to insert a new invindex in the first slot */
 	if (iarr[0].ie_timeperiod.tp_start > tm) {
 		/* *stobjfd = idx_put_newentry(fd, 0, iarr, icnt, &ient); */
@@ -63,7 +64,8 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 	}
 
 	for (i = 0; i < icnt->ic_curnum; i++) {
-		/* if our time is nicely within an existing entry's time
+		/*
+		 * if our time is nicely within an existing entry's time
 		   period, hellalujah */
 		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm) ) {
 #ifdef INVT_DEBUG
@@ -97,19 +99,22 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 
 
 
-		/* if it is beyond the end of this timeperiod, see if we
+		/*
+		 * if it is beyond the end of this timeperiod, see if we
 		   belong to a timeperiod that doesn't have an entry */
 		if (iarr[i].ie_timeperiod.tp_end < tm) {
 			/* see if we're the last entry here */
 			if (i == icnt->ic_curnum - 1) {
-				/* our slot is (i+1)th entry. Make the
+				/*
+				 * our slot is (i+1)th entry. Make the
 				   timeperiod's the same as it was. As far
 				   as I can see there is no way that
 				   timeperiods can overlap.
 
 				   insert the new entry and write back
 				   icnt and invindex entry */
-				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
+				/*
+				 * *stobjfd = idx_put_newentry(fd, i+1, iarr,
 							     icnt, &ient); */
 			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			      return i;
@@ -118,7 +123,8 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 			if (iarr[i+1].ie_timeperiod.tp_start > tm) {
 
 
-				/* We have the option of pushing entries
+				/*
+				 * We have the option of pushing entries
 				   after (i) forward by one slot, and
 				   taking the (i+1)th slot, OR just hooking
 				   up with the next entry.
@@ -128,10 +134,12 @@ idx_insert_newentry(int fd, /* kept locked EX by caller */
 				assert((tm > iarr[i].ie_timeperiod.tp_end) &&
 				       (tm < iarr[i+1].ie_timeperiod.tp_start));
 
-				/* shift everything from (i+1) onwards by
+				/*
+				 * shift everything from (i+1) onwards by
 				   one. Then insert the new entry and write
 				   back icnt and invindex entries */
-				/* *stobjfd = idx_put_newentry(fd, i+1, iarr,
+				/*
+				 * *stobjfd = idx_put_newentry(fd, i+1, iarr,
 							     icnt, &ient); */
 			      *stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 				return i;
@@ -219,7 +227,8 @@ idx_find_stobj(invt_idxinfo_t *idx,
 
 	int 		stobjfd;
 
-	/* since sessions can be inserted in random order, the invindex
+	/*
+	 * since sessions can be inserted in random order, the invindex
 	   table can contain time-periods that don't have corresponding
 	   entries for */
 	if (GET_ALLHDRS_N_CNTS_NOLOCK(idx->invfd, (void **)&idx->iarr,
@@ -234,7 +243,8 @@ idx_find_stobj(invt_idxinfo_t *idx,
 	idx_DEBUG_printinvindices(idx->iarr, idx->icnt->ic_curnum);
 #endif
 
-	/* Now figure out where we are going to insert this stobj among the
+	/*
+	 * Now figure out where we are going to insert this stobj among the
 	   invindices and put it there */
 	idx->index = idx_insert_newentry(idx->invfd, &stobjfd, idx->iarr,
 						 idx->icnt, tm);
@@ -259,7 +269,8 @@ idx_create(char *fname, inv_oflag_t forwhat)
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
-	/* This is not to be called when the user wants to open
+	/*
+	 * This is not to be called when the user wants to open
 	   the db for SEARCH_ONLY. */
 	assert(forwhat != INV_SEARCH_ONLY);
 
@@ -368,7 +379,8 @@ idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime)
 
 
 
-/* an inventory index entry keeps track of a single storage object;
+/*
+ * an inventory index entry keeps track of a single storage object;
    it knows about its name (ie filename) and the timeperiod that the
    it contains dump sessions for.
    note that each file system has its own (set of) inventory indices.
@@ -423,7 +435,8 @@ idx_create_entry(
 			return -1;
 		}
 
-		/* XXX check if there are too many indices. if so, create
+		/*
+		 * XXX check if there are too many indices. if so, create
 		   another and leave a pointer to that in here */
 
 		/* create the new storage object */
@@ -474,14 +487,16 @@ idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index)
 	invt_entry_t 	*ent = 0;
 	int	     	 fd;
 
-	/* if there's space anywhere at all, then it must be in the last
+	/*
+	 * if there's space anywhere at all, then it must be in the last
 	   entry. get_lastheader() does the locking */
 
 	if ((*index = get_lastheader(invfd, (void **)&ent,
 				       sizeof(invt_entry_t),
 				       sizeof(invt_counter_t)) ) < 0)
 		return -1;
-	/* at this point we know that there should be at least one invindex
+	/*
+	 * at this point we know that there should be at least one invindex
 	   entry present */
 	assert (ent != NULL);
 	assert (ent->ie_filename);
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index b2664ab..3d18742 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -57,7 +57,8 @@ init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 	if (make_invdirectory(forwhat) < 0)
 		return I_DONE;
 
-	/* come up with the unique file suffix that refers to this
+	/*
+	 * come up with the unique file suffix that refers to this
 	   filesystem */
 	if (fstab_get_fname(pred, uuname, bywhat, forwhat) < 0) {
 		return I_DONE;
@@ -73,7 +74,8 @@ init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 		} else if (forwhat == INV_SEARCH_N_MOD) {
 			*tok = idx_create(fname, forwhat);
 		} else {
-			/* this happens when the inv is empty and the user
+			/*
+			 * this happens when the inv is empty and the user
 			   wants to do a search. this is legal - not an error */
 			return I_EMPTYINV;
 		}
@@ -205,7 +207,8 @@ invmgr_query_all_sessions (
 		}
 	}
 
-	/* return val indicates if there was an error or not. *buf
+	/*
+	 * return val indicates if there was an error or not. *buf
 	   says whether the search was successful */
 	return ret;
 }
@@ -239,7 +242,8 @@ search_invt(
 	if (invfd == I_EMPTYINV)
 		return -1;
 
-	/* set the caller's buffer pointer to NULL initially.
+	/*
+	 * set the caller's buffer pointer to NULL initially.
 	 * if no session found, the caller will expect to see
 	 * NULL.
 	 */
@@ -255,7 +259,8 @@ search_invt(
 
 	free(icnt);
 
-	/* we need to get all the invindex headers and seshdrs in reverse
+	/*
+	 * we need to get all the invindex headers and seshdrs in reverse
 	   order */
 	for (i = nindices - 1; i >= 0; i--) {
 		int			nsess, j;
@@ -286,17 +291,20 @@ search_invt(
 		for (j = nsess - 1; j >= 0; j--) {
 			invt_session_t ses;
 
-			/* fd is kept locked until we return from the
+			/*
+			 * fd is kept locked until we return from the
 			   callback routine */
 
-			/* Check to see if this session has been pruned
+			/*
+			 * Check to see if this session has been pruned
 			 * by xfsinvutil before checking it.
 			 */
 			if (harr[j].sh_pruned) {
 				continue;
 			}
 
-			/* if we need to check the fs uuid's and they don't
+			/*
+			 * if we need to check the fs uuid's and they don't
 			 * match or we fail to get the session record,
 			 * then keep looking
 			 */
@@ -397,10 +405,12 @@ invmgr_inv_print(
 		}
 		free (scnt);
 		for (s = 0; s < nsess; s++) {
-			/* fd is kept locked until we return from the
+			/*
+			 * fd is kept locked until we return from the
 			   callback routine */
 
-			/* Check to see if this session has been pruned
+			/*
+			 * Check to see if this session has been pruned
 			 * by xfsinvutil before returning it.
 			 */
 			if (harr[s].sh_pruned) {
@@ -622,7 +632,8 @@ insert_session(invt_sessinfo_t *s)
 		destroy_token(tok);
 	}
 
-	/* at this point we know that invindex has at least one entry
+	/*
+	 * at this point we know that invindex has at least one entry
 
 	   First we need to find out if this session is in the inventory
 	   already. To find the storage object that can possibly
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index d2f1515..1b26d03 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -321,7 +321,8 @@ oref_resolve(
 
 	OREF_SET_TYPE(invidx, INVT_OTYPE_INVIDX);
 
-	/* come up with the unique file suffix that refers to this
+	/*
+	 * come up with the unique file suffix that refers to this
 	   filesystem */
 	if (fstab_get_fname(pred, uuname, bywhat) < 0) {
 		return INV_ERR;
@@ -358,7 +359,8 @@ oref_resolve(
 		return INV_ERR;
 	}
 
-	/* create another storage object (and, an inv_index entry for it
+	/*
+	 * create another storage object (and, an inv_index entry for it
 	   too) if we've filled this one up */
 	if (OREF_CNT_CURNUM(stobj) >= OREF_CNT_MAXNUM(stobj)) {
 		int 	rval;
@@ -403,7 +405,8 @@ oref_resolve_child(
 
 	ent = OREF_ENTRIES(invidx);
 
-	/* at this point we know that there should be at least one invindex
+	/*
+	 * at this point we know that there should be at least one invindex
 	   entry present */
 	assert (ent != NULL);
 	assert (ent->ie_filename);
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 3118b38..d54c0df 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -38,7 +38,8 @@
 
 #define INVT_RES_MASK		0x0FF0
 
-/* Indicates if either its child or its parent has been resolved.
+/*
+ * Indicates if either its child or its parent has been resolved.
    Only one kin per object can exist. i.e. a child cant have children.*/
 #define INVT_RES_CHILD		0x1000
 #define INVT_RES_PARENT		0x2000
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 554c983..7fffc36 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -127,7 +127,8 @@ typedef struct invt_seshdr {
 } invt_seshdr_t;
 
 
-/* Each session consists of a number of media streams. While it is given that
+/*
+ * Each session consists of a number of media streams. While it is given that
    there won't be multiple writesessions (ie. dumpsessions) concurrently,
    there can be multiple media streams operating on a single file system,
    each writing media files within its own stream. Hence, we have a linked
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index f86c978..d745f8b 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -60,7 +60,8 @@ stobj_insert_session(invt_idxinfo_t *idx,
 		return -1;
 	}
 
-	/* Check the existing sessions to make sure that we're not
+	/*
+	 * Check the existing sessions to make sure that we're not
 	   duplicating this session */
 	if (sescnt->ic_curnum > 0) {
 		uint i;
@@ -139,7 +140,8 @@ stobj_find_splitpoint(int fd, invt_seshdr_t *harr, uint ns, time32_t tm)
 	}
 
 
-	/* All the entries have the same sh_time. It's not clear if that's
+	/*
+	 * All the entries have the same sh_time. It's not clear if that's
 	   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. */
@@ -195,7 +197,8 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 				= newsess->seshdr->sh_time;
 	}
 
-	/* Get the new stobj to put the 'spilling' sessinfo in. We know the
+	/*
+	 * 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);
@@ -206,7 +209,8 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 		invt_sescounter_t *scnt = NULL;
 		off64_t rval;
 
-		/* We dont need to split. So, just put the new session in
+		/*
+		 * We dont need to split. So, just put the new session in
 		   the new stobj, and rest in peace */
 		idx->index++;
 
@@ -236,7 +240,8 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 		if (! stobj_pack_sessinfo(fd, &session, &harr[i], &bufpp,
 					   &bufszp))
 			return -1;
-		/* Now we need to put this in the new StObj. So, first
+		/*
+		 * Now we need to put this in the new StObj. So, first
 		   unpack it. */
 		if (! stobj_unpack_sessinfo(bufpp, bufszp, &sesinfo) )
 			return -1;
@@ -252,7 +257,8 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 			return -1;
 		free(bufpp);
 	}
-	/* Put the new session in the stobj that we just split. Make
+	/*
+	 * 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 */
@@ -288,11 +294,13 @@ stobj_delete_sessinfo(int fd, /* kept locked EX by caller */
 		       invt_sescounter_t *sescnt,
 		       invt_session_t *ses, invt_seshdr_t *hdr)
 {
-	/* we change the sescnt here, but dont write it back to disk
+	/*
+	 * we change the sescnt here, but dont write it back to disk
 	   until later */
 	sescnt->ic_curnum--;
 
-	/* there is really no need to take out / zero out the deleted
+	/*
+	 * there is really no need to take out / zero out the deleted
 	   session. The seshdr and session will be over-written, but
 	   space taken by the streams and mediafiles will be wasted. */
 	return BOOL_TRUE;
@@ -334,7 +342,8 @@ stobj_put_session(
 	       (int) sescnt->ic_eof);
 #endif
 
-	/* we need to know where the streams begin, and where the
+	/*
+	 * 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;
 
@@ -467,7 +476,8 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 			    (off64_t) ((j-1) * sizeof(invt_mediafile_t));
 		}
 
-		/* adjust the offsets of the first and the last elements
+		/*
+		 * adjust the offsets of the first and the last elements
 		   in the mediafile chain */
 		mfiles[nmfiles].mf_prevmf = 0;
 		nmfiles += strms[i].st_nmediafiles;
@@ -612,7 +622,8 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 	int fd =  sestok->sd_invtok->d_stobj_fd;
 	off64_t pos;
 
-	/* first we need to find out where the current write-position is.
+	/*
+	 * 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)
@@ -626,7 +637,8 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 	if (PUT_SESCOUNTERS(fd, sescnt) < 0)
 		return -1;
 
-	/* get the stream information, and update number of mediafiles.
+	/*
+	 * 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 */
 
@@ -634,7 +646,8 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 			     tok->md_stream_off) < 0)
 		return -1;
 
-	/* We need to update the last ino of this STREAM, which is now the
+	/*
+	 * 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 */
@@ -768,17 +781,20 @@ stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 	sesbufcp = sesbuf = calloc(1, sessz);
 	assert(sesbuf);
 
-	/* Copy everything. Note that we don't bother to adjust the offsets
+	/*
+	 * 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) */
 
-	/* magic cookie that we put for sanity checking in case of an
+	/*
+	 * 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) );
 
-	/* This was originally INV_VERSION. Changed it to mean packed inventory
+	/*
+	 * This was originally INV_VERSION. Changed it to mean packed inventory
 	 * version number and added another inv_version_t to contain the INV_VERSION.
 	 * The primary intent of this change was to make everything 64 bit aligned,
 	 * but we also got the advantage of separating the packed inv version from
@@ -854,7 +870,8 @@ stobj_getsession_byuuid(
 		return BOOL_FALSE;
 	}
 
-	/* yay. we found the session. so, make the session struct and
+	/*
+	 * yay. we found the session. so, make the session struct and
 	   put it in the buffer */
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
@@ -890,7 +907,8 @@ stobj_getsession_bylabel(
 		return BOOL_FALSE;
 	}
 
-	/* yay. we found the session. so, make the session struct and
+	/*
+	 * yay. we found the session. so, make the session struct and
 	   put it in the buffer */
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
@@ -945,7 +963,8 @@ stobj_delete_mobj(int fd,
 		     off = mf->mf_nextmf,
 		     mf++) {
 
-/*  The prob is that we need to keep track of where we got these mfiles from
+/*
+ *  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);
@@ -958,7 +977,8 @@ stobj_delete_mobj(int fd,
 			}
 		}
 
-		/* We have all the media files of this stream. Make another
+		/*
+		 * We have all the media files of this stream. Make another
 		   pass, checking to see if we need to remove any mfiles */
  		dirty = BOOL_FALSE;
 
@@ -969,7 +989,8 @@ stobj_delete_mobj(int fd,
 				printf(" found one\n");
 #endif
 
-/*                                dirty = BOOL_TRUE;
+/*
+ *                                dirty = BOOL_TRUE;
 
 				if (j == 0)
 				       strms[i].st_firstmfile = mf->mf_nextmf;
@@ -1016,7 +1037,8 @@ stobj_unpack_sessinfo(
 
 	tmpbuf = (char *)malloc(bufsz);
 
-	/* first make sure that the magic cookie at the beginning is right.
+	/*
+	 * 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, _(
@@ -1026,7 +1048,8 @@ stobj_unpack_sessinfo(
 	/* skip the cookie */
 	p += strlen(INVTSESS_COOKIE) * sizeof(char);
 
-	/* Check the packing version number. In version 1, this was the only version number.
+	/*
+	 * 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) {
@@ -1037,7 +1060,8 @@ stobj_unpack_sessinfo(
 
 		p += sizeof(inv_version_t);
 
-		/* We hit a 64 bit alignment issue at this point leading to a
+		/*
+		 * 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
 		 * bcopy the remaining part of bufp to a new malloc'ed area
 		 * which will be 64 bit aligned. This is a memory leak, but not much.
@@ -1109,7 +1133,8 @@ stobj_unpack_sessinfo(
 			* sizeof(invt_mediafile_t);
 	}
 
-	/* sanity check the size of the buffer given to us vs. the size it
+	/*
+	 * 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",
diff --git a/inventory/inventory.h b/inventory/inventory.h
index e81f153..cc1fe12 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -20,7 +20,8 @@
 
 #include "types.h"
 
-/* abstract interface to the inventory sub system of xfsdump
+/*
+ * abstract interface to the inventory sub system of xfsdump
  *
  * the inventory contains a description of every xfsdump ever
  * done, unless explicitly deleted. It provides simple and specific
@@ -45,11 +46,13 @@
 
 typedef uint32_t		inv_version_t;
 
-/* This is the general inventory version.
+/*
+ * This is the general inventory version.
  */
 #define INV_VERSION		(inv_version_t) 1
 
-/* This is the version of the on-tape (packed) inventory.
+/*
+ * This is the version of the on-tape (packed) inventory.
  * version 2 has an extra inv_version_t in it to make everything
  * 64 bit aligned.
  */
@@ -183,7 +186,8 @@ typedef struct invt_strdesc_entry	*inv_stmtoken_t;
 
 
 
-/* inventory_open - initializes access to the inventory
+/*
+ * inventory_open - initializes access to the inventory
  */
 extern inv_idbtoken_t
 inv_open(
@@ -240,7 +244,8 @@ inv_put_mediafile(
 				     files from others */
 	bool_t		isinv_dump);
 
-/* lasttime_level_lessthan - finds the time of the last dump of the
+/*
+ * lasttime_level_lessthan - finds the time of the last dump of the
  * specified file system at a level less than the specified level.
  * if never dumped below the current level, *time is set to NULL.
  *
diff --git a/invutil/invidx.c b/invutil/invidx.c
index e723110..ca6e1c2 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -649,7 +649,8 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		mfiles[nmfiles + j].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof(invt_mediafile_t));
 	}
 
-	/* adjust the offsets of the first and the last elements
+	/*
+	 * adjust the offsets of the first and the last elements
 	   in the mediafile chain */
 	mfiles[nmfiles].mf_prevmf = 0;
 	nmfiles += strms[i].st_nmediafiles;
@@ -796,7 +797,8 @@ get_inventry_stobjfile(data_t *d)
 	return NULL;
     }
 
-    /* all the children will be from the same stobj file, so we can just
+    /*
+     * all the children will be from the same stobj file, so we can just
        get the name for the first */
 
     child_data = d->children[0]->data;
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 26fb630..774602d 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -242,7 +242,8 @@ main(int argc, char *argv[])
 	    }
     }
 
-    /* sanity check the inventory database directory, setup global paths
+    /*
+     * sanity check the inventory database directory, setup global paths
      */
     if (!inv_setup_base()) {
         fprintf(stderr,
@@ -287,7 +288,8 @@ main(int argc, char *argv[])
     return 0;
 }
 
-/* get_mntpnt & mntpnt_equal are used to allow matching of mountpoints if
+/*
+ * get_mntpnt & mntpnt_equal are used to allow matching of mountpoints if
  * no hostname is supplied
  */
 
@@ -384,7 +386,8 @@ ParseDate(char *strDate)
         date = mktime(&tm);
     }
 
-    /* xfsdump inventory uses time32_t for portability.
+    /*
+     * xfsdump inventory uses time32_t for portability.
      * make sure the given date did not overflow... */
     date32 = date;
     if (date32 != date) {
@@ -767,7 +770,8 @@ CheckAndPruneStObjFile(bool_t checkonly,
 		   ctime32(&StObjhdr->sh_time));
 	}
 	if (debug) {
-	    /* Note that the DMF people use some of this debug
+	    /*
+	     * Note that the DMF people use some of this debug
 	     * output for their interface to the inventory.
 	     * They care about the following fields:
 	     *	media label:
@@ -917,7 +921,8 @@ CheckAndPruneStObjFile(bool_t checkonly,
     return(0);
 }
 
-/* If any of the media objects have a label which matches the one supplied
+/*
+ * If any of the media objects have a label which matches the one supplied
  * by the user, or if none is supplied, or if the session has no media
  * objects, say the session is prunable.
  * Otherwise, say it should be bypassed.
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index 536069c..3e7a7ed 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -239,7 +239,8 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			return(-1);
 
 
-		/* If undefined then try and define it by looking
+		/*
+		 * If undefined then try and define it by looking
 		 * and the size of the get structure.
 		 * If we know our rmt host, then verify that the
 		 * structure is the correct size for the supported ones
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 16/24] xfsdump: (style) curly brackets should wrap with one space
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (11 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 15/24] xfsdump: (4/4)(style) " Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:29 ` [PATCH 18/24] xfsdump: (2/4)(style) indent and align the code Jan Tulak
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Add a space where it is missing "{foo}", and remove it where are
too many "{   foo   }".

Created by this script:

#!/usr/bin/env bash
# there should be a single space inside of curly brackets
# add where missing "{foo}" and remove where too many "{   foo   }"

find . -name '*.[ch]' ! -type d -exec bash -c '
sed -i \
    -e "s/{\s*\(\S\)/{ \1/g" \
    -e "s/\(\S\)\s*}/\1 }/g" \
    $0
' {} \;

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/content_inode.h  |  4 ++--
 common/drive_minrmt.c   |  2 +-
 common/drive_scsitape.c |  2 +-
 common/main.c           | 50 ++++++++++++++++++++---------------------
 common/mlog.c           | 22 +++++++++---------
 common/stream.c         |  2 +-
 common/ts_mtio.h        |  4 ++--
 dump/content.c          |  4 ++--
 dump/inomap.c           |  2 +-
 include/swab.h          |  6 ++---
 inventory/inv_files.c   |  2 +-
 inventory/inv_oref.h    | 12 +++++-----
 invutil/cmenu.c         | 22 +++++++++---------
 invutil/invutil.c       |  2 +-
 librmt/rmtioctl.c       |  4 ++--
 librmt/rmtopen.c        |  8 +++----
 restore/content.c       |  8 +++----
 restore/mmap.c          |  2 +-
 restore/tree.c          | 18 +++++++--------
 19 files changed, 88 insertions(+), 88 deletions(-)

diff --git a/common/content_inode.h b/common/content_inode.h
index cd8bf8e..915629f 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -149,7 +149,7 @@ typedef struct content_inode_hdr content_inode_hdr_t;
  */
 #define TIMESTRUCT_SZ	8
 
-struct timestruct {			/*		     bytes accum */
+struct timestruct { /*		     bytes accum */
 	int32_t		tv_sec;		/* seconds		 4     4 */
 	int32_t		tv_nsec;	/* and nanoseconds	 4     8 */
 };
@@ -166,7 +166,7 @@ typedef struct timestruct timestruct_t;
 #define BSTAT_SZ	128
 #define MODE_SZ		4
 
-struct bstat {				/*		     bytes accum */
+struct bstat { /*		     bytes accum */
 	xfs_ino_t	bs_ino;		/* inode number		 8     8 */
 	uint32_t	bs_mode;	/* type and mode	 4     c */
 	uint32_t	bs_nlink;	/* number of links	 4    10 */
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index c10d4f4..0006a7e 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -3337,7 +3337,7 @@ prepare_drive(drive_t *drivep)
 
 	/*
 	 * determine tape capabilities. this will set the drivep->d_capabilities
-	 * and contextp->dc_{...}blksz and dc_isQICpr, as well as recommended
+	 * and contextp->dc_{ ... }blksz and dc_isQICpr, as well as recommended
 	 * mark separation and media file size.
 	 */
 	ok = get_tpcaps(drivep);
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index b74641c..9e4d33e 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -4251,7 +4251,7 @@ retry:
 
 	/*
 	 * determine tape capabilities. this will set the drivep->d_capabilities
-	 * and contextp->dc_{...}blksz and dc_isQICpr, as well as recommended
+	 * and contextp->dc_{ ... }blksz and dc_isQICpr, as well as recommended
 	 * mark separation and media file size.
 	 */
 	ok = get_tpcaps(drivep);
diff --git a/common/main.c b/common/main.c
index 0e7cc51..f560c82 100644
--- a/common/main.c
+++ b/common/main.c
@@ -987,7 +987,7 @@ usage(void)
 	ULO(_("<use QIC tape settings>"),		GETOPT_QIC);
 	ULO(_("<subtree> ..."),				GETOPT_SUBTREE);
 	ULO(_("<file> (use file mtime for dump time"),	GETOPT_DUMPTIME);
-	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY);
+	ULO(_("<verbosity { silent, verbose, trace }>"),	GETOPT_VERBOSITY);
 	ULO(_("<maximum file size>"),			GETOPT_MAXDUMPFILESIZE);
 	ULO(_("(don't dump extended file attributes)"),	GETOPT_NOEXTATTR);
 	ULO(_("<base dump session id>"),		GETOPT_BASED);
@@ -1040,7 +1040,7 @@ usage(void)
 	ULO(_("(cumulative restore)"),			GETOPT_CUMULATIVE);
 	ULO(_("<subtree> ..."),				GETOPT_SUBTREE);
 	ULO(_("(contents only)"),			GETOPT_TOC);
-	ULO(_("<verbosity {silent, verbose, trace}>"),	GETOPT_VERBOSITY);
+	ULO(_("<verbosity { silent, verbose, trace }>"),	GETOPT_VERBOSITY);
 	ULO(_("(use small tree window)"),		GETOPT_SMALLWINDOW);
 	ULO(_("(don't restore extended file attributes)"), GETOPT_NOEXTATTR);
 	ULO(_("(restore root dir owner/permissions)"),	GETOPT_ROOTPERM);
@@ -2330,33 +2330,33 @@ struct sig_printmap {
 typedef struct sig_printmap sig_printmap_t;
 
 static sig_printmap_t sig_printmap[] = {
-	{SIGHUP,	"SIGHUP"},
-	{SIGINT,	"SIGINT"},
-	{SIGQUIT,	"SIGQUIT"},
-	{SIGILL,	"SIGILL"},
-	{SIGABRT,	"SIGABRT"},
-	{SIGFPE,	"SIGFPE"},
-	{SIGBUS,	"SIGBUS"},
-	{SIGSEGV,	"SIGSEGV"},
+	{ SIGHUP,	"SIGHUP" },
+	{ SIGINT,	"SIGINT" },
+	{ SIGQUIT,	"SIGQUIT" },
+	{ SIGILL,	"SIGILL" },
+	{ SIGABRT,	"SIGABRT" },
+	{ SIGFPE,	"SIGFPE" },
+	{ SIGBUS,	"SIGBUS" },
+	{ SIGSEGV,	"SIGSEGV" },
 #ifdef SIGSYS
-	{SIGSYS,	"SIGSYS"},
+	{ SIGSYS,	"SIGSYS" },
 #endif
-	{SIGPIPE,	"SIGPIPE"},
-	{SIGALRM,	"SIGALRM"},
-	{SIGTERM,	"SIGTERM"},
-	{SIGUSR1,	"SIGUSR1"},
-	{SIGUSR2,	"SIGUSR2"},
-	{SIGCHLD,	"SIGCHLD"},
-	{SIGPWR,	"SIGPWR"},
-	{SIGURG,	"SIGURG"},
-	{SIGPOLL,	"SIGPOLL"},
-	{SIGXCPU,	"SIGXCPU"},
-	{SIGXFSZ,	"SIGXFSZ"},
+	{ SIGPIPE,	"SIGPIPE" },
+	{ SIGALRM,	"SIGALRM" },
+	{ SIGTERM,	"SIGTERM" },
+	{ SIGUSR1,	"SIGUSR1" },
+	{ SIGUSR2,	"SIGUSR2" },
+	{ SIGCHLD,	"SIGCHLD" },
+	{ SIGPWR,	"SIGPWR" },
+	{ SIGURG,	"SIGURG" },
+	{ SIGPOLL,	"SIGPOLL" },
+	{ SIGXCPU,	"SIGXCPU" },
+	{ SIGXFSZ,	"SIGXFSZ" },
 #if HIDDEN
-	{SIGRTMIN,	"SIGRTMIN"},
-	{SIGRTMAX,	"SIGRTMAX"},
+	{ SIGRTMIN,	"SIGRTMIN" },
+	{ SIGRTMAX,	"SIGRTMAX" },
 #endif
-	{0,		"???"}
+	{ 0,		"???" }
 };
 
 static char *
diff --git a/common/mlog.c b/common/mlog.c
index 5feeafe..b79aad1 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -103,17 +103,17 @@ char *mlog_ss_names[MLOG_SS_CNT] = {
 };
 
 static mlog_sym_t mlog_sym[] = {
-	{"0",		MLOG_SILENT},
-	{"1",		MLOG_VERBOSE},
-	{"2",		MLOG_TRACE},
-	{"3",		MLOG_DEBUG},
-	{"4",		MLOG_NITTY},
-	{"5",		MLOG_NITTY + 1},
-	{"silent",	MLOG_SILENT},
-	{"verbose",	MLOG_VERBOSE},
-	{"trace",	MLOG_TRACE},
-	{"debug",	MLOG_DEBUG},
-	{"nitty",	MLOG_NITTY}
+	{ "0",		MLOG_SILENT },
+	{ "1",		MLOG_VERBOSE },
+	{ "2",		MLOG_TRACE },
+	{ "3",		MLOG_DEBUG },
+	{ "4",		MLOG_NITTY },
+	{ "5",		MLOG_NITTY + 1 },
+	{ "silent",	MLOG_SILENT },
+	{ "verbose",	MLOG_VERBOSE },
+	{ "trace",	MLOG_TRACE },
+	{ "debug",	MLOG_DEBUG },
+	{ "nitty",	MLOG_NITTY }
 };
 
 static qlockh_t mlog_qlockh;
diff --git a/common/stream.c b/common/stream.c
index 0bc6a34..42d87cb 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -208,7 +208,7 @@ stream_getix(pthread_t tid)
 	spm_t *p;							\
 	pthread_t mytid = pthread_self();				\
 									\
-	if (!pthread_equal(mytid, (tid))) {				\
+	if (!pthread_equal(mytid, (tid))) { \
 		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,		\
 		      "stream_set_" #field_name "(): "			\
 		      "foreign stream (tid %lu) "			\
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 8736bf2..07b1932 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -667,7 +667,7 @@ struct mt_fpmsg {
 	int		mm_mlen;
 	union {
 		char	mm_msg[MT_FPMSG_MAX_MSGLEN];	/* Generic format */
-		struct {			/* Format for IBM 3590 type*/
+		struct { /* Format for IBM 3590 type*/
 			char   display_type;	/* Display Type: Set to 0x80 */
 			char   msg_type:3,      /* Message type: 0x00 = General
 						 * Status message */
@@ -684,7 +684,7 @@ struct mt_fpmsg {
 			char   msg1[8];	        /* message 1 */
 			char   msg2[8];	        /* message 2 */
 		} ibm3590;
-		struct {		/* Format for Fujitsu Diana 1, 2, 3 */
+		struct { /* Format for Fujitsu Diana 1, 2, 3 */
 			char   display_mode:3,
 		               display_len:1,
 		               flash:1,
diff --git a/dump/content.c b/dump/content.c
index fe52a70..7890eb9 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -3553,7 +3553,7 @@ dump_extattr_list(drive_t *drivep,
 			if (dumpbufp > dumpbufendp) {
 				break;		/* won't fit in buffer */
 			}
-			if (valuep != NULL) {	/* if added to dump buffer */
+			if (valuep != NULL) { /* if added to dump buffer */
 				endp = dumpbufp;
 				opp->am_attrname = entp->a_name;
 				opp->am_attrvalue = valuep;
@@ -3705,7 +3705,7 @@ dump_extattr_list(drive_t *drivep,
 							     flag,
 							     &valuep);
 
-			if (dumpbufp < dumpbufendp) {	/* if fits in buffer */
+			if (dumpbufp < dumpbufendp) { /* if fits in buffer */
 				endp = dumpbufp;
 				(void)memcpy(valuep, hsmvaluep, hsmvaluesz);
 				hsmcursor++;
diff --git a/dump/inomap.c b/dump/inomap.c
index 7280ad4..240a767 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -775,7 +775,7 @@ supprt_prune(void *arg1,	/* ancestors marked as changed? */
 		return cbrval;
 	}
 
-	if (*(bool_t *)arg1 == BOOL_TRUE) {	/* shortcut, sibling changed */
+	if (*(bool_t *)arg1 == BOOL_TRUE) { /* shortcut, sibling changed */
 		return cbrval;
 	}
 
diff --git a/include/swab.h b/include/swab.h
index ce183bf..ae43b89 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -119,7 +119,7 @@ static __inline__ __u16 __swab16p(__u16 *x)
 }
 static __inline__ void __swab16s(__u16 *addr)
 {
-	(__extension__ ({__arch__swab16s(addr);}));
+	(__extension__ ({ __arch__swab16s(addr); }));
 }
 
 static __inline__ __u32 __fswab32(__u32 x)
@@ -132,7 +132,7 @@ static __inline__ __u32 __swab32p(__u32 *x)
 }
 static __inline__ void __swab32s(__u32 *addr)
 {
-	(__extension__ ({__arch__swab32s(addr);}));
+	(__extension__ ({ __arch__swab32s(addr); }));
 }
 
 static __inline__ __u64 __fswab64(__u64 x)
@@ -151,7 +151,7 @@ static __inline__ __u64 __swab64p(__u64 *x)
 }
 static __inline__ void __swab64s(__u64 *addr)
 {
-	(__extension__ ({__arch__swab64s(addr);}));
+	(__extension__ ({ __arch__swab64s(addr); }));
 }
 
 #endif /* SWAB_H */
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index ebc8035..a07fe28 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -92,7 +92,7 @@ inv_setup_base(void)
 		    new_sbuf.st_dev == old_sbuf.st_dev) {
 			old_exists = 0;	/* both the same, pretend */
 		}
-		else {	/* die! */
+		else { /* die! */
 			return 0;
 		}
 	}
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index d54c0df..ab29b7a 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -172,35 +172,35 @@ typedef struct invt_oref {
 	  (oref)->type |= INVT_RES_ENTRIES; }
 
 #define OREF_SET_HDRS(oref, hdrs) \
-        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
+        { assert ((oref)->type & INVT_OTYPE_STOBJ); \
 	   assert ((oref)->type & INVT_RES_COUNTERS); \
 	   (oref)->eu_hdr = hdrs; \
 	   (oref)->type |= INVT_STOBJ_RES_HDRS; }
 
 #define OREF_SET_SESSIONS(oref, ses) \
-        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
+        { assert ((oref)->type & INVT_OTYPE_STOBJ); \
 	   assert ((oref)->type & INVT_RES_COUNTERS); \
 	   (oref)->eu_ses = ses; \
 	   (oref)->type |= INVT_STOBJ_RES_SESSIONS; }
 
 #define OREF_SET_STRMS(oref, strms) \
-        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
+        { assert ((oref)->type & INVT_OTYPE_STOBJ); \
 	   assert ((oref)->type & INVT_RES_COUNTERS); \
 	   (oref)->eu_strm = strms; \
 	   (oref)->type |= INVT_STOBJ_RES_STRMS; }
 
 #define OREF_SET_CHILD(oref, stobjref) \
-        {  assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
+        { assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
 	   (oref)->ku_child = stobjref; \
 	   (oref)->type |= INVT_RES_CHILD; }
 
 #define OREF_SET_PARENT(oref, invidxref) \
-        {  assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
+        { assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
 	   (oref)->ku_parent = invidxref; \
 	   (oref)->type |= INVT_RES_PARENT; }
 
 #define OREF_UNRESOLVE_CHILD(oref) \
-        {  assert (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
+        { assert (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
 	   close((oref)->ku_child->fd); \
 	   OREF_DESTROY((oref)->ku_child); \
 	   (oref)->ku_child = 0; \
diff --git a/invutil/cmenu.c b/invutil/cmenu.c
index a1704ed..a9ca301 100644
--- a/invutil/cmenu.c
+++ b/invutil/cmenu.c
@@ -43,17 +43,17 @@ WINDOW	*mainmenu;
 WINDOW	*infowin;
 
 menukey_t keyv[] = {
-    {'+',	"| +:       Expand           |",	menu_expand	},
-    {'-',	"| -:       Collapse         |",	menu_collapse	},
-    {'*',	"| *:       Expand Tree      |",	menu_expandall	},
-    {'%',	"| %:       Collapse Tree    |",	menu_collapseall},
-    {'d',	"| d:       Delete           |",	menu_delete	},
-    {'u',	"| u:       Undelete         |",	menu_undelete	},
-    {'i',	"| i:       Import Inventory |",	menu_import	},
-    {'x',	"| x:       Commit & Exit    |",	menu_commit	},
-    {'q',	"| q:       Quit             |",	menu_quit	},
-    {' ',	"| <space>: Select           |",	menu_select	},
-    {KEY_ENTER,	NULL,					menu_select	},
+    { '+',	"| +:       Expand           |",	menu_expand },
+    { '-',	"| -:       Collapse         |",	menu_collapse },
+    { '*',	"| *:       Expand Tree      |",	menu_expandall },
+    { '%',	"| %:       Collapse Tree    |",	menu_collapseall },
+    { 'd',	"| d:       Delete           |",	menu_delete },
+    { 'u',	"| u:       Undelete         |",	menu_undelete },
+    { 'i',	"| i:       Import Inventory |",	menu_import },
+    { 'x',	"| x:       Commit & Exit    |",	menu_commit },
+    { 'q',	"| q:       Quit             |",	menu_quit },
+    { ' ',	"| <space>: Select           |",	menu_select },
+    { KEY_ENTER,	NULL,					menu_select },
 };
 
 /*ARGSUSED*/
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 774602d..15555af 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -358,7 +358,7 @@ ParseDate(char *strDate)
         "%B %d",
         "%m%d%H",
         "%m%d",
-        0};
+        0 };
 
     for (fmt = &templateStr[0]; *fmt != NULL; fmt++) {
         memset (&tm, 0, sizeof (struct tm)); /* ensure fields init'ed */
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index 3e7a7ed..f74e595 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -104,8 +104,8 @@ struct linux64_mtget
 #define STD_MTOFFL  6       /* rewind and put the drive offline */
 
 #define MT_MAX 40 /* encompass potential range of mt_op values */
-static int mtop_irixmap[MT_MAX] = {-1};
-static int mtop_stdmap[MT_MAX] = {-1};
+static int mtop_irixmap[MT_MAX] = { -1 };
+static int mtop_stdmap[MT_MAX] = { -1 };
 
 static void
 init_mtop_map(void)
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index ea6e218..bdea8cc 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -39,9 +39,9 @@
 
 static int _rmt_open(char *, int, int);
 
-int _rmt_Ctp[MAXUNIT][2] = { {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1} };
-int _rmt_Ptc[MAXUNIT][2] = { {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1} };
-int _rmt_host[MAXUNIT] = { -1, -1, -1, -1};
+int _rmt_Ctp[MAXUNIT][2] = { {-1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
+int _rmt_Ptc[MAXUNIT][2] = { {-1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
+int _rmt_host[MAXUNIT] = { -1, -1, -1, -1 };
 
 struct uname_table
 {
@@ -50,7 +50,7 @@ struct uname_table
 };
 
 struct uname_table uname_table[] =
-{ {UNAME_LINUX, "Linux"}, {UNAME_IRIX, "IRIX"}, {0, 0} };
+{ {UNAME_LINUX, "Linux" }, { UNAME_IRIX, "IRIX" }, { 0, 0 } };
 
 
 /*
diff --git a/restore/content.c b/restore/content.c
index a97d9e3..dec3e44 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -2462,7 +2462,7 @@ content_stream_restore(ix_t thrdix)
 			unlock();
 #if DEBUG_DUMPSTREAMS
 			{
-			    static int count[STREAM_MAX] = {0};
+			    static int count[STREAM_MAX] = { 0 };
 			    int streamix = stream_getix(pthread_self());
 			    if (++(count[streamix]) == 30) {
 				mlog(MLOG_TRACE,
@@ -2637,7 +2637,7 @@ content_stream_restore(ix_t thrdix)
 			unlock();
 #if DEBUG_DUMPSTREAMS
 			{
-			static int count[STREAM_MAX] = {0};
+			static int count[STREAM_MAX] = { 0 };
 			int streamix = stream_getix(pthread_self());
 			    if (++(count[streamix]) == 30) {
 				mlog(MLOG_NORMAL,
@@ -3876,7 +3876,7 @@ finalize(char *path1, char *path2)
 		/*
 		 * restore directory attributes
 		 */
-		if (! persp->s.dirattrdonepr) {;
+		if (! persp->s.dirattrdonepr) { ;
 			ok = tree_setattr(path1);
 			if (! ok) {
 				return RV_INTR;
@@ -3887,7 +3887,7 @@ finalize(char *path1, char *path2)
 		/*
 		 * remove orphanage if empty
 		 */
-		if (! persp->s.orphdeltriedpr) {;
+		if (! persp->s.orphdeltriedpr) { ;
 			ok = tree_delorph();
 			if (! ok) {
 				return RV_INTR;
diff --git a/restore/mmap.c b/restore/mmap.c
index 0407740..96711e7 100644
--- a/restore/mmap.c
+++ b/restore/mmap.c
@@ -33,7 +33,7 @@ mmap_autogrow(size_t len, int fd, off_t offset)
     char nul_buffer[] = "";
 
     /* prealloc file if it is an empty file */
-    if (fstat(fd, &buf) == -1) {;
+    if (fstat(fd, &buf) == -1) { ;
 	return (void*)MAP_FAILED;
     }
     if (buf.st_size < offset+len) {
diff --git a/restore/tree.c b/restore/tree.c
index d2637ce..e5abcd9 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -4969,15 +4969,15 @@ struct escape_table {
 typedef struct escape_table escape_table_t;
 
 static escape_table_t escape_table[] = {
- {	'n',	'\n' },
- {	't',	'\t' },
- {	'v',	'\v' },
- {	'b',	'\b' },
- {	'r',	'\r' },
- {	'f',	'\f' },
- {	'f',	'\f' },
- {	'a',	'\a' },
- {	'\\',	'\\' }
+ { 'n',	'\n' },
+ { 't',	'\t' },
+ { 'v',	'\v' },
+ { 'b',	'\b' },
+ { 'r',	'\r' },
+ { 'f',	'\f' },
+ { 'f',	'\f' },
+ { 'a',	'\a' },
+ { '\\',	'\\' }
 };
 
 static void shrink(char *s, size_t cnt);
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 18/24] xfsdump: (2/4)(style) indent and align the code
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (12 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 16/24] xfsdump: (style) curly brackets should wrap with one space Jan Tulak
@ 2018-11-09 14:29 ` Jan Tulak
  2018-11-09 14:30 ` [PATCH 21/24] xfsdump: (style) format intercharacter spaces Jan Tulak
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:29 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Tab length is 8 spaces.

Created by Uncrustify with this config file:

#
# uncrustify config file, indentation
#

indent_with_tabs	= 2		# 1=indent with tabs, align with spaces, 2=use all tabs
input_tab_size		= 8		# original tab size
output_tab_size		= 8		# new tab size
indent_columns		= output_tab_size

indent_label		= 1		# pos: absolute col, neg: relative column

#
# inter-symbol newlines
#

nl_enum_brace		= ignore	# "enum {" vs "enum
 {"
nl_union_brace		= ignore	# "union {" vs "union
 {"
nl_struct_brace		= ignore	# "struct {" vs "struct
 {"
nl_do_brace 		= ignore	# "do {" vs "do
 {"
nl_if_brace 		= ignore	# "if () {" vs "if ()
 {"
nl_for_brace 		= ignore	# "for () {" vs "for ()
 {"
nl_else_brace 		= ignore	# "else {" vs "else
 {"
nl_while_brace 		= ignore	# "while () {" vs "while ()
 {"
nl_switch_brace 	= ignore	# "switch () {" vs "switch ()
 {"
nl_brace_while		= ignore	# "} while" vs "}
 while" - cuddle while
nl_brace_else		= ignore	# "} else" vs "}
 else" - cuddle else
sp_brace_else		= ignore
sp_else_brace		= ignore
nl_fcall_brace		= ignore	# "list_for_each() {" vs "list_for_each()
{"
nl_fdef_brace		= ignore		# "int foo() {" vs "int foo()
{"

#
# Source code modifications
#

mod_paren_on_return	= ignore	# "return 1;" vs "return (1);"
mod_full_brace_for	= ignore	# "for () a--;" vs "for () { a--; }"
mod_full_brace_do	= ignore	# "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while	= ignore	# "while (a) a--;" vs "while (a) { a--; }"

#
# inter-character spacing options
#

sp_return_paren		= ignore		# "return (1);" vs "return(1);"
sp_sizeof_paren		= ignore	# "sizeof (int)" vs "sizeof(int)"
sp_before_sparen	= ignore		# "if (" vs "if("
sp_after_sparen		= ignore		# "if () {" vs "if (){"
sp_after_cast		= ignore	# "(int) a" vs "(int)a"
sp_inside_braces	= ignore		# "{ 1 }" vs "{1}"
sp_inside_braces_struct	= ignore	# "{ 1 }" vs "{1}"
sp_inside_braces_enum	= ignore	# "{ 1 }" vs "{1}"
sp_assign		= ignore
sp_arith		= ignore
sp_bool			= ignore
sp_compare		= ignore
sp_assign		= ignore
sp_after_comma		= force
sp_func_def_paren	= ignore	# "int foo (){" vs "int foo(){"
sp_func_call_paren	= ignore	# "foo (" vs "foo("
sp_func_proto_paren	= ignore	# "int foo ();" vs "int foo();"

#
# Aligning stuff
#

align_with_tabs		= TRUE		# use tabs to align
align_on_tabstop	= TRUE 		# align on tabstops
align_enum_equ_span	= 4		# '=' in enum definition
align_var_def_colon	= TRUE
align_struct_init_span	= 3		# align stuff in a structure init '= { }'
align_right_cmt_span	= 3

#
# other
#

nl_func_paren = ignore
nl_func_decl_start = ignore
nl_func_decl_empty = ignore
nl_func_decl_args = ignore
nl_func_decl_end = ignore
sp_inside_paren = ignore
sp_inside_square = ignore
sp_inside_paren_cast = ignore
sp_inside_fparen = ignore
sp_inside_sparen = ignore
sp_paren_paren = ignore
sp_before_ptr_star = ignore
sp_after_ptr_star = ignore
sp_between_ptr_star = ignore
align_func_params = true
align_var_struct_span = 6

eat_blanks_after_open_brace   = false
eat_blanks_before_close_brace = false
pp_indent = ignore

nl_start_of_file   = ignore
nl_end_of_file     = ignore
nl_end_of_file_min = 1
nl_comment_func_def = 1

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 dump/content.c | 3402 ++++++++++++++++++++++++------------------------
 dump/getopt.h  |   78 +-
 dump/inomap.c  |  714 +++++-----
 dump/inomap.h  |   74 +-
 dump/var.c     |   42 +-
 5 files changed, 2155 insertions(+), 2155 deletions(-)

diff --git a/dump/content.c b/dump/content.c
index 7890eb9..62a4f13 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -74,20 +74,20 @@
 /*
  * max "unsigned long long int"
  */
-#define ULONGLONG_MAX	18446744073709551615LLU
+#define ULONGLONG_MAX   18446744073709551615LLU
 
 /*
  * legal range of dump levels
  */
-#define LEVEL_DEFAULT	0
-#define LEVEL_MAX	9
+#define LEVEL_DEFAULT   0
+#define LEVEL_MAX       9
 
 /*
  * ordinary files as big or bigger than this many pages will be
  * preceeded in the dump by enough padding to align the first byte
  * of that file's data to a page boundary
  */
-#define PGALIGNTHRESH	8
+#define PGALIGNTHRESH   8
 
 
 /* structure definitions used locally ****************************************/
@@ -95,12 +95,12 @@
 /*
  * number of bstats bstat_iter fetches at a time
  */
-#define BSTATBUFLEN	4096
+#define BSTATBUFLEN     4096
 
 /*
  * if the source file system type can't be determined, assume it is this
  */
-#define FS_DEFAULT	"xfs"
+#define FS_DEFAULT      "xfs"
 
 /*
  * marks consist of a opaque drive layer cookie and a startpoint.
@@ -110,7 +110,7 @@
  */
 struct mark {
 	drive_markrec_t dm;
-	startpt_t startpt;
+	startpt_t	startpt;
 };
 
 typedef struct mark mark_t;
@@ -118,7 +118,7 @@ typedef struct mark mark_t;
 /*
  * Media_mfile_begin() entry state.
  */
-enum bes { BES_INIT,	/* in the beginning */
+enum bes { BES_INIT,    /* in the beginning */
 	   BES_ENDOK,   /* last media file successfully flushed to media */
 	   BES_ENDEOM,  /* hit EOM while writing last media file */
 	   BES_INVAL }; /* to assert protocol being followed */
@@ -129,90 +129,90 @@ typedef enum bes bes_t;
  * per-stream context
  */
 struct context {
-	filehdr_t *cc_filehdrp;
-			/*
-			 * pre-allocated buffer: heads each dumped file
-			 */
-	extenthdr_t *cc_extenthdrp;
-			/*
-			 * pre-allocated buffer: heads each dumped file extent
-			 */
-	void *cc_inomap_contextp;
-			/*
-			 * pre-allocated context to speed inomap iteration
-			 */
-	char *cc_getdentsbufp;
-	size_t cc_getdentsbufsz;
-			/*
-			 * pre-allocated buffer for getdents() syscall
-			 */
-	char *cc_mdirentbufp;
-	size_t cc_mdirentbufsz;
-			/*
-			 * pre-allocated buffer for on-media dirent
-			 */
-	char *cc_extattrlistbufp;
-	size_t cc_extattrlistbufsz;
-			/*
-			 * pre-allocated buffer for retrieving a
-			 * list of extended file attributes
-			 */
+	filehdr_t *	cc_filehdrp;
+	/*
+	 * pre-allocated buffer: heads each dumped file
+	 */
+	extenthdr_t *	cc_extenthdrp;
+	/*
+	 * pre-allocated buffer: heads each dumped file extent
+	 */
+	void *		cc_inomap_contextp;
+	/*
+	 * pre-allocated context to speed inomap iteration
+	 */
+	char *		cc_getdentsbufp;
+	size_t		cc_getdentsbufsz;
+	/*
+	 * pre-allocated buffer for getdents() syscall
+	 */
+	char *		cc_mdirentbufp;
+	size_t		cc_mdirentbufsz;
+	/*
+	 * pre-allocated buffer for on-media dirent
+	 */
+	char *		cc_extattrlistbufp;
+	size_t		cc_extattrlistbufsz;
+	/*
+	 * pre-allocated buffer for retrieving a
+	 * list of extended file attributes
+	 */
 	attr_multiop_t *cc_extattrrtrvarrayp;
-	size_t cc_extattrrtrvarraylen;
-			/*
-			 * pre-allocated array of ops for retrieving the
-			 * values for a list of extended file attributes
-			 */
-	char *cc_extattrdumpbufp;
-	size_t cc_extattrdumpbufsz;
-			/*
-			 * pre-allocated buffer for dumping the names and
-			 * values for a list of extended file attributes
-			 */
-	hsm_f_ctxt_t *cc_hsm_f_ctxtp;
-			/*
-			 * pre-allocated HSM context used for holding HSM
-			   state information about a file across subroutine
-			   calls.
-			*/
-	char *cc_readlinkbufp;
-	size_t cc_readlinkbufsz;
-			/*
-			 * pre-allocated buffer for readlink()
-			 */
-	off64_t cc_mfilesz;
-			/*
-			 * total bytes dumped to media file
-			 */
-	size_t cc_markscommitted;
-			/*
-			 * number of marks committed in mfile. only useful
-			 * info is if greater than zero.
-			 */
-	xfs_ino_t cc_stat_lastino;
-			/*
-			 * monotonic strm nondir ino dumped
-			 */
-	bool_t cc_completepr;
-			/*
-			 * set if stream completely dumped. useful for
-			 * determining if dump was interrupted
-			 */
-	bool_t cc_Media_useterminatorpr;
-			/*
-			 * true if stream terminators are expected and
-			 * will be used
-			 */
-	char *cc_Media_firstlabel;
-			/*
-			 * optional command line media label. only used
-			 * for first media object in stream, and only if
-			 * media object does not already have a label
-			 */
-	bes_t cc_Media_begin_entrystate;
-			/*
-			 * Media_mfile_begin context entry state
-			 */
+	size_t		cc_extattrrtrvarraylen;
+	/*
+	 * pre-allocated array of ops for retrieving the
+	 * values for a list of extended file attributes
+	 */
+	char *		cc_extattrdumpbufp;
+	size_t		cc_extattrdumpbufsz;
+	/*
+	 * pre-allocated buffer for dumping the names and
+	 * values for a list of extended file attributes
+	 */
+	hsm_f_ctxt_t *	cc_hsm_f_ctxtp;
+	/*
+	 * pre-allocated HSM context used for holding HSM
+	   state information about a file across subroutine
+	   calls.
+	 */
+	char *		cc_readlinkbufp;
+	size_t		cc_readlinkbufsz;
+	/*
+	 * pre-allocated buffer for readlink()
+	 */
+	off64_t		cc_mfilesz;
+	/*
+	 * total bytes dumped to media file
+	 */
+	size_t		cc_markscommitted;
+	/*
+	 * number of marks committed in mfile. only useful
+	 * info is if greater than zero.
+	 */
+	xfs_ino_t	cc_stat_lastino;
+	/*
+	 * monotonic strm nondir ino dumped
+	 */
+	bool_t		cc_completepr;
+	/*
+	 * set if stream completely dumped. useful for
+	 * determining if dump was interrupted
+	 */
+	bool_t		cc_Media_useterminatorpr;
+	/*
+	 * true if stream terminators are expected and
+	 * will be used
+	 */
+	char *		cc_Media_firstlabel;
+	/*
+	 * optional command line media label. only used
+	 * for first media object in stream, and only if
+	 * media object does not already have a label
+	 */
+	bes_t		cc_Media_begin_entrystate;
+	/*
+	 * Media_mfile_begin context entry state
+	 */
 };
 
 typedef struct context context_t;
@@ -220,15 +220,15 @@ typedef struct context context_t;
 /*
  * extent group context, used by dump_file()
  */
-#define BMAP_LEN	512
+#define BMAP_LEN        512
 
 struct extent_group_context {
-	getbmapx_t eg_bmap[BMAP_LEN];
-	getbmapx_t *eg_nextbmapp;	/* ptr to the next extent to dump */
-	getbmapx_t *eg_endbmapp;		/* to detect extent exhaustion */
-	int eg_fd;			/* file desc. */
-	int eg_bmapix;		/* debug info only, not used */
-	int eg_gbmcnt;		/* debug, counts getbmapx calls for ino*/
+	getbmapx_t	eg_bmap[BMAP_LEN];
+	getbmapx_t *	eg_nextbmapp;   /* ptr to the next extent to dump */
+	getbmapx_t *	eg_endbmapp;    /* to detect extent exhaustion */
+	int		eg_fd;          /* file desc. */
+	int		eg_bmapix;      /* debug info only, not used */
+	int		eg_gbmcnt;      /* debug, counts getbmapx calls for ino*/
 };
 
 typedef struct extent_group_context extent_group_context_t;
@@ -237,42 +237,42 @@ typedef struct extent_group_context extent_group_context_t;
 /*
  * minimum getdents() buffer size
  */
-#define GETDENTSBUF_SZ_MIN	(2 * pgsz)
+#define GETDENTSBUF_SZ_MIN      (2 * pgsz)
 
 
 /*
  * minimum sizes for extended attributes buffers
  */
-#define EXTATTR_LISTBUF_SZ	(XATTR_LIST_MAX)
-#define EXTATTR_RTRVARRAY_LEN	(1 * pgsz)
-#define EXTATTR_DUMPBUF_SZ	(4 * pgsz)
+#define EXTATTR_LISTBUF_SZ      (XATTR_LIST_MAX)
+#define EXTATTR_RTRVARRAY_LEN   (1 * pgsz)
+#define EXTATTR_DUMPBUF_SZ      (4 * pgsz)
 
 /*
  * for printing ext attr namespace
  */
-#define EXTATTR_NAMESPACE(flag)	(((flag) & ATTR_ROOT) ? _("root") : \
-				(((flag) & ATTR_SECURE) ? _("secure") : \
+#define EXTATTR_NAMESPACE(flag) (((flag) & ATTR_ROOT) ? _("root") : \
+				 (((flag) & ATTR_SECURE) ? _("secure") : \
 				  _("non-root")) )
 
 /*
  * for printing file type
  */
-#define FILETYPE(statp)		(((statp)->bs_mode & S_IFMT) == S_IFDIR \
-				  ? _("dir") : _("nondir"))
+#define FILETYPE(statp)         (((statp)->bs_mode & S_IFMT) == S_IFDIR \
+				 ? _("dir") : _("nondir"))
 
 /*
  * per-drive status descriptor
  */
 struct pds {
-	enum { PDS_NULL,		/* per-drive activity not begun */
-	       PDS_INOMAP,		/* dumping inomap */
-	       PDS_DIRDUMP,		/* dumping dirs */
-	       PDS_NONDIR,		/* dumping nondirs */
-	       PDS_INVSYNC,		/* waiting for inventory */
-	       PDS_INVDUMP,		/* dumping session inventory */
-	       PDS_TERMDUMP		/* writing stream terminator */
+	enum { PDS_NULL,                /* per-drive activity not begun */
+	       PDS_INOMAP,              /* dumping inomap */
+	       PDS_DIRDUMP,             /* dumping dirs */
+	       PDS_NONDIR,              /* dumping nondirs */
+	       PDS_INVSYNC,             /* waiting for inventory */
+	       PDS_INVDUMP,             /* dumping session inventory */
+	       PDS_TERMDUMP             /* writing stream terminator */
 	} pds_phase;
-	size64_t pds_dirdone;		/* number of directories done */
+	size64_t pds_dirdone;           /* number of directories done */
 };
 
 typedef struct pds pds_t;
@@ -294,141 +294,141 @@ extern size_t pgsz;
  * file dumpers
  */
 static rv_t
-dump_dirs(ix_t strmix,
-		       xfs_bstat_t *bstatbufp,
-		       size_t bstatbuflen,
-		       void *inomap_contextp);
+dump_dirs(ix_t		strmix,
+	  xfs_bstat_t * bstatbufp,
+	  size_t	bstatbuflen,
+	  void *	inomap_contextp);
 static rv_t
 dump_dir(ix_t strmix,
-		      jdm_fshandle_t *,
-		      int,
-		      xfs_bstat_t *);
+	 jdm_fshandle_t *,
+	 int,
+	 xfs_bstat_t *);
 static rv_t
 dump_file(void *,
-		       jdm_fshandle_t *,
-		       int,
-		       xfs_bstat_t *);
+	  jdm_fshandle_t *,
+	  int,
+	  xfs_bstat_t *);
 static rv_t
-dump_file_reg(drive_t *drivep,
-			   context_t *contextp,
-			   content_inode_hdr_t *scwhdrp,
-			   jdm_fshandle_t *,
-			   xfs_bstat_t *,
-			   bool_t *);
+dump_file_reg(drive_t *			drivep,
+	      context_t *		contextp,
+	      content_inode_hdr_t *	scwhdrp,
+	      jdm_fshandle_t *,
+	      xfs_bstat_t *,
+	      bool_t *);
 static rv_t
-dump_file_spec(drive_t *drivep,
-			    context_t *contextp,
-			    jdm_fshandle_t *,
-			    xfs_bstat_t *);
+dump_file_spec(drive_t *	drivep,
+	       context_t *	contextp,
+	       jdm_fshandle_t *,
+	       xfs_bstat_t *);
 static rv_t
-dump_filehdr(drive_t *drivep,
-			  context_t *contextp,
-			  xfs_bstat_t *,
-			  off64_t,
-			  int);
+dump_filehdr(drive_t *	drivep,
+	     context_t *contextp,
+	     xfs_bstat_t *,
+	     off64_t,
+	     int);
 static rv_t
-dump_extenthdr(drive_t *drivep,
-			    context_t *contextp,
-			    int32_t,
-			    int32_t,
-			    off64_t,
-			    off64_t);
+dump_extenthdr(drive_t *	drivep,
+	       context_t *	contextp,
+	       int32_t,
+	       int32_t,
+	       off64_t,
+	       off64_t);
 static rv_t
-dump_dirent(drive_t *drivep,
-			 context_t *contextp,
-			 xfs_bstat_t *,
-			 xfs_ino_t,
-			 gen_t,
-			 char *,
-			 size_t);
+dump_dirent(drive_t *	drivep,
+	    context_t * contextp,
+	    xfs_bstat_t *,
+	    xfs_ino_t,
+	    gen_t,
+	    char *,
+	    size_t);
 static rv_t
 init_extent_group_context(jdm_fshandle_t *,
-				       xfs_bstat_t *,
-				       extent_group_context_t *);
+			  xfs_bstat_t *,
+			  extent_group_context_t *);
 static void cleanup_extent_group_context(extent_group_context_t *);
 static rv_t
-dump_extent_group(drive_t *drivep,
-			       context_t *contextp,
-			       xfs_bstat_t *,
-			       extent_group_context_t *,
-			       off64_t,
-			       off64_t,
-			       bool_t,
-			       off64_t *,
-			       off64_t *,
-			       bool_t *);
+dump_extent_group(drive_t *	drivep,
+		  context_t *	contextp,
+		  xfs_bstat_t *,
+		  extent_group_context_t *,
+		  off64_t,
+		  off64_t,
+		  bool_t,
+		  off64_t *,
+		  off64_t *,
+		  bool_t *);
 static bool_t
-dump_session_inv(drive_t *drivep,
-			        context_t *contextp,
-			        media_hdr_t *mwhdrp,
-			        content_inode_hdr_t *scwhdrp);
+dump_session_inv(drive_t *		drivep,
+		 context_t *		contextp,
+		 media_hdr_t *		mwhdrp,
+		 content_inode_hdr_t *	scwhdrp);
 static rv_t write_pad(drive_t *drivep, size_t);
 
 static void mark_callback(void *, drive_markrec_t *, bool_t);
 
 static void inv_cleanup(void);
 static void
-dump_terminator(drive_t *drivep,
-			     context_t *contextp,
-			     media_hdr_t *mwhdrp);
+dump_terminator(drive_t *	drivep,
+		context_t *	contextp,
+		media_hdr_t *	mwhdrp);
 static rv_t
-Media_mfile_begin(drive_t *drivep,
-			       context_t *contextp,
-			       bool_t intr_allowed);
+Media_mfile_begin(drive_t *	drivep,
+		  context_t *	contextp,
+		  bool_t	intr_allowed);
 static rv_t
-Media_mfile_end(drive_t *drivep,
-			     context_t *contextp,
-			     media_hdr_t *mwhdrp,
-			     off64_t *ncommittedp,
-			     bool_t hit_eom);
+Media_mfile_end(drive_t *	drivep,
+		context_t *	contextp,
+		media_hdr_t *	mwhdrp,
+		off64_t *	ncommittedp,
+		bool_t		hit_eom);
 static bool_t Media_prompt_overwrite(drive_t *drivep);
 static rv_t
 Media_erasechk(drive_t *drivep,
-			    int dcaps,
-			    bool_t intr_allowed,
-			    bool_t prevmediapresentpr);
+	       int	dcaps,
+	       bool_t	intr_allowed,
+	       bool_t	prevmediapresentpr);
 static bool_t Media_prompt_erase(drive_t *drivep);
 static char *Media_prompt_label(drive_t *drivep, char *bufp, size_t bufsz);
 static void
-update_cc_Media_useterminatorpr(drive_t *drivep,
-					     context_t *contextp);
+update_cc_Media_useterminatorpr(drive_t *	drivep,
+				context_t *	contextp);
 static void set_mcflag(ix_t thrdix);
 static void clr_mcflag(ix_t thrdix);
 
 static bool_t check_complete_flags(void);
 
 static rv_t
-dump_extattrs(drive_t *drivep,
-			   context_t *contextp,
-	       		   jdm_fshandle_t *fshandlep,
-			   xfs_bstat_t *statp);
+dump_extattrs(drive_t *		drivep,
+	      context_t *	contextp,
+	      jdm_fshandle_t *	fshandlep,
+	      xfs_bstat_t *	statp);
 static rv_t
-dump_extattr_list(drive_t *drivep,
-			       context_t *contextp,
-	       		       jdm_fshandle_t *fshandlep,
-			       xfs_bstat_t *statp,
-			       attrlist_t *listp,
-			       int flag,
-			       bool_t *abortprp);
-static char *dump_extattr_buildrecord(xfs_bstat_t *statp,
-				       char *dumpbufp,
-				       char *dumpbufendp,
-				       char *namesrcp,
-				       uint32_t valuesz,
-				       int flag,
-				       char **valuepp);
+dump_extattr_list(drive_t *		drivep,
+		  context_t *		contextp,
+		  jdm_fshandle_t *	fshandlep,
+		  xfs_bstat_t *		statp,
+		  attrlist_t *		listp,
+		  int			flag,
+		  bool_t *		abortprp);
+static char *dump_extattr_buildrecord(xfs_bstat_t *	statp,
+				      char *		dumpbufp,
+				      char *		dumpbufendp,
+				      char *		namesrcp,
+				      uint32_t		valuesz,
+				      int		flag,
+				      char **		valuepp);
 static rv_t
-dump_extattrhdr(drive_t *drivep,
-			     context_t *contextp,
-			     xfs_bstat_t *statp,
-			     size_t recsz,
-			     size_t valoff,
-			     ix_t flags,
-			     uint32_t valsz);
+dump_extattrhdr(drive_t *	drivep,
+		context_t *	contextp,
+		xfs_bstat_t *	statp,
+		size_t		recsz,
+		size_t		valoff,
+		ix_t		flags,
+		uint32_t	valsz);
 
 static bool_t
-save_quotas(char *mntpnt,
-			   quota_info_t *quotainfo);
+save_quotas(char *		mntpnt,
+	    quota_info_t *	quotainfo);
 static int getxfsqstat(char *fsdev);
 
 
@@ -445,137 +445,137 @@ bool_t allowexcludefiles_pr = BOOL_FALSE;
 /* definition of locally defined static variables *****************************/
 
 static bool_t sc_preerasepr = BOOL_FALSE;
-	/*
-	 * pre-erase media
-	 */
+/*
+ * pre-erase media
+ */
 static inv_idbtoken_t sc_inv_idbtoken = INV_TOKEN_NULL;
-	/*
-	 * handle to inventory
-	 */
+/*
+ * handle to inventory
+ */
 static inv_sestoken_t sc_inv_sestoken = INV_TOKEN_NULL;
-	/*
-	 * handle to inventory session
-	 */
+/*
+ * handle to inventory session
+ */
 static inv_stmtoken_t *sc_inv_stmtokenp = 0;
-	/*
-	 * array of inventory session stream handles
-	 */
+/*
+ * array of inventory session stream handles
+ */
 static bool_t sc_inv_updatepr = BOOL_TRUE;
-	/*
-	 * set if ok to update online inventory with stats of this dump
-	 */
+/*
+ * set if ok to update online inventory with stats of this dump
+ */
 static ix_t sc_level = LEVEL_DEFAULT;
-	/*
-	 * dump level requested
-	 */
+/*
+ * dump level requested
+ */
 static bool_t sc_incrpr = BOOL_FALSE;
 static time32_t sc_incrbasetime;
 static ix_t sc_incrbaselevel;
 static uuid_t sc_incrbaseid;
-	/*
-	 * if an incremental dump, the base, level and time of the incremental
-	 * base dump. TRICKY: if resuming an incremental dump, this is the
-	 * base of the original incremental.
-	 */
+/*
+ * if an incremental dump, the base, level and time of the incremental
+ * base dump. TRICKY: if resuming an incremental dump, this is the
+ * base of the original incremental.
+ */
 static bool_t sc_resumepr = BOOL_FALSE;
 static time32_t sc_resumebasetime = 0;
 static uuid_t sc_resumebaseid;
 static size_t sc_resumerangecnt = 0;
 static drange_t *sc_resumerangep = 0;
-	/*
-	 * if a resumed dump, the id, time and undumped ino/offset ranges
-	 * of the interrupted dump being resumed.
-	 */
+/*
+ * if a resumed dump, the id, time and undumped ino/offset ranges
+ * of the interrupted dump being resumed.
+ */
 static jdm_fshandle_t *sc_fshandlep = 0;
-	/*
-	 * dmi file system handle
-	 */
+/*
+ * dmi file system handle
+ */
 static int sc_fsfd = -1;
-	/*
-	 * open file descriptor for root directory
-	 */
+/*
+ * open file descriptor for root directory
+ */
 static xfs_bstat_t *sc_rootxfsstatp = 0;
-	/*
-	 * pointer to loaded bulkstat for root directory
-	 */
+/*
+ * pointer to loaded bulkstat for root directory
+ */
 static startpt_t *sc_startptp = 0;
-	/*
-	 * an array of stream ino/offset start points
-	 */
+/*
+ * an array of stream ino/offset start points
+ */
 static time32_t sc_stat_starttime = 0;
-	/*
-	 * for cacluating elapsed time
-	 */
+/*
+ * for cacluating elapsed time
+ */
 static ix_t sc_stat_inomapphase = 0;
 static ix_t sc_stat_inomappass = 0;
 static size64_t sc_stat_inomapcnt;
 static size64_t sc_stat_inomapdone;
 static size64_t sc_stat_dircnt = 0;
-	/*
-	 * total number of directory inodes to be dumped (strm 0)
-	 */
+/*
+ * total number of directory inodes to be dumped (strm 0)
+ */
 static pds_t sc_stat_pds[STREAM_SIMMAX];
-	/*
-	 * per-drive stream status
-	 */
+/*
+ * per-drive stream status
+ */
 static size64_t sc_stat_nondircnt = 0;
-	/*
-	 * total number of non-directory inodes to be dumped (all strms)
-	 */
+/*
+ * total number of non-directory inodes to be dumped (all strms)
+ */
 static size64_t sc_stat_nondirdone = 0;
-	/*
-	 * total number of non-directory inodes dumped (all strms)
-	 */
+/*
+ * total number of non-directory inodes dumped (all strms)
+ */
 static size64_t sc_stat_datasz = 0;
-	/*
-	 * total size in bytes of non-dirs to be dumped (all strms)
-	 */
+/*
+ * total size in bytes of non-dirs to be dumped (all strms)
+ */
 static size64_t sc_stat_datadone = 0;
-	/*
-	 * total size in bytes of non-dirs dumped (all strms)
-	 */
+/*
+ * total size in bytes of non-dirs dumped (all strms)
+ */
 static size_t sc_thrdsarrivedcnt = 0;
-	/*
-	 * each thread checks in by bumping this count under lock.
-	 * used to decide when its ok to begin waiting for all threads
-	 * to arrive at sync pt for session inventory dump.
-	 */
+/*
+ * each thread checks in by bumping this count under lock.
+ * used to decide when its ok to begin waiting for all threads
+ * to arrive at sync pt for session inventory dump.
+ */
 static size_t sc_thrdsdonecnt = 0;
-	/*
-	 * number of threads which are ready to dump the session inventory.
-	 * when equal to the number of streams remaining (stream_cnt()),
-	 * can proceed with inventory dumps
-	 */
+/*
+ * number of threads which are ready to dump the session inventory.
+ * when equal to the number of streams remaining (stream_cnt()),
+ * can proceed with inventory dumps
+ */
 static context_t *sc_contextp;
-	/*
-	 * an array of per-stream context descriptors
-	 */
+/*
+ * an array of per-stream context descriptors
+ */
 static bool_t sc_mcflag[STREAM_SIMMAX];
-	/*
-	 * media change flag
-	 */
+/*
+ * media change flag
+ */
 static bool_t sc_dumpextattrpr = BOOL_TRUE;
-	/*
-	 * dump extended attributes
-	 */
+/*
+ * dump extended attributes
+ */
 static bool_t sc_dumpasoffline = BOOL_FALSE;
-	/*
-	 * dump dual-residency HSM files as offline
-	 */
+/*
+ * dump dual-residency HSM files as offline
+ */
 static bool_t sc_use_old_direntpr = BOOL_FALSE;
-	/*
-	 * dump dirents as dirent_v1_t instead of dirent_t
-	 * (for compat with dump format 2)
-	 */
+/*
+ * dump dirents as dirent_v1_t instead of dirent_t
+ * (for compat with dump format 2)
+ */
 
 static bool_t sc_savequotas = BOOL_TRUE;
 /*
  * save quota information in dump
  */
 static quota_info_t quotas[] = {
-	{ "user quota",		BOOL_TRUE,	CONTENT_QUOTAFILE,	"", "-uf", XFS_QUOTA_UDQ_ACCT, 0 },
-	{ "project quota",	BOOL_TRUE,	CONTENT_PQUOTAFILE,	"", "-pf", XFS_QUOTA_PDQ_ACCT, 0 },
-	{ "group quota",	BOOL_TRUE,	CONTENT_GQUOTAFILE,	"", "-gf", XFS_QUOTA_GDQ_ACCT, 0 }
+	{ "user quota",	   BOOL_TRUE, CONTENT_QUOTAFILE,  "", "-uf", XFS_QUOTA_UDQ_ACCT, 0 },
+	{ "project quota", BOOL_TRUE, CONTENT_PQUOTAFILE, "", "-pf", XFS_QUOTA_PDQ_ACCT, 0 },
+	{ "group quota",   BOOL_TRUE, CONTENT_GQUOTAFILE, "", "-gf", XFS_QUOTA_GDQ_ACCT, 0 }
 };
 
 /* definition of locally defined global functions ****************************/
@@ -583,17 +583,17 @@ static quota_info_t quotas[] = {
 
 /* definition of locally defined static functions ****************************/
 static bool_t create_inv_session(
-		global_hdr_t *gwhdrtemplatep,
-		uuid_t *fsidp,
-		const char *mntpnt,
-		const char *fsdevice,
-		ix_t subtreecnt,
-		size_t strmix);
+	global_hdr_t *	gwhdrtemplatep,
+	uuid_t *	fsidp,
+	const char *	mntpnt,
+	const char *	fsdevice,
+	ix_t		subtreecnt,
+	size_t		strmix);
 
 bool_t
-content_init(int argc,
-	      char *argv[],
-	      global_hdr_t *gwhdrtemplatep)
+content_init(int		argc,
+	     char *		argv[],
+	     global_hdr_t *	gwhdrtemplatep)
 {
 
 	inv_idbtoken_t inv_idbt;
@@ -655,8 +655,8 @@ content_init(int argc,
 	assert(sizeof(direnthdr_v1_t) == DIRENTHDR_SZ);
 	assert(DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0);
 	assert(sizeofmember(content_hdr_t, ch_specific)
-		>=
-		sizeof(content_inode_hdr_t));
+	       >=
+	       sizeof(content_inode_hdr_t));
 	assert(sizeof(extattrhdr_t) == EXTATTRHDR_SZ);
 
 	/*
@@ -683,18 +683,18 @@ content_init(int argc,
 		case GETOPT_LEVEL:
 			if (! optarg || optarg[0] == '-') {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument missing\n"),
-				      c);
+					     "-%c argument missing\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
 			sc_level = (ix_t)atoi(optarg);
 			if (sc_level > LEVEL_MAX) {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument must be "
-				      "between 0 and %d\n"),
-				      c,
-				      LEVEL_MAX);
+					     "-%c argument must be "
+					     "between 0 and %d\n"),
+				     c,
+				     LEVEL_MAX);
 				usage();
 				return BOOL_FALSE;
 			}
@@ -702,16 +702,16 @@ content_init(int argc,
 		case GETOPT_SUBTREE:
 			if (! optarg || optarg[0] == '-') {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument missing\n"),
-				      c);
+					     "-%c argument missing\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
 			if (optarg[0] == '/') {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument (subtree) "
-				      "must be a relative pathname\n"),
-				      c);
+					     "-%c argument (subtree) "
+					     "must be a relative pathname\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
@@ -720,18 +720,18 @@ content_init(int argc,
 		case GETOPT_MAXDUMPFILESIZE:
 			if (! optarg || optarg [0] == '-') {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument missing\n"),
-				      c);
+					     "-%c argument missing\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
 			maxdumpfilesize = strtoull(optarg, NULL, 0);
 			if (maxdumpfilesize == 0 ||
-			     maxdumpfilesize > ULONGLONG_MAX / 1024 ||
-			     (maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE) ) {
+			    maxdumpfilesize > ULONGLONG_MAX / 1024 ||
+			    (maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE) ) {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument is not a valid file size\n"),
-				      c);
+					     "-%c argument is not a valid file size\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
@@ -755,8 +755,8 @@ content_init(int argc,
 		case GETOPT_ALERTPROG:
 			if (! optarg || optarg[0] == '-') {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-					"-%c argument missing\n"),
-				    c);
+					     "-%c argument missing\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
@@ -771,8 +771,8 @@ content_init(int argc,
 		case GETOPT_BASED:
 			if (! optarg || optarg[0] == '-') {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument missing\n"),
-				      c);
+					     "-%c argument missing\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
@@ -780,9 +780,9 @@ content_init(int argc,
 
 			if (uuid_parse(baseuuidstr, baseuuid) < 0) {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "-%c argument not a valid "
-				      "dump session id\n"),
-				      c);
+					     "-%c argument not a valid "
+					     "dump session id\n"),
+				     c);
 				usage();
 				return BOOL_FALSE;
 			}
@@ -792,9 +792,9 @@ content_init(int argc,
 
 	if (resumereqpr && baseuuidvalpr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
-		      "may not specify both -%c and -%c\n"),
-		      GETOPT_BASED,
-		      GETOPT_RESUME);
+			     "may not specify both -%c and -%c\n"),
+		     GETOPT_BASED,
+		     GETOPT_RESUME);
 		return BOOL_FALSE;
 	}
 
@@ -813,8 +813,8 @@ content_init(int argc,
 	 */
 	if (optind >= argc) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
-		      "source file system "
-		      "not specified\n"));
+			     "source file system "
+			     "not specified\n"));
 		usage();
 		return BOOL_FALSE;
 	}
@@ -856,18 +856,18 @@ content_init(int argc,
 	 * argument doesn't look like a file system.
 	 */
 	if (! fs_info(fstype,
-			sizeof(fstype),
-			FS_DEFAULT,
-			fsdevice,
-			sizeof(fsdevice),
-			mntpnt,
-			sizeof(mntpnt),
-			&fsid,
-			srcname)) {
+		     sizeof(fstype),
+		     FS_DEFAULT,
+		     fsdevice,
+		     sizeof(fsdevice),
+		     mntpnt,
+		     sizeof(mntpnt),
+		     &fsid,
+		     srcname)) {
 
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
-		      "%s does not identify a file system\n"),
-		      srcname);
+			     "%s does not identify a file system\n"),
+		     srcname);
 		usage();
 		return BOOL_FALSE;
 	}
@@ -879,8 +879,8 @@ content_init(int argc,
 	 */
 	if (! fs_mounted(fstype, fsdevice, mntpnt, &fsid)) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
-		      "%s must be mounted to be dumped\n"),
-		      srcname);
+			     "%s must be mounted to be dumped\n"),
+		     srcname);
 		return BOOL_FALSE;
 	}
 
@@ -888,14 +888,14 @@ content_init(int argc,
 	 * place the fs info in the write hdr template
 	 */
 	(void)strncpyterm(cwhdrtemplatep->ch_mntpnt,
-			     mntpnt,
-			     sizeof(cwhdrtemplatep->ch_mntpnt));
+			  mntpnt,
+			  sizeof(cwhdrtemplatep->ch_mntpnt));
 	(void)strncpyterm(cwhdrtemplatep->ch_fsdevice,
-			     fsdevice,
-			     sizeof(cwhdrtemplatep->ch_fsdevice));
+			  fsdevice,
+			  sizeof(cwhdrtemplatep->ch_fsdevice));
 	(void)strncpyterm(cwhdrtemplatep->ch_fstype,
-			     fstype,
-			     sizeof(cwhdrtemplatep->ch_fstype));
+			  fstype,
+			  sizeof(cwhdrtemplatep->ch_fstype));
 	uuid_copy(cwhdrtemplatep->ch_fsid, fsid);
 
 	/* write quota information */
@@ -911,7 +911,7 @@ content_init(int argc,
 					if (subtreecnt) {
 						subtreecnt++;
 						subtreep = (char **) realloc(subtreep,
-								subtreecnt * sizeof(char *));
+									     subtreecnt * sizeof(char *));
 						assert(subtreep);
 						subtreep[subtreecnt - 1] = quotas[i].quotafile;
 					}
@@ -919,8 +919,8 @@ content_init(int argc,
 					quotas[i].savequotas = BOOL_TRUE;
 				} else {
 					mlog(MLOG_NORMAL | MLOG_ERROR, _(
-					      "failed to save %s information, continuing\n"),
-					      quotas[i].desc);
+						     "failed to save %s information, continuing\n"),
+					     quotas[i].desc);
 				}
 			}
 		}
@@ -950,8 +950,8 @@ content_init(int argc,
 	 * to calculate incremental and resumed dumps.
 	 */
 	inv_idbt = inv_open((inv_predicate_t)INV_BY_UUID,
-			     INV_SEARCH_ONLY,
-			     (void *)&fsid);
+			    INV_SEARCH_ONLY,
+			    (void *)&fsid);
 
 	/*
 	 * if a based request, look for the indicated session.
@@ -974,9 +974,9 @@ content_init(int argc,
 		ok = inv_get_session_byuuid(&fsid, &baseuuid, &sessp);
 		if (! ok) {
 			mlog(MLOG_NORMAL | MLOG_ERROR, _(
-			      "could not find specified base dump (%s) "
-			      "in inventory\n"),
-			      baseuuidstr);
+				     "could not find specified base dump (%s) "
+				     "in inventory\n"),
+			     baseuuidstr);
 			return BOOL_FALSE;
 		}
 		strcnt =  (ix_t)sessp->s_nstreams;
@@ -998,7 +998,7 @@ content_init(int argc,
 			sameinterruptedpr = BOOL_TRUE;
 			sc_resumerangecnt =  (size_t)sessp->s_nstreams;
 			sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
-								sizeof(drange_t));
+							     sizeof(drange_t));
 			assert(sc_resumerangep);
 			for (strmix = 0; strmix < sc_resumerangecnt; strmix++) {
 				inv_stream_t *bsp;
@@ -1017,25 +1017,25 @@ content_init(int argc,
 					if (esp) {
 						p->dr_end.sp_ino = esp->st_startino;
 						p->dr_end.sp_offset =
-								esp->st_startino_off;
+							esp->st_startino_off;
 						mlog(MLOG_DEBUG,
-						      "resume range stream %u "
-						      "ino %llu:%lld to "
-						      "%llu:%lld\n",
-						      strmix,
-						      p->dr_begin.sp_ino,
-						      p->dr_begin.sp_offset,
-						      p->dr_end.sp_ino,
-						      p->dr_end.sp_offset);
+						     "resume range stream %u "
+						     "ino %llu:%lld to "
+						     "%llu:%lld\n",
+						     strmix,
+						     p->dr_begin.sp_ino,
+						     p->dr_begin.sp_offset,
+						     p->dr_end.sp_ino,
+						     p->dr_end.sp_offset);
 					} else {
 						p->dr_end.sp_flags = STARTPT_FLAGS_END;
 						mlog(MLOG_DEBUG,
-						      "resume range stream %u "
-						      "ino %llu:%lld to "
-						      "end\n",
-						      strmix,
-						      p->dr_begin.sp_ino,
-						      p->dr_begin.sp_offset);
+						     "resume range stream %u "
+						     "ino %llu:%lld to "
+						     "end\n",
+						     strmix,
+						     p->dr_begin.sp_ino,
+						     p->dr_begin.sp_offset);
 					}
 				} else {
 					/*
@@ -1048,11 +1048,11 @@ content_init(int argc,
 		} else {
 			if (sessp->s_level >= LEVEL_MAX) {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "cannot select dump session %d as base "
-				      "for incremental dump: "
-				      "level must be less than %d\n"),
-				      sessp->s_level,
-				      LEVEL_MAX);
+					     "cannot select dump session %d as base "
+					     "for incremental dump: "
+					     "level must be less than %d\n"),
+				     sessp->s_level,
+				     LEVEL_MAX);
 				return BOOL_FALSE;
 			}
 			sc_level = (ix_t)sessp->s_level + 1;
@@ -1080,8 +1080,8 @@ content_init(int argc,
 	if (sc_level > 0) {
 		if (inv_idbt == INV_TOKEN_NULL) {
 			mlog(MLOG_NORMAL | MLOG_ERROR, _(
-			      "cannot calculate incremental dump: "
-			      "online inventory not available\n"));
+				     "cannot calculate incremental dump: "
+				     "online inventory not available\n"));
 			return BOOL_FALSE;
 		}
 		ok = inv_lastsession_level_lessthan(&fsid,
@@ -1111,7 +1111,7 @@ content_init(int argc,
 				}
 			}
 			underfoundpr = BOOL_TRUE;
-			inv_free_session(& sessp);
+			inv_free_session(&sessp);
 			sessp = 0;
 		}
 	}
@@ -1147,7 +1147,7 @@ content_init(int argc,
 		sameinterruptedpr = BOOL_FALSE;
 		sc_resumerangecnt =  (size_t)sessp->s_nstreams;
 		sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
-						        sizeof(drange_t));
+						     sizeof(drange_t));
 		assert(sc_resumerangep);
 		for (strmix = 0; strmix < sc_resumerangecnt; strmix++) {
 			inv_stream_t *bsp;
@@ -1166,25 +1166,25 @@ content_init(int argc,
 				if (esp) {
 					p->dr_end.sp_ino = esp->st_startino;
 					p->dr_end.sp_offset =
-							esp->st_startino_off;
+						esp->st_startino_off;
 					mlog(MLOG_DEBUG,
-					      "resume range stream %u "
-					      "ino %llu:%lld to "
-					      "%llu:%lld\n",
-					      strmix,
-					      p->dr_begin.sp_ino,
-					      p->dr_begin.sp_offset,
-					      p->dr_end.sp_ino,
-					      p->dr_end.sp_offset);
+					     "resume range stream %u "
+					     "ino %llu:%lld to "
+					     "%llu:%lld\n",
+					     strmix,
+					     p->dr_begin.sp_ino,
+					     p->dr_begin.sp_offset,
+					     p->dr_end.sp_ino,
+					     p->dr_end.sp_offset);
 				} else {
 					p->dr_end.sp_flags = STARTPT_FLAGS_END;
 					mlog(MLOG_DEBUG,
-					      "resume range stream %u "
-					      "ino %llu:%lld to "
-					      "end\n",
-					      strmix,
-					      p->dr_begin.sp_ino,
-					      p->dr_begin.sp_offset);
+					     "resume range stream %u "
+					     "ino %llu:%lld to "
+					     "end\n",
+					     strmix,
+					     p->dr_begin.sp_ino,
+					     p->dr_begin.sp_offset);
 				}
 			} else {
 				/*
@@ -1194,7 +1194,7 @@ content_init(int argc,
 				p->dr_begin.sp_flags = STARTPT_FLAGS_END;
 			}
 		}
-		inv_free_session(& sessp);
+		inv_free_session(&sessp);
 		sessp = 0;
 		samefoundpr = BOOL_TRUE;
 	}
@@ -1212,11 +1212,11 @@ baseuuidbypass:
 	if (samefoundpr && ! resumereqpr) {
 		if (! underfoundpr || undertime <= sametime) {
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "most recent level %d dump "
-			      "was interrupted, "
-			      "but not resuming that dump since "
-			      "resume (-R) option not specified\n"),
-			      sc_level);
+				     "most recent level %d dump "
+				     "was interrupted, "
+				     "but not resuming that dump since "
+				     "resume (-R) option not specified\n"),
+			     sc_level);
 		}
 		free((void *)sc_resumerangep);
 		sc_resumerangep = 0;
@@ -1229,32 +1229,32 @@ baseuuidbypass:
 			if (undertime >= sametime) {
 				if (underinterruptedpr) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					      "most recent base for "
-					      "incremental dump was "
-					      "interrupted (level %u): "
-					      "must resume or redump "
-					      "at or below level %d\n"),
-					      underlevel,
-					      sc_level);
+						     "most recent base for "
+						     "incremental dump was "
+						     "interrupted (level %u): "
+						     "must resume or redump "
+						     "at or below level %d\n"),
+					     underlevel,
+					     sc_level);
 					return BOOL_FALSE;
 				}
 				if (subtreecnt && ! underpartialpr) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					      "level %u incremental "
-					      "subtree dump "
-					      "will be based on non-subtree "
-					      "level %u dump\n"),
-					      sc_level,
-					      underlevel);
+						     "level %u incremental "
+						     "subtree dump "
+						     "will be based on non-subtree "
+						     "level %u dump\n"),
+					     sc_level,
+					     underlevel);
 				}
 				if (! subtreecnt && underpartialpr) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					      "level %u incremental "
-					      "non-subtree dump "
-					      "will be based on subtree "
-					      "level %u dump\n"),
-					      sc_level,
-					      underlevel);
+						     "level %u incremental "
+						     "non-subtree dump "
+						     "will be based on subtree "
+						     "level %u dump\n"),
+					     sc_level,
+					     underlevel);
 				}
 				sc_incrpr = BOOL_TRUE;
 				sc_incrbasetime = undertime;
@@ -1267,21 +1267,21 @@ baseuuidbypass:
 			} else {
 				if (subtreecnt && ! samepartialpr) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					      "level %u incremental "
-					      "subtree dump "
-					      "will be based on non-subtree "
-					      "level %u resumed dump\n"),
-					      sc_level,
-					      sc_level);
+						     "level %u incremental "
+						     "subtree dump "
+						     "will be based on non-subtree "
+						     "level %u resumed dump\n"),
+					     sc_level,
+					     sc_level);
 				}
 				if (! subtreecnt && samepartialpr) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					      "level %u incremental "
-					      "non-subtree dump "
-					      "will be based on subtree "
-					      "level %u resumed dump\n"),
-					      sc_level,
-					      sc_level);
+						     "level %u incremental "
+						     "non-subtree dump "
+						     "will be based on subtree "
+						     "level %u resumed dump\n"),
+					     sc_level,
+					     sc_level);
 				}
 				assert(sametime);
 				sc_incrpr = BOOL_TRUE;
@@ -1295,32 +1295,32 @@ baseuuidbypass:
 		} else {
 			if (underinterruptedpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "most recent base for "
-				      "incremental dump was "
-				      "interrupted (level %u): "
-				      "must resume or redump "
-				      "at or below level %d\n"),
-				      underlevel,
-				      sc_level);
+					     "most recent base for "
+					     "incremental dump was "
+					     "interrupted (level %u): "
+					     "must resume or redump "
+					     "at or below level %d\n"),
+				     underlevel,
+				     sc_level);
 				return BOOL_FALSE;
 			}
 			if (subtreecnt && ! underpartialpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "level %u incremental "
-				      "subtree dump "
-				      "will be based on non-subtree "
-				      "level %u dump\n"),
-				      sc_level,
-				      underlevel);
+					     "level %u incremental "
+					     "subtree dump "
+					     "will be based on non-subtree "
+					     "level %u dump\n"),
+				     sc_level,
+				     underlevel);
 			}
 			if (! subtreecnt && underpartialpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "level %u incremental "
-				      "non-subtree dump "
-				      "will be based on subtree "
-				      "level %u dump\n"),
-				      sc_level,
-				      underlevel);
+					     "level %u incremental "
+					     "non-subtree dump "
+					     "will be based on subtree "
+					     "level %u dump\n"),
+				     sc_level,
+				     underlevel);
 			}
 			sc_incrpr = BOOL_TRUE;
 			sc_incrbasetime = undertime;
@@ -1334,21 +1334,21 @@ baseuuidbypass:
 			assert(sametime);
 			if (subtreecnt && ! samepartialpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "level %u "
-				      "subtree dump "
-				      "will be based on non-subtree "
-				      "level %u resumed dump\n"),
-				      sc_level,
-				      sc_level);
+					     "level %u "
+					     "subtree dump "
+					     "will be based on non-subtree "
+					     "level %u resumed dump\n"),
+				     sc_level,
+				     sc_level);
 			}
 			if (! subtreecnt && samepartialpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "level %u "
-				      "non-subtree dump "
-				      "will be based on subtree "
-				      "level %u resumed dump\n"),
-				      sc_level,
-				      sc_level);
+					     "level %u "
+					     "non-subtree dump "
+					     "will be based on subtree "
+					     "level %u resumed dump\n"),
+				     sc_level,
+				     sc_level);
 			}
 			sc_incrpr = BOOL_FALSE;
 			sc_resumepr = BOOL_TRUE;
@@ -1361,9 +1361,9 @@ baseuuidbypass:
 			assert(! sc_resumerangep);
 			if (sc_level > 0) {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
-				      "cannot find earlier dump "
-				      "to base level %d increment upon\n"),
-				      sc_level);
+					     "cannot find earlier dump "
+					     "to base level %d increment upon\n"),
+				     sc_level);
 				return BOOL_FALSE;
 			}
 		}
@@ -1374,10 +1374,10 @@ baseuuidbypass:
 	 */
 	if (sc_incrpr && underinterruptedpr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
-		      "most recent base dump (level %d begun %s) "
-		      "was interrupted: aborting\n"),
-		      sc_incrbaselevel,
-		      ctimennl(&sc_incrbasetime));
+			     "most recent base dump (level %d begun %s) "
+			     "was interrupted: aborting\n"),
+		     sc_incrbaselevel,
+		     ctimennl(&sc_incrbasetime));
 		return BOOL_FALSE;
 	}
 
@@ -1386,9 +1386,9 @@ baseuuidbypass:
 	 */
 	if (! sc_resumepr && resumereqpr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
-		      "resume (-R) option inappropriate: "
-		      "no interrupted level %d dump to resume\n"),
-		      sc_level);
+			     "resume (-R) option inappropriate: "
+			     "no interrupted level %d dump to resume\n"),
+		     sc_level);
 		return BOOL_FALSE;
 	}
 
@@ -1406,39 +1406,39 @@ baseuuidbypass:
 			assert(strlen(incrtimestr) < sizeof(incrtimestr));
 
 			mlog(MLOG_VERBOSE, _(
-			      "resuming level %d incremental dump of %s:%s "
-			      "begun %s "
-			      "(incremental base level %d begun %s)\n"),
-			      sc_level,
-			      gwhdrtemplatep->gh_hostname,
-			      mntpnt,
-			      restimestr,
-			      sc_incrbaselevel,
-			      incrtimestr);
+				     "resuming level %d incremental dump of %s:%s "
+				     "begun %s "
+				     "(incremental base level %d begun %s)\n"),
+			     sc_level,
+			     gwhdrtemplatep->gh_hostname,
+			     mntpnt,
+			     restimestr,
+			     sc_incrbaselevel,
+			     incrtimestr);
 		} else {
 			mlog(MLOG_VERBOSE, _(
-			      "level %d incremental dump of %s:%s "
-			      "based on level %d dump begun %s\n"),
-			      sc_level,
-			      gwhdrtemplatep->gh_hostname,
-			      mntpnt,
-			      sc_incrbaselevel,
-			      ctimennl(&sc_incrbasetime));
+				     "level %d incremental dump of %s:%s "
+				     "based on level %d dump begun %s\n"),
+			     sc_level,
+			     gwhdrtemplatep->gh_hostname,
+			     mntpnt,
+			     sc_incrbaselevel,
+			     ctimennl(&sc_incrbasetime));
 		}
 	} else {
 		if (sc_resumepr) {
 			mlog(MLOG_VERBOSE, _(
-			      "resuming level %d dump of %s:%s begun %s\n"),
-			      sc_level,
-			      gwhdrtemplatep->gh_hostname,
-			      mntpnt,
-			      ctimennl(&sc_resumebasetime));
+				     "resuming level %d dump of %s:%s begun %s\n"),
+			     sc_level,
+			     gwhdrtemplatep->gh_hostname,
+			     mntpnt,
+			     ctimennl(&sc_resumebasetime));
 		} else {
 			mlog(MLOG_VERBOSE, _(
-			      "level %d dump of %s:%s\n"),
-			      sc_level,
-			      gwhdrtemplatep->gh_hostname,
-			      mntpnt);
+				     "level %d dump of %s:%s\n"),
+			     sc_level,
+			     gwhdrtemplatep->gh_hostname,
+			     mntpnt);
 		}
 	}
 
@@ -1450,8 +1450,8 @@ baseuuidbypass:
 	 * announce the dump time
 	 */
 	mlog(MLOG_VERBOSE, _(
-	      "dump date: %s\n"),
-	      ctimennl(&gwhdrtemplatep->gh_timestamp));
+		     "dump date: %s\n"),
+	     ctimennl(&gwhdrtemplatep->gh_timestamp));
 
 	/*
 	 * display the session UUID
@@ -1460,16 +1460,16 @@ baseuuidbypass:
 		char string_uuid[UUID_STR_LEN + 1];
 		uuid_unparse(gwhdrtemplatep->gh_dumpid, string_uuid);
 		mlog(MLOG_VERBOSE, _(
-		      "session id: %s\n"),
-		      string_uuid);
+			     "session id: %s\n"),
+		     string_uuid);
 	}
 
 	/*
 	 * display the session label
 	 */
 	mlog(MLOG_VERBOSE, _(
-	      "session label: \"%s\"\n"),
-	      gwhdrtemplatep->gh_dumplabel);
+		     "session label: \"%s\"\n"),
+	     gwhdrtemplatep->gh_dumplabel);
 
 	/*
 	 * get a file descriptor for the file system. any file
@@ -1479,9 +1479,9 @@ baseuuidbypass:
 	sc_fsfd = open(mntpnt, O_RDONLY);
 	if (sc_fsfd < 0) {
 		mlog(MLOG_NORMAL, _(
-		      "unable to open %s: %s\n"),
-		      mntpnt,
-		      strerror(errno));
+			     "unable to open %s: %s\n"),
+		     mntpnt,
+		     strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -1501,8 +1501,8 @@ baseuuidbypass:
 		rval = fstat64(sc_fsfd, &rootstat);
 		if (rval) {
 			mlog(MLOG_NORMAL, _(
-			      "could not stat %s\n"),
-			      mntpnt);
+				     "could not stat %s\n"),
+			     mntpnt);
 			return BOOL_FALSE;
 		}
 		sc_rootxfsstatp =
@@ -1516,14 +1516,14 @@ baseuuidbypass:
 		bulkreq.ocount = &ocount;
 		if (ioctl(sc_fsfd, XFS_IOC_FSBULKSTAT, &bulkreq) < 0) {
 			mlog(MLOG_ERROR,
-			      _("failed to get bulkstat information for root inode\n"));
+			     _("failed to get bulkstat information for root inode\n"));
 			return BOOL_FALSE;
 		}
 
 		if (sc_rootxfsstatp->bs_ino != rootstat.st_ino)
 			mlog (MLOG_NORMAL | MLOG_NOTE,
-			       _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
-			         sc_rootxfsstatp->bs_ino, rootstat.st_ino);
+			      _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
+			      sc_rootxfsstatp->bs_ino, rootstat.st_ino);
 	}
 
 	/*
@@ -1533,9 +1533,9 @@ baseuuidbypass:
 	sc_fshandlep = jdm_getfshandle(mntpnt);
 	if (! sc_fshandlep) {
 		mlog(MLOG_NORMAL, _(
-		      "unable to construct a file system handle for %s: %s\n"),
-		      mntpnt,
-		      strerror(errno));
+			     "unable to construct a file system handle for %s: %s\n"),
+		     mntpnt,
+		     strerror(errno));
 		return BOOL_FALSE;
 	}
 
@@ -1568,23 +1568,23 @@ baseuuidbypass:
 	sc_startptp = (startpt_t *)calloc(drivecnt, sizeof(startpt_t));
 	assert(sc_startptp);
 	ok = inomap_build(sc_fshandlep,
-			   sc_fsfd,
-			   sc_rootxfsstatp,
-			   sc_incrpr,
-			   sc_incrbasetime,
-			   sc_resumepr,
-			   sc_resumebasetime,
-			   sc_resumerangecnt,
-			   sc_resumerangep,
-			   subtreep,
-			   subtreecnt,
-			   skip_unchanged_dirs,
-			   sc_startptp,
-			   drivecnt,
-			   &sc_stat_inomapphase,
-			   &sc_stat_inomappass,
-			   sc_stat_inomapcnt,
-			   &sc_stat_inomapdone);
+			  sc_fsfd,
+			  sc_rootxfsstatp,
+			  sc_incrpr,
+			  sc_incrbasetime,
+			  sc_resumepr,
+			  sc_resumebasetime,
+			  sc_resumerangecnt,
+			  sc_resumerangep,
+			  subtreep,
+			  subtreecnt,
+			  skip_unchanged_dirs,
+			  sc_startptp,
+			  drivecnt,
+			  &sc_stat_inomapphase,
+			  &sc_stat_inomappass,
+			  sc_stat_inomapcnt,
+			  &sc_stat_inomapdone);
 	free((void *)subtreep);
 	subtreep = 0;
 	if (! ok) {
@@ -1633,7 +1633,7 @@ baseuuidbypass:
 	if (sc_dumpextattrpr) {
 		scwhdrtemplatep->cih_dumpattr |= CIH_DUMPATTR_EXTATTR;
 		scwhdrtemplatep->cih_dumpattr |=
-					CIH_DUMPATTR_EXTATTRHDR_CHECKSUM;
+			CIH_DUMPATTR_EXTATTRHDR_CHECKSUM;
 	}
 
 	scwhdrtemplatep->cih_rootino = sc_rootxfsstatp->bs_ino;
@@ -1650,34 +1650,34 @@ baseuuidbypass:
 	direntsz = inocnt * (uint64_t)(DIRENTHDR_SZ + 8);
 	filesz = inocnt * (uint64_t)(FILEHDR_SZ + EXTENTHDR_SZ);
 
-	hdr_mfilesz =	GLOBAL_HDR_SZ
-			+
-			inomapsz
-			+
-			direntsz;
+	hdr_mfilesz =   GLOBAL_HDR_SZ
+		      +
+		      inomapsz
+		      +
+		      direntsz;
 	size_estimate = hdr_mfilesz
 			+
 			filesz
 			+
 			datasz;
 	mlog(MLOG_VERBOSE, _(
-	      "estimated dump size: %llu bytes\n"),
-	      size_estimate);
+		     "estimated dump size: %llu bytes\n"),
+	     size_estimate);
 
 	if (drivecnt > 1) {
-	    mlog(MLOG_VERBOSE, _(
-		  "estimated dump size per stream: %llu bytes\n"),
-		    hdr_mfilesz + (filesz + datasz) / drivecnt);
+		mlog(MLOG_VERBOSE, _(
+			     "estimated dump size per stream: %llu bytes\n"),
+		     hdr_mfilesz + (filesz + datasz) / drivecnt);
 	}
 	mlog(MLOG_DEBUG,
-	      "estimated dump header size: %llu bytes\n",
-	      hdr_mfilesz);
+	     "estimated dump header size: %llu bytes\n",
+	     hdr_mfilesz);
 	mlog(MLOG_DEBUG,
-	      "estimated component sizes: global hdr: %llu bytes, "
-	      "inomap: %llu bytes,  dir entries: %llu bytes, "
-	      "file hdrs: %llu bytes, datasz: %llu bytes\n",
-	      GLOBAL_HDR_SZ, inomapsz, direntsz,
-	      filesz, datasz);
+	     "estimated component sizes: global hdr: %llu bytes, "
+	     "inomap: %llu bytes,  dir entries: %llu bytes, "
+	     "file hdrs: %llu bytes, datasz: %llu bytes\n",
+	     GLOBAL_HDR_SZ, inomapsz, direntsz,
+	     filesz, datasz);
 
 	/*
 	 * extract the progress stat denominators from the write hdr
@@ -1696,21 +1696,21 @@ baseuuidbypass:
 		context_t *contextp = &sc_contextp[strmix];
 
 		contextp->cc_filehdrp =
-				(filehdr_t *)calloc(1, sizeof(filehdr_t));
+			(filehdr_t *)calloc(1, sizeof(filehdr_t));
 		assert(contextp->cc_filehdrp);
 
 		contextp->cc_extenthdrp =
-			    (extenthdr_t *)calloc(1, sizeof(extenthdr_t));
+			(extenthdr_t *)calloc(1, sizeof(extenthdr_t));
 		assert(contextp->cc_extenthdrp);
 
 		contextp->cc_getdentsbufsz = sizeof(struct dirent)
-					       +
-					       NAME_MAX + 1;
+					     +
+					     NAME_MAX + 1;
 		if (contextp->cc_getdentsbufsz < GETDENTSBUF_SZ_MIN) {
 			contextp->cc_getdentsbufsz = GETDENTSBUF_SZ_MIN;
 		}
 		contextp->cc_getdentsbufp =
-			   (char *) calloc(1, contextp->cc_getdentsbufsz);
+			(char *) calloc(1, contextp->cc_getdentsbufsz);
 		assert(contextp->cc_getdentsbufp);
 
 		contextp->cc_mdirentbufsz = sizeof(direnthdr_t)
@@ -1719,7 +1719,7 @@ baseuuidbypass:
 					    +
 					    DIRENTHDR_ALIGN;
 		contextp->cc_mdirentbufp =
-			   (char *) calloc(1, contextp->cc_mdirentbufsz);
+			(char *) calloc(1, contextp->cc_mdirentbufsz);
 		assert(contextp->cc_mdirentbufp);
 
 		contextp->cc_extattrlistbufsz = EXTATTR_LISTBUF_SZ;
@@ -1729,15 +1729,15 @@ baseuuidbypass:
 			contextp->cc_extattrdumpbufsz = EXTATTR_DUMPBUF_SZ;
 		}
 		contextp->cc_extattrlistbufp =
-			   (char *)calloc(1, contextp->cc_extattrlistbufsz);
+			(char *)calloc(1, contextp->cc_extattrlistbufsz);
 		assert(contextp->cc_extattrlistbufp);
 		contextp->cc_extattrrtrvarrayp =
-		  (attr_multiop_t *)calloc(contextp->cc_extattrrtrvarraylen,
-				    sizeof(attr_multiop_t));
+			(attr_multiop_t *)calloc(contextp->cc_extattrrtrvarraylen,
+						 sizeof(attr_multiop_t));
 		assert(contextp->cc_extattrrtrvarrayp);
 		contextp->cc_extattrdumpbufp =
-			   (char *)memalign(sizeof(extattrhdr_t),
-					       contextp->cc_extattrdumpbufsz);
+			(char *)memalign(sizeof(extattrhdr_t),
+					 contextp->cc_extattrdumpbufsz);
 		assert(contextp->cc_extattrdumpbufp);
 		if (hsm_fs_ctxtp) {
 			contextp->cc_hsm_f_ctxtp = HsmAllocateFileContext(
@@ -1748,7 +1748,7 @@ baseuuidbypass:
 
 		contextp->cc_readlinkbufsz = MAXPATHLEN + SYMLINK_ALIGN;
 		contextp->cc_readlinkbufp =
-			   (char *) calloc(1, contextp->cc_readlinkbufsz);
+			(char *) calloc(1, contextp->cc_readlinkbufsz);
 		assert(contextp->cc_readlinkbufp);
 
 		contextp->cc_inomap_contextp = inomap_alloc_context();
@@ -1772,16 +1772,16 @@ baseuuidbypass:
 			case GETOPT_MEDIALABEL:
 				if (cp >= ep) {
 					mlog(MLOG_NORMAL, _(
-					      "more -%c arguments "
-					      "than number of drives\n"),
-					      c);
+						     "more -%c arguments "
+						     "than number of drives\n"),
+					     c);
 					usage();
 					return BOOL_FALSE;
 				}
 				if (! optarg || optarg[0] == '-') {
 					mlog(MLOG_NORMAL, _(
-					      "-%c argument missing\n"),
-					      c);
+						     "-%c argument missing\n"),
+					     c);
 					usage();
 					return BOOL_FALSE;
 				}
@@ -1793,10 +1793,10 @@ baseuuidbypass:
 
 		if (cp > sc_contextp && cp < ep) {
 			mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      "media labels given for only %d out of %d "
-			      "drives\n"),
-			      cp - sc_contextp,
-			      drivecnt);
+				     "media labels given for only %d out of %d "
+				     "drives\n"),
+			     cp - sc_contextp,
+			     drivecnt);
 		}
 	}
 
@@ -1820,11 +1820,11 @@ baseuuidbypass:
 		pthread_sigmask(SIG_BLOCK, &tty_set, &orig_set);
 
 		result = create_inv_session(gwhdrtemplatep, &fsid, mntpnt,
-					     fsdevice, subtreecnt, strmix);
+					    fsdevice, subtreecnt, strmix);
 
 		pthread_sigmask(SIG_SETMASK, &orig_set, NULL);
 
-		if (!result) {
+		if (! result) {
 			return BOOL_FALSE;
 		}
 	}
@@ -1856,7 +1856,7 @@ baseuuidbypass:
 	return BOOL_TRUE;
 }
 
-#define STATLINESZ	160
+#define STATLINESZ      160
 
 size_t
 content_statline(char **linespp[])
@@ -1905,32 +1905,32 @@ content_statline(char **linespp[])
 	if (sc_stat_inomapphase && sc_stat_inomapcnt) {
 		if (sc_stat_inomappass) {
 			sprintf(statline[0],
-				 "status at %02d:%02d:%02d: "
-				 "inomap phase %u pass %u "
-				 "%llu/%llu inos scanned, "
-				 "%ld seconds elapsed\n",
-				 tmp->tm_hour,
-				 tmp->tm_min,
-				 tmp->tm_sec,
-				 (unsigned int)sc_stat_inomapphase,
-				 (unsigned int)sc_stat_inomappass,
-				 (unsigned long long)sc_stat_inomapdone,
-				 (unsigned long long)sc_stat_inomapcnt,
-				 elapsed);
+				"status at %02d:%02d:%02d: "
+				"inomap phase %u pass %u "
+				"%llu/%llu inos scanned, "
+				"%ld seconds elapsed\n",
+				tmp->tm_hour,
+				tmp->tm_min,
+				tmp->tm_sec,
+				(unsigned int)sc_stat_inomapphase,
+				(unsigned int)sc_stat_inomappass,
+				(unsigned long long)sc_stat_inomapdone,
+				(unsigned long long)sc_stat_inomapcnt,
+				elapsed);
 			assert(strlen(statline[0]) < STATLINESZ);
 		} else {
 			sprintf(statline[0],
-				 "status at %02d:%02d:%02d: "
-				 "inomap phase %u "
-				 "%llu/%llu inos scanned, "
-				 "%ld seconds elapsed\n",
-				 tmp->tm_hour,
-				 tmp->tm_min,
-				 tmp->tm_sec,
-				 (unsigned int)sc_stat_inomapphase,
-				 (unsigned long long)sc_stat_inomapdone,
-				 (unsigned long long)sc_stat_inomapcnt,
-				 elapsed);
+				"status at %02d:%02d:%02d: "
+				"inomap phase %u "
+				"%llu/%llu inos scanned, "
+				"%ld seconds elapsed\n",
+				tmp->tm_hour,
+				tmp->tm_min,
+				tmp->tm_sec,
+				(unsigned int)sc_stat_inomapphase,
+				(unsigned long long)sc_stat_inomapdone,
+				(unsigned long long)sc_stat_inomapcnt,
+				elapsed);
 			assert(strlen(statline[0]) < STATLINESZ);
 		}
 		return 1;
@@ -1948,11 +1948,11 @@ content_statline(char **linespp[])
 	if (nondirdone || datadone) {
 		/*
 		 * calculate percentage of data dumped
-		*/
+		 */
 		if (sc_stat_datasz) {
 			percent = (double)datadone
-				/
-				(double)sc_stat_datasz;
+				  /
+				  (double)sc_stat_datasz;
 			percent *= 100.0;
 		} else {
 			percent = 100.0;
@@ -1963,26 +1963,26 @@ content_statline(char **linespp[])
 
 		/*
 		 * format the status line in a local static buffer (non-re-entrant!)
-		*/
+		 */
 		sprintf(statline[0],
-				"status at %02d:%02d:%02d: %llu/%llu files dumped, "
-				"%.1lf%%%% data dumped, "
-				"%ld seconds elapsed\n",
-				tmp->tm_hour,
-				tmp->tm_min,
-				tmp->tm_sec,
-				(unsigned long long) nondirdone,
-				(unsigned long long) sc_stat_nondircnt,
-				percent,
-				elapsed);
+			"status at %02d:%02d:%02d: %llu/%llu files dumped, "
+			"%.1lf%%%% data dumped, "
+			"%ld seconds elapsed\n",
+			tmp->tm_hour,
+			tmp->tm_min,
+			tmp->tm_sec,
+			(unsigned long long) nondirdone,
+			(unsigned long long) sc_stat_nondircnt,
+			percent,
+			elapsed);
 	} else {
 		sprintf(statline[0],
-				"status at %02d:%02d:%02d: "
-				"%ld seconds elapsed\n",
-				tmp->tm_hour,
-				tmp->tm_min,
-				tmp->tm_sec,
-				elapsed);
+			"status at %02d:%02d:%02d: "
+			"%ld seconds elapsed\n",
+			tmp->tm_hour,
+			tmp->tm_min,
+			tmp->tm_sec,
+			elapsed);
 	}
 
 	assert(strlen(statline[0]) < STATLINESZ);
@@ -1994,46 +1994,46 @@ content_statline(char **linespp[])
 	for (i = 0; i < drivecnt; i++) {
 		pds_t *pdsp = &sc_stat_pds[i];
 		if (pdsp->pds_phase == PDS_NULL
-		     ||
-		     pdsp->pds_phase == PDS_NONDIR) {
+		    ||
+		    pdsp->pds_phase == PDS_NONDIR) {
 			continue;
 		}
 		statline[statlinecnt][0] = 0;
 		if (drivecnt > 1) {
 			sprintf(statline[statlinecnt],
-				 "drive %u: ",
-				 (unsigned int)i);
+				"drive %u: ",
+				(unsigned int)i);
 		}
 		switch (pdsp->pds_phase) {
 		case PDS_INOMAP:
 			strcat(statline[statlinecnt],
-				"dumping inomap");
+			       "dumping inomap");
 			break;
 		case PDS_DIRDUMP:
 			sprintf(&statline[statlinecnt]
-					  [strlen(statline[statlinecnt])],
-				 "%llu/%llu directories dumped",
-				 (unsigned long long)pdsp->pds_dirdone,
-				 (unsigned long long)sc_stat_dircnt);
+				[strlen(statline[statlinecnt])],
+				"%llu/%llu directories dumped",
+				(unsigned long long)pdsp->pds_dirdone,
+				(unsigned long long)sc_stat_dircnt);
 			break;
 		case PDS_INVSYNC:
 			strcat(statline[statlinecnt],
-				"waiting to dump inventory");
+			       "waiting to dump inventory");
 			break;
 		case PDS_INVDUMP:
 			strcat(statline[statlinecnt],
-				"dumping inventory");
+			       "dumping inventory");
 			break;
 		case PDS_TERMDUMP:
 			strcat(statline[statlinecnt],
-				"dumping stream terminator");
+			       "dumping stream terminator");
 			break;
 		default:
 			break;
 		}
 		sprintf(&statline[statlinecnt]
-				  [strlen(statline[statlinecnt])],
-			 "\n");
+			[strlen(statline[statlinecnt])],
+			"\n");
 		assert(strlen(statline[statlinecnt]) < STATLINESZ);
 		statlinecnt++;
 	}
@@ -2043,12 +2043,12 @@ content_statline(char **linespp[])
 
 static bool_t
 create_inv_session(
-		global_hdr_t *gwhdrtemplatep,
-		uuid_t *fsidp,
-		const char *mntpnt,
-		const char *fsdevice,
-		ix_t subtreecnt,
-		size_t strmix)
+	global_hdr_t *	gwhdrtemplatep,
+	uuid_t *	fsidp,
+	const char *	mntpnt,
+	const char *	fsdevice,
+	ix_t		subtreecnt,
+	size_t		strmix)
 {
 	int rval;
 	char *qmntpnt;
@@ -2059,18 +2059,18 @@ create_inv_session(
 	assert(! rval);
 
 	sc_inv_idbtoken = inv_open((inv_predicate_t)INV_BY_UUID,
-					INV_SEARCH_N_MOD,
-					(void *)fsidp);
+				   INV_SEARCH_N_MOD,
+				   (void *)fsidp);
 	if (sc_inv_idbtoken == INV_TOKEN_NULL) {
 		return BOOL_FALSE;
 	}
 	qmntpnt = (char *)calloc(1, strlen(gwhdrtemplatep->gh_hostname)
-					+ 1 + strlen(mntpnt) + 1);
+				 + 1 + strlen(mntpnt) + 1);
 	assert(qmntpnt);
 	assert(strlen(gwhdrtemplatep->gh_hostname));
 	sprintf(qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt);
 	qfsdevice = (char *)calloc(1, strlen(gwhdrtemplatep->gh_hostname)
-					 + 1 + strlen(fsdevice) + 1);
+				   + 1 + strlen(fsdevice) + 1);
 	assert(qfsdevice);
 	sprintf(qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice);
 
@@ -2079,7 +2079,7 @@ create_inv_session(
 						&gwhdrtemplatep->gh_dumpid,
 						gwhdrtemplatep->gh_dumplabel,
 						subtreecnt ? BOOL_TRUE
-							   : BOOL_FALSE,
+						: BOOL_FALSE,
 						sc_resumepr,
 						(u_char_t)sc_level,
 						drivecnt,
@@ -2092,9 +2092,9 @@ create_inv_session(
 
 	/*
 	 * open an inventory stream for each stream
-	*/
+	 */
 	sc_inv_stmtokenp = (inv_stmtoken_t *)
-				calloc(drivecnt, sizeof(inv_stmtoken_t));
+			   calloc(drivecnt, sizeof(inv_stmtoken_t));
 	assert(sc_inv_stmtokenp);
 	for (strmix = 0; strmix < drivecnt; strmix++) {
 		drive_t *drivep = drivepp[strmix];
@@ -2106,7 +2106,7 @@ create_inv_session(
 			drvpath = drivep->d_pathname;
 		}
 		sc_inv_stmtokenp[strmix] = inv_stream_open(sc_inv_sestoken,
-								drvpath);
+							   drvpath);
 		if (strcmp(drivep->d_pathname, "stdio")) {
 			free((void *)drvpath);
 		}
@@ -2127,25 +2127,25 @@ mark_set(drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags)
 
 	if (flags & STARTPT_FLAGS_NULL) {
 		mlog(MLOG_DEBUG,
-		      "setting media NULL mark\n");
+		     "setting media NULL mark\n");
 	} else if (flags & STARTPT_FLAGS_END) {
 		mlog(MLOG_DEBUG,
-		      "setting media END mark\n");
+		     "setting media END mark\n");
 	} else {
 		mlog(MLOG_DEBUG,
-		      "setting media mark"
-		      " for ino %llu offset %lld\n",
-		      ino,
-		      offset);
+		     "setting media mark"
+		     " for ino %llu offset %lld\n",
+		     ino,
+		     offset);
 	}
 
 	markp->startpt.sp_ino = ino;
 	markp->startpt.sp_offset = offset;
 	markp->startpt.sp_flags = flags;
 	(*dop->do_set_mark)(drivep,
-				mark_callback,
-				(void *)drivep->d_index,
-				(drive_markrec_t *)markp);
+			    mark_callback,
+			    (void *)drivep->d_index,
+			    (drive_markrec_t *)markp);
 }
 
 static void
@@ -2186,15 +2186,15 @@ mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 		 */
 		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
 			mlog(MLOG_DEBUG,
-			      "media NULL mark committed"
-			      " in media file %d\n",
-			      mwhdrp->mh_dumpfileix);
+			     "media NULL mark committed"
+			     " in media file %d\n",
+			     mwhdrp->mh_dumpfileix);
 			scwhdrp->cih_startpt.sp_flags |= STARTPT_FLAGS_NULL;
 		} else if (markp->startpt.sp_flags & STARTPT_FLAGS_END) {
 			mlog(MLOG_DEBUG,
-			      "media END mark committed"
-			      " in media file %d\n",
-			      mwhdrp->mh_dumpfileix);
+			     "media END mark committed"
+			     " in media file %d\n",
+			     mwhdrp->mh_dumpfileix);
 			if (scwhdrp->cih_endpt.sp_flags & STARTPT_FLAGS_END) {
 				scwhdrp->cih_startpt.sp_ino++;
 				scwhdrp->cih_startpt.sp_offset = 0;
@@ -2204,12 +2204,12 @@ mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 			scwhdrp->cih_startpt.sp_flags |= STARTPT_FLAGS_END;
 		} else {
 			mlog(MLOG_DEBUG,
-			      "media mark committed"
-			      " for ino %llu offset %lld"
-			      " in media file %d\n",
-			      markp->startpt.sp_ino,
-			      markp->startpt.sp_offset,
-			      mwhdrp->mh_dumpfileix);
+			     "media mark committed"
+			     " for ino %llu offset %lld"
+			     " in media file %d\n",
+			     markp->startpt.sp_ino,
+			     markp->startpt.sp_offset,
+			     mwhdrp->mh_dumpfileix);
 			scwhdrp->cih_startpt = markp->startpt;
 		}
 	} else {
@@ -2218,16 +2218,16 @@ mark_callback(void *p, drive_markrec_t *dmp, bool_t committed)
 		 */
 		if (markp->startpt.sp_flags & STARTPT_FLAGS_NULL) {
 			mlog(MLOG_DEBUG,
-			      "media NULL mark -NOT- committed\n");
+			     "media NULL mark -NOT- committed\n");
 		} else if (markp->startpt.sp_flags & STARTPT_FLAGS_END) {
 			mlog(MLOG_DEBUG,
-			      "media END mark -NOT- committed\n");
+			     "media END mark -NOT- committed\n");
 		} else {
 			mlog(MLOG_DEBUG,
-			      "media mark -NOT- committed"
-			      " for ino %llu offset %lld\n",
-			      markp->startpt.sp_ino,
-			      markp->startpt.sp_offset);
+			     "media mark -NOT- committed"
+			     " for ino %llu offset %lld\n",
+			     markp->startpt.sp_ino,
+			     markp->startpt.sp_offset);
 		}
 	}
 
@@ -2269,7 +2269,7 @@ content_stream_dump(ix_t strmix)
 	 * allocate a buffer for use by bstat_iter
 	 */
 	bstatbufp = (xfs_bstat_t *)calloc(bstatbuflen,
-					     sizeof(xfs_bstat_t));
+					  sizeof(xfs_bstat_t));
 	assert(bstatbufp);
 
 	/* allocate an inomap context */
@@ -2409,17 +2409,17 @@ content_stream_dump(ix_t strmix)
 		}
 		if (rv == RV_TIMEOUT) {
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "media change timeout will be treated as "
-			      "a request to stop using drive: "
-			      "can resume later\n"));
+				     "media change timeout will be treated as "
+				     "a request to stop using drive: "
+				     "can resume later\n"));
 			mlog_exit_hint(RV_QUIT);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
 		if (rv == RV_QUIT) {
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "media change decline will be treated as "
-			      "a request to stop using drive: "
-			      "can resume later\n"));
+				     "media change decline will be treated as "
+				     "a request to stop using drive: "
+				     "can resume later\n"));
 			mlog_exit_hint(RV_QUIT);
 			return mlog_exit(EXIT_NORMAL, rv);
 		}
@@ -2441,11 +2441,11 @@ content_stream_dump(ix_t strmix)
 		 * sync up here with other streams if reasonable
 		 */
 		mlog(MLOG_VERBOSE, _(
-		      "creating dump session media file %u "
-		      "(media %u, file %u)\n"),
-		      mwhdrp->mh_dumpfileix,
-		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix);
+			     "creating dump session media file %u "
+			     "(media %u, file %u)\n"),
+		     mwhdrp->mh_dumpfileix,
+		     mwhdrp->mh_mediaix,
+		     mwhdrp->mh_mediafileix);
 
 		/*
 		 * initialize the count of marks committed in the media file.
@@ -2457,7 +2457,7 @@ content_stream_dump(ix_t strmix)
 		 * first dump the inomap
 		 */
 		mlog(MLOG_VERBOSE, _(
-		      "dumping ino map\n"));
+			     "dumping ino map\n"));
 		sc_stat_pds[strmix].pds_phase = PDS_INOMAP;
 		rv = inomap_dump(drivep);
 		if (rv == RV_INTR) {
@@ -2494,9 +2494,9 @@ content_stream_dump(ix_t strmix)
 		if (scwhdrp->cih_dumpattr & CIH_DUMPATTR_DIRDUMP) {
 			sc_stat_pds[strmix].pds_dirdone = 0;
 			rv = dump_dirs(strmix,
-					bstatbufp,
-					bstatbuflen,
-					inomap_contextp);
+				       bstatbufp,
+				       bstatbuflen,
+				       inomap_contextp);
 			if (rv == RV_INTR) {
 				stop_requested = BOOL_TRUE;
 				goto decision_more;
@@ -2534,23 +2534,23 @@ content_stream_dump(ix_t strmix)
 		 */
 		if (! all_nondirs_committed) {
 			mlog(MLOG_VERBOSE, _(
-			      "dumping non-directory files\n"));
+				     "dumping non-directory files\n"));
 			sc_stat_pds[strmix].pds_phase = PDS_NONDIR;
 			rv = RV_OK;
 			inomap_reset_context(inomap_contextp);
 			rval = bigstat_iter(sc_fshandlep,
-					     sc_fsfd,
-					     BIGSTAT_ITER_NONDIR,
-					     scwhdrp->cih_startpt.sp_ino,
-					     (bstat_cbfp_t)dump_file,
-					     (void *)strmix,
-					     inomap_next_nondir,
-					     inomap_contextp,
-					     (int *)&rv,
-					     pipeline ?
-					       (bool_t (*)(int))preemptchk : 0,
-					     bstatbufp,
-					     bstatbuflen);
+					    sc_fsfd,
+					    BIGSTAT_ITER_NONDIR,
+					    scwhdrp->cih_startpt.sp_ino,
+					    (bstat_cbfp_t)dump_file,
+					    (void *)strmix,
+					    inomap_next_nondir,
+					    inomap_contextp,
+					    (int *)&rv,
+					    pipeline ?
+					    (bool_t (*)(int))preemptchk : 0,
+					    bstatbufp,
+					    bstatbuflen);
 			if (rval) {
 				free((void *)bstatbufp);
 				return mlog_exit(EXIT_FAULT, RV_CORE);
@@ -2597,9 +2597,9 @@ content_stream_dump(ix_t strmix)
 		 */
 		all_nondirs_sent = BOOL_TRUE;
 		mark_set(drivep,
-			  INO64MAX,
-			  OFF64MAX,
-			  STARTPT_FLAGS_END);
+			 INO64MAX,
+			 OFF64MAX,
+			 STARTPT_FLAGS_END);
 
 decision_more:
 		/*
@@ -2611,16 +2611,16 @@ decision_more:
 		 */
 		if (! hit_eom) {
 			rv = dump_filehdr(drivep,
-					   contextp,
-					   0,
-					   0,
-					   all_nondirs_sent
-					   ?
-					   (FILEHDR_FLAGS_NULL
-					     |
-					     FILEHDR_FLAGS_END)
-					   :
-					   FILEHDR_FLAGS_NULL);
+					  contextp,
+					  0,
+					  0,
+					  all_nondirs_sent
+					  ?
+					  (FILEHDR_FLAGS_NULL
+					   |
+					   FILEHDR_FLAGS_END)
+					  :
+					  FILEHDR_FLAGS_NULL);
 			if (rv == RV_DRIVE) {
 				free((void *)bstatbufp);
 				return mlog_exit(EXIT_NORMAL, rv);
@@ -2640,13 +2640,13 @@ decision_more:
 			 * call returns if the null file header made it.
 			 */
 			mark_set(drivep,
-				  INO64MAX,
-				  OFF64MAX,
-				  all_nondirs_sent
-				  ?
-				  STARTPT_FLAGS_NULL | STARTPT_FLAGS_END
-				  :
-				  STARTPT_FLAGS_NULL);
+				 INO64MAX,
+				 OFF64MAX,
+				 all_nondirs_sent
+				 ?
+				 STARTPT_FLAGS_NULL | STARTPT_FLAGS_END
+				 :
+				 STARTPT_FLAGS_NULL);
 		}
 
 		/*
@@ -2657,13 +2657,13 @@ decision_more:
 		 * all pending marks.
 		 */
 		mlog(MLOG_VERBOSE, _(
-		      "ending media file\n"));
+			     "ending media file\n"));
 		ncommitted = 0;
 		rv = Media_mfile_end(drivep,
-				      contextp,
-				      mwhdrp,
-				      &ncommitted,
-				      hit_eom);
+				     contextp,
+				     mwhdrp,
+				     &ncommitted,
+				     hit_eom);
 		if (rv == RV_DRIVE) {
 			free((void *)bstatbufp);
 			return mlog_exit(EXIT_NORMAL, rv);
@@ -2673,8 +2673,8 @@ decision_more:
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 		mlog(MLOG_VERBOSE, _(
-		      "media file size %lld bytes\n"),
-		      ncommitted);
+			     "media file size %lld bytes\n"),
+		     ncommitted);
 
 		/*
 		 * if at least one mark committed, we know all of
@@ -2710,66 +2710,66 @@ decision_more:
 
 			if (! all_dirs_committed) {
 				mlog(MLOG_DEBUG,
-				      "giving inventory "
-				      "partial dirdump media file\n");
+				     "giving inventory "
+				     "partial dirdump media file\n");
 			} else if (done && empty_mediafile) {
 				mlog(MLOG_DEBUG,
-				      "giving inventory "
-				      "empty last media file: "
-				      "%llu:%lld\n",
-				       startino,
-				       startoffset);
+				     "giving inventory "
+				     "empty last media file: "
+				     "%llu:%lld\n",
+				     startino,
+				     startoffset);
 			} else if (empty_mediafile) {
 				mlog(MLOG_DEBUG,
-				      "giving inventory "
-				      "empty media file: "
-				      "%llu:%lld\n",
-				       startino,
-				       startoffset);
+				     "giving inventory "
+				     "empty media file: "
+				     "%llu:%lld\n",
+				     startino,
+				     startoffset);
 			} else if (done) {
 				mlog(MLOG_DEBUG,
-				      "giving inventory "
-				      "last media file: "
-				      "%llu:%lld\n",
-				       startino,
-				       startoffset);
+				     "giving inventory "
+				     "last media file: "
+				     "%llu:%lld\n",
+				     startino,
+				     startoffset);
 			} else {
 				mlog(MLOG_DEBUG,
-				      "giving inventory "
-				      "media file: "
-				      "%llu:%lld - %llu:%lld\n",
-				       startino,
-				       startoffset,
-				       scwhdrp->cih_startpt.sp_ino,
-				       scwhdrp->cih_startpt.sp_offset);
+				     "giving inventory "
+				     "media file: "
+				     "%llu:%lld - %llu:%lld\n",
+				     startino,
+				     startoffset,
+				     scwhdrp->cih_startpt.sp_ino,
+				     scwhdrp->cih_startpt.sp_offset);
 			}
 
 			/*
 			 * already thread-safe, don't need to lock
 			 */
 			ok = inv_put_mediafile(inv_stmt,
-						&mwhdrp->mh_mediaid,
-						mwhdrp->mh_medialabel,
-					(uint)mwhdrp->mh_mediafileix,
-						startino,
-						startoffset,
-						scwhdrp->cih_startpt.sp_ino,
-						scwhdrp->cih_startpt.sp_offset,
-						ncommitted,
-					        all_dirs_committed
-						&&
-						! empty_mediafile,
-						BOOL_FALSE);
+					       &mwhdrp->mh_mediaid,
+					       mwhdrp->mh_medialabel,
+					       (uint)mwhdrp->mh_mediafileix,
+					       startino,
+					       startoffset,
+					       scwhdrp->cih_startpt.sp_ino,
+					       scwhdrp->cih_startpt.sp_offset,
+					       ncommitted,
+					       all_dirs_committed
+					       &&
+					       ! empty_mediafile,
+					       BOOL_FALSE);
 			if (! ok) {
 				mlog(MLOG_NORMAL, _(
-				      "inventory media file put failed\n"));
+					     "inventory media file put failed\n"));
 			}
 		}
 		if (done) {
 			contextp->cc_completepr = BOOL_TRUE;
-			    /*
-			     * so inv_end_stream and main will know
-			     */
+			/*
+			 * so inv_end_stream and main will know
+			 */
 		}
 
 		/*
@@ -2796,20 +2796,20 @@ decision_more:
 	if (drivep->d_capabilities & DRIVE_CAP_FILES) {
 		if (stream_cnt() > 1) {
 			mlog(MLOG_VERBOSE, _(
-			      "waiting for synchronized "
-			      "session inventory dump\n"));
+				     "waiting for synchronized "
+				     "session inventory dump\n"));
 			sc_stat_pds[strmix].pds_phase = PDS_INVSYNC;
 		}
 
 		/*
 		 * first be sure all threads have begun
-		*/
+		 */
 		while (sc_thrdsarrivedcnt < drivecnt) {
 			sleep(1);
 		}
 		/*
 		 * now wait for survivors to checkin
-		*/
+		 */
 		while (sc_thrdsdonecnt < stream_cnt()) {
 			sleep(1);
 		}
@@ -2830,8 +2830,8 @@ decision_more:
 	elapsed = time(0) - sc_stat_starttime;
 
 	mlog(MLOG_TRACE, _(
-	      "ending stream: %ld seconds elapsed\n"),
-	      elapsed);
+		     "ending stream: %ld seconds elapsed\n"),
+	     elapsed);
 
 	return mlog_exit(EXIT_NORMAL, rv);
 }
@@ -2854,57 +2854,57 @@ content_complete(void)
 	elapsed = time(0) - sc_stat_starttime;
 
 	mlog(MLOG_VERBOSE, _(
-	      "dump size (non-dir files) : %llu bytes\n"),
-	      sc_stat_datadone);
+		     "dump size (non-dir files) : %llu bytes\n"),
+	     sc_stat_datadone);
 
 	if (completepr) {
 		if (sc_savequotas) {
 			for (i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
 				if (quotas[i].savequotas && unlink(quotas[i].quotapath) < 0) {
 					mlog(MLOG_ERROR, _(
-					"unable to remove %s: %s\n"),
-					quotas[i].quotapath,
-					strerror (errno));
+						     "unable to remove %s: %s\n"),
+					     quotas[i].quotapath,
+					     strerror (errno));
 				}
 			}
 		}
 
 		mlog(MLOG_VERBOSE, _(
-		      "dump complete"
-		      ": %ld seconds elapsed"
-		      "\n"),
-		      elapsed);
+			     "dump complete"
+			     ": %ld seconds elapsed"
+			     "\n"),
+		     elapsed);
 	} else {
 		if (sc_inv_updatepr) {
 			mlog(MLOG_VERBOSE | MLOG_NOTE, _(
-			      "dump interrupted"
-			      ": %ld seconds elapsed"
-			      ": may resume later using -%c option"
-			      "\n"),
-			      elapsed,
-			      GETOPT_RESUME);
+				     "dump interrupted"
+				     ": %ld seconds elapsed"
+				     ": may resume later using -%c option"
+				     "\n"),
+			     elapsed,
+			     GETOPT_RESUME);
 			mlog_exit_hint(RV_INTR);
 		} else {
 			mlog(MLOG_VERBOSE | MLOG_NOTE, _(
-			      "dump interrupted"
-			      ": %ld seconds elapsed"
-			      "\n"),
-			      elapsed);
+				     "dump interrupted"
+				     ": %ld seconds elapsed"
+				     "\n"),
+			     elapsed);
 			mlog_exit_hint(RV_INTR);
 		}
 	}
 	return completepr;
 }
 
-#define PREAMBLEMAX	3
-#define QUERYMAX	1
-#define CHOICEMAX	30
-#define ACKMAX		3
-#define POSTAMBLEMAX	3
-#define DLOG_TIMEOUT	300
-#define DLOG_TIMEOUT_MEDIA	3600
+#define PREAMBLEMAX     3
+#define QUERYMAX        1
+#define CHOICEMAX       30
+#define ACKMAX          3
+#define POSTAMBLEMAX    3
+#define DLOG_TIMEOUT    300
+#define DLOG_TIMEOUT_MEDIA      3600
 
-#define CHOICESTRSZ	10
+#define CHOICESTRSZ     10
 typedef struct { ix_t thrdix; char choicestr[CHOICESTRSZ]; } cttm_t;
 
 char *
@@ -2928,10 +2928,10 @@ content_mediachange_query(void)
 		if (sc_mcflag[thrdix]) {
 			choicetothrdmap[choicecnt].thrdix = thrdix;
 			sprintf(choicetothrdmap[choicecnt].choicestr,
-				 "drive %u",
-				 (unsigned int)thrdix);
+				"drive %u",
+				(unsigned int)thrdix);
 			choicestr[choicecnt] =
-					choicetothrdmap[choicecnt].choicestr;
+				choicetothrdmap[choicecnt].choicestr;
 			maxdrvchoiceix = choicecnt;
 			choicecnt++;
 		}
@@ -2940,18 +2940,18 @@ content_mediachange_query(void)
 	choicestr[choicecnt++] = "continue";
 	assert(choicecnt <= CHOICEMAX);
 	responseix = dlog_multi_query(querystr,
-				       querycnt,
-				       choicestr,
-				       choicecnt,
-				       0,           /* hilitestr */
-				       IXMAX,       /* hiliteix */
-				       0,           /* defaultstr */
-				       nochangeix,  /* defaultix */
-				       DLOG_TIMEOUT_MEDIA,
-				       nochangeix, /* timeout ix */
-				       nochangeix, /* sigint ix */
-				       nochangeix, /* sighup ix */
-				       nochangeix);/* sigquit ix */
+				      querycnt,
+				      choicestr,
+				      choicecnt,
+				      0,                /* hilitestr */
+				      IXMAX,            /* hiliteix */
+				      0,                /* defaultstr */
+				      nochangeix,       /* defaultix */
+				      DLOG_TIMEOUT_MEDIA,
+				      nochangeix,       /* timeout ix */
+				      nochangeix,       /* sigint ix */
+				      nochangeix,       /* sighup ix */
+				      nochangeix);      /* sigquit ix */
 	if (responseix <= maxdrvchoiceix) {
 		clr_mcflag(choicetothrdmap[responseix].thrdix);
 		return "media change acknowledged\n";
@@ -2967,29 +2967,29 @@ update_cc_Media_useterminatorpr(drive_t *drivep, context_t *contextp)
 	int dcaps = drivep->d_capabilities;
 
 	contextp->cc_Media_useterminatorpr = BOOL_TRUE;
-	if (! (dcaps & DRIVE_CAP_FILES)) {
+	if (!(dcaps & DRIVE_CAP_FILES)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+	if (!(dcaps & DRIVE_CAP_OVERWRITE)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if (! (dcaps & DRIVE_CAP_BSF)) {
+	if (!(dcaps & DRIVE_CAP_BSF)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
-	if (! (dcaps & DRIVE_CAP_APPEND)) {
+	if (!(dcaps & DRIVE_CAP_APPEND)) {
 		contextp->cc_Media_useterminatorpr = BOOL_FALSE;
 	}
 }
 
 static rv_t
-dump_dirs(ix_t strmix,
-	   xfs_bstat_t *bstatbufp,
-	   size_t bstatbuflen,
-	   void *inomap_contextp)
+dump_dirs(ix_t		strmix,
+	  xfs_bstat_t * bstatbufp,
+	  size_t	bstatbuflen,
+	  void *	inomap_contextp)
 {
 	xfs_ino_t lastino;
 	size_t bulkstatcallcnt;
-        xfs_fsop_bulkreq_t bulkreq;
+	xfs_fsop_bulkreq_t bulkreq;
 
 	inomap_reset_context(inomap_contextp);
 
@@ -3005,7 +3005,7 @@ dump_dirs(ix_t strmix,
 
 		if (bulkstatcallcnt == 0) {
 			mlog(MLOG_VERBOSE, _(
-			      "dumping directories\n"));
+				     "dumping directories\n"));
 		}
 		sc_stat_pds[strmix].pds_phase = PDS_DIRDUMP;
 
@@ -3020,9 +3020,9 @@ dump_dirs(ix_t strmix,
 		 * get a bunch of bulkstats
 		 */
 		mlog(MLOG_NITTY,
-		      "dump_dirs SGI_FS_BULKSTAT %u buf len %u\n",
-		      bulkstatcallcnt,
-		      bstatbuflen);
+		     "dump_dirs SGI_FS_BULKSTAT %u buf len %u\n",
+		     bulkstatcallcnt,
+		     bstatbuflen);
 
 		bulkreq.lastip = (__u64 *)&lastino;
 		bulkreq.icount = bstatbuflen;
@@ -3033,15 +3033,15 @@ dump_dirs(ix_t strmix,
 
 		if (rval) {
 			mlog(MLOG_NORMAL, _(
-			      "SGI_FS_BULKSTAT failed: "
-			      "%s (%d)\n"),
-			      strerror(errno),
-			      errno);
+				     "SGI_FS_BULKSTAT failed: "
+				     "%s (%d)\n"),
+			     strerror(errno),
+			     errno);
 			return RV_ERROR;
 		}
 		mlog(MLOG_NITTY,
-		      "dump_dirs SGI_FS_BULKSTAT returns %d entries\n",
-		      buflenout);
+		     "dump_dirs SGI_FS_BULKSTAT returns %d entries\n",
+		     buflenout);
 
 		/*
 		 * check if done
@@ -3056,30 +3056,30 @@ dump_dirs(ix_t strmix,
 		 */
 		for (p = bstatbufp, endp = bstatbufp + buflenout
 		     ;
-		      p < endp
+		     p < endp
 		     ;
-		      p++) {
+		     p++) {
 			rv_t rv;
 
 			if (p->bs_ino == 0)
 				continue;
 
-			if (!p->bs_nlink || !p->bs_mode) {
+			if (! p->bs_nlink || ! p->bs_mode) {
 				/* inode being modified, get synced data */
 				mlog(MLOG_NITTY,
-				      "ino %llu needs second bulkstat\n",
-				      p->bs_ino);
+				     "ino %llu needs second bulkstat\n",
+				     p->bs_ino);
 
 				if (bigstat_one(sc_fsfd, p->bs_ino, p) < 0) {
-					mlog(MLOG_WARNING,  _(
-					      "failed to get bulkstat information for inode %llu\n"),
-					      p->bs_ino);
+					mlog(MLOG_WARNING, _(
+						     "failed to get bulkstat information for inode %llu\n"),
+					     p->bs_ino);
 					continue;
 				}
-				if (!p->bs_nlink || !p->bs_mode || !p->bs_ino) {
+				if (! p->bs_nlink || ! p->bs_mode || ! p->bs_ino) {
 					mlog(MLOG_TRACE,
-					      "failed to get valid bulkstat information for inode %llu\n",
-					      p->bs_ino);
+					     "failed to get valid bulkstat information for inode %llu\n",
+					     p->bs_ino);
 					continue;
 				}
 			}
@@ -3107,10 +3107,10 @@ dump_dirs(ix_t strmix,
 }
 
 static rv_t
-dump_dir(ix_t strmix,
-	  jdm_fshandle_t *fshandlep,
-	  int fsfd,
-	  xfs_bstat_t *statp)
+dump_dir(ix_t			strmix,
+	 jdm_fshandle_t *	fshandlep,
+	 int			fsfd,
+	 xfs_bstat_t *		statp)
 {
 	context_t *contextp = &sc_contextp[strmix];
 	drive_t *drivep = drivepp[strmix];
@@ -3147,15 +3147,15 @@ dump_dir(ix_t strmix,
 	 * skip if not in inomap
 	 */
 	if (state == MAP_INO_UNUSED
-	     ||
-	     state == MAP_DIR_NOCHNG
-	     ||
-	     state == MAP_NDR_NOCHNG) {
+	    ||
+	    state == MAP_DIR_NOCHNG
+	    ||
+	    state == MAP_NDR_NOCHNG) {
 		if (state == MAP_NDR_NOCHNG) {
 			mlog(MLOG_DEBUG,
-			      "inomap inconsistency ino %llu: "
-			      "map says is non-dir but is dir: skipping\n",
-			      statp->bs_ino);
+			     "inomap inconsistency ino %llu: "
+			     "map says is non-dir but is dir: skipping\n",
+			     statp->bs_ino);
 		}
 		return RV_OK;
 	}
@@ -3165,9 +3165,9 @@ dump_dir(ix_t strmix,
 	 */
 	if (state == MAP_NDR_CHANGE) {
 		mlog(MLOG_DEBUG,
-		      "inomap inconsistency ino %llu: "
-		      "map says non-dir but is dir: skipping\n",
-		      statp->bs_ino);
+		     "inomap inconsistency ino %llu: "
+		     "map says non-dir but is dir: skipping\n",
+		     statp->bs_ino);
 		return RV_OK;
 	}
 
@@ -3176,21 +3176,21 @@ dump_dir(ix_t strmix,
 	 */
 	sc_stat_pds[strmix].pds_dirdone++;
 
-        /*
-         * if bulkstat ino# occupied more than 32 bits and
-         * linux ino# for getdents is 32 bits then
-         * warn and skip.
-         */
+	/*
+	 * if bulkstat ino# occupied more than 32 bits and
+	 * linux ino# for getdents is 32 bits then
+	 * warn and skip.
+	 */
 	if (statp->bs_ino > (xfs_ino_t)INOMAX) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "unable to dump directory: ino %llu too large\n"),
-		      statp->bs_ino);
+			     "unable to dump directory: ino %llu too large\n"),
+		     statp->bs_ino);
 		return RV_OK; /* continue anyway */
 	}
 
 	mlog(MLOG_TRACE,
-	      "dumping directory ino %llu\n",
-	      statp->bs_ino);
+	     "dumping directory ino %llu\n",
+	     statp->bs_ino);
 
 	/*
 	 * open the directory named by statp
@@ -3198,8 +3198,8 @@ dump_dir(ix_t strmix,
 	fd = jdm_open(fshandlep, statp, O_RDONLY);
 	if (fd < 0) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "unable to open directory: ino %llu: %s\n"),
-		      statp->bs_ino, strerror(errno) );
+			     "unable to open directory: ino %llu: %s\n"),
+		     statp->bs_ino, strerror(errno) );
 		return RV_OK; /* continue anyway */
 	}
 
@@ -3229,11 +3229,11 @@ dump_dir(ix_t strmix,
 		 */
 		if (nread < 0) {
 			mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      "unable to read dirents (%d) for "
-			      "directory ino %llu: %s\n"),
-			      gdcnt,
-			      statp->bs_ino,
-			      strerror(errno));
+				     "unable to read dirents (%d) for "
+				     "directory ino %llu: %s\n"),
+			     gdcnt,
+			     statp->bs_ino,
+			     strerror(errno));
 			/*
 			 * !!! curtis looked at this, and pointed out that
 			 * we could take some recovery action here. if the
@@ -3256,21 +3256,21 @@ dump_dir(ix_t strmix,
 		 * and null entries.
 		 */
 		for (p = gdp,
-		      reclen = (size_t)p->d_reclen
+		     reclen = (size_t)p->d_reclen
 		     ;
-		      nread > 0
+		     nread > 0
 		     ;
-		      nread -= (int)reclen,
-		      assert(nread >= 0),
-		      p = (struct dirent *)((char *)p + reclen),
-		      reclen = (size_t)p->d_reclen) {
+		     nread -= (int)reclen,
+		     assert(nread >= 0),
+		     p = (struct dirent *)((char *)p + reclen),
+		     reclen = (size_t)p->d_reclen) {
 			xfs_ino_t ino;
 			register size_t namelen = strlen(p->d_name);
 #ifdef DEBUG
 			register size_t nameszmax = (size_t)reclen
 						    -
 						    offsetofmember(struct dirent,
-								    d_name);
+								   d_name);
 
 			/*
 			 * getdents(2) guarantees that the string will
@@ -3284,12 +3284,12 @@ dump_dir(ix_t strmix,
 			 * skip "." and ".."
 			 */
 			if (*(p->d_name + 0) == '.'
-			     &&
-			     (*(p->d_name + 1) == 0
-			       ||
-			       (*(p->d_name + 1) == '.'
-				 &&
-				 *(p->d_name + 2) == 0))) {
+			    &&
+			    (*(p->d_name + 1) == 0
+			     ||
+			     (*(p->d_name + 1) == '.'
+			      &&
+			      *(p->d_name + 2) == 0))) {
 				continue;
 			}
 
@@ -3297,10 +3297,10 @@ dump_dir(ix_t strmix,
 
 			if (ino == 0) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "encountered 0 ino (%s) in "
-				      "directory ino %llu: NOT dumping\n"),
-				      p->d_name,
-				      statp->bs_ino);
+					     "encountered 0 ino (%s) in "
+					     "directory ino %llu: NOT dumping\n"),
+				     p->d_name,
+				     statp->bs_ino);
 				continue;
 			}
 
@@ -3313,17 +3313,17 @@ dump_dir(ix_t strmix,
 				int scrval;
 
 				scrval = bigstat_one(fsfd,
-						      p->d_ino,
-						      &statbuf);
+						     p->d_ino,
+						     &statbuf);
 				if (scrval) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					      "could not stat "
-					      "dirent %s ino %llu: %s: "
-					      "using null generation count "
-					      "in directory entry\n"),
-					      p->d_name,
-					      (xfs_ino_t)p->d_ino,
-					      strerror(errno));
+						     "could not stat "
+						     "dirent %s ino %llu: %s: "
+						     "using null generation count "
+						     "in directory entry\n"),
+					     p->d_name,
+					     (xfs_ino_t)p->d_ino,
+					     strerror(errno));
 					gen = 0;
 				} else {
 					gen = statbuf.bs_gen;
@@ -3331,12 +3331,12 @@ dump_dir(ix_t strmix,
 			}
 
 			rv = dump_dirent(drivep,
-					  contextp,
-					  statp,
-					  ino,
-					  gen,
-					  p->d_name,
-					  namelen);
+					 contextp,
+					 statp,
+					 ino,
+					 gen,
+					 p->d_name,
+					 namelen);
 			if (rv != RV_OK) {
 				break;
 			}
@@ -3351,10 +3351,10 @@ dump_dir(ix_t strmix,
 	}
 
 	if (rv == RV_OK
-	     &&
-	     sc_dumpextattrpr
-	     &&
-	     (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
+	    &&
+	    sc_dumpextattrpr
+	    &&
+	    (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
 		rv = dump_extattrs(drivep, contextp, fshandlep, statp);
 	}
 
@@ -3367,10 +3367,10 @@ dump_dir(ix_t strmix,
 }
 
 static rv_t
-dump_extattrs(drive_t *drivep,
-	       context_t *contextp,
-	       jdm_fshandle_t *fshandlep,
-	       xfs_bstat_t *statp)
+dump_extattrs(drive_t *		drivep,
+	      context_t *	contextp,
+	      jdm_fshandle_t *	fshandlep,
+	      xfs_bstat_t *	statp)
 {
 	ix_t pass;
 	int flag;
@@ -3382,9 +3382,9 @@ dump_extattrs(drive_t *drivep,
 	 * dump a file header specially marked as heading extended attributes
 	 */
 	mlog(MLOG_NITTY,
-	      "dumping %s ino %llu extended attributes filehdr\n",
-	      FILETYPE(statp),
-	      statp->bs_ino);
+	     "dumping %s ino %llu extended attributes filehdr\n",
+	     FILETYPE(statp),
+	     statp->bs_ino);
 
 	rv = dump_filehdr(drivep, contextp, statp, 0, FILEHDR_FLAGS_EXTATTR);
 	if (rv != RV_OK) {
@@ -3406,10 +3406,10 @@ dump_extattrs(drive_t *drivep,
 			flag = ATTR_SECURE;
 
 		mlog(MLOG_NITTY,
-		      "dumping %s extended attributes for %s ino %llu\n",
-		      EXTATTR_NAMESPACE(flag),
-		      FILETYPE(statp),
-		      statp->bs_ino);
+		     "dumping %s extended attributes for %s ino %llu\n",
+		     EXTATTR_NAMESPACE(flag),
+		     FILETYPE(statp),
+		     statp->bs_ino);
 
 		/*
 		 * loop dumping the extended attributes from the namespace
@@ -3422,18 +3422,18 @@ dump_extattrs(drive_t *drivep,
 			int rval = 0;
 
 			rval = jdm_attr_list(fshandlep, statp,
-				contextp->cc_extattrlistbufp,
-				(int)contextp->cc_extattrlistbufsz,
-				flag, &cursor);
+					     contextp->cc_extattrlistbufp,
+					     (int)contextp->cc_extattrlistbufsz,
+					     flag, &cursor);
 			if (rval) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "could not get list of %s attributes for "
-				      "%s ino %llu: %s (%d)\n"),
-				      EXTATTR_NAMESPACE(flag),
-				      FILETYPE(statp),
-				      statp->bs_ino,
-				      strerror(errno),
-				      errno);
+					     "could not get list of %s attributes for "
+					     "%s ino %llu: %s (%d)\n"),
+				     EXTATTR_NAMESPACE(flag),
+				     FILETYPE(statp),
+				     statp->bs_ino,
+				     strerror(errno),
+				     errno);
 				break;
 			}
 
@@ -3442,42 +3442,42 @@ dump_extattrs(drive_t *drivep,
 
 			abort = BOOL_FALSE;
 			rv = dump_extattr_list(drivep,
-						contextp,
-						fshandlep,
-						statp,
-						listp,
-						flag,
-						&abort);
+					       contextp,
+					       fshandlep,
+					       statp,
+					       listp,
+					       flag,
+					       &abort);
 			if (rv != RV_OK) {
 				return rv;
 			}
-		} while (more && !abort);
+		} while (more && ! abort);
 	}
 
 	/*
 	 * finally, dump a dummy extattr hdr so restore will know
 	 * we're done.
 	 */
-	/*DBG*/mlog(MLOG_NITTY,
+	/*DBG*/ mlog(MLOG_NITTY,
 		     "dumping NULL extattrhdr\n");
 	rv = dump_extattrhdr(drivep,
-			      contextp,
-			      statp,
-			      EXTATTRHDR_SZ,
-			      0,
-			      EXTATTRHDR_FLAGS_NULL,
-			      0);
+			     contextp,
+			     statp,
+			     EXTATTRHDR_SZ,
+			     0,
+			     EXTATTRHDR_FLAGS_NULL,
+			     0);
 	return rv;
 }
 
 static rv_t
-dump_extattr_list(drive_t *drivep,
-		   context_t *contextp,
-		   jdm_fshandle_t *fshandlep,
-		   xfs_bstat_t *statp,
-		   attrlist_t *listp,
-		   int flag,
-		   bool_t *abortprp)
+dump_extattr_list(drive_t *		drivep,
+		  context_t *		contextp,
+		  jdm_fshandle_t *	fshandlep,
+		  xfs_bstat_t *		statp,
+		  attrlist_t *		listp,
+		  int			flag,
+		  bool_t *		abortprp)
 {
 	size_t listlen = (size_t)listp->al_count;
 	ix_t nameix;
@@ -3521,19 +3521,19 @@ dump_extattr_list(drive_t *drivep,
 			 */
 
 			if (hsm_fs_ctxtp) {
-				int	skip_entry;
+				int skip_entry;
 
-				if (!HsmFilterExistingAttribute(
-				    contextp->cc_hsm_f_ctxtp, entp->a_name,
-				    entp->a_valuelen, flag,
-				    &skip_entry)) {
+				if (! HsmFilterExistingAttribute(
+					    contextp->cc_hsm_f_ctxtp, entp->a_name,
+					    entp->a_valuelen, flag,
+					    &skip_entry)) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      		    "HSM could not filter %s "
-					    "attribute %s for %s ino %llu\n"),
-					    EXTATTR_NAMESPACE(flag),
-					    entp->a_name,
-					    FILETYPE(statp),
-			      		    statp->bs_ino);
+						     "HSM could not filter %s "
+						     "attribute %s for %s ino %llu\n"),
+					     EXTATTR_NAMESPACE(flag),
+					     entp->a_name,
+					     FILETYPE(statp),
+					     statp->bs_ino);
 					*abortprp = BOOL_TRUE;
 					return RV_OK;
 				}
@@ -3544,16 +3544,16 @@ dump_extattr_list(drive_t *drivep,
 			}
 
 			dumpbufp = dump_extattr_buildrecord(statp,
-							     dumpbufp,
-							     dumpbufendp,
-							     entp->a_name,
-							     entp->a_valuelen,
-							     flag,
-							     &valuep);
+							    dumpbufp,
+							    dumpbufendp,
+							    entp->a_name,
+							    entp->a_valuelen,
+							    flag,
+							    &valuep);
 			if (dumpbufp > dumpbufendp) {
-				break;		/* won't fit in buffer */
+				break;          /* won't fit in buffer */
 			}
-			if (valuep != NULL) { /* if added to dump buffer */
+			if (valuep != NULL) {   /* if added to dump buffer */
 				endp = dumpbufp;
 				opp->am_attrname = entp->a_name;
 				opp->am_attrvalue = valuep;
@@ -3575,18 +3575,18 @@ dump_extattr_list(drive_t *drivep,
 		rtrvcnt = rtrvix;
 		if (rtrvcnt > 0) {
 			rval = jdm_attr_multi(fshandlep, statp,
-					(void *)contextp->cc_extattrrtrvarrayp,
-					(int)rtrvcnt,
-					0);
+					      (void *)contextp->cc_extattrrtrvarrayp,
+					      (int)rtrvcnt,
+					      0);
 			if (rval) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "could not retrieve %s attributes for "
-				      "%s ino %llu: %s (%d)\n"),
-				      EXTATTR_NAMESPACE(flag),
-				      FILETYPE(statp),
-				      statp->bs_ino,
-				      strerror(errno),
-				      errno);
+					     "could not retrieve %s attributes for "
+					     "%s ino %llu: %s (%d)\n"),
+				     EXTATTR_NAMESPACE(flag),
+				     FILETYPE(statp),
+				     statp->bs_ino,
+				     strerror(errno),
+				     errno);
 				*abortprp = BOOL_TRUE;
 				return RV_OK;
 			}
@@ -3596,23 +3596,23 @@ dump_extattr_list(drive_t *drivep,
 				opp = &contextp->cc_extattrrtrvarrayp[rtrvix];
 				if (opp->am_error) {
 					if (opp->am_error == ENOATTR &&
-					     flag & ATTR_SECURE) {
-				/*
-				 * Security attributes are supported by
-				 * the kernel but jdm_attr_multi() returns
-				 * ENOATTR for every 'user' space attribute
-				 * during the 'security' pass of the extended
-				 * attribute loop (pass==3).  Suppress the
-				 * following error message with a no-op. The
-				 * jdm_attr_multi() problem is fixed in mod
-				 * xfs-linux:xfs-kern:167038a (PV 907903).
-				 */
+					    flag & ATTR_SECURE) {
+						/*
+						 * Security attributes are supported by
+						 * the kernel but jdm_attr_multi() returns
+						 * ENOATTR for every 'user' space attribute
+						 * during the 'security' pass of the extended
+						 * attribute loop (pass==3).  Suppress the
+						 * following error message with a no-op. The
+						 * jdm_attr_multi() problem is fixed in mod
+						 * xfs-linux:xfs-kern:167038a (PV 907903).
+						 */
 						continue;
 					}
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-					     "attr_multi indicates error while "
-					     "retrieving %s attribute [%s] for "
-					     "%s ino %llu: %s (%d)\n"),
+						     "attr_multi indicates error while "
+						     "retrieving %s attribute [%s] for "
+						     "%s ino %llu: %s (%d)\n"),
 					     EXTATTR_NAMESPACE(flag),
 					     opp->am_attrname,
 					     FILETYPE(statp),
@@ -3630,16 +3630,16 @@ dump_extattr_list(drive_t *drivep,
 		 */
 
 		if (dumpbufp <= dumpbufendp)
-			continue;	/* no buffer overflow yet */
+			continue;       /* no buffer overflow yet */
 
 		assert(endp > contextp->cc_extattrdumpbufp);
 		bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
 		rval = write_buf(contextp->cc_extattrdumpbufp,
-				  bufsz,
-				  (void *)drivep,
-				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
-				  (wfp_t)drivep->d_opsp->do_write);
+				 bufsz,
+				 (void *)drivep,
+				 (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				 (wfp_t)drivep->d_opsp->do_write);
 		switch (rval) {
 		case 0:
 			rv = RV_OK;
@@ -3669,41 +3669,41 @@ dump_extattr_list(drive_t *drivep,
 	 * needs to add any addtional attributes.
 	 */
 
-	if (!listp->al_more && hsm_fs_ctxtp) {
+	if (! listp->al_more && hsm_fs_ctxtp) {
 		int hsmcursor = 0;
 		for (;;) {
-			char	*hsmnamep;
-			char	*hsmvaluep;
-			char	*valuep;
-			uint32_t	hsmvaluesz;
+			char *hsmnamep;
+			char *hsmvaluep;
+			char *valuep;
+			uint32_t hsmvaluesz;
 
-			if (!HsmAddNewAttribute(contextp->cc_hsm_f_ctxtp,
+			if (! HsmAddNewAttribute(contextp->cc_hsm_f_ctxtp,
 						hsmcursor,
 						flag,
 						&hsmnamep,
 						&hsmvaluep,
 						&hsmvaluesz)) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      		"HSM could not add new %s attribute "
-					"#%d for %s ino %llu\n"),
-					EXTATTR_NAMESPACE(flag),
-					hsmcursor,
-					FILETYPE(statp),
-			      		statp->bs_ino);
+					     "HSM could not add new %s attribute "
+					     "#%d for %s ino %llu\n"),
+				     EXTATTR_NAMESPACE(flag),
+				     hsmcursor,
+				     FILETYPE(statp),
+				     statp->bs_ino);
 				*abortprp = BOOL_TRUE;
 				return RV_OK;
 			}
 			if (hsmnamep == NULL) {
-				break;		/* No more attributes to add */
+				break;          /* No more attributes to add */
 			}
 
 			dumpbufp = dump_extattr_buildrecord(statp,
-							     dumpbufp,
-							     dumpbufendp,
-							     hsmnamep,
-							     hsmvaluesz,
-							     flag,
-							     &valuep);
+							    dumpbufp,
+							    dumpbufendp,
+							    hsmnamep,
+							    hsmvaluesz,
+							    flag,
+							    &valuep);
 
 			if (dumpbufp < dumpbufendp) { /* if fits in buffer */
 				endp = dumpbufp;
@@ -3716,10 +3716,10 @@ dump_extattr_list(drive_t *drivep,
 			bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
 			rval = write_buf(contextp->cc_extattrdumpbufp,
-				  bufsz,
-				  (void *)drivep,
-				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
-				  (wfp_t)drivep->d_opsp->do_write);
+					 bufsz,
+					 (void *)drivep,
+					 (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+					 (wfp_t)drivep->d_opsp->do_write);
 			switch (rval) {
 			case 0:
 				rv = RV_OK;
@@ -3754,10 +3754,10 @@ dump_extattr_list(drive_t *drivep,
 		bufsz = (size_t)(endp - contextp->cc_extattrdumpbufp);
 
 		rval = write_buf(contextp->cc_extattrdumpbufp,
-				  bufsz,
-				  (void *)drivep,
-				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
-				  (wfp_t)drivep->d_opsp->do_write);
+				 bufsz,
+				 (void *)drivep,
+				 (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				 (wfp_t)drivep->d_opsp->do_write);
 		switch (rval) {
 		case 0:
 			rv = RV_OK;
@@ -3785,13 +3785,13 @@ dump_extattr_list(drive_t *drivep,
 }
 
 static char *
-dump_extattr_buildrecord(xfs_bstat_t *statp,
-			  char *dumpbufp,
-			  char *dumpbufendp,
-			  char *namesrcp,
-			  uint32_t valuesz,
-			  int flag,
-			  char **valuepp)
+dump_extattr_buildrecord(xfs_bstat_t *	statp,
+			 char *		dumpbufp,
+			 char *		dumpbufendp,
+			 char *		namesrcp,
+			 uint32_t	valuesz,
+			 int		flag,
+			 char **	valuepp)
 {
 	extattrhdr_t *ahdrp = (extattrhdr_t *)dumpbufp;
 	char *namep = dumpbufp + EXTATTRHDR_SZ;
@@ -3812,31 +3812,31 @@ dump_extattr_buildrecord(xfs_bstat_t *statp,
 
 	if (namelen > NAME_MAX) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "%s extended attribute name for %s ino %llu too long: "
-		      "%u, max is %u: skipping\n"),
-		      EXTATTR_NAMESPACE(flag),
-		      FILETYPE(statp),
-		      statp->bs_ino,
-		      namelen,
-		      NAME_MAX);
+			     "%s extended attribute name for %s ino %llu too long: "
+			     "%u, max is %u: skipping\n"),
+		     EXTATTR_NAMESPACE(flag),
+		     FILETYPE(statp),
+		     statp->bs_ino,
+		     namelen,
+		     NAME_MAX);
 		*valuepp = 0;
 		return dumpbufp;
 	}
 
 	if (valuesz > ATTR_MAX_VALUELEN) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "%s extended attribute value for %s ino %llu too long: "
-		      "%u, max is %u: skipping\n"),
-		      EXTATTR_NAMESPACE(flag),
-		      FILETYPE(statp),
-		      statp->bs_ino,
-		      valuesz,
-		      ATTR_MAX_VALUELEN);
+			     "%s extended attribute value for %s ino %llu too long: "
+			     "%u, max is %u: skipping\n"),
+		     EXTATTR_NAMESPACE(flag),
+		     FILETYPE(statp),
+		     statp->bs_ino,
+		     valuesz,
+		     ATTR_MAX_VALUELEN);
 		*valuepp = 0;
 		return dumpbufp;
 	}
 
-	/*DBG*/mlog(MLOG_NITTY,
+	/*DBG*/ mlog(MLOG_NITTY,
 		     "building extattr "
 		     "record sz %u "
 		     "hdrsz %u "
@@ -3853,8 +3853,8 @@ dump_extattr_buildrecord(xfs_bstat_t *statp,
 	assert(EXTATTRHDR_SZ + namesz < UINT16MAX);
 	tmpah.ah_valoff = (uint16_t)(EXTATTRHDR_SZ + namesz);
 	tmpah.ah_flags = (uint16_t)
-		((flag & ATTR_ROOT) ? EXTATTRHDR_FLAGS_ROOT :
-		((flag & ATTR_SECURE) ? EXTATTRHDR_FLAGS_SECURE : 0));
+			 ((flag & ATTR_ROOT) ? EXTATTRHDR_FLAGS_ROOT :
+			  ((flag & ATTR_SECURE) ? EXTATTRHDR_FLAGS_SECURE : 0));
 	tmpah.ah_valsz = valuesz;
 	tmpah.ah_flags |= EXTATTRHDR_FLAGS_CHECKSUM;
 	tmpah.ah_checksum = calc_checksum(&tmpah, EXTATTRHDR_SZ);
@@ -3866,13 +3866,13 @@ dump_extattr_buildrecord(xfs_bstat_t *statp,
 
 /* ARGSUSED */
 static rv_t
-dump_extattrhdr(drive_t *drivep,
-		 context_t *contextp,
-		 xfs_bstat_t *statp,
-		 size_t recsz,
-		 size_t valoff,
-		 ix_t flags,
-		 uint32_t valsz)
+dump_extattrhdr(drive_t *	drivep,
+		context_t *	contextp,
+		xfs_bstat_t *	statp,
+		size_t		recsz,
+		size_t		valoff,
+		ix_t		flags,
+		uint32_t	valsz)
 {
 	extattrhdr_t ahdr;
 	extattrhdr_t tmpahdr;
@@ -3889,10 +3889,10 @@ dump_extattrhdr(drive_t *drivep,
 
 	xlate_extattrhdr(&ahdr, &tmpahdr, 1);
 	rval = write_buf((char *)&tmpahdr,
-			  EXTATTRHDR_SZ,
-			  (void *)drivep,
-			  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
-			  (wfp_t)drivep->d_opsp->do_write);
+			 EXTATTRHDR_SZ,
+			 (void *)drivep,
+			 (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+			 (wfp_t)drivep->d_opsp->do_write);
 	switch (rval) {
 	case 0:
 		rv = RV_OK;
@@ -3923,10 +3923,10 @@ dump_extattrhdr(drive_t *drivep,
  */
 /* ARGSUSED */
 static rv_t
-dump_file(void *arg1,
-	   jdm_fshandle_t *fshandlep,
-	   int fsfd,
-	   xfs_bstat_t *statp)
+dump_file(void *		arg1,
+	  jdm_fshandle_t *	fshandlep,
+	  int			fsfd,
+	  xfs_bstat_t *		statp)
 {
 	ix_t strmix = (ix_t)arg1;
 	context_t *contextp = &sc_contextp[strmix];
@@ -3951,7 +3951,7 @@ dump_file(void *arg1,
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		mlog(MLOG_DEBUG, "skip as no links for ino %llu\n",
-			statp->bs_ino);
+		     statp->bs_ino);
 		return RV_OK;
 	}
 
@@ -3963,7 +3963,7 @@ dump_file(void *arg1,
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		mlog(MLOG_DEBUG, "skip as ino %llu is prior to starpoint\n",
-			statp->bs_ino);
+		     statp->bs_ino);
 		return RV_OK;
 	}
 
@@ -3971,14 +3971,14 @@ dump_file(void *arg1,
 	 * skip if at or beyond next startpoint. return non-zero to
 	 * abort iteration.
 	 */
-	if (! (endptp->sp_flags & STARTPT_FLAGS_END)) {
+	if (!(endptp->sp_flags & STARTPT_FLAGS_END)) {
 		if (endptp->sp_offset == 0) {
 			if (statp->bs_ino >= endptp->sp_ino) {
 				if (statp->bs_ino > contextp->cc_stat_lastino) {
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
 				mlog(MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
-					statp->bs_ino);
+				     statp->bs_ino);
 				return RV_NOMORE;
 			}
 		} else {
@@ -3987,7 +3987,7 @@ dump_file(void *arg1,
 					contextp->cc_stat_lastino = statp->bs_ino;
 				}
 				mlog(MLOG_DEBUG, "skip as ino %llu is at/beyond starpoint\n",
-					statp->bs_ino);
+				     statp->bs_ino);
 				return RV_NOMORE;
 			}
 		}
@@ -4002,23 +4002,23 @@ dump_file(void *arg1,
 	 * skip if not in inomap
 	 */
 	if (state == MAP_INO_UNUSED
-	     ||
-	     state == MAP_DIR_NOCHNG
-	     ||
-	     state == MAP_NDR_NOCHNG) {
+	    ||
+	    state == MAP_DIR_NOCHNG
+	    ||
+	    state == MAP_NDR_NOCHNG) {
 		if (state == MAP_DIR_NOCHNG) {
 			mlog(MLOG_DEBUG,
-			      "inomap inconsistency ino %llu: "
-			      "MAP_DIR_NOCHNG but is non-dir: skipping\n",
-			      statp->bs_ino);
+			     "inomap inconsistency ino %llu: "
+			     "MAP_DIR_NOCHNG but is non-dir: skipping\n",
+			     statp->bs_ino);
 		}
 		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		mlog(MLOG_DEBUG, "skip as ino %llu is not marked as changed in inomap\n",
-			statp->bs_ino);
+		     statp->bs_ino);
 		mlog(MLOG_DEBUG, "ino %llu is in state %d\n",
-			statp->bs_ino, state);
+		     statp->bs_ino, state);
 		return RV_OK;
 	}
 
@@ -4027,14 +4027,14 @@ dump_file(void *arg1,
 	 */
 	if (state == MAP_DIR_CHANGE || state == MAP_DIR_SUPPRT) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "inomap inconsistency ino %llu: "
-		      "%s but is now non-dir: NOT dumping\n"),
-		      statp->bs_ino,
-		      state == MAP_DIR_CHANGE
-		      ?
-		      "map says changed dir"
-		      :
-		      "map says unchanged dir");
+			     "inomap inconsistency ino %llu: "
+			     "%s but is now non-dir: NOT dumping\n"),
+		     statp->bs_ino,
+		     state == MAP_DIR_CHANGE
+		     ?
+		     "map says changed dir"
+		     :
+		     "map says unchanged dir");
 	}
 
 	/*
@@ -4046,9 +4046,9 @@ dump_file(void *arg1,
 	if (hsm_fs_ctxtp) {
 		if (HsmInitFileContext(contextp->cc_hsm_f_ctxtp, statp)) {
 			mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      "inomap inconsistency ino %llu: "
-			      "hsm detected error: NOT dumping\n"),
-			      statp->bs_ino);
+				     "inomap inconsistency ino %llu: "
+				     "hsm detected error: NOT dumping\n"),
+			     statp->bs_ino);
 			if (statp->bs_ino > contextp->cc_stat_lastino) {
 				contextp->cc_stat_lastino = statp->bs_ino;
 			}
@@ -4083,20 +4083,20 @@ dump_file(void *arg1,
 
 			/* quota files are exempt from max size check */
 			if (estimated_size > maxdumpfilesize &&
-			    !is_quota_file(statp->bs_ino)) {
+			    ! is_quota_file(statp->bs_ino)) {
 				mlog(MLOG_DEBUG | MLOG_NOTE,
-				      "ino %llu increased beyond maximum size: "
-				      "NOT dumping\n",
-				      statp->bs_ino);
+				     "ino %llu increased beyond maximum size: "
+				     "NOT dumping\n",
+				     statp->bs_ino);
 				return RV_OK;
 			}
 		}
 		rv = dump_file_reg(drivep,
-				    contextp,
-				    scwhdrp,
-				    fshandlep,
-				    statp,
-				    &file_skipped);
+				   contextp,
+				   scwhdrp,
+				   fshandlep,
+				   statp,
+				   &file_skipped);
 		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			lock();
 			sc_stat_nondirdone++;
@@ -4129,9 +4129,9 @@ dump_file(void *arg1,
 		 * don't know how to dump these
 		 */
 		mlog(MLOG_VERBOSE, _(
-		      "don't know how to dump ino %llu: mode %08x\n"),
-		      statp->bs_ino,
-		      statp->bs_mode);
+			     "don't know how to dump ino %llu: mode %08x\n"),
+		     statp->bs_ino,
+		     statp->bs_mode);
 		if (statp->bs_ino > contextp->cc_stat_lastino) {
 			lock();
 			sc_stat_nondirdone++;
@@ -4139,19 +4139,19 @@ dump_file(void *arg1,
 			contextp->cc_stat_lastino = statp->bs_ino;
 		}
 		return RV_OK;
-	/*
-	 * not yet implemented
-	case S_IFMNT:
-	 */
+		/*
+		 * not yet implemented
+		   case S_IFMNT:
+		 */
 	}
 
 	if (rv == RV_OK
-	     &&
-	     file_skipped == BOOL_FALSE
-	     &&
-	     sc_dumpextattrpr
-	     &&
-	     (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
+	    &&
+	    file_skipped == BOOL_FALSE
+	    &&
+	    sc_dumpextattrpr
+	    &&
+	    (statp->bs_xflags & XFS_XFLAG_HASATTR)) {
 		rv = dump_extattrs(drivep, contextp, fshandlep, statp);
 	}
 
@@ -4166,12 +4166,12 @@ dump_file(void *arg1,
  * operator requested stop.
  */
 static rv_t
-dump_file_reg(drive_t *drivep,
-	       context_t *contextp,
-	       content_inode_hdr_t *scwhdrp,
-	       jdm_fshandle_t *fshandlep,
-	       xfs_bstat_t *statp,
-	       bool_t *file_skippedp)
+dump_file_reg(drive_t *			drivep,
+	      context_t *		contextp,
+	      content_inode_hdr_t *	scwhdrp,
+	      jdm_fshandle_t *		fshandlep,
+	      xfs_bstat_t *		statp,
+	      bool_t *			file_skippedp)
 {
 	startpt_t *startptp = &scwhdrp->cih_startpt;
 	startpt_t *endptp = &scwhdrp->cih_endpt;
@@ -4179,7 +4179,7 @@ dump_file_reg(drive_t *drivep,
 	bool_t cmpltflg;
 	off64_t offset;
 	off64_t stopoffset;
-	bool_t sosig;	/* stop offset is significant */
+	bool_t sosig;   /* stop offset is significant */
 	off64_t maxextentcnt;
 	rv_t rv;
 
@@ -4213,7 +4213,7 @@ dump_file_reg(drive_t *drivep,
 				register time32_t ctime = statp->bs_ctime.tv_sec;
 				register time32_t ltime = max(mtime, ctime);
 				if (ltime < sc_resumebasetime) {
-					if (rp->dr_begin.sp_offset > offset){
+					if (rp->dr_begin.sp_offset > offset) {
 						offset =rp->dr_begin.sp_offset;
 					}
 				}
@@ -4239,14 +4239,14 @@ dump_file_reg(drive_t *drivep,
 	}
 
 	mlog(MLOG_TRACE,
-	      "dumping regular file ino %llu "
-	      "offset %lld "
-	      "to offset %lld "
-	      "(size %lld)\n",
-	      statp->bs_ino,
-	      offset,
-	      sosig ? stopoffset : statp->bs_size,
-	      statp->bs_size);
+	     "dumping regular file ino %llu "
+	     "offset %lld "
+	     "to offset %lld "
+	     "(size %lld)\n",
+	     statp->bs_ino,
+	     offset,
+	     sosig ? stopoffset : statp->bs_size,
+	     statp->bs_size);
 
 	/*
 	 * calculate the maximum extent group size. files larger than this
@@ -4260,15 +4260,15 @@ dump_file_reg(drive_t *drivep,
 	 * pretending the dump succeeded.
 	 */
 	rv = init_extent_group_context(fshandlep,
-					statp,
-					&extent_group_context);
+				       statp,
+				       &extent_group_context);
 	if (rv != RV_OK) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "could not open regular file ino %llu mode 0x%08x: "
-		      "%s: not dumped\n"),
-		      statp->bs_ino,
-		      statp->bs_mode,
-		      strerror(errno));
+			     "could not open regular file ino %llu mode 0x%08x: "
+			     "%s: not dumped\n"),
+		     statp->bs_ino,
+		     statp->bs_mode,
+		     strerror(errno));
 		*file_skippedp = BOOL_TRUE;
 		return RV_OK;
 	}
@@ -4309,7 +4309,7 @@ dump_file_reg(drive_t *drivep,
 		 * spoof EOF if the media file size is getting too big.
 		 * note that the most we can go over is d_recmarksep.
 		 */
-		if (contextp->cc_mfilesz >= drivep->d_recmfilesz){
+		if (contextp->cc_mfilesz >= drivep->d_recmfilesz) {
 			rv = RV_EOF;
 			break;
 		}
@@ -4319,9 +4319,9 @@ dump_file_reg(drive_t *drivep,
 		 */
 		if (cldmgr_stop_requested()) {
 			mlog(MLOG_NORMAL, _(
-			      "dump interrupted prior to ino %llu offset %lld\n"),
-			      statp->bs_ino,
-			      offset);
+				     "dump interrupted prior to ino %llu offset %lld\n"),
+			     statp->bs_ino,
+			     offset);
 			mlog_exit_hint(RV_INTR);
 			rv = RV_INTR;
 			break;
@@ -4331,9 +4331,9 @@ dump_file_reg(drive_t *drivep,
 		 * dump the file header
 		 */
 		mlog(MLOG_DEBUG,
-		      "dumping extent group ino %llu offset %lld\n",
-		      statp->bs_ino,
-		      offset);
+		     "dumping extent group ino %llu offset %lld\n",
+		     statp->bs_ino,
+		     offset);
 		rv = dump_filehdr(drivep, contextp, statp, offset, 0);
 		if (rv != RV_OK) {
 			break;
@@ -4349,15 +4349,15 @@ dump_file_reg(drive_t *drivep,
 		 */
 		bc = 0; /* for lint */
 		rv = dump_extent_group(drivep,
-					contextp,
-					statp,
-					&extent_group_context,
-					maxextentcnt,
-					stopoffset,
-					sosig,
-					&offset,
-					&bc,
-					&cmpltflg);
+				       contextp,
+				       statp,
+				       &extent_group_context,
+				       maxextentcnt,
+				       stopoffset,
+				       sosig,
+				       &offset,
+				       &bc,
+				       &cmpltflg);
 		assert(bc >= 0);
 		bytecnt += bc;
 		if (rv != RV_OK) {
@@ -4377,11 +4377,11 @@ dump_file_reg(drive_t *drivep,
 		 * end of the file.
 		 */
 		rv = dump_extenthdr(drivep,
-				     contextp,
-				     EXTENTHDR_TYPE_LAST,
-				     0,
-				     0,
-				     0);
+				    contextp,
+				    EXTENTHDR_TYPE_LAST,
+				    0,
+				    0,
+				    0);
 		if (rv != RV_OK) {
 			break;
 		}
@@ -4404,18 +4404,18 @@ dump_file_reg(drive_t *drivep,
  * appends a variable-length string after the filehdr_t.
  */
 static rv_t
-dump_file_spec(drive_t *drivep,
-		context_t *contextp,
-		jdm_fshandle_t *fshandlep,
-		xfs_bstat_t *statp)
+dump_file_spec(drive_t *	drivep,
+	       context_t *	contextp,
+	       jdm_fshandle_t * fshandlep,
+	       xfs_bstat_t *	statp)
 {
 	int rval;
 	rv_t rv;
 
 	mlog(MLOG_TRACE,
-	      "dumping special file ino %llu mode 0x%04x\n",
-	      statp->bs_ino,
-	      statp->bs_mode);
+	     "dumping special file ino %llu mode 0x%04x\n",
+	     statp->bs_ino,
+	     statp->bs_mode);
 
 	/*
 	 * set a mark - important to do this now, before deciding
@@ -4454,13 +4454,13 @@ dump_file_spec(drive_t *drivep,
 		 * the bytes.
 		 */
 		nread = jdm_readlink(fshandlep,
-				      statp,
-				      contextp->cc_readlinkbufp,
-				      contextp->cc_readlinkbufsz);
+				     statp,
+				     contextp->cc_readlinkbufp,
+				     contextp->cc_readlinkbufsz);
 		if (nread < 0) {
 			mlog(MLOG_DEBUG,
-			      "could not read symlink ino %llu\n",
-			      statp->bs_ino);
+			     "could not read symlink ino %llu\n",
+			     statp->bs_ino);
 			nread = 0;
 		}
 
@@ -4476,18 +4476,18 @@ dump_file_spec(drive_t *drivep,
 		 */
 		extentsz = ((size_t)nread + 1 + (SYMLINK_ALIGN - 1))
 			   &
-			   ~ (SYMLINK_ALIGN - 1);
+			   ~(SYMLINK_ALIGN - 1);
 		assert(extentsz <= contextp->cc_readlinkbufsz);
 
 		/*
 		 * dump an extent header
 		 */
 		rv = dump_extenthdr(drivep,
-				     contextp,
-				     EXTENTHDR_TYPE_DATA,
-				     0,
-				     0,
-				     (off64_t)extentsz);
+				    contextp,
+				    EXTENTHDR_TYPE_DATA,
+				    0,
+				    0,
+				    (off64_t)extentsz);
 		if (rv != RV_OK) {
 			return rv;
 		}
@@ -4496,10 +4496,10 @@ dump_file_spec(drive_t *drivep,
 		 * dump the link path extent
 		 */
 		rval = write_buf(contextp->cc_readlinkbufp,
-				  extentsz,
-				  (void *)drivep,
-				  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
-				  (wfp_t)drivep->d_opsp->do_write);
+				 extentsz,
+				 (void *)drivep,
+				 (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+				 (wfp_t)drivep->d_opsp->do_write);
 		switch (rval) {
 		case 0:
 			rv = RV_OK;
@@ -4530,9 +4530,9 @@ dump_file_spec(drive_t *drivep,
  * does anything else.
  */
 static rv_t
-init_extent_group_context(jdm_fshandle_t *fshandlep,
-			   xfs_bstat_t *statp,
-			   extent_group_context_t *gcp)
+init_extent_group_context(jdm_fshandle_t *		fshandlep,
+			  xfs_bstat_t *			statp,
+			  extent_group_context_t *	gcp)
 {
 	bool_t isrealtime;
 	int oflags;
@@ -4564,15 +4564,15 @@ init_extent_group_context(jdm_fshandle_t *fshandlep,
 	 * after this check but before all reads have completed.
 	 * This change just closes the window a bit.
 	 */
-	if ((statp->bs_mode & S_ISGID) && (! (statp->bs_mode&S_IXOTH)) ) {
+	if ((statp->bs_mode & S_ISGID) && (!(statp->bs_mode&S_IXOTH)) ) {
 		fl.l_type = F_RDLCK;
 		fl.l_whence = SEEK_SET;
 		fl.l_start = (off_t)0;
 		fl.l_len = 0;
 		if ((fcntl(gcp->eg_fd, F_GETLK, &fl)) < 0) {
 			mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      "locking check failed ino %llu\n"),
-			      statp->bs_ino);
+				     "locking check failed ino %llu\n"),
+			     statp->bs_ino);
 			close(gcp->eg_fd);
 			return RV_ERROR;
 		}
@@ -4593,24 +4593,24 @@ cleanup_extent_group_context(extent_group_context_t *gcp)
 }
 
 static rv_t
-dump_extent_group(drive_t *drivep,
-		   context_t *contextp,
-		   xfs_bstat_t *statp,
-		   extent_group_context_t *gcp,
-		   off64_t maxcnt,
-		   off64_t stopoffset,
-		   bool_t sosig,
-		   off64_t *nextoffsetp,
-		   off64_t *bytecntp,
-		   bool_t *cmpltflgp)
+dump_extent_group(drive_t *			drivep,
+		  context_t *			contextp,
+		  xfs_bstat_t *			statp,
+		  extent_group_context_t *	gcp,
+		  off64_t			maxcnt,
+		  off64_t			stopoffset,
+		  bool_t			sosig,
+		  off64_t *			nextoffsetp,
+		  off64_t *			bytecntp,
+		  bool_t *			cmpltflgp)
 {
 	struct dioattr da;
 	drive_ops_t *dop = drivep->d_opsp;
 	bool_t isrealtime = (bool_t)(statp->bs_xflags
-					&
-					XFS_XFLAG_REALTIME);
+				     &
+				     XFS_XFLAG_REALTIME);
 	off64_t nextoffset;
-	off64_t bytecnt;	/* accumulates total bytes sent to media */
+	off64_t bytecnt;        /* accumulates total bytes sent to media */
 	int rval;
 	rv_t rv;
 
@@ -4620,8 +4620,8 @@ dump_extent_group(drive_t *drivep,
 	if (isrealtime) {
 		if ((ioctl(gcp->eg_fd, XFS_IOC_DIOINFO, &da) < 0)) {
 			mlog(MLOG_NORMAL | MLOG_WARNING, _(
-			      "dioinfo failed ino %llu\n"),
-			      statp->bs_ino);
+				     "dioinfo failed ino %llu\n"),
+			     statp->bs_ino);
 			da.d_miniosz = PGSZ;
 		}
 	}
@@ -4642,7 +4642,7 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (sosig && nextoffset >= stopoffset) {
 			mlog(MLOG_NITTY,
-			      "dumped to stop offset\n");
+			     "dumped to stop offset\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4654,7 +4654,7 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (nextoffset >= statp->bs_size) {
 			mlog(MLOG_NITTY,
-			      "dumped to end of file\n");
+			     "dumped to end of file\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4668,7 +4668,7 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (bytecnt >= maxcnt) {
 			mlog(MLOG_NITTY,
-			      "reached per-extent group byte count\n");
+			     "reached per-extent group byte count\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_FALSE;
@@ -4688,21 +4688,21 @@ dump_extent_group(drive_t *drivep,
 			 * get a new extent block
 			 */
 			mlog(MLOG_NITTY,
-			      "calling getbmapx for ino %llu\n",
-			      statp->bs_ino);
+			     "calling getbmapx for ino %llu\n",
+			     statp->bs_ino);
 			rval = ioctl(gcp->eg_fd, XFS_IOC_GETBMAPX, gcp->eg_bmap);
 			gcp->eg_gbmcnt++;
 			entrycnt = gcp->eg_bmap[0].bmv_entries;
 			if (entrycnt < 0) { /* workaround for getbmap bug */
 				mlog(MLOG_DEBUG | MLOG_WARNING, _(
-				      "getbmapx %d ino %lld mode 0x%08x "
-				      "offset %lld ix %d "
-				      "returns negative entry count\n"),
-				      gcp->eg_gbmcnt,
-				      statp->bs_ino,
-				      statp->bs_mode,
-				      nextoffset,
-				      gcp->eg_bmapix);
+					     "getbmapx %d ino %lld mode 0x%08x "
+					     "offset %lld ix %d "
+					     "returns negative entry count\n"),
+				     gcp->eg_gbmcnt,
+				     statp->bs_ino,
+				     statp->bs_mode,
+				     nextoffset,
+				     gcp->eg_bmapix);
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
@@ -4710,13 +4710,13 @@ dump_extent_group(drive_t *drivep,
 			}
 			if (rval) {
 				mlog(MLOG_NORMAL | MLOG_WARNING, _(
-				      "getbmapx %d ino %lld mode 0x%08x "
-				      "offset %lld failed: %s\n"),
-				      gcp->eg_gbmcnt,
-				      statp->bs_ino,
-				      statp->bs_mode,
-				      nextoffset,
-				      strerror(errno));
+					     "getbmapx %d ino %lld mode 0x%08x "
+					     "offset %lld failed: %s\n"),
+				     gcp->eg_gbmcnt,
+				     statp->bs_ino,
+				     statp->bs_mode,
+				     nextoffset,
+				     strerror(errno));
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
@@ -4730,12 +4730,12 @@ dump_extent_group(drive_t *drivep,
 			 */
 
 			if (hsm_fs_ctxtp) {
-				if (!HsmModifyExtentMap(contextp->cc_hsm_f_ctxtp,
-					&gcp->eg_bmap[0])) {
+				if (! HsmModifyExtentMap(contextp->cc_hsm_f_ctxtp,
+							&gcp->eg_bmap[0])) {
 					mlog(MLOG_NORMAL | MLOG_WARNING, _(
-						"hsm detected an extent map "
-						"error in ino %lld, skipping\n"),
-						statp->bs_ino);
+						     "hsm detected an extent map "
+						     "error in ino %lld, skipping\n"),
+					     statp->bs_ino);
 					*nextoffsetp = nextoffset;
 					*bytecntp = bytecnt;
 					*cmpltflgp = BOOL_TRUE;
@@ -4746,7 +4746,7 @@ dump_extent_group(drive_t *drivep,
 
 			if (entrycnt <= 0) {
 				mlog(MLOG_NITTY,
-				      "all extent groups dumped\n");
+				     "all extent groups dumped\n");
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
 				*cmpltflgp = BOOL_TRUE;
@@ -4755,17 +4755,17 @@ dump_extent_group(drive_t *drivep,
 			gcp->eg_nextbmapp = &gcp->eg_bmap[1];
 			gcp->eg_endbmapp = &gcp->eg_bmap[entrycnt + 1];
 			mlog(MLOG_NITTY,
-			      "getbmapx supplied %d extent entries\n",
-			      entrycnt);
+			     "getbmapx supplied %d extent entries\n",
+			     entrycnt);
 		}
 
 		mlog(MLOG_NITTY,
-		      "bmap entry %d ix %d block %lld offset %lld length %lld\n",
-		      gcp->eg_nextbmapp - &gcp->eg_bmap[0],
-		      gcp->eg_bmapix,
-		      gcp->eg_nextbmapp->bmv_block,
-		      gcp->eg_nextbmapp->bmv_offset,
-		      gcp->eg_nextbmapp->bmv_length);
+		     "bmap entry %d ix %d block %lld offset %lld length %lld\n",
+		     gcp->eg_nextbmapp - &gcp->eg_bmap[0],
+		     gcp->eg_bmapix,
+		     gcp->eg_nextbmapp->bmv_block,
+		     gcp->eg_nextbmapp->bmv_offset,
+		     gcp->eg_nextbmapp->bmv_length);
 
 		/*
 		 * if the next bmap entry represents a hole, go to the next
@@ -4780,24 +4780,24 @@ dump_extent_group(drive_t *drivep,
 			 * entry
 			 */
 			offset = gcp->eg_nextbmapp->bmv_offset
-					* (off64_t)BBSIZE;
-			extsz  = gcp->eg_nextbmapp->bmv_length
-					* (off64_t)BBSIZE;
+				 * (off64_t)BBSIZE;
+			extsz = gcp->eg_nextbmapp->bmv_length
+				* (off64_t)BBSIZE;
 
 			mlog(MLOG_NITTY,
-			      "hole extent offset = %lld size = %lld\n",
-			      offset, extsz);
+			     "hole extent offset = %lld size = %lld\n",
+			     offset, extsz);
 
 			/*
 			 * Encode the hole - dump the extent header
 			 * with the right extent type.
 			 */
 			rv = dump_extenthdr(drivep,
-					     contextp,
-					     EXTENTHDR_TYPE_HOLE,
-					     0,
-					     offset,
-					     extsz);
+					    contextp,
+					    EXTENTHDR_TYPE_HOLE,
+					    0,
+					    offset,
+					    extsz);
 			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
@@ -4807,8 +4807,8 @@ dump_extent_group(drive_t *drivep,
 			bytecnt += sizeof(extenthdr_t);
 
 			tmpoffset = (gcp->eg_nextbmapp->bmv_offset
-				      +
-				      gcp->eg_nextbmapp->bmv_length)
+				     +
+				     gcp->eg_nextbmapp->bmv_length)
 				    *
 				    (off64_t)BBSIZE;
 			if (tmpoffset > nextoffset) {
@@ -4827,7 +4827,7 @@ dump_extent_group(drive_t *drivep,
 			off64_t tmpoffset;
 
 			mlog(MLOG_NITTY,
-			      "non-positive extent\n");
+			     "non-positive extent\n");
 			tmpoffset = gcp->eg_nextbmapp->bmv_offset
 				    *
 				    (off64_t)BBSIZE;
@@ -4846,10 +4846,10 @@ dump_extent_group(drive_t *drivep,
 		offset = gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE;
 		extsz = gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE;
 		mlog(MLOG_NITTY,
-		      "extent offset %lld sz %lld; nextoffset %lld\n",
-		      offset,
-		      extsz,
-		      nextoffset);
+		     "extent offset %lld sz %lld; nextoffset %lld\n",
+		     offset,
+		     extsz,
+		     nextoffset);
 
 		/*
 		 * if the new bmap entry begins below the stop offset
@@ -4859,7 +4859,7 @@ dump_extent_group(drive_t *drivep,
 		if (! sosig || offset < stopoffset) {
 			if (offset + extsz <= nextoffset) {
 				mlog(MLOG_NITTY,
-				      "extent ends before nextoffset\n");
+				     "extent ends before nextoffset\n");
 				gcp->eg_nextbmapp++;
 				gcp->eg_bmapix++;
 				continue;
@@ -4872,7 +4872,7 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (offset >= statp->bs_size) {
 			mlog(MLOG_NITTY,
-			      "extent beyond end of file\n");
+			     "extent beyond end of file\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4885,7 +4885,7 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (sosig && offset >= stopoffset) {
 			mlog(MLOG_NITTY,
-			      "extent beyond stop offset\n");
+			     "extent beyond stop offset\n");
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			*cmpltflgp = BOOL_TRUE;
@@ -4902,11 +4902,11 @@ dump_extent_group(drive_t *drivep,
 			extsz -= nextoffset - offset;
 			offset = nextoffset;
 			mlog(MLOG_NITTY,
-			      "adjusted bottom of extent to nextoffset: "
-			      "offset %lld, sz %lld; nextoffset %lld\n",
-			      offset,
-			      extsz,
-			      nextoffset);
+			     "adjusted bottom of extent to nextoffset: "
+			     "offset %lld, sz %lld; nextoffset %lld\n",
+			     offset,
+			     extsz,
+			     nextoffset);
 		}
 		assert(extsz > 0);
 
@@ -4927,13 +4927,13 @@ dump_extent_group(drive_t *drivep,
 				&
 				~(off64_t)(iosz - 1);
 			mlog(MLOG_NITTY,
-			      "adjusted top of extent to honor maxcnt "
-			      "(rounded up %d): "
-			      "offset %lld, sz %lld; maxcnt %lld\n",
-			      iosz,
-			      offset,
-			      extsz,
-			      maxcnt);
+			     "adjusted top of extent to honor maxcnt "
+			     "(rounded up %d): "
+			     "offset %lld, sz %lld; maxcnt %lld\n",
+			     iosz,
+			     offset,
+			     extsz,
+			     maxcnt);
 		}
 
 		/*
@@ -4944,16 +4944,16 @@ dump_extent_group(drive_t *drivep,
 		 */
 		if (extsz <= 0) {
 			mlog(MLOG_NITTY,
-			      "adjusted extent size is non-positive: "
-			      "%lld (bs_size %lld)\n",
-			      extsz,
-			      statp->bs_size);
+			     "adjusted extent size is non-positive: "
+			     "%lld (bs_size %lld)\n",
+			     extsz,
+			     statp->bs_size);
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
 			if (statp->bs_size == 0) {
-			    *cmpltflgp = BOOL_TRUE;
+				*cmpltflgp = BOOL_TRUE;
 			} else {
-			    *cmpltflgp = BOOL_FALSE;
+				*cmpltflgp = BOOL_FALSE;
 			}
 			return RV_OK;
 		}
@@ -4976,13 +4976,13 @@ dump_extent_group(drive_t *drivep,
 				&
 				~(off64_t)(iosz - 1);
 			mlog(MLOG_NITTY,
-			      "adjusted top of extent to match file size "
-			      "(rounded up %d): "
-			      "offset %lld, sz %lld; bs_size %lld\n",
-			      iosz,
-			      offset,
-			      extsz,
-			      statp->bs_size);
+			     "adjusted top of extent to match file size "
+			     "(rounded up %d): "
+			     "offset %lld, sz %lld; bs_size %lld\n",
+			     iosz,
+			     offset,
+			     extsz,
+			     statp->bs_size);
 		}
 
 		/*
@@ -4992,14 +4992,14 @@ dump_extent_group(drive_t *drivep,
 		if (sosig && (extsz > stopoffset - offset)) {
 			extsz = stopoffset - offset;
 			assert(extsz >= 0);
-			assert(! (extsz & (off64_t)(BBSIZE - 1)));
+			assert(!(extsz & (off64_t)(BBSIZE - 1)));
 			mlog(MLOG_NITTY,
-			      "adjusted top of extent "
-			      "to adhere to stop offset: "
-			      "offset %lld, sz %lld; bs_size %lld\n",
-			      offset,
-			      extsz,
-			      statp->bs_size);
+			     "adjusted top of extent "
+			     "to adhere to stop offset: "
+			     "offset %lld, sz %lld; bs_size %lld\n",
+			     offset,
+			     extsz,
+			     statp->bs_size);
 		}
 
 		/*
@@ -5021,14 +5021,14 @@ dump_extent_group(drive_t *drivep,
 			cnt_to_align -= sizeof(extenthdr_t);
 
 			rv = dump_extenthdr(drivep,
-					     contextp,
-					     EXTENTHDR_TYPE_ALIGN,
-					     0,
-					     0,
-					     (off64_t)
-					     ((size_t)cnt_to_align
-					       -
-					       sizeof(extenthdr_t)));
+					    contextp,
+					    EXTENTHDR_TYPE_ALIGN,
+					    0,
+					    0,
+					    (off64_t)
+					    ((size_t)cnt_to_align
+					     -
+					     sizeof(extenthdr_t)));
 			if (rv != RV_OK) {
 				*nextoffsetp = nextoffset;
 				*bytecntp = bytecnt;
@@ -5057,11 +5057,11 @@ dump_extent_group(drive_t *drivep,
 		 * dump the extent header
 		 */
 		rv = dump_extenthdr(drivep,
-				     contextp,
-				     EXTENTHDR_TYPE_DATA,
-				     0,
-				     offset,
-				     extsz);
+				    contextp,
+				    EXTENTHDR_TYPE_DATA,
+				    0,
+				    offset,
+				    extsz);
 		if (rv != RV_OK) {
 			*nextoffsetp = nextoffset;
 			*bytecntp = bytecnt;
@@ -5088,14 +5088,14 @@ dump_extent_group(drive_t *drivep,
 				:
 				(size_t)extsz;
 			bufp = (*dop->do_get_write_buf)(drivep,
-							    reqsz,
-							    &actualsz);
+							reqsz,
+							&actualsz);
 			assert(actualsz <= reqsz);
 			new_off = lseek64(gcp->eg_fd, offset, SEEK_SET);
 			if (new_off == (off64_t)(-1)) {
 				mlog(MLOG_NORMAL, _(
-				      "can't lseek ino %llu\n"),
-				      statp->bs_ino);
+					     "can't lseek ino %llu\n"),
+				     statp->bs_ino);
 				nread = 0;
 			} else {
 				nread = read(gcp->eg_fd, bufp, actualsz);
@@ -5104,23 +5104,23 @@ dump_extent_group(drive_t *drivep,
 #ifdef HIDDEN
 				struct statvfs64 s;
 
- 				/* Be quiet if this is a swap file - #510197 */
+				/* Be quiet if this is a swap file - #510197 */
 				if ((fstatvfs64(gcp->eg_fd, &s) < 0) ||
-				     ((s.f_flag & ST_LOCAL) != 0))
-				   mlog(MLOG_NORMAL, _(
-		"can't read ino %llu at offset %d (act=%d req=%d) rt=%d\n"),
-		statp->bs_ino, new_off, actualsz, reqsz, isrealtime);
+				    ((s.f_flag & ST_LOCAL) != 0))
+					mlog(MLOG_NORMAL, _(
+						     "can't read ino %llu at offset %d (act=%d req=%d) rt=%d\n"),
+					     statp->bs_ino, new_off, actualsz, reqsz, isrealtime);
 #endif /* HIDDEN */
 
 				nread = 0;
 			}
 			assert((size_t)nread <= actualsz);
 			mlog(MLOG_NITTY,
-			      "read ino %llu offset %lld sz %d actual %d\n",
-			      statp->bs_ino,
-			      offset,
-			      actualsz,
-			      nread);
+			     "read ino %llu offset %lld sz %d actual %d\n",
+			     statp->bs_ino,
+			     offset,
+			     actualsz,
+			     nread);
 
 			/*
 			 * must return entire buffer supplied by call to
@@ -5130,13 +5130,13 @@ dump_extent_group(drive_t *drivep,
 			 */
 			if ((size_t)nread < actualsz) {
 				memset((void *)(bufp + nread),
-					0,
-					actualsz - (size_t)nread);
+				       0,
+				       actualsz - (size_t)nread);
 			}
 
 			rval = (*dop->do_write)(drivep,
-						    bufp,
-						    actualsz);
+						bufp,
+						actualsz);
 			switch (rval) {
 			case 0:
 				rv = RV_OK;
@@ -5170,8 +5170,8 @@ dump_extent_group(drive_t *drivep,
 			 */
 			if ((size_t)nread < actualsz) {
 				mlog(MLOG_NITTY,
-				      "padding remaind %lld bytes of extent\n",
-				      extsz);
+				     "padding remaind %lld bytes of extent\n",
+				     extsz);
 				while (extsz) {
 					reqsz = extsz > (off64_t)INTGENMAX
 						?
@@ -5179,7 +5179,7 @@ dump_extent_group(drive_t *drivep,
 						:
 						(size_t)extsz;
 					rv = write_pad(drivep,
-							(size_t)reqsz);
+						       (size_t)reqsz);
 					if (rv != RV_OK) {
 						*nextoffsetp = nextoffset;
 						*bytecntp = bytecnt;
@@ -5200,12 +5200,12 @@ dump_extent_group(drive_t *drivep,
 		 * !!! top of the loop.
 		 */
 		if (nextoffset
-		     >=
-		     gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE
-		     +
-		     gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE) {
+		    >=
+		    gcp->eg_nextbmapp->bmv_offset * (off64_t)BBSIZE
+		    +
+		    gcp->eg_nextbmapp->bmv_length * (off64_t)BBSIZE) {
 			mlog(MLOG_NITTY,
-			      "advancing to next extent in bmap\n");
+			     "advancing to next extent in bmap\n");
 			gcp->eg_nextbmapp++;
 			gcp->eg_bmapix++;
 		}
@@ -5244,11 +5244,11 @@ copy_xfs_bstat(bstat_t *dst, xfs_bstat_t *src)
 }
 
 static rv_t
-dump_filehdr(drive_t *drivep,
-	      context_t *contextp,
-	      xfs_bstat_t *statp,
-	      off64_t offset,
-	      int flags)
+dump_filehdr(drive_t *		drivep,
+	     context_t *	contextp,
+	     xfs_bstat_t *	statp,
+	     off64_t		offset,
+	     int		flags)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register filehdr_t *fhdrp = contextp->cc_filehdrp;
@@ -5269,10 +5269,10 @@ dump_filehdr(drive_t *drivep,
 
 	xlate_filehdr(fhdrp, &tmpfhdrp, 1);
 	rval = write_buf((char *)&tmpfhdrp,
-			  sizeof(tmpfhdrp),
-			  (void *)drivep,
-			  (gwbfp_t)dop->do_get_write_buf,
-			  (wfp_t)dop->do_write);
+			 sizeof(tmpfhdrp),
+			 (void *)drivep,
+			 (gwbfp_t)dop->do_get_write_buf,
+			 (wfp_t)dop->do_write);
 
 	switch (rval) {
 	case 0:
@@ -5295,12 +5295,12 @@ dump_filehdr(drive_t *drivep,
 }
 
 static rv_t
-dump_extenthdr(drive_t *drivep,
-		context_t *contextp,
-		int32_t type,
-		int32_t flags,
-		off64_t offset,
-		off64_t sz)
+dump_extenthdr(drive_t *	drivep,
+	       context_t *	contextp,
+	       int32_t		type,
+	       int32_t		flags,
+	       off64_t		offset,
+	       off64_t		sz)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register extenthdr_t *ehdrp = contextp->cc_extenthdrp;
@@ -5310,27 +5310,27 @@ dump_extenthdr(drive_t *drivep,
 	char typestr[20];
 
 	switch (type)  {
-		case EXTENTHDR_TYPE_LAST:
-			strcpy(typestr, "LAST");
-			break;
-		case EXTENTHDR_TYPE_ALIGN:
-			strcpy(typestr, "ALIGN");
-			break;
-		case EXTENTHDR_TYPE_DATA:
-			strcpy(typestr, "DATA");
-			break;
-		case EXTENTHDR_TYPE_HOLE:
-			strcpy(typestr, "HOLE");
-			break;
-		default:
-			strcpy(typestr, "UNKNOWN");
+	case EXTENTHDR_TYPE_LAST:
+		strcpy(typestr, "LAST");
+		break;
+	case EXTENTHDR_TYPE_ALIGN:
+		strcpy(typestr, "ALIGN");
+		break;
+	case EXTENTHDR_TYPE_DATA:
+		strcpy(typestr, "DATA");
+		break;
+	case EXTENTHDR_TYPE_HOLE:
+		strcpy(typestr, "HOLE");
+		break;
+	default:
+		strcpy(typestr, "UNKNOWN");
 	}
 
 	mlog(MLOG_DEBUG,
-	      "dumping extent type = %s offset = %lld size = %lld\n",
-	      typestr,
-	      offset,
-	       sz);
+	     "dumping extent type = %s offset = %lld size = %lld\n",
+	     typestr,
+	     offset,
+	     sz);
 
 	(void)memset((void *)ehdrp, 0, sizeof(*ehdrp));
 	ehdrp->eh_type = type;
@@ -5341,10 +5341,10 @@ dump_extenthdr(drive_t *drivep,
 
 	xlate_extenthdr(ehdrp, &tmpehdrp, 1);
 	rval = write_buf((char *)&tmpehdrp,
-			  sizeof(tmpehdrp),
-			  (void *)drivep,
-			  (gwbfp_t)dop->do_get_write_buf,
-			  (wfp_t)dop->do_write);
+			 sizeof(tmpehdrp),
+			 (void *)drivep,
+			 (gwbfp_t)dop->do_get_write_buf,
+			 (wfp_t)dop->do_write);
 
 	switch (rval) {
 	case 0:
@@ -5367,13 +5367,13 @@ dump_extenthdr(drive_t *drivep,
 }
 
 static rv_t
-dump_dirent(drive_t *drivep,
-	     context_t *contextp,
-	     xfs_bstat_t *statp,
-	     xfs_ino_t ino,
-	     gen_t gen,
-	     char *name,
-	     size_t namelen)
+dump_dirent(drive_t *		drivep,
+	    context_t *		contextp,
+	    xfs_bstat_t *	statp,
+	    xfs_ino_t		ino,
+	    gen_t		gen,
+	    char *		name,
+	    size_t		namelen)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	char *outbufp;
@@ -5400,12 +5400,12 @@ dump_dirent(drive_t *drivep,
 
 	if (sz > direntbufsz) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "unable to dump "
-		      "directory %llu entry %s (%llu): "
-		      "name too long\n"),
-		      statp->bs_ino,
-		      name,
-		      ino);
+			     "unable to dump "
+			     "directory %llu entry %s (%llu): "
+			     "name too long\n"),
+		     statp->bs_ino,
+		     name,
+		     ino);
 		mlog_exit_hint(RV_INCOMPLETE);
 		return RV_OK;
 	}
@@ -5454,10 +5454,10 @@ dump_dirent(drive_t *drivep,
 	}
 
 	rval = write_buf(outbufp,
-			  sz,
-			  (void *)drivep,
-			  (gwbfp_t)dop->do_get_write_buf,
-			  (wfp_t)dop->do_write);
+			 sz,
+			 (void *)drivep,
+			 (gwbfp_t)dop->do_get_write_buf,
+			 (wfp_t)dop->do_write);
 	free(outbufp);
 	switch (rval) {
 	case 0:
@@ -5480,10 +5480,10 @@ dump_dirent(drive_t *drivep,
 }
 
 static bool_t
-dump_session_inv(drive_t *drivep,
-		  context_t *contextp,
-		  media_hdr_t *mwhdrp,
-		  content_inode_hdr_t *scwhdrp)
+dump_session_inv(drive_t *		drivep,
+		 context_t *		contextp,
+		 media_hdr_t *		mwhdrp,
+		 content_inode_hdr_t *	scwhdrp)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	ix_t strmix = drivep->d_index;
@@ -5502,7 +5502,7 @@ dump_session_inv(drive_t *drivep,
 	}
 
 	mlog(MLOG_VERBOSE, _(
-	      "dumping session inventory\n"));
+		     "dumping session inventory\n"));
 
 	/*
 	 * get a buffer from the inventory manager
@@ -5512,7 +5512,7 @@ dump_session_inv(drive_t *drivep,
 	ok = inv_get_sessioninfo(sc_inv_sestoken, (void *)&inv_sbufp, &inv_sbufsz);
 	if (! ok) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
-		      "unable to get session inventory to dump\n"));
+			     "unable to get session inventory to dump\n"));
 		return BOOL_TRUE;
 	}
 	assert(inv_sbufp);
@@ -5536,7 +5536,7 @@ dump_session_inv(drive_t *drivep,
 		rv_t rv;
 
 		mlog(MLOG_VERBOSE, _(
-		      "beginning inventory media file\n"));
+			     "beginning inventory media file\n"));
 
 		partial = BOOL_FALSE;
 		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
@@ -5545,14 +5545,14 @@ dump_session_inv(drive_t *drivep,
 			break;
 		case RV_TIMEOUT:
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "media change timeout: "
-			      "session inventory not dumped\n"));
+				     "media change timeout: "
+				     "session inventory not dumped\n"));
 			mlog_exit_hint(RV_INV);
 			return BOOL_FALSE;
 		case RV_QUIT:
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "media change declined: "
-			      "session inventory not dumped\n"));
+				     "media change declined: "
+				     "session inventory not dumped\n"));
 			mlog_exit_hint(RV_INV);
 			return BOOL_FALSE;
 		case RV_DRIVE:
@@ -5563,20 +5563,20 @@ dump_session_inv(drive_t *drivep,
 		}
 
 		mlog(MLOG_VERBOSE, _(
-		      "media file %u (media %u, file %u)\n"),
-		      mwhdrp->mh_dumpfileix,
-		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix);
+			     "media file %u (media %u, file %u)\n"),
+		     mwhdrp->mh_dumpfileix,
+		     mwhdrp->mh_mediaix,
+		     mwhdrp->mh_mediafileix);
 
 		uuid_copy(mediaid, mwhdrp->mh_mediaid);
 		strcpy(medialabel, mwhdrp->mh_medialabel);
 		mediafileix = (int)mwhdrp->mh_mediafileix;
 
 		rval = write_buf(inv_sbufp,
-				  inv_sbufsz,
-				  (void *)drivep,
-				  (gwbfp_t)dop->do_get_write_buf,
-				  (wfp_t)dop->do_write);
+				 inv_sbufsz,
+				 (void *)drivep,
+				 (gwbfp_t)dop->do_get_write_buf,
+				 (wfp_t)dop->do_write);
 		switch (rval) {
 		case 0:
 			break;
@@ -5591,13 +5591,13 @@ dump_session_inv(drive_t *drivep,
 		}
 
 		mlog(MLOG_VERBOSE, _(
-		      "ending inventory media file\n"));
+			     "ending inventory media file\n"));
 		ncommitted = 0;
 		rv = Media_mfile_end(drivep,
-				      contextp,
-				      mwhdrp,
-				      &ncommitted,
-				      partial);
+				     contextp,
+				     mwhdrp,
+				     &ncommitted,
+				     partial);
 		switch (rv) {
 		case RV_OK:
 			break;
@@ -5610,14 +5610,14 @@ dump_session_inv(drive_t *drivep,
 
 		if (partial) {
 			mlog(MLOG_VERBOSE, _(
-			      "encountered EOM while writing "
-			      "inventory media file size %lld bytes\n"),
-			      ncommitted);
+				     "encountered EOM while writing "
+				     "inventory media file size %lld bytes\n"),
+			     ncommitted);
 			mlog_exit_hint(RV_INV);
 		} else {
 			mlog(MLOG_VERBOSE, _(
-			      "inventory media file size %lld bytes\n"),
-			      ncommitted);
+				     "inventory media file size %lld bytes\n"),
+			     ncommitted);
 		}
 		if (sc_inv_stmtokenp) {
 			inv_stmt = sc_inv_stmtokenp[strmix];
@@ -5627,23 +5627,23 @@ dump_session_inv(drive_t *drivep,
 
 		if (inv_stmt != INV_TOKEN_NULL) {
 			mlog(MLOG_DEBUG,
-			      "giving inventory "
-			      "session dump media file\n");
+			     "giving inventory "
+			     "session dump media file\n");
 			ok = inv_put_mediafile(inv_stmt,
-						&mediaid,
-						medialabel,
-						(uint)mediafileix,
-						(xfs_ino_t)0,
-						(off64_t)0,
-						(xfs_ino_t)0,
-						(off64_t)0,
-						ncommitted,
-						! partial,
-						BOOL_TRUE);
+					       &mediaid,
+					       medialabel,
+					       (uint)mediafileix,
+					       (xfs_ino_t)0,
+					       (off64_t)0,
+					       (xfs_ino_t)0,
+					       (off64_t)0,
+					       ncommitted,
+					       ! partial,
+					       BOOL_TRUE);
 			if (! ok) {
 				mlog(MLOG_NORMAL, _(
-				      "inventory session media file "
-				      "put failed\n"));
+					     "inventory session media file "
+					     "put failed\n"));
 				return BOOL_FALSE;
 			}
 		}
@@ -5668,7 +5668,7 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 	}
 
 	mlog(MLOG_VERBOSE, _(
-	      "writing stream terminator\n"));
+		     "writing stream terminator\n"));
 
 	/*
 	 * modify the write header to indicate a terminator
@@ -5685,7 +5685,7 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 		rv_t rv;
 
 		mlog(MLOG_VERBOSE, _(
-		      "beginning media stream terminator\n"));
+			     "beginning media stream terminator\n"));
 
 		partial = BOOL_FALSE;
 		rv = Media_mfile_begin(drivep, contextp, BOOL_FALSE);
@@ -5694,13 +5694,13 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 			break;
 		case RV_TIMEOUT:
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "media change timeout: "
-			      "media stream terminator not written\n"));
+				     "media change timeout: "
+				     "media stream terminator not written\n"));
 			return;
 		case RV_QUIT:
 			mlog(MLOG_VERBOSE | MLOG_WARNING, _(
-			      "media change declined: "
-			      "media stream terminator not written\n"));
+				     "media change declined: "
+				     "media stream terminator not written\n"));
 			return;
 		case RV_DRIVE:
 		case RV_ERROR:
@@ -5710,19 +5710,19 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 		}
 
 		mlog(MLOG_VERBOSE, _(
-		      "media file %u (media %u, file %u)\n"),
-		      mwhdrp->mh_dumpfileix,
-		      mwhdrp->mh_mediaix,
-		      mwhdrp->mh_mediafileix);
+			     "media file %u (media %u, file %u)\n"),
+		     mwhdrp->mh_dumpfileix,
+		     mwhdrp->mh_mediaix,
+		     mwhdrp->mh_mediafileix);
 
 		mlog(MLOG_VERBOSE, _(
-		      "ending media stream terminator\n"));
+			     "ending media stream terminator\n"));
 		ncommitted = 0;
 		rv = Media_mfile_end(drivep,
-				      contextp,
-				      mwhdrp,
-				      &ncommitted,
-				      BOOL_FALSE);
+				     contextp,
+				     mwhdrp,
+				     &ncommitted,
+				     BOOL_FALSE);
 		switch (rv) {
 		case RV_OK:
 			break;
@@ -5735,13 +5735,13 @@ dump_terminator(drive_t *drivep, context_t *contextp, media_hdr_t *mwhdrp)
 
 		if (partial) {
 			mlog(MLOG_VERBOSE, _(
-			      "encountered EOM while writing "
-			      "media stream terminator size %lld bytes\n"),
-			      ncommitted);
+				     "encountered EOM while writing "
+				     "media stream terminator size %lld bytes\n"),
+			     ncommitted);
 		} else {
 			mlog(MLOG_VERBOSE, _(
-			      "media stream terminator size %lld bytes\n"),
-			      ncommitted);
+				     "media stream terminator size %lld bytes\n"),
+			     ncommitted);
 		}
 
 		done = ! partial;
@@ -5756,10 +5756,10 @@ write_pad(drive_t *drivep, size_t sz)
 	rv_t rv;
 
 	rval = write_buf(0,
-			  sz,
-			  (void *)drivep,
-			  (gwbfp_t)dop->do_get_write_buf,
-			  (wfp_t)dop->do_write);
+			 sz,
+			 (void *)drivep,
+			 (gwbfp_t)dop->do_get_write_buf,
+			 (wfp_t)dop->do_write);
 
 	switch (rval) {
 	case 0:
@@ -5792,23 +5792,23 @@ inv_cleanup(void)
 		inv_stmtoken_t *inv_stmtp;
 		context_t *contextp;
 		for (strmix = 0,
-		      inv_stmtp = sc_inv_stmtokenp,
-		      contextp = sc_contextp
+		     inv_stmtp = sc_inv_stmtokenp,
+		     contextp = sc_contextp
 		     ;
-		      strmix < drivecnt
+		     strmix < drivecnt
 		     ;
-		      strmix++,
-		      inv_stmtp++,
-		      contextp++) {
+		     strmix++,
+		     inv_stmtp++,
+		     contextp++) {
 			bool_t interrupted;
 			interrupted = ! contextp->cc_completepr;
 			if (*inv_stmtp == INV_TOKEN_NULL) {
 				continue;
 			}
 			mlog(MLOG_DEBUG,
-			      "closing inventory stream %d%s\n",
-			      strmix,
-			      interrupted ? ": interrupted" : "");
+			     "closing inventory stream %d%s\n",
+			     strmix,
+			     interrupted ? ": interrupted" : "");
 			if (interrupted) mlog_exit_hint(RV_INTR);
 			ok = inv_stream_close(*inv_stmtp, interrupted);
 			assert(ok);
@@ -5861,7 +5861,7 @@ Media_mfile_begin(drive_t *drivep, context_t *contextp, bool_t intr_allowed)
 	assert(BES_INIT == 0);
 
 	mlog(MLOG_DEBUG | MLOG_MEDIA,
-	      "Media op: begin media file\n");
+	     "Media op: begin media file\n");
 
 	/*
 	 * the command line-specified media label is good only for the
@@ -5945,18 +5945,18 @@ position:
 		case 0:
 			mlog_lock();
 			mlog(MLOG_VERBOSE | MLOG_NOLOCK | MLOG_MEDIA, _(
-			      "positioned at media file %u: "
-			      "dump %u, "
-			      "stream %u\n"),
-			      mrhdrp->mh_mediafileix,
-			      mrhdrp->mh_dumpmediaix,
-			      drhdrp->dh_driveix);
+				     "positioned at media file %u: "
+				     "dump %u, "
+				     "stream %u\n"),
+			     mrhdrp->mh_mediafileix,
+			     mrhdrp->mh_dumpmediaix,
+			     drhdrp->dh_driveix);
 			mlog(MLOG_TRACE | MLOG_NOLOCK | MLOG_MEDIA,
-			      "stream media file %u (%u in object), "
-			      "stream media object %d\n",
-			      mrhdrp->mh_dumpfileix,
-			      mrhdrp->mh_dumpmediafileix,
-			      mrhdrp->mh_mediaix);
+			     "stream media file %u (%u in object), "
+			     "stream media object %d\n",
+			     mrhdrp->mh_dumpfileix,
+			     mrhdrp->mh_dumpmediafileix,
+			     mrhdrp->mh_mediaix);
 			mlog_unlock();
 
 			/*
@@ -5982,9 +5982,9 @@ position:
 			(*dop->do_end_read)(drivep);
 
 			switch (Media_erasechk(drivep,
-						dcaps,
-						intr_allowed,
-						prevmediapresentpr)) {
+					       dcaps,
+					       intr_allowed,
+					       prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -5995,20 +5995,20 @@ position:
 
 			if ((int32_t)mwhdrp->mh_mediaix >= 0) {
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "cannot interleave dump streams: "
-				      "must supply a blank media object\n"));
+					     "cannot interleave dump streams: "
+					     "must supply a blank media object\n"));
 				goto changemedia;
 			}
-			if (! (dcaps & DRIVE_CAP_APPEND)) {
+			if (!(dcaps & DRIVE_CAP_APPEND)) {
 				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
-				      "media contains valid xfsdump "
-				      "but does not support append\n"));
+					     "media contains valid xfsdump "
+					     "but does not support append\n"));
 				goto changemedia;
 			}
 			if (MEDIA_TERMINATOR_CHK(mrhdrp)) {
 				int status;
 				mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
-				      "stream terminator found\n"));
+					     "stream terminator found\n"));
 				assert(contextp->cc_Media_useterminatorpr);
 				assert(dcaps & DRIVE_CAP_BSF); /* redundant */
 				status = 0;
@@ -6016,8 +6016,8 @@ position:
 				assert(rval == 0);
 				if (status == DRIVE_ERROR_DEVICE) {
 					mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
-					      "encountered media error "
-					      "attempting BSF\n"));
+						     "encountered media error "
+						     "attempting BSF\n"));
 					goto changemedia;
 				}
 				if (mrhdrp->mh_mediafileix == 0) {
@@ -6030,15 +6030,15 @@ position:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-			      "media contains non-xfsdump data "
-			      "or a corrupt xfsdump media file header "
-			      "at beginning of media\n"));
+				     "media contains non-xfsdump data "
+				     "or a corrupt xfsdump media file header "
+				     "at beginning of media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
 			switch (Media_erasechk(drivep,
-						dcaps,
-						intr_allowed,
-						prevmediapresentpr)) {
+					       dcaps,
+					       intr_allowed,
+					       prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -6058,14 +6058,14 @@ position:
 				}
 			}
 
-			if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+			if (!(dcaps & DRIVE_CAP_OVERWRITE)) {
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "unable to overwrite\n"));
+					     "unable to overwrite\n"));
 				goto changemedia;
 			} else {
 				int status;
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "repositioning to overwrite\n"));
+					     "repositioning to overwrite\n"));
 				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
 				rval = (*dop->do_bsf)(drivep, 0, &status);
@@ -6083,8 +6083,8 @@ position:
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				"media may contain data. "
-				"Overwrite option specified\n"));
+				     "media may contain data. "
+				     "Overwrite option specified\n"));
 
 			if (dlog_allowed()) {
 				bool_t ok;
@@ -6111,15 +6111,15 @@ position:
 			return RV_DRIVE;
 		case DRIVE_ERROR_EOD:
 			mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
-			      "at end of data\n"));
+				     "at end of data\n"));
 			prevmediapresentpr = mediapresentpr;
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 
 			switch (Media_erasechk(drivep,
-						dcaps,
-						intr_allowed,
-						prevmediapresentpr)) {
+					       dcaps,
+					       intr_allowed,
+					       prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -6130,9 +6130,9 @@ position:
 
 			if (contextp->cc_Media_useterminatorpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "encountered EOD but expecting a media "
-				      "stream terminator: "
-				      "assuming full media\n"));
+					     "encountered EOD but expecting a media "
+					     "stream terminator: "
+					     "assuming full media\n"));
 				goto changemedia;
 			} else {
 				goto write;
@@ -6142,12 +6142,12 @@ position:
 			mediapresentpr = BOOL_TRUE;
 			virginmediapr = BOOL_FALSE;
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-			      "encountered EOM: media is full\n"));
+				     "encountered EOM: media is full\n"));
 
 			switch (Media_erasechk(drivep,
-						dcaps,
-						intr_allowed,
-						prevmediapresentpr)) {
+					       dcaps,
+					       intr_allowed,
+					       prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -6165,14 +6165,14 @@ position:
 			virginmediapr = BOOL_FALSE;
 
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-			      "encountered corrupt or foreign data: "
-			      "assuming corrupted media\n"));
+				     "encountered corrupt or foreign data: "
+				     "assuming corrupted media\n"));
 			mlog_exit_hint(RV_CORRUPT);
 
 			switch (Media_erasechk(drivep,
-						dcaps,
-						intr_allowed,
-						prevmediapresentpr)) {
+					       dcaps,
+					       intr_allowed,
+					       prevmediapresentpr)) {
 			case RV_OK:
 				goto erasemedia;
 			case RV_INTR:
@@ -6183,24 +6183,24 @@ position:
 
 			if (contextp->cc_Media_useterminatorpr) {
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "encountered corrupt or foreign data "
-				      "but expecting a media "
-				      "stream terminator: "
-				      "assuming corrupted media\n"));
+					     "encountered corrupt or foreign data "
+					     "but expecting a media "
+					     "stream terminator: "
+					     "assuming corrupted media\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
-			} else if (! (dcaps & DRIVE_CAP_OVERWRITE)) {
+			} else if (!(dcaps & DRIVE_CAP_OVERWRITE)) {
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "encountered corrupt or foreign data: "
-				      "unable to overwrite: "
-				      "assuming corrupted media\n"));
+					     "encountered corrupt or foreign data: "
+					     "unable to overwrite: "
+					     "assuming corrupted media\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
 			} else {
 				int status;
 				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-				      "encountered corrupt or foreign data: "
-				      "repositioning to overwrite\n"));
+					     "encountered corrupt or foreign data: "
+					     "repositioning to overwrite\n"));
 				mlog_exit_hint(RV_CORRUPT);
 				assert(dcaps & DRIVE_CAP_BSF);
 				status = 0;
@@ -6218,8 +6218,8 @@ position:
 		case DRIVE_ERROR_EOF:
 		default:
 			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
-			      "unexpected error from do_begin_read: %d\n"),
-			      rval);
+				     "unexpected error from do_begin_read: %d\n"),
+			     rval);
 			return RV_CORE;
 		}
 	}
@@ -6227,7 +6227,7 @@ position:
 
 erasemedia:
 	mlog(MLOG_VERBOSE | MLOG_WARNING | MLOG_MEDIA, _(
-	      "erasing media\n"));
+		     "erasing media\n"));
 	rval = (*dop->do_erase)(drivep);
 	if (rval) {
 		return RV_DRIVE;
@@ -6242,7 +6242,7 @@ changemedia:
 	/*
 	 * if the drive does not support media change, quit.
 	 */
-	if (! (dcaps & DRIVE_CAP_REMOVABLE)) {
+	if (!(dcaps & DRIVE_CAP_REMOVABLE)) {
 		return RV_ERROR;
 	}
 
@@ -6270,7 +6270,7 @@ changemedia:
 	 * If an alert program has been specified, run it
 	 */
 	if (media_change_alert_program != NULL)
-	   system(media_change_alert_program);
+		system(media_change_alert_program);
 
 	/*
 	 * if media change prompt declined or times out,
@@ -6280,9 +6280,9 @@ changemedia:
 		ix_t thrdix = drivep->d_index;
 		assert(sistr);
 		mlog(MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
-		      "please change media: "
-		      "type %s to confirm media change\n"),
-		      sistr);
+			     "please change media: "
+			     "type %s to confirm media change\n"),
+		     sistr);
 		set_mcflag(thrdix);
 		while (sc_mcflag[thrdix]) {
 			sleep(2);
@@ -6362,13 +6362,13 @@ write:
 	 * do not allow interleaving of media files from different xfsdumps.
 	 */
 	if (mwhdrp->mh_mediaix != 0
-	     &&
-	     mwhdrp->mh_dumpmediafileix == 0
-	     &&
-	     ! virginmediapr) {
+	    &&
+	    mwhdrp->mh_dumpmediafileix == 0
+	    &&
+	    ! virginmediapr) {
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-		      "cannot interleave dump streams: must supply a blank "
-		      "media object\n"));
+			     "cannot interleave dump streams: must supply a blank "
+			     "media object\n"));
 		*gwhdrp = saved_gwhdr;
 		goto changemedia;
 	}
@@ -6379,8 +6379,8 @@ write:
 	if (! mediawrittentopr && mwhdrp->mh_dumpfileix != 0) {
 		uuid_copy(mwhdrp->mh_prevmediaid, mwhdrp->mh_mediaid);
 		(void)strncpyterm(mwhdrp->mh_prevmedialabel,
-				     mwhdrp->mh_medialabel,
-				     sizeof(mwhdrp->mh_medialabel));
+				  mwhdrp->mh_medialabel,
+				  sizeof(mwhdrp->mh_medialabel));
 	}
 
 	/*
@@ -6393,42 +6393,42 @@ write:
 			uuid_generate(mwhdrp->mh_mediaid);
 
 			if (! cmdlinemedialabel
-			     &&
-			     ! drivep->d_isnamedpipepr
-			     &&
-			     ! drivep->d_isunnamedpipepr
-			     &&
-			     dlog_allowed()) {
+			    &&
+			    ! drivep->d_isnamedpipepr
+			    &&
+			    ! drivep->d_isunnamedpipepr
+			    &&
+			    dlog_allowed()) {
 				cmdlinemedialabel = Media_prompt_label(drivep,
-							labelbuf,
-							sizeof(labelbuf));
+								       labelbuf,
+								       sizeof(labelbuf));
 				if (intr_allowed && cldmgr_stop_requested()) {
 					return RV_INTR;
 				}
 			}
 			if (cmdlinemedialabel && strlen(cmdlinemedialabel)) {
 				(void)strncpyterm(mwhdrp->mh_medialabel,
-						     cmdlinemedialabel,
-					       sizeof(mwhdrp->mh_medialabel));
+						  cmdlinemedialabel,
+						  sizeof(mwhdrp->mh_medialabel));
 			} else {
 				(void)memset((void *)mwhdrp->mh_medialabel,
-						     0,
-					       sizeof(mwhdrp->mh_medialabel));
+					     0,
+					     sizeof(mwhdrp->mh_medialabel));
 				if (! pipeline) {
 					mlog(MLOG_VERBOSE
-					      |
-					      MLOG_WARNING
-					      |
-					      MLOG_MEDIA, _(
-					      "no media label specified\n"));
+					     |
+					     MLOG_WARNING
+					     |
+					     MLOG_MEDIA, _(
+						     "no media label specified\n"));
 				}
 			}
 		} else {
 			assert(! virginmediapr);
 			uuid_copy(mwhdrp->mh_mediaid, mrhdrp->mh_mediaid);
 			(void)strncpyterm(mwhdrp->mh_medialabel,
-					     mrhdrp->mh_medialabel,
-					     sizeof(mwhdrp->mh_medialabel));
+					  mrhdrp->mh_medialabel,
+					  sizeof(mwhdrp->mh_medialabel));
 		}
 	}
 
@@ -6446,8 +6446,8 @@ write:
 		return RV_OK;
 	case DRIVE_ERROR_EOM:
 		mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
-		      "encountered end of media "
-		      "while attempting to begin new media file\n"));
+			     "encountered end of media "
+			     "while attempting to begin new media file\n"));
 		*gwhdrp = saved_gwhdr;
 		goto changemedia;
 	case DRIVE_ERROR_MEDIA:
@@ -6462,17 +6462,17 @@ write:
 
 /* ARGSUSED */
 static rv_t
-Media_mfile_end(drive_t *drivep,
-		 context_t *contextp,
-		 media_hdr_t *mwhdrp,
-		 off64_t *ncommittedp,
-		 bool_t hit_eom)
+Media_mfile_end(drive_t *	drivep,
+		context_t *	contextp,
+		media_hdr_t *	mwhdrp,
+		off64_t *	ncommittedp,
+		bool_t		hit_eom)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	int rval;
 
 	mlog(MLOG_DEBUG | MLOG_MEDIA,
-	      "Media op: end media file\n");
+	     "Media op: end media file\n");
 
 	assert(contextp->cc_Media_begin_entrystate == BES_INVAL);
 
@@ -6493,8 +6493,8 @@ Media_mfile_end(drive_t *drivep,
 	case DRIVE_ERROR_MEDIA:
 	case DRIVE_ERROR_EOM:
 		mlog(MLOG_VERBOSE | MLOG_MEDIA, _(
-		      "encountered end of media "
-		      "while ending media file\n"));
+			     "encountered end of media "
+			     "while ending media file\n"));
 		mlog_exit_hint(RV_EOM);
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
@@ -6541,9 +6541,9 @@ retry:
 	 * query: ask if overwrite ok
 	 */
 	sprintf(question,
-		 "overwrite data on media in "
-		 "drive %u?\n",
-		 (unsigned int)drivep->d_index);
+		"overwrite data on media in "
+		"drive %u?\n",
+		(unsigned int)drivep->d_index);
 	querycnt = 0;
 	querystr[querycnt++] = question;
 	assert(querycnt <= QUERYMAX);
@@ -6556,18 +6556,18 @@ retry:
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query(querystr,
-				       querycnt,
-				       choicestr,
-				       choicecnt,
-				       0,           /* hilitestr */
-				       IXMAX,       /* hiliteix */
-				       0,           /* defaultstr */
-				       doix,        /* defaultix */
-				       DLOG_TIMEOUT_MEDIA,
-				       dontix,		/* timeout ix */
-				       sigintix,	/* sigint ix */
-				       dontix,		/* sighup ix */
-				       dontix);	/* sigquit ix */
+				      querycnt,
+				      choicestr,
+				      choicecnt,
+				      0,        /* hilitestr */
+				      IXMAX,    /* hiliteix */
+				      0,        /* defaultstr */
+				      doix,     /* defaultix */
+				      DLOG_TIMEOUT_MEDIA,
+				      dontix,   /* timeout ix */
+				      sigintix, /* sigint ix */
+				      dontix,   /* sighup ix */
+				      dontix);  /* sigquit ix */
 	ackcnt = 0;
 	if (responseix == doix) {
 		ackstr[ackcnt++] = "media will be overwritten\n";
@@ -6578,7 +6578,7 @@ retry:
 	}
 	assert(ackcnt <= ACKMAX);
 	dlog_multi_ack(ackstr,
-			ackcnt);
+		       ackcnt);
 
 	postamblecnt = 0;
 	fold_init(fold, "end dialog", '-');
@@ -6587,21 +6587,21 @@ retry:
 	postamblestr[postamblecnt++] = "\n\n";
 	assert(postamblecnt <= POSTAMBLEMAX);
 	dlog_end(postamblestr,
-		  postamblecnt);
+		 postamblecnt);
 
 	if (responseix == sigintix) {
 		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep(1); /* to allow main thread to begin dialog */
+		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 */
+		     "");       /* to block until main thread dialog complete */
+		sleep(1);       /* to allow main thread to request children die */
 		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
 		mlog(MLOG_DEBUG,
-		      "retrying media overwrite dialog\n");
+		     "retrying media overwrite dialog\n");
 		goto retry;
 	}
 
@@ -6611,9 +6611,9 @@ retry:
 
 static rv_t
 Media_erasechk(drive_t *drivep,
-		int dcaps,
-		bool_t intr_allowed,
-		bool_t prevmediapresentpr)
+	       int	dcaps,
+	       bool_t	intr_allowed,
+	       bool_t	prevmediapresentpr)
 {
 	if (prevmediapresentpr == BOOL_TRUE) {
 		return RV_NOTOK;
@@ -6637,9 +6637,9 @@ Media_erasechk(drive_t *drivep,
 			}
 		} else {
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
-			      "drive does not support media erase: "
-			      "ignoring -%c option\n"),
-			      GETOPT_ERASE);
+				     "drive does not support media erase: "
+				     "ignoring -%c option\n"),
+			     GETOPT_ERASE);
 			return RV_NOTOK;
 		}
 	} else {
@@ -6680,12 +6680,12 @@ retry:
 	 * query: ask if overwrite ok
 	 */
 	sprintf(question,
-		 "pre-erase (-%c) option specified "
-		 "and non-blank media encountered:\n"
-		 "please confirm media erase "
-		 "drive %u\n",
-		 GETOPT_ERASE,
-		 (unsigned int)drivep->d_index);
+		"pre-erase (-%c) option specified "
+		"and non-blank media encountered:\n"
+		"please confirm media erase "
+		"drive %u\n",
+		GETOPT_ERASE,
+		(unsigned int)drivep->d_index);
 	querycnt = 0;
 	querystr[querycnt++] = question;
 	assert(querycnt <= QUERYMAX);
@@ -6698,18 +6698,18 @@ retry:
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query(querystr,
-				       querycnt,
-				       choicestr,
-				       choicecnt,
-				       0,           /* hilitestr */
-				       IXMAX,       /* hiliteix */
-				       0,           /* defaultstr */
-				       doix,        /* defaultix */
-				       DLOG_TIMEOUT_MEDIA,
-				       dontix,		/* timeout ix */
-				       sigintix,	/* sigint ix */
-				       dontix,		/* sighup ix */
-				       dontix);	/* sigquit ix */
+				      querycnt,
+				      choicestr,
+				      choicecnt,
+				      0,        /* hilitestr */
+				      IXMAX,    /* hiliteix */
+				      0,        /* defaultstr */
+				      doix,     /* defaultix */
+				      DLOG_TIMEOUT_MEDIA,
+				      dontix,   /* timeout ix */
+				      sigintix, /* sigint ix */
+				      dontix,   /* sighup ix */
+				      dontix);  /* sigquit ix */
 	ackcnt = 0;
 	if (responseix == doix) {
 		ackstr[ackcnt++] = "media will be erased\n";
@@ -6720,7 +6720,7 @@ retry:
 	}
 	assert(ackcnt <= ACKMAX);
 	dlog_multi_ack(ackstr,
-			ackcnt);
+		       ackcnt);
 
 	postamblecnt = 0;
 	fold_init(fold, "end dialog", '-');
@@ -6729,21 +6729,21 @@ retry:
 	postamblestr[postamblecnt++] = "\n\n";
 	assert(postamblecnt <= POSTAMBLEMAX);
 	dlog_end(postamblestr,
-		  postamblecnt);
+		 postamblecnt);
 
 	if (responseix == sigintix) {
 		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
-		sleep(1); /* to allow main thread to begin dialog */
+		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 */
+		     "");       /* to block until main thread dialog complete */
+		sleep(1);       /* to allow main thread to request children die */
 		if (cldmgr_stop_requested()) {
 			return BOOL_FALSE;
 		}
 		mlog(MLOG_DEBUG,
-		      "retrying media erase dialog\n");
+		     "retrying media erase dialog\n");
 		goto retry;
 	}
 
@@ -6760,9 +6760,9 @@ Media_prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp)
 	 * query: ask for a label
 	 */
 	(*pcb)(pctxp,
-		   "please enter label for media in "
-		   "drive %u",
-		   drivep->d_index);
+	       "please enter label for media in "
+	       "drive %u",
+	       drivep->d_index);
 }
 
 static char *
@@ -6791,15 +6791,15 @@ retry:
 	dlog_begin(preamblestr, preamblecnt);
 
 	responseix = dlog_string_query(Media_prompt_label_cb,
-					(void *)drivep,
-					bufp,
-					bufsz,
-					DLOG_TIMEOUT,
-					timeoutix,/* timeout ix */
-					sigintix, /* sigint ix */
-					abortix,  /* sighup ix */
-					abortix,  /* sigquit ix */
-					okix);   /* ok ix */
+				       (void *)drivep,
+				       bufp,
+				       bufsz,
+				       DLOG_TIMEOUT,
+				       timeoutix,       /* timeout ix */
+				       sigintix,        /* sigint ix */
+				       abortix,         /* sighup ix */
+				       abortix,         /* sigquit ix */
+				       okix);           /* ok ix */
 	ackcnt = 0;
 	if (responseix == okix) {
 		ackstr[ackcnt++] = "media label entered: \"";
@@ -6815,7 +6815,7 @@ retry:
 
 	assert(ackcnt <= ACKMAX);
 	dlog_string_ack(ackstr,
-			 ackcnt);
+			ackcnt);
 
 	postamblecnt = 0;
 	fold_init(fold, "end dialog", '-');
@@ -6824,21 +6824,21 @@ retry:
 	postamblestr[postamblecnt++] = "\n\n";
 	assert(postamblecnt <= POSTAMBLEMAX);
 	dlog_end(postamblestr,
-		  postamblecnt);
+		 postamblecnt);
 
 	if (responseix == sigintix) {
 		if (cldmgr_stop_requested()) {
 			return 0;
 		}
-		sleep(1); /* to allow main thread to begin dialog */
+		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 */
+		     "");       /* to block until main thread dialog complete */
+		sleep(1);       /* to allow main thread to request children die */
 		if (cldmgr_stop_requested()) {
 			return 0;
 		}
 		mlog(MLOG_DEBUG,
-		      "retrying media label dialog\n");
+		     "retrying media label dialog\n");
 		goto retry;
 	}
 
@@ -6908,65 +6908,65 @@ is_quota_file(ino_t ino)
 static bool_t
 save_quotas(char *mntpnt, quota_info_t *quotainfo)
 {
-        int             sts = 0;
-        char            buf[1024] = "";
-        int             fd;
-        char            tmp;
-        struct stat     statb;
-
-        mlog(MLOG_VERBOSE, _(
-		"saving %s information for: %s\n"), quotainfo->desc, mntpnt);
-
-        if (unlink(quotainfo->quotapath) == 0) {
-            mlog(MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
-        }
-        else {
-            if (errno != ENOENT) {
-                mlog(MLOG_ERROR, _(
-                      "unable to remove %s: %s\n"),
-                      quotainfo->quotapath,
-                      strerror(errno));
-                return BOOL_FALSE;
-            }
-        }
-
-        sprintf(buf,
-		 "%s -x -c 'dump %s %s' %s 2> /dev/null",
-		 REPQUOTA,
-                 quotainfo->repquotaargs,
-                 quotainfo->quotapath,
-                 mntpnt);
-
-        mlog(MLOG_NITTY, "saving quotas: %s\n", buf);
-
-        sts = system(buf);
-        if (sts != 0) {
-            mlog(MLOG_ERROR, _(
-                  "%s failed with exit status: %d\n"), REPQUOTA,
-		  sts == -1 ? -1 : WEXITSTATUS(sts));
-            return BOOL_FALSE;
-        }
-        if ((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
-            mlog(MLOG_ERROR, _(
-                  "open failed %s: %s\n"),
-                  quotainfo->quotapath,
-                  strerror(errno));
-            return BOOL_FALSE;
-        }
-        if (fstat(fd, &statb) < 0) {
-            mlog(MLOG_ERROR, _(
-                  "stat failed %s: %s\n"),
-                  quotainfo->quotapath,
-                  strerror(errno));
-            close(fd);
-            return BOOL_FALSE;
-        }
-        quotainfo->quotaino = statb.st_ino;
-
-        /* open and read dump file to ensure it is in the dump */
-        read(fd, &tmp, 1);
-        close(fd);
-        return BOOL_TRUE;
+	int sts = 0;
+	char buf[1024] = "";
+	int fd;
+	char tmp;
+	struct stat statb;
+
+	mlog(MLOG_VERBOSE, _(
+		     "saving %s information for: %s\n"), quotainfo->desc, mntpnt);
+
+	if (unlink(quotainfo->quotapath) == 0) {
+		mlog(MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
+	}
+	else {
+		if (errno != ENOENT) {
+			mlog(MLOG_ERROR, _(
+				     "unable to remove %s: %s\n"),
+			     quotainfo->quotapath,
+			     strerror(errno));
+			return BOOL_FALSE;
+		}
+	}
+
+	sprintf(buf,
+		"%s -x -c 'dump %s %s' %s 2> /dev/null",
+		REPQUOTA,
+		quotainfo->repquotaargs,
+		quotainfo->quotapath,
+		mntpnt);
+
+	mlog(MLOG_NITTY, "saving quotas: %s\n", buf);
+
+	sts = system(buf);
+	if (sts != 0) {
+		mlog(MLOG_ERROR, _(
+			     "%s failed with exit status: %d\n"), REPQUOTA,
+		     sts == -1 ? -1 : WEXITSTATUS(sts));
+		return BOOL_FALSE;
+	}
+	if ((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
+		mlog(MLOG_ERROR, _(
+			     "open failed %s: %s\n"),
+		     quotainfo->quotapath,
+		     strerror(errno));
+		return BOOL_FALSE;
+	}
+	if (fstat(fd, &statb) < 0) {
+		mlog(MLOG_ERROR, _(
+			     "stat failed %s: %s\n"),
+		     quotainfo->quotapath,
+		     strerror(errno));
+		close(fd);
+		return BOOL_FALSE;
+	}
+	quotainfo->quotaino = statb.st_ino;
+
+	/* open and read dump file to ensure it is in the dump */
+	read(fd, &tmp, 1);
+	close(fd);
+	return BOOL_TRUE;
 }
 
 static int
diff --git a/dump/getopt.h b/dump/getopt.h
index 06c9ab0..c2ee88f 100644
--- a/dump/getopt.h
+++ b/dump/getopt.h
@@ -28,59 +28,59 @@
  * facilitating easy changes.
  */
 
-#define GETOPT_CMDSTRING	"ab:c:d:ef:hl:mop:qs:t:v:z:AB:CDEFG:H:I:JKL:M:NO:PRSTUVWY:"
+#define GETOPT_CMDSTRING        "ab:c:d:ef:hl:mop:qs:t:v:z:AB:CDEFG:H:I:JKL:M:NO:PRSTUVWY:"
 
-#define GETOPT_DUMPASOFFLINE	'a'	/* dump DMF dualstate files as offline */
-#define	GETOPT_BLOCKSIZE	'b'	/* blocksize for rmt */
-#define	GETOPT_ALERTPROG	'c'	/* Media Change Alert prog(content.c) */
-#define	GETOPT_FILESZ		'd'	/* Media file size to use in Mb */
-#define GETOPT_EXCLUDEFILES	'e'	/* allow files to be excluded */
-#define	GETOPT_DUMPDEST		'f'	/* dump dest. file (drive.c) */
+#define GETOPT_DUMPASOFFLINE    'a'     /* dump DMF dualstate files as offline */
+#define GETOPT_BLOCKSIZE        'b'     /* blocksize for rmt */
+#define GETOPT_ALERTPROG        'c'     /* Media Change Alert prog(content.c) */
+#define GETOPT_FILESZ           'd'     /* Media file size to use in Mb */
+#define GETOPT_EXCLUDEFILES     'e'     /* allow files to be excluded */
+#define GETOPT_DUMPDEST         'f'     /* dump dest. file (drive.c) */
 /*				'g'	*/
-#define	GETOPT_HELP		'h'	/* display version and usage */
+#define GETOPT_HELP             'h'     /* display version and usage */
 /*				'i'	*/
 /*				'j'	*/
 /*				'k'	*/
-#define	GETOPT_LEVEL		'l'	/* dump level (content_inode.c) */
-#define GETOPT_MINRMT		'm'	/* use minimal rmt protocol */
+#define GETOPT_LEVEL            'l'     /* dump level (content_inode.c) */
+#define GETOPT_MINRMT           'm'     /* use minimal rmt protocol */
 /*				'n'	*/
-#define GETOPT_OVERWRITE	'o'	/* overwrite data on tape */
-#define GETOPT_PROGRESS		'p'	/* interval between progress reports */
-#define	GETOPT_QIC		'q'	/* option to tell dump it's a QIC tape */
+#define GETOPT_OVERWRITE        'o'     /* overwrite data on tape */
+#define GETOPT_PROGRESS         'p'     /* interval between progress reports */
+#define GETOPT_QIC              'q'     /* option to tell dump it's a QIC tape */
 /*				'r'	*/
-#define	GETOPT_SUBTREE		's'	/* subtree dump (content_inode.c) */
-#define GETOPT_DUMPTIME		't'	/* use mtime of file as dump time */
+#define GETOPT_SUBTREE          's'     /* subtree dump (content_inode.c) */
+#define GETOPT_DUMPTIME         't'     /* use mtime of file as dump time */
 /*				'u' */
-#define	GETOPT_VERBOSITY	'v'	/* verbosity level (0 to 4) */
+#define GETOPT_VERBOSITY        'v'     /* verbosity level (0 to 4) */
 /*				'w' */
 /*				'x'	   used in irix for xvm snapshot */
 /*				'y' */
-#define GETOPT_MAXDUMPFILESIZE	'z'	/* prune files over specified size */
-#define	GETOPT_NOEXTATTR	'A'	/* do not dump ext. file attributes */
-#define	GETOPT_BASED		'B'	/* specify session to base increment */
-#define GETOPT_RECCHKSUM	'C'	/* use record checksums */
-#define GETOPT_NOUNCHANGEDDIRS	'D'	/* skip unchanged directories */
-#define	GETOPT_ERASE		'E'	/* pre-erase media */
-#define GETOPT_FORCE		'F'	/* don't prompt (getopt.c) */
-#define GETOPT_MINSTACKSZ	'G'	/* minimum stack size (bytes) */
-#define GETOPT_MAXSTACKSZ	'H'	/* maximum stack size (bytes) */
+#define GETOPT_MAXDUMPFILESIZE  'z'     /* prune files over specified size */
+#define GETOPT_NOEXTATTR        'A'     /* do not dump ext. file attributes */
+#define GETOPT_BASED            'B'     /* specify session to base increment */
+#define GETOPT_RECCHKSUM        'C'     /* use record checksums */
+#define GETOPT_NOUNCHANGEDDIRS  'D'     /* skip unchanged directories */
+#define GETOPT_ERASE            'E'     /* pre-erase media */
+#define GETOPT_FORCE            'F'     /* don't prompt (getopt.c) */
+#define GETOPT_MINSTACKSZ       'G'     /* minimum stack size (bytes) */
+#define GETOPT_MAXSTACKSZ       'H'     /* maximum stack size (bytes) */
 #define GETOPT_INVPRINT         'I'     /* just display the inventory */
-#define	GETOPT_NOINVUPDATE	'J'	/* do not update the dump inventory */
-#define GETOPT_FMT2COMPAT	'K'	/* use dump format 2 for compat with old restore */
-#define	GETOPT_DUMPLABEL	'L'	/* dump session label (global.c) */
-#define	GETOPT_MEDIALABEL	'M'	/* media object label (media.c) */
-#define	GETOPT_TIMESTAMP	'N'	/* show timestamps in log msgs */
-#define	GETOPT_OPTFILE		'O'	/* specifycmd line options file */
-#define	GETOPT_RINGPIN		'P'	/* pin down I/O buffer ring */
+#define GETOPT_NOINVUPDATE      'J'     /* do not update the dump inventory */
+#define GETOPT_FMT2COMPAT       'K'     /* use dump format 2 for compat with old restore */
+#define GETOPT_DUMPLABEL        'L'     /* dump session label (global.c) */
+#define GETOPT_MEDIALABEL       'M'     /* media object label (media.c) */
+#define GETOPT_TIMESTAMP        'N'     /* show timestamps in log msgs */
+#define GETOPT_OPTFILE          'O'     /* specifycmd line options file */
+#define GETOPT_RINGPIN          'P'     /* pin down I/O buffer ring */
 /*				'Q'	*/
-#define	GETOPT_RESUME		'R'	/* resume intr dump (content_inode.c) */
-#define	GETOPT_SINGLEMFILE	'S'	/* obsolete - now the default */
-#define	GETOPT_NOTIMEOUTS	'T'	/* don't timeout dialogs */
-#define	GETOPT_UNLOAD		'U'	/* unload media when change needed */
-#define	GETOPT_SHOWLOGSS	'V'	/* show subsystem of log messages */
-#define	GETOPT_SHOWLOGLEVEL	'W'	/* show level of log messages */
+#define GETOPT_RESUME           'R'     /* resume intr dump (content_inode.c) */
+#define GETOPT_SINGLEMFILE      'S'     /* obsolete - now the default */
+#define GETOPT_NOTIMEOUTS       'T'     /* don't timeout dialogs */
+#define GETOPT_UNLOAD           'U'     /* unload media when change needed */
+#define GETOPT_SHOWLOGSS        'V'     /* show subsystem of log messages */
+#define GETOPT_SHOWLOGLEVEL     'W'     /* show level of log messages */
 /*				'X'	*/
-#define	GETOPT_RINGLEN		'Y'	/* specify I/O buffer ring length */
+#define GETOPT_RINGLEN          'Y'     /* specify I/O buffer ring length */
 /*				'Z'	   used on irix for miniroot */
 
 #endif /* GETOPT_H */
diff --git a/dump/inomap.c b/dump/inomap.c
index 240a767..be505ea 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -47,15 +47,15 @@
 
 /* structure definitions used locally ****************************************/
 
-#define BSTATBUFLEN	pgsz
-	/*
-	 * length (in bstat_t's) of buf passed to bigstat_iter
-	 */
+#define BSTATBUFLEN     pgsz
+/*
+ * length (in bstat_t's) of buf passed to bigstat_iter
+ */
 
-#define GETDENTBUFSZ	pgsz
-	/*
-	 * size (in bytes) of buf passed to diriter (when not recursive)
-	 */
+#define GETDENTBUFSZ    pgsz
+/*
+ * size (in bytes) of buf passed to diriter (when not recursive)
+ */
 
 /* declarations of externally defined global symbols *************************/
 
@@ -72,16 +72,16 @@ extern bool_t allowexcludefiles_pr;
  */
 static int
 cb_context(bool_t last,
-			    time32_t,
-			    bool_t,
-			    time32_t,
-			    size_t,
-			    drange_t *,
-			    startpt_t *,
-			    size_t,
-			    int,
-			    bool_t,
-			    bool_t *);
+	   time32_t,
+	   bool_t,
+	   time32_t,
+	   size_t,
+	   drange_t *,
+	   startpt_t *,
+	   size_t,
+	   int,
+	   bool_t,
+	   bool_t *);
 static void cb_context_free(void);
 static int cb_count_inogrp(void *, int, xfs_inogrp_t *);
 static int cb_add_inogrp(void *, int, xfs_inogrp_t *);
@@ -92,15 +92,15 @@ static void cb_accuminit_sz(void);
 static void cb_spinit(void);
 static int
 cb_startpt(void *,
-			    jdm_fshandle_t *,
-			    int,
-			    xfs_bstat_t *);
+	   jdm_fshandle_t *,
+	   int,
+	   xfs_bstat_t *);
 static int
 supprt_prune(void *,
-			      jdm_fshandle_t *,
-			      int,
-			      xfs_bstat_t *,
-			      char *);
+	     jdm_fshandle_t *,
+	     int,
+	     xfs_bstat_t *,
+	     char *);
 static off64_t quantity2offset(jdm_fshandle_t *, xfs_bstat_t *, off64_t);
 static off64_t estimate_dump_space(xfs_bstat_t *);
 
@@ -117,22 +117,22 @@ static void inomap_set_gen(void *, xfs_ino_t, gen_t);
  */
 static int
 subtree_descend_cb(void *,
-				    jdm_fshandle_t *,
-				    int fsfd,
-				    xfs_bstat_t *,
-				    char *);
+		   jdm_fshandle_t *,
+		   int fsfd,
+		   xfs_bstat_t *,
+		   char *);
 static int
 subtreelist_parse_cb(void *,
-				      jdm_fshandle_t *,
-				      int fsfd,
-				      xfs_bstat_t *,
-				      char *);
+		     jdm_fshandle_t *,
+		     int fsfd,
+		     xfs_bstat_t *,
+		     char *);
 static int
 subtreelist_parse(jdm_fshandle_t *,
-				   int,
-				   xfs_bstat_t *,
-				   char *[],
-				   ix_t);
+		  int,
+		  xfs_bstat_t *,
+		  char *[],
+		  ix_t);
 
 /* definition of locally defined global variables ****************************/
 
@@ -154,24 +154,24 @@ static uint64_t inomap_exclude_skipattr = 0;
  */
 /* ARGSUSED */
 bool_t
-inomap_build(jdm_fshandle_t *fshandlep,
-	      int fsfd,
-	      xfs_bstat_t *rootstatp,
-	      bool_t last,
-	      time32_t lasttime,
-	      bool_t resume,
-	      time32_t resumetime,
-	      size_t resumerangecnt,
-	      drange_t *resumerangep,
-	      char *subtreebuf[],
-	      ix_t subtreecnt,
-	      bool_t skip_unchanged_dirs,
-	      startpt_t *startptp,
-	      size_t startptcnt,
-	      ix_t *statphasep,
-	      ix_t *statpassp,
-	      size64_t statcnt,
-	      size64_t *statdonep)
+inomap_build(jdm_fshandle_t *	fshandlep,
+	     int		fsfd,
+	     xfs_bstat_t *	rootstatp,
+	     bool_t		last,
+	     time32_t		lasttime,
+	     bool_t		resume,
+	     time32_t		resumetime,
+	     size_t		resumerangecnt,
+	     drange_t *		resumerangep,
+	     char *		subtreebuf[],
+	     ix_t		subtreecnt,
+	     bool_t		skip_unchanged_dirs,
+	     startpt_t *	startptp,
+	     size_t		startptcnt,
+	     ix_t *		statphasep,
+	     ix_t *		statpassp,
+	     size64_t		statcnt,
+	     size64_t *		statdonep)
 {
 	xfs_bstat_t *bstatbufp;
 	size_t bstatbuflen;
@@ -180,13 +180,13 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	int stat;
 	int rval;
 
-        /*
-         * do a sync so that bulkstat will pick up inode changes
-         * that are currently in the inode cache. this is necessary
-         * for incremental dumps in order to have the dump time
-         * accurately reflect what inodes were included in this dump.
-         * (PV 881455)
-         */
+	/*
+	 * do a sync so that bulkstat will pick up inode changes
+	 * that are currently in the inode cache. this is necessary
+	 * for incremental dumps in order to have the dump time
+	 * accurately reflect what inodes were included in this dump.
+	 * (PV 881455)
+	 */
 	sync();
 
 	/*
@@ -201,9 +201,9 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	 */
 	bstatbuflen = BSTATBUFLEN;
 	bstatbufp = (xfs_bstat_t *)memalign(pgsz,
-					       bstatbuflen
-					       *
-					       sizeof(xfs_bstat_t));
+					    bstatbuflen
+					    *
+					    sizeof(xfs_bstat_t));
 	assert(bstatbufp);
 
 	/*
@@ -220,20 +220,20 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	 * initialize the callback context
 	 */
 	rval = cb_context(last,
-			   lasttime,
-			   resume,
-			   resumetime,
-			   resumerangecnt,
-			   resumerangep,
-			   startptp,
-			   startptcnt,
-			   igrpcnt,
-			   skip_unchanged_dirs,
-			   &pruneneeded);
- 	if (rval) {
- 		free((void *)bstatbufp);
- 		return BOOL_FALSE;
- 	}
+			  lasttime,
+			  resume,
+			  resumetime,
+			  resumerangecnt,
+			  resumerangep,
+			  startptp,
+			  startptcnt,
+			  igrpcnt,
+			  skip_unchanged_dirs,
+			  &pruneneeded);
+	if (rval) {
+		free((void *)bstatbufp);
+		return BOOL_FALSE;
+	}
 
 	/*
 	 * the inode map requires that inodes are added in increasing
@@ -244,11 +244,11 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	 * correct state is set in cb_add.
 	 */
 	rval = inogrp_iter(fsfd, cb_add_inogrp, NULL, &stat);
- 	if (rval || stat) {
+	if (rval || stat) {
 		cb_context_free();
- 		free((void *)bstatbufp);
- 		return BOOL_FALSE;
- 	}
+		free((void *)bstatbufp);
+		return BOOL_FALSE;
+	}
 
 	/*
 	 * construct the ino map, based on the last dump time, resumed
@@ -264,8 +264,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	 * to decide if any pruning can be done.
 	 */
 	mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
-	      "ino map phase 1: "
-	      "constructing initial dump list\n"));
+		     "ino map phase 1: "
+		     "constructing initial dump list\n"));
 
 	*inomap_statdonep = 0;
 	*inomap_statphasep = 1;
@@ -274,23 +274,23 @@ inomap_build(jdm_fshandle_t *fshandlep,
 
 	if (subtreecnt) {
 		rval = subtreelist_parse(fshandlep,
-					  fsfd,
-					  rootstatp,
-					  subtreebuf,
-					  subtreecnt);
+					 fsfd,
+					 rootstatp,
+					 subtreebuf,
+					 subtreecnt);
 	} else {
 		rval = bigstat_iter(fshandlep,
-				     fsfd,
-				     BIGSTAT_ITER_ALL,
-				     (xfs_ino_t)0,
-				     cb_add,
-				     NULL,
-				     NULL,
-				     NULL,
-				     &stat,
-				     preemptchk,
-				     bstatbufp,
-				     bstatbuflen);
+				    fsfd,
+				    BIGSTAT_ITER_ALL,
+				    (xfs_ino_t)0,
+				    cb_add,
+				    NULL,
+				    NULL,
+				    NULL,
+				    &stat,
+				    preemptchk,
+				    bstatbufp,
+				    bstatbuflen);
 	}
 	*inomap_statphasep = 0;
 	if (rval || preemptchk(PREEMPT_FULL)) {
@@ -301,13 +301,13 @@ inomap_build(jdm_fshandle_t *fshandlep,
 
 	if (inomap_exclude_filesize > 0) {
 		mlog(MLOG_NOTE | MLOG_VERBOSE, _(
-		      "pruned %llu files: maximum size exceeded\n"),
-		      inomap_exclude_filesize);
+			     "pruned %llu files: maximum size exceeded\n"),
+		     inomap_exclude_filesize);
 	}
 	if (inomap_exclude_skipattr > 0) {
 		mlog(MLOG_NOTE | MLOG_VERBOSE, _(
-		      "pruned %llu files: skip attribute set\n"),
-		      inomap_exclude_skipattr);
+			     "pruned %llu files: skip attribute set\n"),
+		     inomap_exclude_skipattr);
 	}
 
 	/*
@@ -315,20 +315,20 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	 * no children needing dumping.
 	 */
 	if (pruneneeded) {
-		bool_t	rootdump = BOOL_FALSE;
+		bool_t rootdump = BOOL_FALSE;
 
 		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
-		      "ino map phase 2: "
-		      "pruning unneeded subtrees\n"));
+			     "ino map phase 2: "
+			     "pruning unneeded subtrees\n"));
 		*inomap_statdonep = 0;
 		*inomap_statpassp = 0;
 		*inomap_statphasep = 2;
 
 		(void) supprt_prune(&rootdump,
-				     fshandlep,
-				     fsfd,
-				     rootstatp,
-				     NULL);
+				    fshandlep,
+				    fsfd,
+				    rootstatp,
+				    NULL);
 		*inomap_statphasep = 0;
 
 		if (preemptchk(PREEMPT_FULL)) {
@@ -339,8 +339,8 @@ inomap_build(jdm_fshandle_t *fshandlep,
 
 	} else {
 		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
-		      "ino map phase 2: "
-		      "skipping (no pruning necessary)\n"));
+			     "ino map phase 2: "
+			     "skipping (no pruning necessary)\n"));
 	}
 
 	/*
@@ -353,28 +353,28 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	 */
 	if (startptcnt > 1) {
 		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
-		      "ino map phase 3: "
-		      "identifying stream starting points\n"));
+			     "ino map phase 3: "
+			     "identifying stream starting points\n"));
 	} else {
 		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
-		      "ino map phase 3: "
-		      "skipping (only one dump stream)\n"));
+			     "ino map phase 3: "
+			     "skipping (only one dump stream)\n"));
 	}
 	stat = 0;
 	*inomap_statdonep = 0;
 	*inomap_statphasep = 3;
 	rval = bigstat_iter(fshandlep,
-			     fsfd,
-			     BIGSTAT_ITER_NONDIR,
-			     (xfs_ino_t)0,
-			     cb_startpt,
-			     NULL,
-			     inomap_next_nondir,
-			     inomap_alloc_context(),
-			     &stat,
-			     preemptchk,
-			     bstatbufp,
-			     bstatbuflen);
+			    fsfd,
+			    BIGSTAT_ITER_NONDIR,
+			    (xfs_ino_t)0,
+			    cb_startpt,
+			    NULL,
+			    inomap_next_nondir,
+			    inomap_alloc_context(),
+			    &stat,
+			    preemptchk,
+			    bstatbufp,
+			    bstatbuflen);
 	*inomap_statphasep = 0;
 
 	if (rval) {
@@ -397,18 +397,18 @@ inomap_build(jdm_fshandle_t *fshandlep,
 			}
 			assert(! p->sp_flags);
 			mlog(MLOG_VERBOSE | MLOG_INOMAP,
-			      _("stream %u: ino %llu offset %lld to "),
-			      startptix,
-			      p->sp_ino,
-			      p->sp_offset);
+			     _("stream %u: ino %llu offset %lld to "),
+			     startptix,
+			     p->sp_ino,
+			     p->sp_offset);
 			if (! ep) {
 				mlog(MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
-				      _("end\n"));
+				     _("end\n"));
 			} else {
 				mlog(MLOG_VERBOSE |  MLOG_BARE | MLOG_INOMAP,
-				      _("ino %llu offset %lld\n"),
-				      ep->sp_ino,
-				      ep->sp_offset);
+				     _("ino %llu offset %lld\n"),
+				     ep->sp_ino,
+				     ep->sp_offset);
 			}
 		}
 	}
@@ -416,7 +416,7 @@ inomap_build(jdm_fshandle_t *fshandlep,
 	cb_context_free();
 	free((void *)bstatbufp);
 	mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
-	      "ino map construction complete\n"));
+		     "ino map construction complete\n"));
 	return BOOL_TRUE;
 }
 
@@ -431,8 +431,8 @@ inomap_skip(xfs_ino_t ino)
 	}
 
 	if (oldstate == MAP_DIR_CHANGE
-	     ||
-	     oldstate == MAP_DIR_SUPPRT) {
+	    ||
+	    oldstate == MAP_DIR_SUPPRT) {
 		inomap_set_state(NULL, ino, MAP_DIR_NOCHNG);
 	}
 }
@@ -444,42 +444,42 @@ inomap_skip(xfs_ino_t ino)
  * callback context and operators - inomap_build makes extensive use
  * of iterators. below are the callbacks given to these iterators.
  */
-static bool_t cb_last;		/* set by cb_context() */
-static time32_t cb_lasttime;	/* set by cb_context() */
-static bool_t cb_resume;	/* set by cb_context() */
-static time32_t cb_resumetime;	/* set by cb_context() */
-static size_t cb_resumerangecnt;/* set by cb_context() */
-static drange_t *cb_resumerangep;/* set by cb_context() */
-static void *cb_inomap_contextp;/* set by cb_context() */
-static startpt_t *cb_startptp;	/* set by cb_context() */
-static size_t cb_startptcnt;	/* set by cb_context() */
-static size_t cb_startptix;	/* set by cb_spinit(), incr. by cb_startpt */
-static off64_t cb_datasz;	/* set by cb_context() */
-static off64_t cb_hdrsz;	/* set by cb_context() */
-static off64_t cb_accum;	/* set by cb_context(), cb_spinit() */
-static off64_t cb_incr;		/* set by cb_spinit(), used by cb_startpt() */
-static off64_t cb_target;	/* set by cb_spinit(), used by cb_startpt() */
-static off64_t cb_dircnt;	/* number of dirs CHANGED or PRUNE */
-static off64_t cb_nondircnt;	/* number of non-dirs CHANGED */
-static bool_t *cb_pruneneededp; /* set by cb_context() */
-static bool_t cb_skip_unchanged_dirs;	/* set by cb_context() */
+static bool_t cb_last;                  /* set by cb_context() */
+static time32_t cb_lasttime;            /* set by cb_context() */
+static bool_t cb_resume;                /* set by cb_context() */
+static time32_t cb_resumetime;          /* set by cb_context() */
+static size_t cb_resumerangecnt;        /* set by cb_context() */
+static drange_t *cb_resumerangep;       /* set by cb_context() */
+static void *cb_inomap_contextp;        /* set by cb_context() */
+static startpt_t *cb_startptp;          /* set by cb_context() */
+static size_t cb_startptcnt;            /* set by cb_context() */
+static size_t cb_startptix;             /* set by cb_spinit(), incr. by cb_startpt */
+static off64_t cb_datasz;               /* set by cb_context() */
+static off64_t cb_hdrsz;                /* set by cb_context() */
+static off64_t cb_accum;                /* set by cb_context(), cb_spinit() */
+static off64_t cb_incr;                 /* set by cb_spinit(), used by cb_startpt() */
+static off64_t cb_target;               /* set by cb_spinit(), used by cb_startpt() */
+static off64_t cb_dircnt;               /* number of dirs CHANGED or PRUNE */
+static off64_t cb_nondircnt;            /* number of non-dirs CHANGED */
+static bool_t *cb_pruneneededp;         /* set by cb_context() */
+static bool_t cb_skip_unchanged_dirs;   /* set by cb_context() */
 
 /*
  * cb_context - initializes the call back context for the add and prune
  * phases of inomap_build().
  */
 static int
-cb_context(bool_t last,
-	    time32_t lasttime,
-	    bool_t resume,
-	    time32_t resumetime,
-	    size_t resumerangecnt,
-	    drange_t *resumerangep,
-	    startpt_t *startptp,
-	    size_t startptcnt,
-	    int igrpcnt,
-	    bool_t skip_unchanged_dirs,
-	    bool_t *pruneneededp)
+cb_context(bool_t	last,
+	   time32_t	lasttime,
+	   bool_t	resume,
+	   time32_t	resumetime,
+	   size_t	resumerangecnt,
+	   drange_t *	resumerangep,
+	   startpt_t *	startptp,
+	   size_t	startptcnt,
+	   int		igrpcnt,
+	   bool_t	skip_unchanged_dirs,
+	   bool_t *	pruneneededp)
 {
 	cb_last = last;
 	cb_lasttime = lasttime;
@@ -499,7 +499,7 @@ cb_context(bool_t last,
 		return -1;
 
 	cb_inomap_contextp = inomap_alloc_context();
-	if (!cb_inomap_contextp)
+	if (! cb_inomap_contextp)
 		return -1;
 
 	return 0;
@@ -527,10 +527,10 @@ cb_count_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
  */
 /* ARGSUSED */
 static int
-cb_add(void *arg1,
-	jdm_fshandle_t *fshandlep,
-	int fsfd,
-	xfs_bstat_t *statp)
+cb_add(void *		arg1,
+       jdm_fshandle_t * fshandlep,
+       int		fsfd,
+       xfs_bstat_t *	statp)
 {
 	register time32_t mtime = statp->bs_mtime.tv_sec;
 	register time32_t ctime = statp->bs_ctime.tv_sec;
@@ -589,9 +589,9 @@ cb_add(void *arg1,
 	if (changed) {
 		if (mode == S_IFDIR) {
 			inomap_add(cb_inomap_contextp,
-				    ino,
-				    (gen_t)statp->bs_gen,
-				    MAP_DIR_CHANGE);
+				   ino,
+				   (gen_t)statp->bs_gen,
+				   MAP_DIR_CHANGE);
 			cb_dircnt++;
 		} else {
 			estimated_size = estimate_dump_space(statp);
@@ -601,39 +601,39 @@ cb_add(void *arg1,
 			 * files are exempt from the check.
 			 */
 			if (maxdumpfilesize > 0 &&
-			     estimated_size > maxdumpfilesize &&
-			     !is_quota_file(statp->bs_ino)) {
+			    estimated_size > maxdumpfilesize &&
+			    ! is_quota_file(statp->bs_ino)) {
 				mlog(MLOG_DEBUG | MLOG_EXCLFILES,
-				      "pruned ino %llu, owner %u, estimated size %llu: maximum size exceeded\n",
-				      statp->bs_ino,
-				      statp->bs_uid,
-				      estimated_size);
+				     "pruned ino %llu, owner %u, estimated size %llu: maximum size exceeded\n",
+				     statp->bs_ino,
+				     statp->bs_uid,
+				     estimated_size);
 				inomap_add(cb_inomap_contextp,
-					    ino,
-					    (gen_t)statp->bs_gen,
-					    MAP_NDR_NOCHNG);
+					   ino,
+					   (gen_t)statp->bs_gen,
+					   MAP_NDR_NOCHNG);
 				inomap_exclude_filesize++;
 				return 0;
 			}
 
 			if (allowexcludefiles_pr && statp->bs_xflags & XFS_XFLAG_NODUMP) {
 				mlog(MLOG_DEBUG | MLOG_EXCLFILES,
-				      "pruned ino %llu, owner %u, estimated size %llu: skip flag set\n",
-				      statp->bs_ino,
-				      statp->bs_uid,
-				      estimated_size);
+				     "pruned ino %llu, owner %u, estimated size %llu: skip flag set\n",
+				     statp->bs_ino,
+				     statp->bs_uid,
+				     estimated_size);
 				inomap_add(cb_inomap_contextp,
-					    ino,
-					    (gen_t)statp->bs_gen,
-					    MAP_NDR_NOCHNG);
+					   ino,
+					   (gen_t)statp->bs_gen,
+					   MAP_NDR_NOCHNG);
 				inomap_exclude_skipattr++;
 				return 0;
 			}
 
 			inomap_add(cb_inomap_contextp,
-				    ino,
-				    (gen_t)statp->bs_gen,
-				    MAP_NDR_CHANGE);
+				   ino,
+				   (gen_t)statp->bs_gen,
+				   MAP_NDR_CHANGE);
 			cb_nondircnt++;
 			cb_datasz += estimated_size;
 			cb_hdrsz += (EXTENTHDR_SZ * (statp->bs_extents + 1));
@@ -645,22 +645,22 @@ cb_add(void *arg1,
 		if (mode == S_IFDIR) {
 			if (cb_skip_unchanged_dirs) {
 				inomap_add(cb_inomap_contextp,
-					    ino,
-					    (gen_t)statp->bs_gen,
-					    MAP_DIR_NOCHNG);
+					   ino,
+					   (gen_t)statp->bs_gen,
+					   MAP_DIR_NOCHNG);
 			} else {
 				*cb_pruneneededp = BOOL_TRUE;
 				inomap_add(cb_inomap_contextp,
-					    ino,
-					    (gen_t)statp->bs_gen,
-					    MAP_DIR_SUPPRT);
+					   ino,
+					   (gen_t)statp->bs_gen,
+					   MAP_DIR_SUPPRT);
 				cb_dircnt++;
 			}
 		} else {
 			inomap_add(cb_inomap_contextp,
-				    ino,
-				    (gen_t)statp->bs_gen,
-				    MAP_NDR_NOCHNG);
+				   ino,
+				   (gen_t)statp->bs_gen,
+				   MAP_NDR_NOCHNG);
 		}
 	}
 
@@ -674,17 +674,17 @@ cb_inoinresumerange(xfs_ino_t ino)
 
 	for (streamix = 0; streamix < cb_resumerangecnt; streamix++) {
 		register drange_t *rp = &cb_resumerangep[streamix];
-		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
-		     &&
-		     ino >= rp->dr_begin.sp_ino
-		     &&
-		     ((rp->dr_end.sp_flags & STARTPT_FLAGS_END)
-		       ||
-		       ino < rp->dr_end.sp_ino
-		       ||
-		       (ino == rp->dr_end.sp_ino
-			 &&
-			 rp->dr_end.sp_offset != 0))) {
+		if (!(rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
+		    &&
+		    ino >= rp->dr_begin.sp_ino
+		    &&
+		    ((rp->dr_end.sp_flags & STARTPT_FLAGS_END)
+		     ||
+		     ino < rp->dr_end.sp_ino
+		     ||
+		     (ino == rp->dr_end.sp_ino
+		      &&
+		      rp->dr_end.sp_offset != 0))) {
 			return BOOL_TRUE;
 		}
 	}
@@ -699,11 +699,11 @@ cb_inoresumed(xfs_ino_t ino)
 
 	for (streamix = 0; streamix < cb_resumerangecnt; streamix++) {
 		drange_t *rp = &cb_resumerangep[streamix];
-		if (! (rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
-		     &&
-		     ino == rp->dr_begin.sp_ino
-		     &&
-		     rp->dr_begin.sp_offset != 0) {
+		if (!(rp->dr_begin.sp_flags & STARTPT_FLAGS_END)
+		    &&
+		    ino == rp->dr_begin.sp_ino
+		    &&
+		    rp->dr_begin.sp_offset != 0) {
 			return BOOL_TRUE;
 		}
 	}
@@ -717,12 +717,12 @@ cb_inoresumed(xfs_ino_t ino)
  * (-> nochng) on the way back up after examining all descendents.
  */
 /* ARGSUSED */
-static bool_t			/* false, used as diriter callback */
-supprt_prune(void *arg1,	/* ancestors marked as changed? */
-	      jdm_fshandle_t *fshandlep,
-	      int fsfd,
-	      xfs_bstat_t *statp,
-	      char *name)
+static bool_t                           /* false, used as diriter callback */
+supprt_prune(void *		arg1,   /* ancestors marked as changed? */
+	     jdm_fshandle_t *	fshandlep,
+	     int		fsfd,
+	     xfs_bstat_t *	statp,
+	     char *		name)
 {
 	static bool_t cbrval = BOOL_FALSE;
 	int state;
@@ -732,33 +732,33 @@ supprt_prune(void *arg1,	/* ancestors marked as changed? */
 
 		state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
 		if (state != MAP_DIR_CHANGE &&
-                     state != MAP_DIR_NOCHNG &&
-		     state != MAP_DIR_SUPPRT) {
+		    state != MAP_DIR_NOCHNG &&
+		    state != MAP_DIR_SUPPRT) {
 			/*
 			 * if file is now a dir then it has
 			 * certainly changed.
 			 */
 			state = MAP_DIR_CHANGE;
 			inomap_set_state(cb_inomap_contextp,
-					  statp->bs_ino,
-					  state);
+					 statp->bs_ino,
+					 state);
 		}
 
 		(void)diriter(fshandlep,
-				 fsfd,
-				 statp,
-				 supprt_prune,
-				 (void *)&changed_below,
-				 &cbrval,
-				 NULL,
-				 0);
+			      fsfd,
+			      statp,
+			      supprt_prune,
+			      (void *)&changed_below,
+			      &cbrval,
+			      NULL,
+			      0);
 
 		if (state == MAP_DIR_SUPPRT) {
 			if (changed_below == BOOL_FALSE) {
 				inomap_set_state(cb_inomap_contextp,
-						  statp->bs_ino,
-						  MAP_DIR_NOCHNG);
-				cb_dircnt--;	/* dump size just changed! */
+						 statp->bs_ino,
+						 MAP_DIR_NOCHNG);
+				cb_dircnt--;    /* dump size just changed! */
 			}
 			else {
 				/* Directory entries back up the hierarchy */
@@ -781,7 +781,7 @@ supprt_prune(void *arg1,	/* ancestors marked as changed? */
 
 	state = inomap_get_state(cb_inomap_contextp, statp->bs_ino);
 	if (state != MAP_NDR_CHANGE &&
-	     state != MAP_NDR_NOCHNG) {
+	    state != MAP_NDR_NOCHNG) {
 		/*
 		 * if dir is now a file then it has
 		 * certainly changed.
@@ -829,28 +829,28 @@ cb_spinit(void)
  * or split the file between the old and new streams. in the case of
  * a split decision, always split at a BBSIZE boundary.
  */
-#define TOO_SHY		1000000	/* max accept. accum short of target */
-#define TOO_BOLD	1000000	/* max accept. accum beyond target */
+#define TOO_SHY         1000000 /* max accept. accum short of target */
+#define TOO_BOLD        1000000 /* max accept. accum beyond target */
 
 typedef enum {
-	HOLD,	/* don't change */
-	BUMP,	/* set a new start point and put this file after it */
-	SPLIT,	/* set a new start point and split this file across it */
-	YELL	/* impossible condition; complain */
+	HOLD,   /* don't change */
+	BUMP,   /* set a new start point and put this file after it */
+	SPLIT,  /* set a new start point and split this file across it */
+	YELL    /* impossible condition; complain */
 } action_t;
 
 /* ARGSUSED */
 static int
-cb_startpt(void *arg1,
-	    jdm_fshandle_t *fshandlep,
-	    int fsfd,
-	    xfs_bstat_t *statp)
+cb_startpt(void *		arg1,
+	   jdm_fshandle_t *	fshandlep,
+	   int			fsfd,
+	   xfs_bstat_t *	statp)
 {
 	register int state;
 
 	off64_t estimate;
 	off64_t old_accum = cb_accum;
-	off64_t qty;	/* amount of a SPLIT file to skip */
+	off64_t qty;    /* amount of a SPLIT file to skip */
 	action_t action;
 
 	(*inomap_statdonep)++;
@@ -927,7 +927,7 @@ cb_startpt(void *arg1,
 				action = (action_t)HOLD;
 			} else if (cb_accum - cb_target < TOO_BOLD) {
 				if (cb_accum - cb_target >=
-						      cb_target - old_accum) {
+				    cb_target - old_accum) {
 					action = (action_t)BUMP;
 				} else {
 					action = (action_t)HOLD;
@@ -959,9 +959,9 @@ cb_startpt(void *arg1,
 			      &
 			      ~(off64_t)(BBSIZE - 1);
 			cb_startptp->sp_offset =
-					quantity2offset(fshandlep,
-							 statp,
-							 qty);
+				quantity2offset(fshandlep,
+						statp,
+						qty);
 			cb_startptix++;
 			cb_startptp++;
 			cb_target += cb_incr;
@@ -986,22 +986,22 @@ cb_startpt(void *arg1,
  * define structure for ino to gen mapping.
  */
 struct i2gseg {
-	uint64_t s_valid;
-	gen_t s_gen[INOPERSEG];
+	uint64_t	s_valid;
+	gen_t		s_gen[INOPERSEG];
 };
 typedef struct i2gseg i2gseg_t;
 
 typedef struct seg_addr {
-	int hnkoff;
-	int segoff;
-	int inooff;
+	int	hnkoff;
+	int	segoff;
+	int	inooff;
 } seg_addr_t;
 
 static struct inomap {
-	hnk_t *hnkmap;
-	int hnkmaplen;
-	i2gseg_t *i2gmap;
-	seg_addr_t lastseg;
+	hnk_t *		hnkmap;
+	int		hnkmaplen;
+	i2gseg_t *	i2gmap;
+	seg_addr_t	lastseg;
 } inomap;
 
 static inline void
@@ -1096,8 +1096,8 @@ inomap_init(int igrpcnt)
 	inomap.hnkmaplen = (igrpcnt + SEGPERHNK - 1) / SEGPERHNK;
 	inomap.hnkmap = (hnk_t *)malloc(inomap.hnkmaplen * HNKSZ);
 	inomap.i2gmap = (i2gseg_t *)
-		calloc(inomap.hnkmaplen * SEGPERHNK, sizeof(i2gseg_t));
-	if (!inomap.hnkmap || !inomap.i2gmap)
+			calloc(inomap.hnkmaplen * SEGPERHNK, sizeof(i2gseg_t));
+	if (! inomap.hnkmap || ! inomap.i2gmap)
 		return -1;
 	return 0;
 }
@@ -1117,7 +1117,7 @@ inomap_validaddr(seg_addr_t *addrp)
 		return BOOL_FALSE;
 
 	maxseg = (addrp->hnkoff == inomap.lastseg.hnkoff) ?
-			inomap.lastseg.segoff : SEGPERHNK - 1;
+		 inomap.lastseg.segoff : SEGPERHNK - 1;
 
 	if (addrp->segoff < 0 || addrp->segoff > maxseg)
 		return BOOL_FALSE;
@@ -1175,15 +1175,15 @@ cb_add_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 
 			inomap.hnkmaplen++;
 			inomap.hnkmap = (hnk_t *)
-				realloc(inomap.hnkmap, inomap.hnkmaplen * HNKSZ);
+					realloc(inomap.hnkmap, inomap.hnkmaplen * HNKSZ);
 
 			numsegs = inomap.hnkmaplen * SEGPERHNK;
 			if (numsegs < 0)
 				return -1;
 			inomap.i2gmap = (i2gseg_t *)
-				realloc(inomap.i2gmap, numsegs * sizeof(i2gseg_t));
+					realloc(inomap.i2gmap, numsegs * sizeof(i2gseg_t));
 
-			if (!inomap.hnkmap || !inomap.i2gmap)
+			if (! inomap.hnkmap || ! inomap.i2gmap)
 				return -1;
 
 			/* zero the new portion of the i2gmap */
@@ -1217,10 +1217,10 @@ void *
 inomap_alloc_context(void)
 {
 	void *addr = calloc(1, sizeof(seg_addr_t));
-	if (!addr) {
+	if (! addr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR,
-		      _("failed to allocate inomap context: %s\n"),
-		      strerror(errno));
+		     _("failed to allocate inomap context: %s\n"),
+		     strerror(errno));
 	}
 	return addr;
 }
@@ -1281,11 +1281,11 @@ inomap_find_seg(seg_addr_t *addrp, xfs_ino_t ino)
 	int lower;
 	int upper;
 
-	if (!inomap_validaddr(addrp) ) {
+	if (! inomap_validaddr(addrp) ) {
 		inomap_reset_context(addrp);
 	}
 
-	if (!inomap_find_hnk(addrp, ino) )
+	if (! inomap_find_hnk(addrp, ino) )
 		return BOOL_FALSE;
 
 	/* find the correct segment */
@@ -1317,12 +1317,12 @@ inomap_iter(void *contextp, int statemask)
 	seg_addr_t *addrp = (seg_addr_t *)contextp;
 
 	for (;
-	      addrp->hnkoff <= inomap.lastseg.hnkoff;
-	      addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0) {
+	     addrp->hnkoff <= inomap.lastseg.hnkoff;
+	     addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0) {
 
 		for (;
-		      addrp->segoff <= inomap_lastseg(addrp->hnkoff);
-		      addrp->segoff++, addrp->inooff = 0) {
+		     addrp->segoff <= inomap_lastseg(addrp->hnkoff);
+		     addrp->segoff++, addrp->inooff = 0) {
 
 			segp = inomap_addr2seg(addrp);
 
@@ -1377,7 +1377,7 @@ inomap_set_state(void *contextp, xfs_ino_t ino, int state)
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (!inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino) )
 		return MAP_INO_UNUSED;
 
 	segp = inomap_addr2seg(addrp);
@@ -1396,7 +1396,7 @@ inomap_get_state(void *contextp, xfs_ino_t ino)
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (!inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino) )
 		return MAP_INO_UNUSED;
 
 	segp = inomap_addr2seg(addrp);
@@ -1414,7 +1414,7 @@ inomap_set_gen(void *contextp, xfs_ino_t ino, gen_t gen)
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (!inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino) )
 		return;
 
 	segp = inomap_addr2seg(addrp);
@@ -1435,14 +1435,14 @@ inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen)
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (!inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino) )
 		return 1;
 
 	segp = inomap_addr2seg(addrp);
 	i2gsegp = &inomap.i2gmap[inomap_addr2segix(addrp)];
 
 	relino = ino - segp->base;
-	if (! (i2gsegp->s_valid & ((uint64_t)1 << relino)))
+	if (!(i2gsegp->s_valid & ((uint64_t)1 << relino)))
 		return 1;
 
 	*gen = i2gsegp->s_gen[relino];
@@ -1475,8 +1475,8 @@ inomap_dump(drive_t *drivep)
 	 * use write_buf to dump the hunks
 	 */
 	for (addr.hnkoff = 0;
-	      addr.hnkoff <= inomap.lastseg.hnkoff;
-	      addr.hnkoff++) {
+	     addr.hnkoff <= inomap.lastseg.hnkoff;
+	     addr.hnkoff++) {
 		int rval;
 		rv_t rv;
 		drive_ops_t *dop = drivep->d_opsp;
@@ -1485,10 +1485,10 @@ inomap_dump(drive_t *drivep)
 
 		xlate_hnk(hnkp, &tmphnkp, 1);
 		rval = write_buf((char *)&tmphnkp,
-				  sizeof(tmphnkp),
-				  (void *)drivep,
-				  (gwbfp_t)dop->do_get_write_buf,
-				  (wfp_t)dop->do_write);
+				 sizeof(tmphnkp),
+				 (void *)drivep,
+				 (gwbfp_t)dop->do_get_write_buf,
+				 (wfp_t)dop->do_write);
 		switch (rval) {
 		case 0:
 			rv = RV_OK;
@@ -1517,11 +1517,11 @@ inomap_dump(drive_t *drivep)
 }
 
 static int
-subtreelist_parse(jdm_fshandle_t *fshandlep,
-		   int fsfd,
-		   xfs_bstat_t *rootstatp,
-		   char *subtreebuf[],
-		   ix_t subtreecnt)
+subtreelist_parse(jdm_fshandle_t *	fshandlep,
+		  int			fsfd,
+		  xfs_bstat_t *		rootstatp,
+		  char *		subtreebuf[],
+		  ix_t			subtreecnt)
 {
 	ix_t subtreeix;
 
@@ -1538,19 +1538,19 @@ subtreelist_parse(jdm_fshandle_t *fshandlep,
 		char *currentpath = subtreebuf[subtreeix];
 		assert(*currentpath != '/');
 		(void)diriter(fshandlep,
-				 fsfd,
-				 rootstatp,
-				 subtreelist_parse_cb,
-				 (void *)currentpath,
-				 &cbrval,
-				 NULL,
-				 0);
+			      fsfd,
+			      rootstatp,
+			      subtreelist_parse_cb,
+			      (void *)currentpath,
+			      &cbrval,
+			      NULL,
+			      0);
 		if (cbrval != 1) {
 			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_INOMAP,
-			      "%s: %s\n",
-			      cbrval == 0 ? _("subtree not present")
-					  : _("invalid subtree specified"),
-			      currentpath);
+			     "%s: %s\n",
+			     cbrval == 0 ? _("subtree not present")
+			     : _("invalid subtree specified"),
+			     currentpath);
 			return -1;
 		}
 	}
@@ -1559,11 +1559,11 @@ subtreelist_parse(jdm_fshandle_t *fshandlep,
 }
 
 static int
-subtreelist_parse_cb(void *arg1,
-		      jdm_fshandle_t *fshandlep,
-		      int fsfd,
-		      xfs_bstat_t *statp,
-		      char *name)
+subtreelist_parse_cb(void *		arg1,
+		     jdm_fshandle_t *	fshandlep,
+		     int		fsfd,
+		     xfs_bstat_t *	statp,
+		     char *		name)
 {
 	int cbrval = 0;
 
@@ -1610,20 +1610,20 @@ subtreelist_parse_cb(void *arg1,
 
 		/*
 		 * repair the subpath
-		*/
+		 */
 		*nextslash = '/';
 
 		/*
 		 * peel the first element of the subpath and recurse
-		*/
+		 */
 		(void)diriter(fshandlep,
-				 fsfd,
-				 statp,
-				 subtreelist_parse_cb,
-				 (void *)(nextslash + 1),
-				 &cbrval,
-				 NULL,
-				 0);
+			      fsfd,
+			      statp,
+			      subtreelist_parse_cb,
+			      (void *)(nextslash + 1),
+			      &cbrval,
+			      NULL,
+			      0);
 		return cbrval;
 
 	} else {
@@ -1638,23 +1638,23 @@ subtreelist_parse_cb(void *arg1,
 		}
 
 		(void)diriter(fshandlep,
-				 fsfd,
-				 statp,
-				 subtree_descend_cb,
-				 NULL,
-				 &cbrval,
-				 0,
-				 0);
+			      fsfd,
+			      statp,
+			      subtree_descend_cb,
+			      NULL,
+			      &cbrval,
+			      0,
+			      0);
 		return 1;
 	}
 }
 
 static int
-subtree_descend_cb(void *arg1,
-		    jdm_fshandle_t *fshandlep,
-		    int fsfd,
-		    xfs_bstat_t *statp,
-		    char *name)
+subtree_descend_cb(void *		arg1,
+		   jdm_fshandle_t *	fshandlep,
+		   int			fsfd,
+		   xfs_bstat_t *	statp,
+		   char *		name)
 {
 	int cbrval = 0;
 
@@ -1663,13 +1663,13 @@ subtree_descend_cb(void *arg1,
 	if ((statp->bs_mode & S_IFMT) == S_IFDIR) {
 
 		(void)diriter(fshandlep,
-				 fsfd,
-				 statp,
-				 subtree_descend_cb,
-				 NULL,
-				 &cbrval,
-				 NULL,
-				 0);
+			      fsfd,
+			      statp,
+			      subtree_descend_cb,
+			      NULL,
+			      &cbrval,
+			      NULL,
+			      0);
 	}
 
 	return cbrval;
@@ -1679,7 +1679,7 @@ subtree_descend_cb(void *arg1,
  * uses the extent map to figure the first offset in the file
  * with qty real (non-hole) bytes behind it
  */
-#define BMAP_LEN	512
+#define BMAP_LEN        512
 
 static off64_t
 quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
@@ -1711,9 +1711,9 @@ quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 	fd = jdm_open(fshandlep, statp, O_RDONLY);
 	if (fd < 0) {
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
-		      "could not open ino %llu to read extent map: %s\n"),
-		      statp->bs_ino,
-		      strerror(errno));
+			     "could not open ino %llu to read extent map: %s\n"),
+		     statp->bs_ino,
+		     strerror(errno));
 		return 0;
 	}
 
@@ -1724,9 +1724,9 @@ quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
 		rval = ioctl(fd, XFS_IOC_GETBMAPX, bmap);
 		if (rval) {
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
-			      "could not read extent map for ino %llu: %s\n"),
-			      statp->bs_ino,
-			      strerror(errno));
+				     "could not read extent map for ino %llu: %s\n"),
+			     statp->bs_ino,
+			     strerror(errno));
 			(void)close(fd);
 			return 0;
 		}
@@ -1767,7 +1767,7 @@ estimate_dump_space(xfs_bstat_t *statp)
 		 * specified and the HSM provided an estimate, then use it.
 		 */
 		if (hsm_fs_ctxtp) {
-			off64_t	bytes;
+			off64_t bytes;
 			int accurate;
 
 			/*
@@ -1790,17 +1790,17 @@ estimate_dump_space(xfs_bstat_t *statp)
 	case S_IFBLK:
 	case S_IFSOCK:
 	case S_IFLNK:
-	/*
-	 * not yet
-	case S_IFUUID:
-	*/
+		/*
+		 * not yet
+		   case S_IFUUID:
+		 */
 		return 0;
 	default:
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
-		      "unknown inode type: ino=%llu, mode=0x%04x 0%06o\n"),
-		      statp->bs_ino,
-		      statp->bs_mode,
-		      statp->bs_mode);
+			     "unknown inode type: ino=%llu, mode=0x%04x 0%06o\n"),
+		     statp->bs_ino,
+		     statp->bs_mode,
+		     statp->bs_mode);
 		return 0;
 	}
 }
diff --git a/dump/inomap.h b/dump/inomap.h
index b9619f6..2ae6b71 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -49,24 +49,24 @@ struct xfs_bstat;
  * fall at file boundaries. returns BOOL_FALSE if error encountered (should
  * abort the dump; else returns BOOL_TRUE.
  */
-extern bool_t inomap_build(void *fshandlep,
-			    int fsfd,
-			    struct xfs_bstat *rootstatp,
-			    bool_t last,
-	      		    time32_t lasttime,
-			    bool_t resume,
-	      		    time32_t resumetime,
-			    size_t resumerangecnt,
-			    drange_t *resumerangep,
-			    char *subtreebuf[],
-			    ix_t subtreecnt,
-			    bool_t skip_unchanged_dirs,
-			    startpt_t startptp[],
-	      		    size_t startptcnt,
-			    ix_t *statphasep,
-			    ix_t *statpassp,
-			    size64_t statcnt,
-			    size64_t *statdonep);
+extern bool_t inomap_build(void *		fshandlep,
+			   int			fsfd,
+			   struct xfs_bstat *	rootstatp,
+			   bool_t		last,
+			   time32_t		lasttime,
+			   bool_t		resume,
+			   time32_t		resumetime,
+			   size_t		resumerangecnt,
+			   drange_t *		resumerangep,
+			   char *		subtreebuf[],
+			   ix_t			subtreecnt,
+			   bool_t		skip_unchanged_dirs,
+			   startpt_t		startptp[],
+			   size_t		startptcnt,
+			   ix_t *		statphasep,
+			   ix_t *		statpassp,
+			   size64_t		statcnt,
+			   size64_t *		statdonep);
 
 extern uint64_t inomap_getsz(void);
 
@@ -94,14 +94,14 @@ extern rv_t inomap_dump(drive_t *drivep);
 /*
  * map state values
  */
-#define MAP_INO_UNUSED	0       /* ino not in use by fs */
-#define MAP_DIR_NOCHNG	1       /* dir, ino in use by fs, but not dumped */
-#define MAP_NDR_NOCHNG	2       /* non-dir, ino in use by fs, but not dumped */
-#define MAP_DIR_CHANGE	3       /* dir, changed since last dump */
-#define MAP_NDR_CHANGE	4       /* non-dir, changed since last dump */
-#define MAP_DIR_SUPPRT	5       /* dir, unchanged but needed for hierarchy */
-#define MAP_RESERVED1	6       /* this state currently not used */
-#define MAP_RESERVED2	7       /* this state currently not used */
+#define MAP_INO_UNUSED  0       /* ino not in use by fs */
+#define MAP_DIR_NOCHNG  1       /* dir, ino in use by fs, but not dumped */
+#define MAP_NDR_NOCHNG  2       /* non-dir, ino in use by fs, but not dumped */
+#define MAP_DIR_CHANGE  3       /* dir, changed since last dump */
+#define MAP_NDR_CHANGE  4       /* non-dir, changed since last dump */
+#define MAP_DIR_SUPPRT  5       /* dir, unchanged but needed for hierarchy */
+#define MAP_RESERVED1   6       /* this state currently not used */
+#define MAP_RESERVED2   7       /* this state currently not used */
 
 /*
  * the inomap is implemented as a linked list of chunks. each chunk contains
@@ -110,24 +110,24 @@ extern rv_t inomap_dump(drive_t *drivep);
  * index and manipulate the 3-bit state values.
  */
 struct seg {
-	xfs_ino_t base;
-	uint64_t lobits;
-	uint64_t mebits;
-	uint64_t hibits;
+	xfs_ino_t	base;
+	uint64_t	lobits;
+	uint64_t	mebits;
+	uint64_t	hibits;
 };
 
 typedef struct seg seg_t;
 
-#define INOPERSEG	(sizeof(((seg_t *)0)->lobits) * NBBY)
+#define INOPERSEG       (sizeof(((seg_t *)0)->lobits) * NBBY)
 
-#define HNKSZ		(4 * PGSZ)
-#define SEGPERHNK	((HNKSZ / sizeof(seg_t)) - 1)
+#define HNKSZ           (4 * PGSZ)
+#define SEGPERHNK       ((HNKSZ / sizeof(seg_t)) - 1)
 
 struct hnk {
-	seg_t seg[SEGPERHNK];
-	xfs_ino_t maxino;
-	struct hnk *nextp;		/* no longer used, kept for binary compat */
-	char pad[sizeof(seg_t) - sizeof(xfs_ino_t) - sizeof(struct hnk *)];
+	seg_t		seg[SEGPERHNK];
+	xfs_ino_t	maxino;
+	struct hnk *	nextp;          /* no longer used, kept for binary compat */
+	char		pad[sizeof(seg_t) - sizeof(xfs_ino_t) - sizeof(struct hnk *)];
 };
 
 typedef struct hnk hnk_t;
diff --git a/dump/var.c b/dump/var.c
index a195693..47ec9fa 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -66,14 +66,14 @@ var_create_component(char *path)
 
 	if (rval && errno != EEXIST) {
 		mlog(MLOG_NORMAL, _("unable to create %s: %s\n"),
-		      path, strerror(errno));
+		     path, strerror(errno));
 		return 0;
 	}
 	if (rval == 0) {
 		rval = chown(path, 0, 0);
 		if (rval) {
 			mlog(MLOG_NORMAL, _("unable to chown %s: %s\n"),
-			      path, strerror(errno));
+			     path, strerror(errno));
 		}
 	}
 	return 1;
@@ -91,13 +91,13 @@ var_skip(uuid_t *dumped_fsidp, void (*cb)(xfs_ino_t ino))
 	rval = fs_getid(XFSDUMP_DIRPATH, &fsid);
 	if (rval) {
 #ifdef HIDDEN
-                /* NOTE: this will happen for non-XFS file systems */
-                /*       and is expected, so no msg */
+		/* NOTE: this will happen for non-XFS file systems */
+		/*       and is expected, so no msg */
 		mlog(MLOG_NORMAL, _(
-		      "unable to determine uuid of fs containing %s: "
-		      "%s\n"),
-		      XFSDUMP_DIRPATH,
-		      strerror(errno));
+			     "unable to determine uuid of fs containing %s: "
+			     "%s\n"),
+		     XFSDUMP_DIRPATH,
+		     strerror(errno));
 #endif
 		return;
 	}
@@ -124,15 +124,15 @@ var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 	rval = lstat64(base, &statbuf);
 	if (rval) {
 		mlog(MLOG_NORMAL, _(
-		      "unable to get status of %s: %s\n"),
-		      base,
-		      strerror(errno));
+			     "unable to get status of %s: %s\n"),
+		     base,
+		     strerror(errno));
 		return;
 	}
 
 	mlog(MLOG_DEBUG,
-	      "excluding %s from dump\n",
-	      base);
+	     "excluding %s from dump\n",
+	     base);
 
 	(*cb)(statbuf.st_ino);
 
@@ -143,8 +143,8 @@ var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 	dirp = opendir(base);
 	if (! dirp) {
 		mlog(MLOG_NORMAL, _(
-		      "unable to open directory %s\n"),
-		      base);
+			     "unable to open directory %s\n"),
+		     base);
 		return;
 	}
 
@@ -155,12 +155,12 @@ var_skip_recurse(char *base, void (*cb)(xfs_ino_t ino))
 		 * skip "." and ".."
 		 */
 		if (*(direntp->d_name + 0) == '.'
-		     &&
-		     (*(direntp->d_name + 1) == 0
-		       ||
-		       (*(direntp->d_name + 1) == '.'
-			 &&
-			 *(direntp->d_name + 2) == 0))) {
+		    &&
+		    (*(direntp->d_name + 1) == 0
+		     ||
+		     (*(direntp->d_name + 1) == '.'
+		      &&
+		      *(direntp->d_name + 2) == 0))) {
 			continue;
 		}
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 21/24] xfsdump: (style) format intercharacter spaces
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (13 preceding siblings ...)
  2018-11-09 14:29 ` [PATCH 18/24] xfsdump: (2/4)(style) indent and align the code Jan Tulak
@ 2018-11-09 14:30 ` Jan Tulak
  2018-11-09 14:30 ` [PATCH 22/24] xfsdump: (style) format newlines Jan Tulak
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:30 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

This patch changes intercharacter spaces, e.g. adds a space around binary
operators, removes multiple spaces where they are not used for alignment,
removes a space in a function header ("fnt ()" -> "fnt()"), etc.

Created by Uncrustify with this config file:

#
# uncrustify config, format intercharacter spaces
#

indent_with_tabs	= 2		# 1=indent with tabs, align with spaces, 2=use all tabs
input_tab_size		= 8		# original tab size
output_tab_size		= 8		# new tab size
indent_columns		= output_tab_size

indent_label		= 1		# pos: absolute col, neg: relative column

#
# inter-symbol newlines
#

nl_enum_brace		= ignore	# "enum {" vs "enum
 {"
nl_union_brace		= ignore	# "union {" vs "union
 {"
nl_struct_brace		= ignore	# "struct {" vs "struct
 {"
nl_do_brace 		= ignore	# "do {" vs "do
 {"
nl_if_brace 		= ignore	# "if () {" vs "if ()
 {"
nl_for_brace 		= ignore	# "for () {" vs "for ()
 {"
nl_else_brace 		= ignore	# "else {" vs "else
 {"
nl_while_brace 		= ignore	# "while () {" vs "while ()
 {"
nl_switch_brace 	= ignore	# "switch () {" vs "switch ()
 {"
nl_brace_while		= ignore	# "} while" vs "}
 while" - cuddle while
nl_brace_else		= ignore	# "} else" vs "}
 else" - cuddle else
sp_brace_else		= ignore
sp_else_brace		= ignore
nl_fcall_brace		= ignore	# "list_for_each() {" vs "list_for_each()
{"
nl_fdef_brace		= ignore		# "int foo() {" vs "int foo()
{"

#
# Source code modifications
#

mod_paren_on_return	= ignore	# "return 1;" vs "return (1);"
mod_full_brace_for	= ignore	# "for () a--;" vs "for () { a--; }"
mod_full_brace_do	= ignore	# "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while	= ignore	# "while (a) a--;" vs "while (a) { a--; }"

#
# inter-character spacing options
#

sp_return_paren		= force		# "return (1);" vs "return(1);"
sp_sizeof_paren		= remove	# "sizeof (int)" vs "sizeof(int)"
sp_before_sparen	= force		# "if (" vs "if("
sp_after_sparen		= force		# "if () {" vs "if (){"
sp_after_cast		= remove	# "(int) a" vs "(int)a"
sp_inside_braces	= force		# "{ 1 }" vs "{1}"
sp_inside_braces_struct	= force	# "{ 1 }" vs "{1}"
sp_inside_braces_enum	= force	# "{ 1 }" vs "{1}"
sp_assign		= force
sp_arith		= force
sp_bool			= force
sp_compare		= force
sp_assign		= force
sp_after_comma		= force
sp_func_def_paren	= remove	# "int foo (){" vs "int foo(){"
sp_func_call_paren	= remove	# "foo (" vs "foo("
sp_func_proto_paren	= remove	# "int foo ();" vs "int foo();"

#
# Aligning stuff
#

align_with_tabs		= TRUE		# use tabs to align
align_on_tabstop	= TRUE 		# align on tabstops
align_enum_equ_span	= 4		# '=' in enum definition
align_var_def_colon	= TRUE
align_struct_init_span	= 3		# align stuff in a structure init '= { }'
align_right_cmt_span	= 3

#
# other
#

nl_func_paren = ignore
nl_func_decl_start = ignore
nl_func_decl_empty = ignore
nl_func_decl_args = ignore
nl_func_decl_end = ignore

sp_inside_paren = remove
sp_inside_square = remove
sp_inside_paren_cast = remove
sp_inside_fparen = remove
sp_inside_sparen = remove
sp_paren_paren = remove
sp_before_ptr_star = force
sp_after_ptr_star = remove
sp_between_ptr_star = remove
align_func_params = true
align_var_struct_span = 6

eat_blanks_after_open_brace   = false
eat_blanks_before_close_brace = false
pp_indent = ignore

nl_start_of_file   = ignore
nl_end_of_file     = ignore
nl_end_of_file_min = 1
nl_comment_func_def = 1

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/cldmgr.c         |   2 +-
 common/cleanup.c        |   2 +-
 common/content_inode.h  |  20 ++--
 common/dlog.c           |   8 +-
 common/drive.h          |   2 +-
 common/drive_minrmt.c   |  28 +++---
 common/drive_scsitape.c |  38 ++++----
 common/drive_simple.c   |  14 +--
 common/fs.c             |   4 +-
 common/getdents.h       |   2 +-
 common/global.c         |   6 +-
 common/global.h         |   2 +-
 common/hsmapi.c         |   8 +-
 common/inventory.c      | 112 +++++++++++-----------
 common/inventory.h      |   6 +-
 common/main.c           |  14 +--
 common/mlog.c           |   8 +-
 common/path.c           |  12 +--
 common/path.h           |   4 +-
 common/stream.c         |  10 +-
 common/timeutil.c       |   4 +-
 common/ts_mtio.h        |   4 +-
 common/types.h          |   4 +-
 common/util.c           |   4 +-
 common/util.h           |  12 +--
 dump/content.c          |  56 +++++------
 dump/inomap.c           |  24 ++---
 dump/var.c              |   4 +-
 include/swab.h          |  24 ++---
 include/swap.h          |   2 +-
 inventory/inv_api.c     | 106 ++++++++++----------
 inventory/inv_core.c    |  34 +++----
 inventory/inv_fstab.c   |  48 +++++-----
 inventory/inv_idx.c     |  64 ++++++-------
 inventory/inv_mgr.c     |  72 +++++++-------
 inventory/inv_oref.c    |  22 ++---
 inventory/inv_oref.h    |  40 ++++----
 inventory/inv_priv.h    |  48 +++++-----
 inventory/inv_stobj.c   | 208 ++++++++++++++++++++--------------------
 inventory/inventory.h   |  12 +--
 inventory/testmain.c    |  86 ++++++++---------
 invutil/cmenu.h         |   2 +-
 invutil/fstab.c         |   8 +-
 invutil/invidx.c        |  30 +++---
 invutil/invutil.c       | 106 ++++++++++----------
 invutil/invutil.h       |  18 ++--
 invutil/menu.c          |   2 +-
 invutil/stobj.c         |  26 ++---
 librmt/isrmt.c          |   2 +-
 librmt/rmtaccess.c      |   6 +-
 librmt/rmtclose.c       |  12 +--
 librmt/rmtcommand.c     |   4 +-
 librmt/rmtcreat.c       |  10 +-
 librmt/rmtdev.c         |   6 +-
 librmt/rmtfstat.c       |  12 +--
 librmt/rmtioctl.c       |  38 ++++----
 librmt/rmtisatty.c      |   6 +-
 librmt/rmtlib.h         |   4 +-
 librmt/rmtlseek.c       |  12 +--
 librmt/rmtmsg.c         |   2 +-
 librmt/rmtopen.c        |  40 ++++----
 librmt/rmtread.c        |  14 +--
 librmt/rmtstatus.c      |  10 +-
 librmt/rmtwrite.c       |  14 +--
 restore/bag.h           |   2 +-
 restore/content.c       | 110 ++++++++++-----------
 restore/dirattr.c       |   4 +-
 restore/inomap.c        |   8 +-
 restore/mmap.c          |   6 +-
 restore/namreg.c        |   8 +-
 restore/node.c          |   4 +-
 restore/tree.c          |  40 ++++----
 72 files changed, 873 insertions(+), 873 deletions(-)

diff --git a/common/cldmgr.c b/common/cldmgr.c
index d56363d..cfefa62 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -81,7 +81,7 @@ cldmgr_create(int (*	entry)(void *arg1),
 	cld_t *cldp;
 	int rval;
 
-	assert(pthread_equal(pthread_self(), cldmgr_parenttid) );
+	assert(pthread_equal(pthread_self(), cldmgr_parenttid));
 
 	cldp = cldmgr_getcld();
 	if (! cldp) {
diff --git a/common/cleanup.c b/common/cleanup.c
index 68f3cc6..c473705 100644
--- a/common/cleanup.c
+++ b/common/cleanup.c
@@ -139,7 +139,7 @@ cleanup_early(void)
 		if (cuptr->cu_flags & CU_EARLY) {
 			(*cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2);
 			free((void *)cuptr);
-			if (cuprevp)  {
+			if (cuprevp) {
 				cuprevp->cu_nextp = cunextp;
 			} else {
 				cu_rootp = cunextp;
diff --git a/common/content_inode.h b/common/content_inode.h
index 0fbb9b0..7b94ba2 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -124,16 +124,16 @@ typedef struct content_inode_hdr content_inode_hdr_t;
 /*
  * dump attributes
  */
-#define CIH_DUMPATTR_SUBTREE                    (1 <<  0)
-#define CIH_DUMPATTR_INDEX                      (1 <<  1)
-#define CIH_DUMPATTR_INVENTORY                  (1 <<  2)
-#define CIH_DUMPATTR_INCREMENTAL                (1 <<  3)
-#define CIH_DUMPATTR_RETRY                      (1 <<  4)
-#define CIH_DUMPATTR_RESUME                     (1 <<  5)
-#define CIH_DUMPATTR_INOMAP                     (1 <<  6)
-#define CIH_DUMPATTR_DIRDUMP                    (1 <<  7)
-#define CIH_DUMPATTR_FILEHDR_CHECKSUM           (1 <<  8)
-#define CIH_DUMPATTR_EXTENTHDR_CHECKSUM         (1 <<  9)
+#define CIH_DUMPATTR_SUBTREE                    (1 << 0)
+#define CIH_DUMPATTR_INDEX                      (1 << 1)
+#define CIH_DUMPATTR_INVENTORY                  (1 << 2)
+#define CIH_DUMPATTR_INCREMENTAL                (1 << 3)
+#define CIH_DUMPATTR_RETRY                      (1 << 4)
+#define CIH_DUMPATTR_RESUME                     (1 << 5)
+#define CIH_DUMPATTR_INOMAP                     (1 << 6)
+#define CIH_DUMPATTR_DIRDUMP                    (1 << 7)
+#define CIH_DUMPATTR_FILEHDR_CHECKSUM           (1 << 8)
+#define CIH_DUMPATTR_EXTENTHDR_CHECKSUM         (1 << 9)
 #define CIH_DUMPATTR_DIRENTHDR_CHECKSUM         (1 << 10)
 #define CIH_DUMPATTR_DIRENTHDR_GEN              (1 << 11)
 #define CIH_DUMPATTR_EXTATTR                    (1 << 12)
diff --git a/common/dlog.c b/common/dlog.c
index c998321..0b71370 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -471,7 +471,7 @@ promptinput(char *	buf,
 		FD_SET(dlog_ttyfd, &rfds);
 
 		rc = select(dlog_ttyfd + 1, &rfds, NULL, NULL, &tv);
-		if (rc > 0 && FD_ISSET(dlog_ttyfd, &rfds) ) {
+		if (rc > 0 && FD_ISSET(dlog_ttyfd, &rfds)) {
 			nread = read(dlog_ttyfd, bufp, bufsz);
 			if (nread < 0) {
 				break; // error handled below
@@ -479,13 +479,13 @@ promptinput(char *	buf,
 				mlog(MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, "\n");
 				*bufp = 0;
 				break; // no input, return an empty string
-			} else if (nread > 0 && bufp[nread-1] == '\n') {
+			} else if (nread > 0 && bufp[nread - 1] == '\n') {
 				// received a full line, chomp the newline
-				bufp[nread-1] = 0;
+				bufp[nread - 1] = 0;
 				break;
 			} else if (nread == bufsz) {
 				// no more room, truncate and return
-				bufp[nread-1] = 0;
+				bufp[nread - 1] = 0;
 				break;
 			}
 
diff --git a/common/drive.h b/common/drive.h
index 2700187..ddcc230 100644
--- a/common/drive.h
+++ b/common/drive.h
@@ -626,7 +626,7 @@ struct drive_ops {
 	 * and performance info. set to NULL if
 	 * nothing to say.
 	 */
-	void	(*do_quit)(drive_t * drivep);
+	void	(*do_quit)(drive_t *drivep);
 	/*
 	 * tells the drive manager to de-allocate
 	 * resources, INCLUDING the slave process.
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 9a6c252..1423486 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -292,7 +292,7 @@ extern int rmtopen(char *, int, ...);
 extern int rmtclose(int);
 extern int rmtfstat(int, struct stat *);
 extern int rmtioctl(int, int, ...);
-extern int rmtread(int, void*, uint);
+extern int rmtread(int, void *, uint);
 extern int rmtwrite(int, const void *, uint);
 
 
@@ -319,7 +319,7 @@ static void do_get_mark(drive_t *, drive_mark_t *);
 static void do_end_read(drive_t *);
 static int do_begin_write(drive_t *);
 static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
-static char * do_get_write_buf(drive_t *, size_t, size_t *);
+static char *do_get_write_buf(drive_t *, size_t, size_t *);
 static int do_write(drive_t *, char *, size_t);
 static size_t do_get_align_cnt(drive_t *);
 static int do_end_write(drive_t *, off64_t *);
@@ -366,7 +366,7 @@ static int getrec(drive_t *drivep);
 static int
 write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
 	     bool_t xlatepr);
-static ring_msg_t * Ring_get(ring_t *ringp);
+static ring_msg_t *Ring_get(ring_t *ringp);
 static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
 static void Ring_put(ring_t *ringp, ring_msg_t *msgp);
 static int validate_media_file_hdr(drive_t *drivep);
@@ -1123,7 +1123,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 		off64_t nextrecoffset;
 		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		nextrecoffset = contextp->dc_reccnt  * (off64_t)tape_recsz
+		nextrecoffset = contextp->dc_reccnt * (off64_t)tape_recsz
 				+
 				(off64_t)rechdrp->rec_used;
 		if (wantedoffset >= nextrecoffset) {
@@ -1756,7 +1756,7 @@ do_begin_write(drive_t *drivep)
 	tpwhdrp->recsize = (int32_t)tape_recsz;
 	tpwhdrp->rec_used = 0;
 	tpwhdrp->file_offset = 0;
-	tpwhdrp->first_mark_offset= 0;
+	tpwhdrp->first_mark_offset = 0;
 	tpwhdrp->capability = drivep->d_capabilities;
 
 	/*
@@ -1827,7 +1827,7 @@ do_begin_write(drive_t *drivep)
 	/*
 	 * intialize header in new record
 	 */
-	rechdrp = (rec_hdr_t*)contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
 	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
@@ -2120,7 +2120,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)
  *	the number of bytes to next alignment
  */
 static size_t
-do_get_align_cnt(drive_t * drivep)
+do_get_align_cnt(drive_t *drivep)
 {
 	char *next_alignment_point;
 	intptr_t next_alignment_off;
@@ -2147,7 +2147,7 @@ do_get_align_cnt(drive_t * drivep)
 	 * and a multiple of PGSZ.
 	 */
 	next_alignment_off = (intptr_t)contextp->dc_nextp;
-	next_alignment_off +=  PGMASK;
+	next_alignment_off += PGMASK;
 	next_alignment_off &= ~PGMASK;
 	next_alignment_point = (char *)next_alignment_off;
 	assert(next_alignment_point <= contextp->dc_recendp);
@@ -2416,7 +2416,7 @@ do_fsf(drive_t *drivep, int count, int *statp)
 
 			op_failed = 0;
 			assert(contextp->dc_fd >= 0);
-			if (mt_op(contextp->dc_fd, MTFSF, 1) ) {
+			if (mt_op(contextp->dc_fd, MTFSF, 1)) {
 				op_failed = 1;
 			}
 
@@ -2425,7 +2425,7 @@ do_fsf(drive_t *drivep, int count, int *statp)
 			 * Check for a file mark to
 			 * determine if the fsf command worked.
 			 */
-			if  (! op_failed) {
+			if (! op_failed) {
 				done = 1;
 			}
 
@@ -3552,7 +3552,7 @@ checkhdr:
 					     _("may be an EFS dump at BOT\n"));
 				} else
 				/* Check if the tape was erased by us */
-				if  (isxfsdumperasetape(drivep)) {
+				if (isxfsdumperasetape(drivep)) {
 					mlog(MLOG_NORMAL | MLOG_DRIVE,
 					     _("This tape was erased earlier "
 					       "by xfsdump.\n"));
@@ -3772,7 +3772,7 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 
 	xlate_rec_hdr(tmprh, rechdrp, 1);
 
-	if (rechdrp->magic != STAPE_MAGIC)  {
+	if (rechdrp->magic != STAPE_MAGIC) {
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		     _("record %lld corrupt: bad magic number\n"),
 		     contextp->dc_iocnt - 1);
@@ -4181,7 +4181,7 @@ erase_and_verify(drive_t *drivep)
 	 * detect if we have erased the tape.
 	 */
 
-	tempbufp = (char *) calloc(1, (size_t)tape_recsz);
+	tempbufp = (char *)calloc(1, (size_t)tape_recsz);
 	strcpy(tempbufp, ERASE_MAGIC);
 	Write(drivep, tempbufp, tape_recsz, &saved_errno);
 	free(tempbufp);
@@ -4245,7 +4245,7 @@ isefsdump(drive_t *drivep)
 static bool_t
 isxfsdumperasetape(drive_t *drivep)
 {
-	if (! strcmp((char *)drivep->d_greadhdrp, ERASE_MAGIC) )
+	if (! strcmp((char *)drivep->d_greadhdrp, ERASE_MAGIC))
 		return BOOL_TRUE;
 	else
 		return BOOL_FALSE;
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index e39e884..be1bb46 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -342,7 +342,7 @@ extern int rmtopen(char *, int, ...);
 extern int rmtclose(int);
 extern int rmtfstat(int, struct stat *);
 extern int rmtioctl(int, int, ...);
-extern int rmtread(int, void*, uint);
+extern int rmtread(int, void *, uint);
 extern int rmtwrite(int, const void *, uint);
 
 
@@ -369,7 +369,7 @@ static void do_get_mark(drive_t *, drive_mark_t *);
 static void do_end_read(drive_t *);
 static int do_begin_write(drive_t *);
 static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
-static char * do_get_write_buf(drive_t *, size_t, size_t *);
+static char *do_get_write_buf(drive_t *, size_t, size_t *);
 static int do_write(drive_t *, char *, size_t);
 static size_t do_get_align_cnt(drive_t *);
 static int do_end_write(drive_t *, off64_t *);
@@ -425,7 +425,7 @@ static int getrec(drive_t *drivep);
 static int
 write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
 	     bool_t xlatepr);
-static ring_msg_t * Ring_get(ring_t *ringp);
+static ring_msg_t *Ring_get(ring_t *ringp);
 static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
 static void Ring_put(ring_t *ringp, ring_msg_t *msgp);
 static int validate_media_file_hdr(drive_t *drivep);
@@ -448,7 +448,7 @@ static void map_ts_status(struct mtget *, struct mtget_sgi);
 static int dbgrmtopen(char *, int);
 static int dbgrmtclose(int);
 static int dbgrmtioctl(int, int, void *);
-static int dbgrmtread(int, void*, uint);
+static int dbgrmtread(int, void *, uint);
 static int dbgrmtwrite(int, void *, uint);
 #endif /* RMTDBG */
 
@@ -457,7 +457,7 @@ static int dbgrmtwrite(int, void *, uint);
 /*
  * tape driver
  */
-int TS_ISDRIVER=0;
+int TS_ISDRIVER = 0;
 
 /*
  * scsitape drive strategy. referenced by drive.c
@@ -1248,7 +1248,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 		off64_t nextrecoffset;
 		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		nextrecoffset = contextp->dc_reccnt  * (off64_t)tape_recsz
+		nextrecoffset = contextp->dc_reccnt * (off64_t)tape_recsz
 				+
 				(off64_t)rechdrp->rec_used;
 		if (wantedoffset >= nextrecoffset) {
@@ -1918,7 +1918,7 @@ do_begin_write(drive_t *drivep)
 	tpwhdrp->recsize = (int32_t)tape_recsz;
 	tpwhdrp->rec_used = 0;
 	tpwhdrp->file_offset = 0;
-	tpwhdrp->first_mark_offset= 0;
+	tpwhdrp->first_mark_offset = 0;
 	tpwhdrp->capability = drivep->d_capabilities;
 
 	/*
@@ -1989,7 +1989,7 @@ do_begin_write(drive_t *drivep)
 	/*
 	 * intialize header in new record
 	 */
-	rechdrp = (rec_hdr_t*)contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
 	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
@@ -2282,7 +2282,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)
  *	the number of bytes to next alignment
  */
 static size_t
-do_get_align_cnt(drive_t * drivep)
+do_get_align_cnt(drive_t *drivep)
 {
 	char *next_alignment_point;
 	intptr_t next_alignment_off;
@@ -2309,7 +2309,7 @@ do_get_align_cnt(drive_t * drivep)
 	 * and a multiple of PGSZ.
 	 */
 	next_alignment_off = (intptr_t)contextp->dc_nextp;
-	next_alignment_off +=  PGMASK;
+	next_alignment_off += PGMASK;
 	next_alignment_off &= ~PGMASK;
 	next_alignment_point = (char *)next_alignment_off;
 	assert(next_alignment_point <= contextp->dc_recendp);
@@ -2594,11 +2594,11 @@ do_fsf(drive_t *drivep, int count, int *statp)
 			/*
 			 * check for end-of-data and end-of-tape conditions
 			 */
-			if (IS_EOT(mtstat) ) {
+			if (IS_EOT(mtstat)) {
 				*statp = DRIVE_ERROR_EOM;
 				return i;
 
-			} else if (IS_EOD(mtstat) ) {
+			} else if (IS_EOD(mtstat)) {
 				*statp = DRIVE_ERROR_EOD;
 				return i;
 			}
@@ -2613,7 +2613,7 @@ do_fsf(drive_t *drivep, int count, int *statp)
 
 			op_failed = 0;
 			assert(contextp->dc_fd >= 0);
-			if (mt_op(contextp->dc_fd, MTFSF, 1) ) {
+			if (mt_op(contextp->dc_fd, MTFSF, 1)) {
 				op_failed = 1;
 			}
 
@@ -2977,7 +2977,7 @@ do_quit(drive_t *drivep)
 	    &&
 	    contextp->dc_cansetblkszpr
 	    &&
-	    (contextp->dc_origcurblksz != 0) ) {
+	    (contextp->dc_origcurblksz != 0)) {
 		(void)set_fixed_blksz(drivep, contextp->dc_origcurblksz);
 	}
 
@@ -3196,7 +3196,7 @@ read_label(drive_t *drivep)
 #ifdef RESTORE
 
 	/* Linux case */
-	if (IS_EOD(mtstat) && IS_FMK(mtstat) ) {
+	if (IS_EOD(mtstat) && IS_FMK(mtstat)) {
 		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		     "hit EOM\n");
 		return DRIVE_ERROR_EOM;
@@ -3405,7 +3405,7 @@ set_fixed_blksz(drive_t *drivep, size_t blksz)
 		 */
 		if (mt_op(contextp->dc_fd,
 			  MTSETBLK,
-			  (int)blksz) ) {
+			  (int)blksz)) {
 			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			     "MTSETBLK %u failed: %s (%d)\n",
 			     blksz,
@@ -3842,7 +3842,7 @@ determine_write_error(drive_t *drivep, int nwritten, int saved_errno)
 
 		ret = DRIVE_ERROR_EOM;
 	} else if ((saved_errno == 0) &&
-		   (nwritten > 0)     &&
+		   (nwritten > 0) &&
 		   contextp->dc_isQICpr) {
 		/*
 		 * short write on one of this devices indicates
@@ -4070,7 +4070,7 @@ is_variable(drive_t *drivep, bool_t *varblk)
 	contextp = (drive_context_t *)drivep->d_contextp;
 
 	if (TS_ISDRIVER) {
-		char value[MT_ATTR_MAX_VALLEN+1];
+		char value[MT_ATTR_MAX_VALLEN + 1];
 		struct mt_attr mtattr;
 
 		value[0] = '\0';
@@ -5120,7 +5120,7 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 
 	xlate_rec_hdr(tmprh, rechdrp, 1);
 
-	if (rechdrp->magic != STAPE_MAGIC)  {
+	if (rechdrp->magic != STAPE_MAGIC) {
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		     _("record %lld corrupt: bad magic number\n"),
 		     contextp->dc_iocnt - 1);
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 1f75bb7..b415c43 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -57,10 +57,10 @@
 #define write   rmtwrite
 
 extern int rmtclose(int);
-extern int rmtcreat (char *path, int mode);
+extern int rmtcreat(char *path, int mode);
 extern int rmtioctl(int, int, ...);
 extern int rmtopen(char *, int, ...);
-extern int rmtread(int, void*, uint);
+extern int rmtread(int, void *, uint);
 extern int rmtwrite(int, const void *, uint);
 
 
@@ -131,7 +131,7 @@ static void do_get_mark(drive_t *, drive_mark_t *);
 static void do_end_read(drive_t *);
 static int do_begin_write(drive_t *);
 static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
-static char * do_get_write_buf(drive_t *, size_t, size_t *);
+static char *do_get_write_buf(drive_t *, size_t, size_t *);
 static int do_write(drive_t *, char *, size_t);
 static size_t do_get_align_cnt(drive_t *);
 static int do_end_write(drive_t *, off64_t *);
@@ -517,7 +517,7 @@ do_begin_read(drive_t *drivep)
 			return DRIVE_ERROR_FORMAT;
 		}
 	}
-	if  (rval) {
+	if (rval) {
 		free(tmphdr);
 		return rval;
 	}
@@ -846,7 +846,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 				 (rfp_t)drivep->d_opsp->do_read,
 				 (rrbfp_t)drivep->d_opsp->do_return_read_buf,
 				 &rval);
-		if  (rval) {
+		if (rval) {
 			return rval;
 		}
 		nreadneeded64 -= nread;
@@ -1295,7 +1295,7 @@ do_get_write_buf(drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp)
 	/*
 	 * calculate how much buffer remains
 	 */
-	remaining_bufsz =(size_t)(contextp->dc_emptyp - contextp->dc_nextp);
+	remaining_bufsz = (size_t)(contextp->dc_emptyp - contextp->dc_nextp);
 
 	/*
 	 *  give the caller the lesser of what he wants and what is available
@@ -1432,7 +1432,7 @@ do_get_align_cnt(drive_t *drivep)
 	 * a multiple of PGSZ.
 	 */
 	next_alignment_off = (intptr_t)contextp->dc_nextp;
-	next_alignment_off +=  PGMASK;
+	next_alignment_off += PGMASK;
 	next_alignment_off &= ~PGMASK;
 	next_alignment_point = (char *)next_alignment_off;
 	assert(next_alignment_point <= contextp->dc_emptyp);
diff --git a/common/fs.c b/common/fs.c
index 6ed86d9..7b816be 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -217,7 +217,7 @@ fs_getid(char *mnts, uuid_t *idb)
 		uuid_clear(*idb);
 		return -1;
 	}
-	if (ioctl(fd, XFS_IOC_FSGEOMETRY_V1, &geo) ) {
+	if (ioctl(fd, XFS_IOC_FSGEOMETRY_V1, &geo)) {
 		uuid_clear(*idb);
 		close(fd);
 		return -1;
@@ -279,7 +279,7 @@ fs_tab_free(void)
 	     ;
 	     tep
 	     ;
-	     otep = tep, tep = tep->fte_nextp, fs_tab_ent_free(otep) )
+	     otep = tep, tep = tep->fte_nextp, fs_tab_ent_free(otep))
 
 		;
 }
diff --git a/common/getdents.h b/common/getdents.h
index 3640d25..687334c 100644
--- a/common/getdents.h
+++ b/common/getdents.h
@@ -18,6 +18,6 @@
 #ifndef GETDENTS_H
 #define GETDENTS_H
 
-int getdents_wrap (int fd, char *buf, size_t nbytes);
+int getdents_wrap(int fd, char *buf, size_t nbytes);
 
 #endif /* GETDENTS_H */
diff --git a/common/global.c b/common/global.c
index ba424d8..bf08961 100644
--- a/common/global.c
+++ b/common/global.c
@@ -46,7 +46,7 @@ extern bool_t pipeline;
 /* forward declarations of locally defined static functions ******************/
 
 #ifdef DUMP
-static char * prompt_label(char *bufp, size_t bufsz);
+static char *prompt_label(char *bufp, size_t bufsz);
 #endif /* DUMP */
 
 /* definition of locally defined global variables ****************************/
@@ -97,7 +97,7 @@ global_hdr_alloc(int argc, char *argv[])
 	 * will be included in increments on this base. This may be
 	 * overridden with the GETOPT_DUMPTIME option.
 	 */
-	ghdrp->gh_timestamp = (time32_t) time(0);
+	ghdrp->gh_timestamp = (time32_t)time(0);
 
 	/*
 	 * fill in the host id: typecast to fit into a 64 bit field
@@ -172,7 +172,7 @@ global_hdr_alloc(int argc, char *argv[])
 				return 0;
 			}
 
-			if (! uuid_parse(optarg, ghdrp->gh_dumpid) ) {
+			if (! uuid_parse(optarg, ghdrp->gh_dumpid)) {
 				mlog(MLOG_NORMAL | MLOG_ERROR,
 				     _("-%c argument not a valid uuid\n"),
 				     c);
diff --git a/common/global.h b/common/global.h
index 36ec456..8a111cd 100644
--- a/common/global.h
+++ b/common/global.h
@@ -76,7 +76,7 @@ typedef struct global_hdr global_hdr_t;
  * used by main() to allocate and populate a global header template.
  * drive managers will copy this into the write header.
  */
-extern global_hdr_t * global_hdr_alloc(int argc, char *argv[]);
+extern global_hdr_t *global_hdr_alloc(int argc, char *argv[]);
 
 
 /*
diff --git a/common/hsmapi.c b/common/hsmapi.c
index cf25702..4ffc1fd 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -116,10 +116,10 @@ typedef struct {
  * Interesting bit combinations within the bs_dmevmask field of xfs_bstat_t:
  * OFL, UNM, and PAR files have exactly these bits set.
  * DUL and MIG files have all but the DM_EVENT_READ bit set */
-#define DMF_EV_BITS     ((1<<DM_EVENT_DESTROY) | \
-			 (1<<DM_EVENT_READ)    | \
-			 (1<<DM_EVENT_WRITE)   | \
-			 (1<<DM_EVENT_TRUNCATE))
+#define DMF_EV_BITS     ((1 << DM_EVENT_DESTROY) | \
+			 (1 << DM_EVENT_READ) | \
+			 (1 << DM_EVENT_WRITE) | \
+			 (1 << DM_EVENT_TRUNCATE))
 
 /* OFL file's managed region event flags */
 #define DMF_MR_FLAGS    (0x1 | 0x2 | 0x4)
diff --git a/common/inventory.c b/common/inventory.c
index 0e2ffba..07e5e5a 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -53,8 +53,8 @@ inv_open(inv_predicate_t bywhat, void *pred)
 
 	int index = 0;
 
-	assert (pred);
-	if ((fd = init_idb (pred, bywhat, uuname, &tok)) < 0)
+	assert(pred);
+	if ((fd = init_idb(pred, bywhat, uuname, &tok)) < 0)
 		return tok;
 
 	/*
@@ -69,7 +69,7 @@ inv_open(inv_predicate_t bywhat, void *pred)
 		return INV_TOKEN_NULL;
 	}
 
-	assert (index > 0);
+	assert(index > 0);
 
 	/* Now we need to make sure that this has enough space */
 	num = GET_SESCOUNTERS(stobjfd, &sescnt);
@@ -83,14 +83,14 @@ inv_open(inv_predicate_t bywhat, void *pred)
 	/*
 	 * create another storage object (and, an inv_index entry for it too)
 	   if we've filled this one up */
-	if ((uint) num >= sescnt->ic_maxnum) {
+	if ((uint)num >= sescnt->ic_maxnum) {
 #ifdef INVT_DEBUG
 		printf("$ creating a new storage obj & index entry. \n");
 #endif
-		close (stobjfd);
+		close(stobjfd);
 
 		stobjfd = create_invindex_entry(&tok, fd, uuname, BOOL_FALSE);
-		free (sescnt);
+		free(sescnt);
 		if (stobjfd < 0) {
 			close(fd);
 			close(sesslock_fd);
@@ -100,7 +100,7 @@ inv_open(inv_predicate_t bywhat, void *pred)
 		return tok;
 	}
 
-	free (sescnt);
+	free(sescnt);
 	tok = get_token(fd, stobjfd);
 	tok->d_invindex_off = INVINDEX_HDR_OFFSET(index - 1);
 
@@ -121,8 +121,8 @@ inv_open(inv_predicate_t bywhat, void *pred)
 bool_t
 inv_close(inv_idbtoken_t tok)
 {
-	close (tok->d_invindex_fd);
-	close (tok->d_stobj_fd);
+	close(tok->d_invindex_fd);
+	close(tok->d_stobj_fd);
 	destroy_token(tok);
 	close(sesslock_fd);
 	sesslock_fd = -1;
@@ -149,10 +149,10 @@ inv_lasttime_level_lessthan(
 	time32_t **	tm)
 {
 	int rval;
-	assert (tok != INV_TOKEN_NULL);
+	assert(tok != INV_TOKEN_NULL);
 
-	rval =  search_invt(tok, level, (void **) tm,
-			    (search_callback_t) tm_level_lessthan);
+	rval = search_invt(tok, level, (void **)tm,
+			   (search_callback_t)tm_level_lessthan);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 }
@@ -174,10 +174,10 @@ inv_lastsession_level_lessthan(
 	inv_session_t **ses)
 {
 	int rval;
-	assert (tok != INV_TOKEN_NULL);
+	assert(tok != INV_TOKEN_NULL);
 
-	rval = search_invt(tok, level, (void **) ses,
-			   (search_callback_t) lastsess_level_lessthan);
+	rval = search_invt(tok, level, (void **)ses,
+			   (search_callback_t)lastsess_level_lessthan);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 
@@ -201,9 +201,9 @@ inv_lastsession_level_equalto(
 	inv_session_t **ses)
 {
 	int rval;
-	assert (tok != INV_TOKEN_NULL);
-	rval = search_invt(tok, level, (void **) ses,
-			   (search_callback_t) lastsess_level_equalto);
+	assert(tok != INV_TOKEN_NULL);
+	rval = search_invt(tok, level, (void **)ses,
+			   (search_callback_t)lastsess_level_equalto);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 
@@ -240,12 +240,12 @@ inv_writesession_open(
 	invt_seshdr_t hdr;
 	inv_sestoken_t sestok;
 
-	assert (tok != INV_TOKEN_NULL);
-	assert (sesid && fsid && mntpt && devpath);
+	assert(tok != INV_TOKEN_NULL);
+	assert(sesid && fsid && mntpt && devpath);
 
-	if (!(tok->d_update_flag & FSTAB_UPDATED) ) {
+	if (!(tok->d_update_flag & FSTAB_UPDATED)) {
 		if (put_fstab_entry(fsid, mntpt, devpath) < 0) {
-			printf ("put_fstab_entry :(\n");
+			printf("put_fstab_entry :(\n");
 			return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag |= FSTAB_UPDATED;
@@ -253,11 +253,11 @@ inv_writesession_open(
 
 
 
-	ses = (invt_session_t *) calloc(1, sizeof(invt_session_t) );
+	ses = (invt_session_t *)calloc(1, sizeof(invt_session_t));
 
 	/* copy the session information to store */
-	memcpy(&ses->s_sesid, sesid, sizeof(uuid_t) );
-	memcpy(&ses->s_fsid, fsid, sizeof(uuid_t) );
+	memcpy(&ses->s_sesid, sesid, sizeof(uuid_t));
+	memcpy(&ses->s_fsid, fsid, sizeof(uuid_t));
 	strcpy(ses->s_label, label);
 	strcpy(ses->s_mountpt, mntpt);
 	strcpy(ses->s_devpath, devpath);
@@ -268,7 +268,7 @@ inv_writesession_open(
 
 	fd = tok->d_stobj_fd;
 
-	assert (fd > 0);
+	assert(fd > 0);
 
 	hdr.sh_time = time;
 	hdr.sh_level = level;
@@ -282,8 +282,8 @@ inv_writesession_open(
 
 	INVLOCK(fd, LOCK_EX);
 	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
-		free (ses);
-		free (sestok);
+		free(ses);
+		free(sestok);
 		INVLOCK(fd, LOCK_UN);
 		return INV_TOKEN_NULL;
 	}
@@ -292,7 +292,7 @@ inv_writesession_open(
 	 * create the writesession, and get ready for the streams to come
 	   afterwards */
 	rval = create_session(sestok, fd, sescnt, ses, &hdr);
-	assert (rval > 0);
+	assert(rval > 0);
 
 
 	INVLOCK(fd, LOCK_UN);
@@ -301,14 +301,14 @@ inv_writesession_open(
 
 	if (tok->d_update_flag & NEW_INVINDEX) {
 		if (put_sesstime(sestok, INVT_STARTTIME) < 0) {
-			printf ("put_starttime :(\n");
+			printf("put_starttime :(\n");
 			return INV_TOKEN_NULL;
 		}
 		tok->d_update_flag &= ~(NEW_INVINDEX);
 	}
 
-	free (ses);
-	free (sescnt);
+	free(ses);
+	free(sescnt);
 
 
 	return (rval < 0) ? INV_TOKEN_NULL : sestok;
@@ -330,14 +330,14 @@ inv_writesession_close(inv_sestoken_t tok)
 {
 	int rval;
 
-	assert (tok != INV_TOKEN_NULL);
+	assert(tok != INV_TOKEN_NULL);
 
 	/* now update end_time in the inv index header */
 	rval = put_sesstime(tok, INVT_ENDTIME);
 
-	memset(tok, 0, sizeof(invt_sesdesc_entry_t) );
+	memset(tok, 0, sizeof(invt_sesdesc_entry_t));
 
-	free (tok);
+	free(tok);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 
@@ -360,14 +360,14 @@ inv_stream_open(
 	invt_seshdr_t seshdr;
 	int fd;
 
-	assert (tok != INV_TOKEN_NULL);
+	assert(tok != INV_TOKEN_NULL);
 
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_FALSE;
 
 
 	/* XXX yukk... make the token descriptors not pointers */
-	stok = (inv_stmtoken_t) malloc(sizeof(invt_strdesc_entry_t) );
+	stok = (inv_stmtoken_t)malloc(sizeof(invt_strdesc_entry_t));
 
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
@@ -381,7 +381,7 @@ inv_stream_open(
 	/* get the session header first */
 	if (GET_REC_NOLOCK(fd, &seshdr, sizeof(invt_seshdr_t),
 			   tok->sd_sesshdr_off) <= 0) {
-		free (stok);
+		free(stok);
 		INVLOCK(fd, LOCK_UN);
 		sess_unlock();
 		return INV_TOKEN_NULL;
@@ -392,7 +392,7 @@ inv_stream_open(
 	/* XXX Have one func that gives both seshdr and session */
 	if (GET_REC_NOLOCK(fd, &ses, sizeof(invt_session_t),
 			   tok->sd_session_off) <= 0) {
-		free (stok);
+		free(stok);
 		INVLOCK(fd, LOCK_UN);
 		sess_unlock();
 		return INV_TOKEN_NULL;
@@ -401,22 +401,22 @@ inv_stream_open(
 
 	if (ses.s_cur_nstreams < ses.s_max_nstreams) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof(invt_stream_t) *
-						 ses.s_cur_nstreams)
+		stok->md_stream_off = (off64_t)(sizeof(invt_stream_t) *
+						ses.s_cur_nstreams)
 				      + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
 
 		/* write it back. this locks and unlocks fd EXclusively */
 		if (PUT_REC(fd, &ses, sizeof(ses),
 			    tok->sd_session_off) < 0) {
-			free (stok);
+			free(stok);
 			sess_unlock();
 			return INV_TOKEN_NULL;
 		}
 	} else {
 		fprintf(stderr, "Cant create more than %d streams. Max'd out..\n",
 			ses.s_cur_nstreams);
-		free (stok);
+		free(stok);
 		sess_unlock();
 		return INV_TOKEN_NULL;
 	}
@@ -427,7 +427,7 @@ inv_stream_open(
 	/* now put the stream header on to the disk */
 	if (PUT_REC(fd, &stream, sizeof(invt_stream_t),
 		    stok->md_stream_off) < 0) {
-		free (stok);
+		free(stok);
 		return INV_TOKEN_NULL;
 	}
 
@@ -482,9 +482,9 @@ inv_stream_close(
 end:
 	INVLOCK(fd, LOCK_UN);
 
-	free (tok->md_lastmfile);
-	memset(tok, 0, sizeof(invt_strdesc_entry_t) );
-	free (tok);
+	free(tok->md_lastmfile);
+	memset(tok, 0, sizeof(invt_strdesc_entry_t));
+	free(tok);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 }
@@ -512,14 +512,14 @@ inv_put_mediafile(
 	int rval;
 
 
-	assert (tok != INV_TOKEN_NULL);
-	assert (tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
-	assert (tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
+	assert(tok != INV_TOKEN_NULL);
+	assert(tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
+	assert(tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
 
-	mf = (invt_mediafile_t *) calloc(1, sizeof(invt_mediafile_t) );
+	mf = (invt_mediafile_t *)calloc(1, sizeof(invt_mediafile_t));
 
 	/* copy the media file information */
-	memcpy(&mf->mf_moid, moid, sizeof(uuid_t) );
+	memcpy(&mf->mf_moid, moid, sizeof(uuid_t));
 	strcpy(mf->mf_label, label);
 	mf->mf_startino.ino = startino;
 	mf->mf_startino.offset = startino_offset;
@@ -566,7 +566,7 @@ inv_get_inolist(
 
 #ifdef NOTDEF
 	*inolist = NULL;
-	curitem = malloc(sizeof(inv_inolist_t) );
+	curitem = malloc(sizeof(inv_inolist_t));
 
 	/* get the array of all indices in the invindex */
 	if ((nindices = GET_ALLHDRS_N_CNTS(invfd, (void **)&iarr,
@@ -588,7 +588,7 @@ inv_get_inolist(
 		create_inolist_item(curitem, statbuf.st_ino);
 	}
 	/* The inventory index */
-	if (fstat64(invfd, &statbuf) ) {
+	if (fstat64(invfd, &statbuf)) {
 		perror("InvIndex file");
 		return -1;
 	}
@@ -655,8 +655,8 @@ inv_DEBUG_printallsessions(
 	inv_session_t **ses)
 {
 	int rval;
-	rval = search_invt(tok, 0, (void **) ses,
-			   (search_callback_t) DEBUG_displayallsessions);
+	rval = search_invt(tok, 0, (void **)ses,
+			   (search_callback_t)DEBUG_displayallsessions);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 
diff --git a/common/inventory.h b/common/inventory.h
index 7660e07..7f81643 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -133,9 +133,9 @@ struct invt_sesdesc_entry;
 struct invt_strdesc_entry;
 
 /* The three kinds of access tokens for the inventory */
-typedef struct invt_desc_entry          *inv_idbtoken_t;
-typedef struct invt_sesdesc_entry       *inv_sestoken_t;
-typedef struct invt_strdesc_entry       *inv_stmtoken_t;
+typedef struct invt_desc_entry *inv_idbtoken_t;
+typedef struct invt_sesdesc_entry *inv_sestoken_t;
+typedef struct invt_strdesc_entry *inv_stmtoken_t;
 
 
 
diff --git a/common/main.c b/common/main.c
index c364fc9..49dcd90 100644
--- a/common/main.c
+++ b/common/main.c
@@ -93,7 +93,7 @@ bool_t preemptchk(int);
 /* forward declarations of locally defined static functions ******************/
 
 static bool_t loadoptfile(int *argcp, char ***argvp);
-static char * stripquotes(char *p);
+static char *stripquotes(char *p);
 static void shiftleftby1(char *p, char *endp);
 static void sighandler(int);
 static int childmain(void *);
@@ -1081,7 +1081,7 @@ usage(void)
 	 * catch all of those cases below
 	 */
 
-	(void) mlog_exit(EXIT_ERROR, RV_OPT);
+	(void)mlog_exit(EXIT_ERROR, RV_OPT);
 }
 
 /*
@@ -1210,7 +1210,7 @@ loadoptfile(int *argcp, char ***argvp)
 	 */
 	optind = 1;
 	opterr = 0;
-	optfilename =  0;
+	optfilename = 0;
 	while ((c = getopt(*argcp, *argvp, GETOPT_CMDSTRING)) != EOF) {
 		switch (c) {
 		case GETOPT_OPTFILE:
@@ -1234,7 +1234,7 @@ loadoptfile(int *argcp, char ***argvp)
 			break;
 		}
 	}
-	if (! optfilename)  {
+	if (! optfilename) {
 		return BOOL_TRUE;
 	}
 
@@ -1243,7 +1243,7 @@ loadoptfile(int *argcp, char ***argvp)
 	 */
 	errno = 0;
 	fd = open(optfilename, O_RDONLY);
-	if (fd  < 0) {
+	if (fd < 0) {
 		mlog(MLOG_ERROR | MLOG_NOLOCK,
 		     _("cannot open option file %s: %s (%d)\n"),
 		     optfilename,
@@ -1282,7 +1282,7 @@ loadoptfile(int *argcp, char ***argvp)
 	 * skip the GETOPT_OPTFILE option which put us here!
 	 */
 	sz = 0;
-	for (i =  0; i < *argcp; i++) {
+	for (i = 0; i < *argcp; i++) {
 		if (i == (int)optfileix) {
 			i++; /* to skip option argument */
 			continue;
@@ -1484,7 +1484,7 @@ sighandler(int signo)
 	/*
 	 * dialog gets first crack at the signal
 	 */
-	if (dlog_sighandler(signo) )
+	if (dlog_sighandler(signo))
 		return;
 
 	/*
diff --git a/common/mlog.c b/common/mlog.c
index 290d076..11a923b 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -303,7 +303,7 @@ mlog_init1(int argc, char *argv[])
 	 * mlog_fd set to stderr, see if we can switch
 	 * to stdout.
 	 */
-	if (optind >= argc ||  strcmp(argv[optind], "-")) {
+	if (optind >= argc || strcmp(argv[optind], "-")) {
 		mlog_fp = stdout;
 	}
 #endif /* DUMP */
@@ -605,7 +605,7 @@ _mlog_exit(const char *file, int line, int exit_code, rv_t rv)
 	 * most accurate information about the termination condition.
 	 */
 
-	if (pthread_equal(tid, parenttid) ) {
+	if (pthread_equal(tid, parenttid)) {
 		if (mlog_main_exit_code == -1) {
 			mlog_main_exit_code = exit_code;
 			mlog_main_exit_return = rv;
@@ -665,7 +665,7 @@ _mlog_exit_hint(const char *file, int line, rv_t rv)
 	 * information about the termination condition.
 	 */
 
-	if (pthread_equal(tid, parenttid) )
+	if (pthread_equal(tid, parenttid))
 		mlog_main_exit_hint = rv;
 	else
 		stream_set_hint(tid, rv);
@@ -680,7 +680,7 @@ mlog_get_hint(void)
 	bool_t ok;
 	rv_t hint;
 
-	if (pthread_equal(pthread_self(), parenttid) )
+	if (pthread_equal(pthread_self(), parenttid))
 		return mlog_main_exit_hint;
 
 	ok = stream_get_exit_status(pthread_self(), states, N(states),
diff --git a/common/path.c b/common/path.c
index 7467d4f..5196e9d 100644
--- a/common/path.c
+++ b/common/path.c
@@ -33,9 +33,9 @@ struct pem {
 
 typedef struct pem pem_t;
 
-static pem_t * pem_alloc(char *path);
+static pem_t *pem_alloc(char *path);
 static void pem_free(pem_t *pemp);
-static char * pem_next(pem_t *pemp);
+static char *pem_next(pem_t *pemp);
 
 #define PAMAX   1024
 
@@ -46,11 +46,11 @@ struct pa {
 
 typedef struct pa pa_t;
 
-static pa_t * pa_alloc(void);
+static pa_t *pa_alloc(void);
 static void pa_free(pa_t *pap);
 static void pa_append(pa_t *pap, char *pep);
 static int pa_peel(pa_t *pap);
-static char * pa_gen(pa_t *pap);
+static char *pa_gen(pa_t *pap);
 
 char *
 path_diff(char *path, char *base)
@@ -100,7 +100,7 @@ path_reltoabs(char *dir, char *basedir)
 	 * check if the path starts with a / or
 	 * is a remote path (i.e. contains  machine:/path/name).
 	 */
-	if ((*dir != '/') && (strchr(dir, ':') == 0) ) {
+	if ((*dir != '/') && (strchr(dir, ':') == 0)) {
 		char *absdir;
 		absdir = (char *)malloc(strlen(basedir)
 					+
@@ -119,7 +119,7 @@ path_reltoabs(char *dir, char *basedir)
 	if (strchr(dir, ':') == 0) {
 		absdir = path_normalize(dir);
 	} else {
-		absdir = (char *)malloc(strlen(dir)  + 1);
+		absdir = (char *)malloc(strlen(dir) + 1);
 		(void)sprintf(absdir, "%s", dir);
 	}
 
diff --git a/common/path.h b/common/path.h
index b81b92b..58d0c53 100644
--- a/common/path.h
+++ b/common/path.h
@@ -21,9 +21,9 @@
 /*
  * various pathname helpers
  */
-extern char * path_reltoabs(char *dir, char *basedir);
+extern char *path_reltoabs(char *dir, char *basedir);
 extern char *path_normalize(char *path);
-extern char * path_diff(char *path, char *base);
+extern char *path_diff(char *path, char *base);
 extern int path_beginswith(char *path, char *base);
 
 #endif /* PATH_H */
diff --git a/common/stream.c b/common/stream.c
index 1965a7e..e091359 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -94,7 +94,7 @@ stream_dead(pthread_t tid)
 	spm_t *ep = spm + N(spm);
 
 	for (; p < ep; p++)
-		if (pthread_equal(p->s_tid, tid) ) {
+		if (pthread_equal(p->s_tid, tid)) {
 			p->s_state = S_ZOMBIE;
 			break;
 		}
@@ -109,8 +109,8 @@ stream_free(pthread_t tid)
 
 	lock();
 	for (; p < ep; p++) {
-		if (pthread_equal(p->s_tid, tid) ) {
-			(void) memset((void *) p, 0, sizeof(spm_t));
+		if (pthread_equal(p->s_tid, tid)) {
+			(void)memset((void *)p, 0, sizeof(spm_t));
 			p->s_state = S_FREE;
 			break;
 		}
@@ -154,7 +154,7 @@ stream_find(pthread_t tid, stream_state_t s[], int nstates)
 
 	/* note we don't lock the stream array in this function */
 	for (; p < ep; p++)
-		if (pthread_equal(p->s_tid, tid) ) {
+		if (pthread_equal(p->s_tid, tid)) {
 			/* check state */
 			for (i = 0; i < nstates; i++)
 				if (p->s_state == s[i])
@@ -174,7 +174,7 @@ stream_find(pthread_t tid, stream_state_t s[], int nstates)
 	}
 #endif /* STREAM_DEBUG */
 
-	return (spm_t *) NULL;
+	return (spm_t *)NULL;
 }
 
 /*
diff --git a/common/timeutil.c b/common/timeutil.c
index a25b0c4..b327c2f 100644
--- a/common/timeutil.c
+++ b/common/timeutil.c
@@ -26,14 +26,14 @@
 char *
 ctime32(const time32_t *timep)
 {
-	time_t t = (time_t) *timep;
+	time_t t = (time_t)*timep;
 	return ctime(&t);
 }
 
 char *
 ctime32_r(const time32_t *timep, char *buf)
 {
-	time_t t = (time_t) *timep;
+	time_t t = (time_t)*timep;
 	return ctime_r(&t, buf);
 }
 
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index b044c6f..3e0432d 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -238,7 +238,7 @@ typedef struct  mtacct {
 #define MT_MAX_VID      6       /* Max characters in volume id sans null    */
 
 struct  mtvid {
-	char vid[MT_MAX_VID+1];
+	char vid[MT_MAX_VID + 1];
 };
 
 /*	structure for MTIOCGETBLKINFO - all quantities in bytes.
@@ -438,7 +438,7 @@ struct mt_capablity {
  *
  */
 #define MTPDTRACE       6000                    /* From pd_ioctl.h */
-#define MTIOCODE(x)     ('t'<<8|(x))
+#define MTIOCODE(x)     ('t' << 8 | (x))
 
 #ifndef _SYS_MTIO_H
 #define MTIOCTOP        MTIOCODE('a')           /* perform tape op */
diff --git a/common/types.h b/common/types.h
index 1d5c2f5..5ebee5c 100644
--- a/common/types.h
+++ b/common/types.h
@@ -28,7 +28,7 @@
  * have nothing to do with file handle operations.
  */
 #define sizeofmember(t, m)      sizeof(((t *)0)->m)
-#define offsetofmember(t, m)    ((size_t)(char *)&(((t *)0)->m) )
+#define offsetofmember(t, m)    ((size_t)(char *)&(((t *)0)->m))
 
 #define XFSDUMP_DIRPATH inv_basepath()
 
@@ -60,7 +60,7 @@ typedef int32_t time32_t;
 
 typedef uint64_t xfs_ino_t;
 
-#define constpp        char * const *
+#define constpp        char *const *
 
 /*
  * limits
diff --git a/common/util.c b/common/util.c
index c6d768e..55c1d48 100644
--- a/common/util.c
+++ b/common/util.c
@@ -124,7 +124,7 @@ bigstat_iter(jdm_fshandle_t *	fshandlep,
 	     bstat_seekfp_t	seekfp,
 	     void *		seek_arg1,
 	     int *		statp,
-	     bool_t (pfp)(int),
+	     bool_t(pfp)(int),
 	     xfs_bstat_t *	buf,
 	     size_t		buflenin)
 {
@@ -363,7 +363,7 @@ diriter(jdm_fshandle_t *					fshandlep,
 	int cbrval;
 
 	if (usrgdp) {
-		assert(usrgdsz >= sizeof(struct dirent) );
+		assert(usrgdsz >= sizeof(struct dirent));
 		gdsz = usrgdsz;
 		gdp = (struct dirent *)usrgdp;
 	} else {
diff --git a/common/util.h b/common/util.h
index e67c56a..e4e6b32 100644
--- a/common/util.h
+++ b/common/util.h
@@ -97,16 +97,16 @@ typedef int (*bstat_cbfp_t)(void *		arg1,
 typedef xfs_ino_t (*bstat_seekfp_t)(void *	arg1,
 				    xfs_ino_t	lastino);
 
-extern int bigstat_iter(jdm_fshandle_t *fshandlep,
+extern int bigstat_iter(jdm_fshandle_t * fshandlep,
 			int fsfd,
 			int selector,
 			xfs_ino_t start_ino,
 			bstat_cbfp_t fp,
-			void * cb_arg1,
+			void *cb_arg1,
 			bstat_seekfp_t seekfp,
-			void * seek_arg1,
+			void *seek_arg1,
 			int *statp,
-			bool_t (pfp)(int),       /* preemption chk func */
+			bool_t(pfp)(int),        /* preemption chk func */
 			xfs_bstat_t *buf,
 			size_t buflen);
 
@@ -159,8 +159,8 @@ extern int diriter(jdm_fshandle_t *					fshandlep,
  * Align pointer up to alignment
  */
 #define ALIGN_PTR(p, a) \
-	(((intptr_t)(p) & ((a)-1)) ? \
-	 ((void *)(((intptr_t)(p) + ((a)-1)) & ~((a)-1))) : \
+	(((intptr_t)(p) & ((a) - 1)) ? \
+	 ((void *)(((intptr_t)(p) + ((a) - 1)) & ~((a) - 1))) : \
 	 ((void *)(p)))
 
 #endif /* UTIL_H */
diff --git a/dump/content.c b/dump/content.c
index 62a4f13..236c06c 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -252,7 +252,7 @@ typedef struct extent_group_context extent_group_context_t;
  */
 #define EXTATTR_NAMESPACE(flag) (((flag) & ATTR_ROOT) ? _("root") : \
 				 (((flag) & ATTR_SECURE) ? _("secure") : \
-				  _("non-root")) )
+				  _("non-root")))
 
 /*
  * for printing file type
@@ -665,7 +665,7 @@ content_init(int		argc,
 	dwhdrtemplatep = (drive_hdr_t *)gwhdrtemplatep->gh_upper;
 	mwhdrtemplatep = (media_hdr_t *)dwhdrtemplatep->dh_upper;
 	cwhdrtemplatep = (content_hdr_t *)mwhdrtemplatep->mh_upper;
-	scwhdrtemplatep = (content_inode_hdr_t *) cwhdrtemplatep->ch_specific;
+	scwhdrtemplatep = (content_inode_hdr_t *)cwhdrtemplatep->ch_specific;
 
 	if (gwhdrtemplatep->gh_version < GLOBAL_HDR_VERSION_3) {
 		sc_use_old_direntpr = BOOL_TRUE;
@@ -728,7 +728,7 @@ content_init(int		argc,
 			maxdumpfilesize = strtoull(optarg, NULL, 0);
 			if (maxdumpfilesize == 0 ||
 			    maxdumpfilesize > ULONGLONG_MAX / 1024 ||
-			    (maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE) ) {
+			    (maxdumpfilesize == ULONGLONG_MAX && errno == ERANGE)) {
 				mlog(MLOG_NORMAL | MLOG_ERROR, _(
 					     "-%c argument is not a valid file size\n"),
 				     c);
@@ -910,8 +910,8 @@ content_init(int		argc,
 				if (save_quotas(mntpnt, &quotas[i])) {
 					if (subtreecnt) {
 						subtreecnt++;
-						subtreep = (char **) realloc(subtreep,
-									     subtreecnt * sizeof(char *));
+						subtreep = (char **)realloc(subtreep,
+									    subtreecnt * sizeof(char *));
 						assert(subtreep);
 						subtreep[subtreecnt - 1] = quotas[i].quotafile;
 					}
@@ -979,7 +979,7 @@ content_init(int		argc,
 			     baseuuidstr);
 			return BOOL_FALSE;
 		}
-		strcnt =  (ix_t)sessp->s_nstreams;
+		strcnt = (ix_t)sessp->s_nstreams;
 		for (strix = 0; strix < strcnt; strix++) {
 			bsp = &sessp->s_streams[strix];
 			if (bsp->st_interrupted) {
@@ -993,10 +993,10 @@ content_init(int		argc,
 			resumereqpr = BOOL_TRUE;
 			samefoundpr = BOOL_TRUE;
 			sametime = sessp->s_time;
-			uuid_copy (sameid, sessp->s_sesid);
+			uuid_copy(sameid, sessp->s_sesid);
 			samepartialpr = sessp->s_ispartial;
 			sameinterruptedpr = BOOL_TRUE;
-			sc_resumerangecnt =  (size_t)sessp->s_nstreams;
+			sc_resumerangecnt = (size_t)sessp->s_nstreams;
 			sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
 							     sizeof(drange_t));
 			assert(sc_resumerangep);
@@ -1058,7 +1058,7 @@ content_init(int		argc,
 			sc_level = (ix_t)sessp->s_level + 1;
 			undertime = sessp->s_time;
 			underlevel = (ix_t)sessp->s_level;
-			uuid_copy (underid, sessp->s_sesid);
+			uuid_copy(underid, sessp->s_sesid);
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
 			underfoundpr = BOOL_TRUE;
@@ -1099,10 +1099,10 @@ content_init(int		argc,
 
 			undertime = sessp->s_time;
 			underlevel = (ix_t)sessp->s_level;
-			uuid_copy (underid, sessp->s_sesid);
+			uuid_copy(underid, sessp->s_sesid);
 			underpartialpr = sessp->s_ispartial;
 			underinterruptedpr = BOOL_FALSE;
-			strcnt =  (ix_t)sessp->s_nstreams;
+			strcnt = (ix_t)sessp->s_nstreams;
 			for (strix = 0; strix < strcnt; strix++) {
 				bsp = &sessp->s_streams[strix];
 				if (bsp->st_interrupted) {
@@ -1145,7 +1145,7 @@ content_init(int		argc,
 		uuid_copy(sameid, sessp->s_sesid);
 		samepartialpr = sessp->s_ispartial;
 		sameinterruptedpr = BOOL_FALSE;
-		sc_resumerangecnt =  (size_t)sessp->s_nstreams;
+		sc_resumerangecnt = (size_t)sessp->s_nstreams;
 		sc_resumerangep = (drange_t *)calloc(sc_resumerangecnt,
 						     sizeof(drange_t));
 		assert(sc_resumerangep);
@@ -1521,9 +1521,9 @@ baseuuidbypass:
 		}
 
 		if (sc_rootxfsstatp->bs_ino != rootstat.st_ino)
-			mlog (MLOG_NORMAL | MLOG_NOTE,
-			      _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
-			      sc_rootxfsstatp->bs_ino, rootstat.st_ino);
+			mlog(MLOG_NORMAL | MLOG_NOTE,
+			     _("root ino %lld differs from mount dir ino %lld, bind mount?\n"),
+			     sc_rootxfsstatp->bs_ino, rootstat.st_ino);
 	}
 
 	/*
@@ -1650,7 +1650,7 @@ baseuuidbypass:
 	direntsz = inocnt * (uint64_t)(DIRENTHDR_SZ + 8);
 	filesz = inocnt * (uint64_t)(FILEHDR_SZ + EXTENTHDR_SZ);
 
-	hdr_mfilesz =   GLOBAL_HDR_SZ
+	hdr_mfilesz = GLOBAL_HDR_SZ
 		      +
 		      inomapsz
 		      +
@@ -1710,7 +1710,7 @@ baseuuidbypass:
 			contextp->cc_getdentsbufsz = GETDENTSBUF_SZ_MIN;
 		}
 		contextp->cc_getdentsbufp =
-			(char *) calloc(1, contextp->cc_getdentsbufsz);
+			(char *)calloc(1, contextp->cc_getdentsbufsz);
 		assert(contextp->cc_getdentsbufp);
 
 		contextp->cc_mdirentbufsz = sizeof(direnthdr_t)
@@ -1719,7 +1719,7 @@ baseuuidbypass:
 					    +
 					    DIRENTHDR_ALIGN;
 		contextp->cc_mdirentbufp =
-			(char *) calloc(1, contextp->cc_mdirentbufsz);
+			(char *)calloc(1, contextp->cc_mdirentbufsz);
 		assert(contextp->cc_mdirentbufp);
 
 		contextp->cc_extattrlistbufsz = EXTATTR_LISTBUF_SZ;
@@ -1748,7 +1748,7 @@ baseuuidbypass:
 
 		contextp->cc_readlinkbufsz = MAXPATHLEN + SYMLINK_ALIGN;
 		contextp->cc_readlinkbufp =
-			(char *) calloc(1, contextp->cc_readlinkbufsz);
+			(char *)calloc(1, contextp->cc_readlinkbufsz);
 		assert(contextp->cc_readlinkbufp);
 
 		contextp->cc_inomap_contextp = inomap_alloc_context();
@@ -1971,8 +1971,8 @@ content_statline(char **linespp[])
 			tmp->tm_hour,
 			tmp->tm_min,
 			tmp->tm_sec,
-			(unsigned long long) nondirdone,
-			(unsigned long long) sc_stat_nondircnt,
+			(unsigned long long)nondirdone,
+			(unsigned long long)sc_stat_nondircnt,
 			percent,
 			elapsed);
 	} else {
@@ -2864,7 +2864,7 @@ content_complete(void)
 					mlog(MLOG_ERROR, _(
 						     "unable to remove %s: %s\n"),
 					     quotas[i].quotapath,
-					     strerror (errno));
+					     strerror(errno));
 				}
 			}
 		}
@@ -3199,7 +3199,7 @@ dump_dir(ix_t			strmix,
 	if (fd < 0) {
 		mlog(MLOG_NORMAL | MLOG_WARNING, _(
 			     "unable to open directory: ino %llu: %s\n"),
-		     statp->bs_ino, strerror(errno) );
+		     statp->bs_ino, strerror(errno));
 		return RV_OK; /* continue anyway */
 	}
 
@@ -4214,7 +4214,7 @@ dump_file_reg(drive_t *			drivep,
 				register time32_t ltime = max(mtime, ctime);
 				if (ltime < sc_resumebasetime) {
 					if (rp->dr_begin.sp_offset > offset) {
-						offset =rp->dr_begin.sp_offset;
+						offset = rp->dr_begin.sp_offset;
 					}
 				}
 				break;
@@ -4564,7 +4564,7 @@ init_extent_group_context(jdm_fshandle_t *		fshandlep,
 	 * after this check but before all reads have completed.
 	 * This change just closes the window a bit.
 	 */
-	if ((statp->bs_mode & S_ISGID) && (!(statp->bs_mode&S_IXOTH)) ) {
+	if ((statp->bs_mode & S_ISGID) && (!(statp->bs_mode & S_IXOTH))) {
 		fl.l_type = F_RDLCK;
 		fl.l_whence = SEEK_SET;
 		fl.l_start = (off_t)0;
@@ -5011,7 +5011,7 @@ dump_extent_group(drive_t *			drivep,
 		if (isrealtime || extsz >= PGALIGNTHRESH * PGSZ) {
 			size_t cnt_to_align;
 			cnt_to_align = (*dop->do_get_align_cnt)(drivep);
-			if ((size_t)cnt_to_align < 2*sizeof(extenthdr_t)) {
+			if ((size_t)cnt_to_align < 2 * sizeof(extenthdr_t)) {
 				cnt_to_align += PGSZ;
 			}
 
@@ -5309,7 +5309,7 @@ dump_extenthdr(drive_t *	drivep,
 	rv_t rv;
 	char typestr[20];
 
-	switch (type)  {
+	switch (type) {
 	case EXTENTHDR_TYPE_LAST:
 		strcpy(typestr, "LAST");
 		break;
@@ -6946,7 +6946,7 @@ save_quotas(char *mntpnt, quota_info_t *quotainfo)
 		     sts == -1 ? -1 : WEXITSTATUS(sts));
 		return BOOL_FALSE;
 	}
-	if ((fd = open(quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
+	if ((fd = open(quotainfo->quotapath, O_RDONLY | O_DSYNC)) < 0) {
 		mlog(MLOG_ERROR, _(
 			     "open failed %s: %s\n"),
 		     quotainfo->quotapath,
diff --git a/dump/inomap.c b/dump/inomap.c
index be505ea..17c6909 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -324,11 +324,11 @@ inomap_build(jdm_fshandle_t *	fshandlep,
 		*inomap_statpassp = 0;
 		*inomap_statphasep = 2;
 
-		(void) supprt_prune(&rootdump,
-				    fshandlep,
-				    fsfd,
-				    rootstatp,
-				    NULL);
+		(void)supprt_prune(&rootdump,
+				   fshandlep,
+				   fsfd,
+				   rootstatp,
+				   NULL);
 		*inomap_statphasep = 0;
 
 		if (preemptchk(PREEMPT_FULL)) {
@@ -405,7 +405,7 @@ inomap_build(jdm_fshandle_t *	fshandlep,
 				mlog(MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
 				     _("end\n"));
 			} else {
-				mlog(MLOG_VERBOSE |  MLOG_BARE | MLOG_INOMAP,
+				mlog(MLOG_VERBOSE | MLOG_BARE | MLOG_INOMAP,
 				     _("ino %llu offset %lld\n"),
 				     ep->sp_ino,
 				     ep->sp_offset);
@@ -1281,11 +1281,11 @@ inomap_find_seg(seg_addr_t *addrp, xfs_ino_t ino)
 	int lower;
 	int upper;
 
-	if (! inomap_validaddr(addrp) ) {
+	if (! inomap_validaddr(addrp)) {
 		inomap_reset_context(addrp);
 	}
 
-	if (! inomap_find_hnk(addrp, ino) )
+	if (! inomap_find_hnk(addrp, ino))
 		return BOOL_FALSE;
 
 	/* find the correct segment */
@@ -1377,7 +1377,7 @@ inomap_set_state(void *contextp, xfs_ino_t ino, int state)
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (! inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino))
 		return MAP_INO_UNUSED;
 
 	segp = inomap_addr2seg(addrp);
@@ -1396,7 +1396,7 @@ inomap_get_state(void *contextp, xfs_ino_t ino)
 	seg_t *segp;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (! inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino))
 		return MAP_INO_UNUSED;
 
 	segp = inomap_addr2seg(addrp);
@@ -1414,7 +1414,7 @@ inomap_set_gen(void *contextp, xfs_ino_t ino, gen_t gen)
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (! inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino))
 		return;
 
 	segp = inomap_addr2seg(addrp);
@@ -1435,7 +1435,7 @@ inomap_get_gen(void *contextp, xfs_ino_t ino, gen_t *gen)
 	xfs_ino_t relino;
 
 	addrp = contextp ? (seg_addr_t *)contextp : &addr;
-	if (! inomap_find_seg(addrp, ino) )
+	if (! inomap_find_seg(addrp, ino))
 		return 1;
 
 	segp = inomap_addr2seg(addrp);
diff --git a/dump/var.c b/dump/var.c
index 47ec9fa..75a239e 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -50,13 +50,13 @@ var_create(void)
 		p++;
 		if (*p == '/') {
 			*p = '\0';
-			if (! var_create_component(path) )
+			if (! var_create_component(path))
 				return;
 			*p = '/';
 		}
 	} while (*p);
 
-	(void) var_create_component(path);
+	(void)var_create_component(path);
 }
 
 static int
diff --git a/include/swab.h b/include/swab.h
index 2fa21f2..0a5289f 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -18,8 +18,8 @@
 		__u32 __x = (x); \
 		((__u32)( \
 			 (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
-			 (((__u32)(__x) & (__u32)0x0000ff00UL) <<  8) | \
-			 (((__u32)(__x) & (__u32)0x00ff0000UL) >>  8) | \
+			 (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \
+			 (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \
 			 (((__u32)(__x) & (__u32)0xff000000UL) >> 24))); \
 	})
 
@@ -30,8 +30,8 @@
 			 (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
 			 (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
 			 (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
-			 (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) <<  8) | \
-			 (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >>  8) | \
+			 (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
+			 (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
 			 (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
 			 (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
 			 (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56))); \
@@ -44,16 +44,16 @@
 #define ___constant_swab32(x) \
 	((__u32)( \
 		 (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
-		 (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
-		 (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
+		 (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
+		 (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
 		 (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
 #define ___constant_swab64(x) \
 	((__u64)( \
 		 (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
 		 (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
 		 (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
-		 (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) <<  8) | \
-		 (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) | \
+		 (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
+		 (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
 		 (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
 		 (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
 		 (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
@@ -119,7 +119,7 @@ static __inline__ __u16 __swab16p(__u16 *x)
 }
 static __inline__ void __swab16s(__u16 *addr)
 {
-	(__extension__ ({ __arch__swab16s(addr); }));
+	(__extension__({ __arch__swab16s(addr); }));
 }
 
 static __inline__ __u32 __fswab32(__u32 x)
@@ -132,14 +132,14 @@ static __inline__ __u32 __swab32p(__u32 *x)
 }
 static __inline__ void __swab32s(__u32 *addr)
 {
-	(__extension__ ({ __arch__swab32s(addr); }));
+	(__extension__({ __arch__swab32s(addr); }));
 }
 
 static __inline__ __u64 __fswab64(__u64 x)
 {
 #  ifdef __SWAB_64_THRU_32__
 	__u32 h = x >> 32;
-	__u32 l = x & ((1ULL<<32)-1);
+	__u32 l = x & ((1ULL << 32) - 1);
 	return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
 #  else
 	return (__extension__ __arch__swab64(x));
@@ -151,7 +151,7 @@ static __inline__ __u64 __swab64p(__u64 *x)
 }
 static __inline__ void __swab64s(__u64 *addr)
 {
-	(__extension__ ({ __arch__swab64s(addr); }));
+	(__extension__({ __arch__swab64s(addr); }));
 }
 
 #endif /* SWAB_H */
diff --git a/include/swap.h b/include/swap.h
index a0593d4..d6252ee 100644
--- a/include/swap.h
+++ b/include/swap.h
@@ -55,7 +55,7 @@
 			 (INT_SWAP((ref), (valueref))) : (valueref))) : \
 	 (void)(((ref) = (valueref)), \
 		(((arch) != ARCH_NOCONVERT) ? \
-		 (ref) = INT_SWAP((ref), (ref)) : 0) ))
+		 (ref) = INT_SWAP((ref), (ref)) : 0)))
 
 #define INT_XLATE(buf, p, dir, arch) \
 	((dir > 0) ? ((p) = INT_GET((buf), (arch))) : INT_SET((buf), (arch), (p)))
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 7a5332a..2467115 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -55,8 +55,8 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 
 	int index = 0;
 
-	assert (pred);
-	fd = retval = init_idb (pred, bywhat, forwhat, &tok);
+	assert(pred);
+	fd = retval = init_idb(pred, bywhat, forwhat, &tok);
 
 	if (retval == I_DONE)
 		return tok;
@@ -81,7 +81,7 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 		return INV_TOKEN_NULL;
 	}
 
-	assert (index > 0);
+	assert(index > 0);
 
 	/* Now we need to make sure that this has enough space */
 	INVLOCK(stobjfd, LOCK_SH);
@@ -98,17 +98,17 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 	 * create another storage object (and, an inv_index entry for it
 	   too) if we've filled this one up */
 
-	if ((uint) num >= sescnt->ic_maxnum) {
+	if ((uint)num >= sescnt->ic_maxnum) {
 		mlog(MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
 		     "index entry. \n");
 		INVLOCK(stobjfd, LOCK_UN);
-		close (stobjfd);
+		close(stobjfd);
 
 		INVLOCK(fd, LOCK_EX);
 		stobjfd = idx_create_entry(&tok, fd, BOOL_FALSE);
 		INVLOCK(fd, LOCK_UN);
 
-		free (sescnt);
+		free(sescnt);
 		if (stobjfd < 0) {
 			close(fd);
 			return INV_TOKEN_NULL;
@@ -118,7 +118,7 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 
 	INVLOCK(stobjfd, LOCK_UN);
 
-	free (sescnt);
+	free(sescnt);
 	tok = get_token(fd, stobjfd);
 	tok->d_invindex_off = IDX_HDR_OFFSET(index - 1);
 	tok->d_oflag = forwhat;
@@ -139,9 +139,9 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 bool_t
 inv_close(inv_idbtoken_t tok)
 {
-	close (tok->d_invindex_fd);
+	close(tok->d_invindex_fd);
 	if (tok->d_stobj_fd >= 0)
-		close (tok->d_stobj_fd);
+		close(tok->d_stobj_fd);
 	destroy_token(tok);
 	return BOOL_TRUE;
 }
@@ -180,14 +180,14 @@ inv_writesession_open(
 	inv_sestoken_t sestok;
 	inv_oflag_t forwhat;
 
-	assert (tok != INV_TOKEN_NULL);
-	assert (sesid && fsid && mntpt && devpath);
+	assert(tok != INV_TOKEN_NULL);
+	assert(sesid && fsid && mntpt && devpath);
 	forwhat = tok->d_oflag;
 	fd = tok->d_stobj_fd;
-	assert (forwhat != INV_SEARCH_ONLY);
-	assert (fd > 0);
+	assert(forwhat != INV_SEARCH_ONLY);
+	assert(fd > 0);
 
-	if (!(tok->d_update_flag & FSTAB_UPDATED) ) {
+	if (!(tok->d_update_flag & FSTAB_UPDATED)) {
 		if (fstab_put_entry(fsid, mntpt, devpath, forwhat) < 0) {
 			mlog(MLOG_NORMAL | MLOG_INV, _(
 				     "INV: put_fstab_entry failed.\n"));
@@ -198,9 +198,9 @@ inv_writesession_open(
 
 
 	/* copy the session information to store */
-	memset((void *)&ses, 0, sizeof(ses) );  /* paranoia */
-	memcpy(&ses.s_sesid, sesid, sizeof(uuid_t) );
-	memcpy(&ses.s_fsid, fsid, sizeof(uuid_t) );
+	memset((void *)&ses, 0, sizeof(ses));   /* paranoia */
+	memcpy(&ses.s_sesid, sesid, sizeof(uuid_t));
+	memcpy(&ses.s_fsid, fsid, sizeof(uuid_t));
 	strcpy(ses.s_label, label);
 	strcpy(ses.s_mountpt, mntpt);
 	strcpy(ses.s_devpath, devpath);
@@ -221,7 +221,7 @@ inv_writesession_open(
 
 	INVLOCK(fd, LOCK_EX);
 	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
-		free (sestok);
+		free(sestok);
 		INVLOCK(fd, LOCK_UN);
 		return INV_TOKEN_NULL;
 	}
@@ -230,7 +230,7 @@ inv_writesession_open(
 	 * create the writesession, and get ready for the streams to come
 	   afterwards */
 	rval = stobj_create_session(sestok, fd, sescnt, &ses, &hdr);
-	assert (rval > 0);
+	assert(rval > 0);
 
 
 	INVLOCK(fd, LOCK_UN);
@@ -246,7 +246,7 @@ inv_writesession_open(
 		tok->d_update_flag &= ~(NEW_INVINDEX);
 	}
 
-	free (sescnt);
+	free(sescnt);
 
 
 	return (rval < 0) ? INV_TOKEN_NULL : sestok;
@@ -268,13 +268,13 @@ inv_writesession_close(inv_sestoken_t tok)
 {
 	int rval;
 
-	assert (tok != INV_TOKEN_NULL);
+	assert(tok != INV_TOKEN_NULL);
 
 	/* now update end_time in the inv index header */
 	rval = idx_put_sesstime(tok, INVT_ENDTIME);
 
-	memset(tok, 0, sizeof(invt_sesdesc_entry_t) );
-	free (tok);
+	memset(tok, 0, sizeof(invt_sesdesc_entry_t));
+	free(tok);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 
@@ -299,7 +299,7 @@ inv_stream_open(
 	int fd;
 	bool_t err = BOOL_FALSE;
 
-	assert (tok != INV_TOKEN_NULL);
+	assert(tok != INV_TOKEN_NULL);
 
 	/*
 	 * this memset is needed as a dump interrupted/crashed very soon
@@ -314,7 +314,7 @@ inv_stream_open(
 	strcpy(stream.st_cmdarg, cmdarg);
 
 	/* XXX yukk... make the token descriptors not pointers */
-	stok = (inv_stmtoken_t) malloc(sizeof(invt_strdesc_entry_t) );
+	stok = (inv_stmtoken_t)malloc(sizeof(invt_strdesc_entry_t));
 
 	stok->md_sesstok = tok;
 	stok->md_lastmfile = 0;
@@ -328,10 +328,10 @@ inv_stream_open(
 	if (stobj_get_sessinfo(tok, &seshdr, &ses) <= 0)
 		err = BOOL_TRUE;
 
-	if ((! err)  && ses.s_cur_nstreams < ses.s_max_nstreams) {
+	if ((! err) && ses.s_cur_nstreams < ses.s_max_nstreams) {
 		/* this is where this stream header will be written to */
-		stok->md_stream_off = (off64_t) (sizeof(invt_stream_t) *
-						 ses.s_cur_nstreams)
+		stok->md_stream_off = (off64_t)(sizeof(invt_stream_t) *
+						ses.s_cur_nstreams)
 				      + seshdr.sh_streams_off;
 		ses.s_cur_nstreams++;
 
@@ -340,9 +340,9 @@ inv_stream_open(
 				   tok->sd_session_off) < 0)
 			err = BOOL_TRUE;
 	} else if (! err) {
-		mlog (MLOG_NORMAL, _(
-			      "INV: cant create more than %d streams."
-			      " Max'd out..\n"), ses.s_cur_nstreams);
+		mlog(MLOG_NORMAL, _(
+			     "INV: cant create more than %d streams."
+			     " Max'd out..\n"), ses.s_cur_nstreams);
 		err = BOOL_TRUE;
 	}
 
@@ -360,7 +360,7 @@ inv_stream_open(
 	}
 
 	/* error occured somewhere */
-	free (stok);
+	free(stok);
 	INVLOCK(fd, LOCK_UN);
 	return INV_TOKEN_NULL;
 
@@ -424,10 +424,10 @@ inv_stream_close(
 	INVLOCK(fd, LOCK_UN);
 
 	if (tok->md_lastmfile) {
-		free (tok->md_lastmfile);
+		free(tok->md_lastmfile);
 	}
-	memset(tok, 0, sizeof(invt_strdesc_entry_t) );
-	free (tok);
+	memset(tok, 0, sizeof(invt_strdesc_entry_t));
+	free(tok);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 }
@@ -459,14 +459,14 @@ inv_put_mediafile(
 	int rval;
 
 
-	assert (tok != INV_TOKEN_NULL);
-	assert (tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
-	assert (tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
+	assert(tok != INV_TOKEN_NULL);
+	assert(tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED);
+	assert(tok->md_sesstok->sd_invtok->d_stobj_fd >= 0);
 
-	mf = (invt_mediafile_t *) calloc(1, sizeof(invt_mediafile_t) );
+	mf = (invt_mediafile_t *)calloc(1, sizeof(invt_mediafile_t));
 
 	/* copy the media file information */
-	memcpy(&mf->mf_moid, moid, sizeof(uuid_t) );
+	memcpy(&mf->mf_moid, moid, sizeof(uuid_t));
 	strcpy(mf->mf_label, label);
 	mf->mf_mfileidx = mfileindex;
 	mf->mf_startino.ino = startino;
@@ -600,13 +600,13 @@ inv_free_session(
 
 	for (i = 0; i < (*ses)->s_nstreams; i++) {
 		/* the array of mediafiles is contiguous */
-		free ((*ses)->s_streams[i].st_mediafiles);
+		free((*ses)->s_streams[i].st_mediafiles);
 	}
 
 	/* all streams are contiguous too */
-	free ((*ses)->s_streams);
+	free((*ses)->s_streams);
 
-	free (*ses);
+	free(*ses);
 	*ses = NULL;
 }
 
@@ -630,9 +630,9 @@ inv_lasttime_level_lessthan(
 {
 	int rval;
 	if (tok != INV_TOKEN_NULL) {
-		rval =  search_invt(fsidp, tok->d_invindex_fd, &level,
-				    (void **)tm,
-				    (search_callback_t)tm_level_lessthan);
+		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
+				   (void **)tm,
+				   (search_callback_t)tm_level_lessthan);
 
 		return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
 	}
@@ -938,14 +938,14 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 				switch (d) {
 				/* process mntpt option */
 				case OPT_MNT:
-					bywhat = (inv_predicate_t) INV_BY_MOUNTPT;
+					bywhat = (inv_predicate_t)INV_BY_MOUNTPT;
 					fs = value;
 					npreds++;
 					break;
 
 				/* process fsid option */
 				case OPT_FSID:
-					bywhat = (inv_predicate_t) INV_BY_UUID;
+					bywhat = (inv_predicate_t)INV_BY_UUID;
 					npreds++;
 
 					uuid_parse(value, fsid);
@@ -953,7 +953,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 					break;
 
 				case OPT_DEV:       /* process dev option */
-					bywhat = (inv_predicate_t) INV_BY_DEVPATH;
+					bywhat = (inv_predicate_t)INV_BY_DEVPATH;
 					fs = value;
 					npreds++;
 					break;
@@ -968,7 +968,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 				case OPT_MOBJID:
 				{
 					uuid_t *u;
-					u = malloc (sizeof(uuid_t) );
+					u = malloc(sizeof(uuid_t));
 					uuid_parse(value, *u);
 					prctx->mobj.type = INVT_MOID;
 					prctx->mobj.value = (void *)u;
@@ -1066,10 +1066,10 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 					}
 					inv_close(tok);
 				}
-				free (arr);
+				free(arr);
 				rval |= I_IDONE;
 			}
-			if ((rval&I_IERR)) {
+			if ((rval & I_IERR)) {
 				mlog(MLOG_NORMAL | MLOG_INV, _(
 					     "INV: open failed on mount point \"%s\"\n"),
 				     fs);
@@ -1136,7 +1136,7 @@ inv_DEBUG_print(int argc, char **argv)
 				       forwhat,
 				       &arr[i].ft_uuid);
 			if (tok == INV_TOKEN_NULL) {
-				free (arr);
+				free(arr);
 				return BOOL_FALSE;
 			}
 
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index b966ebc..5670e60 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -50,12 +50,12 @@ get_counters(int fd, void **cntpp, size_t cntsz)
 {
 	/* object must be locked at least SHARED by caller */
 	uint num;
-	assert(cntsz >= sizeof(invt_counter_t) );
+	assert(cntsz >= sizeof(invt_counter_t));
 
-	*cntpp =  calloc(1, cntsz);
+	*cntpp = calloc(1, cntsz);
 
 	/* find the number of sessions and the max possible */
-	if (GET_REC_NOLOCK(fd, (void *) *cntpp, cntsz, (off64_t) 0) < 0) {
+	if (GET_REC_NOLOCK(fd, (void *)*cntpp, cntsz, (off64_t)0) < 0) {
 		free(*cntpp);
 		*cntpp = NULL;
 		return -1;
@@ -66,13 +66,13 @@ get_counters(int fd, void **cntpp, size_t cntsz)
 	if (((invt_counter_t *)(*cntpp))->ic_vernum != INV_VERSION) {
 		mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV : Unknown version %d - Expected version %d\n"),
-		     (int) ((invt_counter_t *)(*cntpp))->ic_vernum,
-		     (int) INV_VERSION);
-		assert (((invt_counter_t *)(*cntpp))->ic_vernum ==
-			INV_VERSION);
+		     (int)((invt_counter_t *)(*cntpp))->ic_vernum,
+		     (int)INV_VERSION);
+		assert(((invt_counter_t *)(*cntpp))->ic_vernum ==
+		       INV_VERSION);
 	}
 
-	return (int) num;
+	return (int)num;
 }
 
 
@@ -95,8 +95,8 @@ get_headers(int fd, void **hdrs, size_t bufsz, size_t off)
 	/* file must be locked at least SHARED by caller */
 
 	/* get the array of hdrs */
-	if (GET_REC_NOLOCK(fd, (void *) *hdrs, bufsz, (off64_t)off) < 0) {
-		free (*hdrs);
+	if (GET_REC_NOLOCK(fd, (void *)*hdrs, bufsz, (off64_t)off) < 0) {
+		free(*hdrs);
 		*hdrs = NULL;
 		return -1;
 	}
@@ -116,13 +116,13 @@ get_invtrecord(int fd, void *buf, size_t bufsz, off64_t off,
 {
 	int nread;
 
-	assert (fd >= 0);
+	assert(fd >= 0);
 
 	if (dolock)
 		INVLOCK(fd, LOCK_SH);
 
 	nread = pread(fd, buf, bufsz, (off_t)off);
-	if (nread != (int) bufsz) {
+	if (nread != (int)bufsz) {
 		INV_PERROR(_("Error in reading inventory record :"));
 		if (dolock)
 			INVLOCK(fd, LOCK_UN);
@@ -153,7 +153,7 @@ put_invtrecord(int fd, void *buf, size_t bufsz, off64_t off, bool_t dolock)
 		INVLOCK(fd, LOCK_EX);
 
 	nwritten = pwrite(fd, buf, bufsz, (off_t)off);
-	if (nwritten != (int) bufsz) {
+	if (nwritten != (int)bufsz) {
 		INV_PERROR(_("Error in writing inventory record :"));
 		if (dolock)
 			INVLOCK(fd, LOCK_UN);
@@ -190,7 +190,7 @@ get_headerinfo(int fd, void **hdrs, void **cnt,
 	/* If there are no sessions recorded yet, we're done too */
 	if (num > 0) {
 		if (get_headers(fd, hdrs, hdrsz * (size_t)num, cntsz) < 0) {
-			free (*cnt);
+			free(*cnt);
 			num = -1;
 		}
 	}
@@ -222,10 +222,10 @@ get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 	 * if there's space anywhere at all, then it must be in the last
 	   entry */
 	*ent = malloc(hdrsz);
-	pos = (char *) arr + ((uint)nindices - 1) * hdrsz;
+	pos = (char *)arr + ((uint)nindices - 1) * hdrsz;
 	memcpy(*ent, pos, hdrsz);
-	free (arr);
-	free (cnt);
+	free(arr);
+	free(cnt);
 
 	return nindices;
 }
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 1f6ed8d..6b603b6 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -54,16 +54,16 @@ fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 {
 	int fd;
 
-	fd = open (INV_FSTAB, INV_OFLAG(forwhat));
+	fd = open(INV_FSTAB, INV_OFLAG(forwhat));
 
 	if (fd < 0)
 		return -1; /* if ENOENT, fstab_put_entry will CREAT */
 
 	INVLOCK(fd, LOCK_EX);
-	if ((*numfs = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void**) arr,
+	if ((*numfs = GET_ALLHDRS_N_CNTS_NOLOCK(fd, (void **)arr,
 						(void **)cnt,
 						sizeof(invt_fstab_t),
-						sizeof(invt_counter_t) )
+						sizeof(invt_counter_t))
 	     ) < 0) {
 		mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: couldn't get fstab headers\n"));
@@ -104,16 +104,16 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 		if (errno != ENOENT) {
 			return -1;
 		}
-		if ((fd = open(INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR))
+		if ((fd = open(INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR | S_IWUSR))
 		    < 0) {
-			INV_PERROR (INV_FSTAB);
+			INV_PERROR(INV_FSTAB);
 			return -1;
 		}
 
 		INVLOCK(fd, LOCK_EX);
 		fchmod(fd, INV_PERMS);
 
-		cnt = (invt_counter_t *) malloc(sizeof (invt_counter_t) );
+		cnt = (invt_counter_t *)malloc(sizeof(invt_counter_t));
 
 		cnt->ic_maxnum = -1;
 		cnt->ic_curnum = 0;
@@ -127,15 +127,15 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 /*			if ((STREQL(arr[i].ft_mountpt, mntpt) ) &&
                             (STREQL(arr[i].ft_devpath, dev) ))
  */
-				free (arr);
-				free (cnt);
+				free(arr);
+				free(cnt);
 				close(fd);
 				return 1;
 
 			}
 		}
 		/* entry not found. just follow thru to create a new one */
-		free (arr);
+		free(arr);
 	}
 
 	/*
@@ -145,7 +145,7 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 		invt_fstab_t ent;
 		off64_t hoff;
 
-		memcpy(&ent.ft_uuid, fsidp, sizeof(uuid_t) );
+		memcpy(&ent.ft_uuid, fsidp, sizeof(uuid_t));
 		strcpy(ent.ft_mountpt, mntpt);
 		strcpy(ent.ft_devpath, dev);
 
@@ -155,9 +155,9 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 		     mntpt);
 #endif
 		cnt->ic_curnum++;
-		hoff = (off64_t) (sizeof(invt_counter_t) +
-				  (size_t)(cnt->ic_curnum - 1) *
-				  sizeof(invt_fstab_t) );
+		hoff = (off64_t)(sizeof(invt_counter_t) +
+				 (size_t)(cnt->ic_curnum - 1) *
+				 sizeof(invt_fstab_t));
 
 		rval = PUT_COUNTERS(fd, cnt);
 		if (rval > 0) {
@@ -166,8 +166,8 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 
 	}
 	INVLOCK(fd, LOCK_UN);
-	free (cnt);
-	close (fd);
+	free(cnt);
+	close(fd);
 	return rval;
 }
 
@@ -201,16 +201,16 @@ fstab_get_fname(void *		pred,
 			return -1;
 		}
 		INVLOCK(fd, LOCK_UN);
-		close (fd);
-		free (cnt); /* we dont need it */
+		close(fd);
+		free(cnt);  /* we dont need it */
 
 		/* first get hold of the uuid for this mount point/device */
 
 		for (i = 0; i < numfs; i++) {
 			if ((bywhat == INV_BY_MOUNTPT &&
-			     (STREQL(arr[i].ft_mountpt, pred) )) ||
+			     (STREQL(arr[i].ft_mountpt, pred))) ||
 			    (bywhat == INV_BY_DEVPATH &&
-			     (STREQL(arr[i].ft_devpath, pred) ))) {
+			     (STREQL(arr[i].ft_devpath, pred)))) {
 
 				uuidp = &arr[i].ft_uuid;
 				break;
@@ -231,14 +231,14 @@ fstab_get_fname(void *		pred,
 
 	uuid_unparse(*uuidp, uuidstr);
 
-	strncpy (fname, INV_DIRPATH, INV_STRLEN);
-	strcat (fname, "/");
-	strcat (fname, uuidstr);
+	strncpy(fname, INV_DIRPATH, INV_STRLEN);
+	strcat(fname, "/");
+	strcat(fname, uuidstr);
 
 	if (bywhat != INV_BY_UUID)
-		free (arr);
+		free(arr);
 
-	assert((int) strlen(fname) < INV_STRLEN);
+	assert((int)strlen(fname) < INV_STRLEN);
 	return 1;
 }
 
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 927d36a..bfe1c68 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -67,15 +67,15 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 		/*
 		 * if our time is nicely within an existing entry's time
 		   period, hellalujah */
-		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm) ) {
+		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm)) {
 #ifdef INVT_DEBUG
 			mlog(MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n", i);
 #endif
 			*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 			return i;
 		}
-		if (iarr[i].ie_timeperiod.tp_end == 0  &&
-		    iarr[i].ie_timeperiod.tp_start  == 0) {
+		if (iarr[i].ie_timeperiod.tp_end == 0 &&
+		    iarr[i].ie_timeperiod.tp_start == 0) {
 #ifdef INVT_DEBUG
 			mlog(MLOG_DEBUG | MLOG_INV, "INV: end = start \n");
 			mlog(MLOG_DEBUG | MLOG_INV, "BEF: st %ld end %ld\n",
@@ -87,7 +87,7 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 				iarr[i].ie_timeperiod.tp_end = tm;
 			PUT_REC_NOLOCK(fd, iarr,
 				       icnt->ic_curnum * sizeof(invt_entry_t),
-				       (off64_t) sizeof(invt_counter_t) );
+				       (off64_t)sizeof(invt_counter_t));
 #ifdef INVT_DEBUG
 			mlog(MLOG_DEBUG | MLOG_INV, "AFT: st %ld end %ld\n",
 			     iarr[i].ie_timeperiod.tp_start,
@@ -120,7 +120,7 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 				return i;
 			}
 			/* see if the next entry starts later than us */
-			if (iarr[i+1].ie_timeperiod.tp_start > tm) {
+			if (iarr[i + 1].ie_timeperiod.tp_start > tm) {
 
 
 				/*
@@ -132,7 +132,7 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 
 				/* the timeperiods had better not overlap */
 				assert((tm > iarr[i].ie_timeperiod.tp_end) &&
-				       (tm < iarr[i+1].ie_timeperiod.tp_start));
+				       (tm < iarr[i + 1].ie_timeperiod.tp_start));
 
 				/*
 				 * shift everything from (i+1) onwards by
@@ -175,28 +175,28 @@ idx_put_newentry(
 	invt_counter_t *icnt = idx->icnt;
 
 	stobj_makefname(ient->ie_filename);
-	if ((stobjfd = stobj_create(ient->ie_filename) ) < 0)
+	if ((stobjfd = stobj_create(ient->ie_filename)) < 0)
 		return -1;
 
 	icnt->ic_curnum++; /* there is no maximum */
 
-	idxarr = (invt_entry_t *) calloc (icnt->ic_curnum,
-					  sizeof(invt_entry_t) );
-	memcpy(idxarr, iarr, (size_t) (sizeof(invt_entry_t) * index) );
+	idxarr = (invt_entry_t *)calloc(icnt->ic_curnum,
+					sizeof(invt_entry_t));
+	memcpy(idxarr, iarr, (size_t)(sizeof(invt_entry_t) * index));
 
 	/* shift everything from (i+1) onwards by one */
-	if (index <  icnt->ic_curnum - 1)
+	if (index < icnt->ic_curnum - 1)
 		memcpy(&idxarr[index + 1], &iarr[index],
-		       (size_t) ((icnt->ic_curnum - index - 1) *
-				 sizeof(invt_entry_t) ));
+		       (size_t)((icnt->ic_curnum - index - 1) *
+				sizeof(invt_entry_t)));
 	/* insert the new entry */
-	memcpy(&idxarr[index], ient, sizeof(invt_entry_t) );
+	memcpy(&idxarr[index], ient, sizeof(invt_entry_t));
 
 
 	if ((PUT_COUNTERS(fd, icnt) < 0) ||
 	    (PUT_REC_NOLOCK(fd, idxarr,
 			    icnt->ic_curnum * sizeof(invt_entry_t),
-			    sizeof(invt_counter_t) ) < 0) ) {
+			    sizeof(invt_counter_t)) < 0)) {
 		/* XXX delete the stobj that we just created */
 
 		memset(ient->ie_filename, 0, INV_STRLEN);
@@ -234,7 +234,7 @@ idx_find_stobj(invt_idxinfo_t * idx,
 	if (GET_ALLHDRS_N_CNTS_NOLOCK(idx->invfd, (void **)&idx->iarr,
 				      (void **)&idx->icnt,
 				      sizeof(invt_entry_t),
-				      sizeof(invt_counter_t) ) < 0) {
+				      sizeof(invt_counter_t)) < 0) {
 		return -1;
 	}
 
@@ -274,8 +274,8 @@ idx_create(char *fname, inv_oflag_t forwhat)
 	   the db for SEARCH_ONLY. */
 	assert(forwhat != INV_SEARCH_ONLY);
 
-	if ((fd = open (fname, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
-		INV_PERROR (fname);
+	if ((fd = open(fname, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
+		INV_PERROR(fname);
 		return INV_TOKEN_NULL;
 	}
 
@@ -306,11 +306,11 @@ int
 idx_recons_time(time32_t tm, invt_idxinfo_t *idx)
 {
 	invt_timeperiod_t *tp = &idx->iarr[idx->index].ie_timeperiod;
-	if (tp->tp_start && IS_WITHIN(tp, tm) )
+	if (tp->tp_start && IS_WITHIN(tp, tm))
 		return 1;
 
 	if (tm > tp->tp_end || tp->tp_end == 0)
-		tp->tp_end =  tm;
+		tp->tp_end = tm;
 	if (tm < tp->tp_start || tp->tp_start == 0)
 		tp->tp_start = tm;
 	PUT_REC_NOLOCK(idx->invfd, &idx->iarr[idx->index],
@@ -367,7 +367,7 @@ idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime)
 							  sizeof(invt_counter_t))) < 0) {
 			return -1;
 		}
-		idx_DEBUG_printinvindices(iarr, (uint) nindices);
+		idx_DEBUG_printinvindices(iarr, (uint)nindices);
 		free(iarr);
 		free(icnt);
 	}
@@ -403,7 +403,7 @@ idx_create_entry(
 	off64_t hoff;
 
 
-	memset (&ent, 0, sizeof(ent) );
+	memset(&ent, 0, sizeof(ent));
 
 	/* initialize the start and end times to be the same */
 	ent.ie_timeperiod.tp_start = ent.ie_timeperiod.tp_end = (time32_t)0;
@@ -431,7 +431,7 @@ idx_create_entry(
 	} else {
 		invt_counter_t *cnt = NULL;
 
-		if (GET_COUNTERS(invfd, &cnt)  < 0) {
+		if (GET_COUNTERS(invfd, &cnt) < 0) {
 			return -1;
 		}
 
@@ -452,7 +452,7 @@ idx_create_entry(
 		/* add the new index entry to the array, at the end */
 
 		hoff = IDX_HDR_OFFSET(cnt->ic_curnum - 1);
-		free (cnt);
+		free(cnt);
 #ifdef INVT_DEBUG
 		mlog(MLOG_NITTY | MLOG_INV, "new stobj name %s @ offset %d\n",
 		     ent.ie_filename, (int)hoff);
@@ -493,18 +493,18 @@ idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index)
 
 	if ((*index = get_lastheader(invfd, (void **)&ent,
 				     sizeof(invt_entry_t),
-				     sizeof(invt_counter_t)) ) < 0)
+				     sizeof(invt_counter_t))) < 0)
 		return -1;
 	/*
 	 * at this point we know that there should be at least one invindex
 	   entry present */
-	assert (ent != NULL);
-	assert (ent->ie_filename);
+	assert(ent != NULL);
+	assert(ent->ie_filename);
 
 	fd = open(ent->ie_filename, INV_OFLAG(forwhat));
 	if (fd < 0)
 		INV_PERROR(ent->ie_filename);
-	free (ent);
+	free(ent);
 
 	return fd;
 }
@@ -522,9 +522,9 @@ idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num)
 #define INV_UUID_STR_LEN        36 /* not exported via uuid.h */
 	for (i = 0; i < num; i++) {
 		k = strlen(iarr[i].ie_filename);
-		strncpy(s, (char *) iarr[i].ie_filename + k -
+		strncpy(s, (char *)iarr[i].ie_filename + k -
 			(INV_UUID_STR_LEN + strlen(INV_STOBJ_PREFIX)), 8);
-		s[8]= 0;
+		s[8] = 0;
 		printf("%d. %s \t(%d - %d)\n", i, s,
 		       iarr[i].ie_timeperiod.tp_start,
 		       iarr[i].ie_timeperiod.tp_end);
@@ -536,7 +536,7 @@ idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num)
 }
 
 int
-idx_DEBUG_print (int fd)
+idx_DEBUG_print(int fd)
 {
 	int nindices;
 	invt_entry_t *iarr = NULL;
@@ -548,7 +548,7 @@ idx_DEBUG_print (int fd)
 						  sizeof(invt_counter_t))) < 0) {
 		return -1;
 	}
-	idx_DEBUG_printinvindices(iarr, (uint) nindices);
+	idx_DEBUG_printinvindices(iarr, (uint)nindices);
 	free(iarr);
 	free(icnt);
 
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 1552df3..e5aeb02 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -65,12 +65,12 @@ init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 	}
 
 	(void)strcpy(fname, uuname);
-	strcat (fname, INV_INVINDEX_PREFIX);
+	strcat(fname, INV_INVINDEX_PREFIX);
 
 	/* first check if the inv_index file exists: if not create it */
-	if ((fd = open(fname, INV_OFLAG(forwhat)) ) == -1) {
+	if ((fd = open(fname, INV_OFLAG(forwhat))) == -1) {
 		if (errno != ENOENT) {
-			INV_PERROR (fname);
+			INV_PERROR(fname);
 		} else if (forwhat == INV_SEARCH_N_MOD) {
 			*tok = idx_create(fname, forwhat);
 		} else {
@@ -95,15 +95,15 @@ get_token(int invfd, int stobjfd)
 {
 	invt_desc_entry_t *desc;
 
-	desc = (invt_desc_entry_t *) malloc
-		       (sizeof(invt_desc_entry_t) );
+	desc = (invt_desc_entry_t *)malloc
+		       (sizeof(invt_desc_entry_t));
 
 	desc->d_invindex_fd = invfd;
 	desc->d_stobj_fd = stobjfd;
 	desc->d_update_flag = 0;
 	desc->d_invindex_off = -1;
 
-	return (inv_idbtoken_t) desc; /* yukky, but ok for the time being */
+	return (inv_idbtoken_t)desc;  /* yukky, but ok for the time being */
 }
 
 
@@ -114,7 +114,7 @@ get_token(int invfd, int stobjfd)
 void
 destroy_token(inv_idbtoken_t tok)
 {
-	free ((invt_desc_entry_t *) tok);
+	free((invt_desc_entry_t *)tok);
 }
 
 
@@ -124,10 +124,10 @@ get_sesstoken(inv_idbtoken_t tok)
 {
 	inv_sestoken_t stok;
 
-	stok = (inv_sestoken_t) malloc(sizeof(invt_sesdesc_entry_t) );
+	stok = (inv_sestoken_t)malloc(sizeof(invt_sesdesc_entry_t));
 	stok->sd_invtok = tok;
 	stok->sd_session_off = stok->sd_sesshdr_off = -1;
-	stok->sd_sesstime = (time32_t) 0;
+	stok->sd_sesstime = (time32_t)0;
 	return stok;
 }
 
@@ -142,7 +142,7 @@ get_sesstoken(inv_idbtoken_t tok)
 /*                                                                           */
 /*---------------------------------------------------------------------------*/
 bool_t
-invmgr_query_all_sessions (
+invmgr_query_all_sessions(
 	uuid_t *		fsidp,
 	void *			inarg,
 	void **			outarg,
@@ -268,7 +268,7 @@ search_invt(
 		invt_seshdr_t *harr = NULL;
 		bool_t found;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY);
+		fd = open(iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
 			INV_PERROR(iarr[i].ie_filename);
 			continue;
@@ -286,7 +286,7 @@ search_invt(
 			close(fd);
 			continue;
 		}
-		free (scnt);
+		free(scnt);
 
 		for (j = nsess - 1; j >= 0; j--) {
 			invt_session_t ses;
@@ -372,7 +372,7 @@ invmgr_inv_print(
 	free(icnt);
 
 	if (prctx->invidx) {
-		idx_DEBUG_printinvindices(iarr, (uint) nindices);
+		idx_DEBUG_printinvindices(iarr, (uint)nindices);
 		free(iarr);
 		return (0);
 	}
@@ -385,7 +385,7 @@ invmgr_inv_print(
 		invt_seshdr_t *harr = NULL;
 		int s;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY);
+		fd = open(iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
 			INV_PERROR(iarr[i].ie_filename);
 			continue;
@@ -403,7 +403,7 @@ invmgr_inv_print(
 			close(fd);
 			continue;
 		}
-		free (scnt);
+		free(scnt);
 		for (s = 0; s < nsess; s++) {
 			/*
 			 * fd is kept locked until we return from the
@@ -425,7 +425,7 @@ invmgr_inv_print(
 		close(fd);
 	}
 
-	free (iarr);
+	free(iarr);
 	return 0;
 }
 
@@ -468,7 +468,7 @@ invmgr_inv_check(
 		invt_seshdr_t *harr = NULL;
 		int s;
 
-		fd = open (iarr[i].ie_filename, O_RDONLY);
+		fd = open(iarr[i].ie_filename, O_RDONLY);
 		if (fd < 0) {
 			INV_PERROR(iarr[i].ie_filename);
 			continue;
@@ -486,13 +486,13 @@ invmgr_inv_check(
 			close(fd);
 			continue;
 		}
-		free (scnt);
+		free(scnt);
 
 		if ((iarr[i].ie_timeperiod.tp_start != harr[0].sh_time) ||
-		    (iarr[i].ie_timeperiod.tp_end != harr[nsess-1].sh_time)) {
-			printf(_("INV: Check %d failed.\n"), i+1);
+		    (iarr[i].ie_timeperiod.tp_end != harr[nsess - 1].sh_time)) {
+			printf(_("INV: Check %d failed.\n"), i + 1);
 			printf(_("invidx (%d)\t%d - %d\n"),
-			       i+1,
+			       i + 1,
 			       iarr[i].ie_timeperiod.tp_start,
 			       iarr[i].ie_timeperiod.tp_end);
 			for (s = 0; s < nsess; s++) {
@@ -501,7 +501,7 @@ invmgr_inv_check(
 		}
 		else {
 			printf(_("INV: Check %d out of %d succeeded\n"),
-			       i+1, nindices);
+			       i + 1, nindices);
 		}
 		INVLOCK(fd, LOCK_UN);
 		close(fd);
@@ -524,15 +524,15 @@ tm_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
 {
 	u_char level = *(u_char *)arg;
 	*tm = NULL;
-	if (IS_PARTIAL_SESSION(hdr) )
+	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
 	if (hdr->sh_level < level) {
 #ifdef INVT_DEBUG
 		mlog(MLOG_DEBUG | MLOG_INV, "$ found level %d < %d\n", hdr->sh_level,
 		     level);
 #endif
-		*tm = calloc(1, sizeof(time32_t) );
-		memcpy(*tm, &hdr->sh_time, sizeof(time32_t) );
+		*tm = calloc(1, sizeof(time32_t));
+		memcpy(*tm, &hdr->sh_time, sizeof(time32_t));
 		return 1;
 	}
 	return 0;
@@ -553,14 +553,14 @@ lastsess_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
 {
 	u_char level = *(u_char *)arg;
 	*buf = NULL;
-	if (IS_PARTIAL_SESSION(hdr) )
+	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
 	if (hdr->sh_level < level) {
 #ifdef INVT_DEBUG
 		mlog(MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d < %d \n",
 		     hdr->sh_level, level);
 #endif
-		return stobj_make_invsess(fd, (inv_session_t **) buf, hdr);
+		return stobj_make_invsess(fd, (inv_session_t **)buf, hdr);
 	}
 	return 0;
 
@@ -580,14 +580,14 @@ lastsess_level_equalto(int fd, invt_seshdr_t *hdr,
 {
 	u_char level = *(u_char *)arg;
 	*buf = NULL;
-	if (IS_PARTIAL_SESSION(hdr) )
+	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
 	if (hdr->sh_level == level) {
 #ifdef INVT_DEBUG
 		mlog(MLOG_DEBUG | MLOG_INV, "$ found (ses) level %d == %d \n", hdr->sh_level,
 		     level);
 #endif
-		return stobj_make_invsess(fd, (inv_session_t **) buf, hdr);
+		return stobj_make_invsess(fd, (inv_session_t **)buf, hdr);
 	}
 	return 0;
 
@@ -615,10 +615,10 @@ insert_session(invt_sessinfo_t *s)
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 
 	/* initialize the inventory */
-	if ((invfd = init_idb ((void *) s->ses->s_fsid,
-			       (inv_predicate_t) INV_BY_UUID,
-			       forwhat,
-			       &tok) ) < 0) {
+	if ((invfd = init_idb((void *)s->ses->s_fsid,
+			      (inv_predicate_t)INV_BY_UUID,
+			      forwhat,
+			      &tok)) < 0) {
 		if (tok == INV_TOKEN_NULL) {
 #ifdef INVT_DEBUG
 			mlog(MLOG_DEBUG | MLOG_INV, "INV: insert_session: init_db "
@@ -653,7 +653,7 @@ insert_session(invt_sessinfo_t *s)
 	/* Now put the session in the storage-object */
 	INVLOCK(stobjfd, LOCK_EX);
 	if ((stobj_insert_session(&idx, stobjfd, s) < 0) ||
-	    (idx_recons_time (s->seshdr->sh_time, &idx) < 0) )
+	    (idx_recons_time(s->seshdr->sh_time, &idx) < 0))
 		ret = BOOL_TRUE;
 
 	INVLOCK(stobjfd, LOCK_UN);
@@ -729,11 +729,11 @@ invmgr_lockinit(void)
 {
 	if (invlock_fd == -1) {
 		if ((invlock_fd = open(INV_LOCKFILE,
-				       O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+				       O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
 			INV_PERROR(INV_LOCKFILE);
 			return BOOL_FALSE;
 		}
-		fchmod (invlock_fd, INV_PERMS);
+		fchmod(invlock_fd, INV_PERMS);
 	}
 	return BOOL_TRUE;
 }
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 0879056..08045c5 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -75,8 +75,8 @@ oref_resolve_upto(
 {
 	int rval = INV_OK;
 
-	assert (OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
-	assert (OREF_ISLOCKED(obj));
+	assert(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
+	assert(OREF_ISLOCKED(obj));
 
 	/* we arent interested in anything else */
 	type &= INVT_RES_MASK;
@@ -196,7 +196,7 @@ oref_sync(
 		rval = PUT_REC_NOLOCK(obj->fd,
 				      OREF_CNT(obj),
 				      sizeof(*OREF_CNT(obj)),
-				      (off64_t) 0);
+				      (off64_t)0);
 
 		break;
 
@@ -206,7 +206,7 @@ oref_sync(
 		rval = PUT_REC_NOLOCK(obj->fd,
 				      OREF_ENTRIES(obj),
 				      sizeof(*OREF_ENTRIES(obj)),
-				      (off64_t) sizeof(*OREF_CNT(obj)));
+				      (off64_t)sizeof(*OREF_CNT(obj)));
 
 		break;
 
@@ -325,13 +325,13 @@ oref_resolve(
 	if (fstab_get_fname(pred, uuname, bywhat) < 0) {
 		return INV_ERR;
 	}
-	(void) strcpy(fname, uuname);
+	(void)strcpy(fname, uuname);
 	strcat(fname, INV_INVINDEX_PREFIX);
 
 	/* first check if the inv_index file exists: if not create it */
 	if ((fd = open(fname, O_RDWR)) == -1) {
 		if (errno != ENOENT) {
-			INV_PERROR (fname);
+			INV_PERROR(fname);
 			return INV_ERR;
 		}
 		/* create the invidx */
@@ -406,8 +406,8 @@ oref_resolve_child(
 	/*
 	 * at this point we know that there should be at least one invindex
 	   entry present */
-	assert (ent != NULL);
-	assert (ent->ie_filename);
+	assert(ent != NULL);
+	assert(ent->ie_filename);
 
 	fd = open(ent->ie_filename, O_RDWR);
 	if (fd < 0) {
@@ -433,8 +433,8 @@ oref_resolve_new_invidx(
 	int stobjfd, fd;
 	inv_idbtoken_t tok;
 
-	if ((fd = open (fname, O_RDWR | O_CREAT, S_IRUSR|S_IWUSR) ) < 0) {
-		INV_PERROR (fname);
+	if ((fd = open(fname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
+		INV_PERROR(fname);
 		return INV_ERR;
 	}
 	invidx->fd = fd;
@@ -468,7 +468,7 @@ oref_resolve_new_stobj(
 
 	assert(OREF_ISLOCKED(invidx));
 
-	memset (&ent, 0, sizeof(ent) );
+	memset(&ent, 0, sizeof(ent));
 	stobj = calloc(1, sizeof(invt_oref_t));
 	OREF_SET_CHILD(invidx, stobj);
 
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 3fa82ee..7de9441 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -159,48 +159,48 @@ typedef struct invt_oref {
 	{ (oref)->token = tok; }
 
 #define OREF_SET_CNT(oref, cnt) \
-	{ assert (OREF_ISRESOLVED(oref, INVT_OTYPE_MASK)); \
+	{ assert(OREF_ISRESOLVED(oref, INVT_OTYPE_MASK)); \
 	  ((oref)->type & INVT_OTYPE_STOBJ) ? \
 	  (oref)->cu_sescnt = (cnt) : (oref)->cu_cnt = (cnt); \
 	  (oref)->type |= INVT_RES_COUNTERS; }
 
 #define OREF_SET_ENTRIES(oref, ents) \
-	{ assert ((oref)->type & (INVT_OTYPE_INVIDX | INVT_OTYPE_FSTAB)); \
-	  assert ((oref)->type & INVT_RES_COUNTERS); \
+	{ assert((oref)->type & (INVT_OTYPE_INVIDX | INVT_OTYPE_FSTAB)); \
+	  assert((oref)->type & INVT_RES_COUNTERS); \
 	  ((oref)->type & INVT_OTYPE_INVIDX) ? \
 	  (oref)->eu_ent = ents : (oref)->eu_fstabent = ents; \
 	  (oref)->type |= INVT_RES_ENTRIES; }
 
 #define OREF_SET_HDRS(oref, hdrs) \
-	{ assert ((oref)->type & INVT_OTYPE_STOBJ); \
-	  assert ((oref)->type & INVT_RES_COUNTERS); \
+	{ assert((oref)->type & INVT_OTYPE_STOBJ); \
+	  assert((oref)->type & INVT_RES_COUNTERS); \
 	  (oref)->eu_hdr = hdrs; \
 	  (oref)->type |= INVT_STOBJ_RES_HDRS; }
 
 #define OREF_SET_SESSIONS(oref, ses) \
-	{ assert ((oref)->type & INVT_OTYPE_STOBJ); \
-	  assert ((oref)->type & INVT_RES_COUNTERS); \
+	{ assert((oref)->type & INVT_OTYPE_STOBJ); \
+	  assert((oref)->type & INVT_RES_COUNTERS); \
 	  (oref)->eu_ses = ses; \
 	  (oref)->type |= INVT_STOBJ_RES_SESSIONS; }
 
 #define OREF_SET_STRMS(oref, strms) \
-	{ assert ((oref)->type & INVT_OTYPE_STOBJ); \
-	  assert ((oref)->type & INVT_RES_COUNTERS); \
+	{ assert((oref)->type & INVT_OTYPE_STOBJ); \
+	  assert((oref)->type & INVT_RES_COUNTERS); \
 	  (oref)->eu_strm = strms; \
 	  (oref)->type |= INVT_STOBJ_RES_STRMS; }
 
 #define OREF_SET_CHILD(oref, stobjref) \
-	{ assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
+	{ assert(! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
 	  (oref)->ku_child = stobjref; \
 	  (oref)->type |= INVT_RES_CHILD; }
 
 #define OREF_SET_PARENT(oref, invidxref) \
-	{ assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
+	{ assert(! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
 	  (oref)->ku_parent = invidxref; \
 	  (oref)->type |= INVT_RES_PARENT; }
 
 #define OREF_UNRESOLVE_CHILD(oref) \
-	{ assert (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
+	{ assert(OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
 	  close((oref)->ku_child->fd); \
 	  OREF_DESTROY((oref)->ku_child); \
 	  (oref)->ku_child = 0; \
@@ -280,10 +280,10 @@ _oref_free(
 
 #ifdef NOTDEF
 
-extern int xlv_oref_resolve (
+extern int xlv_oref_resolve(
 	xlv_oref_t *oref, xlv_tab_vol_entry_t *tab_vol_entry);
 
-extern int xlv_oref_resolve_from_list (
+extern int xlv_oref_resolve_from_list(
 	xlv_oref_t *oref, xlv_oref_t *oref_list);
 
 
@@ -291,7 +291,7 @@ extern int xlv_oref_resolve_from_list (
  *	Prints out the object referenced by an oref.
  */
 
-extern void xlv_oref_print (xlv_oref_t *oref, int p_mode);
+extern void xlv_oref_print(xlv_oref_t *oref, int p_mode);
 
 /*
  *	An iterator that applies a user-supplied function and arg
@@ -301,22 +301,22 @@ extern void xlv_oref_print (xlv_oref_t *oref, int p_mode);
  */
 typedef int (*XLV_OREF_PF) (xlv_oref_t *, void *);
 
-extern void xlv_for_each_ve_in_obj (
+extern void xlv_for_each_ve_in_obj(
 	xlv_oref_t *	oref,
 	XLV_OREF_PF	operation,
 	void *		arg);
 
-extern void xlv_for_each_ve_in_vol (
+extern void xlv_for_each_ve_in_vol(
 	xlv_oref_t *	oref,
 	XLV_OREF_PF	operation,
 	void *		arg);
 
-extern int xlv_for_each_ve_in_subvol (
+extern int xlv_for_each_ve_in_subvol(
 	xlv_oref_t *	oref,
 	XLV_OREF_PF	operation,
 	void *		arg);
 
-extern int xlv_for_each_ve_in_plex (
+extern int xlv_for_each_ve_in_plex(
 	xlv_oref_t *	oref,
 	XLV_OREF_PF	operation,
 	void *		arg);
@@ -326,7 +326,7 @@ extern int xlv_for_each_ve_in_plex (
  *	Returns 1 if the oref is a null reference; i.e., it has just
  *	been XLV_OREF_INIT'ed and no new fields have been set.
  */
-extern int xlv_oref_is_null (xlv_oref_t *oref);
+extern int xlv_oref_is_null(xlv_oref_t *oref);
 #endif /* NOTDEF */
 
 
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index e958b51..d8873b9 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -63,11 +63,11 @@
 #define INVLOCK(fd, m)  flock(fd, m)
 
 /* return values */
-#define INV_OK                  (int) 1
-#define INV_ERR                 (int) -1
+#define INV_OK                  (int)1
+#define INV_ERR                 (int)-1
 
-#define I_DONE                  (int) -1
-#define I_EMPTYINV              (int) -2
+#define I_DONE                  (int)-1
+#define I_EMPTYINV              (int)-2
 
 /* flags to oref_resolve_new_stobj() */
 #define IS_EMPTY                BOOL_TRUE
@@ -77,22 +77,22 @@
 
 #define IS_WITHIN(ttpe, tm)     (tm >= (ttpe)->tp_start && \
 				 tm <= (ttpe)->tp_end)
-#define IDX_HDR_OFFSET(n)       (off64_t) (sizeof(invt_entry_t) * \
-					   (size_t) (n) \
-					   + sizeof(invt_counter_t) )
-#define STOBJ_OFFSET(nhdrs, nsess) (off64_t) ( \
+#define IDX_HDR_OFFSET(n)       (off64_t)(sizeof(invt_entry_t) * \
+					  (size_t)(n) \
+					  + sizeof(invt_counter_t))
+#define STOBJ_OFFSET(nhdrs, nsess) (off64_t)( \
 		sizeof(invt_sescounter_t) + \
-		(size_t) nhdrs * sizeof(invt_seshdr_t) + \
-		(size_t) nsess * sizeof(invt_session_t) )
+		(size_t)nhdrs * sizeof(invt_seshdr_t) + \
+		(size_t)nsess * sizeof(invt_session_t))
 
 #define STREQL(n, m)            (strcmp((n), (m)) == 0)
 #define UUID_EQL(n, m, t)       (uuid_compare(n, m, t) == 0)
 #define IS_PARTIAL_SESSION(h) ((h)->sh_flag & INVT_PARTIAL)
 #define IS_RESUMED_SESSION(h) ((h)->sh_flag & INVT_RESUMED)
-#define SC_EOF_INITIAL_POS      (off64_t) (sizeof(invt_sescounter_t) + \
-					   INVT_STOBJ_MAXSESSIONS * \
-					   (sizeof(invt_seshdr_t) + \
-					    sizeof(invt_session_t) ))
+#define SC_EOF_INITIAL_POS      (off64_t)(sizeof(invt_sescounter_t) + \
+					  INVT_STOBJ_MAXSESSIONS * \
+					  (sizeof(invt_seshdr_t) + \
+					   sizeof(invt_session_t)))
 
 #define INV_PERROR(s)   mlog(MLOG_NORMAL, "INV: %s %s\n", s, strerror(errno))
 #define INV_OFLAG(f)    (f == INV_SEARCH_ONLY) ? O_RDONLY : O_RDWR
@@ -324,18 +324,18 @@ typedef bool_t (*search_callback_t) (int, invt_seshdr_t *, void *, void *);
 
 #define PUT_COUNTERS(fd, cnt) PUT_REC_NOLOCK(fd, (void *)(cnt), \
 					     sizeof(invt_counter_t), \
-					     (off64_t) 0)
+					     (off64_t)0)
 
 #define PUT_SESCOUNTERS(fd, cnt)  PUT_REC_NOLOCK(fd, (void *)(cnt), \
 						 sizeof(invt_sescounter_t), \
-						 (off64_t) 0)
+						 (off64_t)0)
 
-#define GET_SESHEADERS(fd, hdrs, n) get_headers(fd, (void**)(hdrs), \
-						(size_t) (n * sizeof(invt_seshdr_t) ), \
-						sizeof(invt_sescounter_t)  )
+#define GET_SESHEADERS(fd, hdrs, n) get_headers(fd, (void **)(hdrs), \
+						(size_t)(n * sizeof(invt_seshdr_t)), \
+						sizeof(invt_sescounter_t))
 
-#define GET_ENTRIES(fd, hdrs, n, sz) get_headers(fd, (void**)(hdrs), \
-						 (size_t) (n * sz), sizeof(invt_counter_t))
+#define GET_ENTRIES(fd, hdrs, n, sz) get_headers(fd, (void **)(hdrs), \
+						 (size_t)(n * sz), sizeof(invt_counter_t))
 
 /*----------------------------------------------------------------------*/
 /* Function Prototypes							*/
@@ -375,7 +375,7 @@ int
 idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num);
 
 int
-idx_DEBUG_print (int fd);
+idx_DEBUG_print(int fd);
 
 /*----------------------------------------------------------------------*/
 
@@ -425,7 +425,7 @@ stobj_delete_mfile(int fd, inv_stream_t *strm, invt_mediafile_t *mf,
 
 bool_t
 stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
-		    void  **bufpp, size_t *bufszp);
+		    void **bufpp, size_t *bufszp);
 
 bool_t
 stobj_unpack_sessinfo(
@@ -442,7 +442,7 @@ stobj_delete_mobj(int fd, invt_seshdr_t *hdr, void *arg,
 		  void **buf);
 
 int
-stobj_get_sessinfo (inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses);
+stobj_get_sessinfo(inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses);
 
 void
 stobj_makefname(char *fname);
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 2d1227c..5db757c 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -66,29 +66,29 @@ stobj_insert_session(invt_idxinfo_t *	idx,
 	if (sescnt->ic_curnum > 0) {
 		uint i;
 		invt_session_t *sessions = calloc(sescnt->ic_curnum,
-						  sizeof(invt_session_t) );
+						  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);
+				   (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++) {
+		for (i = 0; i < sescnt->ic_curnum; i++) {
 			if (uuid_compare(sessions[i].s_sesid,
 					 s->ses->s_sesid) == 0)
 				break;
 
 		}
-		free (sessions);
+		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;
 		}
 
@@ -106,11 +106,11 @@ stobj_insert_session(invt_idxinfo_t *	idx,
 
 	if (stobj_put_session(fd, sescnt, s->ses, s->seshdr, s->strms,
 			      s->mfiles) < 0) {
-		free (sescnt);
+		free(sescnt);
 		return -1;
 	}
 
-	free (sescnt);
+	free(sescnt);
 	return 1;
 }
 
@@ -130,12 +130,12 @@ 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--) {
 		/* 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;
 	}
 
@@ -180,7 +180,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	assert(harr != NULL);
 
 	if ((ix = stobj_find_splitpoint(fd, harr, ns,
-					newsess->seshdr->sh_time) ) == 0)
+					newsess->seshdr->sh_time)) == 0)
 		return -1;
 
 	if (ix == ns) {
@@ -189,7 +189,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	} 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
@@ -243,7 +243,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 		/*
 		 * 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 */
@@ -253,7 +253,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 
 		/* Now delete that session from this StObj */
 		if (! stobj_delete_sessinfo(fd, sescnt, &session,
-					   &harr[i]) )
+					   &harr[i]))
 			return -1;
 		free(bufpp);
 	}
@@ -264,7 +264,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	   disk */
 	if (stobj_put_session(fd, sescnt, newsess->ses, newsess->seshdr,
 			      newsess->strms, newsess->mfiles) < 0) {
-		free (sescnt);
+		free(sescnt);
 		return -1;
 	}
 
@@ -327,7 +327,7 @@ stobj_put_session(
 	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)
@@ -336,10 +336,10 @@ stobj_put_session(
 	sescnt->ic_curnum++;
 
 #ifdef INVT_DEBUG
-	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);
+	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);
 #endif
 
 	/*
@@ -349,14 +349,14 @@ stobj_put_session(
 
 	if (strms == NULL) {
 		sescnt->ic_eof += (off64_t)(ses->s_max_nstreams *
-					    sizeof(invt_stream_t) );
+					    sizeof(invt_stream_t));
 	} else {
 		uint i;
 		size_t nmf = 0;
 		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;
+					    sizeof(invt_stream_t));
+		for (i = 0; i < ses->s_cur_nstreams; i++)
+			nmf += (size_t)strms[i].st_nmediafiles;
 
 		sescnt->ic_eof += (off64_t)(sizeof(invt_mediafile_t)
 					    * nmf);
@@ -408,29 +408,29 @@ stobj_sortheaders(int fd, uint num)
 	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");
-	for (i=0; i<(int)num; i++)
-		printf("%ld\n", (long) hdrs[i].sh_time);
+	for (i = 0; i < (int)num; i++)
+		printf("%ld\n", (long)hdrs[i].sh_time);
 #endif
-	qsort((void*) hdrs, (size_t) num,
+	qsort((void *)hdrs, (size_t)num,
 	      sizeof(invt_seshdr_t), stobj_hdrcmp);
 
 #ifdef INVT_DEBUG
 	printf("\n\nAFT\n");
-	for (i=0; i<(int)num; i++)
-		printf("%ld\n", (long) hdrs[i].sh_time);
+	for (i = 0; i < (int)num; i++)
+		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;
 
 }
@@ -452,14 +452,14 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 {
 	uint nstm = ses->s_cur_nstreams;
 	off64_t off = hdr->sh_streams_off;
-	off64_t mfileoff = off + (off64_t)(nstm * sizeof(invt_stream_t) );
+	off64_t mfileoff = off + (off64_t)(nstm * sizeof(invt_stream_t));
 	uint nmfiles = 0;
 	uint i, j;
 
 	/* fix the offsets in streams */
 	for (i = 0; i < nstm; i++) {
 		strms[i].st_firstmfile = mfileoff +
-					 (off64_t) ((size_t) nmfiles * sizeof(invt_mediafile_t) );
+					 (off64_t)((size_t)nmfiles * sizeof(invt_mediafile_t));
 		/* now fix the offsets in mediafiles */
 		for (j = 0; j < strms[i].st_nmediafiles; j++) {
 
@@ -467,13 +467,13 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 			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 =
 					strms[i].st_firstmfile +
-					(off64_t) ((j-1) * sizeof(invt_mediafile_t));
+					(off64_t)((j - 1) * sizeof(invt_mediafile_t));
 		}
 
 		/*
@@ -522,7 +522,7 @@ stobj_makefname(char *fname)
 	strcat(fname, str);
 	strcat(fname, INV_STOBJ_PREFIX);
 
-	assert((int) strlen(fname) < INV_STRLEN);
+	assert((int)strlen(fname) < INV_STRLEN);
 }
 
 
@@ -544,8 +544,8 @@ stobj_create(char *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);
+	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;
 	}
@@ -558,7 +558,7 @@ stobj_create(char *fname)
 	sescnt.ic_maxnum = INVT_STOBJ_MAXSESSIONS;
 	sescnt.ic_eof = SC_EOF_INITIAL_POS;
 
-	if (PUT_SESCOUNTERS (fd, &sescnt) < 0) {
+	if (PUT_SESCOUNTERS(fd, &sescnt) < 0) {
 		memset(fname, 0, INV_STRLEN);
 		INVLOCK(fd, LOCK_UN);
 		close(fd);
@@ -619,7 +619,7 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 	invt_sescounter_t *sescnt = NULL;
 	invt_stream_t stream;
 	inv_sestoken_t sestok = tok->md_sesstok;
-	int fd =  sestok->sd_invtok->d_stobj_fd;
+	int fd = sestok->sd_invtok->d_stobj_fd;
 	off64_t pos;
 
 	/*
@@ -632,7 +632,7 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 	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)
 		return -1;
@@ -659,8 +659,8 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 
 	stream.st_nmediafiles++;
 #ifdef INVT_DEBUG
-	mlog (MLOG_VERBOSE, "#################### mediafile #%d "
-	      "###################\n", stream.st_nmediafiles);
+	mlog(MLOG_VERBOSE, "#################### mediafile #%d "
+	     "###################\n", stream.st_nmediafiles);
 #endif
 	/* add the new mediafile at the tail of the list */
 
@@ -687,7 +687,7 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 		rval = PUT_REC_NOLOCK(fd, tok->md_lastmfile,
 				      sizeof(invt_mediafile_t),
 				      mf->mf_prevmf);
-		free (tok->md_lastmfile);
+		free(tok->md_lastmfile);
 		if (rval < 0)
 			return -1;
 	}
@@ -722,15 +722,15 @@ 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) {
+				   tok->sd_sesshdr_off)) > 0) {
 		rval = GET_REC_NOLOCK(fd, ses, sizeof(invt_session_t),
 				      tok->sd_session_off);
 	}
@@ -748,7 +748,7 @@ 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)
+		    void **bufpp, size_t *bufszp)
 {
 	size_t stmsz;
 	uint i, j;
@@ -767,15 +767,15 @@ stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 		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) );
+	strms = calloc(ses->s_cur_nstreams, sizeof(invt_stream_t));
 	if (GET_REC_NOLOCK(fd, strms, stmsz, hdr->sh_streams_off) < 0) {
-		free (strms);
+		free(strms);
 		return BOOL_FALSE;
 	}
 
 	for (i = 0; i < ses->s_cur_nstreams; i++)
 		sessz += sizeof(invt_mediafile_t) *
-			 (size_t) strms[i].st_nmediafiles;
+			 (size_t)strms[i].st_nmediafiles;
 
 	/* Now we know how big this entire thing is going to be */
 	sesbufcp = sesbuf = calloc(1, sessz);
@@ -791,7 +791,7 @@ stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 	 * 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) );
+	sesbuf += (size_t)(strlen(INVTSESS_COOKIE) * sizeof(char));
 
 	/*
 	 * This was originally INV_VERSION. Changed it to mean packed inventory
@@ -945,11 +945,11 @@ stobj_delete_mobj(int			fd,
 		return -1;
 
 	/* now get all the streams of this session */
-	strms = calloc (ses.s_cur_nstreams, sizeof(invt_stream_t) );
+	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);
+		free(strms);
 		return BOOL_FALSE;
 	}
 
@@ -957,7 +957,7 @@ stobj_delete_mobj(int			fd,
 	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) );
+		mfiles = mf = calloc(nmfiles, sizeof(invt_mediafile_t));
 		for (j = 0; j < nmfiles;
 		     j++,
 		     off = mf->mf_nextmf,
@@ -984,7 +984,7 @@ stobj_delete_mobj(int			fd,
 
 		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");
 #endif
@@ -1003,11 +1003,11 @@ stobj_delete_mobj(int			fd,
 			}
 
 		}
-		free (mfiles);
+		free(mfiles);
 		if (dirty);
 	}
 
-	free (strms);
+	free(strms);
 
 	return BOOL_FALSE; /* ret FALSE, or it'll stop iteration */
 }
@@ -1033,14 +1033,14 @@ stobj_unpack_sessinfo(
 	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) {
+	if (strncmp(p, INVTSESS_COOKIE, strlen(INVTSESS_COOKIE)) != 0) {
 		mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: inv_put_session: unknown cookie\n"));
 		return BOOL_FALSE;
@@ -1052,7 +1052,7 @@ stobj_unpack_sessinfo(
 	 * 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;
 
@@ -1076,7 +1076,7 @@ stobj_unpack_sessinfo(
 		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) {
+	} 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 */
@@ -1085,7 +1085,7 @@ stobj_unpack_sessinfo(
 	} else {
 		mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: inv_put_session: unknown packed inventory version"
-			     " %d\n"), *(inv_version_t *) p);
+			     " %d\n"), *(inv_version_t *)p);
 		return BOOL_FALSE;
 	}
 
@@ -1099,7 +1099,7 @@ stobj_unpack_sessinfo(
 
 
 	xlate_invt_session((invt_session_t *)p, (invt_session_t *)tmpbuf, 1);
-	bcopy (tmpbuf, p, sizeof(invt_session_t));
+	bcopy(tmpbuf, p, sizeof(invt_session_t));
 	s->ses = (invt_session_t *)p;
 	p += sizeof(invt_session_t);
 
@@ -1114,11 +1114,11 @@ stobj_unpack_sessinfo(
 
 #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;
+		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));
@@ -1129,19 +1129,19 @@ stobj_unpack_sessinfo(
 	}
 #endif
 	for (i = 0; i < s->ses->s_cur_nstreams; i++) {
-		p += (size_t) (s->strms[i].st_nmediafiles)
+		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) {
+	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) ));
+		     (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;
 }
@@ -1172,7 +1172,7 @@ 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) );
+	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;
@@ -1214,8 +1214,8 @@ stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 	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) );
+	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);
@@ -1243,22 +1243,22 @@ 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) {
-		free (strms);
+		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));
 
 	/* fill in the stream structures too */
-	i = (int) ses->s_cur_nstreams;
+	i = (int)ses->s_cur_nstreams;
 	while (i--) {
 		off64_t off;
 		uint j, nmf;
@@ -1269,7 +1269,7 @@ stobj_copy_invsess(int			fd,
 
 		if (nmf)
 			ises->s_streams[i].st_mediafiles = calloc(nmf,
-								  sizeof(inv_mediafile_t) );
+								  sizeof(inv_mediafile_t));
 		assert(! nmf || ises->s_streams[i].st_mediafiles);
 
 		for (j = 0; j < nmf;
@@ -1322,17 +1322,17 @@ 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;
+	nstreams = (int)ises->s_nstreams;
 	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) );
+		nmf = (int)ises->s_streams[i].st_nmediafiles;
+		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],
@@ -1348,8 +1348,8 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 int
 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);
 }
 
 
@@ -1375,17 +1375,17 @@ DEBUG_sessprint(invt_session_t *ses)
 }
 
 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),
+		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;
 		}
 	}
@@ -1395,13 +1395,13 @@ 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 (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))
@@ -1427,12 +1427,12 @@ DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 
 	bool_t moidsearch = (mobj && mobj->type != INVT_NULLTYPE);
 	if (moidsearch) {
-		if (! check_for_mobj (ses, mobj))
+		if (! check_for_mobj(ses, mobj))
 			return;
 	}
 
-	if (ref == 0 || fsidxprinted != (uint) prctx->index) {
-		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);
@@ -1460,7 +1460,7 @@ DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 	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);
@@ -1481,7 +1481,7 @@ DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 		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 (! mobj_eql(mfp, mobj))
 					continue;
 			}
 			printf("\t\t\tmedia file %d:", j);
diff --git a/inventory/inventory.h b/inventory/inventory.h
index 728e104..d7a8726 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -49,15 +49,15 @@ typedef uint32_t inv_version_t;
 /*
  * This is the general inventory version.
  */
-#define INV_VERSION             (inv_version_t) 1
+#define INV_VERSION             (inv_version_t)1
 
 /*
  * This is the version of the on-tape (packed) inventory.
  * version 2 has an extra inv_version_t in it to make everything
  * 64 bit aligned.
  */
-#define PACKED_INV_VERSION_1    (inv_version_t) 1
-#define PACKED_INV_VERSION_2    (inv_version_t) 2
+#define PACKED_INV_VERSION_1    (inv_version_t)1
+#define PACKED_INV_VERSION_2    (inv_version_t)2
 #define PACKED_INV_VERSION      PACKED_INV_VERSION_2
 
 /* Print [-I] suboption -depth */
@@ -179,9 +179,9 @@ struct invt_sesdesc_entry;
 struct invt_strdesc_entry;
 
 /* The three kinds of access tokens for the inventory */
-typedef struct invt_desc_entry          *inv_idbtoken_t;
-typedef struct invt_sesdesc_entry       *inv_sestoken_t;
-typedef struct invt_strdesc_entry       *inv_stmtoken_t;
+typedef struct invt_desc_entry *inv_idbtoken_t;
+typedef struct invt_sesdesc_entry *inv_sestoken_t;
+typedef struct invt_strdesc_entry *inv_stmtoken_t;
 
 
 
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 0b6c822..7fabbfc 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -68,7 +68,7 @@ CREAT_mfiles(inv_stmtoken_t tok, uuid_t *moid, ino_t f, ino_t n)
 	uuid_create(&labelid, &stat);
 	uuid_to_string(&labelid, &str, &stat);
 	strncpy(strbuf, str, 8);
-	free (str);
+	free(str);
 	strbuf[8] = '\0';
 	sprintf(label, "%s_%s (%d-%d)\0", "MEDIA_FILE", strbuf, (int)f, (int)n);
 
@@ -95,7 +95,7 @@ recons_test(int howmany)
 
 	fd = open(sesfile, O_RDONLY);
 
-	for (i=0; i<howmany && i < SESLIM; i++) {
+	for (i = 0; i < howmany && i < SESLIM; i++) {
 		rval = get_invtrecord(fd, &sarr[i],
 				      sizeof(uuid_t) + sizeof(size_t), off,
 				      BOOL_FALSE);
@@ -111,7 +111,7 @@ recons_test(int howmany)
 
 
 
-	for (i=0; i<howmany && i < SESLIM; i++) {
+	for (i = 0; i < howmany && i < SESLIM; i++) {
 		if (inv_put_sessioninfo(sarr[i].buf, sarr[i].sz) < 0)
 			printf("$ insert failed.\n");
 	}
@@ -135,11 +135,11 @@ delete_test(int n)
 	fd = open("moids", O_RDONLY);
 	if (fd < 0) return -1;
 
-	get_invtrecord(fd, &moid, sizeof(uuid_t), (n-1)* sizeof(uuid_t), 0);
+	get_invtrecord(fd, &moid, sizeof(uuid_t), (n - 1) * sizeof(uuid_t), 0);
 	uuid_to_string(&moid, &str, &stat);
 	printf("Searching for Moid = %s\n", str);
 	free(str);
-	if (! inv_delete_mediaobj(&moid) ) return -1;
+	if (! inv_delete_mediaobj(&moid)) return -1;
 
 	return 1;
 
@@ -153,7 +153,7 @@ sess_queries_byuuid(char *uu)
 	inv_session_t *ses;
 	invt_pr_ctx_t prctx;
 
-	uuid_from_string (uu, &uuid, &stat);
+	uuid_from_string(uu, &uuid, &stat);
 	printf("uuid = %s\n", uu);
 	if (inv_get_session_byuuid(&uuid, &ses)) {
 		if (! ses)
@@ -205,14 +205,14 @@ query_test(int level)
 		printf("mount pt %s\n", sesfile);
 		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, sesfile);
 		if (! tok) return -1;
-		idx_DEBUG_print (tok->d_invindex_fd);
+		idx_DEBUG_print(tok->d_invindex_fd);
 		return 1;
 	}
 
-	for (i = 7; i<8; i++) {
+	for (i = 7; i < 8; i++) {
 		printf("\n\n\n----------------------------------\n"
-		       "$ Searching fs %s\n", mnt_str[7-i]);
-		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, mnt_str[7-i]);
+		       "$ Searching fs %s\n", mnt_str[7 - i]);
+		tok = inv_open(INV_BY_MOUNTPT, INV_SEARCH_ONLY, mnt_str[7 - i]);
 		if (! tok) return -1;
 
 		prctx.index = i;
@@ -220,20 +220,20 @@ query_test(int level)
 			invmgr_inv_print(tok->d_invindex_fd, &prctx);
 		else {
 			if (inv_lasttime_level_lessthan(tok, level, &tm) && tm) {
-				printf("\n\nTIME %s %ld\n", ctime(tm), (long) *tm);
-				free (tm);
+				printf("\n\nTIME %s %ld\n", ctime(tm), (long)*tm);
+				free(tm);
 			}
 			if (inv_lastsession_level_lessthan(tok, level, &ses) && ses) {
 				DEBUG_sessionprint(ses, 99, &prctx);
-				free (ses->s_streams);
-				free (ses);
+				free(ses->s_streams);
+				free(ses);
 			}
 
 			if (inv_lastsession_level_equalto(tok, level, &ses) && ses) {
 				printf("Gotcha\n");
 				DEBUG_sessionprint(ses, 99, &prctx);
-				free (ses->s_streams);
-				free (ses);
+				free(ses->s_streams);
+				free(ses);
 			}
 		}
 		inv_close(tok);
@@ -273,20 +273,20 @@ write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 
 #ifdef FIRSTTIME
 	printf("first time!\n");
-	for (i=0; i<8; i++) {
+	for (i = 0; i < 8; i++) {
 		uuid_create(&fsidarr[i], &stat);
-		assert (stat == uuid_s_ok);
+		assert(stat == uuid_s_ok);
 		uuid_create(&sesidarr[i], &stat);
-		assert (stat == uuid_s_ok);
+		assert(stat == uuid_s_ok);
 	}
 	fd = open("uuids", O_RDWR | O_CREAT);
-	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L);
-	PUT_REC(fd, (void *)sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8);
+	PUT_REC(fd, (void *)fsidarr, sizeof(uuid_t) * 8, 0L);
+	PUT_REC(fd, (void *)sesidarr, sizeof(uuid_t) * 8, sizeof(uuid_t) * 8);
 	close(fd);
 #endif
 	fd = open("uuids", O_RDONLY);
-	GET_REC(fd, fsidarr, sizeof (uuid_t) * 8, 0L);
-	GET_REC(fd, sesidarr, sizeof (uuid_t) * 8, sizeof (uuid_t) * 8);
+	GET_REC(fd, fsidarr, sizeof(uuid_t) * 8, 0L);
+	GET_REC(fd, sesidarr, sizeof(uuid_t) * 8, sizeof(uuid_t) * 8);
 	close(fd);
 #ifdef RECONS
 	rfd = open(sesfile, O_RDWR | O_CREAT);
@@ -306,31 +306,31 @@ write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 		dev = dev_str[7];
 		fsidp = &fsidarr[0]; /* j */
 		tok1 = inv_open(INV_BY_UUID, INV_SEARCH_N_MOD, fsidp);
-		assert (tok1 != INV_TOKEN_NULL);
+		assert(tok1 != INV_TOKEN_NULL);
 
 		uuid_create(&labelid, &stat);
 		uuid_to_string(&labelid, &str, &stat);
 		strncpy(strbuf, str, 8);
-		free (str);
+		free(str);
 		strbuf[8] = '\0';
 		sprintf(label, "%s_%s (%d)\0", "SESSION_LABEL", strbuf, i);
 
 		tok2 = inv_writesession_open(tok1, fsidp,
 					     &labelid,
 					     label,
-					     (bool_t)i%2,
-					     (bool_t)i%2,
+					     (bool_t)i % 2,
+					     (bool_t)i % 2,
 					     dumplevel, nstreams,
 					     time(NULL),
 					     mnt, dev);
-		assert (tok2 != INV_TOKEN_NULL);
-		for (m = 0; m<nstreams; m++) {
+		assert(tok2 != INV_TOKEN_NULL);
+		for (m = 0; m < nstreams; m++) {
 			tok3 = inv_stream_open(tok2, "/dev/rmt");
-			assert (tok3 != INV_TOKEN_NULL);
+			assert(tok3 != INV_TOKEN_NULL);
 
-			for (k = 0; k<nmedia; k++)
-				CREAT_mfiles(tok3, &labelid, k*100,
-					     k*100 + 99);
+			for (k = 0; k < nmedia; k++)
+				CREAT_mfiles(tok3, &labelid, k * 100,
+					     k * 100 + 99);
 			inv_stream_close(tok3, BOOL_TRUE);
 		}
 
@@ -372,25 +372,25 @@ mp_test(int nstreams)
 {
 #if 0
 	tok1 = inv_open(INV_BY_UUID, fsidp);
-	assert (tok1 != INV_TOKEN_NULL);
+	assert(tok1 != INV_TOKEN_NULL);
 
 	tok2 = inv_writesession_open(tok1, fsidp,
 				     &labelid,
 				     label,
-				     (bool_t)i%2,
-				     (bool_t)i%2,
+				     (bool_t)i % 2,
+				     (bool_t)i % 2,
 				     dumplevel, nstreams,
 				     time(NULL),
 				     mnt, dev);
-	assert (tok2 != INV_TOKEN_NULL);
+	assert(tok2 != INV_TOKEN_NULL);
 
-	for (m = 0; m<nstreams; m++) {
+	for (m = 0; m < nstreams; m++) {
 		tok3 = inv_stream_open(tok2, "/dev/rmt");
-		assert (tok3 != INV_TOKEN_NULL);
+		assert(tok3 != INV_TOKEN_NULL);
 
-		for (k = 0; k<nmedia; k++)
-			CREAT_mfiles(tok3, &labelid, k*100,
-				     k*100 + 99);
+		for (k = 0; k < nmedia; k++)
+			CREAT_mfiles(tok3, &labelid, k * 100,
+				     k * 100 + 99);
 		inv_stream_close(tok3, BOOL_TRUE);
 	}
 #endif
@@ -499,7 +499,7 @@ main(int argc, char *argv[])
 	else if (op == DEL)
 		rval = delete_test(nsess);
 	else if (op == MP)
-		rval = mp_test (nstreams);
+		rval = mp_test(nstreams);
 	else if (op == QUE2) {
 		if (uuid)
 			rval = sess_queries_byuuid(uuid);
diff --git a/invutil/cmenu.h b/invutil/cmenu.h
index 5da537e..5b6217b 100644
--- a/invutil/cmenu.h
+++ b/invutil/cmenu.h
@@ -32,7 +32,7 @@
 	beep(); \
 	wrefresh(stdscr); \
 	sleep(2)
-#define put_info_header(m)      put_line(infowin, 0, m, A_REVERSE|A_BOLD, ALIGN_LEFT)
+#define put_info_header(m)      put_line(infowin, 0, m, A_REVERSE | A_BOLD, ALIGN_LEFT)
 #define put_info_line(l, m)     put_line(infowin, l, m, 0, ALIGN_LEFT)
 #define put_option(w, l, t, a)  put_line(w, l, t, a, ALIGN_LEFT)
 #define clear_line(w, l)                wmove(w, l, 0); wclrtoeol(w);
diff --git a/invutil/fstab.c b/invutil/fstab.c
index 745f677..0052f9d 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -225,7 +225,7 @@ add_fstab_data(int fidx, invt_fstab_t *data)
 }
 
 node_t *
-generate_fstab_menu(char * inv_path, node_t *startnode, int level, char *fstabname)
+generate_fstab_menu(char *inv_path, node_t *startnode, int level, char *fstabname)
 {
 	int i;
 	char *invname;
@@ -242,7 +242,7 @@ generate_fstab_menu(char * inv_path, node_t *startnode, int level, char *fstabna
 	fstab_entry = (invt_fstab_t *)(fstab_file[idx].mapaddr + sizeof(invt_counter_t));
 
 	n = startnode;
-	for (i=0; i < fstab_file[idx].counter->ic_curnum; i++) {
+	for (i = 0; i < fstab_file[idx].counter->ic_curnum; i++) {
 		len = strlen(fstab_entry[i].ft_mountpt) + strlen(fstab_entry[i].ft_devpath) + 40;
 		txt = malloc(len);
 		if (txt == NULL) {
@@ -374,7 +374,7 @@ remmap_fstab(int fidx, int num)
 
 	/* regenerate the data index for the file given the new mapping */
 	fstab_entry = (invt_fstab_t *)(fstab_file[fidx].mapaddr + sizeof(invt_counter_t));
-	for (i=0; i < nEntries; i++) {
+	for (i = 0; i < nEntries; i++) {
 		if (i >= fstab_file[fidx].numrecords) {
 			add_fstab_data(fidx, &(fstab_entry[i]));
 		}
@@ -429,7 +429,7 @@ close_fstab(int fidx)
 	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)) {
+	if ((fstabentries != 0) && (fstabentries < fstab_file[fidx].nEntries)) {
 		ftruncate(fstab_file[fidx].fd,
 			  sizeof(invt_counter_t) + (sizeof(invt_fstab_t) * fstabentries));
 	}
diff --git a/invutil/invidx.c b/invutil/invidx.c
index b19cb6e..a641f09 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -99,7 +99,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 				&inv_entry[idx + 1],
 				(sizeof(invt_entry_t) * (invidx_file[fidx].counter->ic_curnum - idx - 1)));
 
-			invidx_file[fidx].data[idx]=NULL;
+			invidx_file[fidx].data[idx] = NULL;
 			for (i = idx + 1; i < invidx_file[fidx].numrecords; i++) {
 				if (invidx_file[fidx].data[i] != NULL)
 					invidx_file[fidx].data[i]--;
@@ -283,7 +283,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 				return 0;
 			}
 
-			new_fd = open(dst_idxfile, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
+			new_fd = open(dst_idxfile, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
 			if (new_fd < 0) {
 				put_error("Error: unable to open inventory index file");
 				return 0;
@@ -603,7 +603,7 @@ stobj_create(char *fname)
 	invt_sescounter_t sescnt;
 
 	/* create the new storage object */
-	if ((fd = open(fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
+	if ((fd = open(fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
 		return -1;
 	}
 
@@ -617,7 +617,7 @@ stobj_create(char *fname)
 	sescnt.ic_eof = SC_EOF_INITIAL_POS;
 
 	lseek(fd, 0, SEEK_SET);
-	write_n_bytes (fd, (char *)&sescnt, sizeof(sescnt), "new stobj file");
+	write_n_bytes(fd, (char *)&sescnt, sizeof(sescnt), "new stobj file");
 
 	INVLOCK(fd, LOCK_UN);
 	return fd;
@@ -630,23 +630,23 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 {
 	uint nstm = ses->s_cur_nstreams;
 	off64_t off = hdr->sh_streams_off;
-	off64_t mfileoff= off + (off64_t)(nstm * sizeof(invt_stream_t) );
+	off64_t mfileoff = off + (off64_t)(nstm * sizeof(invt_stream_t));
 	uint nmfiles = 0;
 	uint i, j;
 
 	/* fix the offsets in streams */
 	for (i = 0; i < nstm; i++) {
-		strms[i].st_firstmfile = mfileoff + (off64_t) ((size_t) nmfiles * sizeof(invt_mediafile_t) );
+		strms[i].st_firstmfile = mfileoff + (off64_t)((size_t)nmfiles * sizeof(invt_mediafile_t));
 		/* now fix the offsets in mediafiles */
 		for (j = 0; j < strms[i].st_nmediafiles; j++) {
 
 			/* no need to fix the last element's next ptr */
 			if (j < strms[i].st_nmediafiles - 1)
-				mfiles[nmfiles + j].mf_nextmf =  strms[i].st_firstmfile + (off64_t) ((j+1) * sizeof(invt_mediafile_t));
+				mfiles[nmfiles + j].mf_nextmf = strms[i].st_firstmfile + (off64_t)((j + 1) * sizeof(invt_mediafile_t));
 
 			/* no need to fix the first element's prev ptr */
 			if (j)
-				mfiles[nmfiles + j].mf_prevmf = strms[i].st_firstmfile + (off64_t) ((j-1) * sizeof(invt_mediafile_t));
+				mfiles[nmfiles + j].mf_prevmf = strms[i].st_firstmfile + (off64_t)((j - 1) * sizeof(invt_mediafile_t));
 		}
 
 		/*
@@ -833,7 +833,7 @@ find_invidx_insert_pos(int fidx, invt_entry_t *inv_entry)
 
 	for (i = 0; i < invidx_file[fidx].numrecords - 1; i++) {
 		entry = invidx_file[fidx].data[i];
-		next_entry = invidx_file[fidx].data[i+1];
+		next_entry = invidx_file[fidx].data[i + 1];
 
 		if (inv_entry->ie_timeperiod.tp_start > entry->ie_timeperiod.tp_end
 		    && inv_entry->ie_timeperiod.tp_end < next_entry->ie_timeperiod.tp_start) {
@@ -904,7 +904,7 @@ add_invidx_data(int fidx, invt_entry_t *data)
 }
 
 node_t *
-generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFileName)
+generate_invidx_menu(char *inv_path, node_t *startnode, int level, char *idxFileName)
 {
 	int i;
 	int idx;
@@ -921,7 +921,7 @@ generate_invidx_menu(char * inv_path, node_t *startnode, int level, char *idxFil
 	invidx_entry = (invt_entry_t *)(invidx_file[idx].mapaddr + sizeof(invt_counter_t));
 
 	n = startnode;
-	for (i=0; i < invidx_file[idx].counter->ic_curnum; i++) {
+	for (i = 0; i < invidx_file[idx].counter->ic_curnum; i++) {
 		len = strlen(invidx_entry[i].ie_filename) + 54;
 		txt = malloc(len);
 		if (txt == NULL) {
@@ -1022,7 +1022,7 @@ remmap_invidx(int fidx, int num)
 
 	/* regenerate the data index for the file given the new mapping */
 	inv_entry = (invt_entry_t *)(invidx_file[fidx].mapaddr + sizeof(invt_counter_t));
-	for (i=0; i < nEntries; i++) {
+	for (i = 0; i < nEntries; i++) {
 		if (i >= invidx_file[fidx].numrecords) {
 			add_invidx_data(fidx, &(inv_entry[i]));
 		}
@@ -1043,7 +1043,7 @@ open_invidx(char *idxFileName)
 	char *name;
 	invt_counter_t header;
 
-	errno=0;
+	errno = 0;
 	fd = open_and_lock(idxFileName, FILE_WRITE, wait_for_locks);
 	if (fd < 0) {
 		return fd;
@@ -1060,7 +1060,7 @@ open_invidx(char *idxFileName)
 	nEntries = header.ic_curnum;
 
 	mapaddr = mmap_n_bytes(fd,
-			       nEntries*sizeof(invt_entry_t) + sizeof(invt_counter_t),
+			       nEntries * sizeof(invt_entry_t) + sizeof(invt_counter_t),
 			       BOOL_FALSE,
 			       idxFileName);
 
@@ -1078,7 +1078,7 @@ close_invidx(int idx)
 
 	nEntries = invidx_file[idx].counter->ic_curnum;
 	munmap(invidx_file[idx].mapaddr,
-	       (invidx_file[idx].nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
+	       (invidx_file[idx].nEntries * sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
 	if (nEntries != 0 && nEntries != invidx_file[idx].nEntries) {
 		ftruncate(invidx_file[idx].fd,
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 1a49d39..13ebd56 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -301,7 +301,7 @@ get_mntpnt(char *txt)
 	if (p == NULL)
 		return txt;
 
-	return p+1;
+	return p + 1;
 }
 
 int
@@ -361,7 +361,7 @@ ParseDate(char *strDate)
 	};
 
 	for (fmt = &templateStr[0]; *fmt != NULL; fmt++) {
-		memset (&tm, 0, sizeof (struct tm)); /* ensure fields init'ed */
+		memset(&tm, 0, sizeof(struct tm));   /* ensure fields init'ed */
 		if (strptime(strDate, *fmt, &tm) != NULL)
 			break;
 	}
@@ -379,7 +379,7 @@ ParseDate(char *strDate)
 	/* HACK to ensure tm_isdst is set BEFORE calling mktime(3) */
 	if (tm.tm_isdst) {
 		int dst = tm.tm_isdst;
-		memset (&tm, 0, sizeof (struct tm));
+		memset(&tm, 0, sizeof(struct tm));
 		tm.tm_isdst = dst;
 		(void)strptime(strDate, *fmt, &tm);
 		tm.tm_isdst = dst;
@@ -405,35 +405,35 @@ ParseDate(char *strDate)
 }
 
 char *
-GetNameOfStobj (char *inv_path, char *filename)
+GetNameOfStobj(char *inv_path, char *filename)
 {
 	char *str;
 	char *name;
 
 	str = basename(filename);
-	name = (char *) malloc(strlen(inv_path) + 1  + strlen(str) + 1);
+	name = (char *)malloc(strlen(inv_path) + 1 + strlen(str) + 1);
 	strcpy(name, inv_path);
 	strcat(name, "/");
 	strcat(name, str);
 
-	return(name);
+	return (name);
 }
 
 char *
-GetNameOfInvIndex (char *inv_path, uuid_t uuid)
+GetNameOfInvIndex(char *inv_path, uuid_t uuid)
 {
 	char str[UUID_STR_LEN + 1];
 	char *name;
 
 	uuid_unparse(uuid, str);
-	name = (char *) malloc(strlen(inv_path) + 1  + strlen(str)
-			       + strlen(INV_INVINDEX_PREFIX) + 1);
+	name = (char *)malloc(strlen(inv_path) + 1 + strlen(str)
+			      + strlen(INV_INVINDEX_PREFIX) + 1);
 	strcpy(name, inv_path);
 	strcat(name, "/");
 	strcat(name, str);
 	strcat(name, INV_INVINDEX_PREFIX);
 
-	return(name);
+	return (name);
 }
 
 char *
@@ -441,12 +441,12 @@ GetFstabFullPath(char *inv_path)
 {
 	char *fstabname;
 
-	fstabname = (char *) malloc(strlen(inv_path) + 1 /* one for the "/" */
-				    + strlen("fstab") + 1);
+	fstabname = (char *)malloc(strlen(inv_path) + 1  /* one for the "/" */
+				   + strlen("fstab") + 1);
 	strcpy(fstabname, inv_path);
 	strcat(fstabname, "/");
 	strcat(fstabname, "fstab");
-	return(fstabname);
+	return (fstabname);
 }
 
 void
@@ -485,7 +485,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	nEntries = cnt.ic_curnum;
 
 	mapaddr = mmap_n_bytes(fd,
-			       nEntries*sizeof(invt_fstab_t) + sizeof(invt_counter_t),
+			       nEntries * sizeof(invt_fstab_t) + sizeof(invt_counter_t),
 			       BOOL_FALSE,
 			       fstabname);
 
@@ -501,7 +501,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 
 		printf("   Found entry for %s\n", fstabentry[i].ft_mountpt);
 
-		for (j = i +1; j < counter->ic_curnum; j++) {
+		for (j = i + 1; j < counter->ic_curnum; j++) {
 			if (uuid_compare(fstabentry[i].ft_uuid, fstabentry[j].ft_uuid) == 0)
 			{
 				printf("     duplicate fstab entry\n");
@@ -570,14 +570,14 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	fstabEntries = counter->ic_curnum;
 
 	munmap(mapaddr,
-	       (nEntries*sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
+	       (nEntries * sizeof(invt_fstab_t)) + sizeof(invt_counter_t));
 
-	if ((fstabEntries != 0)  && (fstabEntries != nEntries)) {
+	if ((fstabEntries != 0) && (fstabEntries != nEntries)) {
 		if (debug) {
 			printf("ftruncate fstab from %d to %d (%ld bytes)\n",
 			       nEntries,
 			       fstabEntries,
-			       (long) sizeof(invt_counter_t) + (sizeof(invt_fstab_t) * fstabEntries));
+			       (long)sizeof(invt_counter_t) + (sizeof(invt_fstab_t) * fstabEntries));
 			printf("ftruncate %s\n", fstabname);
 		}
 		ftruncate(fd,
@@ -629,13 +629,13 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 	nEntries = header.ic_curnum;
 
 	temp = mmap_n_bytes(fd,
-			    nEntries*sizeof(invt_entry_t) + sizeof(invt_counter_t),
+			    nEntries * sizeof(invt_entry_t) + sizeof(invt_counter_t),
 			    BOOL_FALSE, idxFileName);
 
 	counter = (invt_counter_t *)temp;
 	invIndexEntry = (invt_entry_t *)(temp + sizeof(invt_counter_t));
 
-	for (i=0; i < counter->ic_curnum;)
+	for (i = 0; i < counter->ic_curnum;)
 	{
 		removeflag = BOOL_FALSE;
 		printf("         Checking access for\n"
@@ -647,7 +647,7 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 			       ctime32(&(invIndexEntry[i].ie_timeperiod.tp_end)));
 		}
 
-		if ((access(invIndexEntry[i].ie_filename, R_OK | W_OK) == -1)  &&
+		if ((access(invIndexEntry[i].ie_filename, R_OK | W_OK) == -1) &&
 		    (errno == ENOENT))
 		{
 			printf("         Unable to access %s referred in %s\n",
@@ -676,14 +676,14 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 
 	validEntries = counter->ic_curnum;
 
-	munmap(temp, (nEntries*sizeof(invt_entry_t)) + sizeof(invt_counter_t));
+	munmap(temp, (nEntries * sizeof(invt_entry_t)) + sizeof(invt_counter_t));
 
-	if ((validEntries != 0)  && (validEntries != nEntries)) {
+	if ((validEntries != 0) && (validEntries != nEntries)) {
 		if (debug) {
 			printf("ftruncate idx from %d to %d (%ld bytes)\n",
 			       nEntries,
 			       validEntries,
-			       (long) sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)));
+			       (long)sizeof(invt_counter_t) + (validEntries * sizeof(invt_entry_t)));
 			printf("- truncate %s\n", idxFileName);
 		}
 		ftruncate(fd,
@@ -704,10 +704,10 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 			printf("unlink idx file %s\n", idxFileName);
 		}
 		unlink(idxFileName);
-		return(-1);
+		return (-1);
 	}
 
-	return(0);
+	return (0);
 }
 
 int
@@ -758,7 +758,7 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 	StObjses = (invt_session_t *)(temp + StObjhdr->sh_sess_off);
 
 	sescount = 0;
-	for (i=0; i < counter->ic_curnum;) {
+	for (i = 0; i < counter->ic_curnum;) {
 		removeflag = BOOL_FALSE;
 		if (StObjhdr->sh_pruned)
 			prunedcount++;
@@ -796,7 +796,7 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 			printf("\t\tsession id:\t%s\n", str);
 			printf("\t\tlevel:\t\t%d\n", StObjhdr->sh_level);
 			printf("\t\tstreams:\t%d\n", StObjses->s_cur_nstreams);
-			for (i = 0; i < (int) StObjses->s_cur_nstreams; i++) {
+			for (i = 0; i < (int)StObjses->s_cur_nstreams; i++) {
 				printf("\t\tstream %d:\n", i);
 				StObjstrm = (invt_stream_t *)(temp +
 							      StObjhdr->sh_streams_off +
@@ -804,9 +804,9 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 				printf("\t\t\tpathname:\t%s\n",
 				       StObjstrm->st_cmdarg);
 				printf("\t\t\tinode start:\t%llu\n",
-				       (unsigned long long) StObjstrm->st_startino.ino);
+				       (unsigned long long)StObjstrm->st_startino.ino);
 				printf("\t\t\tinode   end:\t%llu\n",
-				       (unsigned long long) StObjstrm->st_endino.ino);
+				       (unsigned long long)StObjstrm->st_endino.ino);
 				printf("\t\t\tinterrupted:\t%s\n",
 				       StObjstrm->st_interrupted ? "YES" : "NO");
 				printf("\t\t\tmedia files:\t%d\n",
@@ -817,11 +817,11 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 									(j * sizeof(invt_mediafile_t)));
 					printf("\t\t\tmfile file %d:\n", j);
 					printf("\t\t\t\tmfile size:\t%lld\n",
-					       (long long) StObjmed->mf_size);
+					       (long long)StObjmed->mf_size);
 					printf("\t\t\t\tmfile start:\t%llu\n",
-					       (unsigned long long) StObjmed->mf_startino.ino);
+					       (unsigned long long)StObjmed->mf_startino.ino);
 					printf("\t\t\t\tmfile end:\t%llu\n",
-					       (unsigned long long) StObjmed->mf_endino.ino);
+					       (unsigned long long)StObjmed->mf_endino.ino);
 					printf("\t\t\t\tmedia label:\t\"%s\"\n",
 					       StObjmed->mf_label);
 				}
@@ -915,10 +915,10 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 		if (debug)
 			printf("Removing: %s\n", StObjFileName);
 		unlink(StObjFileName);
-		return(-1);
+		return (-1);
 	}
 
-	return(0);
+	return (0);
 }
 
 /*
@@ -942,7 +942,7 @@ uses_specified_mf_label(
 	if (! r_mf_label) {
 		return 1; /* prune */
 	}
-	for (s = 0; s < (int) StObjses->s_cur_nstreams; s++) {
+	for (s = 0; s < (int)StObjses->s_cur_nstreams; s++) {
 		StObjstrm = (invt_stream_t *)
 			    (temp + StObjhdr->sh_streams_off + (s * sizeof(invt_stream_t)));
 		for (m = 0; m < StObjstrm->st_nmediafiles; m++, num_media_objects++) {
@@ -1017,7 +1017,7 @@ inv_DEBUG_lock_str(int c)
  *      returns SYSCALL_FAILED for other failures.
  */
 int
-open_and_lock(char * path, Open_t open_type, uint lock_wait_flag)
+open_and_lock(char *path, Open_t open_type, uint lock_wait_flag)
 {
 	int fd;
 	int rc;
@@ -1106,58 +1106,58 @@ open_and_lock(char * path, Open_t open_type, uint lock_wait_flag)
 }
 
 void
-read_n_bytes(int fd, void * buf, size_t count, char *path)
+read_n_bytes(int fd, void *buf, size_t count, char *path)
 {
 	int rc;
 
 	rc = read(fd, buf, count);
 	if (rc < 0) {
 		fprintf(stderr, "%s: read of %ld bytes on %s failed.\n",
-			g_programName, (long) count, path);
+			g_programName, (long)count, path);
 		perror(path);
-		exit (2);
+		exit(2);
 	} else if (rc != count) {
 		fprintf(stderr, "%s: read of %ld bytes on %s failed.\n",
-			g_programName, (long) count, path);
+			g_programName, (long)count, path);
 		fprintf(stderr, "Tried to read %ld bytes, got %d.\n",
-			(long) count, rc);
-		exit (2);
+			(long)count, rc);
+		exit(2);
 	}
 }
 
 void
-write_n_bytes(int fd, void * buf, size_t count, char *path)
+write_n_bytes(int fd, void *buf, size_t count, char *path)
 {
 	int rc;
 
 	rc = write(fd, buf, count);
 	if (rc < 0) {
 		fprintf(stderr, "%s: write of %ld bytes on %s failed.\n",
-			g_programName, (long) count, path);
+			g_programName, (long)count, path);
 		perror(path);
-		exit (2);
+		exit(2);
 	} else if (rc != count) {
 		fprintf(stderr, "%s: write of %ld bytes on %s failed.\n",
-			g_programName, (long) count, path);
+			g_programName, (long)count, path);
 		fprintf(stderr, "Tried to write %ld bytes, wrote %d.\n",
-			(long) count, rc);
-		exit (2);
+			(long)count, rc);
+		exit(2);
 	}
 }
 
 void *
 mmap_n_bytes(int fd, size_t count, bool_t checkonly, char *path)
 {
-	void * temp;
+	void *temp;
 
 	lseek(fd, 0, SEEK_SET);
 	temp = mmap(NULL, count,
-		    (checkonly == BOOL_TRUE) ? PROT_READ : PROT_READ|PROT_WRITE,
+		    (checkonly == BOOL_TRUE) ? PROT_READ : PROT_READ | PROT_WRITE,
 		    MAP_SHARED, fd, 0);
 
 	if (temp == (void *)-1) {
 		fprintf(stderr, "%s: error in mmap of %ld bytes for file %s\n",
-			g_programName, (long) count, path);
+			g_programName, (long)count, path);
 		perror("mmap");
 		fprintf(stderr, "%s: abnormal termination\n", g_programName);
 		exit(1);
@@ -1166,7 +1166,7 @@ mmap_n_bytes(int fd, size_t count, bool_t checkonly, char *path)
 }
 
 void
-usage (void)
+usage(void)
 {
 	int pfxsz;
 
diff --git a/invutil/invutil.h b/invutil/invutil.h
index b4a16b2..33b5284 100644
--- a/invutil/invutil.h
+++ b/invutil/invutil.h
@@ -18,7 +18,7 @@
 #ifndef INVUTIL_H
 #define INVUTIL_H
 
-#define STR_LEN                 INV_STRLEN+32
+#define STR_LEN                 INV_STRLEN + 32
 #define GEN_STRLEN              32
 
 /*      open_and_lock() return codes */
@@ -34,16 +34,16 @@ typedef enum {
 	DIRECTORY_UNSAFE
 } Open_t;
 
-extern char * g_programName;
-extern char * g_programVersion;
-extern char * inventory_path;
+extern char *g_programName;
+extern char *g_programVersion;
+extern char *inventory_path;
 extern bool_t debug;
 extern bool_t force;
 extern bool_t wait_for_locks;
 
-char *  GetFstabFullPath(char *);
-char * GetNameOfInvIndex (char *, uuid_t);
-char *  GetNameOfStobj (char *inv_path, char *filename);
+char *GetFstabFullPath(char *);
+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 *);
@@ -51,11 +51,11 @@ 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 *);
-void    usage (void);
+void    usage(void);
 int open_and_lock(char *, Open_t, uint);
 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 *mmap_n_bytes(int, size_t, bool_t, char *);
 void    ListFstab(void);
 int     ListInvIndexFile(char *);
 int     ListStObjFile(char *);
diff --git a/invutil/menu.c b/invutil/menu.c
index c866210..b50734c 100644
--- a/invutil/menu.c
+++ b/invutil/menu.c
@@ -168,7 +168,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 		if (quit == BOOL_TRUE)
 			continue;
 
-		c=wgetch(win);
+		c = wgetch(win);
 		switch (c) {
 		case '?':
 		case KEY_F(1):
diff --git a/invutil/stobj.c b/invutil/stobj.c
index b70f732..1c475da 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -192,7 +192,7 @@ stobjsess_highlight(WINDOW *win, node_t *current, node_t *list)
 		 (stobjhdr->sh_pruned == BOOL_TRUE) ? "yes" : "no",
 		 stobjhdr->sh_flag,
 		 ctime32(&(stobjhdr->sh_time)));
-	txt[strlen(txt)-1] = '\0';
+	txt[strlen(txt) - 1] = '\0';
 	put_info_line(1, txt);
 
 	uuid_unparse(stobjses->s_fsid, uuidstr);
@@ -230,13 +230,13 @@ stobjstrm_highlight(WINDOW *win, node_t *current, node_t *list)
 	put_info_line(1, txt);
 
 	snprintf(txt, sizeof(txt), "start ino: %llu, offset %lld",
-		 (unsigned long long) stobjstrm->st_startino.ino,
-		 (long long) stobjstrm->st_startino.offset);
+		 (unsigned long long)stobjstrm->st_startino.ino,
+		 (long long)stobjstrm->st_startino.offset);
 	put_info_line(2, txt);
 
 	snprintf(txt, sizeof(txt), "  end ino: %llu, offset %lld",
-		 (unsigned long long) stobjstrm->st_endino.ino,
-		 (long long) stobjstrm->st_endino.offset);
+		 (unsigned long long)stobjstrm->st_endino.ino,
+		 (long long)stobjstrm->st_endino.offset);
 	put_info_line(3, txt);
 
 	return FALSE;
@@ -266,13 +266,13 @@ stobjmed_highlight(WINDOW *win, node_t *current, node_t *list)
 	put_info_line(1, txt);
 
 	snprintf(txt, sizeof(txt), "start ino: %llu, offset %lld",
-		 (unsigned long long) stobjmed->mf_startino.ino,
-		 (long long) stobjmed->mf_startino.offset);
+		 (unsigned long long)stobjmed->mf_startino.ino,
+		 (long long)stobjmed->mf_startino.offset);
 	put_info_line(2, txt);
 
 	snprintf(txt, sizeof(txt), "  end ino: %llu, offset %lld",
-		 (unsigned long long) stobjmed->mf_endino.ino,
-		 (long long) stobjmed->mf_endino.offset);
+		 (unsigned long long)stobjmed->mf_endino.ino,
+		 (long long)stobjmed->mf_endino.offset);
 	put_info_line(3, txt);
 
 	return FALSE;
@@ -414,7 +414,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 
 	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);
@@ -423,7 +423,7 @@ generate_stobj_menu(node_t *startnode, int level, char *StObjFileName)
 		session->header = StObjhdr;
 		session->session = StObjses;
 
-		len = 60+strlen(session->session->s_label);
+		len = 60 + strlen(session->session->s_label);
 		txt = malloc(len);
 		if (txt == NULL) {
 			fprintf(stderr, "%s: internal memory error: invidx_text\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)));
@@ -577,7 +577,7 @@ open_stobj(char *StObjFileName)
 	invt_sescounter_t cnt;
 	char *name;
 
-	errno=0;
+	errno = 0;
 	fd = open_and_lock(StObjFileName, FILE_WRITE, wait_for_locks);
 	if (fd < 0) {
 		return fd;
diff --git a/librmt/isrmt.c b/librmt/isrmt.c
index 138632b..79f685e 100644
--- a/librmt/isrmt.c
+++ b/librmt/isrmt.c
@@ -27,7 +27,7 @@
  *	Isrmt. Let a programmer know he has a remote device.
  */
 
-int isrmt (fd)
+int isrmt(fd)
 int fd;
 {
 	return (fd >= REM_BIAS);
diff --git a/librmt/rmtaccess.c b/librmt/rmtaccess.c
index f0d5417..0944d41 100644
--- a/librmt/rmtaccess.c
+++ b/librmt/rmtaccess.c
@@ -29,17 +29,17 @@
  *	to caller.
  */
 
-int rmtaccess (path, amode)
+int rmtaccess(path, amode)
 char *path;
 int amode;
 {
-	if (_rmt_dev (path))
+	if (_rmt_dev(path))
 	{
 		return (0);             /* Let /etc/rmt find out */
 	}
 	else
 	{
-		return (access (path, amode));
+		return (access(path, amode));
 	}
 }
 
diff --git a/librmt/rmtclose.c b/librmt/rmtclose.c
index 9ba214d..20be537 100644
--- a/librmt/rmtclose.c
+++ b/librmt/rmtclose.c
@@ -29,19 +29,19 @@ static int _rmt_close(int);
  *	Close a file.  Looks just like close(2) to caller.
  */
 
-int rmtclose (fildes)
+int rmtclose(fildes)
 int fildes;
 {
-	if (isrmt (fildes))
+	if (isrmt(fildes))
 	{
 		/* no longer know what host we have for this fildes */
 		RMTHOST(fildes - REM_BIAS) = UNAME_UNKNOWN;
 
-		return (_rmt_close (fildes - REM_BIAS));
+		return (_rmt_close(fildes - REM_BIAS));
 	}
 	else
 	{
-		return (close (fildes));
+		return (close(fildes));
 	}
 }
 
@@ -58,10 +58,10 @@ _rmt_close(int fildes)
 		rc = _rmt_status(fildes);
 
 		_rmt_abort(fildes);
-		return(rc);
+		return (rc);
 	}
 
-	return(-1);
+	return (-1);
 }
 
 
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index 5811d50..cfeaac3 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -48,7 +48,7 @@ char *buf;
 	blen = strlen(buf);
 	if (write(WRITE(fildes), buf, blen) == blen)
 	{
-		return(0);
+		return (0);
 	}
 
 /*
@@ -58,7 +58,7 @@ char *buf;
 	_rmt_abort(fildes);
 
 	setoserror(EIO);
-	return(-1);
+	return (-1);
 }
 
 
diff --git a/librmt/rmtcreat.c b/librmt/rmtcreat.c
index ae19bed..c86d608 100644
--- a/librmt/rmtcreat.c
+++ b/librmt/rmtcreat.c
@@ -30,19 +30,19 @@
 #include <fcntl.h>              /* use this one for S5 with remote stuff */
 #include "rmtlib.h"
 
-extern int rmtopen(char*, int, int);
+extern int rmtopen(char *, int, int);
 
-int rmtcreat (path, mode)
+int rmtcreat(path, mode)
 char *path;
 int mode;
 {
-	if (_rmt_dev (path))
+	if (_rmt_dev(path))
 	{
-		return (rmtopen (path, 1 | O_CREAT, mode));
+		return (rmtopen(path, 1 | O_CREAT, mode));
 	}
 	else
 	{
-		return (creat (path, mode));
+		return (creat(path, mode));
 	}
 }
 
diff --git a/librmt/rmtdev.c b/librmt/rmtdev.c
index 0bd011c..b1f2fbb 100644
--- a/librmt/rmtdev.c
+++ b/librmt/rmtdev.c
@@ -29,12 +29,12 @@
  *	0 otherwise.
  */
 
-int _rmt_dev (path)
+int _rmt_dev(path)
 register char *path;
 {
-	if ((path = strchr (path, ':')) != (char *)0)
+	if ((path = strchr(path, ':')) != (char *)0)
 	{
-		if (strncmp (path + 1, "/dev/", 5) == 0)
+		if (strncmp(path + 1, "/dev/", 5) == 0)
 		{
 			return (1);
 		}
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 7c21219..75ff766 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -35,13 +35,13 @@ static int _rmt_fstat(int, char *);
  *	Get file status.  Looks just like fstat(2) to caller.
  */
 
-int rmtfstat (fildes, buf)
+int rmtfstat(fildes, buf)
 int fildes;
 struct stat *buf;
 {
-	if (isrmt (fildes))
+	if (isrmt(fildes))
 	{
-		return (_rmt_fstat (fildes - REM_BIAS, (char *)buf));
+		return (_rmt_fstat(fildes - REM_BIAS, (char *)buf));
 	}
 	else
 	{
@@ -69,7 +69,7 @@ _rmt_fstat(int fildes, char *arg)
 
 	if (_rmt_command(fildes, buffer) == -1 ||
 	    (rc = _rmt_status(fildes)) == -1)
-		return(-1);
+		return (-1);
 
 	/* adjust read count to prevent overflow */
 
@@ -84,7 +84,7 @@ _rmt_fstat(int fildes, char *arg)
 abortit:
 			_rmt_abort(fildes);
 			setoserror(EIO);
-			return(-1);
+			return (-1);
 		}
 	}
 
@@ -93,5 +93,5 @@ abortit:
 		if (read(READ(fildes), buffer, 1) <= 0)
 			goto abortit;
 
-	return(0);
+	return (0);
 }
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index c34dbeb..bcf9124 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -142,11 +142,11 @@ static int _rmt_ioctl(int, unsigned int, void *);
 int
 rmtioctl(int fildes, unsigned int request, void *arg)
 {
-	if (isrmt (fildes)) {
-		return (_rmt_ioctl (fildes - REM_BIAS, request, arg));
+	if (isrmt(fildes)) {
+		return (_rmt_ioctl(fildes - REM_BIAS, request, arg));
 	}
 	else {
-		return (ioctl (fildes, request, arg));
+		return (ioctl(fildes, request, arg));
 	}
 }
 
@@ -185,14 +185,14 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
  */
 
 	if (op == MTIOCTOP) {
-		int mt_op = ((struct mtop *) arg)->mt_op;
-		int mt_count = ((struct mtop *) arg)->mt_count;
+		int mt_op = ((struct mtop *)arg)->mt_op;
+		int mt_count = ((struct mtop *)arg)->mt_count;
 
 		if (RMTHOST(fildes) == UNAME_UNDEFINED) {
 			_rmt_msg(RMTWARN,
 				 _("rmtioctl: remote host type not supported for MTIOCTOP\n"));
 			setoserror(EPROTONOSUPPORT);
-			return(-1);
+			return (-1);
 		}
 
 		/* map the linux op code to the irix op code */
@@ -200,7 +200,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			mt_op = mtop_irixmap[mt_op];
 			if (mt_op == -1) {
 				setoserror(EINVAL);
-				return(-1);
+				return (-1);
 			}
 		}
 		else if (RMTHOST(fildes) != UNAME_LINUX) {
@@ -208,15 +208,15 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			mt_op = mtop_stdmap[mt_op];
 			if (mt_op == -1) {
 				setoserror(EINVAL);
-				return(-1);
+				return (-1);
 			}
 		}
 
 		sprintf(buffer, "I%d\n%d\n", mt_op, mt_count);
 		if (_rmt_command(fildes, buffer) == -1) {
-			return(-1);
+			return (-1);
 		}
-		return(_rmt_status(fildes));
+		return (_rmt_status(fildes));
 	}
 	else if (op == MTIOCGET) {
 
@@ -234,7 +234,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		 */
 		if (_rmt_command(fildes, "S") == -1 ||
 		    (rc = _rmt_status(fildes)) == -1)
-			return(-1);
+			return (-1);
 
 
 		/*
@@ -248,7 +248,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			_rmt_msg(RMTWARN,
 				 _("rmtioctl: remote host type not supported for MTIOCGET\n"));
 			setoserror(EPROTONOSUPPORT);
-			return(-1);
+			return (-1);
 		case UNAME_IRIX:
 			if (sizeof(struct irix_mtget) != rc) {
 				_rmt_msg(RMTWARN,
@@ -256,7 +256,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 					   " - got %d, wanted %d\n"),
 					 rc, sizeof(struct irix_mtget));
 				setoserror(EPROTONOSUPPORT);
-				return(-1);
+				return (-1);
 			}
 			break;
 		case UNAME_LINUX:
@@ -273,16 +273,16 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 					 rc, sizeof(struct linux32_mtget),
 					 sizeof(struct linux64_mtget));
 				setoserror(EPROTONOSUPPORT);
-				return(-1);
+				return (-1);
 			}
 			break;
 		default:
 			setoserror(EPROTONOSUPPORT);
-			return(-1);
+			return (-1);
 		}
 
 
-		assert(RMTHOST(fildes)==UNAME_LINUX || RMTHOST(fildes)==UNAME_IRIX);
+		assert(RMTHOST(fildes) == UNAME_LINUX || RMTHOST(fildes) == UNAME_IRIX);
 
 
 		if (RMTHOST(fildes) == UNAME_IRIX) {
@@ -303,7 +303,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			if (cnt <= 0) {
 				_rmt_abort(fildes);
 				setoserror(EIO);
-				return(-1);
+				return (-1);
 			}
 		}
 
@@ -416,11 +416,11 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			dstp->mt_dsreg = srcp->mt_dsreg;
 			dstp->mt_gstat = srcp->mt_gstat;
 		}
-		return(0);
+		return (0);
 
 	}
 	else {
 		setoserror(EINVAL);
-		return(-1);
+		return (-1);
 	}
 }
diff --git a/librmt/rmtisatty.c b/librmt/rmtisatty.c
index 2f6d96d..75ae9fc 100644
--- a/librmt/rmtisatty.c
+++ b/librmt/rmtisatty.c
@@ -28,15 +28,15 @@
  *	Rmtisatty.  Do the isatty function.
  */
 
-int rmtisatty (fd)
+int rmtisatty(fd)
 int fd;
 {
-	if (isrmt (fd))
+	if (isrmt(fd))
 	{
 		return (0);
 	}
 	else
 	{
-		return (isatty (fd));
+		return (isatty(fd));
 	}
 }
diff --git a/librmt/rmtlib.h b/librmt/rmtlib.h
index 1fd11cf..f7dbde0 100644
--- a/librmt/rmtlib.h
+++ b/librmt/rmtlib.h
@@ -77,10 +77,10 @@ extern int _rmt_host[MAXUNIT];
 #define setoserror(err) (errno = err) /* TODO: multithread check */
 
 /* prototypes */
-int isrmt (int);
+int isrmt(int);
 void _rmt_abort(int);
 int _rmt_command(int, char *);
-int _rmt_dev (char *);
+int _rmt_dev(char *);
 int _rmt_status(int);
 int _rmt_msgson(void);
 void _rmt_msg(int level, const char *msg, ...);
diff --git a/librmt/rmtlseek.c b/librmt/rmtlseek.c
index c59c157..350d444 100644
--- a/librmt/rmtlseek.c
+++ b/librmt/rmtlseek.c
@@ -32,18 +32,18 @@ static off_t _rmt_lseek(int, off_t, int);
  *	Perform lseek on file.  Looks just like lseek(2) to caller.
  */
 
-off_t rmtlseek (fildes, offset, whence)
+off_t rmtlseek(fildes, offset, whence)
 int fildes;
 off_t offset;
 int whence;
 {
-	if (isrmt (fildes))
+	if (isrmt(fildes))
 	{
-		return (_rmt_lseek (fildes - REM_BIAS, offset, whence));
+		return (_rmt_lseek(fildes - REM_BIAS, offset, whence));
 	}
 	else
 	{
-		return (lseek (fildes, offset, whence));
+		return (lseek(fildes, offset, whence));
 	}
 }
 
@@ -58,9 +58,9 @@ _rmt_lseek(int fildes, off_t offset, int whence)
 
 	sprintf(buffer, "L%ld\n%d\n", (long)offset, whence);
 	if (_rmt_command(fildes, buffer) == -1)
-		return(-1);
+		return (-1);
 
-	return(_rmt_status(fildes));
+	return (_rmt_status(fildes));
 }
 
 
diff --git a/librmt/rmtmsg.c b/librmt/rmtmsg.c
index 906293d..aeb599e 100644
--- a/librmt/rmtmsg.c
+++ b/librmt/rmtmsg.c
@@ -80,6 +80,6 @@ _rmt_msg(int level, const char *msg, ...)
 		vsprintf(msg_str, msg, arg);
 		va_end(arg);
 
-		fprintf(stderr, "%s%s", level==RMTWARN ? _("WARNING: ") : "", msg_str);
+		fprintf(stderr, "%s%s", level == RMTWARN ? _("WARNING: ") : "", msg_str);
 	}
 }
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 7a74a11..383e9bf 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -39,8 +39,8 @@
 
 static int _rmt_open(char *, int, int);
 
-int _rmt_Ctp[MAXUNIT][2] = { {-1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
-int _rmt_Ptc[MAXUNIT][2] = { {-1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
+int _rmt_Ctp[MAXUNIT][2] = { { -1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
+int _rmt_Ptc[MAXUNIT][2] = { { -1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
 int _rmt_host[MAXUNIT] = { -1, -1, -1, -1 };
 
 struct uname_table
@@ -50,7 +50,7 @@ struct uname_table
 };
 
 struct uname_table uname_table[] =
-{ {UNAME_LINUX, "Linux" }, { UNAME_IRIX, "IRIX" }, { 0, 0 } };
+{ { UNAME_LINUX, "Linux" }, { UNAME_IRIX, "IRIX" }, { 0, 0 } };
 
 
 /*
@@ -58,18 +58,18 @@ struct uname_table uname_table[] =
  *	caller.
  */
 
-int rmtopen (path, oflag, mode)
+int rmtopen(path, oflag, mode)
 char *path;
 int oflag;
 int mode;
 {
-	if (strchr (path, ':') != NULL)
+	if (strchr(path, ':') != NULL)
 	{
-		return (_rmt_open (path, oflag, mode) | REM_BIAS);
+		return (_rmt_open(path, oflag, mode) | REM_BIAS);
 	}
 	else
 	{
-		return (open (path, oflag, mode));
+		return (open(path, oflag, mode));
 	}
 }
 
@@ -84,7 +84,7 @@ int mode;
 #define MAXDBGPATH      100
 
 /* ARGSUSED */
-static int _rmt_open (char *path, int oflag, int mode)
+static int _rmt_open(char *path, int oflag, int mode)
 {
 	int i, rc;
 	char buffer[BUFMAGIC];
@@ -121,7 +121,7 @@ static int _rmt_open (char *path, int oflag, int mode)
 	if (i == MAXUNIT)
 	{
 		setoserror(EMFILE);
-		return(-1);
+		return (-1);
 	}
 
 /*
@@ -158,7 +158,7 @@ static int _rmt_open (char *path, int oflag, int mode)
 
 	/* try to find out the uname of the remote host */
 	{
-#define MAX_UNAMECMD MAXHOSTLEN+40
+#define MAX_UNAMECMD MAXHOSTLEN + 40
 #define MAX_UNAME 20
 		FILE *rmt_f;
 		char cmd[MAX_UNAMECMD];
@@ -193,8 +193,8 @@ static int _rmt_open (char *path, int oflag, int mode)
 				goto do_rmt;
 			}
 			len = strlen(uname);
-			if (len > 0 && uname[len-1] == '\n')
-				uname[len-1] = '\0'; /* chomp the '\n' */
+			if (len > 0 && uname[len - 1] == '\n')
+				uname[len - 1] = '\0'; /* chomp the '\n' */
 		}
 
 		for (p = &uname_table[0]; p->name != 0; p++) {
@@ -219,10 +219,10 @@ static int _rmt_open (char *path, int oflag, int mode)
  */
 do_rmt:
 	if (pipe(_rmt_Ptc[i]) == -1 || pipe(_rmt_Ctp[i]) == -1)
-		return(-1);
+		return (-1);
 
 	if ((rc = fork()) == -1)
-		return(-1);
+		return (-1);
 
 	if (rc == 0)
 	{
@@ -232,8 +232,8 @@ do_rmt:
 		close(1);
 		dup(_rmt_Ctp[i][1]);
 		close(_rmt_Ctp[i][0]); close(_rmt_Ctp[i][1]);
-		(void) setuid (getuid ());
-		(void) setgid (getgid ());
+		(void)setuid(getuid());
+		(void)setgid(getgid());
 		if (_rmt_msgson() == RMTDBG) {
 			snprintf(rmt_cmd, sizeof(rmt_cmd), "%s %s.%d",
 				 rmt_path, RMT_DEBUG_FILE, getpid());
@@ -244,12 +244,12 @@ do_rmt:
 		if (user != login)
 		{
 			execl(rsh_path, "rsh", system, "-l", login,
-			      rmt_cmd, (char *) 0);
+			      rmt_cmd, (char *)0);
 		}
 		else
 		{
 			execl(rsh_path, "rsh", system,
-			      rmt_cmd, (char *) 0);
+			      rmt_cmd, (char *)0);
 		}
 
 /*
@@ -269,7 +269,7 @@ do_rmt:
 
 	sprintf(buffer, "O%s\n%d\n", device, oflag);
 	if (_rmt_command(i, buffer) == -1 || _rmt_status(i) == -1)
-		return(-1);
+		return (-1);
 
-	return(i);
+	return (i);
 }
diff --git a/librmt/rmtread.c b/librmt/rmtread.c
index bc37ff9..6edfb08 100644
--- a/librmt/rmtread.c
+++ b/librmt/rmtread.c
@@ -33,18 +33,18 @@ static int _rmt_read(int, char *, unsigned int);
  *	Read from stream.  Looks just like read(2) to caller.
  */
 
-int rmtread (fildes, buf, nbyte)
+int rmtread(fildes, buf, nbyte)
 int fildes;
 char *buf;
 unsigned int nbyte;
 {
-	if (isrmt (fildes))
+	if (isrmt(fildes))
 	{
-		return (_rmt_read (fildes - REM_BIAS, buf, nbyte));
+		return (_rmt_read(fildes - REM_BIAS, buf, nbyte));
 	}
 	else
 	{
-		return (read (fildes, buf, nbyte));
+		return (read(fildes, buf, nbyte));
 	}
 }
 
@@ -60,7 +60,7 @@ _rmt_read(int fildes, char *buf, unsigned int nbyte)
 
 	sprintf(buffer, "R%d\n", nbyte);
 	if (_rmt_command(fildes, buffer) == -1 || (rc = _rmt_status(fildes)) == -1)
-		return(-1);
+		return (-1);
 
 	for (i = 0; i < rc; i += nbyte, buf += nbyte)
 	{
@@ -69,9 +69,9 @@ _rmt_read(int fildes, char *buf, unsigned int nbyte)
 		{
 			_rmt_abort(fildes);
 			setoserror(EIO);
-			return(-1);
+			return (-1);
 		}
 	}
 
-	return(rc);
+	return (rc);
 }
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index 91ad308..11ff375 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -49,7 +49,7 @@ int fildes;
 		{
 			_rmt_abort(fildes);
 			setoserror(EIO);
-			return(-1);
+			return (-1);
 		}
 		if (*cp == '\n')
 		{
@@ -62,7 +62,7 @@ int fildes;
 	{
 		_rmt_abort(fildes);
 		setoserror(EIO);
-		return(-1);
+		return (-1);
 	}
 
 /*
@@ -83,7 +83,7 @@ int fildes;
 		if (*cp == 'F')
 			_rmt_abort(fildes);
 
-		return(-1);
+		return (-1);
 	}
 
 /*
@@ -94,10 +94,10 @@ int fildes;
 	{
 		_rmt_abort(fildes);
 		setoserror(EIO);
-		return(-1);
+		return (-1);
 	}
 
-	return(atoi(cp + 1));
+	return (atoi(cp + 1));
 }
 
 
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index f0b7c0a..4610222 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -33,18 +33,18 @@ static int _rmt_write(int, char *, unsigned int);
  *	Write to stream.  Looks just like write(2) to caller.
  */
 
-int rmtwrite (fildes, buf, nbyte)
+int rmtwrite(fildes, buf, nbyte)
 int fildes;
 char *buf;
 unsigned int nbyte;
 {
-	if (isrmt (fildes))
+	if (isrmt(fildes))
 	{
-		return (_rmt_write (fildes - REM_BIAS, buf, nbyte));
+		return (_rmt_write(fildes - REM_BIAS, buf, nbyte));
 	}
 	else
 	{
-		return (write (fildes, buf, nbyte));
+		return (write(fildes, buf, nbyte));
 	}
 }
 
@@ -59,14 +59,14 @@ _rmt_write(int fildes, char *buf, unsigned int nbyte)
 
 	sprintf(buffer, "W%d\n", nbyte);
 	if (_rmt_command(fildes, buffer) == -1)
-		return(-1);
+		return (-1);
 
 	if (write(WRITE(fildes), buf, nbyte) == nbyte)
 	{
-		return(_rmt_status(fildes));
+		return (_rmt_status(fildes));
 	}
 
 	_rmt_abort(fildes);
 	setoserror(EIO);
-	return(-1);
+	return (-1);
 }
diff --git a/restore/bag.h b/restore/bag.h
index 5157ad8..035d7d3 100644
--- a/restore/bag.h
+++ b/restore/bag.h
@@ -97,7 +97,7 @@ extern void bagiter_init(bag_t *bagp, bagiter_t *iterp);
  * returns the next element in the bag. caller may remove the element
  * prior to the next call.
  */
-extern bagelem_t * bagiter_next(bagiter_t *iterp, void **payloadpp);
+extern bagelem_t *bagiter_next(bagiter_t *iterp, void **payloadpp);
 
 /*
  * destroys the bag.
diff --git a/restore/content.c b/restore/content.c
index fa89bb4..c360205 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -875,12 +875,12 @@ 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 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,
@@ -939,7 +939,7 @@ restore_extent_group(drive_t *	drivep,
 		     int	fd,
 		     bool_t	ehcs,
 		     rv_t *	rvp);
-static bool_t restore_complete_reg(stream_context_t*);
+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,
@@ -971,7 +971,7 @@ addobj(bag_t *	bagp,
        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 char *ehdr_typestr(int32_t type);
 static int egrpcmp(egrp_t *egrpap, egrp_t *egrpbp);
 static void
 display_dump_label(bool_t		lockpr,
@@ -992,7 +992,7 @@ 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 char *get_extattrbuf(ix_t which);
 static rv_t
 restore_extattr(drive_t *	drivep,
 		filehdr_t *	fhdrp,
@@ -1007,8 +1007,8 @@ 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 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 quotafilecheck(char *type, char *dstdir, char *quotafile);
 
@@ -1523,7 +1523,7 @@ 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, _(
@@ -1873,8 +1873,8 @@ content_init(int argc, char *argv[], size64_t vmsz)
 			 (off_t)pgsz);
 	assert(! rval);
 	stpgcnt = newstpgcnt;
-	persp = (pers_t *) mmap_autogrow(perssz + stpgcnt * pgsz,
-					 tranp->t_persfd, 0);
+	persp = (pers_t *)mmap_autogrow(perssz + stpgcnt * pgsz,
+					tranp->t_persfd, 0);
 	if (persp == (pers_t *)-1) {
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			     "could not map persistent state file %s: %s\n"),
@@ -1968,7 +1968,7 @@ content_init(int argc, char *argv[], size64_t vmsz)
 	 */
 	if (persp->a.dstdirisxfspr) {
 		void *fshanp;
-		size_t fshlen=0;
+		size_t fshlen = 0;
 
 		if (path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) {
 			mlog(MLOG_NORMAL,
@@ -1989,11 +1989,11 @@ content_init(int argc, char *argv[], size64_t vmsz)
 	 */
 	assert(! descp);
 	if (descpgcnt) {
-		descp = (pers_desc_t *) mmap_autogrow(descpgcnt * pgsz,
-						      tranp->t_persfd,
-						      (off_t)perssz
-						      +
-						      (off_t)(stpgcnt * pgsz));
+		descp = (pers_desc_t *)mmap_autogrow(descpgcnt * pgsz,
+						     tranp->t_persfd,
+						     (off_t)perssz
+						     +
+						     (off_t)(stpgcnt * pgsz));
 		if (descp == (pers_desc_t *)-1) {
 			mlog(MLOG_NORMAL | MLOG_ERROR, _(
 				     "could not map persistent state file inv %s: "
@@ -2830,9 +2830,9 @@ content_complete(void)
 	if (! persp) {
 		completepr = BOOL_TRUE;
 	} else if (! persp->a.valpr) {
-		completepr =  BOOL_TRUE;
+		completepr = BOOL_TRUE;
 	} else if (! persp->s.valpr) {
-		completepr =  BOOL_TRUE;
+		completepr = BOOL_TRUE;
 	} else {
 		completepr = BOOL_FALSE;
 	}
@@ -3881,7 +3881,7 @@ finalize(char *path1, char *path2)
 					      if (! ok) {
 						      return RV_INTR;
 					      }
-					      persp->s.dirattrdonepr = BOOL_TRUE;}
+					      persp->s.dirattrdonepr = BOOL_TRUE; }
 
 		/*
 		 * remove orphanage if empty
@@ -3891,7 +3891,7 @@ finalize(char *path1, char *path2)
 					       if (! ok) {
 						       return RV_INTR;
 					       }
-					       persp->s.orphdeltriedpr = BOOL_TRUE;}
+					       persp->s.orphdeltriedpr = BOOL_TRUE; }
 
 		/*
 		 * delete the persistent ino map
@@ -4142,11 +4142,11 @@ Media_mfile_next(Media_t *		Mediap,
 	/*
 	 * pass back hdr and drive ptrs
 	 */
-	*grhdrpp =  grhdrp;
-	*drhdrpp =  drhdrp;
-	*mrhdrpp =  mrhdrp;
-	*crhdrpp =  crhdrp;
-	*scrhdrpp =  scrhdrp;
+	*grhdrpp = grhdrp;
+	*drhdrpp = drhdrp;
+	*mrhdrpp = mrhdrp;
+	*crhdrpp = crhdrp;
+	*scrhdrpp = scrhdrp;
 	*drivepp = drivep;
 
 	/*
@@ -5267,11 +5267,11 @@ pi_allocdesc(dh_t *deschp)
 		 */
 		assert(stpgcnt <= (ix_t)INTGENMAX);
 		assert(newdescpgcnt > 0);
-		descp = (pers_desc_t *) mmap_autogrow(newdescpgcnt * pgsz,
-						      tranp->t_persfd,
-						      (off_t)perssz
-						      +
-						      (off_t)(stpgcnt * pgsz));
+		descp = (pers_desc_t *)mmap_autogrow(newdescpgcnt * pgsz,
+						     tranp->t_persfd,
+						     (off_t)perssz
+						     +
+						     (off_t)(stpgcnt * pgsz));
 		if (descp == (pers_desc_t *)(-1)) {
 			pi_unlock();
 			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
@@ -5808,7 +5808,7 @@ pi_addfile(Media_t *		Mediap,
 				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);
@@ -5862,7 +5862,7 @@ pi_transcribe(inv_session_t *sessp)
 	/*
 	 * traverse inventory, transcribing into pers inv.
 	 */
-	strmcnt =  (size_t)sessp->s_nstreams;
+	strmcnt = (size_t)sessp->s_nstreams;
 	for (strmix = 0; strmix < strmcnt; strmix++) {
 		inv_stream_t *strmp;
 		size_t fileix;
@@ -6236,11 +6236,11 @@ pi_scanfileendino(dh_t fileh)
 						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;
+							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;
+							ino = DH2F(nexth)->f_firstegrp.eg_ino - 1;
 							return ino;
 						}
 					}
@@ -6766,7 +6766,7 @@ pi_neededobjs_free(bag_t *bagp)
 	bagiter_init(bagp, &bagiter);
 
 	bagobjp = 0;
-	while ((bagelemp = bagiter_next(&bagiter, (void **)&bagobjp) )) {
+	while ((bagelemp = bagiter_next(&bagiter, (void **)&bagobjp))) {
 		bag_remove(bagp, bagelemp, &dummykey, &dummypayloadp);
 		assert(bagobjp);
 		assert(bagobjp == (bagobj_t *)dummypayloadp);
@@ -7823,7 +7823,7 @@ set_file_owner(
 		mode &= ~S_ISUID;
 	}
 
-	if ((mode & (S_ISGID|S_IXGRP)) == (S_ISGID|S_IXGRP)) {
+	if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
 		mlog(MLOG_VERBOSE | MLOG_WARNING,
 		     _("stripping setgid bit on %s since chown failed\n"),
 		     path);
@@ -7955,7 +7955,7 @@ restore_reg(drive_t *	drivep,
 		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_extsize = (uint32_t)bstatp->bs_extsize;
 		fsxattr.fsx_projid = bstat_projid(bstatp);
 
 		rval = ioctl(*fdp, XFS_IOC_FSSETXATTR, (void *)&fsxattr);
@@ -8770,7 +8770,7 @@ read_dirent(drive_t *		drivep,
 		default:
 			return RV_CORE;
 		}
-		assert((size_t) nread == remsz);
+		assert((size_t)nread == remsz);
 	}
 
 	return RV_OK;
@@ -9314,7 +9314,7 @@ setextattr(char *path, extattrhdr_t *ahdrp)
 	int rval;
 
 	isdmpr = (isrootpr &&
-		  ! strncmp((char *)(&ahdrp[1]), dmiattr, sizeof(dmiattr)-1));
+		  ! strncmp((char *)(&ahdrp[1]), dmiattr, sizeof(dmiattr) - 1));
 
 	/*
 	 * If restoreextattrpr not set, then we are here because -D was
@@ -9370,14 +9370,14 @@ dump_partials(void)
 	pi_lock();
 	printf("\npartial_reg: count=%d\n", (int)persp->a.parrestcnt);
 	if (persp->a.parrestcnt > 0) {
-		for (i=0; i < partialmax; i++) {
+		for (i = 0; i < partialmax; i++) {
 			if (persp->a.parrest[i].is_ino > 0) {
 				int j;
 
 				isptr = &persp->a.parrest[i];
 				printf("\tino=%llu ",
 				       (unsigned long long)isptr->is_ino);
-				for (j=0, bsptr=isptr->is_bs;
+				for (j = 0, bsptr = isptr->is_bs;
 				     j < drivecnt;
 				     j++, bsptr++)
 				{
@@ -9419,12 +9419,12 @@ check_valid_partials(void)
 
 	pi_lock();
 	if (persp->a.parrestcnt > 0) {
-		for (i=0; i < partialmax; i++) {
+		for (i = 0; i < partialmax; i++) {
 			if (persp->a.parrest[i].is_ino > 0) {
 				int j;
 
 				isptr = &persp->a.parrest[i];
-				for (j=0, bsptr=isptr->is_bs;
+				for (j = 0, bsptr = isptr->is_bs;
 				     j < drivecnt;
 				     j++, bsptr++)
 				{
@@ -9487,7 +9487,7 @@ partial_reg(ix_t	d_index,
 	 * Search for a matching inode.  Gaps can exist so we must search
 	 * all entries.
 	 */
-	for (i=0; i < partialmax; i++) {
+	for (i = 0; i < partialmax; i++) {
 		if (persp->a.parrest[i].is_ino == ino) {
 			isptr = &persp->a.parrest[i];
 			break;
@@ -9499,7 +9499,7 @@ partial_reg(ix_t	d_index,
 		mlog(MLOG_NITTY | MLOG_NOLOCK,
 		     "partial_reg: no entry found for %llu\n", ino);
 		/* find a free one */
-		for (i=0; i < partialmax; i++) {
+		for (i = 0; i < partialmax; i++) {
 			if (persp->a.parrest[i].is_ino == 0) {
 				int j;
 
@@ -9512,7 +9512,7 @@ partial_reg(ix_t	d_index,
 				 * used to decide if an entry is used or
 				 * not
 				 */
-				for (j=0, bsptr=isptr->is_bs;
+				for (j = 0, bsptr = isptr->is_bs;
 				     j < drivecnt; j++, bsptr++) {
 					bsptr->endoffset = 0;
 				}
@@ -9573,7 +9573,7 @@ found:
  * been restored by another dump stream.
  */
 static bool_t
-partial_check (xfs_ino_t ino, off64_t fsize)
+partial_check(xfs_ino_t ino, off64_t fsize)
 {
 	partial_rest_t *isptr = NULL;
 	bool_t ret;
@@ -9594,7 +9594,7 @@ partial_check (xfs_ino_t ino, off64_t fsize)
 	 * Search for the inode.  Gaps can exist so we must search
 	 * all entries.
 	 */
-	for (i=0; i < partialmax; i++) {
+	for (i = 0; i < partialmax; i++) {
 		if (persp->a.parrest[i].is_ino == ino) {
 			isptr = &persp->a.parrest[i];
 			break;
@@ -9637,7 +9637,7 @@ gapsearch:
 	 * span has been restored.  Bytespans are not necessarily in order
 	 * so the search is repeated from the start each time.
 	 */
-	for (i=0, bsptr=isptr->is_bs; i < drivecnt; i++, bsptr++) {
+	for (i = 0, bsptr = isptr->is_bs; i < drivecnt; i++, bsptr++) {
 		if (bsptr->endoffset > 0 &&
 		    bsptr->offset <= curoffset &&
 		    bsptr->endoffset > curoffset)
@@ -10190,7 +10190,7 @@ do_fssetdm_by_handle(
 	fsdmidata_t *	fdmp)
 {
 	void *hanp;
-	size_t hlen=0;
+	size_t hlen = 0;
 	int rc;
 
 	if (path_to_handle(path, &hanp, &hlen)) {
@@ -10221,7 +10221,7 @@ quotafilecheck(char *type, char *dstdir, char *quotafile)
 		dstdir,
 		quotafile);
 
-	if (stat (buf, &s) >= 0 && S_ISREG(s.st_mode)) {
+	if (stat(buf, &s) >= 0 && S_ISREG(s.st_mode)) {
 		mlog(MLOG_NORMAL, _(
 			     "%s quota information written to '%s'\n"),
 		     type,
diff --git a/restore/dirattr.c b/restore/dirattr.c
index 380110a..69557a9 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -68,7 +68,7 @@
  * with a handle checksum.
  */
 #define HDLSUMCNT               4
-#define HDLSUMSHIFT             (NBBY * sizeof (dah_t) - HDLSUMCNT)
+#define HDLSUMSHIFT             (NBBY * sizeof(dah_t) - HDLSUMCNT)
 #define HDLSUMLOMASK            ((1 << HDLSUMCNT) - 1)
 #define HDLSUMMASK              (HDLSUMLOMASK << HDLSUMSHIFT)
 #define HDLDIXCNT               HDLSUMSHIFT
@@ -968,7 +968,7 @@ dirattr_flush()
 	/*
 	 * sanity checks
 	 */
-	assert (dtp);
+	assert(dtp);
 
 	if (dtp->dt_off) {
 		/*
diff --git a/restore/inomap.c b/restore/inomap.c
index 066cd75..2611d98 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -84,7 +84,7 @@ extern size_t pgsz;
  */
 static int map_getset(xfs_ino_t, int, bool_t);
 static int map_set(xfs_ino_t ino, int);
-static seg_t * map_getsegment(xfs_ino_t ino);
+static seg_t *map_getsegment(xfs_ino_t ino);
 
 /* definition of locally defined global variables ****************************/
 
@@ -239,7 +239,7 @@ inomap_restore_pers(drive_t *			drivep,
 	/*
 	 * mmap the persistent hdr and space for the map
 	 */
-	persp = (pers_t *) mmap_autogrow(
+	persp = (pers_t *)mmap_autogrow(
 		PERSSZ
 		+
 		sizeof(hnk_t) * (size_t)hnkcnt,
@@ -397,7 +397,7 @@ inomap_sync_pers(char *hkdir)
 	/*
 	 * mmap the persistent hdr
 	 */
-	persp = (pers_t *) mmap_autogrow(
+	persp = (pers_t *)mmap_autogrow(
 		PERSSZ,
 		pers_fd,
 		(off64_t)0);
@@ -420,7 +420,7 @@ inomap_sync_pers(char *hkdir)
 	 * mmap the pers inomap
 	 */
 	assert(hnkcnt * sizeof(hnk_t) <= (size64_t)INT32MAX);
-	roothnkp = (hnk_t *) mmap_autogrow(
+	roothnkp = (hnk_t *)mmap_autogrow(
 		sizeof(hnk_t) * (size_t)hnkcnt,
 		pers_fd,
 		(off64_t)PERSSZ);
diff --git a/restore/mmap.c b/restore/mmap.c
index dcce98c..851b33c 100644
--- a/restore/mmap.c
+++ b/restore/mmap.c
@@ -33,9 +33,9 @@ mmap_autogrow(size_t len, int fd, off_t offset)
 
 	/* prealloc file if it is an empty file */
 	if (fstat(fd, &buf) == -1) {;
-				    return (void*)MAP_FAILED;}
-	if (buf.st_size < offset+len) {
-		(void)lseek(fd, offset+len-1, SEEK_SET);
+				    return (void *)MAP_FAILED; }
+	if (buf.st_size < offset + len) {
+		(void)lseek(fd, offset + len - 1, SEEK_SET);
 		(void)write(fd, nul_buffer, 1);
 	}
 
diff --git a/restore/namreg.c b/restore/namreg.c
index e02fc17..883f379 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -241,7 +241,7 @@ namreg_init(char *hkdir, bool_t resume, uint64_t inocnt)
 	 * mmap the persistent descriptor
 	 */
 	assert(!(NAMREG_PERS_SZ % pgsz));
-	npp = (namreg_pers_t *) mmap_autogrow(
+	npp = (namreg_pers_t *)mmap_autogrow(
 		NAMREG_PERS_SZ,
 		ntp->nt_fd,
 		(off_t)0);
@@ -491,7 +491,7 @@ namreg_get(nrh_t	nrh,
 	/*
 	 * copy the name into the caller-supplied buffer.
 	 */
-	strncpy(bufp, in_bufp+1, len);
+	strncpy(bufp, in_bufp + 1, len);
 
 #ifdef NAMREGCHK
 
@@ -524,7 +524,7 @@ namreg_map(void)
 		return rv;
 	}
 
-	ntp->nt_map = (char *) mmap_autogrow(
+	ntp->nt_map = (char *)mmap_autogrow(
 		npp->np_appendoff - NAMREG_PERS_SZ,
 		ntp->nt_fd,
 		NAMREG_PERS_SZ);
@@ -535,7 +535,7 @@ namreg_map(void)
 	 */
 	if (ntp->nt_map == (char *)-1) {
 		mlog(MLOG_DEBUG, "failed to map namreg: %s\n",
-		     strerror(errno) );
+		     strerror(errno));
 		ntp->nt_map = NULL;
 	}
 
diff --git a/restore/node.c b/restore/node.c
index 071f4c3..edfa947 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -51,7 +51,7 @@ extern size_t pgmask;
  * that xfsrestore can handle.
  */
 #define HDLGENCNT               4
-#define HDLGENSHIFT             (NBBY * sizeof (nh_t) - HDLGENCNT)
+#define HDLGENSHIFT             (NBBY * sizeof(nh_t) - HDLGENCNT)
 #define HDLGENLOMASK            ((1 << HDLGENCNT) - 1)
 #define HDLGENMASK              (HDLGENLOMASK << HDLGENSHIFT)
 #define HDLMASK                 ((1 << HDLGENSHIFT) - 1)
@@ -195,7 +195,7 @@ node_map_internal(nh_t nh, void **pp)
 		relnix_t relnix = nh2relnix(nh);
 		*pp = (void *)((char *)(*pp) +
 			       ((off64_t)relnix *
-				node_hdrp->nh_nodesz) );
+				node_hdrp->nh_nodesz));
 	}
 }
 
diff --git a/restore/tree.c b/restore/tree.c
index cfe2eca..3f77c9a 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -311,7 +311,7 @@ Node_alloc(xfs_ino_t	ino,
 	   dah_t	dah,
 	   size_t	flags);
 static void Node_free(nh_t *nhp);
-static node_t * Node_map(nh_t nh);
+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,
@@ -487,7 +487,7 @@ tree_init(char *	hkdir,
 	 * mmap the persistent state
 	 */
 	assert(!(PERSSZ % pgsz));
-	persp = (treepers_t *) mmap_autogrow(
+	persp = (treepers_t *)mmap_autogrow(
 		PERSSZ,
 		tranp->t_persfd,
 		(off64_t)0);
@@ -677,7 +677,7 @@ tree_sync(char *	hkdir,
 	 * mmap the persistent state
 	 */
 	assert(!(PERSSZ % pgsz));
-	persp = (treepers_t *) mmap_autogrow(
+	persp = (treepers_t *)mmap_autogrow(
 		PERSSZ,
 		tranp->t_persfd,
 		(off64_t)0);
@@ -2067,9 +2067,9 @@ tree_cb_links(xfs_ino_t					ino,
 					mkdir_r(dir);
 				}
 
-				mlog (MLOG_VERBOSE | MLOG_NOTE | MLOG_TREE, _(
-					      "ino %llu salvaging file,"
-					      " placing in %s\n"), ino, path1);
+				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) {
@@ -2237,9 +2237,9 @@ tree_extattr_recurse(nh_t parh,
 	dah = parp->n_dah;
 	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);
+		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) {
@@ -2363,7 +2363,7 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		/*
 		 * not real, refed, but not selected, can't help
 		 */
-		if (! isrealpr &&   isrefpr && ! isselpr) {
+		if (! isrealpr && isrefpr && ! isselpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
 			     "skipping node %x: not selected\n",
 			     nh);
@@ -2374,7 +2374,7 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		/*
 		 * if unreal, refed, sel, add to dst list,
 		 */
-		if (! isrealpr &&   isrefpr &&   isselpr) {
+		if (! isrealpr && isrefpr && isselpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
 			     "making node %x dst: "
 			     "not real, refed, sel\n",
@@ -2389,7 +2389,7 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 		/*
 		 * if real, unrefed, sel, add to src list
 		 */
-		if (isrealpr && ! isrefpr &&   isselpr) {
+		if (isrealpr && ! isrefpr && isselpr) {
 			mlog(MLOG_NITTY | MLOG_TREE,
 			     "making node %x src: real, not refed, sel\n",
 			     nh);
@@ -2405,7 +2405,7 @@ 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) ) {
+		if (isrealpr && (isrefpr || ! isselpr)) {
 			mlog(MLOG_NITTY | MLOG_TREE,
 			     "skipping node %x: %s\n",
 			     nh,
@@ -3743,7 +3743,7 @@ Node2path_recurse(nh_t nh, char *buf, int bufsz, int level)
 	 */
 	oldbuf = buf;
 	oldbufsz = bufsz;
-	bufsz = Node2path_recurse(parh, buf, bufsz, level+1); /* RECURSION */
+	bufsz = Node2path_recurse(parh, buf, bufsz, level + 1); /* RECURSION */
 	if (bufsz <= 0) {
 		return bufsz;
 	}
@@ -4386,7 +4386,7 @@ hash_init(size64_t	vmsz,
 	assert(persp->p_hashsz <= SIZEMAX);
 	assert(!(persp->p_hashsz % (size64_t)pgsz));
 	assert(!(PERSSZ % pgsz));
-	tranp->t_hashp = (nh_t *) mmap_autogrow(
+	tranp->t_hashp = (nh_t *)mmap_autogrow(
 		(size_t)persp->p_hashsz,
 		tranp->t_persfd,
 		(off64_t)PERSSZ);
@@ -4437,7 +4437,7 @@ hash_sync(char *perspath)
 	assert(hashsz <= SIZEMAX);
 	assert(!(hashsz % (size64_t)pgsz));
 	assert(!(PERSSZ % pgsz));
-	tranp->t_hashp = (nh_t *) mmap_autogrow(
+	tranp->t_hashp = (nh_t *)mmap_autogrow(
 		(size_t)hashsz,
 		tranp->t_persfd,
 		(off64_t)PERSSZ);
@@ -4456,11 +4456,11 @@ static inline size_t
 hash_val(xfs_ino_t ino, size_t hashmask)
 {
 	ino += ~(ino << 15);
-	ino ^=  (ino >> 10);
-	ino +=  (ino << 3);
-	ino ^=  (ino >> 6);
+	ino ^= (ino >> 10);
+	ino += (ino << 3);
+	ino ^= (ino >> 6);
 	ino += ~(ino << 11);
-	ino ^=  (ino >> 16);
+	ino ^= (ino >> 16);
 	return (size_t)ino & hashmask;
 }
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 22/24] xfsdump: (style) format newlines
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (14 preceding siblings ...)
  2018-11-09 14:30 ` [PATCH 21/24] xfsdump: (style) format intercharacter spaces Jan Tulak
@ 2018-11-09 14:30 ` Jan Tulak
  2018-11-09 14:30 ` [PATCH 23/24] xfsdump: (style) add stars to multiline comments Jan Tulak
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:30 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

Add and remove newlines to conform to the xfs/kernel coding style.

Created by Uncrustify with this config file:

#
# uncrustify config, format newlines
#

indent_with_tabs	= 2		# 1=indent with tabs, align with spaces, 2=use all tabs
input_tab_size		= 8		# original tab size
output_tab_size		= 8		# new tab size
indent_columns		= output_tab_size

indent_label		= 1		# pos: absolute col, neg: relative column

#
# inter-symbol newlines
#

nl_enum_brace		= remove	# "enum {" vs "enum
 {"
nl_union_brace		= remove	# "union {" vs "union
 {"
nl_struct_brace		= remove	# "struct {" vs "struct
 {"
nl_do_brace 		= remove	# "do {" vs "do
 {"
nl_if_brace 		= remove	# "if () {" vs "if ()
 {"
nl_for_brace 		= remove	# "for () {" vs "for ()
 {"
nl_else_brace 		= remove	# "else {" vs "else
 {"
nl_while_brace 		= remove	# "while () {" vs "while ()
 {"
nl_switch_brace 	= remove	# "switch () {" vs "switch ()
 {"
nl_brace_while		= remove	# "} while" vs "}
 while" - cuddle while
nl_brace_else		= remove	# "} else" vs "}
 else" - cuddle else
sp_brace_else		= force
sp_else_brace		= force
nl_func_var_def_blk	= 1
nl_fcall_brace		= remove	# "list_for_each() {" vs "list_for_each()
{"
nl_fdef_brace		= add		# "int foo() {" vs "int foo()
{"
nl_after_label_colon	= true		# "fail:
free(foo);" vs "fail: free(foo);"

#
# Source code modifications
#

mod_paren_on_return	= ignore	# "return 1;" vs "return (1);"
mod_full_brace_for	= ignore	# "for () a--;" vs "for () { a--; }"
mod_full_brace_do	= ignore	# "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while	= ignore	# "while (a) a--;" vs "while (a) { a--; }"

#
# inter-character spacing options
#

sp_return_paren		= force		# "return (1);" vs "return(1);"
sp_sizeof_paren		= remove	# "sizeof (int)" vs "sizeof(int)"
sp_before_sparen	= force		# "if (" vs "if("
sp_after_sparen		= force		# "if () {" vs "if (){"
sp_after_cast		= remove	# "(int) a" vs "(int)a"
sp_inside_braces	= force		# "{ 1 }" vs "{1}"
sp_inside_braces_struct	= force	# "{ 1 }" vs "{1}"
sp_inside_braces_enum	= force	# "{ 1 }" vs "{1}"
sp_assign		= force
sp_arith		= force
sp_bool			= force
sp_compare		= force
sp_assign		= force
sp_after_comma		= force
sp_func_def_paren	= remove	# "int foo (){" vs "int foo(){"
sp_func_call_paren	= remove	# "foo (" vs "foo("
sp_func_proto_paren	= remove	# "int foo ();" vs "int foo();"

#
# Aligning stuff
#

align_with_tabs		= TRUE		# use tabs to align
align_on_tabstop	= TRUE 		# align on tabstops
align_enum_equ_span	= 4		# '=' in enum definition
align_var_def_colon	= TRUE
align_struct_init_span	= 3		# align stuff in a structure init '= { }'
align_right_cmt_span	= 3

#
# other
#

nl_func_paren = remove
nl_func_decl_start = ignore
nl_func_decl_empty = remove
nl_func_decl_args = ignore
nl_func_decl_end = remove

sp_inside_paren = remove
sp_inside_square = remove
sp_inside_paren_cast = remove
sp_inside_fparen = remove
sp_inside_sparen = remove
sp_paren_paren = remove
sp_before_ptr_star = force
sp_after_ptr_star = remove
sp_between_ptr_star = remove
align_func_params = true
align_var_struct_span = 6

eat_blanks_after_open_brace   = true
eat_blanks_before_close_brace = true
pp_indent = ignore

nl_start_of_file   = remove
nl_end_of_file     = force
nl_end_of_file_min = 1
nl_comment_func_def = 1

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/arch_xlate.c     |  3 --
 common/content_inode.h  |  2 ++
 common/drive.c          |  1 -
 common/drive_minrmt.c   | 15 ++++-----
 common/drive_scsitape.c | 38 +++++++++------------
 common/drive_simple.c   |  7 ++--
 common/global.c         |  1 +
 common/inventory.c      | 12 +++----
 common/main.c           |  4 +++
 common/mlog.c           | 12 +++----
 common/path.c           |  2 ++
 common/ring.c           |  1 +
 common/stream.c         |  2 ++
 common/timeutil.c       |  2 ++
 common/ts_mtio.h        |  3 +-
 dump/content.c          |  9 ++---
 dump/inomap.c           | 18 +++++-----
 inventory/inv_api.c     | 28 +++++-----------
 inventory/inv_core.c    |  5 ++-
 inventory/inv_files.c   |  3 +-
 inventory/inv_fstab.c   |  7 ----
 inventory/inv_idx.c     | 15 +++------
 inventory/inv_mgr.c     | 16 +++------
 inventory/inv_oref.c    | 22 ++++---------
 inventory/inv_priv.h    |  1 -
 inventory/inv_stobj.c   | 25 ++------------
 inventory/inventory.h   |  1 -
 inventory/testmain.c    | 14 ++------
 invutil/cmenu.c         |  9 ++---
 invutil/fstab.c         | 15 +++------
 invutil/invidx.c        | 40 ++++++++--------------
 invutil/invutil.c       | 73 ++++++++++++++---------------------------
 invutil/list.c          |  3 +-
 invutil/list.h          |  1 -
 invutil/menu.c          |  9 ++---
 invutil/stobj.c         | 10 ++----
 librmt/rmtaccess.c      |  9 ++---
 librmt/rmtclose.c       | 12 ++-----
 librmt/rmtcommand.c     |  6 +---
 librmt/rmtcreat.c       |  9 ++---
 librmt/rmtdev.c         |  8 ++---
 librmt/rmtfstat.c       | 13 +++-----
 librmt/rmtioctl.c       | 46 ++++++++------------------
 librmt/rmtisatty.c      |  7 ++--
 librmt/rmtlseek.c       |  9 ++---
 librmt/rmtopen.c        | 42 ++++++++----------------
 librmt/rmtread.c        | 13 +++-----
 librmt/rmtstatus.c      | 21 ++++--------
 librmt/rmtwrite.c       | 10 ++----
 restore/content.c       | 59 +++++++++++++--------------------
 restore/dirattr.c       |  4 +++
 restore/inomap.c        |  3 ++
 restore/mmap.c          |  6 ++--
 restore/namreg.c        |  5 +--
 restore/node.c          |  5 +--
 restore/tree.c          | 17 +++++-----
 56 files changed, 248 insertions(+), 485 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index 24cfa2a..fc848e2 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -102,7 +102,6 @@ xlate_global_hdr(global_hdr_t *gh1, global_hdr_t *gh2, int dir)
 	     ptr2->gh_ipaddr,
 	     ptr2->gh_hostname,
 	     ptr2->gh_dumplabel);
-
 }
 
 /*
@@ -405,7 +404,6 @@ xlate_bstat(bstat_t *bs1, bstat_t *bs2, int dir)
 	     "\tbs_mode  %lo\n",
 	     ptr2->bs_ino,
 	     ptr2->bs_mode);
-
 }
 
 /*
@@ -676,7 +674,6 @@ xlate_invt_session(invt_session_t *is1, invt_session_t *is2, int dir)
 	     "\ts_max_nstreams %u\n",
 	     ptr2->s_cur_nstreams,
 	     ptr2->s_max_nstreams);
-
 }
 
 void
diff --git a/common/content_inode.h b/common/content_inode.h
index 7b94ba2..21f36ec 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -422,6 +422,7 @@ calc_checksum(void *bufp, size_t len)
 	uint32_t sum = 0;
 	uint32_t *sump = bufp;
 	uint32_t *endp = sump + len / sizeof(uint32_t);
+
 	assert(len % sizeof(uint32_t) == 0);
 	while (sump < endp)
 		sum += *sump++;
@@ -434,6 +435,7 @@ is_checksum_valid(void *bufp, size_t len)
 	uint32_t sum = 0;
 	uint32_t *sump = bufp;
 	uint32_t *endp = sump + len / sizeof(uint32_t);
+
 	assert(len % sizeof(uint32_t) == 0);
 	while (sump < endp)
 		sum += *sump++;
diff --git a/common/drive.c b/common/drive.c
index 1dcc01e..4ed3550 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -341,7 +341,6 @@ drive_mark_discard(drive_t *drivep)
 	     dmp
 	     ;
 	     drivep->d_markrecheadp = dmp->dm_nextp, dmp = dmp->dm_nextp) {
-
 		(*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp, BOOL_FALSE);
 	}
 }
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 1423486..28dd7d1 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -2405,7 +2405,6 @@ do_fsf(drive_t *drivep, int count, int *statp)
 		 * reach the next file.
 		 */
 		while (! done) {
-
 			/*
 			 * advance the tape to the next file mark
 			 * NOTE:
@@ -2502,7 +2501,6 @@ do_bsf(drive_t *drivep, int count, int *statp)
 	 * now loop, skipping media files
 	 */
 	for (skipped = 0; skipped < count; skipped++) {
-
 		/*
 		 * move to the left of the next file mark on the left.
 		 * check for BOT.
@@ -2847,7 +2845,6 @@ validate_media_file_hdr(drive_t *drivep)
 		mlog(MLOG_NORMAL | MLOG_DRIVE,
 		     _("tape record checksum error\n"));
 		return DRIVE_ERROR_CORRUPTION;
-
 	}
 
 	xlate_global_hdr(tmpgh, grhdrp, 1);
@@ -3125,7 +3122,6 @@ determine_write_error(int nwritten, int saved_errno)
 	     saved_errno);
 
 	return (ret);
-
 }
 
 static void
@@ -3178,6 +3174,7 @@ static int
 dbgrmtopen(char *path, int flags)
 {
 	int rval;
+
 	rval = rmtopen(path, flags);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTOPEN(%s, %d) returns %d: errno=%d (%s)\n"),
@@ -3192,6 +3189,7 @@ static int
 dbgrmtclose(int fd)
 {
 	int rval;
+
 	rval = rmtclose(fd);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTCLOSE(%d) returns %d: errno=%d (%s)\n"),
@@ -3205,6 +3203,7 @@ static int
 dbgrmtioctl(int fd, int op, void *arg)
 {
 	int rval;
+
 	rval = rmtioctl(fd, op, arg);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTIOCTL(%d, %d, 0x%x) returns %d: errno=%d (%s)\n"),
@@ -3220,6 +3219,7 @@ static int
 dbgrmtread(int fd, void *p, uint sz)
 {
 	int rval;
+
 	rval = rmtread(fd, p, sz);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTREAD(%d, 0x%x, %u) returns %d: errno=%d (%s)\n"),
@@ -3235,6 +3235,7 @@ static int
 dbgrmtwrite(int fd, void *p, uint sz)
 {
 	int rval;
+
 	rval = rmtwrite(fd, p, sz);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTWRITE(%d, 0x%x, %u) returns %d: errno=%d (%s)\n"),
@@ -3614,7 +3615,6 @@ largersize:
 			return DRIVE_ERROR_MEDIA;
 		}
 		continue;
-
 	}
 
 	mlog(MLOG_DEBUG | MLOG_DRIVE,
@@ -3767,7 +3767,6 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 		     _("record %lld corrupt: bad record checksum\n"),
 		     contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
-
 	}
 
 	xlate_rec_hdr(tmprh, rechdrp, 1);
@@ -3780,7 +3779,6 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 	}
 
 	if (uuid_is_null(rechdrp->dump_uuid)) {
-
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		     _("record %lld corrupt: null dump id\n"),
 		     contextp->dc_iocnt - 1);
@@ -3944,6 +3942,7 @@ static int
 getrec(drive_t *drivep)
 {
 	drive_context_t *contextp;
+
 	contextp = (drive_context_t *)drivep->d_contextp;
 
 	while (! contextp->dc_recp) {
@@ -4083,7 +4082,6 @@ calc_max_lost(drive_t *drivep)
 	} else {
 		contextp->dc_lostrecmax = 2;
 	}
-
 }
 
 static void
@@ -4233,6 +4231,7 @@ isefsdump(drive_t *drivep)
 {
 	int32_t *efshdrp = (int32_t *)drivep->d_greadhdrp;
 	int32_t efsmagic = efshdrp[6];
+
 	if (efsmagic == 60011
 	    ||
 	    efsmagic == 60012) {
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index be1bb46..3c0b139 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -555,13 +555,11 @@ is_scsi_driver(char *pathname)
 
 	if (dev_major == get_driver_character_major("st")) {
 		return BOOL_TRUE;
-	}
-	else if (dev_major == get_driver_character_major("ts") ||
-		 dev_major == get_driver_character_major("tmf")) {
+	} else if (dev_major == get_driver_character_major("ts") ||
+		   dev_major == get_driver_character_major("tmf")) {
 		TS_ISDRIVER = 1;
 		return BOOL_TRUE;
-	}
-	else {
+	} else {
 		return BOOL_FALSE;
 	}
 }
@@ -599,8 +597,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)
 	} else {
 		if (is_scsi_driver(drivep->d_pathname)) {
 			return 10;
-		}
-		else {
+		} else {
 			return -10;
 		}
 	}
@@ -2597,7 +2594,6 @@ do_fsf(drive_t *drivep, int count, int *statp)
 			if (IS_EOT(mtstat)) {
 				*statp = DRIVE_ERROR_EOM;
 				return i;
-
 			} else if (IS_EOD(mtstat)) {
 				*statp = DRIVE_ERROR_EOD;
 				return i;
@@ -2753,7 +2749,6 @@ do_bsf(drive_t *drivep, int count, int *statp)
 	 * now loop, skipping media files
 	 */
 	for (skipped = 0; skipped < count; skipped++) {
-
 		/*
 		 * move to the left of the next file mark on the left.
 		 * check for BOT.
@@ -3284,7 +3279,6 @@ validate_media_file_hdr(drive_t *drivep)
 		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		     "tape record checksum error\n");
 		return DRIVE_ERROR_CORRUPTION;
-
 	}
 
 	xlate_global_hdr(tmpgh, grhdrp, 1);
@@ -3492,8 +3486,7 @@ get_tpcaps(drive_t *drivep)
 			contextp->dc_maxblksz = QIC_BLKSZ;
 			drivep->d_capabilities &= ~DRIVE_CAP_OVERWRITE;
 			drivep->d_capabilities &= ~DRIVE_CAP_BSF;
-		}
-		else {
+		} else {
 			contextp->dc_cangetblkszpr = BOOL_TRUE;
 			contextp->dc_cansetblkszpr = BOOL_TRUE;
 			contextp->dc_maxblksz = mtinfo.maxblksz;
@@ -3593,8 +3586,7 @@ mt_blkinfo(int fd, struct mtblkinfo *minfo)
 		}
 		minfo->curblksz = ts_blkinfo.curblksz;
 		minfo->maxblksz = ts_blkinfo.maxblksz;
-	}
-	else {
+	} else {
 		if (ioctl(fd, MTIOCGET, &mt_stat) < 0) {
 			/*
 			 * failure
@@ -3823,7 +3815,6 @@ determine_write_error(drive_t *drivep, int nwritten, int saved_errno)
 		status_failed_message(drivep);
 		ret = DRIVE_ERROR_DEVICE;
 	} else if (IS_WPROT(mtstat) && (saved_errno == EROFS)) {
-
 		mlog(MLOG_NORMAL,
 		     _("tape is write protected\n"));
 
@@ -3833,7 +3824,6 @@ determine_write_error(drive_t *drivep, int nwritten, int saved_errno)
 		    (saved_errno == ENOSPC))) {
 		ret = DRIVE_ERROR_EOM;
 	} else if (saved_errno == EIO) {
-
 		mlog(MLOG_NORMAL,
 		     _("tape media error on write operation\n"));
 
@@ -3864,7 +3854,6 @@ determine_write_error(drive_t *drivep, int nwritten, int saved_errno)
 	     saved_errno);
 
 	return (ret);
-
 }
 
 static void
@@ -3917,6 +3906,7 @@ static int
 dbgrmtopen(char *path, int flags)
 {
 	int rval;
+
 	rval = rmtopen(path, flags);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTOPEN(%s, %d) returns %d: errno=%d (%s)\n"),
@@ -3931,6 +3921,7 @@ static int
 dbgrmtclose(int fd)
 {
 	int rval;
+
 	rval = rmtclose(fd);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTCLOSE(%d) returns %d: errno=%d (%s)\n"),
@@ -3944,6 +3935,7 @@ static int
 dbgrmtioctl(int fd, int op, void *arg)
 {
 	int rval;
+
 	rval = rmtioctl(fd, op, arg);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTIOCTL(%d, %d, 0x%x) returns %d: errno=%d (%s)\n"),
@@ -3959,6 +3951,7 @@ static int
 dbgrmtread(int fd, void *p, uint sz)
 {
 	int rval;
+
 	rval = rmtread(fd, p, sz);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTREAD(%d, 0x%x, %u) returns %d: errno=%d (%s)\n"),
@@ -3974,6 +3967,7 @@ static int
 dbgrmtwrite(int fd, void *p, uint sz)
 {
 	int rval;
+
 	rval = rmtwrite(fd, p, sz);
 	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	     _("RMTWRITE(%d, 0x%x, %u) returns %d: errno=%d (%s)\n"),
@@ -4928,7 +4922,6 @@ largersize:
 			return DRIVE_ERROR_MEDIA;
 		}
 		continue;
-
 	} /* loop reading 1st record 'til get correct blksz */
 
 	mlog(MLOG_DEBUG | MLOG_DRIVE,
@@ -5115,7 +5108,6 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 		     _("record %lld corrupt: bad record checksum\n"),
 		     contextp->dc_iocnt - 1);
 		return DRIVE_ERROR_CORRUPTION;
-
 	}
 
 	xlate_rec_hdr(tmprh, rechdrp, 1);
@@ -5128,7 +5120,6 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)
 	}
 
 	if (uuid_is_null(rechdrp->dump_uuid)) {
-
 		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		     _("record %lld corrupt: null dump id\n"),
 		     contextp->dc_iocnt - 1);
@@ -5294,6 +5285,7 @@ static int
 getrec(drive_t *drivep)
 {
 	drive_context_t *contextp;
+
 	contextp = (drive_context_t *)drivep->d_contextp;
 
 	while (! contextp->dc_recp) {
@@ -5433,7 +5425,6 @@ calc_max_lost(drive_t *drivep)
 	} else {
 		contextp->dc_lostrecmax = 2;
 	}
-
 }
 
 static void
@@ -5594,7 +5585,8 @@ bsf_and_verify(drive_t *drivep)
 		(void)mt_op(contextp->dc_fd, MTBSF, 1);
 
 		try = 1;
-status:         ok = mt_get_status(drivep, &mtstat);
+status:
+		ok = mt_get_status(drivep, &mtstat);
 		if (! ok) {
 			mtstat = 0;
 			status_failed_message(drivep);
@@ -5697,6 +5689,7 @@ isefsdump(drive_t *drivep)
 {
 	int32_t *efshdrp = (int32_t *)drivep->d_greadhdrp;
 	int32_t efsmagic = efshdrp[6];
+
 	if (efsmagic == 60011
 	    ||
 	    efsmagic == 60012) {
@@ -5776,4 +5769,3 @@ map_ts_status(struct mtget *mtstat, struct mtget_sgi mtstat_sgi)
 	}
 	return;
 }
-
diff --git a/common/drive_simple.c b/common/drive_simple.c
index b415c43..3b85da7 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -324,7 +324,6 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)
 			drivep->d_capabilities |= DRIVE_CAP_ERASE;
 			contextp->dc_rampr = BOOL_TRUE;
 			oflags = O_RDWR | O_CREAT;
-
 		} else {
 			switch (statbuf.st_mode & S_IFMT) {
 			case S_IFREG:
@@ -359,7 +358,6 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)
 			     drivep->d_pathname,
 			     strerror(errno));
 			return BOOL_FALSE;
-
 		}
 		oflags = O_RDONLY;
 		switch (statbuf.st_mode & S_IFMT) {
@@ -1044,8 +1042,7 @@ do_begin_write(drive_t *drivep)
 	if (! global_hdr_checksum_check(tmphdr)) {
 		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		     _("media file header checksum error\n"));
-	}
-	else {
+	} else {
 		mlog(MLOG_NITTY, "media file header checksum OK!\n");
 	}
 
@@ -1082,6 +1079,7 @@ do_set_mark(drive_t *		drivep,
 {
 	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	drive_mark_t mark;
+
 	mlog(MLOG_NITTY | MLOG_DRIVE,
 	     "drive_simple set_mark()\n");
 
@@ -1140,7 +1138,6 @@ do_set_mark(drive_t *		drivep,
 			 * adjust header checksum
 			 */
 			global_hdr_checksum_set(gwhdrp);
-
 		} else if (contextp->dc_rampr) {
 			global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 			drive_hdr_t *dwhdrp = drivep->d_writehdrp;
diff --git a/common/global.c b/common/global.c
index bf08961..91305b0 100644
--- a/common/global.c
+++ b/common/global.c
@@ -63,6 +63,7 @@ global_hdr_alloc(int argc, char *argv[])
 	global_hdr_t *ghdrp;
 	int c;
 	char *dumplabel;
+
 #ifdef DUMP
 	char labelbuf[GLOBAL_HDR_STRING_SZ];
 	struct stat64 statb;
diff --git a/common/inventory.c b/common/inventory.c
index 07e5e5a..7346ddd 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -45,7 +45,6 @@ int sesslock_fd = -1;
 inv_idbtoken_t
 inv_open(inv_predicate_t bywhat, void *pred)
 {
-
 	int fd, stobjfd, num;
 	char uuname[INV_STRLEN];
 	inv_idbtoken_t tok = INV_TOKEN_NULL;
@@ -105,7 +104,6 @@ inv_open(inv_predicate_t bywhat, void *pred)
 	tok->d_invindex_off = INVINDEX_HDR_OFFSET(index - 1);
 
 	return tok;
-
 }
 
 
@@ -149,6 +147,7 @@ inv_lasttime_level_lessthan(
 	time32_t **	tm)
 {
 	int rval;
+
 	assert(tok != INV_TOKEN_NULL);
 
 	rval = search_invt(tok, level, (void **)tm,
@@ -174,13 +173,13 @@ inv_lastsession_level_lessthan(
 	inv_session_t **ses)
 {
 	int rval;
+
 	assert(tok != INV_TOKEN_NULL);
 
 	rval = search_invt(tok, level, (void **)ses,
 			   (search_callback_t)lastsess_level_lessthan);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 
@@ -201,12 +200,12 @@ inv_lastsession_level_equalto(
 	inv_session_t **ses)
 {
 	int rval;
+
 	assert(tok != INV_TOKEN_NULL);
 	rval = search_invt(tok, level, (void **)ses,
 			   (search_callback_t)lastsess_level_equalto);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 
@@ -340,7 +339,6 @@ inv_writesession_close(inv_sestoken_t tok)
 	free(tok);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 
@@ -537,7 +535,6 @@ inv_put_mediafile(
 	 */
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 
@@ -610,7 +607,6 @@ inv_get_inolist(
 #endif
 
 	return 1;
-
 }
 
 
@@ -655,11 +651,11 @@ inv_DEBUG_printallsessions(
 	inv_session_t **ses)
 {
 	int rval;
+
 	rval = search_invt(tok, 0, (void **)ses,
 			   (search_callback_t)DEBUG_displayallsessions);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 #endif
diff --git a/common/main.c b/common/main.c
index 49dcd90..16dee52 100644
--- a/common/main.c
+++ b/common/main.c
@@ -148,6 +148,7 @@ int
 main(int argc, char *argv[])
 {
 	int c;
+
 #ifdef DUMP
 	uid_t euid;
 #endif /* DUMP */
@@ -1624,6 +1625,7 @@ sigint_dialog(void)
 	size_t controlix;
 	size_t ioix;
 	size_t mediachangeix;
+
 #ifdef RESTORE
 	size_t piix;
 	size_t roix;
@@ -2150,6 +2152,7 @@ set_rlimits(size64_t *vmszp)
 #endif /* RESTORE */
 {
 	struct rlimit64 rlimit64;
+
 #ifdef RESTORE
 	size64_t vmsz;
 #endif /* RESTORE */
@@ -2368,6 +2371,7 @@ sig_numstring(int num)
 			       (sizeof(sig_printmap)
 				/
 				sizeof(sig_printmap[0]));
+
 	for (; p < endp; p++) {
 		if (p->num == num) {
 			return p->string;
diff --git a/common/mlog.c b/common/mlog.c
index 11a923b..17490ce 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -361,8 +361,7 @@ mlog_override_level(int levelarg)
 		for (ss = 0; ss < MLOG_SS_CNT; ss++) {
 			mlog_level_ss[ss] = level;
 		}
-	}
-	else { /* do a particular subsys */
+	} else { /* do a particular subsys */
 		mlog_level_ss[ss] = level;
 	}
 }
@@ -371,6 +370,7 @@ void
 mlog(int levelarg, char *fmt, ...)
 {
 	va_list args;
+
 	va_start(args, fmt);
 	mlog_va(levelarg, fmt, args);
 	va_end(args);
@@ -610,8 +610,7 @@ _mlog_exit(const char *file, int line, int exit_code, rv_t rv)
 			mlog_main_exit_code = exit_code;
 			mlog_main_exit_return = rv;
 		}
-	}
-	else {
+	} else {
 		stream_state_t states[] = { S_RUNNING };
 		stream_state_t state;
 		int streamix;
@@ -625,8 +624,7 @@ _mlog_exit(const char *file, int line, int exit_code, rv_t rv)
 					   &streamix,
 					   &exit_code,
 					   &exit_return,
-					   &exit_hint))
-		{
+					   &exit_hint)) {
 			if (exit_code == -1) {
 				stream_set_code(tid, exit_code);
 				stream_set_return(tid, rv);
@@ -669,7 +667,6 @@ _mlog_exit_hint(const char *file, int line, rv_t rv)
 		mlog_main_exit_hint = rv;
 	else
 		stream_set_hint(tid, rv);
-
 }
 
 rv_t
@@ -725,7 +722,6 @@ mlog_exit_flush(void)
 
 	ntids = stream_find_all(states, N(states), tids, STREAM_SIMMAX);
 	if (ntids > 0) {
-
 		/* print the state of all the streams */
 		fprintf(mlog_fp, _("%s: %s Summary:\n"), progname, PROGSTR_CAPS);
 
diff --git a/common/path.c b/common/path.c
index 5196e9d..12d4090 100644
--- a/common/path.c
+++ b/common/path.c
@@ -170,6 +170,7 @@ static pem_t *
 pem_alloc(char *path)
 {
 	pem_t *pemp = (pem_t *)calloc(1, sizeof(pem_t));
+
 	assert(pemp);
 	pemp->pem_head = path;
 	pemp->pem_next = pemp->pem_head;
@@ -246,6 +247,7 @@ static pa_t *
 pa_alloc(void)
 {
 	pa_t *pap = (pa_t *)calloc(1, sizeof(pa_t));
+
 	assert(pap);
 
 	return pap;
diff --git a/common/ring.c b/common/ring.c
index 030f65d..fddce15 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -458,6 +458,7 @@ ring_slave_entry(void *ringctxp)
 {
 	sigset_t blocked_set;
 	ring_t *ringp = (ring_t *)ringctxp;
+
 	enum { LOOPMODE_NORMAL, LOOPMODE_IGNORE, LOOPMODE_DIE } loopmode;
 
 	/*
diff --git a/common/stream.c b/common/stream.c
index e091359..e80fe74 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -126,6 +126,7 @@ stream_find_all(stream_state_t states[], int nstates,
 	int i, count = 0;
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
+
 	assert(nstates > 0 && ntids > 0);
 
 	if (! initialized)
@@ -188,6 +189,7 @@ stream_getix(pthread_t tid)
 	stream_state_t states[] = { S_RUNNING };
 	spm_t *p;
 	int ix;
+
 	p = stream_find(tid, states, N(states));
 	ix = p ? p->s_ix : -1;
 	return ix;
diff --git a/common/timeutil.c b/common/timeutil.c
index b327c2f..1f351a2 100644
--- a/common/timeutil.c
+++ b/common/timeutil.c
@@ -27,6 +27,7 @@ char *
 ctime32(const time32_t *timep)
 {
 	time_t t = (time_t)*timep;
+
 	return ctime(&t);
 }
 
@@ -34,6 +35,7 @@ char *
 ctime32_r(const time32_t *timep, char *buf)
 {
 	time_t t = (time_t)*timep;
+
 	return ctime_r(&t, buf);
 }
 
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 3e0432d..87faa15 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -716,8 +716,7 @@ struct mt_fpmsg {
 /* Definition of MTGETPOS/MTSETPOS structure */
 #define MAX_VEND_POS_SIZE       256     /* Maximum vendor specific position
 	                                 * data size. */
-struct  vendor_specific_pos
-{
+struct  vendor_specific_pos {
 	u_short position_type;          /* Identifies which position type is required. */
 	short	size;                   /* Number of bytes of position data. */
 	u_char	pos[MAX_VEND_POS_SIZE]; /*Generic vendor specific position data*/
diff --git a/dump/content.c b/dump/content.c
index 236c06c..ddda3df 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -595,7 +595,6 @@ content_init(int		argc,
 	     char *		argv[],
 	     global_hdr_t *	gwhdrtemplatep)
 {
-
 	inv_idbtoken_t inv_idbt;
 	inv_session_t *sessp = 0;
 	drive_hdr_t *dwhdrtemplatep;
@@ -864,7 +863,6 @@ content_init(int		argc,
 		     sizeof(mntpnt),
 		     &fsid,
 		     srcname)) {
-
 		mlog(MLOG_NORMAL | MLOG_ERROR, _(
 			     "%s does not identify a file system\n"),
 		     srcname);
@@ -900,7 +898,6 @@ content_init(int		argc,
 
 	/* write quota information */
 	if (sc_savequotas) {
-
 		sc_savequotas = BOOL_FALSE;
 		for (i = 0; i < (sizeof(quotas) / sizeof(quotas[0])); i++) {
 			quotas[i].savequotas = BOOL_FALSE;
@@ -2123,6 +2120,7 @@ mark_set(drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags)
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	mark_t *markp = (mark_t *)calloc(1, sizeof(mark_t));
+
 	assert(markp);
 
 	if (flags & STARTPT_FLAGS_NULL) {
@@ -4391,7 +4389,6 @@ dump_file_reg(drive_t *			drivep,
 		 * update the media file size
 		 */
 		contextp->cc_mfilesz += bytecnt;
-
 	}
 
 	cleanup_extent_group_context(&extent_group_context);
@@ -6505,7 +6502,6 @@ Media_mfile_end(drive_t *	drivep,
 		contextp->cc_Media_begin_entrystate = BES_INVAL;
 		return RV_CORE;
 	}
-
 }
 
 static bool_t
@@ -6919,8 +6915,7 @@ save_quotas(char *mntpnt, quota_info_t *quotainfo)
 
 	if (unlink(quotainfo->quotapath) == 0) {
 		mlog(MLOG_WARNING, _("overwriting: %s\n"), quotainfo->quotapath);
-	}
-	else {
+	} else {
 		if (errno != ENOENT) {
 			mlog(MLOG_ERROR, _(
 				     "unable to remove %s: %s\n"),
diff --git a/dump/inomap.c b/dump/inomap.c
index 17c6909..44d3724 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -336,7 +336,6 @@ inomap_build(jdm_fshandle_t *	fshandlep,
 			free((void *)bstatbufp);
 			return BOOL_FALSE;
 		}
-
 	} else {
 		mlog(MLOG_VERBOSE | MLOG_INOMAP, _(
 			     "ino map phase 2: "
@@ -515,6 +514,7 @@ static int
 cb_count_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
 {
 	int *count = (int *)arg1;
+
 	(*count)++;
 	return 0;
 }
@@ -759,15 +759,13 @@ supprt_prune(void *		arg1,   /* ancestors marked as changed? */
 						 statp->bs_ino,
 						 MAP_DIR_NOCHNG);
 				cb_dircnt--;    /* dump size just changed! */
-			}
-			else {
+			} else {
 				/* Directory entries back up the hierarchy */
 				/* to be dumped - as either MAP_DIR_SUPPRT */
 				/* or as MAP_DIR_CHANGE in inode state map */
 				*(bool_t *)arg1 = BOOL_TRUE;
 			}
-		}
-		else if (state == MAP_DIR_CHANGE) {
+		} else if (state == MAP_DIR_CHANGE) {
 			/* Directory entries back up the hierarchy must get */
 			/* dumped - as either MAP_DIR_SUPPRT/MAP_DIR_CHANGE */
 			*(bool_t *)arg1 = BOOL_TRUE;
@@ -1010,6 +1008,7 @@ SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	register uint64_t clrmask;
+
 	relino = ino - segp->base;
 	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
@@ -1063,6 +1062,7 @@ SEG_GET_BITS(seg_t *segp, xfs_ino_t ino)
 	int state;
 	register xfs_ino_t relino;
 	register uint64_t mask;
+
 	relino = ino - segp->base;
 	mask = (uint64_t)1 << relino;
 	if (segp->lobits & mask) {
@@ -1135,6 +1135,7 @@ static inline seg_t *
 inomap_addr2seg(seg_addr_t *addrp)
 {
 	hnk_t *hunkp = inomap_addr2hnk(addrp);
+
 	return &hunkp->seg[addrp->segoff];
 }
 
@@ -1217,6 +1218,7 @@ void *
 inomap_alloc_context(void)
 {
 	void *addr = calloc(1, sizeof(seg_addr_t));
+
 	if (! addr) {
 		mlog(MLOG_NORMAL | MLOG_ERROR,
 		     _("failed to allocate inomap context: %s\n"),
@@ -1319,11 +1321,9 @@ inomap_iter(void *contextp, int statemask)
 	for (;
 	     addrp->hnkoff <= inomap.lastseg.hnkoff;
 	     addrp->hnkoff++, addrp->segoff = 0, addrp->inooff = 0) {
-
 		for (;
 		     addrp->segoff <= inomap_lastseg(addrp->hnkoff);
 		     addrp->segoff++, addrp->inooff = 0) {
-
 			segp = inomap_addr2seg(addrp);
 
 			ino = segp->base + addrp->inooff;
@@ -1576,6 +1576,7 @@ subtreelist_parse_cb(void *		arg1,
 	 * temporarily terminate the subpath at the next slash
 	 */
 	char *nextslash = strchr(subpath, '/');
+
 	if (nextslash) {
 		*nextslash = 0;
 	}
@@ -1597,7 +1598,6 @@ subtreelist_parse_cb(void *		arg1,
 	cb_add(NULL, fshandlep, fsfd, statp);
 
 	if (nextslash) {
-
 		/*
 		 * if we're not at the end of the path, yet the current
 		 * path element is not a directory, complain and abort the
@@ -1625,7 +1625,6 @@ subtreelist_parse_cb(void *		arg1,
 			      NULL,
 			      0);
 		return cbrval;
-
 	} else {
 		/*
 		 * we've reached the specified subpath, so if we're
@@ -1661,7 +1660,6 @@ subtree_descend_cb(void *		arg1,
 	cb_add(NULL, fshandlep, fsfd, statp);
 
 	if ((statp->bs_mode & S_IFMT) == S_IFDIR) {
-
 		(void)diriter(fshandlep,
 			      fsfd,
 			      statp,
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 2467115..3d684f2 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -123,7 +123,6 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 	tok->d_invindex_off = IDX_HDR_OFFSET(index - 1);
 	tok->d_oflag = forwhat;
 	return tok;
-
 }
 
 
@@ -277,7 +276,6 @@ inv_writesession_close(inv_sestoken_t tok)
 	free(tok);
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 
@@ -363,7 +361,6 @@ inv_stream_open(
 	free(stok);
 	INVLOCK(fd, LOCK_UN);
 	return INV_TOKEN_NULL;
-
 }
 
 
@@ -393,7 +390,6 @@ inv_stream_close(
 	INVLOCK(fd, LOCK_EX);
 	if ((rval = GET_REC_NOLOCK(fd, &strm, sizeof(invt_stream_t),
 				   tok->md_stream_off)) > 0) {
-
 		if (strm.st_interrupted != wasinterrupted) {
 			strm.st_interrupted = wasinterrupted;
 			dowrite = BOOL_TRUE;
@@ -407,7 +403,6 @@ inv_stream_close(
 			    tok->md_lastmfile->mf_endino.ino ||
 			    strm.st_endino.offset !=
 			    tok->md_lastmfile->mf_endino.offset) {
-
 				mlog(MLOG_DEBUG | MLOG_INV, "INV: stream_close() "
 				     " - endinos dont match ! \n");
 				dowrite = BOOL_TRUE;
@@ -496,7 +491,6 @@ inv_put_mediafile(
 	 */
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
-
 }
 
 
@@ -577,7 +571,6 @@ inv_put_sessioninfo(invt_sessinfo_t *s)
 	}
 
 	return insert_session(s);
-
 }
 
 
@@ -629,6 +622,7 @@ inv_lasttime_level_lessthan(
 	time32_t **	tm)
 {
 	int rval;
+
 	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)tm,
@@ -662,6 +656,7 @@ inv_lastsession_level_lessthan(
 	inv_session_t **ses)
 {
 	int rval;
+
 	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)ses,
@@ -674,7 +669,6 @@ inv_lastsession_level_lessthan(
 					 (void *)&level,        /* in */
 					 (void **)ses,          /* out */
 					 (search_callback_t)lastsess_level_lessthan);
-
 }
 
 /*----------------------------------------------------------------------*/
@@ -697,6 +691,7 @@ inv_lastsession_level_equalto(
 	inv_session_t **ses)
 {
 	int rval;
+
 	if (tok != INV_TOKEN_NULL) {
 		rval = search_invt(fsidp, tok->d_invindex_fd, &level,
 				   (void **)ses,
@@ -709,7 +704,6 @@ inv_lastsession_level_equalto(
 					 (void *)&level,        /* in */
 					 (void **)ses,          /* out */
 					 (search_callback_t)lastsess_level_equalto);
-
 }
 
 
@@ -728,7 +722,6 @@ inv_get_session_byuuid(
 	uuid_t *	sesid,
 	inv_session_t **ses)
 {
-
 	return invmgr_query_all_sessions(fsidp,         /* fs uuid */
 					 (void *)sesid, /* in */
 					 (void **)ses,  /* out */
@@ -750,7 +743,6 @@ inv_get_session_bylabel(
 	char *		session_label,
 	inv_session_t **ses)
 {
-
 	return invmgr_query_all_sessions(fsidp,                 /* fs uuid */
 					 (void *)session_label, /* in */
 					 (void **)ses,          /* out */
@@ -893,6 +885,7 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 	int npreds = 0;
 	int npreds2 = 0;
 	char invoptstring[128], *rptr, *wptr;
+
 	optind = 1;
 	opterr = 0;
 
@@ -1013,7 +1006,6 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 			}
 			break; /* case GETOPT_INVPRINT */
 		}
-
 	}
 
 	if (npreds > 1) {
@@ -1021,15 +1013,13 @@ inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx)
 			     "INV: Only one of mnt=, dev= and fsid=value can be used.\n")
 		     );
 		rval |= I_IERR;
-	}
-	else if (npreds2 > 1) {
+	} else if (npreds2 > 1) {
 		mlog(MLOG_NORMAL | MLOG_INV, _(
 			     "INV: Only one of mobjid= and mobjlabel= can be used.\n")
 		     );
 		rval |= I_IERR;
-	}
-	else if ((rval & I_IFOUND) && !(rval & I_IERR) && fs
-		 && ! prctx->fstab && ! prctx->invcheck) {
+	} else if ((rval & I_IFOUND) && !(rval & I_IERR) && fs
+		   && ! prctx->fstab && ! prctx->invcheck) {
 		inv_idbtoken_t tok;
 
 		/*
@@ -1106,6 +1096,7 @@ inv_DEBUG_print(int argc, char **argv)
 	int rval;
 	invt_pr_ctx_t prctx;
 	inv_oflag_t forwhat = INV_SEARCH_ONLY;
+
 	prctx.mobj.type = INVT_NULLTYPE;
 	prctx.fstab = prctx.invidx = prctx.invcheck = BOOL_FALSE;
 	prctx.level = PR_MAXLEVEL;
@@ -1146,8 +1137,7 @@ inv_DEBUG_print(int argc, char **argv)
 				     &arr[i].ft_mountpt
 				     );
 				invmgr_inv_check(tok->d_invindex_fd);
-			}
-			else {
+			} else {
 				prctx.index = i;
 				invmgr_inv_print(tok->d_invindex_fd,
 						 &prctx);
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 5670e60..00e8d1a 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -50,6 +50,7 @@ get_counters(int fd, void **cntpp, size_t cntsz)
 {
 	/* object must be locked at least SHARED by caller */
 	uint num;
+
 	assert(cntsz >= sizeof(invt_counter_t));
 
 	*cntpp = calloc(1, cntsz);
@@ -86,7 +87,6 @@ get_counters(int fd, void **cntpp, size_t cntsz)
 int
 get_headers(int fd, void **hdrs, size_t bufsz, size_t off)
 {
-
 	*hdrs = malloc(bufsz);
 	if (*hdrs == NULL) {
 		INV_PERROR(_("get_headers() - malloc(seshdrs)\n"));
@@ -212,6 +212,7 @@ get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 	void *arr = NULL;
 	invt_counter_t *cnt = NULL;
 	char *pos;
+
 	/* get the entries in the inv_index */
 	if ((nindices = GET_ALLHDRS_N_CNTS(fd, &arr, (void **)&cnt,
 					   hdrsz, cntsz)) <= 0) {
@@ -229,5 +230,3 @@ get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 
 	return nindices;
 }
-
-
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index 9105ee2..48275a2 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -91,8 +91,7 @@ inv_setup_base(void)
 		if (new_sbuf.st_ino == old_sbuf.st_ino &&
 		    new_sbuf.st_dev == old_sbuf.st_dev) {
 			old_exists = 0; /* both the same, pretend */
-		}
-		else {                  /* die! */
+		} else {                /* die! */
 			return 0;
 		}
 	}
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 6b603b6..17ff6d7 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -118,12 +118,9 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 		cnt->ic_maxnum = -1;
 		cnt->ic_curnum = 0;
 		cnt->ic_vernum = INV_VERSION;
-
 	} else if (numfs > 0) {
-
 		for (i = 0; i < numfs; i++) {
 			if (uuid_compare(*fsidp, arr[i].ft_uuid) == 0) {
-
 /*			if ((STREQL(arr[i].ft_mountpt, mntpt) ) &&
                             (STREQL(arr[i].ft_devpath, dev) ))
  */
@@ -131,7 +128,6 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 				free(cnt);
 				close(fd);
 				return 1;
-
 			}
 		}
 		/* entry not found. just follow thru to create a new one */
@@ -163,7 +159,6 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 		if (rval > 0) {
 			rval = PUT_REC_NOLOCK(fd, &ent, sizeof(ent), hoff);
 		}
-
 	}
 	INVLOCK(fd, LOCK_UN);
 	free(cnt);
@@ -211,7 +206,6 @@ fstab_get_fname(void *		pred,
 			     (STREQL(arr[i].ft_mountpt, pred))) ||
 			    (bywhat == INV_BY_DEVPATH &&
 			     (STREQL(arr[i].ft_devpath, pred)))) {
-
 				uuidp = &arr[i].ft_uuid;
 				break;
 			}
@@ -221,7 +215,6 @@ fstab_get_fname(void *		pred,
 			mlog(MLOG_DEBUG | MLOG_INV, "INV: get_fname: unable to find %s"
 			     " in the inventory\n", (char *)pred);
 #endif
-
 	} else {
 		uuidp = (uuid_t *)pred;
 	}
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index bfe1c68..907cab3 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -51,6 +51,7 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 {
 	uint i;
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
+
 /*	invt_entry_t ient;
         ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = tm; */
 
@@ -121,8 +122,6 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 			}
 			/* see if the next entry starts later than us */
 			if (iarr[i + 1].ie_timeperiod.tp_start > tm) {
-
-
 				/*
 				 * We have the option of pushing entries
 				   after (i) forward by one slot, and
@@ -150,8 +149,6 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 	/* We couldnt find anything that fits */
 	assert(0);      /* We can't get here ! */
 	return -1;
-
-
 }
 
 
@@ -207,7 +204,6 @@ idx_put_newentry(
 	free(iarr);
 	idx->iarr = idxarr;
 	return stobjfd;
-
 }
 
 
@@ -224,7 +220,6 @@ int
 idx_find_stobj(invt_idxinfo_t * idx,
 	       time32_t		tm)
 {
-
 	int stobjfd;
 
 	/*
@@ -306,6 +301,7 @@ int
 idx_recons_time(time32_t tm, invt_idxinfo_t *idx)
 {
 	invt_timeperiod_t *tp = &idx->iarr[idx->index].ie_timeperiod;
+
 	if (tp->tp_start && IS_WITHIN(tp, tm))
 		return 1;
 
@@ -459,7 +455,6 @@ idx_create_entry(
 #endif
 		if (PUT_REC_NOLOCK(invfd, &ent, sizeof(ent), hoff) < 0)
 			return -1;
-
 	}
 
 	*tok = get_token(invfd, fd);
@@ -467,7 +462,6 @@ idx_create_entry(
 	(*tok)->d_update_flag |= NEW_INVINDEX;
 	(*tok)->d_oflag = INV_SEARCH_N_MOD;
 	return fd;
-
 }
 
 
@@ -517,6 +511,7 @@ idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num)
 	uint k;
 
 	char s[9];
+
 	printf("\n ==================================\n"
 	       " InvIndex\n # StObjs\t%d\n", num);
 #define INV_UUID_STR_LEN        36 /* not exported via uuid.h */
@@ -532,7 +527,6 @@ idx_DEBUG_printinvindices(invt_entry_t *iarr, uint num)
 #undef INV_UUID_STR_LEN
 	printf("\n ==================================\n");
 	return 1;
-
 }
 
 int
@@ -541,6 +535,7 @@ idx_DEBUG_print(int fd)
 	int nindices;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
+
 	if ((nindices = GET_ALLHDRS_N_CNTS_NOLOCK(fd,
 						  (void **)&iarr,
 						  (void **)&icnt,
@@ -562,6 +557,7 @@ DEBUG_displayallsessions(int fd, invt_seshdr_t *hdr, uint ref,
 			 invt_pr_ctx_t *prctx)
 {
 	inv_session_t *ses;
+
 	if (stobj_make_invsess(fd, &ses, hdr) < 1)
 		return -1;
 
@@ -571,4 +567,3 @@ DEBUG_displayallsessions(int fd, invt_seshdr_t *hdr, uint ref,
 
 	return 0;
 }
-
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index e5aeb02..e332295 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -232,7 +232,6 @@ search_invt(
 	void **			buf,
 	search_callback_t	do_chkcriteria)
 {
-
 	int fd, i;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
@@ -350,7 +349,6 @@ invmgr_inv_print(
 	int		invfd,
 	invt_pr_ctx_t * prctx)
 {
-
 	int fd, i;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
@@ -442,7 +440,6 @@ int
 invmgr_inv_check(
 	int invfd)
 {
-
 	int fd, i;
 	invt_entry_t *iarr = NULL;
 	invt_counter_t *icnt = NULL;
@@ -498,8 +495,7 @@ invmgr_inv_check(
 			for (s = 0; s < nsess; s++) {
 				printf(_("tm (%d)\t%d\n"), s, harr[s].sh_time);
 			}
-		}
-		else {
+		} else {
 			printf(_("INV: Check %d out of %d succeeded\n"),
 			       i + 1, nindices);
 		}
@@ -523,6 +519,7 @@ tm_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
 		  void **tm)
 {
 	u_char level = *(u_char *)arg;
+
 	*tm = NULL;
 	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
@@ -552,6 +549,7 @@ lastsess_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
 			void **buf)
 {
 	u_char level = *(u_char *)arg;
+
 	*buf = NULL;
 	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
@@ -563,7 +561,6 @@ lastsess_level_lessthan(int fd, invt_seshdr_t *hdr, void *arg,
 		return stobj_make_invsess(fd, (inv_session_t **)buf, hdr);
 	}
 	return 0;
-
 }
 
 
@@ -579,6 +576,7 @@ lastsess_level_equalto(int fd, invt_seshdr_t *hdr,
 		       void *arg, void **buf)
 {
 	u_char level = *(u_char *)arg;
+
 	*buf = NULL;
 	if (IS_PARTIAL_SESSION(hdr))
 		return 0;
@@ -590,8 +588,6 @@ lastsess_level_equalto(int fd, invt_seshdr_t *hdr,
 		return stobj_make_invsess(fd, (inv_session_t **)buf, hdr);
 	}
 	return 0;
-
-
 }
 
 
@@ -671,7 +667,6 @@ insert_session(invt_sessinfo_t *s)
 
 	/* and we are done */
 	return BOOL_TRUE;
-
 }
 
 
@@ -743,6 +738,7 @@ bool_t
 invmgr_trylock(invt_mode_t mode)
 {
 	int md;
+
 	assert(invlock_fd >= 0);
 
 	md = (mode == INVT_RECONSTRUCT) ? LOCK_EX : LOCK_SH;
@@ -759,8 +755,6 @@ invmgr_unlock(void)
 	assert(invlock_fd >= 0);
 
 	INVLOCK(invlock_fd, LOCK_UN);
-
 }
 
 #endif
-
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 08045c5..7260da7 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -124,8 +124,7 @@ oref_resolve_entries(
 			return INV_ERR;
 		}
 		obj->eu_ent = ent;
-	}
-	else {
+	} else {
 		invt_fstab_t *ent;
 		assert(OREF_CNT_CURNUM(obj));
 		if (GET_ENTRIES(obj->fd, &ent, OREF_CNT_CURNUM(obj),
@@ -160,8 +159,7 @@ oref_resolve_counters(
 			return INV_ERR;
 		}
 		obj->cu_sescnt = sescnt;
-	}
-	else {
+	} else {
 		invt_counter_t *cnt;
 		cnt = calloc(1, sizeof(invt_counter_t));
 		if (GET_COUNTERS(obj->fd, cnt) < 0) {
@@ -279,14 +277,12 @@ _oref_free(
 			free((oref)->eu_strm);
 		if (OREF_ISRESOLVED(obj, INVT_RES_MFILES))
 			free((oref)->eu_mfile);
-	}
-	else if (OREF_ISRESOLVED(obj, INVT_OTYPE_INVIDX)) {
+	} else if (OREF_ISRESOLVED(obj, INVT_OTYPE_INVIDX)) {
 		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_cnt);
 		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
 			free((oref)->eu_ent);
-	}
-	else if (OREF_ISRESOLVED(obj, INVT_OTYPE_FSTAB)) {
+	} else if (OREF_ISRESOLVED(obj, INVT_OTYPE_FSTAB)) {
 		if (OREF_ISRESOLVED(obj, INVT_RES_COUNTERS))
 			free((oref)->cu_cnt);
 		if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
@@ -383,7 +379,6 @@ oref_resolve(
 
 	OREF_SET_TOKEN(tok);
 	return INV_OK;
-
 }
 
 /*
@@ -396,6 +391,7 @@ oref_resolve_child(
 	int *		index)
 {
 	invt_entry_t *ent;
+
 	assert(OREF_IS_LOCKED(invidx));
 
 	if (oref_resolve_upto(invidx, INVT_RES_ENTRIES) == INV_ERR)
@@ -449,7 +445,6 @@ oref_resolve_new_invidx(
 
 	OREF_UNLOCK(invidx);
 	return rval;
-
 }
 
 
@@ -496,8 +491,7 @@ oref_resolve_new_stobj(
 		    ||
 		    (oref_sync(invidx, INVT_RES_ENTRIES) == INV_ERR))
 			return INV_ERR;
-	}
-	else {
+	} else {
 		if (oref_resolve_upto(invidx, INVT_RES_COUNTERS) == INV_ERR)
 			return INV_ERR;
 
@@ -515,7 +509,6 @@ oref_resolve_new_stobj(
 		    (oref_sync_append(invidx, INVT_RES_ENTRIES,
 				      &ent, sizeof(ent)) == INV_ERR))
 			return INV_ERR;
-
 	}
 	tok = get_token(invfd, fd);
 	tok->d_invindex_off = IDX_HDR_OFFSET(OREF_CNT_CURNUM(invidx) - 1);
@@ -523,7 +516,4 @@ oref_resolve_new_stobj(
 
 	OREF_SET_TOKEN(invidx, tok);
 	return INV_OK;
-
 }
-
-
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index d8873b9..63fd785 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -250,7 +250,6 @@ typedef struct invt_strdesc_entry {
 	                                           to get it back from disk
 	                                           when we add the next mfile
 	                                           to the linked list */
-
 } invt_strdesc_entry_t;
 
 
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 5db757c..6956850 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -80,7 +80,6 @@ stobj_insert_session(invt_idxinfo_t *	idx,
 			if (uuid_compare(sessions[i].s_sesid,
 					 s->ses->s_sesid) == 0)
 				break;
-
 		}
 		free(sessions);
 		if (i < sescnt->ic_curnum) {
@@ -91,7 +90,6 @@ stobj_insert_session(invt_idxinfo_t *	idx,
 			free(sescnt);
 			return 1;
 		}
-
 	}
 
 	if (sescnt->ic_curnum >= sescnt->ic_maxnum) {
@@ -101,7 +99,6 @@ stobj_insert_session(invt_idxinfo_t *	idx,
 		}
 		free(sescnt);
 		return 1;
-
 	}
 
 	if (stobj_put_session(fd, sescnt, s->ses, s->seshdr, s->strms,
@@ -150,9 +147,6 @@ stobj_find_splitpoint(int fd, invt_seshdr_t *harr, uint ns, time32_t tm)
 	     );
 
 	return ns - 1;
-
-
-
 }
 
 
@@ -280,9 +274,7 @@ int
 stobj_delete_mfile(int fd, inv_stream_t *strm, invt_mediafile_t *mf,
 		   off64_t mfileoff)
 {
-
 	return 1;
-
 }
 
 
@@ -362,7 +354,6 @@ stobj_put_session(
 					    * nmf);
 		if (stobj_put_streams(fd, hdr, ses, strms, mfiles) < 0)
 			return -1;
-
 	}
 
 	/* we write back the counters of this storage object first */
@@ -400,6 +391,7 @@ stobj_sortheaders(int fd, uint num)
 {
 	size_t sz = sizeof(invt_seshdr_t) * num;
 	invt_seshdr_t *hdrs;
+
 #ifdef INVT_DEBUG
 	int i;
 #endif
@@ -432,7 +424,6 @@ stobj_sortheaders(int fd, uint num)
 
 	free(hdrs);
 	return 1;
-
 }
 
 
@@ -462,7 +453,6 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 					 (off64_t)((size_t)nmfiles * sizeof(invt_mediafile_t));
 		/* now fix the offsets in mediafiles */
 		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 =
@@ -482,7 +472,6 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		mfiles[nmfiles].mf_prevmf = 0;
 		nmfiles += strms[i].st_nmediafiles;
 		mfiles[nmfiles - 1].mf_nextmf = 0;
-
 	}
 
 	/* first put the streams. hdr already points at the right place */
@@ -495,7 +484,6 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		return -1;
 
 	return 1;
-
 }
 
 
@@ -876,7 +864,6 @@ stobj_getsession_byuuid(
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
 	return BOOL_TRUE;
-
 }
 
 
@@ -913,7 +900,6 @@ stobj_getsession_bylabel(
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
 	return BOOL_TRUE;
-
 }
 
 
@@ -962,7 +948,6 @@ stobj_delete_mobj(int			fd,
 		     j++,
 		     off = mf->mf_nextmf,
 		     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.
@@ -1001,7 +986,6 @@ stobj_delete_mobj(int			fd,
                                        strms[i].st_lastmfile =;
  */
 			}
-
 		}
 		free(mfiles);
 		if (dirty);
@@ -1184,13 +1168,11 @@ stobj_convert_mfile(inv_mediafile_t *expmf, invt_mediafile_t *mf)
 			  BOOL_TRUE : BOOL_FALSE;
 	expmf->m_isinvdump = (mf->mf_flag & INVT_MFILE_INVDUMP) ?
 			     BOOL_TRUE : BOOL_FALSE;
-
 }
 
 void
 stobj_convert_strm(inv_stream_t *expstrm, invt_stream_t *strm)
 {
-
 	expstrm->st_interrupted = strm->st_interrupted;
 	expstrm->st_startino = strm->st_startino.ino;
 	expstrm->st_startino_off =
@@ -1222,7 +1204,6 @@ stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 
 	/* caller is responsible for initializing this */
 	ises->s_streams = NULL;
-
 }
 
 
@@ -1297,7 +1278,6 @@ stobj_copy_invsess(int			fd,
 				return -1;
 			}
 		}
-
 	}
 
 
@@ -1363,6 +1343,7 @@ void
 DEBUG_sessprint(invt_session_t *ses)
 {
 	char str[UUID_STR_LEN + 1];
+
 	uuid_unparse(ses->s_fsid, str);
 
 	printf("-------- session -------------\n");
@@ -1377,7 +1358,6 @@ DEBUG_sessprint(invt_session_t *ses)
 bool_t
 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)) {
@@ -1426,6 +1406,7 @@ 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) {
 		if (! check_for_mobj(ses, mobj))
 			return;
diff --git a/inventory/inventory.h b/inventory/inventory.h
index d7a8726..ea61bb9 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -169,7 +169,6 @@ typedef struct inv_session {
 	uint		s_refnum;               /* storage location dependent ref.
 	                                            used in displaying the session and
 	                                            nowhere else */
-
 } inv_session_t;
 
 
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 7fabbfc..8ac9053 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -74,7 +74,6 @@ CREAT_mfiles(inv_stmtoken_t tok, uuid_t *moid, ino_t f, ino_t n)
 
 	inv_put_mediafile(tok, moid, label, 12, f, 0, n, 0, 0xffff,
 			  BOOL_TRUE, BOOL_FALSE);
-
 }
 
 typedef struct ses {
@@ -117,8 +116,6 @@ recons_test(int howmany)
 	}
 
 	close(fd);
-
-
 }
 
 
@@ -142,7 +139,6 @@ delete_test(int n)
 	if (! inv_delete_mediaobj(&moid)) return -1;
 
 	return 1;
-
 }
 
 int
@@ -265,6 +261,7 @@ write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 	char strbuf[128];
 	void *bufp;
 	size_t sz;
+
 #ifdef RECONS
 	int rfd;
 	off64_t off;
@@ -406,8 +403,7 @@ mp_test(int nstreams)
 /*----------------------------------------------------------------------*/
 
 
-main(int argc, char *argv[])
-{
+main(int argc, char *argv[]){
 	int rval = -1, nsess = 8, nmedia = 2, nstreams = 3, level = 0;
 	int cc = 0;
 	extern char *optarg;
@@ -505,15 +501,11 @@ main(int argc, char *argv[])
 			rval = sess_queries_byuuid(uuid);
 		else if (label)
 			rval = sess_queries_bylabel(label);
-	}
-	else
+	} else
 		usage();
 
 	if (rval < 0)
 		printf("aborted\n");
 	else
 		printf("done\n");
-
-
 }
-
diff --git a/invutil/cmenu.c b/invutil/cmenu.c
index f7da523..e339ae9 100644
--- a/invutil/cmenu.c
+++ b/invutil/cmenu.c
@@ -488,16 +488,13 @@ list_prune(node_t *menulist, char *mountpt, uuid_t *uuidp, time32_t prunetime)
 			if (d->ops->op_prune(mountpt, uuidp, prunetime, n, menulist) == BOOL_TRUE) {
 				if (d->ops->op_delete == NULL) {
 					list_delete(n, menulist);
-				}
-				else {
+				} else {
 					d->ops->op_delete(NULL, n, menulist);
 				}
-			}
-			else {
+			} else {
 				if (d->ops->op_undelete == NULL) {
 					list_undelete(n, menulist);
-				}
-				else {
+				} else {
 					d->ops->op_undelete(NULL, n, menulist);
 				}
 			}
diff --git a/invutil/fstab.c b/invutil/fstab.c
index 0052f9d..9a03a05 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -96,8 +96,7 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
 			}
 		}
 		fstab_file[fidx].counter->ic_curnum--;
-	}
-	else if (d->imported == BOOL_TRUE) {
+	} else if (d->imported == BOOL_TRUE) {
 		invt_fstab_t *dest;
 
 		for (i = 0; i < d->nbr_children; i++) {
@@ -111,8 +110,7 @@ fstab_commit(WINDOW *win, node_t *current, node_t *list)
 
 		if (fstab_file[0].counter->ic_curnum < fstab_file[0].nEntries) {
 			dest = fstab_file[0].data[fstab_file[0].counter->ic_curnum - 1] + 1;
-		}
-		else {
+		} else {
 			/* expand mmap by one */
 			dest = remmap_fstab(0, 1);
 		}
@@ -208,8 +206,7 @@ add_fstab_data(int fidx, invt_fstab_t *data)
 			fprintf(stderr, "%s: internal memory error: fstab data allocation\n", g_programName);
 			exit(1);
 		}
-	}
-	else {
+	} else {
 		fstab_file[fidx].data = realloc(fstab_file[fidx].data,
 						sizeof(*fstab_file[fidx].data)
 						* (fstab_file[fidx].numrecords + 1));
@@ -290,8 +287,7 @@ add_fstab(char *name, int fd, int nEntries, char *mapaddr, invt_counter_t *count
 			fprintf(stderr, "%s: internal memory error: malloc fstab_file\n", g_programName);
 			exit(1);
 		}
-	}
-	else {
+	} else {
 		if (fstab_numfiles >= highwatermark - 1) {
 			highwatermark += highwatermark;
 
@@ -377,8 +373,7 @@ remmap_fstab(int fidx, int num)
 	for (i = 0; i < nEntries; i++) {
 		if (i >= fstab_file[fidx].numrecords) {
 			add_fstab_data(fidx, &(fstab_entry[i]));
-		}
-		else {
+		} else {
 			fstab_file[fidx].data[i] = &(fstab_entry[i]);
 		}
 	}
diff --git a/invutil/invidx.c b/invutil/invidx.c
index a641f09..2482e74 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -106,8 +106,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 			}
 		}
 		invidx_file[fidx].counter->ic_curnum--;
-	}
-	else if (d->imported == BOOL_TRUE) {
+	} else if (d->imported == BOOL_TRUE) {
 		int dst_fileidx;
 		int dst_invpos;
 		int dst_invidx;
@@ -169,8 +168,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 
 					if (--i < 0)
 						break;
-				}
-				while ((dst_invidx = find_overlapping_invidx(dst_fileidx, inv_entry)) >= 0);
+				} while ((dst_invidx = find_overlapping_invidx(dst_fileidx, inv_entry)) >= 0);
 
 				mark_all_children_commited(current);
 
@@ -205,8 +203,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 				}
 
 				return 0;
-			}
-			else {
+			} else {
 				/* insert new invidx entry, and copy over stobj file */
 				if (invidx_file[dst_fileidx].counter->ic_curnum >= invidx_file[dst_fileidx].nEntries) {
 					dest = remmap_invidx(dst_fileidx, 1);
@@ -217,8 +214,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 					memmove(invidx_file[dst_fileidx].data[dst_invpos + 1],
 						invidx_file[dst_fileidx].data[dst_invpos],
 						sizeof(*inv_entry) * (invidx_file[dst_fileidx].counter->ic_curnum - dst_invpos));
-				}
-				else {
+				} else {
 					dest = invidx_file[dst_fileidx].data[invidx_file[dst_fileidx].counter->ic_curnum - 1] + 1;
 				}
 
@@ -244,8 +240,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 						put_error("Error: unable to copy stobj file: stat error");
 						return 0;
 					}
-				}
-				else {
+				} else {
 					put_error("Error: unable to copy stobj file: file exists");
 					return 0;
 				}
@@ -259,8 +254,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 				open_stobj(dst_stobjfile);
 				return 0;
 			}
-		}
-		else {
+		} else {
 			/* no matching inventory index file - just copy entry to a new file */
 			invt_counter_t cnt;
 			int new_fd;
@@ -277,8 +271,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 					put_error("Error: unable to stat inventory index file");
 					return 0;
 				}
-			}
-			else {
+			} else {
 				put_error("Error: unable to copy inventory index file: file exists");
 				return 0;
 			}
@@ -314,8 +307,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
 					put_error("Error: unable to copy stobj file: stat error");
 					return 0;
 				}
-			}
-			else {
+			} else {
 				put_error("Error: unable to copy stobj file: file exists");
 				return 0;
 			}
@@ -382,12 +374,10 @@ read_stobj_info(int fd, int idx, invt_seshdr_t **out_hdr,
 		if (nmfiles > 0) {
 			mfiles = malloc(sizeof(*mfiles) * nmfiles);
 			read_n_bytes(fd, (char *)mfiles, sizeof(*mfiles) * nmfiles, "stobj file");
-		}
-		else {
+		} else {
 			mfiles = NULL;
 		}
-	}
-	else {
+	} else {
 		strms = NULL;
 		mfiles = NULL;
 	}
@@ -639,7 +629,6 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		strms[i].st_firstmfile = mfileoff + (off64_t)((size_t)nmfiles * sizeof(invt_mediafile_t));
 		/* now fix the offsets in mediafiles */
 		for (j = 0; j < strms[i].st_nmediafiles; j++) {
-
 			/* no need to fix the last element's next ptr */
 			if (j < strms[i].st_nmediafiles - 1)
 				mfiles[nmfiles + j].mf_nextmf = strms[i].st_firstmfile + (off64_t)((j + 1) * sizeof(invt_mediafile_t));
@@ -886,8 +875,7 @@ add_invidx_data(int fidx, invt_entry_t *data)
 				g_programName);
 			exit(1);
 		}
-	}
-	else {
+	} else {
 		invidx_file[fidx].data = realloc(invidx_file[fidx].data,
 						 sizeof(*invidx_file[fidx].data)
 						 * (invidx_file[fidx].numrecords + 1));
@@ -967,8 +955,7 @@ add_invidx(char *name, int fd, int nEntries, char *mapaddr, invt_counter_t *coun
 			fprintf(stderr, "%s: internal memory error: malloc invidx_file\n", g_programName);
 			exit(1);
 		}
-	}
-	else {
+	} else {
 		if (invidx_numfiles >= highwatermark - 1) {
 			highwatermark += highwatermark;
 
@@ -1025,8 +1012,7 @@ remmap_invidx(int fidx, int num)
 	for (i = 0; i < nEntries; i++) {
 		if (i >= invidx_file[fidx].numrecords) {
 			add_invidx_data(fidx, &(inv_entry[i]));
-		}
-		else {
+		} else {
 			invidx_file[fidx].data[i] = &(inv_entry[i]);
 		}
 	}
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 13ebd56..24a7b6a 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -258,30 +258,25 @@ main(int argc, char *argv[])
 		time32_t temptime = 0;
 		CheckAndPruneFstab(inventory_path, BOOL_TRUE, tempstr, &uuid,
 				   &session, temptime, NULL);
-	}
-	else if (session_option) {
+	} else if (session_option) {
 		CheckAndPruneFstab(
 			inventory_path, BOOL_FALSE, mntPoint, &uuid,
 			&session, (time32_t)0, r_mf_label);
-	}
-	else if (uuid_option || mntpnt_option) {
+	} else if (uuid_option || mntpnt_option) {
 		time32_t timeSecs = ParseDate(argv[optind]);
 
 		if (interactive_option) {
 			invutil_interactive(inventory_path, mntPoint, &uuid, timeSecs);
 			printf("\n");
-		}
-		else {
+		} else {
 			CheckAndPruneFstab(
 				inventory_path, BOOL_FALSE, mntPoint, &uuid,
 				&session, timeSecs, r_mf_label);
 		}
-	}
-	else if (interactive_option) {
+	} else if (interactive_option) {
 		invutil_interactive(inventory_path, mntPoint, &uuid, 0);
 		printf("\n");
-	}
-	else {
+	} else {
 		usage();
 	}
 
@@ -495,23 +490,20 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 	printf("Processing file %s\n", fstabname);
 
 	/* check each entry in fstab for mount pt or uuid match */
-	for (i = 0; i < counter->ic_curnum;)
-	{
+	for (i = 0; i < counter->ic_curnum;) {
 		removeflag = BOOL_FALSE;
 
 		printf("   Found entry for %s\n", fstabentry[i].ft_mountpt);
 
 		for (j = i + 1; j < counter->ic_curnum; j++) {
-			if (uuid_compare(fstabentry[i].ft_uuid, fstabentry[j].ft_uuid) == 0)
-			{
+			if (uuid_compare(fstabentry[i].ft_uuid, fstabentry[j].ft_uuid) == 0) {
 				printf("     duplicate fstab entry\n");
 				removeflag = BOOL_TRUE;
 				break;
 			}
 		}
 
-		if (! removeflag)
-		{
+		if (! removeflag) {
 			bool_t IdxCheckOnly = BOOL_TRUE;
 
 			invname = GetNameOfInvIndex(inv_path, fstabentry[i].ft_uuid);
@@ -526,17 +518,14 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 				if (mountPt != NULL && strcmp(mountPt, fstabentry[i].ft_mountpt) == 0) {
 					printf("     Match on hostname and path\n");
 					IdxCheckOnly = BOOL_FALSE;
-				}
-				else if ((! uuid_is_null(*uuidp))
-					 && (uuid_compare(*uuidp, fstabentry[i].ft_uuid) == 0)) {
+				} else if ((! uuid_is_null(*uuidp))
+					   && (uuid_compare(*uuidp, fstabentry[i].ft_uuid) == 0)) {
 					printf("     Match on UUID only\n");
 					IdxCheckOnly = BOOL_FALSE;
-				}
-				else if (mountPt != NULL && mntpnt_equal(mountPt, fstabentry[i].ft_mountpt)) {
+				} else if (mountPt != NULL && mntpnt_equal(mountPt, fstabentry[i].ft_mountpt)) {
 					printf("     Match on directory name only: %s\n", mountPt);
 					IdxCheckOnly = BOOL_FALSE;
-				}
-				else if (! uuid_is_null(*sessionp)) {
+				} else if (! uuid_is_null(*sessionp)) {
 					// no session id to match against yet, defer deciding if this is
 					// a check-only run until we have a session
 					IdxCheckOnly = BOOL_FALSE;
@@ -550,11 +539,9 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 			}
 
 			free(invname);
-
 		}
 
-		if (removeflag == BOOL_TRUE)
-		{
+		if (removeflag == BOOL_TRUE) {
 			printf("     removing fstab entry %s\n", fstabentry[i].ft_mountpt);
 			if (counter->ic_curnum > 1) {
 				bcopy((void *)&fstabentry[i + 1],
@@ -562,8 +549,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 				      (sizeof(invt_fstab_t) * (counter->ic_curnum - i - 1)));
 			}
 			counter->ic_curnum--;
-		}
-		else
+		} else
 			i++; /* next entry if this entry not removed */
 	}
 
@@ -586,8 +572,7 @@ CheckAndPruneFstab(char *inv_path, bool_t checkonly, char *mountPt,
 
 	close(fd);
 
-	if (fstabEntries == 0)
-	{
+	if (fstabEntries == 0) {
 		if (debug) {
 			printf("unlink fstab file %s\n", fstabname);
 		}
@@ -635,8 +620,7 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 	counter = (invt_counter_t *)temp;
 	invIndexEntry = (invt_entry_t *)(temp + sizeof(invt_counter_t));
 
-	for (i = 0; i < counter->ic_curnum;)
-	{
+	for (i = 0; i < counter->ic_curnum;) {
 		removeflag = BOOL_FALSE;
 		printf("         Checking access for\n"
 		       "          %s\n", invIndexEntry[i].ie_filename);
@@ -648,8 +632,7 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 		}
 
 		if ((access(invIndexEntry[i].ie_filename, R_OK | W_OK) == -1) &&
-		    (errno == ENOENT))
-		{
+		    (errno == ENOENT)) {
 			printf("         Unable to access %s referred in %s\n",
 			       invIndexEntry[i].ie_filename, idxFileName);
 			printf("         removing index entry \n");
@@ -661,16 +644,14 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 			removeflag = BOOL_TRUE; /* The StObj is gone */
 		}
 
-		if (removeflag == BOOL_TRUE)
-		{
+		if (removeflag == BOOL_TRUE) {
 			if (counter->ic_curnum > 1) {
 				bcopy((void *)&invIndexEntry[i + 1],
 				      (void *)&invIndexEntry[i],
 				      (sizeof(invt_entry_t) * (counter->ic_curnum - i - 1)));
 			}
 			counter->ic_curnum--;
-		}
-		else
+		} else
 			i++; /* next entry if this entry not removed */
 	}
 
@@ -698,8 +679,7 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 
 	close(fd);
 
-	if (validEntries == 0)
-	{
+	if (validEntries == 0) {
 		if (debug) {
 			printf("unlink idx file %s\n", idxFileName);
 		}
@@ -858,16 +838,14 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 				       str, StObjses->s_mountpt, StObjses->s_devpath,
 				       StObjses->s_label, ctime32(&StObjhdr->sh_time));
 				removeflag = BOOL_TRUE;
-			}
-			else {
+			} else {
 				printf("-------------------------------------------------\n");
 				printf("An entry matching the mount point/time is :\n");
 				printf("UUID\t\t:\t%s\nMOUNT POINT\t:\t%s\n"
 				       "DEV PATH\t:\t%s\nTIME OF DUMP\t:\t%s",
 				       str, StObjses->s_mountpt, StObjses->s_devpath,
 				       ctime32(&StObjhdr->sh_time));
-				while (GotResponse == BOOL_FALSE)
-				{
+				while (GotResponse == BOOL_FALSE) {
 					char *chp;
 
 					printf("\nDo you want to prune this entry: [y/n] ");
@@ -878,8 +856,7 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 					if (strcasecmp(response, "Y") == 0) {
 						removeflag = BOOL_TRUE;
 						GotResponse = BOOL_TRUE;
-					}
-					else if (strcasecmp(response, "N") == 0) {
+					} else if (strcasecmp(response, "N") == 0) {
 						GotResponse = BOOL_TRUE;
 					}
 				}
@@ -910,8 +887,7 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 
 	close(fd);
 
-	if (validEntries == 0)
-	{
+	if (validEntries == 0) {
 		if (debug)
 			printf("Removing: %s\n", StObjFileName);
 		unlink(StObjFileName);
@@ -1183,4 +1159,3 @@ usage(void)
 
 	exit(1);
 }
-
diff --git a/invutil/list.c b/invutil/list.c
index 8661650..201e7bc 100644
--- a/invutil/list.c
+++ b/invutil/list.c
@@ -109,8 +109,7 @@ list_add(node_t *prevnode, node_t *newnode)
 		if (newnode->next != NULL) {
 			newnode->next->prev = newnode;
 		}
-	}
-	else {
+	} else {
 		newnode->next = NULL;
 		newnode->prev = NULL;
 	}
diff --git a/invutil/list.h b/invutil/list.h
index 3a06c02..7d8d45e 100644
--- a/invutil/list.h
+++ b/invutil/list.h
@@ -52,4 +52,3 @@ node_t *free_all_children(node_t *node);
 node_t *mark_all_children_commited(node_t *node);
 
 #endif /* LIST_H */
-
diff --git a/invutil/menu.c b/invutil/menu.c
index b50734c..705c4c8 100644
--- a/invutil/menu.c
+++ b/invutil/menu.c
@@ -44,8 +44,7 @@ put_all_options(WINDOW *win, node_t *list, node_t *current)
 		}
 		if (node == current) {
 			attr = A_REVERSE;
-		}
-		else {
+		} else {
 			attr = 0;
 		}
 		put_option(win, i, d->text, attr);
@@ -138,8 +137,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 			if (d->ops != NULL && d->ops->op_highlight != NULL) {
 				quit = d->ops->op_highlight(win, current, list);
 			}
-		}
-		else if (last != current || redraw_options) {
+		} else if (last != current || redraw_options) {
 			put_option(win, last_line, ((data_t *)(last->data))->text, 0);
 			put_option(win, current_line, d->text, A_REVERSE);
 
@@ -291,8 +289,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
 					if (keyv[k].fn != NULL) {
 						quit = keyv[k].fn(win, current, list);
 						break;
-					}
-					else {
+					} else {
 						put_footer("internal error: can't execute function", ALIGN_CENTRE);
 						break;
 					}
diff --git a/invutil/stobj.c b/invutil/stobj.c
index 1c475da..2f538ca 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -159,8 +159,7 @@ stobjsess_commit(WINDOW *win, node_t *current, node_t *list)
 
 	if (d->deleted == BOOL_TRUE) {
 		stobjhdr->sh_pruned = 1;
-	}
-	else {
+	} else {
 		stobjhdr->sh_pruned = 0;
 	}
 
@@ -368,8 +367,7 @@ add_stobj_data(int fidx, void *data)
 				g_programName);
 			exit(1);
 		}
-	}
-	else {
+	} else {
 		stobj_file[fidx].data = realloc(stobj_file[fidx].data,
 						sizeof(*stobj_file[fidx].data)
 						* (stobj_file[fidx].numrecords + 1));
@@ -541,8 +539,7 @@ add_stobj(char *name, int fd, off_t size, char *mapaddr, invt_sescounter_t *coun
 			fprintf(stderr, "%s: internal memory error: malloc stobj_file\n", g_programName);
 			exit(1);
 		}
-	}
-	else {
+	} else {
 		if (stobj_numfiles >= highwatermark - 1) {
 			highwatermark += highwatermark;
 
@@ -636,7 +633,6 @@ close_all_stobj()
 	int unlink_ok;
 
 	for (i = 0; i < stobj_numfiles; i++) {
-
 		if (stobj_file[i].fd < 0)
 			continue;
 
diff --git a/librmt/rmtaccess.c b/librmt/rmtaccess.c
index 0944d41..ef1c2ac 100644
--- a/librmt/rmtaccess.c
+++ b/librmt/rmtaccess.c
@@ -33,14 +33,9 @@ int rmtaccess(path, amode)
 char *path;
 int amode;
 {
-	if (_rmt_dev(path))
-	{
+	if (_rmt_dev(path)) {
 		return (0);             /* Let /etc/rmt find out */
-	}
-	else
-	{
+	} else {
 		return (access(path, amode));
 	}
 }
-
-
diff --git a/librmt/rmtclose.c b/librmt/rmtclose.c
index 20be537..1744220 100644
--- a/librmt/rmtclose.c
+++ b/librmt/rmtclose.c
@@ -32,15 +32,12 @@ static int _rmt_close(int);
 int rmtclose(fildes)
 int fildes;
 {
-	if (isrmt(fildes))
-	{
+	if (isrmt(fildes)) {
 		/* no longer know what host we have for this fildes */
 		RMTHOST(fildes - REM_BIAS) = UNAME_UNKNOWN;
 
 		return (_rmt_close(fildes - REM_BIAS));
-	}
-	else
-	{
+	} else {
 		return (close(fildes));
 	}
 }
@@ -53,8 +50,7 @@ _rmt_close(int fildes)
 {
 	int rc;
 
-	if (_rmt_command(fildes, "C\n") != -1)
-	{
+	if (_rmt_command(fildes, "C\n") != -1) {
 		rc = _rmt_status(fildes);
 
 		_rmt_abort(fildes);
@@ -63,5 +59,3 @@ _rmt_close(int fildes)
 
 	return (-1);
 }
-
-
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index cfeaac3..6b96af9 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -46,8 +46,7 @@ char *buf;
  */
 
 	blen = strlen(buf);
-	if (write(WRITE(fildes), buf, blen) == blen)
-	{
+	if (write(WRITE(fildes), buf, blen) == blen) {
 		return (0);
 	}
 
@@ -60,6 +59,3 @@ char *buf;
 	setoserror(EIO);
 	return (-1);
 }
-
-
-
diff --git a/librmt/rmtcreat.c b/librmt/rmtcreat.c
index c86d608..7026a36 100644
--- a/librmt/rmtcreat.c
+++ b/librmt/rmtcreat.c
@@ -36,14 +36,9 @@ int rmtcreat(path, mode)
 char *path;
 int mode;
 {
-	if (_rmt_dev(path))
-	{
+	if (_rmt_dev(path)) {
 		return (rmtopen(path, 1 | O_CREAT, mode));
-	}
-	else
-	{
+	} else {
 		return (creat(path, mode));
 	}
 }
-
-
diff --git a/librmt/rmtdev.c b/librmt/rmtdev.c
index b1f2fbb..6271e20 100644
--- a/librmt/rmtdev.c
+++ b/librmt/rmtdev.c
@@ -32,14 +32,10 @@
 int _rmt_dev(path)
 register char *path;
 {
-	if ((path = strchr(path, ':')) != (char *)0)
-	{
-		if (strncmp(path + 1, "/dev/", 5) == 0)
-		{
+	if ((path = strchr(path, ':')) != (char *)0) {
+		if (strncmp(path + 1, "/dev/", 5) == 0) {
 			return (1);
 		}
 	}
 	return (0);
 }
-
-
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 75ff766..67c1f7a 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -39,12 +39,9 @@ int rmtfstat(fildes, buf)
 int fildes;
 struct stat *buf;
 {
-	if (isrmt(fildes))
-	{
+	if (isrmt(fildes)) {
 		return (_rmt_fstat(fildes - REM_BIAS, (char *)buf));
-	}
-	else
-	{
+	} else {
 		int i;
 		i = fstat(fildes, buf);
 		return i;
@@ -76,11 +73,9 @@ _rmt_fstat(int fildes, char *arg)
 	adj_rc = (rc > sizeof(struct stat)) ? sizeof(struct stat) : rc;
 	rc -= adj_rc;
 
-	for (; adj_rc > 0; adj_rc -= cnt, arg += cnt)
-	{
+	for (; adj_rc > 0; adj_rc -= cnt, arg += cnt) {
 		cnt = read(READ(fildes), arg, adj_rc);
-		if (cnt <= 0)
-		{
+		if (cnt <= 0) {
 abortit:
 			_rmt_abort(fildes);
 			setoserror(EIO);
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index bcf9124..a948593 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -47,8 +47,7 @@ struct  irix_mtget {
 	int		mt_blkno;       /* block number of current position */
 };
 
-struct linux32_mtget
-{
+struct linux32_mtget {
 	int32_t mt_type;        /* Type of magtape device.  */
 	int32_t mt_resid;       /* Residual count: */
 	/* The following registers are device dependent.  */
@@ -60,8 +59,7 @@ struct linux32_mtget
 	int32_t mt_blkno;       /* Current block number.  */
 };
 
-struct linux64_mtget
-{
+struct linux64_mtget {
 	int64_t mt_type;        /* Type of magtape device.  */
 	int64_t mt_resid;       /* Residual count. */
 	/* The following registers are device dependent.  */
@@ -144,8 +142,7 @@ rmtioctl(int fildes, unsigned int request, void *arg)
 {
 	if (isrmt(fildes)) {
 		return (_rmt_ioctl(fildes - REM_BIAS, request, arg));
-	}
-	else {
+	} else {
 		return (ioctl(fildes, request, arg));
 	}
 }
@@ -202,8 +199,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 				setoserror(EINVAL);
 				return (-1);
 			}
-		}
-		else if (RMTHOST(fildes) != UNAME_LINUX) {
+		} else if (RMTHOST(fildes) != UNAME_LINUX) {
 			/* map the linux op code to the standard/fallback op code */
 			mt_op = mtop_stdmap[mt_op];
 			if (mt_op == -1) {
@@ -217,9 +213,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			return (-1);
 		}
 		return (_rmt_status(fildes));
-	}
-	else if (op == MTIOCGET) {
-
+	} else if (op == MTIOCGET) {
 		/*
 		 *  Grab the status and read it directly into the structure.
 		 *  Since the data is binary data, and the other machine might
@@ -262,11 +256,9 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		case UNAME_LINUX:
 			if (sizeof(struct linux32_mtget) == rc) {
 				islinux32 = 1;
-			}
-			else if (sizeof(struct linux64_mtget) == rc) {
+			} else if (sizeof(struct linux64_mtget) == rc) {
 				islinux32 = 0;
-			}
-			else {
+			} else {
 				_rmt_msg(RMTWARN,
 					 _("rmtioctl: Linux mtget structure of wrong size "
 					   "- got %d, wanted %d or %d\n"),
@@ -287,11 +279,9 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 
 		if (RMTHOST(fildes) == UNAME_IRIX) {
 			p = irixget = (char *)&irix_mtget;
-		}
-		else if (islinux32) {
+		} else if (islinux32) {
 			p = linux32get = (char *)&linux32_mtget;
-		}
-		else {
+		} else {
 			p = linux64get = (char *)&linux64_mtget;
 		}
 
@@ -324,8 +314,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 				irixp->mt_fileno = INT_SWAP(irixp->mt_fileno, irixp->mt_fileno);
 				irixp->mt_blkno = INT_SWAP(irixp->mt_blkno, irixp->mt_blkno);
 			}
-		}
-		else if (islinux32) {
+		} else if (islinux32) {
 			struct linux32_mtget *linuxp = (struct linux32_mtget *)linux32get;
 
 			if (linuxp->mt_type > 0xffff) {
@@ -338,10 +327,8 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 				linuxp->mt_fileno = INT_SWAP(linuxp->mt_fileno, linuxp->mt_fileno);
 				linuxp->mt_blkno = INT_SWAP(linuxp->mt_blkno, linuxp->mt_blkno);
 				linuxp->mt_gstat = INT_SWAP(linuxp->mt_gstat, linuxp->mt_gstat);
-
 			}
-		}
-		else {
+		} else {
 			struct linux64_mtget *linuxp = (struct linux64_mtget *)linux64get;
 
 			if (linuxp->mt_type > 0xffff) {
@@ -354,7 +341,6 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 				linuxp->mt_fileno = INT_SWAP(linuxp->mt_fileno, linuxp->mt_fileno);
 				linuxp->mt_blkno = INT_SWAP(linuxp->mt_blkno, linuxp->mt_blkno);
 				linuxp->mt_gstat = INT_SWAP(linuxp->mt_gstat, linuxp->mt_gstat);
-
 			}
 		}
 
@@ -391,8 +377,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 				dstp->mt_gstat |= GMT_EOF(0xffffffff);
 			if (status & IRIX_MT_EW)
 				; /* No GMT_ to map it to */
-		}
-		else if (islinux32) {
+		} else if (islinux32) {
 			struct mtget *dstp = (struct mtget *)arg;
 			struct linux32_mtget *srcp = (struct linux32_mtget *)linux32get;
 
@@ -403,8 +388,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			dstp->mt_blkno = srcp->mt_blkno;
 			dstp->mt_dsreg = srcp->mt_dsreg;
 			dstp->mt_gstat = srcp->mt_gstat;
-		}
-		else {
+		} else {
 			struct mtget *dstp = (struct mtget *)arg;
 			struct linux64_mtget *srcp = (struct linux64_mtget *)linux64get;
 
@@ -417,9 +401,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			dstp->mt_gstat = srcp->mt_gstat;
 		}
 		return (0);
-
-	}
-	else {
+	} else {
 		setoserror(EINVAL);
 		return (-1);
 	}
diff --git a/librmt/rmtisatty.c b/librmt/rmtisatty.c
index 75ae9fc..25758ca 100644
--- a/librmt/rmtisatty.c
+++ b/librmt/rmtisatty.c
@@ -31,12 +31,9 @@
 int rmtisatty(fd)
 int fd;
 {
-	if (isrmt(fd))
-	{
+	if (isrmt(fd)) {
 		return (0);
-	}
-	else
-	{
+	} else {
 		return (isatty(fd));
 	}
 }
diff --git a/librmt/rmtlseek.c b/librmt/rmtlseek.c
index 350d444..546b8c8 100644
--- a/librmt/rmtlseek.c
+++ b/librmt/rmtlseek.c
@@ -37,12 +37,9 @@ int fildes;
 off_t offset;
 int whence;
 {
-	if (isrmt(fildes))
-	{
+	if (isrmt(fildes)) {
 		return (_rmt_lseek(fildes - REM_BIAS, offset, whence));
-	}
-	else
-	{
+	} else {
 		return (lseek(fildes, offset, whence));
 	}
 }
@@ -62,5 +59,3 @@ _rmt_lseek(int fildes, off_t offset, int whence)
 
 	return (_rmt_status(fildes));
 }
-
-
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 383e9bf..1458ade 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -43,8 +43,7 @@ int _rmt_Ctp[MAXUNIT][2] = { { -1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
 int _rmt_Ptc[MAXUNIT][2] = { { -1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } };
 int _rmt_host[MAXUNIT] = { -1, -1, -1, -1 };
 
-struct uname_table
-{
+struct uname_table {
 	int	id;
 	char *	name;
 };
@@ -63,12 +62,9 @@ char *path;
 int oflag;
 int mode;
 {
-	if (strchr(path, ':') != NULL)
-	{
+	if (strchr(path, ':') != NULL) {
 		return (_rmt_open(path, oflag, mode) | REM_BIAS);
-	}
-	else
-	{
+	} else {
 		return (open(path, oflag, mode));
 	}
 }
@@ -118,8 +114,7 @@ static int _rmt_open(char *path, int oflag, int mode)
 		if (READ(i) == -1 && WRITE(i) == -1)
 			break;
 
-	if (i == MAXUNIT)
-	{
+	if (i == MAXUNIT) {
 		setoserror(EMFILE);
 		return (-1);
 	}
@@ -134,16 +129,13 @@ static int _rmt_open(char *path, int oflag, int mode)
 	*user = '\0';
 	path++;
 
-	if (*(path - 1) == '@')
-	{
+	if (*(path - 1) == '@') {
 		while (*path != ':') {
 			*sys++ = *path++;
 		}
 		*sys = '\0';
 		path++;
-	}
-	else
-	{
+	} else {
 		for (user = login; (*sys = *user); user++, sys++)
 			;
 		user = login;
@@ -167,8 +159,7 @@ static int _rmt_open(char *path, int oflag, int mode)
 
 		if (user != login) {
 			snprintf(cmd, sizeof(cmd), "%s -l %s %s uname", rsh_path, login, system);
-		}
-		else {
+		} else {
 			snprintf(cmd, sizeof(cmd), "%s %s uname", rsh_path, system);
 		}
 
@@ -179,8 +170,7 @@ static int _rmt_open(char *path, int oflag, int mode)
 				 cmd);
 			RMTHOST(i) = UNAME_UNDEFINED;
 			goto do_rmt;
-		}
-		else {
+		} else {
 			int len;
 			char *c = fgets(uname, sizeof(uname), rmt_f);
 			pclose(rmt_f);
@@ -206,8 +196,7 @@ static int _rmt_open(char *path, int oflag, int mode)
 			_rmt_msg(RMTWARN, _(
 					 "rmtopen: remote host type, \"%s\", is unknown to librmt\n"),
 				 uname);
-		}
-		else {
+		} else {
 			RMTHOST(i) = p->id;
 			_rmt_msg(RMTDBG, "rmtopen: RMTHOST(%d) = %s\n", i, p->name);
 		}
@@ -224,8 +213,7 @@ do_rmt:
 	if ((rc = fork()) == -1)
 		return (-1);
 
-	if (rc == 0)
-	{
+	if (rc == 0) {
 		close(0);
 		dup(_rmt_Ptc[i][0]);
 		close(_rmt_Ptc[i][0]); close(_rmt_Ptc[i][1]);
@@ -237,17 +225,13 @@ do_rmt:
 		if (_rmt_msgson() == RMTDBG) {
 			snprintf(rmt_cmd, sizeof(rmt_cmd), "%s %s.%d",
 				 rmt_path, RMT_DEBUG_FILE, getpid());
-		}
-		else {
+		} else {
 			strncpy(rmt_cmd, rmt_path, sizeof(rmt_cmd));
 		}
-		if (user != login)
-		{
+		if (user != login) {
 			execl(rsh_path, "rsh", system, "-l", login,
 			      rmt_cmd, (char *)0);
-		}
-		else
-		{
+		} else {
 			execl(rsh_path, "rsh", system,
 			      rmt_cmd, (char *)0);
 		}
diff --git a/librmt/rmtread.c b/librmt/rmtread.c
index 6edfb08..1004992 100644
--- a/librmt/rmtread.c
+++ b/librmt/rmtread.c
@@ -38,12 +38,9 @@ int fildes;
 char *buf;
 unsigned int nbyte;
 {
-	if (isrmt(fildes))
-	{
+	if (isrmt(fildes)) {
 		return (_rmt_read(fildes - REM_BIAS, buf, nbyte));
-	}
-	else
-	{
+	} else {
 		return (read(fildes, buf, nbyte));
 	}
 }
@@ -62,11 +59,9 @@ _rmt_read(int fildes, char *buf, unsigned int nbyte)
 	if (_rmt_command(fildes, buffer) == -1 || (rc = _rmt_status(fildes)) == -1)
 		return (-1);
 
-	for (i = 0; i < rc; i += nbyte, buf += nbyte)
-	{
+	for (i = 0; i < rc; i += nbyte, buf += nbyte) {
 		nbyte = read(READ(fildes), buf, rc);
-		if (nbyte <= 0)
-		{
+		if (nbyte <= 0) {
 			_rmt_abort(fildes);
 			setoserror(EIO);
 			return (-1);
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index 11ff375..3691eef 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -43,23 +43,19 @@ int fildes;
  *	read the reply command line
  */
 
-	for (i = 0, cp = buffer; i < BUFMAGIC; i++, cp++)
-	{
-		if (read(READ(fildes), cp, 1) != 1)
-		{
+	for (i = 0, cp = buffer; i < BUFMAGIC; i++, cp++) {
+		if (read(READ(fildes), cp, 1) != 1) {
 			_rmt_abort(fildes);
 			setoserror(EIO);
 			return (-1);
 		}
-		if (*cp == '\n')
-		{
+		if (*cp == '\n') {
 			*cp = 0;
 			break;
 		}
 	}
 
-	if (i == BUFMAGIC)
-	{
+	if (i == BUFMAGIC) {
 		_rmt_abort(fildes);
 		setoserror(EIO);
 		return (-1);
@@ -73,8 +69,7 @@ int fildes;
 		if (*cp != ' ')
 			break;
 
-	if (*cp == 'E' || *cp == 'F')
-	{
+	if (*cp == 'E' || *cp == 'F') {
 		setoserror(atoi(cp + 1));
 		while (read(READ(fildes), &c, 1) == 1)
 			if (c == '\n')
@@ -90,8 +85,7 @@ int fildes;
  *	check for mis-synced pipes
  */
 
-	if (*cp != 'A')
-	{
+	if (*cp != 'A') {
 		_rmt_abort(fildes);
 		setoserror(EIO);
 		return (-1);
@@ -99,6 +93,3 @@ int fildes;
 
 	return (atoi(cp + 1));
 }
-
-
-
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index 4610222..830be20 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -38,12 +38,9 @@ int fildes;
 char *buf;
 unsigned int nbyte;
 {
-	if (isrmt(fildes))
-	{
+	if (isrmt(fildes)) {
 		return (_rmt_write(fildes - REM_BIAS, buf, nbyte));
-	}
-	else
-	{
+	} else {
 		return (write(fildes, buf, nbyte));
 	}
 }
@@ -61,8 +58,7 @@ _rmt_write(int fildes, char *buf, unsigned int nbyte)
 	if (_rmt_command(fildes, buffer) == -1)
 		return (-1);
 
-	if (write(WRITE(fildes), buf, nbyte) == nbyte)
-	{
+	if (write(WRITE(fildes), buf, nbyte) == nbyte) {
 		return (_rmt_status(fildes));
 	}
 
diff --git a/restore/content.c b/restore/content.c
index c360205..09080c3 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -1543,7 +1543,6 @@ content_init(int argc, char *argv[], size64_t vmsz)
 		persp->v.housekeeping_magic = HOUSEKEEPING_MAGIC;
 		persp->v.housekeeping_version = HOUSEKEEPING_VERSION;
 		persp->v.pagesize = pgsz;
-
 	} else {
 		/*
 		 * cumulative or resuming a restore, verify the header
@@ -2573,7 +2572,6 @@ content_stream_restore(ix_t thrdix)
 				return mlog_exit(EXIT_ERROR, RV_ERROR);
 			}
 			tranp->t_treeinitdonepr = BOOL_TRUE;
-
 		} else {
 			ok = tree_check_dump_format(grhdrp->gh_version);
 			if (! ok) {
@@ -3274,8 +3272,7 @@ applydirdump(drive_t *			drivep,
 			 * if in a pipeline, call preemptchk() to
 			 * print status reports
 			 */
-			if (pipeline)
-			{
+			if (pipeline) {
 				mlog(MLOG_DEBUG,
 				     "preemptchk()\n");
 				preemptchk();
@@ -3713,7 +3710,6 @@ applynondirdump(drive_t *		drivep,
 		 * complete the old one and begin the new one.
 		 */
 		if (bstatp->bs_ino != strctxp->sc_bstat.bs_ino) {
-
 			restore_complete_reg(strctxp);
 
 			/* start new ino */
@@ -3723,7 +3719,6 @@ applynondirdump(drive_t *		drivep,
 			strctxp->sc_ownerset = BOOL_FALSE;
 
 			rv = restore_file(drivep, fhdrp, ehcs, ahcs, path1, path2);
-
 		} else if (fhdrp->fh_flags & FILEHDR_FLAGS_EXTATTR) {
 			rv = restore_extattr(drivep,
 					     fhdrp,
@@ -3845,8 +3840,7 @@ applynondirdump(drive_t *		drivep,
 		 * if in a pipeline, call preemptchk() to
 		 * print status reports
 		 */
-		if (pipeline)
-		{
+		if (pipeline) {
 			mlog(MLOG_DEBUG,
 			     "preemptchk()\n");
 			preemptchk();
@@ -3872,26 +3866,29 @@ finalize(char *path1, char *path2)
 	bool_t ok;
 
 	if (! tranp->t_toconlypr) {
-
 		/*
 		 * restore directory attributes
 		 */
-		if (! persp->s.dirattrdonepr) {;
-					      ok = tree_setattr(path1);
-					      if (! ok) {
-						      return RV_INTR;
-					      }
-					      persp->s.dirattrdonepr = BOOL_TRUE; }
+		if (! persp->s.dirattrdonepr) {
+			;
+			ok = tree_setattr(path1);
+			if (! ok) {
+				return RV_INTR;
+			}
+			persp->s.dirattrdonepr = BOOL_TRUE;
+		}
 
 		/*
 		 * remove orphanage if empty
 		 */
-		if (! persp->s.orphdeltriedpr) {;
-					       ok = tree_delorph();
-					       if (! ok) {
-						       return RV_INTR;
-					       }
-					       persp->s.orphdeltriedpr = BOOL_TRUE; }
+		if (! persp->s.orphdeltriedpr) {
+			;
+			ok = tree_delorph();
+			if (! ok) {
+				return RV_INTR;
+			}
+			persp->s.orphdeltriedpr = BOOL_TRUE;
+		}
 
 		/*
 		 * delete the persistent ino map
@@ -3950,6 +3947,7 @@ wipepersstate(void)
 	DIR *dirp;
 	struct dirent64 *direntp;
 	char pathname[MAXPATHLEN];
+
 	dirp = opendir(tranp->t_hkdir);
 	if (! dirp) {
 		return;
@@ -4520,7 +4518,6 @@ validate:
 		 */
 		if (uuid_compare(prevmfiledumpid,
 				 grhdrp->gh_dumpid) != 0) {
-
 			char string_uuid[UUID_STR_LEN + 1];
 
 			mlog_lock();
@@ -5008,8 +5005,7 @@ newmedia:
 		 */
 		if ((*dop->do_get_device_class)(drivep)
 		    ==
-		    DEVICE_NONREMOVABLE)
-		{
+		    DEVICE_NONREMOVABLE) {
 			/*
 			 * if no error has already been detected then don't log
 			   a failure */
@@ -6222,7 +6218,6 @@ pi_scanfileendino(dh_t fileh)
 			     nexth != DH_NULL
 			     ;
 			     nexth = DH2F(nexth)->f_nexth) {
-
 				switch (mode) {
 				case 0:
 					if (nexth == fileh) {
@@ -6636,7 +6631,6 @@ pi_neededobjs_nondir_alloc(bool_t *	knownholesprp,
 			    ! DH2F(tailh)->f_nondirdonepr
 			    &&
 			    ! DH2F(tailh)->f_nondirskippr) {
-
 				dh_t objh = DH2F(tailh)->f_parh;
 
 				if (! DH2O(objh)->o_indrivepr
@@ -6667,7 +6661,6 @@ pi_neededobjs_nondir_alloc(bool_t *	knownholesprp,
 		} while (tailh != headh);
 
 		tailegrp = headegrp;
-
 	} while (headh != DH_NULL);
 
 	pi_unlock();
@@ -7947,7 +7940,6 @@ restore_reg(drive_t *	drivep,
 	}
 
 	if (persp->a.dstdirisxfspr) {
-
 		/*
 		 * set the extended inode flags, except those which must
 		 * be set only after all data has been restored.
@@ -8312,7 +8304,6 @@ restore_spec(filehdr_t *fhdrp, rv_t *rvp, char *path)
 				return BOOL_TRUE;
 			}
 			(void)close(sockfd);
-
 		} else {
 			/*
 			 * create the node
@@ -9379,8 +9370,7 @@ dump_partials(void)
 				       (unsigned long long)isptr->is_ino);
 				for (j = 0, bsptr = isptr->is_bs;
 				     j < drivecnt;
-				     j++, bsptr++)
-				{
+				     j++, bsptr++) {
 					if (bsptr->endoffset > 0) {
 						printf("%d:%lld-%lld ",
 						       j, (long long)bsptr->offset,
@@ -9426,8 +9416,7 @@ check_valid_partials(void)
 				isptr = &persp->a.parrest[i];
 				for (j = 0, bsptr = isptr->is_bs;
 				     j < drivecnt;
-				     j++, bsptr++)
-				{
+				     j++, bsptr++) {
 					if (bsptr->endoffset > 0) {
 						num_partials[j]++;
 						if (num_partials[j] > 2) {
@@ -9640,8 +9629,7 @@ gapsearch:
 	for (i = 0, bsptr = isptr->is_bs; i < drivecnt; i++, bsptr++) {
 		if (bsptr->endoffset > 0 &&
 		    bsptr->offset <= curoffset &&
-		    bsptr->endoffset > curoffset)
-		{
+		    bsptr->endoffset > curoffset) {
 			curoffset = bsptr->endoffset;
 			goto gapsearch;
 		}
@@ -10165,7 +10153,6 @@ display_needed_objects(purp_t	purp,
 			     _("\nthere may be unidentified media "
 			       "objects containing media files not yet tried "
 			       "for directory hierarchy restoral:\n"));
-
 		}
 		if (purp == PURP_NONDIR) {
 			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
diff --git a/restore/dirattr.c b/restore/dirattr.c
index 69557a9..95d5d38 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -409,6 +409,7 @@ dirattr_add(filehdr_t *fhdrp)
 	dirattr_t dirattr;
 	off64_t oldoff;
 	dix_t dix;
+
 #ifdef DIRATTRCHK
 	uint16_t sum;
 #endif /* DIRATTRCHK */
@@ -790,6 +791,7 @@ void
 dirattr_update(dah_t dah, filehdr_t *fhdrp)
 {
 	dix_t dix;
+
 #ifdef DIRATTRCHK
 	uint16_t sum;
 #endif /* DIRATTRCHK */
@@ -1003,6 +1005,7 @@ dirattr_get(dah_t dah)
 	off64_t argoff;
 	off64_t newoff;
 	int nread;
+
 #ifdef DIRATTRCHK
 	uint16_t sum;
 #endif /* DIRATTRCHK */
@@ -1083,6 +1086,7 @@ dirattr_cacheflush(void)
 {
 	dah_t dah;
 	dix_t dix;
+
 #ifdef DIRATTRCHK
 	uint16_t sum;
 #endif /* DIRATTRCHK */
diff --git a/restore/inomap.c b/restore/inomap.c
index 2611d98..fabc557 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -115,6 +115,7 @@ SEG_SET_BITS(seg_t *segp, xfs_ino_t ino, int state)
 	register xfs_ino_t relino;
 	register uint64_t mask;
 	register uint64_t clrmask;
+
 	relino = ino - segp->base;
 	mask = (uint64_t)1 << relino;
 	clrmask = ~mask;
@@ -168,6 +169,7 @@ SEG_GET_BITS(seg_t *segp, xfs_ino_t ino)
 	int state;
 	register xfs_ino_t relino;
 	register uint64_t mask;
+
 	relino = ino - segp->base;
 	mask = (uint64_t)1 << relino;
 	if (segp->lobits & mask) {
@@ -468,6 +470,7 @@ void
 inomap_del_pers(char *hkdir)
 {
 	char *perspath = open_pathalloc(hkdir, PERS_NAME, 0);
+
 	(void)unlink(perspath);
 	free((void *)perspath);
 }
diff --git a/restore/mmap.c b/restore/mmap.c
index 851b33c..932fbe9 100644
--- a/restore/mmap.c
+++ b/restore/mmap.c
@@ -32,8 +32,10 @@ mmap_autogrow(size_t len, int fd, off_t offset)
 	char nul_buffer[] = "";
 
 	/* prealloc file if it is an empty file */
-	if (fstat(fd, &buf) == -1) {;
-				    return (void *)MAP_FAILED; }
+	if (fstat(fd, &buf) == -1) {
+		;
+		return (void *)MAP_FAILED;
+	}
 	if (buf.st_size < offset + len) {
 		(void)lseek(fd, offset + len - 1, SEEK_SET);
 		(void)write(fd, nul_buffer, 1);
diff --git a/restore/namreg.c b/restore/namreg.c
index 883f379..e760557 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -362,7 +362,6 @@ namreg_flush(void)
 	assert(ntp);
 
 	if (ntp->nt_off) {
-
 		/*
 		 * write the accumulated name strings.
 		 */
@@ -396,6 +395,7 @@ namreg_get(nrh_t	nrh,
 	size_t len;
 	char *in_bufp;
 	static char read_buf[256];
+
 	/* long enough for the longest allowed name (255), plus 1 for length */
 #ifdef NAMREGCHK
 	nrh_t chkbit;
@@ -436,11 +436,8 @@ namreg_get(nrh_t	nrh,
 	lock();
 
 	if (ntp->nt_map) {
-
 		in_bufp = ntp->nt_map + newoff - NAMREG_PERS_SZ;
-
 	} else {
-
 		if (ntp->nt_at_endpr && ntp->nt_off) {
 			if (namreg_flush() != RV_OK) {
 				unlock();
diff --git a/restore/node.c b/restore/node.c
index edfa947..a987160 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -335,7 +335,6 @@ node_init(int		fd,
 	}
 
 	for (winmapmax = 0, segcount = 1; winmapmax < WINMAP_MIN; segcount <<= 1) {
-
 		nodesperseg = max(dirs_nondirs_cnt / segcount, NODESPERSEG_MIN);
 
 		/* nodesperseg must be a power of 2 */
@@ -472,6 +471,7 @@ node_alloc(void)
 {
 	u_char_t *p;
 	nh_t nh;
+
 #ifdef NODECHK
 	u_char_t *hkpp;
 	u_char_t gen = 0;
@@ -504,7 +504,6 @@ node_alloc(void)
 		node_hdrp->nh_freenh = *linkagep;
 
 		node_unmap_internal(nh, (void **)&p, BOOL_TRUE);
-
 	} else {
 		if (nh2relnix(node_hdrp->nh_virgnh) == 0) {
 			/* need to start a new virgin segment */
@@ -566,6 +565,7 @@ void *
 node_map(nh_t nh)
 {
 	u_char_t *p;
+
 #ifdef NODECHK
 	register u_char_t hkp;
 	register u_char_t hdlgen;
@@ -617,6 +617,7 @@ node_free(nh_t *nhp)
 	nh_t nh;
 	u_char_t *p;
 	register nh_t *linkagep;
+
 #ifdef NODECHK
 	register u_char_t *hkpp;
 	register u_char_t hdlgen;
diff --git a/restore/tree.c b/restore/tree.c
index 3f77c9a..81b0d4a 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -788,6 +788,7 @@ tree_marknoref_recurse(nh_t parh)
 		cldh = parp->n_cldh;
 		Node_unmap(parh, &parp);
 	}
+
 	while (cldh != NH_NULL) {
 		node_t *cldp;
 		nh_t nextcldh;
@@ -1527,7 +1528,7 @@ noref_elim_recurse(nh_t		parh,
 				Node_unmap(renameh, &renamep);
 				Node_unmap(cldh, &cldp);
 			}
-		} else  {
+		} else {
 			/*
 			 * determine if we can unlink this node.
 			 * if its not real, and not refed, simple.
@@ -1581,8 +1582,7 @@ noref_elim_recurse(nh_t		parh,
 				}
 				if (neededpr) {
 					mustorphpr = BOOL_TRUE;
-				}
-				else {
+				} else {
 					canunlinkpr = BOOL_TRUE;
 				}
 			}
@@ -1728,7 +1728,6 @@ mkdirs_recurse(nh_t parh, nh_t cldh, char *path)
 					     "mkdir %s failed: %s\n"),
 				     path,
 				     strerror(errno));
-
 			} else {
 				cldp = Node_map(cldh);
 				cldp->n_flags |= NF_REAL;
@@ -2057,7 +2056,6 @@ tree_cb_links(xfs_ino_t					ino,
 					return RV_NOTOK;
 				}
 			} else {
-
 				if (! tranp->t_toconlypr) {
 					char *dir;
 					char tmp[PATH_MAX];
@@ -2146,6 +2144,7 @@ tree_adjref_recurse(nh_t	cldh,
 		grandcldh = cldp->n_cldh;
 		Node_unmap(cldh, &cldp);
 	}
+
 	while (grandcldh != NH_NULL) {
 		node_t *grandcldp;
 		nh_t nextgrandcldh;
@@ -2340,7 +2339,6 @@ proc_hardlinks_cb(void *contextp, nh_t hardheadh)
 	lnsrch = 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);
 		bool_t isrealpr = np->n_flags & NF_REAL;
 		bool_t isrefpr = np->n_flags & NF_REFED;
@@ -2624,6 +2622,7 @@ tree_setattr_recurse(nh_t parh, char *path)
 {
 	node_t *parp = Node_map(parh);
 	nh_t cldh = parp->n_cldh;
+
 	Node_unmap(parh, &parp);
 	while (cldh != NH_NULL) {
 		nh_t nextcldh;
@@ -3624,6 +3623,7 @@ static void
 Node_free(nh_t *nhp)
 {
 	node_t *np;
+
 	np = Node_map(*nhp);
 	np->n_ino = 0;
 	np->n_gen = 0;
@@ -3652,6 +3652,7 @@ static node_t *
 Node_map(nh_t nh)
 {
 	node_t *n = (node_t *)node_map(nh);
+
 	if (n == NULL) {
 		mlog(MLOG_ERROR | MLOG_TREE, _(
 			     "failed to map in node (node handle: %u)\n"), nh);
@@ -3674,6 +3675,7 @@ static bool_t
 Node2path(nh_t nh, char *path, char *errmsg)
 {
 	int remainingcnt;
+
 	strcpy(path, "."); /* in case root node passed in */
 	remainingcnt = Node2path_recurse(nh, path, MAXPATHLEN, 0);
 	if (remainingcnt <= 0) {
@@ -5212,8 +5214,7 @@ mkdir_r(char *path)
 		if (mkdir_r(dirname(strdup(path))) < 0)
 			return -1;
 		return mkdir(path, 0755);
-	}
-	else if ((sbuf.st_mode & S_IFDIR) == 0) {
+	} else if ((sbuf.st_mode & S_IFDIR) == 0) {
 		mlog(MLOG_TRACE | MLOG_ERROR | MLOG_TREE, _(
 			     "%s is not a directory\n"),
 		     path);
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 23/24] xfsdump: (style) add stars to multiline comments
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (15 preceding siblings ...)
  2018-11-09 14:30 ` [PATCH 22/24] xfsdump: (style) format newlines Jan Tulak
@ 2018-11-09 14:30 ` Jan Tulak
  2018-11-09 14:30 ` [PATCH 24/24] xfsdump: (style) remove parentheses after return Jan Tulak
  2018-11-14 20:36 ` [PATCH 00/24] xfsdump: code style change Eric Sandeen
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:30 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

All lines of multiline comments should begin with a star.

Created by Uncrustify with this config file:

#
# uncrustify config, add stars to multiline comments
#

indent_with_tabs	= 2		# 1=indent with tabs, align with spaces, 2=use all tabs
input_tab_size		= 8		# original tab size
output_tab_size		= 8		# new tab size
indent_columns		= output_tab_size

indent_label		= 1		# pos: absolute col, neg: relative column

#
# inter-symbol newlines
#

nl_enum_brace		= remove	# "enum {" vs "enum
 {"
nl_union_brace		= remove	# "union {" vs "union
 {"
nl_struct_brace		= remove	# "struct {" vs "struct
 {"
nl_do_brace 		= remove	# "do {" vs "do
 {"
nl_if_brace 		= remove	# "if () {" vs "if ()
 {"
nl_for_brace 		= remove	# "for () {" vs "for ()
 {"
nl_else_brace 		= remove	# "else {" vs "else
 {"
nl_while_brace 		= remove	# "while () {" vs "while ()
 {"
nl_switch_brace 	= remove	# "switch () {" vs "switch ()
 {"
nl_brace_while		= remove	# "} while" vs "}
 while" - cuddle while
nl_brace_else		= remove	# "} else" vs "}
 else" - cuddle else
sp_brace_else		= force
sp_else_brace		= force
nl_func_var_def_blk	= 1
nl_fcall_brace		= remove	# "list_for_each() {" vs "list_for_each()
{"
nl_fdef_brace		= add		# "int foo() {" vs "int foo()
{"
nl_after_label_colon	= true		# "fail:
free(foo);" vs "fail: free(foo);"

#
# Source code modifications
#

mod_paren_on_return	= ignore	# "return 1;" vs "return (1);"
mod_full_brace_for	= ignore	# "for () a--;" vs "for () { a--; }"
mod_full_brace_do	= ignore	# "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while	= ignore	# "while (a) a--;" vs "while (a) { a--; }"

#
# inter-character spacing options
#

sp_return_paren		= force		# "return (1);" vs "return(1);"
sp_sizeof_paren		= remove	# "sizeof (int)" vs "sizeof(int)"
sp_before_sparen	= force		# "if (" vs "if("
sp_after_sparen		= force		# "if () {" vs "if (){"
sp_after_cast		= remove	# "(int) a" vs "(int)a"
sp_inside_braces	= force		# "{ 1 }" vs "{1}"
sp_inside_braces_struct	= force	# "{ 1 }" vs "{1}"
sp_inside_braces_enum	= force	# "{ 1 }" vs "{1}"
sp_assign		= force
sp_arith		= force
sp_bool			= force
sp_compare		= force
sp_assign		= force
sp_after_comma		= force
sp_func_def_paren	= remove	# "int foo (){" vs "int foo(){"
sp_func_call_paren	= remove	# "foo (" vs "foo("
sp_func_proto_paren	= remove	# "int foo ();" vs "int foo();"

#
# Aligning stuff
#

align_with_tabs		= TRUE		# use tabs to align
align_on_tabstop	= TRUE 		# align on tabstops
align_enum_equ_span	= 4		# '=' in enum definition
align_var_def_colon	= TRUE
align_struct_init_span	= 3		# align stuff in a structure init '= { }'
align_right_cmt_span	= 3

cmt_star_cont = true

#
# other
#

nl_func_paren = remove
nl_func_decl_start = ignore
nl_func_decl_empty = remove
nl_func_decl_args = ignore
nl_func_decl_end = remove

sp_inside_paren = remove
sp_inside_square = remove
sp_inside_paren_cast = remove
sp_inside_fparen = remove
sp_inside_sparen = remove
sp_paren_paren = remove
sp_before_ptr_star = force
sp_after_ptr_star = remove
sp_between_ptr_star = remove
align_func_params = true
align_var_struct_span = 6

eat_blanks_after_open_brace   = true
eat_blanks_before_close_brace = true
pp_indent = ignore

nl_start_of_file   = remove
nl_end_of_file     = force
nl_end_of_file_min = 1
nl_comment_func_def = 1

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/drive_minrmt.c |  8 ++--
 common/getdents.c     | 24 ++++++------
 common/hsmapi.c       | 26 ++++++-------
 common/inventory.c    | 16 ++++----
 common/inventory.h    |  6 +--
 common/main.c         |  6 +--
 common/media.c        |  4 +-
 common/ts_mtio.h      | 76 +++++++++++++++++++-------------------
 dump/content.c        |  6 +--
 dump/inomap.c         |  2 +-
 inventory/inv_api.c   | 54 +++++++++++++--------------
 inventory/inv_core.c  |  2 +-
 inventory/inv_fstab.c |  6 +--
 inventory/inv_idx.c   | 56 ++++++++++++++--------------
 inventory/inv_mgr.c   | 22 +++++------
 inventory/inv_oref.c  |  6 +--
 inventory/inv_oref.h  |  2 +-
 inventory/inv_priv.h  | 44 +++++++++++-----------
 inventory/inv_stobj.c | 86 +++++++++++++++++++++----------------------
 inventory/inventory.h | 12 +++---
 inventory/testmain.c  |  2 +-
 invutil/invidx.c      |  4 +-
 restore/content.c     |  2 +-
 23 files changed, 236 insertions(+), 236 deletions(-)

diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 28dd7d1..dc6d502 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -3098,7 +3098,7 @@ determine_write_error(int nwritten, int saved_errno)
 		(saved_errno == EIO)
 		||
 		((saved_errno == 0) && (nwritten >= 0))          /* short
-	                                                            write indicates EOM */
+	                                                          * write indicates EOM */
 		) {
 		mlog(MLOG_NORMAL,
 		     _("tape media error on write operation\n"));
@@ -4171,9 +4171,9 @@ erase_and_verify(drive_t *drivep)
 
 	/*
 	 * Erase is not standard rmt. So we cannot use the line below.
-
-	   (void)mt_op(contextp->dc_fd, MTERASE, 0);
-
+	 *
+	 * (void)mt_op(contextp->dc_fd, MTERASE, 0);
+	 *
 	 * So write a record of zeros to fake erase . Poor man's erase!
 	 * We put the ERASE_MAGIC string at the beginning so we can
 	 * detect if we have erased the tape.
diff --git a/common/getdents.c b/common/getdents.c
index 0f10741..9c9ed99 100644
--- a/common/getdents.c
+++ b/common/getdents.c
@@ -45,13 +45,13 @@ struct kernel_dirent64 {
 
 /*
  * The problem here is that we cannot simply read the next NBYTES
-   bytes.  We need to take the additional field into account.  We use
-   some heuristic.  Assuming the directory contains names with 14
-   characters on average we can compute an estimated number of entries
-   which fit in the buffer.  Taking this number allows us to specify a
-   reasonable number of bytes to read.  If we should be wrong, we can
-   reset the file descriptor.  In practice the kernel is limiting the
-   amount of data returned much more then the reduced buffer size.  */
+ * bytes.  We need to take the additional field into account.  We use
+ * some heuristic.  Assuming the directory contains names with 14
+ * characters on average we can compute an estimated number of entries
+ * which fit in the buffer.  Taking this number allows us to specify a
+ * reasonable number of bytes to read.  If we should be wrong, we can
+ * reset the file descriptor.  In practice the kernel is limiting the
+ * amount of data returned much more then the reduced buffer size.  */
 int
 getdents_wrap(int fd, char *buf, size_t nbytes)
 {
@@ -77,7 +77,7 @@ getdents_wrap(int fd, char *buf, size_t nbytes)
 
 	/*
 	 * If the structure returned by the kernel is identical to what we
-	   need, don't do any conversions.  */
+	 * need, don't do any conversions.  */
 	if (offsetof(struct dirent, d_name)
 	    == offsetof(struct kernel_dirent64, d_name)
 	    && sizeof(dp->d_ino) == sizeof(kdp->d_ino)
@@ -90,8 +90,8 @@ getdents_wrap(int fd, char *buf, size_t nbytes)
 		const size_t alignment = __alignof__(struct dirent);
 		/*
 		 * Since kdp->d_reclen is already aligned for the kernel
-		   structure this may compute a value that is bigger
-		   than necessary.  */
+		 * structure this may compute a value that is bigger
+		 * than necessary.  */
 		size_t old_reclen = kdp->d_reclen;
 		size_t new_reclen = ((old_reclen - size_diff + alignment - 1)
 				     & ~(alignment - 1));
@@ -105,8 +105,8 @@ getdents_wrap(int fd, char *buf, size_t nbytes)
 		    || (sizeof(dp->d_off) != sizeof(kdp->d_off))) {
 			/*
 			 * Overflow.  If there was at least one entry
-			   before this one, return them without error,
-			   otherwise signal overflow.  */
+			 * before this one, return them without error,
+			 * otherwise signal overflow.  */
 			if (last_offset != -1) {
 				lseek64(fd, last_offset, SEEK_SET);
 				return (char *)dp - buf;
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 4ffc1fd..738edf9 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -45,7 +45,7 @@
 
 /*
  * DMF attribute name, size, and format as stored within XFS. (Stolen directly
-   from "dmfsapi/dmf_dmattr.H".
+ * from "dmfsapi/dmf_dmattr.H".
  */
 
 #define DMF_ATTR_NAME   "SGI_DMI_DMFATTR"       /* name of DMF's attr */
@@ -126,7 +126,7 @@ typedef struct {
 
 /*
  * The following definitions provide the internal format of the hsm_fs_ctxt_t
-   and hsm_f_ctxt_t structures, respectively.
+ * and hsm_f_ctxt_t structures, respectively.
  */
 
 typedef struct  {
@@ -217,7 +217,7 @@ HsmInitFsysContext(
 
 	/*
 	 * Malloc space for a filesystem context, and initialize any fields
-	   needed later by other routines.
+	 * needed later by other routines.
 	 */
 
 	if ((dmf_fs_ctxtp = malloc(sizeof(dmf_fs_ctxt_t))) == NULL) {
@@ -227,7 +227,7 @@ HsmInitFsysContext(
 
 	/*
 	 * Get the filesystem's handle for later use in building file
-	   handles in HsmInitFileContext.
+	 * handles in HsmInitFileContext.
 	 */
 	dmf_fs_ctxtp->fshanp = jdm_getfshandle((char *)mountpoint);
 	if (dmf_fs_ctxtp->fshanp == NULL) {
@@ -321,9 +321,9 @@ HsmEstimateFileSpace(
 	} else {
 		/*
 		 * This code is assuming that there are no MIG files, and so any
-		   file with DMAPI event bits set will be dumped as OFL. The
-		   non-dir dump size estimation will be somewhat low if there
-		   are MIG files.
+		 * file with DMAPI event bits set will be dumped as OFL. The
+		 * non-dir dump size estimation will be somewhat low if there
+		 * are MIG files.
 		 */
 		if ((statp->bs_mode & S_IFMT) != S_IFREG) {
 			return 0;       /* not a regular file */
@@ -486,8 +486,8 @@ HsmInitFileContext(
 
 	/*
 	 * We have a likely candidate, so we have to pay the price and look
-	   for the DMF attribute.  (It could be in a disk block separate from
-	   the inode.)
+	 * for the DMF attribute.  (It could be in a disk block separate from
+	 * the inode.)
 	 */
 	attr_op.am_opcode = ATTR_OP_GET;
 	attr_op.am_error = 0;
@@ -600,9 +600,9 @@ HsmModifyExtentMap(
 
 	/*
 	 * We are dumping a dualstate file.  Make it look like there is only
-	   one getbmapx extent and that it contains a hole which extends from
-	   the current offset to the end of the file.  The bmap[1].bmv_offset
-	   should already be correct.
+	 * one getbmapx extent and that it contains a hole which extends from
+	 * the current offset to the end of the file.  The bmap[1].bmv_offset
+	 * should already be correct.
 	 */
 
 	length = BTOBB(dmf_f_ctxtp->filesize) - bmap[1].bmv_offset;
@@ -670,7 +670,7 @@ HsmFilterExistingAttribute(
 
 	/*
 	 * Remove the existing DMF attribute, as we will later replace it with
-	   our own version.
+	 * our own version.
 	 */
 
 	*skip_entry = 1;
diff --git a/common/inventory.c b/common/inventory.c
index 7346ddd..d7609c0 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -58,7 +58,7 @@ inv_open(inv_predicate_t bywhat, void *pred)
 
 	/*
 	 * XXX also, see if it is too full. if so, make another and leave a
-	   reference to the new file in the old one */
+	 * reference to the new file in the old one */
 
 	stobjfd = get_storageobj(fd, &index);
 	if (stobjfd < 0) {
@@ -81,7 +81,7 @@ inv_open(inv_predicate_t bywhat, void *pred)
 	}
 	/*
 	 * create another storage object (and, an inv_index entry for it too)
-	   if we've filled this one up */
+	 * if we've filled this one up */
 	if ((uint)num >= sescnt->ic_maxnum) {
 #ifdef INVT_DEBUG
 		printf("$ creating a new storage obj & index entry. \n");
@@ -277,7 +277,7 @@ inv_writesession_open(
 
 	/*
 	 * we need to put the new session in the appropriate place in
-	   storage object. So first find out howmany sessions are there */
+	 * storage object. So first find out howmany sessions are there */
 
 	INVLOCK(fd, LOCK_EX);
 	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
@@ -289,7 +289,7 @@ inv_writesession_open(
 
 	/*
 	 * create the writesession, and get ready for the streams to come
-	   afterwards */
+	 * afterwards */
 	rval = create_session(sestok, fd, sescnt, ses, &hdr);
 	assert(rval > 0);
 
@@ -463,7 +463,7 @@ inv_stream_close(
 
 	/*
 	 * get the last media file to figure out what our last ino was.
-	   we have a pointer to that in the stream token */
+	 * we have a pointer to that in the stream token */
 	if (tok->md_lastmfile) {
 		if (strm.st_endino.ino != tok->md_lastmfile->mf_endino.ino ||
 		    strm.st_endino.offset != tok->md_lastmfile->mf_endino.offset) {
@@ -530,8 +530,8 @@ inv_put_mediafile(
 
 	/*
 	 * we dont free the mfile here. we always keep the last mfile
-	   around, inside the inv_stmtoken, and when we add a new mfile,
-	   we free the previous one. The last one is freed in stream_close()
+	 * around, inside the inv_stmtoken, and when we add a new mfile,
+	 * we free the previous one. The last one is freed in stream_close()
 	 */
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
@@ -636,7 +636,7 @@ inv_get_session(
 
 	/*
 	 * First get the session header, and the session information. Then
-	   we can figure out how much space to allocate */
+	 * we can figure out how much space to allocate */
 }
 
 
diff --git a/common/inventory.h b/common/inventory.h
index 7f81643..6d7c94e 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -82,8 +82,8 @@ typedef struct inv_stream {
 	xfs_ino_t	st_startino;    /* the starting pt */
 	off64_t		st_startino_off;
 	xfs_ino_t	st_endino;      /* where we actually ended up. this means
-	                                   we've written upto but not including
-	                                   this breakpoint. */
+	                                 * we've written upto but not including
+	                                 * this breakpoint. */
 	off64_t		st_endino_off;
 	int		st_nmediafiles; /* number of mediafiles */
 } inv_stream_t;
@@ -104,7 +104,7 @@ typedef struct inv_session {
 	time32_t	s_time;                 /* time of the dump */
 	u_char		s_level;                /* dump level */
 	char		s_label[INV_STRLEN];    /* session label, assigned by the
-	                                           operator */
+	                                         * operator */
 	char		s_mountpt[INV_STRLEN];  /* path to the mount point */
 	char		s_devpath[INV_STRLEN];  /* path to the device */
 } inv_session_t;
diff --git a/common/main.c b/common/main.c
index 16dee52..ee3c2bd 100644
--- a/common/main.c
+++ b/common/main.c
@@ -780,9 +780,9 @@ main(int argc, char *argv[])
 					(void)sigint_dialog();
 				}
 				/*
-				   mlog(MLOG_NORMAL,
-				      _("session interrupt in progress: "
-				      "please wait\n"));
+				 * mlog(MLOG_NORMAL,
+				 *    _("session interrupt in progress: "
+				 *    "please wait\n"));
 				 */
 			} else {
 				if (dlog_allowed()) {
diff --git a/common/media.c b/common/media.c
index bb7835f..c1d2b27 100644
--- a/common/media.c
+++ b/common/media.c
@@ -138,8 +138,8 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)
 	if (! medialabel) {
 		/*
 		 * not useful
-		   mlog(MLOG_VERBOSE,
-		      _("WARNING: no media label specified\n"));
+		 * mlog(MLOG_VERBOSE,
+		 *    _("WARNING: no media label specified\n"));
 		 */
 		medialabel = "";
 	}
diff --git a/common/ts_mtio.h b/common/ts_mtio.h
index 87faa15..5487a3f 100644
--- a/common/ts_mtio.h
+++ b/common/ts_mtio.h
@@ -92,7 +92,7 @@ typedef unsigned int minor_t;
 #define MTSCSI_CIPHER_SEC_OFF   0x6002  /* disable recovered error report */
 /*
  * These are meaningful only for Exabyte.  Default is to return
-        errors if read length is less than the block length */
+ *      errors if read length is less than the block length */
 #define MTSCSI_SILI             0x6003  /* suppress illegal length indication */
 #define MTSCSI_EILI             0x6004  /* enable illegal length indication.
 	                                 * currently implemented only for
@@ -242,27 +242,27 @@ struct  mtvid {
 };
 
 /*	structure for MTIOCGETBLKINFO - all quantities in bytes.
-        A value of 0 indicates no limit
-        When using the variable block size device, the lastread
-        field is determined by reading one block and then spacing
-        backwards, if no i/o has yet been done to this tape.  Unlike
-        MTIOCGETBLKSIZE, all quantities are in bytes.
+ *      A value of 0 indicates no limit
+ *      When using the variable block size device, the lastread
+ *      field is determined by reading one block and then spacing
+ *      backwards, if no i/o has yet been done to this tape.  Unlike
+ *      MTIOCGETBLKSIZE, all quantities are in bytes.
  */
 struct mtblkinfo {
 	unsigned	minblksz;       /* minimum block size */
 	unsigned	maxblksz;       /* maximum block size */
 	unsigned	curblksz;       /* size of block at last i/o.  For fixed
-	                                   mode, all requests must be a multiple of this. */
+	                                 * mode, all requests must be a multiple of this. */
 	unsigned	recblksz;       /* "recommended" size for i/o.  Mostly
-	                                   based on compatibility with earlier releases and/or
-	                                   other vendors */
+	                                 * based on compatibility with earlier releases and/or
+	                                 * other vendors */
 };
 
 
 /*	structure for MTSCSI_RDLOG
-        The fields in this structure reflect the values required in
-        the SCSI Log Sense command.  See a product manual for an
-        explanation of the fields.
+ *      The fields in this structure reflect the values required in
+ *      the SCSI Log Sense command.  See a product manual for an
+ *      explanation of the fields.
  */
 
 #define MTSCSI_LOGLEN   4096
@@ -329,7 +329,7 @@ struct mtaudio {
 	uchar_t			zero2	: 4, pno2 : 4;  /* fields should always be 0, or 0xA, when the */
 	uchar_t			zero3	: 4, pno3 : 4;  /* pno field is also 0xA, indicating not valid */
 	uchar_t			indexhi : 4, index : 4; /* index number within program; hi is the
-	                                                   most significant BCD digit, index the least. */
+	                                                 * most significant BCD digit, index the least. */
 	struct mtaudtimecode	ptime;                  /* program time */
 	struct mtaudtimecode	atime;                  /* absolute time */
 	struct mtaudtimecode	rtime;                  /* running time */
@@ -341,9 +341,9 @@ struct mtaudio {
 /* structure for MTCAPABILITY */
 struct mt_capablity {
 	int	mtsubtype;      /* this is NOT the same as mt_type, this is
-	                           the actual tape type, from invent.h, such as 9track, or DAT;
-	                           otherwise it is difficult to associate a particular device
-	                           with its type from a program. */
+	                         * the actual tape type, from invent.h, such as 9track, or DAT;
+	                         * otherwise it is difficult to associate a particular device
+	                         * with its type from a program. */
 	uint_t	mtcapablity;    /* the MTCAN* bits */
 	uint_t	mtfuture[8];    /* for future additions */
 };
@@ -355,21 +355,21 @@ struct mt_capablity {
 
 /*
  *      values for mt_dposn; values chosen for compatiblity with
-        existing programs!  Note that these bits and the gaps between
-        are also used in tpsc.h */
+ *      existing programs!  Note that these bits and the gaps between
+ *      are also used in tpsc.h */
 
 /*
  * The expected relative behaviour of MT_EW, MT_EOT and MTANSI can be
-   described as follows.
-   - writing from BOT, with MTANSI disabled, when LEOT is encountered,
-     MT_EW and MT_EOT are set. If MTANSI is now enabled, MT_EOT will be
-     reset and writing will be permitted until PEOT is encountered,
-     whereupon MT_EOT will again be set and will remain so until the
-     tape is repositioned.
-   - reading from BOT, MT_EOT will be set when PEOT is
-     encountered. LEOT is not normally reported by the drive, and therefore
-     MT_EW will normally not be set, unless the drive supports the REW mode
-     bit. (few do)
+ * described as follows.
+ * - writing from BOT, with MTANSI disabled, when LEOT is encountered,
+ *   MT_EW and MT_EOT are set. If MTANSI is now enabled, MT_EOT will be
+ *   reset and writing will be permitted until PEOT is encountered,
+ *   whereupon MT_EOT will again be set and will remain so until the
+ *   tape is repositioned.
+ * - reading from BOT, MT_EOT will be set when PEOT is
+ *   encountered. LEOT is not normally reported by the drive, and therefore
+ *   MT_EW will normally not be set, unless the drive supports the REW mode
+ *   bit. (few do)
  */
 
 #define MT_EOT          0x01    /* tape is at end of media */
@@ -614,12 +614,12 @@ struct mt_capablity {
 #define MTCAN_SEEK      0x20000         /* drive supports seeking to a particular
 	                                 * block (or sometimes program # if AUDIO supported) */
 #define MTCAN_CHTYPEANY 0x40000         /* drive can change density
-	                                   and/or fixed to variable at any point (if it can change at all).
-	                                   Otherwise it can change only at BOT */
+	                                 * and/or fixed to variable at any point (if it can change at all).
+	                                 * Otherwise it can change only at BOT */
 #define MTCANT_IMM      0x80000         /* drive doesn't work correctly when
-	                                   immediate mode rewind, etc. is enabled.  Setting this bit
-	                                   will disable immediate mode rewind on the drive, independent
-	                                   of the setting of tpsc_immediate_rewind (in master.d/tpsc) */
+	                                 * immediate mode rewind, etc. is enabled.  Setting this bit
+	                                 * will disable immediate mode rewind on the drive, independent
+	                                 * of the setting of tpsc_immediate_rewind (in master.d/tpsc) */
 #define MTCAN_COMPRESS  0x100000        /* drive supports compression */
 #define MTCAN_BUFFM     0x200000        /* drive supports writing of
 	                                 * buffered filemarks */
@@ -672,11 +672,11 @@ struct mt_fpmsg {
 			char	msg_type	: 3,    /* Message type: 0x00 = General
 			                                 * Status message */
 				msg_cntrl	: 3,    /* Message control:
-			                                   0 = Display message 0
-			                                   1 = Display message 1
-			                                   2 = Flash message 0
-			                                   3 = Flash message 1
-			                                   4 = Alternate message 0 and 1
+			                                 * 0 = Display message 0
+			                                 * 1 = Display message 1
+			                                 * 2 = Flash message 0
+			                                 * 3 = Flash message 1
+			                                 * 4 = Alternate message 0 and 1
 			                                 */
 				rsvd1 : 2;
 			char	rsvd2[4];
diff --git a/dump/content.c b/dump/content.c
index ddda3df..64f6029 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -172,8 +172,8 @@ struct context {
 	hsm_f_ctxt_t *	cc_hsm_f_ctxtp;
 	/*
 	 * pre-allocated HSM context used for holding HSM
-	   state information about a file across subroutine
-	   calls.
+	 * state information about a file across subroutine
+	 * calls.
 	 */
 	char *		cc_readlinkbufp;
 	size_t		cc_readlinkbufsz;
@@ -4139,7 +4139,7 @@ dump_file(void *		arg1,
 		return RV_OK;
 		/*
 		 * not yet implemented
-		   case S_IFMNT:
+		 * case S_IFMNT:
 		 */
 	}
 
diff --git a/dump/inomap.c b/dump/inomap.c
index 44d3724..12b3d2c 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -1790,7 +1790,7 @@ estimate_dump_space(xfs_bstat_t *statp)
 	case S_IFLNK:
 		/*
 		 * not yet
-		   case S_IFUUID:
+		 * case S_IFUUID:
 		 */
 		return 0;
 	default:
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 3d684f2..2494978 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -63,7 +63,7 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 
 	/*
 	 * if we just want to search the db, all we need is the invidx.
-	   at this point, we know that a tok wasnt created in init_idb() */
+	 * at this point, we know that a tok wasnt created in init_idb() */
 	if (forwhat == INV_SEARCH_ONLY) {
 		/* fd == I_EMPTYINV or fd == valid fd */
 		tok = get_token(fd, -1);
@@ -73,7 +73,7 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 
 	/*
 	 * XXX also, see if it is too full. if so, make another and leave a
-	   reference to the new file in the old one */
+	 * reference to the new file in the old one */
 
 	stobjfd = idx_get_stobj(fd, forwhat, &index);
 	if (stobjfd < 0) {
@@ -96,7 +96,7 @@ inv_open(inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred)
 
 	/*
 	 * create another storage object (and, an inv_index entry for it
-	   too) if we've filled this one up */
+	 * too) if we've filled this one up */
 
 	if ((uint)num >= sescnt->ic_maxnum) {
 		mlog(MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
@@ -216,7 +216,7 @@ inv_writesession_open(
 
 	/*
 	 * we need to put the new session in the appropriate place in
-	   storage object. So first find out howmany sessions are there */
+	 * storage object. So first find out howmany sessions are there */
 
 	INVLOCK(fd, LOCK_EX);
 	if (GET_SESCOUNTERS(fd, &sescnt) < 0) {
@@ -227,7 +227,7 @@ inv_writesession_open(
 
 	/*
 	 * create the writesession, and get ready for the streams to come
-	   afterwards */
+	 * afterwards */
 	rval = stobj_create_session(sestok, fd, sescnt, &ses, &hdr);
 	assert(rval > 0);
 
@@ -397,7 +397,7 @@ inv_stream_close(
 
 		/*
 		 * get the last media file to figure out what our last
-		   ino was. we have a pointer to that in the stream token */
+		 * ino was. we have a pointer to that in the stream token */
 		if (tok->md_lastmfile) {
 			if (strm.st_endino.ino !=
 			    tok->md_lastmfile->mf_endino.ino ||
@@ -475,8 +475,8 @@ inv_put_mediafile(
 
 	/*
 	 * This flag is used to indicate the media file that contains the
-	   dump of the sessioninfo structure that contains all but this
-	   media file */
+	 * dump of the sessioninfo structure that contains all but this
+	 * media file */
 	if (isinvdump)
 		mf->mf_flag |= INVT_MFILE_INVDUMP;
 
@@ -486,8 +486,8 @@ inv_put_mediafile(
 
 	/*
 	 * we dont free the mfile here. we always keep the last mfile
-	   around, inside the inv_stmtoken, and when we add a new mfile,
-	   we free the previous one. The last one is freed in stream_close()
+	 * around, inside the inv_stmtoken, and when we add a new mfile,
+	 * we free the previous one. The last one is freed in stream_close()
 	 */
 
 	return (rval < 0) ? BOOL_FALSE : BOOL_TRUE;
@@ -531,7 +531,7 @@ inv_get_sessioninfo(
 
 	/*
 	 * Next we get the session header, and the session information. Then
-	   we can figure out how much space to allocate */
+	 * we can figure out how much space to allocate */
 	if (stobj_get_sessinfo(tok, &hdr, &ses) <= 0) {
 		INVLOCK(fd, LOCK_UN);
 		return BOOL_FALSE;
@@ -766,22 +766,22 @@ inv_delete_mediaobj(uuid_t *moid)
 
 	/*
 	 * forall fsids (fs) in fstab {
-	       open invindex table (t)
-	       forall indices (i) in t {
-	          open stobj (st)
-	          forall sessions (s) in st {
-	              forall streams (strm) in s {
-	                 forall mediafiles (m) in strm {
-	                     if (m.mediaobj == moid) {
-	                     // delete m
-	                     if (--strm.nmediafiles == 0)
-	                        if (--s.nstreams == 0)
-	                            delete-session (s)
-	                     }
-	                 }
-	              }
-	         }
-	      }
+	 *     open invindex table (t)
+	 *     forall indices (i) in t {
+	 *        open stobj (st)
+	 *        forall sessions (s) in st {
+	 *            forall streams (strm) in s {
+	 *               forall mediafiles (m) in strm {
+	 *                   if (m.mediaobj == moid) {
+	 *                   // delete m
+	 *                   if (--strm.nmediafiles == 0)
+	 *                      if (--s.nstreams == 0)
+	 *                          delete-session (s)
+	 *                   }
+	 *               }
+	 *            }
+	 *       }
+	 *    }
 	 */
 
 	invt_counter_t *cnt;
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 00e8d1a..340c75e 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -221,7 +221,7 @@ get_lastheader(int fd, void **ent, size_t hdrsz, size_t cntsz)
 
 	/*
 	 * if there's space anywhere at all, then it must be in the last
-	   entry */
+	 * entry */
 	*ent = malloc(hdrsz);
 	pos = (char *)arr + ((uint)nindices - 1) * hdrsz;
 	memcpy(*ent, pos, hdrsz);
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 17ff6d7..3f1cbf0 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -74,7 +74,7 @@ fstab_getall(invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 #endif
 	/*
 	 * fstab is left locked EX on exit. The caller takes does
-	   the unlocking */
+	 * the unlocking */
 	return fd;
 }
 
@@ -122,7 +122,7 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 		for (i = 0; i < numfs; i++) {
 			if (uuid_compare(*fsidp, arr[i].ft_uuid) == 0) {
 /*			if ((STREQL(arr[i].ft_mountpt, mntpt) ) &&
-                            (STREQL(arr[i].ft_devpath, dev) ))
+ *                          (STREQL(arr[i].ft_devpath, dev) ))
  */
 				free(arr);
 				free(cnt);
@@ -136,7 +136,7 @@ fstab_put_entry(uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat)
 
 	/*
 	 * make a new fstab entry and insert it at the end. the table
-	   is locked EXclusively at this point */
+	 * is locked EXclusively at this point */
 	{
 		invt_fstab_t ent;
 		off64_t hoff;
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 907cab3..edafe28 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -53,11 +53,11 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 
 /*	invt_entry_t ient;
-        ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = tm; */
+ *      ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = tm; */
 
 	/*
 	 * If time period of the new entry is before our first invindex,
-	   we have to insert a new invindex in the first slot */
+	 * we have to insert a new invindex in the first slot */
 	if (iarr[0].ie_timeperiod.tp_start > tm) {
 		/* *stobjfd = idx_put_newentry(fd, 0, iarr, icnt, &ient); */
 		*stobjfd = open(iarr[0].ie_filename, INV_OFLAG(forwhat));
@@ -67,7 +67,7 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 	for (i = 0; i < icnt->ic_curnum; i++) {
 		/*
 		 * if our time is nicely within an existing entry's time
-		   period, hellalujah */
+		 * period, hellalujah */
 		if (IS_WITHIN(&iarr[i].ie_timeperiod, tm)) {
 #ifdef INVT_DEBUG
 			mlog(MLOG_DEBUG | MLOG_INV, "INV: is_within %d\n", i);
@@ -102,21 +102,21 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 
 		/*
 		 * if it is beyond the end of this timeperiod, see if we
-		   belong to a timeperiod that doesn't have an entry */
+		 * belong to a timeperiod that doesn't have an entry */
 		if (iarr[i].ie_timeperiod.tp_end < tm) {
 			/* see if we're the last entry here */
 			if (i == icnt->ic_curnum - 1) {
 				/*
 				 * our slot is (i+1)th entry. Make the
-				   timeperiod's the same as it was. As far
-				   as I can see there is no way that
-				   timeperiods can overlap.
-
-				   insert the new entry and write back
-				   icnt and invindex entry */
+				 * timeperiod's the same as it was. As far
+				 * as I can see there is no way that
+				 * timeperiods can overlap.
+				 *
+				 * insert the new entry and write back
+				 * icnt and invindex entry */
 				/*
 				 * *stobjfd = idx_put_newentry(fd, i+1, iarr,
-				                             icnt, &ient); */
+				 *                           icnt, &ient); */
 				*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 				return i;
 			}
@@ -124,10 +124,10 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 			if (iarr[i + 1].ie_timeperiod.tp_start > tm) {
 				/*
 				 * We have the option of pushing entries
-				   after (i) forward by one slot, and
-				   taking the (i+1)th slot, OR just hooking
-				   up with the next entry.
-				   We choose the former. */
+				 * after (i) forward by one slot, and
+				 * taking the (i+1)th slot, OR just hooking
+				 * up with the next entry.
+				 * We choose the former. */
 
 				/* the timeperiods had better not overlap */
 				assert((tm > iarr[i].ie_timeperiod.tp_end) &&
@@ -135,11 +135,11 @@ idx_insert_newentry(int fd,             /* kept locked EX by caller */
 
 				/*
 				 * shift everything from (i+1) onwards by
-				   one. Then insert the new entry and write
-				   back icnt and invindex entries */
+				 * one. Then insert the new entry and write
+				 * back icnt and invindex entries */
 				/*
 				 * *stobjfd = idx_put_newentry(fd, i+1, iarr,
-				                             icnt, &ient); */
+				 *                           icnt, &ient); */
 				*stobjfd = open(iarr[i].ie_filename, INV_OFLAG(forwhat));
 				return i;
 			}
@@ -224,8 +224,8 @@ idx_find_stobj(invt_idxinfo_t * idx,
 
 	/*
 	 * since sessions can be inserted in random order, the invindex
-	   table can contain time-periods that don't have corresponding
-	   entries for */
+	 * table can contain time-periods that don't have corresponding
+	 * entries for */
 	if (GET_ALLHDRS_N_CNTS_NOLOCK(idx->invfd, (void **)&idx->iarr,
 				      (void **)&idx->icnt,
 				      sizeof(invt_entry_t),
@@ -240,7 +240,7 @@ idx_find_stobj(invt_idxinfo_t * idx,
 
 	/*
 	 * Now figure out where we are going to insert this stobj among the
-	   invindices and put it there */
+	 * invindices and put it there */
 	idx->index = idx_insert_newentry(idx->invfd, &stobjfd, idx->iarr,
 					 idx->icnt, tm);
 
@@ -266,7 +266,7 @@ idx_create(char *fname, inv_oflag_t forwhat)
 
 	/*
 	 * This is not to be called when the user wants to open
-	   the db for SEARCH_ONLY. */
+	 * the db for SEARCH_ONLY. */
 	assert(forwhat != INV_SEARCH_ONLY);
 
 	if ((fd = open(fname, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
@@ -377,9 +377,9 @@ idx_put_sesstime(inv_sestoken_t tok, bool_t whichtime)
 
 /*
  * an inventory index entry keeps track of a single storage object;
-   it knows about its name (ie filename) and the timeperiod that the
-   it contains dump sessions for.
-   note that each file system has its own (set of) inventory indices.
+ * it knows about its name (ie filename) and the timeperiod that the
+ * it contains dump sessions for.
+ * note that each file system has its own (set of) inventory indices.
  */
 
 /*----------------------------------------------------------------------*/
@@ -433,7 +433,7 @@ idx_create_entry(
 
 		/*
 		 * XXX check if there are too many indices. if so, create
-		   another and leave a pointer to that in here */
+		 * another and leave a pointer to that in here */
 
 		/* create the new storage object */
 		fd = stobj_create(ent.ie_filename);
@@ -483,7 +483,7 @@ idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index)
 
 	/*
 	 * if there's space anywhere at all, then it must be in the last
-	   entry. get_lastheader() does the locking */
+	 * entry. get_lastheader() does the locking */
 
 	if ((*index = get_lastheader(invfd, (void **)&ent,
 				     sizeof(invt_entry_t),
@@ -491,7 +491,7 @@ idx_get_stobj(int invfd, inv_oflag_t forwhat, int *index)
 		return -1;
 	/*
 	 * at this point we know that there should be at least one invindex
-	   entry present */
+	 * entry present */
 	assert(ent != NULL);
 	assert(ent->ie_filename);
 
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index e332295..2ac1323 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -59,7 +59,7 @@ init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 
 	/*
 	 * come up with the unique file suffix that refers to this
-	   filesystem */
+	 * filesystem */
 	if (fstab_get_fname(pred, uuname, bywhat, forwhat) < 0) {
 		return I_DONE;
 	}
@@ -76,7 +76,7 @@ init_idb(void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat,
 		} else {
 			/*
 			 * this happens when the inv is empty and the user
-			   wants to do a search. this is legal - not an error */
+			 * wants to do a search. this is legal - not an error */
 			return I_EMPTYINV;
 		}
 		return I_DONE; /* we are done whether token's NULL or not */
@@ -209,7 +209,7 @@ invmgr_query_all_sessions(
 
 	/*
 	 * return val indicates if there was an error or not. *buf
-	   says whether the search was successful */
+	 * says whether the search was successful */
 	return ret;
 }
 
@@ -260,7 +260,7 @@ search_invt(
 
 	/*
 	 * we need to get all the invindex headers and seshdrs in reverse
-	   order */
+	 * order */
 	for (i = nindices - 1; i >= 0; i--) {
 		int nsess, j;
 		invt_sescounter_t *scnt = NULL;
@@ -292,7 +292,7 @@ search_invt(
 
 			/*
 			 * fd is kept locked until we return from the
-			   callback routine */
+			 * callback routine */
 
 			/*
 			 * Check to see if this session has been pruned
@@ -405,7 +405,7 @@ invmgr_inv_print(
 		for (s = 0; s < nsess; s++) {
 			/*
 			 * fd is kept locked until we return from the
-			   callback routine */
+			 * callback routine */
 
 			/*
 			 * Check to see if this session has been pruned
@@ -630,11 +630,11 @@ insert_session(invt_sessinfo_t *s)
 
 	/*
 	 * at this point we know that invindex has at least one entry
-
-	   First we need to find out if this session is in the inventory
-	   already. To find the storage object that can possibly
-	   contain this session, it suffices to sequentially search the
-	   inventory indices of this filesystem for the particular invt-entry
+	 *
+	 * First we need to find out if this session is in the inventory
+	 * already. To find the storage object that can possibly
+	 * contain this session, it suffices to sequentially search the
+	 * inventory indices of this filesystem for the particular invt-entry
 	 */
 	INVLOCK(invfd, LOCK_EX);
 	idx.invfd = invfd;
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index 7260da7..26bf8bd 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -317,7 +317,7 @@ oref_resolve(
 
 	/*
 	 * come up with the unique file suffix that refers to this
-	   filesystem */
+	 * filesystem */
 	if (fstab_get_fname(pred, uuname, bywhat) < 0) {
 		return INV_ERR;
 	}
@@ -355,7 +355,7 @@ oref_resolve(
 
 	/*
 	 * create another storage object (and, an inv_index entry for it
-	   too) if we've filled this one up */
+	 * too) if we've filled this one up */
 	if (OREF_CNT_CURNUM(stobj) >= OREF_CNT_MAXNUM(stobj)) {
 		int rval;
 #ifdef INVT_DEBUG
@@ -401,7 +401,7 @@ oref_resolve_child(
 
 	/*
 	 * at this point we know that there should be at least one invindex
-	   entry present */
+	 * entry present */
 	assert(ent != NULL);
 	assert(ent->ie_filename);
 
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 7de9441..f5c9515 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -40,7 +40,7 @@
 
 /*
  * Indicates if either its child or its parent has been resolved.
-   Only one kin per object can exist. i.e. a child cant have children.*/
+ * Only one kin per object can exist. i.e. a child cant have children.*/
 #define INVT_RES_CHILD          0x1000
 #define INVT_RES_PARENT         0x2000
 #define INVT_RES_KIN            INVT_RES_PARENT | INVT_RES_CHILD
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 63fd785..1cd90f9 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -109,16 +109,16 @@ typedef struct invt_session {
 	char	s_mountpt[INV_STRLEN];  /* path to the mount point */
 	char	s_devpath[INV_STRLEN];  /* path to the device */
 	uint	s_cur_nstreams;         /* number of streams created under
-	                                   this session so far */
+	                                 * this session so far */
 	uint	s_max_nstreams;         /* number of media streams in
-	                                   the session */
+	                                 * the session */
 	char	s_padding[16];
 } invt_session_t;
 
 typedef struct invt_seshdr {
 	off64_t		sh_sess_off;    /* offset to rest of the sessioninfo */
 	off64_t		sh_streams_off; /* offset to start of the set of
-	                                   stream hdrs */
+	                                 * stream hdrs */
 	time32_t	sh_time;        /* time of the dump */
 	uint32_t	sh_flag;        /* for misc flags */
 	u_char		sh_level;       /* dump level */
@@ -129,10 +129,10 @@ typedef struct invt_seshdr {
 
 /*
  * Each session consists of a number of media streams. While it is given that
-   there won't be multiple writesessions (ie. dumpsessions) concurrently,
-   there can be multiple media streams operating on a single file system,
-   each writing media files within its own stream. Hence, we have a linked
-   list of media files, that the stream keeps track of. */
+ * there won't be multiple writesessions (ie. dumpsessions) concurrently,
+ * there can be multiple media streams operating on a single file system,
+ * each writing media files within its own stream. Hence, we have a linked
+ * list of media files, that the stream keeps track of. */
 
 
 typedef struct invt_breakpt {
@@ -144,8 +144,8 @@ typedef struct invt_stream {
 	/* duplicate info from mediafiles for speed */
 	invt_breakpt_t	st_startino;            /* the starting pt */
 	invt_breakpt_t	st_endino;              /* where we actually ended up. this
-	                                           means we've written upto but not
-	                                           including this breakpoint. */
+	                                         * means we've written upto but not
+	                                         * including this breakpoint. */
 	off64_t		st_firstmfile;          /*offsets to the start and end of*/
 	off64_t		st_lastmfile;           /* .. linked list of mediafiles */
 	char		st_cmdarg[INV_STRLEN];  /* drive path */
@@ -161,7 +161,7 @@ typedef struct invt_mediafile {
 	char		mf_label[INV_STRLEN];   /* media file label */
 	invt_breakpt_t	mf_startino;            /* file that we started out with */
 	invt_breakpt_t	mf_endino;              /* the dump file we ended this
-	                                           media file with */
+	                                         * media file with */
 	off64_t		mf_nextmf;              /* links to other mfiles */
 	off64_t		mf_prevmf;
 	uint		mf_mfileidx;            /* index within the media object */
@@ -187,9 +187,9 @@ typedef struct invt_entry {
 #define INVT_COUNTER_FIELDS  \
 	uint32_t ic_vernum;     /* on disk version number for posterity */ \
 	uint ic_curnum;         /* number of sessions/invindices recorded \
-	                           so far */                              \
+	                         * so far */                              \
 	uint ic_maxnum;         /* maximum number of sessions/inv_indices \
-	                           that we can record on this stobj */
+	                         * that we can record on this stobj */
 #define INVT_COUNTER_FIELDS_SIZE 0xc
 
 typedef struct invt_counter {
@@ -200,7 +200,7 @@ typedef struct invt_counter {
 typedef struct invt_sescounter {
 	INVT_COUNTER_FIELDS
 	off64_t ic_eof;          /* current end of the file, where the next
-	                            media file or stream will be written to */
+	                         *  media file or stream will be written to */
 	char	ic_padding[0x20 - (INVT_COUNTER_FIELDS_SIZE +
 				   sizeof(off64_t))];
 } invt_sescounter_t;
@@ -223,12 +223,12 @@ typedef struct invt_desc_entry {
 	int		d_invindex_fd;  /* open file descriptor of inv index */
 	int		d_stobj_fd;     /* fd of storage object */
 	u_char		d_update_flag;  /* indicates whether fstab was updated with
-	                                   this file system or not and also if
-	                                   we had to create a new invindex file */
+	                                 * this file system or not and also if
+	                                 * we had to create a new invindex file */
 	inv_oflag_t	d_oflag;        /* the open mode (SEARCH_ONLY, SEARCH_N_MOD) */
 	off64_t		d_invindex_off; /* for every session, we need a reference
-	                                   to its invindex entry, so that when we
-	                                   close a session, we know which one */
+	                                 * to its invindex entry, so that when we
+	                                 * close a session, we know which one */
 } invt_desc_entry_t;
 
 
@@ -237,7 +237,7 @@ typedef struct invt_sesdesc_entry {
 	off64_t			sd_session_off;
 	off64_t			sd_sesshdr_off;
 	time32_t		sd_sesstime; /* time that session started.
-	                                        needed for closing the session */
+	                                      * needed for closing the session */
 } invt_sesdesc_entry_t;
 
 struct invt_mediafile;
@@ -245,11 +245,11 @@ struct invt_mediafile;
 typedef struct invt_strdesc_entry {
 	invt_sesdesc_entry_t *	md_sesstok;     /* the session token */
 	off64_t			md_stream_off;  /* offset to the media stream
-	                                           header */
+	                                         * header */
 	struct invt_mediafile * md_lastmfile;   /* just so that we dont have
-	                                           to get it back from disk
-	                                           when we add the next mfile
-	                                           to the linked list */
+	                                         * to get it back from disk
+	                                         * when we add the next mfile
+	                                         * to the linked list */
 } invt_strdesc_entry_t;
 
 
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 6956850..648f53d 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -62,7 +62,7 @@ stobj_insert_session(invt_idxinfo_t *	idx,
 
 	/*
 	 * Check the existing sessions to make sure that we're not
-	   duplicating this session */
+	 * duplicating this session */
 	if (sescnt->ic_curnum > 0) {
 		uint i;
 		invt_session_t *sessions = calloc(sescnt->ic_curnum,
@@ -139,9 +139,9 @@ stobj_find_splitpoint(int fd, invt_seshdr_t *harr, uint ns, time32_t tm)
 
 	/*
 	 * All the entries have the same sh_time. It's not clear if that's
-	   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. */
+	 * 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, _(
 		     "INV: failed to find a different sh_time to split\n")
 	     );
@@ -193,8 +193,8 @@ 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. */
+	 * 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)
 		return -1;
@@ -205,7 +205,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 
 		/*
 		 * We dont need to split. So, just put the new session in
-		   the new stobj, and rest in peace */
+		 * the new stobj, and rest in peace */
 		idx->index++;
 
 		if (GET_SESCOUNTERS(newsess->stobjfd, &scnt) < 0)
@@ -236,7 +236,7 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 			return -1;
 		/*
 		 * Now we need to put this in the new StObj. So, first
-		   unpack it. */
+		 * unpack it. */
 		if (! stobj_unpack_sessinfo(bufpp, bufszp, &sesinfo))
 			return -1;
 
@@ -253,9 +253,9 @@ stobj_split(invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	}
 	/*
 	 * 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 */
+	 * 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);
@@ -288,13 +288,13 @@ stobj_delete_sessinfo(int fd, /* kept locked EX by caller */
 {
 	/*
 	 * we change the sescnt here, but dont write it back to disk
-	   until later */
+	 * until later */
 	sescnt->ic_curnum--;
 
 	/*
 	 * there is really no need to take out / zero out the deleted
-	   session. The seshdr and session will be over-written, but
-	   space taken by the streams and mediafiles will be wasted. */
+	 * session. The seshdr and session will be over-written, but
+	 * space taken by the streams and mediafiles will be wasted. */
 	return BOOL_TRUE;
 }
 
@@ -336,7 +336,7 @@ stobj_put_session(
 
 	/*
 	 * we need to know where the streams begin, and where the
-	   media files will begin, at the end of the streams */
+	 * media files will begin, at the end of the streams */
 	hdr->sh_streams_off = sescnt->ic_eof;
 
 	if (strms == NULL) {
@@ -468,7 +468,7 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 
 		/*
 		 * adjust the offsets of the first and the last elements
-		   in the mediafile chain */
+		 * in the mediafile chain */
 		mfiles[nmfiles].mf_prevmf = 0;
 		nmfiles += strms[i].st_nmediafiles;
 		mfiles[nmfiles - 1].mf_nextmf = 0;
@@ -612,8 +612,8 @@ 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 */
+	 * so, we first read the sescounter that is at the top of this
+	 * storage object */
 	if (GET_SESCOUNTERS(fd, &sescnt) < 0)
 		return -1;
 
@@ -627,8 +627,8 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 
 	/*
 	 * 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 */
+	 * 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)
@@ -636,9 +636,9 @@ stobj_put_mediafile(inv_stmtoken_t tok, invt_mediafile_t *mf)
 
 	/*
 	 * 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 */
+	 * 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)
 			stream.st_startino = mf->mf_startino;
@@ -771,13 +771,13 @@ stobj_pack_sessinfo(int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 
 	/*
 	 * 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) */
+	 * either in the seshdr or in the mediafiles, because we don't need
+	 * 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 :) */
+	 * earthquake or something :) */
 	strcpy(sesbuf, INVTSESS_COOKIE);
 	sesbuf += (size_t)(strlen(INVTSESS_COOKIE) * sizeof(char));
 
@@ -860,7 +860,7 @@ stobj_getsession_byuuid(
 
 	/*
 	 * yay. we found the session. so, make the session struct and
-	   put it in the buffer */
+	 * put it in the buffer */
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
 	return BOOL_TRUE;
@@ -896,7 +896,7 @@ stobj_getsession_bylabel(
 
 	/*
 	 * yay. we found the session. so, make the session struct and
-	   put it in the buffer */
+	 * put it in the buffer */
 	stobj_copy_invsess(fd, hdr, &ses, (inv_session_t **)buf);
 
 	return BOOL_TRUE;
@@ -950,7 +950,7 @@ stobj_delete_mobj(int			fd,
 		     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.
+ *  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,
@@ -964,7 +964,7 @@ stobj_delete_mobj(int			fd,
 
 		/*
 		 * We have all the media files of this stream. Make another
-		   pass, checking to see if we need to remove any mfiles */
+		 * pass, checking to see if we need to remove any mfiles */
 		dirty = BOOL_FALSE;
 
 		for (j = 0; j < nmfiles; j++) {
@@ -976,14 +976,14 @@ stobj_delete_mobj(int			fd,
 
 /*
  *                                dirty = BOOL_TRUE;
-
-                                if (j == 0)
-                                       strms[i].st_firstmfile = mf->mf_nextmf;
-                                else
-                                       mfiles[j-1].mf_nextmf = mf->mf_nextmf;
-
-                                if (j == nmfiles - 1)
-                                       strms[i].st_lastmfile =;
+ *
+ *                              if (j == 0)
+ *                                     strms[i].st_firstmfile = mf->mf_nextmf;
+ *                              else
+ *                                     mfiles[j-1].mf_nextmf = mf->mf_nextmf;
+ *
+ *                              if (j == nmfiles - 1)
+ *                                     strms[i].st_lastmfile =;
  */
 			}
 		}
@@ -1023,7 +1023,7 @@ stobj_unpack_sessinfo(
 
 	/*
 	 * first make sure that the magic cookie at the beginning is right.
-	   this isn't null-terminated */
+	 * 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"));
@@ -1119,7 +1119,7 @@ stobj_unpack_sessinfo(
 
 	/*
 	 * sanity check the size of the buffer given to us vs. the size it
-	   should be */
+	 * 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,
@@ -1467,8 +1467,8 @@ DEBUG_sessionprint(inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 			}
 			printf("\t\t\tmedia file %d:", j);
 			/*
-			   if (mfp->m_isinvdump)
-			        printf(" SESSION INVENTORY");
+			 * if (mfp->m_isinvdump)
+			 *      printf(" SESSION INVENTORY");
 			 */
 			printf("\n");
 			printf("\t\t\t\tmfile index:\t%d\n", mfp->m_mfile_index);
diff --git a/inventory/inventory.h b/inventory/inventory.h
index ea61bb9..6e866e1 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -126,7 +126,7 @@ typedef struct inv_mediafile {
 	off64_t		m_size;                 /* size of mediafile in bytes */
 	bool_t		m_isgood;               /* distinguishes good mfiles */
 	bool_t		m_isinvdump;            /* is this the mfile that has the dump
-	                                           of the rest of the session? */
+	                                         * of the rest of the session? */
 	char		m_label[INV_STRLEN];    /* media file label */
 } inv_mediafile_t;
 
@@ -138,8 +138,8 @@ typedef struct inv_stream {
 	xfs_ino_t		st_startino;            /* the starting pt */
 	off64_t			st_startino_off;
 	xfs_ino_t		st_endino;              /* where we actually ended up. this
-	                                                   means we've written upto but not
-	                                                   including this breakpoint. */
+	                                                 * means we've written upto but not
+	                                                 * including this breakpoint. */
 	off64_t			st_endino_off;
 	char			st_cmdarg[INV_STRLEN];  /* the driver path user entered */
 	uint			st_nmediafiles;         /* number of mediafiles */
@@ -167,8 +167,8 @@ typedef struct inv_session {
 	uint		s_nstreams;             /* num of media streams recorded */
 	inv_stream_t *	s_streams;              /* array of streams */
 	uint		s_refnum;               /* storage location dependent ref.
-	                                            used in displaying the session and
-	                                            nowhere else */
+	                                         *  used in displaying the session and
+	                                         *  nowhere else */
 } inv_session_t;
 
 
@@ -240,7 +240,7 @@ inv_put_mediafile(
 	off64_t		endino_offset,
 	off64_t		size,           /* size of the mediafile in bytes */
 	bool_t		isgood,         /* to distinguish unimportant media
-                                           files from others */
+                                         * files from others */
 	bool_t		isinv_dump);
 
 /*
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 8ac9053..47c43ea 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -298,7 +298,7 @@ write_test(int nsess, int nstreams, int nmedia, int dumplevel)
 	for (i = 0; i < nsess; i++) {
 		j = i % 8;
 		/*mnt = mnt_str[j];
-		   dev = dev_str[7-j]; */
+		 * dev = dev_str[7-j]; */
 		mnt = mnt_str[0];
 		dev = dev_str[7];
 		fsidp = &fsidarr[0]; /* j */
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 2482e74..ec72dd2 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -640,7 +640,7 @@ stobj_put_streams(int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 
 		/*
 		 * adjust the offsets of the first and the last elements
-		   in the mediafile chain */
+		 * in the mediafile chain */
 		mfiles[nmfiles].mf_prevmf = 0;
 		nmfiles += strms[i].st_nmediafiles;
 		mfiles[nmfiles - 1].mf_nextmf = 0;
@@ -788,7 +788,7 @@ get_inventry_stobjfile(data_t *d)
 
 	/*
 	 * all the children will be from the same stobj file, so we can just
-	   get the name for the first */
+	 * get the name for the first */
 
 	child_data = d->children[0]->data;
 
diff --git a/restore/content.c b/restore/content.c
index 09080c3..7ede958 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -5008,7 +5008,7 @@ newmedia:
 		    DEVICE_NONREMOVABLE) {
 			/*
 			 * if no error has already been detected then don't log
-			   a failure */
+			 * a failure */
 			if (mlog_get_hint() == RV_NONE)
 				mlog_exit_hint(RV_OK);
 			return RV_QUIT;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 24/24] xfsdump: (style) remove parentheses after return
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (16 preceding siblings ...)
  2018-11-09 14:30 ` [PATCH 23/24] xfsdump: (style) add stars to multiline comments Jan Tulak
@ 2018-11-09 14:30 ` Jan Tulak
  2018-11-14 20:36 ` [PATCH 00/24] xfsdump: code style change Eric Sandeen
  18 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-09 14:30 UTC (permalink / raw)
  To: linux-xfs; +Cc: Jan Tulak

"return (foo);" -> "return foo;"

Created by Uncrustify with this config file:

#
# uncrustify config, remove parentheses after return
#

indent_with_tabs	= 2		# 1=indent with tabs, align with spaces, 2=use all tabs
input_tab_size		= 8		# original tab size
output_tab_size		= 8		# new tab size
indent_columns		= output_tab_size

indent_label		= 1		# pos: absolute col, neg: relative column

#
# inter-symbol newlines
#

nl_enum_brace		= remove	# "enum {" vs "enum
 {"
nl_union_brace		= remove	# "union {" vs "union
 {"
nl_struct_brace		= remove	# "struct {" vs "struct
 {"
nl_do_brace 		= remove	# "do {" vs "do
 {"
nl_if_brace 		= remove	# "if () {" vs "if ()
 {"
nl_for_brace 		= remove	# "for () {" vs "for ()
 {"
nl_else_brace 		= remove	# "else {" vs "else
 {"
nl_while_brace 		= remove	# "while () {" vs "while ()
 {"
nl_switch_brace 	= remove	# "switch () {" vs "switch ()
 {"
nl_brace_while		= remove	# "} while" vs "}
 while" - cuddle while
nl_brace_else		= remove	# "} else" vs "}
 else" - cuddle else
sp_brace_else		= force
sp_else_brace		= force
nl_func_var_def_blk	= 1
nl_fcall_brace		= remove	# "list_for_each() {" vs "list_for_each()
{"
nl_fdef_brace		= add		# "int foo() {" vs "int foo()
{"
nl_after_label_colon	= true		# "fail:
free(foo);" vs "fail: free(foo);"

#
# Source code modifications
#

mod_paren_on_return	= remove	# "return 1;" vs "return (1);"
mod_full_brace_for	= ignore	# "for () a--;" vs "for () { a--; }"
mod_full_brace_do	= ignore	# "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while	= ignore	# "while (a) a--;" vs "while (a) { a--; }"

#
# inter-character spacing options
#

sp_return_paren		= force		# "return (1);" vs "return(1);"
sp_sizeof_paren		= remove	# "sizeof (int)" vs "sizeof(int)"
sp_before_sparen	= force		# "if (" vs "if("
sp_after_sparen		= force		# "if () {" vs "if (){"
sp_after_cast		= remove	# "(int) a" vs "(int)a"
sp_inside_braces	= force		# "{ 1 }" vs "{1}"
sp_inside_braces_struct	= force	# "{ 1 }" vs "{1}"
sp_inside_braces_enum	= force	# "{ 1 }" vs "{1}"
sp_assign		= force
sp_arith		= force
sp_bool			= force
sp_compare		= force
sp_assign		= force
sp_after_comma		= force
sp_func_def_paren	= remove	# "int foo (){" vs "int foo(){"
sp_func_call_paren	= remove	# "foo (" vs "foo("
sp_func_proto_paren	= remove	# "int foo ();" vs "int foo();"

#
# Aligning stuff
#

align_with_tabs		= TRUE		# use tabs to align
align_on_tabstop	= TRUE 		# align on tabstops
align_enum_equ_span	= 4		# '=' in enum definition
align_var_def_colon	= TRUE
align_struct_init_span	= 3		# align stuff in a structure init '= { }'
align_right_cmt_span	= 3

cmt_star_cont = true

#
# other
#

nl_func_paren = remove
nl_func_decl_start = ignore
nl_func_decl_empty = remove
nl_func_decl_args = ignore
nl_func_decl_end = remove

sp_inside_paren = remove
sp_inside_square = remove
sp_inside_paren_cast = remove
sp_inside_fparen = remove
sp_inside_sparen = remove
sp_paren_paren = remove
sp_before_ptr_star = force
sp_after_ptr_star = remove
sp_between_ptr_star = remove
align_func_params = true
align_var_struct_span = 6

eat_blanks_after_open_brace   = true
eat_blanks_before_close_brace = true
pp_indent = ignore

nl_start_of_file   = remove
nl_end_of_file     = force
nl_end_of_file_min = 1
nl_comment_func_def = 1

Signed-off-by: Jan Tulak <jtulak@redhat.com>
---
 common/drive_minrmt.c   |  2 +-
 common/drive_scsitape.c |  2 +-
 dump/content.c          |  4 ++--
 include/swab.h          | 12 ++++++------
 inventory/inv_mgr.c     |  2 +-
 inventory/inv_priv.h    |  2 +-
 invutil/invutil.c       | 14 +++++++-------
 librmt/isrmt.c          |  2 +-
 librmt/rmtaccess.c      |  4 ++--
 librmt/rmtclose.c       |  8 ++++----
 librmt/rmtcommand.c     |  4 ++--
 librmt/rmtcreat.c       |  4 ++--
 librmt/rmtdev.c         |  4 ++--
 librmt/rmtfstat.c       |  8 ++++----
 librmt/rmtioctl.c       | 30 +++++++++++++++---------------
 librmt/rmtisatty.c      |  4 ++--
 librmt/rmtlseek.c       |  8 ++++----
 librmt/rmtopen.c        | 14 +++++++-------
 librmt/rmtread.c        | 10 +++++-----
 librmt/rmtstatus.c      | 10 +++++-----
 librmt/rmtwrite.c       | 10 +++++-----
 21 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index dc6d502..e926eeb 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -3121,7 +3121,7 @@ determine_write_error(int nwritten, int saved_errno)
 	     nwritten,
 	     saved_errno);
 
-	return (ret);
+	return ret;
 }
 
 static void
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 3c0b139..4ab1b55 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -3853,7 +3853,7 @@ determine_write_error(drive_t *drivep, int nwritten, int saved_errno)
 	     nwritten,
 	     saved_errno);
 
-	return (ret);
+	return ret;
 }
 
 static void
diff --git a/dump/content.c b/dump/content.c
index 64f6029..29652c2 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -6975,7 +6975,7 @@ getxfsqstat(char *fsname)
 	memset(&qstat, 0, sizeof(fs_quota_stat_t));
 	if (quotactl(QCMD(Q_XGETQSTAT, 0), fsname, 0,
 		     (caddr_t)&qstat) < 0) {
-		return (-1);
+		return -1;
 	}
-	return ((int)qstat.qs_flags);
+	return (int)qstat.qs_flags;
 }
diff --git a/include/swab.h b/include/swab.h
index 0a5289f..55090fc 100644
--- a/include/swab.h
+++ b/include/swab.h
@@ -111,11 +111,11 @@
 
 static __inline__ __u16 __fswab16(__u16 x)
 {
-	return (__extension__ __arch__swab16(x));
+	return __extension__ __arch__swab16(x);
 }
 static __inline__ __u16 __swab16p(__u16 *x)
 {
-	return (__extension__ __arch__swab16p(x));
+	return __extension__ __arch__swab16p(x);
 }
 static __inline__ void __swab16s(__u16 *addr)
 {
@@ -124,11 +124,11 @@ static __inline__ void __swab16s(__u16 *addr)
 
 static __inline__ __u32 __fswab32(__u32 x)
 {
-	return (__extension__ __arch__swab32(x));
+	return __extension__ __arch__swab32(x);
 }
 static __inline__ __u32 __swab32p(__u32 *x)
 {
-	return (__extension__ __arch__swab32p(x));
+	return __extension__ __arch__swab32p(x);
 }
 static __inline__ void __swab32s(__u32 *addr)
 {
@@ -142,12 +142,12 @@ static __inline__ __u64 __fswab64(__u64 x)
 	__u32 l = x & ((1ULL << 32) - 1);
 	return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
 #  else
-	return (__extension__ __arch__swab64(x));
+	return __extension__ __arch__swab64(x);
 #  endif
 }
 static __inline__ __u64 __swab64p(__u64 *x)
 {
-	return (__extension__ __arch__swab64p(x));
+	return __extension__ __arch__swab64p(x);
 }
 static __inline__ void __swab64s(__u64 *addr)
 {
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 2ac1323..c7d0bb1 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -372,7 +372,7 @@ invmgr_inv_print(
 	if (prctx->invidx) {
 		idx_DEBUG_printinvindices(iarr, (uint)nindices);
 		free(iarr);
-		return (0);
+		return 0;
 	}
 
 
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 1cd90f9..3b6b545 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -200,7 +200,7 @@ typedef struct invt_counter {
 typedef struct invt_sescounter {
 	INVT_COUNTER_FIELDS
 	off64_t ic_eof;          /* current end of the file, where the next
-	                         *  media file or stream will be written to */
+	                          *  media file or stream will be written to */
 	char	ic_padding[0x20 - (INVT_COUNTER_FIELDS_SIZE +
 				   sizeof(off64_t))];
 } invt_sescounter_t;
diff --git a/invutil/invutil.c b/invutil/invutil.c
index 24a7b6a..88c6b2d 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -411,7 +411,7 @@ GetNameOfStobj(char *inv_path, char *filename)
 	strcat(name, "/");
 	strcat(name, str);
 
-	return (name);
+	return name;
 }
 
 char *
@@ -428,7 +428,7 @@ GetNameOfInvIndex(char *inv_path, uuid_t uuid)
 	strcat(name, str);
 	strcat(name, INV_INVINDEX_PREFIX);
 
-	return (name);
+	return name;
 }
 
 char *
@@ -441,7 +441,7 @@ GetFstabFullPath(char *inv_path)
 	strcpy(fstabname, inv_path);
 	strcat(fstabname, "/");
 	strcat(fstabname, "fstab");
-	return (fstabname);
+	return fstabname;
 }
 
 void
@@ -684,10 +684,10 @@ CheckAndPruneInvIndexFile(bool_t	checkonly,
 			printf("unlink idx file %s\n", idxFileName);
 		}
 		unlink(idxFileName);
-		return (-1);
+		return -1;
 	}
 
-	return (0);
+	return 0;
 }
 
 int
@@ -891,10 +891,10 @@ CheckAndPruneStObjFile(bool_t	checkonly,
 		if (debug)
 			printf("Removing: %s\n", StObjFileName);
 		unlink(StObjFileName);
-		return (-1);
+		return -1;
 	}
 
-	return (0);
+	return 0;
 }
 
 /*
diff --git a/librmt/isrmt.c b/librmt/isrmt.c
index 79f685e..32d03ad 100644
--- a/librmt/isrmt.c
+++ b/librmt/isrmt.c
@@ -30,5 +30,5 @@
 int isrmt(fd)
 int fd;
 {
-	return (fd >= REM_BIAS);
+	return fd >= REM_BIAS;
 }
diff --git a/librmt/rmtaccess.c b/librmt/rmtaccess.c
index ef1c2ac..801a533 100644
--- a/librmt/rmtaccess.c
+++ b/librmt/rmtaccess.c
@@ -34,8 +34,8 @@ char *path;
 int amode;
 {
 	if (_rmt_dev(path)) {
-		return (0);             /* Let /etc/rmt find out */
+		return 0;             /* Let /etc/rmt find out */
 	} else {
-		return (access(path, amode));
+		return access(path, amode);
 	}
 }
diff --git a/librmt/rmtclose.c b/librmt/rmtclose.c
index 1744220..602cf01 100644
--- a/librmt/rmtclose.c
+++ b/librmt/rmtclose.c
@@ -36,9 +36,9 @@ int fildes;
 		/* no longer know what host we have for this fildes */
 		RMTHOST(fildes - REM_BIAS) = UNAME_UNKNOWN;
 
-		return (_rmt_close(fildes - REM_BIAS));
+		return _rmt_close(fildes - REM_BIAS);
 	} else {
-		return (close(fildes));
+		return close(fildes);
 	}
 }
 
@@ -54,8 +54,8 @@ _rmt_close(int fildes)
 		rc = _rmt_status(fildes);
 
 		_rmt_abort(fildes);
-		return (rc);
+		return rc;
 	}
 
-	return (-1);
+	return -1;
 }
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index 6b96af9..d722e86 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -47,7 +47,7 @@ char *buf;
 
 	blen = strlen(buf);
 	if (write(WRITE(fildes), buf, blen) == blen) {
-		return (0);
+		return 0;
 	}
 
 /*
@@ -57,5 +57,5 @@ char *buf;
 	_rmt_abort(fildes);
 
 	setoserror(EIO);
-	return (-1);
+	return -1;
 }
diff --git a/librmt/rmtcreat.c b/librmt/rmtcreat.c
index 7026a36..d2ecf2f 100644
--- a/librmt/rmtcreat.c
+++ b/librmt/rmtcreat.c
@@ -37,8 +37,8 @@ char *path;
 int mode;
 {
 	if (_rmt_dev(path)) {
-		return (rmtopen(path, 1 | O_CREAT, mode));
+		return rmtopen(path, 1 | O_CREAT, mode);
 	} else {
-		return (creat(path, mode));
+		return creat(path, mode);
 	}
 }
diff --git a/librmt/rmtdev.c b/librmt/rmtdev.c
index 6271e20..5eeef6a 100644
--- a/librmt/rmtdev.c
+++ b/librmt/rmtdev.c
@@ -34,8 +34,8 @@ register char *path;
 {
 	if ((path = strchr(path, ':')) != (char *)0) {
 		if (strncmp(path + 1, "/dev/", 5) == 0) {
-			return (1);
+			return 1;
 		}
 	}
-	return (0);
+	return 0;
 }
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 67c1f7a..dae3d9a 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -40,7 +40,7 @@ int fildes;
 struct stat *buf;
 {
 	if (isrmt(fildes)) {
-		return (_rmt_fstat(fildes - REM_BIAS, (char *)buf));
+		return _rmt_fstat(fildes - REM_BIAS, (char *)buf);
 	} else {
 		int i;
 		i = fstat(fildes, buf);
@@ -66,7 +66,7 @@ _rmt_fstat(int fildes, char *arg)
 
 	if (_rmt_command(fildes, buffer) == -1 ||
 	    (rc = _rmt_status(fildes)) == -1)
-		return (-1);
+		return -1;
 
 	/* adjust read count to prevent overflow */
 
@@ -79,7 +79,7 @@ _rmt_fstat(int fildes, char *arg)
 abortit:
 			_rmt_abort(fildes);
 			setoserror(EIO);
-			return (-1);
+			return -1;
 		}
 	}
 
@@ -88,5 +88,5 @@ abortit:
 		if (read(READ(fildes), buffer, 1) <= 0)
 			goto abortit;
 
-	return (0);
+	return 0;
 }
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index a948593..abddbce 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -141,9 +141,9 @@ int
 rmtioctl(int fildes, unsigned int request, void *arg)
 {
 	if (isrmt(fildes)) {
-		return (_rmt_ioctl(fildes - REM_BIAS, request, arg));
+		return _rmt_ioctl(fildes - REM_BIAS, request, arg);
 	} else {
-		return (ioctl(fildes, request, arg));
+		return ioctl(fildes, request, arg);
 	}
 }
 
@@ -189,7 +189,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			_rmt_msg(RMTWARN,
 				 _("rmtioctl: remote host type not supported for MTIOCTOP\n"));
 			setoserror(EPROTONOSUPPORT);
-			return (-1);
+			return -1;
 		}
 
 		/* map the linux op code to the irix op code */
@@ -197,22 +197,22 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			mt_op = mtop_irixmap[mt_op];
 			if (mt_op == -1) {
 				setoserror(EINVAL);
-				return (-1);
+				return -1;
 			}
 		} else if (RMTHOST(fildes) != UNAME_LINUX) {
 			/* map the linux op code to the standard/fallback op code */
 			mt_op = mtop_stdmap[mt_op];
 			if (mt_op == -1) {
 				setoserror(EINVAL);
-				return (-1);
+				return -1;
 			}
 		}
 
 		sprintf(buffer, "I%d\n%d\n", mt_op, mt_count);
 		if (_rmt_command(fildes, buffer) == -1) {
-			return (-1);
+			return -1;
 		}
-		return (_rmt_status(fildes));
+		return _rmt_status(fildes);
 	} else if (op == MTIOCGET) {
 		/*
 		 *  Grab the status and read it directly into the structure.
@@ -228,7 +228,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 		 */
 		if (_rmt_command(fildes, "S") == -1 ||
 		    (rc = _rmt_status(fildes)) == -1)
-			return (-1);
+			return -1;
 
 
 		/*
@@ -242,7 +242,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			_rmt_msg(RMTWARN,
 				 _("rmtioctl: remote host type not supported for MTIOCGET\n"));
 			setoserror(EPROTONOSUPPORT);
-			return (-1);
+			return -1;
 		case UNAME_IRIX:
 			if (sizeof(struct irix_mtget) != rc) {
 				_rmt_msg(RMTWARN,
@@ -250,7 +250,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 					   " - got %d, wanted %d\n"),
 					 rc, sizeof(struct irix_mtget));
 				setoserror(EPROTONOSUPPORT);
-				return (-1);
+				return -1;
 			}
 			break;
 		case UNAME_LINUX:
@@ -265,12 +265,12 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 					 rc, sizeof(struct linux32_mtget),
 					 sizeof(struct linux64_mtget));
 				setoserror(EPROTONOSUPPORT);
-				return (-1);
+				return -1;
 			}
 			break;
 		default:
 			setoserror(EPROTONOSUPPORT);
-			return (-1);
+			return -1;
 		}
 
 
@@ -293,7 +293,7 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			if (cnt <= 0) {
 				_rmt_abort(fildes);
 				setoserror(EIO);
-				return (-1);
+				return -1;
 			}
 		}
 
@@ -400,9 +400,9 @@ _rmt_ioctl(int fildes, unsigned int op, void *arg)
 			dstp->mt_dsreg = srcp->mt_dsreg;
 			dstp->mt_gstat = srcp->mt_gstat;
 		}
-		return (0);
+		return 0;
 	} else {
 		setoserror(EINVAL);
-		return (-1);
+		return -1;
 	}
 }
diff --git a/librmt/rmtisatty.c b/librmt/rmtisatty.c
index 25758ca..9262694 100644
--- a/librmt/rmtisatty.c
+++ b/librmt/rmtisatty.c
@@ -32,8 +32,8 @@ int rmtisatty(fd)
 int fd;
 {
 	if (isrmt(fd)) {
-		return (0);
+		return 0;
 	} else {
-		return (isatty(fd));
+		return isatty(fd);
 	}
 }
diff --git a/librmt/rmtlseek.c b/librmt/rmtlseek.c
index 546b8c8..44b2d5e 100644
--- a/librmt/rmtlseek.c
+++ b/librmt/rmtlseek.c
@@ -38,9 +38,9 @@ off_t offset;
 int whence;
 {
 	if (isrmt(fildes)) {
-		return (_rmt_lseek(fildes - REM_BIAS, offset, whence));
+		return _rmt_lseek(fildes - REM_BIAS, offset, whence);
 	} else {
-		return (lseek(fildes, offset, whence));
+		return lseek(fildes, offset, whence);
 	}
 }
 
@@ -55,7 +55,7 @@ _rmt_lseek(int fildes, off_t offset, int whence)
 
 	sprintf(buffer, "L%ld\n%d\n", (long)offset, whence);
 	if (_rmt_command(fildes, buffer) == -1)
-		return (-1);
+		return -1;
 
-	return (_rmt_status(fildes));
+	return _rmt_status(fildes);
 }
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 1458ade..65a519f 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -63,9 +63,9 @@ int oflag;
 int mode;
 {
 	if (strchr(path, ':') != NULL) {
-		return (_rmt_open(path, oflag, mode) | REM_BIAS);
+		return _rmt_open(path, oflag, mode) | REM_BIAS;
 	} else {
-		return (open(path, oflag, mode));
+		return open(path, oflag, mode);
 	}
 }
 
@@ -116,7 +116,7 @@ static int _rmt_open(char *path, int oflag, int mode)
 
 	if (i == MAXUNIT) {
 		setoserror(EMFILE);
-		return (-1);
+		return -1;
 	}
 
 /*
@@ -208,10 +208,10 @@ static int _rmt_open(char *path, int oflag, int mode)
  */
 do_rmt:
 	if (pipe(_rmt_Ptc[i]) == -1 || pipe(_rmt_Ctp[i]) == -1)
-		return (-1);
+		return -1;
 
 	if ((rc = fork()) == -1)
-		return (-1);
+		return -1;
 
 	if (rc == 0) {
 		close(0);
@@ -253,7 +253,7 @@ do_rmt:
 
 	sprintf(buffer, "O%s\n%d\n", device, oflag);
 	if (_rmt_command(i, buffer) == -1 || _rmt_status(i) == -1)
-		return (-1);
+		return -1;
 
-	return (i);
+	return i;
 }
diff --git a/librmt/rmtread.c b/librmt/rmtread.c
index 1004992..6b34c1e 100644
--- a/librmt/rmtread.c
+++ b/librmt/rmtread.c
@@ -39,9 +39,9 @@ char *buf;
 unsigned int nbyte;
 {
 	if (isrmt(fildes)) {
-		return (_rmt_read(fildes - REM_BIAS, buf, nbyte));
+		return _rmt_read(fildes - REM_BIAS, buf, nbyte);
 	} else {
-		return (read(fildes, buf, nbyte));
+		return read(fildes, buf, nbyte);
 	}
 }
 
@@ -57,16 +57,16 @@ _rmt_read(int fildes, char *buf, unsigned int nbyte)
 
 	sprintf(buffer, "R%d\n", nbyte);
 	if (_rmt_command(fildes, buffer) == -1 || (rc = _rmt_status(fildes)) == -1)
-		return (-1);
+		return -1;
 
 	for (i = 0; i < rc; i += nbyte, buf += nbyte) {
 		nbyte = read(READ(fildes), buf, rc);
 		if (nbyte <= 0) {
 			_rmt_abort(fildes);
 			setoserror(EIO);
-			return (-1);
+			return -1;
 		}
 	}
 
-	return (rc);
+	return rc;
 }
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index 3691eef..064b646 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -47,7 +47,7 @@ int fildes;
 		if (read(READ(fildes), cp, 1) != 1) {
 			_rmt_abort(fildes);
 			setoserror(EIO);
-			return (-1);
+			return -1;
 		}
 		if (*cp == '\n') {
 			*cp = 0;
@@ -58,7 +58,7 @@ int fildes;
 	if (i == BUFMAGIC) {
 		_rmt_abort(fildes);
 		setoserror(EIO);
-		return (-1);
+		return -1;
 	}
 
 /*
@@ -78,7 +78,7 @@ int fildes;
 		if (*cp == 'F')
 			_rmt_abort(fildes);
 
-		return (-1);
+		return -1;
 	}
 
 /*
@@ -88,8 +88,8 @@ int fildes;
 	if (*cp != 'A') {
 		_rmt_abort(fildes);
 		setoserror(EIO);
-		return (-1);
+		return -1;
 	}
 
-	return (atoi(cp + 1));
+	return atoi(cp + 1);
 }
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index 830be20..86c3c54 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -39,9 +39,9 @@ char *buf;
 unsigned int nbyte;
 {
 	if (isrmt(fildes)) {
-		return (_rmt_write(fildes - REM_BIAS, buf, nbyte));
+		return _rmt_write(fildes - REM_BIAS, buf, nbyte);
 	} else {
-		return (write(fildes, buf, nbyte));
+		return write(fildes, buf, nbyte);
 	}
 }
 
@@ -56,13 +56,13 @@ _rmt_write(int fildes, char *buf, unsigned int nbyte)
 
 	sprintf(buffer, "W%d\n", nbyte);
 	if (_rmt_command(fildes, buffer) == -1)
-		return (-1);
+		return -1;
 
 	if (write(WRITE(fildes), buf, nbyte) == nbyte) {
-		return (_rmt_status(fildes));
+		return _rmt_status(fildes);
 	}
 
 	_rmt_abort(fildes);
 	setoserror(EIO);
-	return (-1);
+	return -1;
 }
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 00/24] xfsdump: code style change
  2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
                   ` (17 preceding siblings ...)
  2018-11-09 14:30 ` [PATCH 24/24] xfsdump: (style) remove parentheses after return Jan Tulak
@ 2018-11-14 20:36 ` Eric Sandeen
  2018-11-15 12:40   ` Jan Tulak
  18 siblings, 1 reply; 23+ messages in thread
From: Eric Sandeen @ 2018-11-14 20:36 UTC (permalink / raw)
  To: Jan Tulak, linux-xfs

On 11/9/18 8:29 AM, Jan Tulak wrote:
> This set is dealing with whitespaces only, no functional change, code
> shuffling, etc. should be present (with one small exception in patch no. 2).
> From the previous set I split the changes into multiple patches, one type of
> change at a time, and tried to make the code fully compliant with xfs style,
> so the number of changes is way bigger than in the first set.
> 
> The only patch with code shuffling (but no behavioral change) is: "xfsdump: do
> not split function call with ifdef." See the patch for details.
> 
> For patch 21 - xfsdump: (style) format intercharacter spaces, I think whether
> it is still to much agregated and I should separate the changes. Some other
> patches I had to split to multiple files as they are too big to pass through
> to the mailing list - it is in their name. The largest one is 660K now, so I
> will check if that passed through, or it is still too big.
> 
> The whole set is created mechanically from scratch. Scripts used for the
> specific change are part of the commit message and I can easily put it all
> together. So there is no need to worry about rebase conflicts, etc. when
> pointing out issues.
> 
> The tools used to make these changes are sed and uncrustify.
> http://uncrustify.sourceforge.net/
> 
> A git tree with these patches is also on Github:
> https://github.com/jtulak/xfsdump/tree/style-nov-9th
> or
> git clone --single-branch -b style-nov-9th https://github.com/jtulak/xfsdump.git

Thanks for doing this.  I do think it's useful in the long run.

NB: not all patches came through, apparently they were too big for the list.

A few issues I notice:

1) we now get warnings like:

In file included from content.c:44:0:
types.h:30:0: warning: "sizeofmember" redefined [enabled by default]
 #define sizeofmember(t, m)      sizeof(((t *)0)->m)
 ^
In file included from content.c:40:0:
/usr/include/xfs/jdm.h:65:0: note: this is the location of the previous definition
 #define sizeofmember( t, m ) sizeof( ( ( t * )0 )->m )
 ^

because xfsprogs headers have the definitions w/ the spaces in them.  So
I'd just leave sizeofmember and offsetofmember defines alone for now to
avoid this.  Or, wrap them in #ifndef's.  Or if we require xfsprogs headers
to build anyway, perhaps just drop the defines altogether.

2) I think we probably do not want to change any user-facing strings,
or at least they should be carefully examined.  This will break some
translations (fixable) but it's also more of a functional change, and
should be done with care if at all, and maybe left for a separate patch
if it's warranted.

3) This creates /many/ more > 80 char lines.  Per:

# for F in */*.[ch]; do expand $F | grep '.\{81\}'; done

the codebase goes from 794 such lines to 1806.  IOWs, some of the "missing"
whitespace may have been intentional, to stay under 80 cols.  New lines
vs. compressed lines is a judgement call, I guess.  Bleah.

So... sorry about that, but if the goal is to format better, let's be
sure to keep observing other basic rules like "< 80 cols"

4) related, there are places where we intentionally dropped a space to
keep things well aligned, for example:

        ULO(_("<file> (restore only if newer than)"),   GETOPT_NEWER);
        ULO(_("(restore owner/group even if not root)"),GETOPT_OWNER);
        ULO(_("<seconds between progress reports>"),    GETOPT_PROGRESS);

this "breaks the rule" but it's fairly common to line up columns that way
if it's just off by 1 char.

Other things like this:

 struct quota_info {
-       char *  desc;           /* Quotas type (user, project, etc) */
-       bool_t  savequotas;     /* Quotas saved OK */
-       char *  quotafile;      /* Filename quota info is stored in */
-       char    quotapath[MAXPATHLEN]; /* Full path to quotafile */
-       char *  repquotaargs;   /* Args to repquota to create this quotafile */
-       int     statflag;       /* quota stats flag for this type */
-       ino_t   quotaino;       /* ino of the quota file */
+       char *  desc;                   /* Quotas type (user, project, etc) */
+       bool_t  savequotas;             /* Quotas saved OK */
+       char *  quotafile;              /* Filename quota info is stored in */
+       char    quotapath[MAXPATHLEN];  /* Full path to quotafile */
+       char *  repquotaargs;           /* Args to repquota to create this quotafile */
+       int     statflag;               /* quota stats flag for this type */
+       ino_t   quotaino;               /* ino of the quota file */
 };

probably shouldn't happen either, it's better to keep stuff < 80cols
and have 1 oddball comment remaining.

I was trying to compare objdump -d to ensure there were no other unintended
runtime changes, but unfortunately there are changes
which will affect that even if it's whitespace; for example whitespace
changes within an assert() will change strings (the text of the assert)
and their locations, and so will change the disassembly.  So I'm not sure
it's possible to validate "no functional changes" by binary inspection...

I suppose we could try to limit whitespace changes to things that won't
change disassembly first (for example, no string or assert changes) and
then go back and do them, so that we could ge the bulk of the changes in
with no modifications to the binary code, but ... I'm not sure if it's
worth it.

Sorry for the hassle, but even though it's "only whitespace" I think we
want to be as careful as possible to not move anything backwards...

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 00/24] xfsdump: code style change
  2018-11-14 20:36 ` [PATCH 00/24] xfsdump: code style change Eric Sandeen
@ 2018-11-15 12:40   ` Jan Tulak
  2018-11-15 16:12     ` Eric Sandeen
  0 siblings, 1 reply; 23+ messages in thread
From: Jan Tulak @ 2018-11-15 12:40 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Wed, Nov 14, 2018 at 9:36 PM Eric Sandeen <sandeen@sandeen.net> wrote:
>
> On 11/9/18 8:29 AM, Jan Tulak wrote:
> > This set is dealing with whitespaces only, no functional change, code
> > shuffling, etc. should be present (with one small exception in patch no. 2).
> > From the previous set I split the changes into multiple patches, one type of
> > change at a time, and tried to make the code fully compliant with xfs style,
> > so the number of changes is way bigger than in the first set.
> >
> > The only patch with code shuffling (but no behavioral change) is: "xfsdump: do
> > not split function call with ifdef." See the patch for details.
> >
> > For patch 21 - xfsdump: (style) format intercharacter spaces, I think whether
> > it is still to much agregated and I should separate the changes. Some other
> > patches I had to split to multiple files as they are too big to pass through
> > to the mailing list - it is in their name. The largest one is 660K now, so I
> > will check if that passed through, or it is still too big.
> >
> > The whole set is created mechanically from scratch. Scripts used for the
> > specific change are part of the commit message and I can easily put it all
> > together. So there is no need to worry about rebase conflicts, etc. when
> > pointing out issues.
> >
> > The tools used to make these changes are sed and uncrustify.
> > http://uncrustify.sourceforge.net/
> >
> > A git tree with these patches is also on Github:
> > https://github.com/jtulak/xfsdump/tree/style-nov-9th
> > or
> > git clone --single-branch -b style-nov-9th https://github.com/jtulak/xfsdump.git
>
> Thanks for doing this.  I do think it's useful in the long run.
>
> NB: not all patches came through, apparently they were too big for the list.

Thanks for looking at it. And sorry for the missing mails, I checked
it in my mailbox and there they arrived all. But apparently, Gmail and
its deduplication made it look like it came through both mailing list
and me in cc, even if I received CCed version only.

>
> A few issues I notice:
>
> 1) we now get warnings like:
>
> In file included from content.c:44:0:
> types.h:30:0: warning: "sizeofmember" redefined [enabled by default]
>  #define sizeofmember(t, m)      sizeof(((t *)0)->m)
>  ^
> In file included from content.c:40:0:
> /usr/include/xfs/jdm.h:65:0: note: this is the location of the previous definition
>  #define sizeofmember( t, m ) sizeof( ( ( t * )0 )->m )
>  ^
>
> because xfsprogs headers have the definitions w/ the spaces in them.  So
> I'd just leave sizeofmember and offsetofmember defines alone for now to
> avoid this.  Or, wrap them in #ifndef's.  Or if we require xfsprogs headers
> to build anyway, perhaps just drop the defines altogether.

Ok, I will drop it out.

>
> 2) I think we probably do not want to change any user-facing strings,
> or at least they should be carefully examined.  This will break some
> translations (fixable) but it's also more of a functional change, and
> should be done with care if at all, and maybe left for a separate patch
> if it's warranted.
>
> 3) This creates /many/ more > 80 char lines.  Per:
>
> # for F in */*.[ch]; do expand $F | grep '.\{81\}'; done
>
> the codebase goes from 794 such lines to 1806.  IOWs, some of the "missing"
> whitespace may have been intentional, to stay under 80 cols.  New lines
> vs. compressed lines is a judgement call, I guess.  Bleah.
>
> So... sorry about that, but if the goal is to format better, let's be
> sure to keep observing other basic rules like "< 80 cols"

Yeah. I'm not sure there is an easy way to automate that...

>
> 4) related, there are places where we intentionally dropped a space to
> keep things well aligned, for example:
>
>         ULO(_("<file> (restore only if newer than)"),   GETOPT_NEWER);
>         ULO(_("(restore owner/group even if not root)"),GETOPT_OWNER);
>         ULO(_("<seconds between progress reports>"),    GETOPT_PROGRESS);
>
> this "breaks the rule" but it's fairly common to line up columns that way
> if it's just off by 1 char.
>
> Other things like this:
>
>  struct quota_info {
> -       char *  desc;           /* Quotas type (user, project, etc) */
> -       bool_t  savequotas;     /* Quotas saved OK */
> -       char *  quotafile;      /* Filename quota info is stored in */
> -       char    quotapath[MAXPATHLEN]; /* Full path to quotafile */
> -       char *  repquotaargs;   /* Args to repquota to create this quotafile */
> -       int     statflag;       /* quota stats flag for this type */
> -       ino_t   quotaino;       /* ino of the quota file */
> +       char *  desc;                   /* Quotas type (user, project, etc) */
> +       bool_t  savequotas;             /* Quotas saved OK */
> +       char *  quotafile;              /* Filename quota info is stored in */
> +       char    quotapath[MAXPATHLEN];  /* Full path to quotafile */
> +       char *  repquotaargs;           /* Args to repquota to create this quotafile */
> +       int     statflag;               /* quota stats flag for this type */
> +       ino_t   quotaino;               /* ino of the quota file */
>  };
>
> probably shouldn't happen either, it's better to keep stuff < 80cols
> and have 1 oddball comment remaining.
>
> I was trying to compare objdump -d to ensure there were no other unintended
> runtime changes, but unfortunately there are changes
> which will affect that even if it's whitespace; for example whitespace
> changes within an assert() will change strings (the text of the assert)
> and their locations, and so will change the disassembly.  So I'm not sure
> it's possible to validate "no functional changes" by binary inspection...
>
> I suppose we could try to limit whitespace changes to things that won't
> change disassembly first (for example, no string or assert changes) and
> then go back and do them, so that we could ge the bulk of the changes in
> with no modifications to the binary code, but ... I'm not sure if it's
> worth it.

I'll look at these issues and see what can be done/if that helps with
disassembly.

>
> Sorry for the hassle, but even though it's "only whitespace" I think we
> want to be as careful as possible to not move anything backwards...

Yup, I agree. We are not talking about a web form that will work even
if the layout breaks a bit.

Thanks,
Jan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 00/24] xfsdump: code style change
  2018-11-15 12:40   ` Jan Tulak
@ 2018-11-15 16:12     ` Eric Sandeen
  2018-11-16 15:19       ` Jan Tulak
  0 siblings, 1 reply; 23+ messages in thread
From: Eric Sandeen @ 2018-11-15 16:12 UTC (permalink / raw)
  To: Jan Tulak; +Cc: linux-xfs

On 11/15/18 6:40 AM, Jan Tulak wrote:
> On Wed, Nov 14, 2018 at 9:36 PM Eric Sandeen <sandeen@sandeen.net> wrote:
>>
>> On 11/9/18 8:29 AM, Jan Tulak wrote:
>>> This set is dealing with whitespaces only, no functional change, code
>>> shuffling, etc. should be present (with one small exception in patch no. 2).
>>> From the previous set I split the changes into multiple patches, one type of
>>> change at a time, and tried to make the code fully compliant with xfs style,
>>> so the number of changes is way bigger than in the first set.
>>>
>>> The only patch with code shuffling (but no behavioral change) is: "xfsdump: do
>>> not split function call with ifdef." See the patch for details.
>>>
>>> For patch 21 - xfsdump: (style) format intercharacter spaces, I think whether
>>> it is still to much agregated and I should separate the changes. Some other
>>> patches I had to split to multiple files as they are too big to pass through
>>> to the mailing list - it is in their name. The largest one is 660K now, so I
>>> will check if that passed through, or it is still too big.
>>>
>>> The whole set is created mechanically from scratch. Scripts used for the
>>> specific change are part of the commit message and I can easily put it all
>>> together. So there is no need to worry about rebase conflicts, etc. when
>>> pointing out issues.
>>>
>>> The tools used to make these changes are sed and uncrustify.
>>> http://uncrustify.sourceforge.net/
>>>
>>> A git tree with these patches is also on Github:
>>> https://github.com/jtulak/xfsdump/tree/style-nov-9th
>>> or
>>> git clone --single-branch -b style-nov-9th https://github.com/jtulak/xfsdump.git
>>
>> Thanks for doing this.  I do think it's useful in the long run.
>>
>> NB: not all patches came through, apparently they were too big for the list.
> 
> Thanks for looking at it. And sorry for the missing mails, I checked
> it in my mailbox and there they arrived all. But apparently, Gmail and
> its deduplication made it look like it came through both mailing list
> and me in cc, even if I received CCed version only.
> 
>>
>> A few issues I notice:
>>
>> 1) we now get warnings like:
>>
>> In file included from content.c:44:0:
>> types.h:30:0: warning: "sizeofmember" redefined [enabled by default]
>>  #define sizeofmember(t, m)      sizeof(((t *)0)->m)
>>  ^
>> In file included from content.c:40:0:
>> /usr/include/xfs/jdm.h:65:0: note: this is the location of the previous definition
>>  #define sizeofmember( t, m ) sizeof( ( ( t * )0 )->m )
>>  ^
>>
>> because xfsprogs headers have the definitions w/ the spaces in them.  So
>> I'd just leave sizeofmember and offsetofmember defines alone for now to
>> avoid this.  Or, wrap them in #ifndef's.  Or if we require xfsprogs headers
>> to build anyway, perhaps just drop the defines altogether.
> 
> Ok, I will drop it out.
> 
>>
>> 2) I think we probably do not want to change any user-facing strings,
>> or at least they should be carefully examined.  This will break some
>> translations (fixable) but it's also more of a functional change, and
>> should be done with care if at all, and maybe left for a separate patch
>> if it's warranted.
>>
>> 3) This creates /many/ more > 80 char lines.  Per:
>>
>> # for F in */*.[ch]; do expand $F | grep '.\{81\}'; done
>>
>> the codebase goes from 794 such lines to 1806.  IOWs, some of the "missing"
>> whitespace may have been intentional, to stay under 80 cols.  New lines
>> vs. compressed lines is a judgement call, I guess.  Bleah.
>>
>> So... sorry about that, but if the goal is to format better, let's be
>> sure to keep observing other basic rules like "< 80 cols"
> 
> Yeah. I'm not sure there is an easy way to automate that...

Well, I think that's kind of the point here.  Do your automated replacement,
but then manually inspect the result - you can look for 80col problems with
the example above.  Then manually fix up as needed.  Then proceed to the next
patch.

Reviewers will need to look at the changes closely nyway, so you may as well
do it before submission.  ;)

...

>> I suppose we could try to limit whitespace changes to things that won't
>> change disassembly first (for example, no string or assert changes) and
>> then go back and do them, so that we could ge the bulk of the changes in
>> with no modifications to the binary code, but ... I'm not sure if it's
>> worth it.
> 
> I'll look at these issues and see what can be done/if that helps with
> disassembly.

I'm undecided about whether it's worth it.  While it would be nice to be
able to compare objdumps and see that there are no changes at all, if it
complicates the patchset it may not be worth it.  See what you think.

-Eric

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 00/24] xfsdump: code style change
  2018-11-15 16:12     ` Eric Sandeen
@ 2018-11-16 15:19       ` Jan Tulak
  0 siblings, 0 replies; 23+ messages in thread
From: Jan Tulak @ 2018-11-16 15:19 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Thu, Nov 15, 2018 at 5:12 PM Eric Sandeen <sandeen@sandeen.net> wrote:
>
> On 11/15/18 6:40 AM, Jan Tulak wrote:
> > On Wed, Nov 14, 2018 at 9:36 PM Eric Sandeen <sandeen@sandeen.net> wrote:

...

> >> 3) This creates /many/ more > 80 char lines.  Per:
> >>
> >> # for F in */*.[ch]; do expand $F | grep '.\{81\}'; done
> >>
> >> the codebase goes from 794 such lines to 1806.  IOWs, some of the "missing"
> >> whitespace may have been intentional, to stay under 80 cols.  New lines
> >> vs. compressed lines is a judgement call, I guess.  Bleah.
> >>
> >> So... sorry about that, but if the goal is to format better, let's be
> >> sure to keep observing other basic rules like "< 80 cols"
> >
> > Yeah. I'm not sure there is an easy way to automate that...
>
> Well, I think that's kind of the point here.  Do your automated replacement,
> but then manually inspect the result - you can look for 80col problems with
> the example above.  Then manually fix up as needed.  Then proceed to the next
> patch.
>
> Reviewers will need to look at the changes closely nyway, so you may as well
> do it before submission.  ;)
>

It's about all the rebase conflicts that arises after any change in
previous patches. If it was a thing I write once, then so be it. But
if I have to rewrite it again after any change in one of the previous
patches, well, that doesn't scale. :-) But I hope I can solve this
somehow.

Thanks,
Jan


-- 
Jan Tulak

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-11-17  1:32 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09 14:29 [PATCH 00/24] xfsdump: code style change Jan Tulak
2018-11-09 14:29 ` [PATCH 01/24] xfsdump: (style) remove trailing whitespaces Jan Tulak
2018-11-09 14:29 ` [PATCH 02/24] xfsdump: do not split function call with ifdef Jan Tulak
2018-11-09 14:29 ` [PATCH 04/24] xfsdump: (2/4)(style) remove spaces from parentheses Jan Tulak
2018-11-09 14:29 ` [PATCH 06/24] xfsdump: (4/4)(style) " Jan Tulak
2018-11-09 14:29 ` [PATCH 07/24] xfsdump: (style) remove a space in front of comma/semicolon Jan Tulak
2018-11-09 14:29 ` [PATCH 08/24] xfsdump: (style) remove a space in ptr dereferences Jan Tulak
2018-11-09 14:29 ` [PATCH 09/24] xfsdump: add a space after comma and semicolon where was none Jan Tulak
2018-11-09 14:29 ` [PATCH 10/24] xfsdump: (style) insert a newline between type and fnt name in definitions Jan Tulak
2018-11-09 14:29 ` [PATCH 11/24] xfsdump: (style) add a space after if, switch, for, do, while Jan Tulak
2018-11-09 14:29 ` [PATCH 13/24] xfsdump: (2/4)(style) add first empty line for multiline comments Jan Tulak
2018-11-09 14:29 ` [PATCH 14/24] xfsdump: (3/4)(style) " Jan Tulak
2018-11-09 14:29 ` [PATCH 15/24] xfsdump: (4/4)(style) " Jan Tulak
2018-11-09 14:29 ` [PATCH 16/24] xfsdump: (style) curly brackets should wrap with one space Jan Tulak
2018-11-09 14:29 ` [PATCH 18/24] xfsdump: (2/4)(style) indent and align the code Jan Tulak
2018-11-09 14:30 ` [PATCH 21/24] xfsdump: (style) format intercharacter spaces Jan Tulak
2018-11-09 14:30 ` [PATCH 22/24] xfsdump: (style) format newlines Jan Tulak
2018-11-09 14:30 ` [PATCH 23/24] xfsdump: (style) add stars to multiline comments Jan Tulak
2018-11-09 14:30 ` [PATCH 24/24] xfsdump: (style) remove parentheses after return Jan Tulak
2018-11-14 20:36 ` [PATCH 00/24] xfsdump: code style change Eric Sandeen
2018-11-15 12:40   ` Jan Tulak
2018-11-15 16:12     ` Eric Sandeen
2018-11-16 15:19       ` Jan Tulak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).