Skip to contentSkip to conversation

xfsdump: (style) remove spaces from parentheses

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

lore
Share & tools
lore

Jan Tulak

author
#0 lore raw

cover xfsdump: (style) remove spaces from parentheses

Hi guys

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

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

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

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

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

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

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

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

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

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 common/arch_xlate.c     |   8 +-
 common/cldmgr.c         | 134 +++++++++----------
 common/cldmgr.h         |  16 +--
 common/cleanup.c        |  66 +++++-----
 common/cleanup.h        |  16 +--
 common/content.h        |  42 +++---
 common/content_common.c |  94 ++++++-------
 common/content_common.h |   2 +-
 common/content_inode.h  |  88 ++++++-------
 common/dlog.c           | 284 ++++++++++++++++++++--------------------
 common/dlog.h           |  32 ++---
 common/drive.c          | 170 ++++++++++++------------
 common/drive.h          | 126 +++++++++---------
 13 files changed, 539 insertions(+), 539 deletions(-)
common/arch_xlate.c +4 -4
index 4043a9d..99b1d00 100644
@@ -464,7 +464,7 @@ xlate_direnthdr(direnthdr_t *dh1, direnthdr_t *dh2, int dir)
 	     ptr1->dh_gen,
 	     ptr1->dh_checksum,
 	     ptr1->dh_sz,
-	     ptr1->dh_name );
+	     ptr1->dh_name);
 
 	mlog(MLOG_NITTY, "xlate_direnthdr: post-xlate\n"
 	     "\tdh_ino %llu\n"
@@ -476,7 +476,7 @@ xlate_direnthdr(direnthdr_t *dh1, direnthdr_t *dh2, int dir)
 	     ptr2->dh_gen,
 	     ptr2->dh_checksum,
 	     ptr2->dh_sz,
-	     ptr2->dh_name );
+	     ptr2->dh_name);
 }
 
 /*
@@ -510,7 +510,7 @@ xlate_direnthdr_v1(direnthdr_v1_t *dh1, direnthdr_v1_t *dh2, int dir)
 	     ptr1->dh_gen,
 	     ptr1->dh_sz,
 	     ptr1->dh_checksum,
-	     ptr1->dh_name );
+	     ptr1->dh_name);
 
 	mlog(MLOG_NITTY, "xlate_direnthdr_v1: post-xlate\n"
 	     "\tdh_ino %llu\n"
@@ -522,7 +522,7 @@ 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);
 }
 
 /*
common/cldmgr.c +67 -67

277 lines not on this page · raw message

common/cldmgr.h +8 -8
index c3384fa..ce3a382 100644
@@ -24,39 +24,39 @@
 /* cldmgr_init - initializes child management
  * returns FALSE if trouble encountered.
  */
-extern bool_t cldmgr_init( void );
+extern bool_t cldmgr_init(void);
 
 /* cldmgr_create - creates a child thread. returns FALSE if trouble
  * encountered
  */
-extern bool_t cldmgr_create( int ( * entry )( void *arg1 ),
+extern bool_t cldmgr_create(int (* entry)(void *arg1),
 			     ix_t streamix,
 			     char *descstr,
-			     void *arg1 );
+			     void *arg1);
 
 /* cldmgr_stop - asks all children to gracefully terminate, at the next
  * convenient point in their normal processing loop.
  */
-extern void cldmgr_stop( void );
+extern void cldmgr_stop(void);
 
 /* cldmgr_join - join child threads that have exited.
  * returns EXIT_NORMAL if all exited normally (or no threads have exited),
  * EXIT_FAULT if any threads requested a core dump, or another EXIT_*
  * value if any threads exited abnormally.
  */
-extern int cldmgr_join( void );
+extern int cldmgr_join(void);
 
 /* cldmgr_stop_requested - returns TRUE if the child should gracefully
  * terminate.
  */
-extern bool_t cldmgr_stop_requested( void );
+extern bool_t cldmgr_stop_requested(void);
 
 /* cldmgr_remainingcnt - returns number of children remaining
  */
-extern size_t cldmgr_remainingcnt( void );
+extern size_t cldmgr_remainingcnt(void);
 
 /* checks if any children serving any other streams are still alive
  */
-extern bool_t cldmgr_otherstreamsremain( ix_t streamix );
+extern bool_t cldmgr_otherstreamsremain(ix_t streamix);
 
 #endif /* CLDMGR_H */
common/cleanup.c +33 -33

145 lines not on this page · raw message

common/cleanup.h +8 -8
index a54f9db..1cf55d9 100644
@@ -24,20 +24,20 @@
 
 typedef void cleanup_t;
 
-extern void cleanup_init( void );
+extern void cleanup_init(void);
 
-extern cleanup_t *cleanup_register( void ( *funcp )( void *arg1, void *arg2 ),
+extern cleanup_t *cleanup_register(void (*funcp)(void *arg1, void *arg2),
 				    void *arg1,
-				    void *arg2 );
+				    void *arg2);
 
 extern cleanup_t *cleanup_register_early(
-				    void ( *funcp )( void *arg1, void *arg2 ),
+				    void (*funcp)(void *arg1, void *arg2),
 				    void *arg1,
-				    void *arg2 );
+				    void *arg2);
 
-extern void cleanup_cancel( cleanup_t *cleanupp );
+extern void cleanup_cancel(cleanup_t *cleanupp);
 
-extern void cleanup( void );
-extern void cleanup_early( void );
+extern void cleanup(void);
+extern void cleanup_early(void);
 
 #endif /* CLEANUP_H */
common/content.h +21 -21

108 lines not on this page · raw message

common/content_common.c +47 -47

140 lines not on this page · raw message

common/content_common.h +1 -1
index 368ac0f..3e5d98b 100644
@@ -18,6 +18,6 @@
 #ifndef CONTENT_COMMON_H
 #define CONTENT_COMMON_H
 
-extern bool_t Media_prompt_change( drive_t *drivep );
+extern bool_t Media_prompt_change(drive_t *drivep);
 
 #endif /* CONTENT_COMMON_H */
common/content_inode.h +44 -44

204 lines not on this page · raw message

common/dlog.c +142 -142

573 lines not on this page · raw message

common/dlog.h +16 -16
index 31ed9c2..7f0e41d 100644
@@ -23,41 +23,41 @@
  * abstracts dialogs with the operator
  */
 
-extern bool_t dlog_init( int argc, char *argv[ ] );
+extern bool_t dlog_init(int argc, char *argv[]);
 
 
 /* tells if dialogs are allowed;
  * will be false if invoked to right of unnamed pipe,
  * or if pipe to left breaks.
  */
-extern bool_t dlog_allowed( void );
+extern bool_t dlog_allowed(void);
 
 
 /* allows signal handler to notify dlog of broken write pipe
  */
-extern void dlog_desist( void );
+extern void dlog_desist(void);
 
 /* returns the dialog tty file descriptor. returns -1 if none
  */
-extern int dlog_fd( void );
+extern int dlog_fd(void);
 
 /* returns BOOL_TRUE if a dialog consumed the given signal
  */
-extern bool_t dlog_sighandler( int signo );
+extern bool_t dlog_sighandler(int signo);
 
 /* bracket a dialog session
  */
-extern void dlog_begin( char *preamblestr[ ], size_t preamblecnt );
-extern void dlog_end( char *postamblestr[ ], size_t postamblecnt );
+extern void dlog_begin(char *preamblestr[], size_t preamblecnt);
+extern void dlog_end(char *postamblestr[], size_t postamblecnt);
 
 
 /* multiple choice question abstraction. if any exception event index
  * set to IXMAX, that event will be ignored. returns index of selected
  * choice, or exception index if exception occured.
  */
-extern ix_t dlog_multi_query( char *querystr[ ],	/* pre-choices output */
+extern ix_t dlog_multi_query(char *querystr[],	/* pre-choices output */
 			      size_t querycnt,		/* length of above */
-			      char *choicestr[ ],	/* choices */
+			      char *choicestr[],	/* choices */
 			      size_t choicecnt,		/* length of above */
 			      char *hilitestr,		/* to distinguish */
 			      ix_t hiliteix,		/* highlighted choice */
@@ -67,8 +67,8 @@ extern ix_t dlog_multi_query( char *querystr[ ],	/* pre-choices output */
 			      ix_t timeoutix,		/* return if timeout */
 			      ix_t sigintix,		/* return if SIGINT */
 			      ix_t sighupix,		/* return if SIGHUP */
-			      ix_t sigquitix );		/* return if SIGQUIT */
-extern void dlog_multi_ack( char *ackstr[ ], size_t ackcnt );
+			      ix_t sigquitix);		/* return if SIGQUIT */
+extern void dlog_multi_ack(char *ackstr[], size_t ackcnt);
 
 /* call the caller's callback to display whatever, using provided print
  * function, then prompt for and return an arbitrary string. two types
@@ -78,9 +78,9 @@ 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 );
-extern ix_t dlog_string_query( dlog_ucbp_t ucb, /* user's print func */
+typedef void (* dlog_pcbp_t)(void *pctxp, char *s, ...);
+typedef void (* dlog_ucbp_t)(void *uctxp, dlog_pcbp_t pcb, void *pctxp);
+extern ix_t dlog_string_query(dlog_ucbp_t ucb, /* user's print func */
 			       void *uctxp,	/* user's context for above */
 			       char *bufp,	/* typed string returned in */
 			       size_t bufsz,	/* buffer size */
@@ -89,7 +89,7 @@ extern ix_t dlog_string_query( dlog_ucbp_t ucb, /* user's print func */
 			       ix_t sigintix,	/* return if SIGINT */
 			       ix_t sighupix,	/* return if SIGHUP */
 			       ix_t sigquitix,  /* return if SIGQUIT */
-			       ix_t okix );     /* return if successful */
-extern void dlog_string_ack( char *ackstr[ ], size_t ackcnt );
+			       ix_t okix);     /* return if successful */
+extern void dlog_string_ack(char *ackstr[], size_t ackcnt);
 
 #endif /* DLOG_H */
common/drive.c +85 -85

385 lines not on this page · raw message

common/drive.h +63 -63

331 lines not on this page · raw message

Signature · 1 line
2.19.1
author
#2 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 common/drive_minrmt.c | 2128 ++++++++++++++++++++---------------------
 1 file changed, 1064 insertions(+), 1064 deletions(-)
common/drive_minrmt.c +1064 -1064
index 04fed3e..e9be114 100644
@@ -237,118 +237,118 @@ typedef struct drive_context drive_context_t;
 /* macros for shortcut references to context. assumes a local variable named
  * 'contextp'.
  */
-#define	tape_recsz	( contextp->dc_recsz )
-#define	tape_blksz	( contextp->dc_blksz )
+#define	tape_recsz	(contextp->dc_recsz)
+#define	tape_blksz	(contextp->dc_blksz)
 
 /* declarations of externally defined global variables ***********************/
 
-extern void usage( void );
+extern void usage(void);
 #ifdef DUMP
 extern uint64_t hdr_mfilesz;
 #endif /* DUMP */
 
 /* remote tape protocol declarations (should be a system header file)
  */
-extern int rmtopen( char *, int, ... );
-extern int rmtclose( int );
-extern int rmtfstat( int, struct stat * );
-extern int rmtioctl( int, int, ... );
-extern int rmtread( int, void*, uint);
-extern int rmtwrite( int, const void *, uint);
+extern int rmtopen(char *, int, ...);
+extern int rmtclose(int);
+extern int rmtfstat(int, struct stat *);
+extern int rmtioctl(int, int, ...);
+extern int rmtread(int, void*, uint);
+extern int rmtwrite(int, const void *, uint);
 
 
 /* forward declarations of locally defined static functions ******************/
 
 /* strategy functions
  */
-static int ds_match( int, char *[], drive_t * );
-static int ds_instantiate( int, char *[], drive_t * );
+static int ds_match(int, char *[], drive_t *);
+static int ds_instantiate(int, char *[], drive_t *);
 
 /* manager operations
  */
-static bool_t do_init( drive_t * );
-static bool_t do_sync( drive_t * );
-static int do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, int * );
-static void do_return_read_buf( drive_t *, char *, size_t );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static int do_seek_mark( drive_t *, drive_mark_t * );
-static int do_next_mark( drive_t * );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static void do_end_read( drive_t * );
-static int do_begin_write( drive_t * );
-static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
-static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static int do_write( drive_t *, char *, size_t );
-static size_t do_get_align_cnt( drive_t * );
-static int do_end_write( drive_t *, off64_t * );
-static int do_fsf( drive_t *, int , int *);
-static int do_bsf( drive_t *, int , int *);
-static int do_rewind( drive_t * );
-static int do_erase( drive_t * );
-static int do_eject_media( drive_t * );
-static int do_get_device_class( drive_t * );
-static void do_display_metrics( drive_t *drivep );
-static void do_quit( drive_t * );
+static bool_t do_init(drive_t *);
+static bool_t do_sync(drive_t *);
+static int do_begin_read(drive_t *);
+static char *do_read(drive_t *, size_t , size_t *, int *);
+static void do_return_read_buf(drive_t *, char *, size_t);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static int do_seek_mark(drive_t *, drive_mark_t *);
+static int do_next_mark(drive_t *);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static void do_end_read(drive_t *);
+static int do_begin_write(drive_t *);
+static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
+static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static int do_write(drive_t *, char *, size_t);
+static size_t do_get_align_cnt(drive_t *);
+static int do_end_write(drive_t *, off64_t *);
+static int do_fsf(drive_t *, int , int *);
+static int do_bsf(drive_t *, int , int *);
+static int do_rewind(drive_t *);
+static int do_erase(drive_t *);
+static int do_eject_media(drive_t *);
+static int do_get_device_class(drive_t *);
+static void do_display_metrics(drive_t *drivep);
+static void do_quit(drive_t *);
 
 /* misc. local utility funcs
  */
-static int	mt_op(int , int , int );
-static int determine_write_error( int, int );
-static int read_label( drive_t *);
-static bool_t tape_rec_checksum_check( drive_context_t *, char * );
-static void set_recommended_sizes( drive_t * );
-static void display_access_failed_message( drive_t *);
-static bool_t get_tpcaps( drive_t * );
-static int prepare_drive( drive_t *drivep );
-static bool_t Open( drive_t *drivep );
-static void Close( drive_t *drivep );
-static int Read( drive_t *drivep,
+static int	mt_op(int , int , int);
+static int determine_write_error(int, int);
+static int read_label(drive_t *);
+static bool_t tape_rec_checksum_check(drive_context_t *, char *);
+static void set_recommended_sizes(drive_t *);
+static void display_access_failed_message(drive_t *);
+static bool_t get_tpcaps(drive_t *);
+static int prepare_drive(drive_t *drivep);
+static bool_t Open(drive_t *drivep);
+static void Close(drive_t *drivep);
+static int Read(drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
-		      int *errnop );
-static int Write( drive_t *drivep,
+		      int *errnop);
+static int Write(drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
-		       int *saved_errnop );
-static int record_hdr_validate( drive_t *drivep,
+		       int *saved_errnop);
+static int record_hdr_validate(drive_t *drivep,
 				     char *bufp,
-				     bool_t chkoffpr );
-static int ring_read( void *clientctxp, char *bufp );
-static int ring_write( void *clientctxp, char *bufp );
-static double percent64( off64_t num, off64_t denom );
-static int getrec( drive_t *drivep );
-static int write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
-                              bool_t xlatepr );
-static ring_msg_t * Ring_get( ring_t *ringp );
-static void Ring_reset(  ring_t *ringp, ring_msg_t *msgp );
-static void Ring_put(  ring_t *ringp, ring_msg_t *msgp );
-static int validate_media_file_hdr( drive_t *drivep );
-static void calc_max_lost( drive_t *drivep );
-static void display_ring_metrics( drive_t *drivep, int mlog_flags );
+				     bool_t chkoffpr);
+static int ring_read(void *clientctxp, char *bufp);
+static int ring_write(void *clientctxp, char *bufp);
+static double percent64(off64_t num, off64_t denom);
+static int getrec(drive_t *drivep);
+static int write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
+                              bool_t xlatepr);
+static ring_msg_t * Ring_get(ring_t *ringp);
+static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
+static void Ring_put(ring_t *ringp, ring_msg_t *msgp);
+static int validate_media_file_hdr(drive_t *drivep);
+static void calc_max_lost(drive_t *drivep);
+static void display_ring_metrics(drive_t *drivep, int mlog_flags);
 #ifdef CLRMTAUD
-static uint32_t rewind_and_verify( drive_t *drivep );
-static uint32_t erase_and_verify( drive_t *drivep );
-static uint32_t bsf_and_verify( drive_t *drivep );
-static uint32_t fsf_and_verify( drive_t *drivep );
+static uint32_t rewind_and_verify(drive_t *drivep);
+static uint32_t erase_and_verify(drive_t *drivep);
+static uint32_t bsf_and_verify(drive_t *drivep);
+static uint32_t fsf_and_verify(drive_t *drivep);
 #else /* CLRMTAUD */
-static short rewind_and_verify( drive_t *drivep );
-static short erase_and_verify( drive_t *drivep );
-static short bsf_and_verify( drive_t *drivep );
-static short fsf_and_verify( drive_t *drivep );
+static short rewind_and_verify(drive_t *drivep);
+static short erase_and_verify(drive_t *drivep);
+static short bsf_and_verify(drive_t *drivep);
+static short fsf_and_verify(drive_t *drivep);
 #endif /* CLRMTAUD */
-static bool_t set_best_blk_and_rec_sz( drive_t *drivep );
-static bool_t isefsdump( drive_t *drivep );
-static bool_t isxfsdumperasetape( drive_t *drivep );
+static bool_t set_best_blk_and_rec_sz(drive_t *drivep);
+static bool_t isefsdump(drive_t *drivep);
+static bool_t isxfsdumperasetape(drive_t *drivep);
 
 /* RMT trace stubs
  */
 #ifdef RMTDBG
-static int dbgrmtopen( char *, int );
-static int dbgrmtclose( int );
-static int dbgrmtioctl( int, int, void * );
-static int dbgrmtread( int, void *, uint);
-static int dbgrmtwrite( int, void *, uint);
+static int dbgrmtopen(char *, int);
+static int dbgrmtclose(int);
+static int dbgrmtioctl(int, int, void *);
+static int dbgrmtread(int, void *, uint);
+static int dbgrmtwrite(int, void *, uint);
 #endif /* RMTDBG */
 
 #define ERASE_MAGIC "$^*@++! This tape was quick erased by SGI xfsdump $^*@++!"
@@ -408,7 +408,7 @@ static uint32_t cmdlineblksize = 0;
  */
 /* ARGSUSED */
 static int
-ds_match( int argc, char *argv[], drive_t *drivep )
+ds_match(int argc, char *argv[], drive_t *drivep)
 {
 	int fd;
 	int c;
@@ -417,7 +417,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 	/* heuristics to determine if this is a drive.
 	 */
 
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 		return -10;
 	}
 
@@ -429,21 +429,21 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 	{
 		optind = 1;
 		opterr = 0;
-		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
+		while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 		   switch (c) {
 		      case GETOPT_BLOCKSIZE:
-			    if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			    if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					_("-%c argument missing\n"),
-					c );
+					c);
 				return -10;
 		    	    }
-			    cmdlineblksize = ( uint32_t )atoi( optarg );
+			    cmdlineblksize = (uint32_t)atoi(optarg);
 		            errno = 0;
-		            fd = open( drivep->d_pathname, O_RDONLY );
-		            if ( fd < 0 )
+		            fd = open(drivep->d_pathname, O_RDONLY);
+		            if (fd < 0)
 			            return -10;
-		            close( fd );
+		            close(fd);
 			    break;
 			case GETOPT_MINRMT:
 			    minrmt = BOOL_TRUE;
@@ -455,9 +455,9 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 			if (cmdlineblksize != 0)
 				return 20;
 		 	else
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					_("Minimal rmt cannot be used without specifying blocksize. Use -%c\n"),
-					GETOPT_BLOCKSIZE );
+					GETOPT_BLOCKSIZE);
 		}
 	}
 	/* catch all */
@@ -468,18 +468,18 @@ ds_match( int argc, char *argv[], drive_t *drivep )
  */
 /*ARGSUSED*/
 static bool_t
-ds_instantiate( int argc, char *argv[], drive_t *drivep )
+ds_instantiate(int argc, char *argv[], drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int c;
 
 	/* opportunity for sanity checking
 	 */
-	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
-	assert( sizeof( rec_hdr_t )
+	assert(sizeof(global_hdr_t) <= STAPE_HDR_SZ);
+	assert(sizeof(rec_hdr_t)
 		==
-		sizeofmember( drive_hdr_t, dh_specific ));
-	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
+		sizeofmember(drive_hdr_t, dh_specific));
+	assert(! (STAPE_MAX_RECSZ % PGSZ));
 
 	/* hook up the drive ops
 	 */
@@ -487,9 +487,9 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 
 	/* allocate context for the drive manager
 	 */
-	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
-	assert( contextp );
-	memset( ( void * )contextp, 0, sizeof( *contextp ));
+	contextp = (drive_context_t *)calloc(1, sizeof(drive_context_t));
+	assert(contextp);
+	memset((void *)contextp, 0, sizeof(*contextp));
 
 	/* do not enable a separate I/O thread,
 	 * more testing to be done first...
@@ -507,26 +507,26 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	contextp->dc_isQICpr = BOOL_FALSE;
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_RINGLEN:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
-			contextp->dc_ringlen = ( size_t )atoi( optarg );
-			if ( contextp->dc_ringlen < RINGLEN_MIN
+			contextp->dc_ringlen = (size_t)atoi(optarg);
+			if (contextp->dc_ringlen < RINGLEN_MIN
 			     ||
-			     contextp->dc_ringlen > RINGLEN_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+			     contextp->dc_ringlen > RINGLEN_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("-%c argument must be "
 				      "between %u and %u: ignoring %u\n"),
 				      c,
 				      RINGLEN_MIN,
 				      RINGLEN_MAX,
-				      contextp->dc_ringlen );
+				      contextp->dc_ringlen);
 				return BOOL_FALSE;
 			}
 			break;
@@ -545,23 +545,23 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 #ifdef DUMP
 		case GETOPT_OVERWRITE:
 			contextp->dc_overwritepr = BOOL_TRUE;
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      			_("Overwrite command line option\n") );
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      			_("Overwrite command line option\n"));
 			break;
 		case GETOPT_FILESZ:
-			if ( ! optarg || optarg [ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg [0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
-			contextp->dc_filesz = (off64_t)atoi( optarg ) * 1024 * 1024;
+			contextp->dc_filesz = (off64_t)atoi(optarg) * 1024 * 1024;
 			if (contextp->dc_filesz <= 0) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument must be a "
 				      "positive number (MB): ignoring %u\n"),
 				      c,
-				      contextp->dc_filesz );
+				      contextp->dc_filesz);
 				return BOOL_FALSE;
 			}
 			break;
@@ -585,37 +585,37 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	/* if threads not allowed, allocate a record buffer. otherwise
 	 * create a ring, from which buffers will be taken.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
-		assert( contextp->dc_bufp );
+	if (contextp->dc_singlethreadedpr) {
+		contextp->dc_bufp = (char *)memalign(PGSZ, STAPE_MAX_RECSZ);
+		assert(contextp->dc_bufp);
 	} else {
 		int rval;
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
 		      "ring op: create: ringlen == %u\n",
-		      contextp->dc_ringlen );
-		contextp->dc_ringp = ring_create( contextp->dc_ringlen,
+		      contextp->dc_ringlen);
+		contextp->dc_ringp = ring_create(contextp->dc_ringlen,
 						  STAPE_MAX_RECSZ,
 						  contextp->dc_ringpinnedpr,
 						  drivep->d_index,
 						  ring_read,
 						  ring_write,
-						  ( void * )drivep,
-						  &rval );
-		if ( ! contextp->dc_ringp ) {
-			if ( rval == ENOMEM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+						  (void *)drivep,
+						  &rval);
+		if (! contextp->dc_ringp) {
+			if (rval == ENOMEM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("unable to allocate memory "
-				      "for I/O buffer ring\n") );
-			} else if ( rval == E2BIG ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "for I/O buffer ring\n"));
+			} else if (rval == E2BIG) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not enough physical memory "
-				      "to pin down I/O buffer ring\n") );
-			} else if ( rval == EPERM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "to pin down I/O buffer ring\n"));
+			} else if (rval == EPERM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not allowed "
-				      "to pin down I/O buffer ring\n") );
+				      "to pin down I/O buffer ring\n"));
 			} else {
-				assert( 0 );
+				assert(0);
 			}
 			return BOOL_FALSE;
 		}
@@ -668,15 +668,15 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
  */
 /* ARGSUSED */
 static bool_t
-do_init( drive_t *drivep )
+do_init(drive_t *drivep)
 {
 #ifdef DUMP
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 #endif /* DUMP */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: init\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: init\n");
 
 #ifdef DUMP
 	/* fill in media strategy id: artifact of first version of xfsdump
@@ -693,10 +693,10 @@ do_init( drive_t *drivep )
  */
 /* ARGSUSED */
 static bool_t
-do_sync( drive_t *drivep )
+do_sync(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: sync\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: sync\n");
 
 	return BOOL_TRUE;
 }
@@ -711,32 +711,32 @@ do_sync( drive_t *drivep )
  *
  */
 static int
-do_begin_read( drive_t *drivep )
+do_begin_read(drive_t *drivep)
 {
         drive_context_t *contextp;
         int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: begin read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: begin read\n");
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_READ );
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! contextp->dc_recp );
+	assert(drivep->d_capabilities & DRIVE_CAP_READ);
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! contextp->dc_recp);
 
 	/* get a record buffer to use during initialization.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -745,38 +745,38 @@ do_begin_read( drive_t *drivep )
 	 * size previously determined.
 	 */
 	contextp->dc_iocnt = 0;
-	if ( contextp->dc_fd < 0 ) {
-		assert( contextp->dc_fd == -1 );
-		rval = prepare_drive( drivep );
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_fd < 0) {
+		assert(contextp->dc_fd == -1);
+		rval = prepare_drive(drivep);
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	} else {
-		rval = read_label( drivep ) ;
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+		rval = read_label(drivep) ;
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	}
-	assert( contextp->dc_iocnt == 1 );
+	assert(contextp->dc_iocnt == 1);
 					/* set by prepare_drive or read_label */
 
 	/* all is well. adjust context. don't kick off read-aheads just yet;
 	 * the client may not want this media file.
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
+	if (! contextp->dc_singlethreadedpr) {
 		contextp->dc_msgp->rm_op = RING_OP_NOP;
 		contextp->dc_msgp->rm_user = 0; /* do diff. use in do_seek */
-		Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -807,31 +807,31 @@ do_begin_read( drive_t *drivep )
  *
  */
 static char *
-do_read( drive_t *drivep,
+do_read(drive_t *drivep,
 	 size_t wantedcnt,
 	 size_t *actualcntp,
-	 int *rvalp )
+	 int *rvalp)
 {
 	drive_context_t *contextp;
 	size_t availcnt;
 	size_t actualcnt;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: read: wanted %u (0x%x)\n",
 	      wantedcnt,
-	      wantedcnt );
+	      wantedcnt);
 
 	/* get context ptrs
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( wantedcnt > 0 );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(wantedcnt > 0);
 
 	/* clear the return status field
 	 */
@@ -839,30 +839,30 @@ do_read( drive_t *drivep,
 
 	/* read a new record if necessary
 	 */
-	rval = getrec( drivep );
-	if ( rval ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+	rval = getrec(drivep);
+	if (rval) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "rmt drive op read returning error rval=%d\n",
-		      rval );
+		      rval);
 		*rvalp = rval;
 		return 0;
 	}
 
 	/* figure how much data is available, and how much should be supplied
 	 */
-	availcnt = ( size_t )( contextp->dc_dataendp - contextp->dc_nextp );
-	actualcnt = min( wantedcnt, availcnt );
+	availcnt = (size_t)(contextp->dc_dataendp - contextp->dc_nextp);
+	actualcnt = min(wantedcnt, availcnt);
 
 	/* adjust the context
 	 */
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "rmt drive op read actual == %d (0x%x)\n",
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	*actualcntp = actualcnt;
 	return contextp->dc_ownedp;
@@ -877,29 +877,29 @@ do_read( drive_t *drivep,
  */
 /* ARGSUSED */
 static void
-do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
+do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	/* REFERENCED */
 	size_t ownedcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: return read buf: sz %d (0x%x)\n",
 	      retcnt,
-	      retcnt );
+	      retcnt);
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( bufp == contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(bufp == contextp->dc_ownedp);
 
 	/* calculate how much the caller owns
 	 */
-	assert( contextp->dc_nextp >= contextp->dc_ownedp );
-	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	assert( ownedcnt == retcnt );
+	assert(contextp->dc_nextp >= contextp->dc_ownedp);
+	ownedcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
+	assert(ownedcnt == retcnt);
 
 	/* take possession of buffer portion
 	 */
@@ -908,11 +908,11 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
 	/* if caller is done with this record, take the buffer back
 	 * and (if ring in use) give buffer to ring for read-ahead.
 	 */
-	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
-		assert( contextp->dc_nextp == contextp->dc_dataendp );
-		if ( ! contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_nextp >= contextp->dc_dataendp) {
+		assert(contextp->dc_nextp == contextp->dc_dataendp);
+		if (! contextp->dc_singlethreadedpr) {
 			contextp->dc_msgp->rm_op = RING_OP_READ;
-			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -930,29 +930,29 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
  *	void
  */
 static void
-do_get_mark( drive_t *drivep, drive_mark_t *markp )
+do_get_mark(drive_t *drivep, drive_mark_t *markp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t offset;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: get mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: get mark\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 	/* the mark is simply the offset into the media file of the
 	 * next byte to be read.
 	 */
-	offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
-		offset += ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
+	offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
+		offset += (off64_t)(contextp->dc_nextp - contextp->dc_recp);
 	}
 
-	*markp = ( drive_mark_t )offset;
+	*markp = (drive_mark_t)offset;
 
 	return;
 }
@@ -969,7 +969,7 @@ typedef enum { SEEKMODE_BUF, SEEKMODE_RAW } seekmode_t;
  *
  */
 static int
-do_seek_mark( drive_t *drivep, drive_mark_t *markp )
+do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 {
 	drive_context_t	*contextp;
 	off64_t wantedoffset;
@@ -981,55 +981,55 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 
 	/* the desired mark is passed by reference, and is really just an
 	 * offset into the raw (incl rec hdrs) read stream
 	 */
-	wantedoffset = *( off64_t * )markp;
+	wantedoffset = *(off64_t *)markp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: seek mark: %lld (0x%llx)\n",
 	      wantedoffset,
-	      wantedoffset );
+	      wantedoffset);
 
 	/* determine the current offset. assert that the wanted offset is
 	 * not less than the current offset.
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset >= currentoffset );
+	assert(wantedoffset >= currentoffset);
 
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
 	 */
-	if ( contextp->dc_recp ) {
+	if (contextp->dc_recp) {
 		off64_t nextrecoffset;
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		nextrecoffset = contextp->dc_reccnt  * ( off64_t )tape_recsz
+		nextrecoffset = contextp->dc_reccnt  * (off64_t)tape_recsz
 				+
-				( off64_t )rechdrp->rec_used;
-		if ( wantedoffset >= nextrecoffset ) {
+				(off64_t)rechdrp->rec_used;
+		if (wantedoffset >= nextrecoffset) {
 			uint32_t recoff;
 			size_t wantedcnt;
 			char *dummybufp;
@@ -1039,39 +1039,39 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			/* if this is the last record, the wanted offset
 			 * must be just after it.
 			 */
-			if ( rechdrp->rec_used < tape_recsz ) {
-				assert( wantedoffset == nextrecoffset );
+			if (rechdrp->rec_used < tape_recsz) {
+				assert(wantedoffset == nextrecoffset);
 			}
 
 			/* figure how much to ask for
 			 */
-			assert( contextp->dc_nextp >= contextp->dc_recp );
-			recoff = ( uint32_t )( contextp->dc_nextp
+			assert(contextp->dc_nextp >= contextp->dc_recp);
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			wantedcnt = ( size_t )( rechdrp->rec_used
+						contextp->dc_recp);
+			wantedcnt = (size_t)(rechdrp->rec_used
 						-
-						recoff );
+						recoff);
 
 			/* eat that much tape
 			 */
 			rval = 0;
-			dummybufp = do_read( drivep,
+			dummybufp = do_read(drivep,
 					     wantedcnt,
 					     &actualcnt,
-					     &rval );
-			if ( rval ) {
+					     &rval);
+			if (rval) {
 				return rval;
 			}
-			assert( actualcnt == wantedcnt );
-			do_return_read_buf( drivep, dummybufp, actualcnt );
-			currentoffset += ( off64_t )actualcnt;
-			assert( currentoffset == nextrecoffset );
-			assert( wantedoffset >= currentoffset );
-			assert( ! contextp->dc_recp );
-			assert( currentoffset
+			assert(actualcnt == wantedcnt);
+			do_return_read_buf(drivep, dummybufp, actualcnt);
+			currentoffset += (off64_t)actualcnt;
+			assert(currentoffset == nextrecoffset);
+			assert(wantedoffset >= currentoffset);
+			assert(! contextp->dc_recp);
+			assert(currentoffset
 				==
-				contextp->dc_reccnt * ( off64_t )tape_recsz );
+				contextp->dc_reccnt * (off64_t)tape_recsz);
 		}
 	}
 
@@ -1082,208 +1082,208 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 * made it there, suspend read-ahead, eat those readahead records,
 	 * FSR the remaining, and resume readahead.
 	 */
-	if ( contextp->dc_canfsrpr
+	if (contextp->dc_canfsrpr
 	     &&
-	     wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	     wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
 
-		assert( ! contextp->dc_recp );
-		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
-		if ( contextp->dc_singlethreadedpr ) {
+		assert(! contextp->dc_recp);
+		wantedreccnt = wantedoffset / (off64_t)tape_recsz;
+		if (contextp->dc_singlethreadedpr) {
 			seekmode = SEEKMODE_RAW;
 		} else {
 			seekmode = SEEKMODE_BUF;
 		}
-		assert( wantedreccnt != 0 ); /* so NOP below can be
+		assert(wantedreccnt != 0); /* so NOP below can be
 					      * distinguished from use
 					      * in do_begin_read
 					      */
-		while ( contextp->dc_reccnt < wantedreccnt ) {
+		while (contextp->dc_reccnt < wantedreccnt) {
 			off64_t recskipcnt64;
 			off64_t recskipcnt64remaining;
 
-			if ( seekmode == SEEKMODE_BUF ) {
+			if (seekmode == SEEKMODE_BUF) {
 				ring_stat_t rs;
-				assert( ! contextp->dc_msgp );
+				assert(! contextp->dc_msgp);
 				contextp->dc_msgp =
-						Ring_get( contextp->dc_ringp );
+						Ring_get(contextp->dc_ringp);
 				rs = contextp->dc_msgp->rm_stat;
-				if ( rs == RING_STAT_ERROR ) {
+				if (rs == RING_STAT_ERROR) {
 					contextp->dc_errorpr = BOOL_TRUE;
 					return contextp->dc_msgp->rm_rval;
 				}
-				if ( rs != RING_STAT_OK
+				if (rs != RING_STAT_OK
 				     &&
 				     rs != RING_STAT_INIT
 				     &&
-				     rs != RING_STAT_NOPACK ) {
-					assert( 0 );
+				     rs != RING_STAT_NOPACK) {
+					assert(0);
 					contextp->dc_errorpr = BOOL_TRUE;
 					return DRIVE_ERROR_CORE;
 				}
-				if ( rs == RING_STAT_OK ) {
+				if (rs == RING_STAT_OK) {
 					contextp->dc_reccnt++;
 				}
-				if ( rs == RING_STAT_NOPACK
+				if (rs == RING_STAT_NOPACK
 				     &&
 				     contextp->dc_msgp->rm_user
 				     ==
-				     wantedreccnt ) {
+				     wantedreccnt) {
 					seekmode = SEEKMODE_RAW;
 				}
 				contextp->dc_msgp->rm_op = RING_OP_NOP;
 				contextp->dc_msgp->rm_user = wantedreccnt;
-				Ring_put( contextp->dc_ringp,
-					  contextp->dc_msgp );
+				Ring_put(contextp->dc_ringp,
+					  contextp->dc_msgp);
 				contextp->dc_msgp = 0;
 				continue;
 			}
 
-			assert( contextp->dc_reccnt == contextp->dc_iocnt );
-			assert( wantedreccnt > contextp->dc_reccnt );
+			assert(contextp->dc_reccnt == contextp->dc_iocnt);
+			assert(wantedreccnt > contextp->dc_reccnt);
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
-			while ( recskipcnt64remaining ) {
+			while (recskipcnt64remaining) {
 				int recskipcnt;
 				int saved_errno;
 				int rval;
 
-				assert( recskipcnt64remaining > 0 );
-				if ( recskipcnt64remaining > INTGENMAX ) {
+				assert(recskipcnt64remaining > 0);
+				if (recskipcnt64remaining > INTGENMAX) {
 					recskipcnt = INTGENMAX;
 				} else {
-					recskipcnt = ( int )
+					recskipcnt = (int)
 						     recskipcnt64remaining;
 				}
-				assert( recskipcnt > 0 );
-				rval = mt_op( contextp->dc_fd,
+				assert(recskipcnt > 0);
+				rval = mt_op(contextp->dc_fd,
 					      MTFSR,
-					      recskipcnt );
+					      recskipcnt);
 				saved_errno = errno;
-				if ( rval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				if (rval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					      _("could not forward space %d "
 					      "tape blocks: "
 					      "rval == %d, errno == %d (%s)\n"),
 					      rval,
 					      saved_errno,
-					      strerror( saved_errno ));
+					      strerror(saved_errno));
 					return DRIVE_ERROR_MEDIA;
 				}
-				recskipcnt64remaining -= ( off64_t )recskipcnt;
+				recskipcnt64remaining -= (off64_t)recskipcnt;
 			}
 			contextp->dc_reccnt += recskipcnt64;
 			contextp->dc_iocnt += recskipcnt64;
 			currentoffset = contextp->dc_reccnt
 					*
-					( off64_t )tape_recsz;
-			assert( wantedoffset >= currentoffset );
-			assert( wantedoffset - currentoffset
+					(off64_t)tape_recsz;
+			assert(wantedoffset >= currentoffset);
+			assert(wantedoffset - currentoffset
 				<
-				( off64_t )tape_recsz );
+				(off64_t)tape_recsz);
 		}
 	}
 
 	/* remove excess records by eating them. won't be any if
 	 * FSR supported
 	 */
-	while ( wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	while (wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 		int rval;
 
-		assert( ! contextp->dc_recp );
+		assert(! contextp->dc_recp);
 
 		/* figure how much to ask for. to eat an entire record,
 		 * ask for a record sans the header. do_read will eat
 		 * the header, we eat the rest.
 		 */
-		wantedcnt = ( size_t )( tape_recsz - STAPE_HDR_SZ );
+		wantedcnt = (size_t)(tape_recsz - STAPE_HDR_SZ);
 
 		/* eat that much tape
 		 */
 		rval = 0;
-		dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		if ( rval ) {
+		dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		if (rval) {
 			return rval;
 		}
-		assert( actualcnt == wantedcnt );
-		do_return_read_buf( drivep, dummybufp, actualcnt );
-		assert( ! contextp->dc_recp );
-		currentoffset += ( off64_t )tape_recsz;
-		assert( currentoffset
+		assert(actualcnt == wantedcnt);
+		do_return_read_buf(drivep, dummybufp, actualcnt);
+		assert(! contextp->dc_recp);
+		currentoffset += (off64_t)tape_recsz;
+		assert(currentoffset
 			==
-			contextp->dc_reccnt * ( off64_t )tape_recsz );
+			contextp->dc_reccnt * (off64_t)tape_recsz);
 	}
 
 	/* eat that portion of the next record leading up to the
 	 * desired offset.
 	 */
-	if ( wantedoffset != currentoffset ) {
+	if (wantedoffset != currentoffset) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 
-		assert( wantedoffset > currentoffset );
-		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
-		wantedcnt = ( size_t )( wantedoffset - currentoffset );
-		if ( contextp->dc_recp ) {
+		assert(wantedoffset > currentoffset);
+		assert(wantedoffset - currentoffset < (off64_t)tape_recsz);
+		wantedcnt = (size_t)(wantedoffset - currentoffset);
+		if (contextp->dc_recp) {
 			uint32_t recoff;
 #ifdef DEBUG
-			rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+			rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
-			recoff = ( uint32_t )( contextp->dc_nextp
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			assert( recoff <= tape_recsz );
-			assert( rechdrp->rec_used <= tape_recsz );
-			assert( recoff >= STAPE_HDR_SZ );
-			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-			assert( recoff <= rechdrp->rec_used );
-			assert( recoff + wantedcnt <= rechdrp->rec_used );
+						contextp->dc_recp);
+			assert(recoff <= tape_recsz);
+			assert(rechdrp->rec_used <= tape_recsz);
+			assert(recoff >= STAPE_HDR_SZ);
+			assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+			assert(recoff <= rechdrp->rec_used);
+			assert(recoff + wantedcnt <= rechdrp->rec_used);
 		} else {
-			assert( wantedcnt >= STAPE_HDR_SZ );
+			assert(wantedcnt >= STAPE_HDR_SZ);
 			wantedcnt -= STAPE_HDR_SZ;
 		}
 
 		/* eat that much tape
 		 */
-		if ( wantedcnt > 0 ) {
+		if (wantedcnt > 0) {
 		    int rval;
 		    rval = 0;
-		    dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		    if ( rval ) {
+		    dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		    if (rval) {
 			    return rval;
 		    }
-		    assert( actualcnt == wantedcnt );
-		    do_return_read_buf( drivep, dummybufp, actualcnt );
+		    assert(actualcnt == wantedcnt);
+		    do_return_read_buf(drivep, dummybufp, actualcnt);
 		}
 	}
 
 	/* as a sanity check, refigure the current offset and make sure
 	 * it is equal to the wanted offset
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset == currentoffset );
+	assert(wantedoffset == currentoffset);
 
 	return 0;
 }
@@ -1299,7 +1299,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_next_mark( drive_t *drivep )
+do_next_mark(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	rec_hdr_t *rechdrp;
@@ -1314,69 +1314,69 @@ do_next_mark( drive_t *drivep )
 
 	/* assert protocol being followed.
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: next mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: next mark\n");
 
 	trycnt = 0;
 
-	if ( contextp->dc_errorpr ) {
+	if (contextp->dc_errorpr) {
 		goto resetring;
 	} else {
 		goto noerrorsearch;
 	}
 
 noerrorsearch:
-	for ( ; ; ) {
-		rval = getrec( drivep );
-		if ( rval == DRIVE_ERROR_CORRUPTION ) {
+	for (; ;) {
+		rval = getrec(drivep);
+		if (rval == DRIVE_ERROR_CORRUPTION) {
 			goto resetring;
-		} else if ( rval ) {
+		} else if (rval) {
 			return rval;
 		}
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		assert( rechdrp->first_mark_offset != 0 );
-		if ( rechdrp->first_mark_offset > 0 ) {
+		assert(rechdrp->first_mark_offset != 0);
+		if (rechdrp->first_mark_offset > 0) {
 			 off64_t markoff = rechdrp->first_mark_offset
 					   -
 					   rechdrp->file_offset;
-			 off64_t curoff = ( off64_t )( contextp->dc_nextp
+			 off64_t curoff = (off64_t)(contextp->dc_nextp
 						       -
-						       contextp->dc_recp );
-			 assert( markoff > 0 );
-			 assert( curoff > 0 );
-			 if ( markoff >= curoff ) {
+						       contextp->dc_recp);
+			 assert(markoff > 0);
+			 assert(curoff > 0);
+			 if (markoff >= curoff) {
 				break;
 			}
 		}
 
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
 		contextp->dc_reccnt++;
 	}
 
-	assert( rechdrp->first_mark_offset - rechdrp->file_offset
+	assert(rechdrp->first_mark_offset - rechdrp->file_offset
 		<=
-		( off64_t )tape_recsz );
+		(off64_t)tape_recsz);
 	contextp->dc_nextp = contextp->dc_recp
 			     +
-			     ( size_t )( rechdrp->first_mark_offset
+			     (size_t)(rechdrp->first_mark_offset
 					 -
-					 rechdrp->file_offset );
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+					 rechdrp->file_offset);
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	if (contextp->dc_nextp == contextp->dc_dataendp) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1386,124 +1386,124 @@ noerrorsearch:
 	return 0;
 
 resetring:
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
 
 	/* get a record buffer and cast a record header pointer
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	goto readrecord;
 
 readrecord:
 	trycnt++;
-	if ( trycnt > maxtrycnt ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("unable to locate next mark in media file\n") );
+	if (trycnt > maxtrycnt) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("unable to locate next mark in media file\n"));
 		return DRIVE_ERROR_MEDIA;
 	}
 
-	nread = Read( drivep, contextp->dc_recp, tape_recsz, &saved_errno );
+	nread = Read(drivep, contextp->dc_recp, tape_recsz, &saved_errno);
 	goto validateread;
 
 validateread:
-	if ( nread == ( int )tape_recsz ) {
+	if (nread == (int)tape_recsz) {
 		goto validatehdr;
 	}
 
-	if ( nread >= 0 ) {
-		assert( ( size_t )nread <= tape_recsz );
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (nread >= 0) {
+		assert((size_t)nread <= tape_recsz);
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "short read (nread == %d, record size == %d)\n",
 		      nread,
-		      tape_recsz );
+		      tape_recsz);
 		goto getbeyonderror;
 	}
 
 	/* some other error
 	 */
-	mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 	      _("unexpected error attempting to read record: "
 	      "read returns %d, errno %s (%s)\n"),
 	      nread,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 
 	goto getbeyonderror;
 
 validatehdr:
-	rval = record_hdr_validate( drivep, contextp->dc_recp, BOOL_FALSE );
+	rval = record_hdr_validate(drivep, contextp->dc_recp, BOOL_FALSE);
 
-	if ( rval
+	if (rval
 	     &&
-	     ( contextp->dc_isQICpr == BOOL_TRUE
+	     (contextp->dc_isQICpr == BOOL_TRUE
 	       ||
-	       contextp->dc_isQICpr == BOOL_UNKNOWN )) {
+	       contextp->dc_isQICpr == BOOL_UNKNOWN)) {
 		goto huntQIC;
 	}
 
-	if ( rval ) {
+	if (rval) {
 		goto readrecord;
 	}
 
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
-	if ( rechdrp->first_mark_offset < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+	if (rechdrp->first_mark_offset < 0) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 		      _("valid record %lld but no mark\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		goto readrecord;
 	}
 
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
 	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
-	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
-	assert( markoff < ( off64_t )tape_recsz );
-	assert( rechdrp->rec_used > STAPE_HDR_SZ );
-	assert( rechdrp->rec_used < tape_recsz );
+	assert(markoff >= (off64_t)STAPE_HDR_SZ);
+	assert(markoff < (off64_t)tape_recsz);
+	assert(rechdrp->rec_used > STAPE_HDR_SZ);
+	assert(rechdrp->rec_used < tape_recsz);
 
 	goto alliswell;
 
 alliswell:
-	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_nextp = contextp->dc_recp + (size_t)markoff;
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
-	assert( contextp->dc_dataendp <= contextp->dc_recendp );
-	assert( contextp->dc_nextp < contextp->dc_dataendp );
+	assert(contextp->dc_dataendp <= contextp->dc_recendp);
+	assert(contextp->dc_nextp < contextp->dc_dataendp);
 	contextp->dc_errorpr = BOOL_FALSE;
 
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("resynchronized at record %lld "
 	      "offset %u\n"),
 	      contextp->dc_iocnt - 1,
 	      contextp->dc_nextp
 	      -
-	      contextp->dc_recp );
+	      contextp->dc_recp);
 	return 0;
 
 getbeyonderror:
-	rval = mt_op( contextp->dc_fd, MTFSR, 1 );
+	rval = mt_op(contextp->dc_fd, MTFSR, 1);
 	saved_errno = errno;
 
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not forward space one tape block beyond "
 		      "read error: rval == %d, errno == %d (%s)\n"),
 		      rval,
 		      saved_errno,
-		      strerror( saved_errno ));
+		      strerror(saved_errno));
 		return DRIVE_ERROR_MEDIA;
 	}
 
@@ -1515,12 +1515,12 @@ huntQIC:
 	 * the following blocks to the head of the record buffer, and try
 	 * to read the remaining blocks in the record.
 	 */
-	for ( p = contextp->dc_recp + QIC_BLKSZ
+	for (p = contextp->dc_recp + QIC_BLKSZ
 	      ;
 	      p < contextp->dc_recendp
 	      ;
-	      p += QIC_BLKSZ ) {
-		if ( *( uint64_t * )p == STAPE_MAGIC ) {
+	      p += QIC_BLKSZ) {
+		if (*(uint64_t *)p == STAPE_MAGIC) {
 			goto adjustQIC;
 		}
 	}
@@ -1528,14 +1528,14 @@ huntQIC:
 	goto readrecord;
 
 adjustQIC:
-	tailsz = ( size_t )( contextp->dc_recendp - p );
-	memcpy( ( void * )contextp->dc_recp,
-		( void * )p,
-		tailsz );
-	nread = Read( drivep,
+	tailsz = (size_t)(contextp->dc_recendp - p);
+	memcpy((void *)contextp->dc_recp,
+		(void *)p,
+		tailsz);
+	nread = Read(drivep,
 		      contextp->dc_recp + tailsz,
 		      tape_recsz - tailsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	goto validateread;
 }
@@ -1548,27 +1548,27 @@ adjustQIC:
  *	void
  */
 static void
-do_end_read( drive_t *drivep )
+do_end_read(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: end read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: end read\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
 	/* In the scsi version, read_label() does a status command to the
 	 * drive to then decide if doing a 'fsf' is appropriate.  For minrmt,
 	 * we don't have the status command so we need to space forward at
 	 * the moment we know we need to go forward... which is here.
 	 */
-	( void )fsf_and_verify( drivep );
+	(void)fsf_and_verify(drivep);
 
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 
@@ -1584,7 +1584,7 @@ do_end_read( drive_t *drivep )
  * 	DRIVE_ERROR_... on failure
  */
 static int
-do_begin_write( drive_t *drivep )
+do_begin_write(drive_t *drivep)
 {
 	drive_context_t		*contextp;
 	drive_hdr_t		*dwhdrp;
@@ -1605,34 +1605,34 @@ do_begin_write( drive_t *drivep )
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: begin write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: begin write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! drivep->d_markrecheadp );
-	assert( ! contextp->dc_recp );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! drivep->d_markrecheadp);
+	assert(! contextp->dc_recp);
 
 	/* get pointers into global write header
 	 */
 	gwhdrp = drivep->d_gwritehdrp;
 	dwhdrp = drivep->d_writehdrp;
-	tpwhdrp = ( rec_hdr_t * )dwhdrp->dh_specific;
+	tpwhdrp = (rec_hdr_t *)dwhdrp->dh_specific;
 
 	/* must already be open. The only way to open is to do a begin_read.
 	 * so all interaction with tape requires reading first.
 	 */
-	assert( contextp->dc_fd != -1 );
+	assert(contextp->dc_fd != -1);
 
 	/* fill in write header's drive specific info
 	 */
 	tpwhdrp->magic = STAPE_MAGIC;
 	tpwhdrp->version = STAPE_VERSION;
-	tpwhdrp->blksize = ( int32_t )tape_blksz;
-	tpwhdrp->recsize = ( int32_t )tape_recsz;
+	tpwhdrp->blksize = (int32_t)tape_blksz;
+	tpwhdrp->recsize = (int32_t)tape_recsz;
 	tpwhdrp->rec_used = 0;
 	tpwhdrp->file_offset = 0;
 	tpwhdrp->first_mark_offset= 0;
@@ -1641,15 +1641,15 @@ do_begin_write( drive_t *drivep )
 	/* get a record buffer. will be used for the media file header,
 	 * and is needed to "prime the pump" for first call to do_write.
 	 */
-	assert( ! contextp->dc_recp );
-	if ( contextp->dc_singlethreadedpr ) {
-		assert( contextp->dc_bufp );
+	assert(! contextp->dc_recp);
+	if (contextp->dc_singlethreadedpr) {
+		assert(contextp->dc_bufp);
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		assert( ! contextp->dc_msgp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		assert(! contextp->dc_msgp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -1657,7 +1657,7 @@ do_begin_write( drive_t *drivep )
 	 * being produced!
 	 */
 	contextp->dc_iocnt = 0;
-	memset( ( void * )contextp->dc_recp, 0, tape_recsz );
+	memset((void *)contextp->dc_recp, 0, tape_recsz);
 
 	tmpgh  = (global_hdr_t *)contextp->dc_recp;
 	tmpdh  = (drive_hdr_t *)tmpgh->gh_upper;
@@ -1679,12 +1679,12 @@ do_begin_write( drive_t *drivep )
 
 	/* checksum the global header
 	 */
-	global_hdr_checksum_set( tmpgh );
+	global_hdr_checksum_set(tmpgh);
 
-	rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE );
-	if ( rval ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE);
+	if (rval) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1694,7 +1694,7 @@ do_begin_write( drive_t *drivep )
 	/* prepare the drive context. must have a record buffer ready to
 	 * go, header initialized.
 	 */
-	assert( ! contextp->dc_ownedp );
+	assert(! contextp->dc_ownedp);
 	contextp->dc_reccnt = 1; /* count the header record */
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
@@ -1704,12 +1704,12 @@ do_begin_write( drive_t *drivep )
 	rechdrp = (rec_hdr_t*)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	/* set mode now so operators will work
 	 */
@@ -1724,10 +1724,10 @@ do_begin_write( drive_t *drivep )
  * in record.
  */
 static void
-do_set_mark( drive_t *drivep,
+do_set_mark(drive_t *drivep,
 	     drive_mcbfp_t cbfuncp,
 	     void *cbcontextp,
-	     drive_markrec_t *markrecp )
+	     drive_markrec_t *markrecp)
 {
 	drive_context_t *contextp;
 	off64_t nextoff;
@@ -1735,34 +1735,34 @@ do_set_mark( drive_t *drivep,
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
 
 	/* calculate and fill in the mark record offset
 	 */
-	assert( contextp->dc_recp );
-	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
+	assert(contextp->dc_recp);
+	nextoff = contextp->dc_reccnt * (off64_t)tape_recsz
 		  +
-		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
-	markrecp->dm_log = ( drive_mark_t )nextoff;
+		  (off64_t)(contextp->dc_nextp - contextp->dc_recp);
+	markrecp->dm_log = (drive_mark_t)nextoff;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: set mark: %lld (0x%llx)\n",
 	      nextoff,
-	      nextoff );
+	      nextoff);
 
 	/* note the location of the first mark in this tape record.
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-	if ( rechdrp->first_mark_offset == -1LL ) {
-		assert( nextoff != -1LL );
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
+	if (rechdrp->first_mark_offset == -1LL) {
+		assert(nextoff != -1LL);
 		rechdrp->first_mark_offset = nextoff;
 	}
 
@@ -1771,11 +1771,11 @@ do_set_mark( drive_t *drivep,
 	markrecp->dm_cbfuncp = cbfuncp;
 	markrecp->dm_cbcontextp = cbcontextp;
 	markrecp->dm_nextp = 0;
-	if ( drivep->d_markrecheadp == 0 ) {
+	if (drivep->d_markrecheadp == 0) {
 		drivep->d_markrecheadp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	} else {
-		assert( drivep->d_markrectailp );
+		assert(drivep->d_markrectailp);
 		drivep->d_markrectailp->dm_nextp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	}
@@ -1790,7 +1790,7 @@ do_set_mark( drive_t *drivep,
  *	"actual_bufszp" points to the size of the buffer
  */
 static char *
-do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
+do_get_write_buf(drive_t *drivep, size_t wantedcnt, size_t *actualcntp)
 {
 	drive_context_t *contextp;
 	size_t remainingcnt;
@@ -1798,32 +1798,32 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* figure how much is available; supply the min of what is
 	 * available and what is wanted.
 	 */
-	remainingcnt = ( size_t )( contextp->dc_recendp - contextp->dc_nextp );
-	actualcnt = min( remainingcnt, wantedcnt );
+	remainingcnt = (size_t)(contextp->dc_recendp - contextp->dc_nextp);
+	actualcnt = min(remainingcnt, wantedcnt);
 	*actualcntp = actualcnt;
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: get write buf: wanted %u (0x%x) actual %u (0x%x)\n",
 	      wantedcnt,
 	      wantedcnt,
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	return contextp->dc_ownedp;
 }
@@ -1841,7 +1841,7 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
  */
 /* ARGSUSED */
 static int
-do_write( drive_t *drivep, char *bufp, size_t retcnt )
+do_write(drive_t *drivep, char *bufp, size_t retcnt)
 {
 	drive_context_t *contextp;
 	rec_hdr_t *rechdrp;
@@ -1852,33 +1852,33 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* get drive context and pointer to global write hdr
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 	gwhdrp = drivep->d_gwritehdrp;
 
 	/* calculate how many bytes we believe caller is holding
 	 */
-	heldcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
+	heldcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: write: retcnt %u (0x%x) heldcnt %u (0x%x)\n",
 	      retcnt,
 	      retcnt,
 	      heldcnt,
-	      heldcnt );
+	      heldcnt);
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp <= contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp <= contextp->dc_recendp);
 
 	/* verify the caller is returning exactly what is held
 	 */
-	assert( bufp == contextp->dc_ownedp );
-	assert( retcnt == heldcnt );
+	assert(bufp == contextp->dc_ownedp);
+	assert(retcnt == heldcnt);
 
 	/* take it back
 	 */
@@ -1887,30 +1887,30 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	/* if some portion of the record buffer has not yet been
 	 * held by the client, just return.
 	 */
-	if ( contextp->dc_nextp < contextp->dc_recendp ) {
+	if (contextp->dc_nextp < contextp->dc_recendp) {
 		return 0;
 	}
 
 	/* record in record header that entire record is used
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->rec_used = tape_recsz;
 
 	/* write out the record buffer and get a new one.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE );
+	if (contextp->dc_singlethreadedpr) {
+		rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE);
 		last_rec_wrtn_wo_err = contextp->dc_reccnt; /* conv cnt to ix */
 	} else {
 		contextp->dc_msgp->rm_op = RING_OP_WRITE;
 		contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-		Ring_put( contextp->dc_ringp,
-			  contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp,
+			  contextp->dc_msgp);
 		contextp->dc_msgp = 0;
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 		last_rec_wrtn_wo_err = contextp->dc_msgp->rm_user;
-		switch( contextp->dc_msgp->rm_stat ) {
+		switch(contextp->dc_msgp->rm_stat) {
 		case RING_STAT_OK:
 		case RING_STAT_INIT:
 			rval = 0;
@@ -1919,7 +1919,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 			rval = contextp->dc_msgp->rm_rval;
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 			return DRIVE_ERROR_CORE;
 		}
 	}
@@ -1927,7 +1927,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	/* check for errors. if none, commit all marks before a safety margin
 	 * before the no error offset.
 	 */
-	if ( rval ) {
+	if (rval) {
 		contextp->dc_errorpr = BOOL_TRUE;
 	} else {
 		off64_t recs_wrtn_wo_err;
@@ -1935,8 +1935,8 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 		off64_t bytes_committed;
 		recs_wrtn_wo_err = last_rec_wrtn_wo_err + 1;
 		recs_committed = recs_wrtn_wo_err - contextp->dc_lostrecmax;
-		bytes_committed = recs_committed * ( off64_t )tape_recsz;
-		drive_mark_commit( drivep, bytes_committed );
+		bytes_committed = recs_committed * (off64_t)tape_recsz;
+		drive_mark_commit(drivep, bytes_committed);
 	}
 
 	/* adjust context
@@ -1949,15 +1949,15 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* intialize header in new record
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	return rval;
 }
@@ -1970,40 +1970,40 @@ 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;
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: get align cnt\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: get align cnt\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because all buffers are page-aligned
 	 * and a multiple of PGSZ.
 	 */
-	next_alignment_off = ( intptr_t )contextp->dc_nextp;
+	next_alignment_off = (intptr_t)contextp->dc_nextp;
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
-	next_alignment_point = ( char * )next_alignment_off;
-	assert( next_alignment_point <= contextp->dc_recendp );
+	next_alignment_point = (char *)next_alignment_off;
+	assert(next_alignment_point <= contextp->dc_recendp);
 
 	/* return the number of bytes to the next alignment offset
 	 */
-	assert( next_alignment_point >= contextp->dc_nextp );
-	return ( size_t )( next_alignment_point - contextp->dc_nextp );
+	assert(next_alignment_point >= contextp->dc_nextp);
+	return (size_t)(next_alignment_point - contextp->dc_nextp);
 }
 
 /* do_end_write - pad and write pending record if any client data in it.
@@ -2014,9 +2014,9 @@ do_get_align_cnt( drive_t * drivep )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_end_write( drive_t *drivep, off64_t *ncommittedp )
+do_end_write(drive_t *drivep, off64_t *ncommittedp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t first_rec_w_err; /* zero-based index */
 	off64_t recs_wtn_wo_err;
 	off64_t recs_guaranteed;
@@ -2024,17 +2024,17 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: end write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: end write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* pre-initialize return of count of bytes committed to media
 	 */
@@ -2044,46 +2044,46 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * to do anymore writes, just cleanup and return 0. don't need to
 	 * do commits, already done when error occured.
 	 */
-	if ( contextp->dc_errorpr ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_errorpr) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_mode = OM_NONE;
-		drive_mark_discard( drivep );
-		*ncommittedp = ( contextp->dc_iocnt - contextp->dc_lostrecmax )
+		drive_mark_discard(drivep);
+		*ncommittedp = (contextp->dc_iocnt - contextp->dc_lostrecmax)
 			       *
-			       ( off64_t )tape_recsz;
+			       (off64_t)tape_recsz;
 		contextp->dc_recp = 0;
 		return 0;
 	}
 
 	/* if any user data in current record buffer, send it out.
 	 */
-	if ( contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ ) {
+	if (contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ) {
 		rec_hdr_t *rechdrp;
 		size_t bufusedcnt;
 
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-		bufusedcnt = ( size_t )( contextp->dc_nextp
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
+		bufusedcnt = (size_t)(contextp->dc_nextp
 					 -
-					 contextp->dc_recp );
+					 contextp->dc_recp);
 		rechdrp->rec_used = bufusedcnt;
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "writing padded last record\n" );
-		if ( contextp->dc_singlethreadedpr ) {
-			rval = write_record( drivep,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "writing padded last record\n");
+		if (contextp->dc_singlethreadedpr) {
+			rval = write_record(drivep,
 					     contextp->dc_recp,
-					     BOOL_TRUE, BOOL_TRUE );
+					     BOOL_TRUE, BOOL_TRUE);
 		} else {
-			assert( contextp->dc_msgp );
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_WRITE;
 			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			switch( contextp->dc_msgp->rm_stat ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				rval = 0;
@@ -2092,7 +2092,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 				rval = contextp->dc_msgp->rm_rval;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2109,7 +2109,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * media, and that will be used to select which marks
 	 * to commit and which to discard.
 	 */
-	if ( rval ) {
+	if (rval) {
 		first_rec_w_err = contextp->dc_iocnt;
 			/* because dc_iocnt bumped by write_record
 			 * only if no error
@@ -2117,28 +2117,28 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	} else {
 		first_rec_w_err = -1L;
 	}
-	if ( ! contextp->dc_singlethreadedpr ) {
-		while ( ! rval ) {
-			assert( contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		while (! rval) {
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_TRACE;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			if ( contextp->dc_msgp->rm_op == RING_OP_TRACE ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			if (contextp->dc_msgp->rm_op == RING_OP_TRACE) {
 				break;
 			}
-			switch( contextp->dc_msgp->rm_stat ) {
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
-				assert( rval == 0 );
+				assert(rval == 0);
 				break;
 			case RING_STAT_ERROR:
 				rval = contextp->dc_msgp->rm_rval;
 				first_rec_w_err = contextp->dc_msgp->rm_user;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2147,8 +2147,8 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	/* the ring is now flushed. reset
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -2157,16 +2157,16 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * side-effect of flushing the driver/drive of pending writes,
 	 * exposing any write errors.
 	 */
-	if ( ! rval ) {
+	if (! rval) {
 		int weofrval;
 
-		weofrval = mt_op( contextp->dc_fd, MTWEOF, 1 );
-		if ( weofrval ) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+		weofrval = mt_op(contextp->dc_fd, MTWEOF, 1);
+		if (weofrval) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "MTWEOF returned %d: errno == %d (%s)\n",
 			      weofrval,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 			rval = DRIVE_ERROR_EOM;
 		}
 	}
@@ -2185,18 +2185,18 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * and return rval. return by reference the number of bytes committed
 	 * to tape.
 	 */
-	if ( rval ) {
-		assert( first_rec_w_err >= 0 );
+	if (rval) {
+		assert(first_rec_w_err >= 0);
 		recs_wtn_wo_err = first_rec_w_err;
 		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
 	} else {
-		assert( first_rec_w_err == -1 );
+		assert(first_rec_w_err == -1);
 		recs_wtn_wo_err = contextp->dc_iocnt;
 		recs_guaranteed = recs_wtn_wo_err;
 	}
-	bytes_committed = recs_guaranteed * ( off64_t )tape_recsz;
-	drive_mark_commit( drivep, bytes_committed );
-	drive_mark_discard( drivep );
+	bytes_committed = recs_guaranteed * (off64_t)tape_recsz;
+	drive_mark_commit(drivep, bytes_committed);
+	drive_mark_discard(drivep);
 	contextp->dc_mode = OM_NONE;
 	*ncommittedp = bytes_committed;
 	return rval;
@@ -2210,45 +2210,45 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_fsf( drive_t *drivep, int count, int *statp )
+do_fsf(drive_t *drivep, int count, int *statp)
 {
 	int 		i, done, op_failed, opcount;
 	drive_context_t *contextp;
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: fsf: count %d\n",
-	      count );
+	      count);
 
-	assert( count );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(count);
+	assert(contextp->dc_mode == OM_NONE);
 
-	for ( i = 0 ; i < count; i++ ) {
+	for (i = 0 ; i < count; i++) {
 		done = 0;
 		opcount = 2;
 
 		/* the tape may encounter errors will trying to
 		 * reach the next file.
 		 */
-		while ( !done ) {
+		while (!done) {
 
 			/* advance the tape to the next file mark
 			 * NOTE:
 			 * 	ignore return code
 			 */
-			mlog( MLOG_VERBOSE | MLOG_DRIVE,
-			      _("advancing tape to next media file\n") );
+			mlog(MLOG_VERBOSE | MLOG_DRIVE,
+			      _("advancing tape to next media file\n"));
 
 			op_failed = 0;
-			assert( contextp->dc_fd >= 0 );
-			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
+			assert(contextp->dc_fd >= 0);
+			if (mt_op(contextp->dc_fd, MTFSF, 1)) {
 				op_failed = 1;
 			}
 
@@ -2264,9 +2264,9 @@ do_fsf( drive_t *drivep, int count, int *statp )
 			 * times, and a file mark has not been reached,
 			 * return an error.
 			 */
-			if ( --opcount < 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_DRIVE,
-					_("FSF tape command failed\n") );
+			if (--opcount < 0) {
+				mlog(MLOG_VERBOSE | MLOG_DRIVE,
+					_("FSF tape command failed\n"));
 
 				*statp = DRIVE_ERROR_DEVICE;
 				return i;
@@ -2286,37 +2286,37 @@ do_fsf( drive_t *drivep, int count, int *statp )
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_bsf( drive_t *drivep, int count, int *statp )
+do_bsf(drive_t *drivep, int count, int *statp)
 {
 #ifdef DEBUG
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	int skipped;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: bsf: count %d\n",
-	      count );
+	      count);
 
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
 	*statp = 0;
 
 	/* back space - places us to left of previous file mark
 	 * if we hit BOT, return
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
-	rval = bsf_and_verify( drivep );
+	assert(drivep->d_capabilities & DRIVE_CAP_BSF);
+	rval = bsf_and_verify(drivep);
 	if (rval) {
 		if (errno == ENOSPC/*IRIX*/ || errno == EIO/*Linux*/) {
-			if ( count ) {
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
+			if (count) {
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
 				      "rmt drive op: bsf reached BOT "
 					    "unexpectedly (%d files to go)\n",
 				       count);
 				/* set statp - BOT is unexpected */
 			} else {
-				mlog( MLOG_DEBUG | MLOG_DRIVE,
+				mlog(MLOG_DEBUG | MLOG_DRIVE,
 				      "rmt drive op: bsf reached BOT\n");
 				/* don't set statp, BOT is fine */
 				return 0;
@@ -2328,16 +2328,16 @@ 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.
 		 */
-		rval = bsf_and_verify( drivep );
+		rval = bsf_and_verify(drivep);
 		if (rval) {
 			if (errno == ENOSPC/*IRIX*/ || errno == EIO/*Linux*/) {
-				if ( count - skipped - 1 ) {
-					mlog( MLOG_DEBUG | MLOG_DRIVE,
+				if (count - skipped - 1) {
+					mlog(MLOG_DEBUG | MLOG_DRIVE,
 					      "rmt drive op: bsf reached BOT "
 					      "unexpectedly (%d files to go)\n",
 					      count - skipped - 1);
@@ -2345,7 +2345,7 @@ do_bsf( drive_t *drivep, int count, int *statp )
 					*statp = DRIVE_ERROR_DEVICE;
 					return skipped + 1;
 				} else {
-					mlog( MLOG_DEBUG | MLOG_DRIVE,
+					mlog(MLOG_DEBUG | MLOG_DRIVE,
 					      "rmt drive op: bsf reached BOT\n");
 					/* don't set statp - BOT is fine */
 					return skipped + 1;
@@ -2359,7 +2359,7 @@ do_bsf( drive_t *drivep, int count, int *statp )
 	/* we're not at BOT, so we need to move to the right side of
 	 * the file mark
 	 */
-	( void )fsf_and_verify( drivep );
+	(void)fsf_and_verify(drivep);
 
 	/* indicate the number of media files skipped
 	 */
@@ -2374,21 +2374,21 @@ do_bsf( drive_t *drivep, int count, int *statp )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_rewind( drive_t *drivep )
+do_rewind(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: rewind\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: rewind\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	( void )rewind_and_verify( drivep );
+	(void)rewind_and_verify(drivep);
 	return 0;
 }
 
@@ -2400,33 +2400,33 @@ do_rewind( drive_t *drivep )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_erase( drive_t *drivep )
+do_erase(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: erase\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: erase\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	(void )rewind_and_verify( drivep );
+	(void)rewind_and_verify(drivep);
 
 	/* use validating tape erase util func
 	 */
-	( void )erase_and_verify( drivep );
+	(void)erase_and_verify(drivep);
 
 	/* rewind again
 	 */
-	( void )rewind_and_verify( drivep );
+	(void)rewind_and_verify(drivep);
 
 	/* close the drive so we start from scratch
 	 */
-	Close( drivep );
+	Close(drivep);
 	return 0;
 }
 
@@ -2438,27 +2438,27 @@ do_erase( drive_t *drivep )
  *	DRIVE_ERROR_DEVICE on failure
  */
 static int
-do_eject_media( drive_t *drivep )
+do_eject_media(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: eject media\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: eject media\n");
 
 	/* drive must be open
 	 */
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* issue tape unload
 	 */
-	if ( contextp->dc_unloadokpr ) {
-		( void )mt_op( contextp->dc_fd, MTUNLOAD, 0 );
+	if (contextp->dc_unloadokpr) {
+		(void)mt_op(contextp->dc_fd, MTUNLOAD, 0);
 	}
 
 	/* close the device driver
 	 */
-	Close( drivep );
+	Close(drivep);
 
 	return 0;
 }
@@ -2471,10 +2471,10 @@ do_eject_media( drive_t *drivep )
  */
 /* ARGSUSED */
 static int
-do_get_device_class( drive_t *drivep)
+do_get_device_class(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: get device class\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: get device class\n");
 
 	return DEVICE_TAPE_REMOVABLE;
 }
@@ -2482,55 +2482,55 @@ do_get_device_class( drive_t *drivep)
 /* do_display_metrics - print ring stats if using I/O ring
  */
 static void
-do_display_metrics( drive_t *drivep )
+do_display_metrics(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	if ( ringp ) {
-		if ( drivecnt > 1 ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
+	if (ringp) {
+		if (drivecnt > 1) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
 			      _("drive %u "),
-			      drivep->d_index );
+			      drivep->d_index);
 		}
-		display_ring_metrics( drivep,
-				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK );
+		display_ring_metrics(drivep,
+				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK);
 	}
 }
 
 /* do_quit
  */
 static void
-do_quit( drive_t *drivep )
+do_quit(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op: quit\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op: quit\n");
 
 	/* print the ring metrics and kill the ring
 	 */
-	if ( ringp ) {
-		display_ring_metrics( drivep, MLOG_VERBOSE );
+	if (ringp) {
+		display_ring_metrics(drivep, MLOG_VERBOSE);
 
 		/* tell slave to die
 		 */
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-		      "ring op: destroy\n" );
-		ring_destroy( ringp );
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+		      "ring op: destroy\n");
+		ring_destroy(ringp);
 	}
 
 	Close(drivep);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "rmt drive op quit complete\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "rmt drive op quit complete\n");
 }
 
 static double
-percent64( off64_t num, off64_t denom )
+percent64(off64_t num, off64_t denom)
 {
-	return ( double )( num * 100 ) / ( double )denom;
+	return (double)(num * 100) / (double)denom;
 }
 
 
@@ -2546,7 +2546,7 @@ percent64( off64_t num, off64_t denom )
  *	DRIVE_ERROR_* on failure
  */
 static int
-read_label( drive_t *drivep )
+read_label(drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int nread;
@@ -2555,45 +2555,45 @@ read_label( drive_t *drivep )
 
 	/* initialize context ptr
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* read the first record of the media file directly
 	 */
-	nread = Read( drivep,
+	nread = Read(drivep,
 		      contextp->dc_recp,
 		      tape_recsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	/* if a read error, get status
 	 */
-	if ( nread != ( int )tape_recsz ) {
-		assert( nread < ( int )tape_recsz );
+	if (nread != (int)tape_recsz) {
+		assert(nread < (int)tape_recsz);
 	}
 
 	/* check for an unexpected errno
 	 */
-	if ( nread < 0 && saved_errno != ENOSPC ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (nread < 0 && saved_errno != ENOSPC) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not read from drive: %s (%d)\n"),
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* check for a blank tape/EOD.
 	 */
-	if (( nread == 0 )  /* takes care of sun */
+	if ((nread == 0)  /* takes care of sun */
 	      ||            /* now handle SGI */
-	      (nread < 0 && saved_errno == ENOSPC )) {
+	      (nread < 0 && saved_errno == ENOSPC)) {
 #ifdef DUMP
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("encountered EOD : assuming blank media\n") );
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("encountered EOD : assuming blank media\n"));
 #endif
 #ifdef RESTORE
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("encountered EOD : end of data\n") );
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("encountered EOD : end of data\n"));
 #endif
-		( void )rewind_and_verify( drivep );
+		(void)rewind_and_verify(drivep);
 #ifdef DUMP
 		return DRIVE_ERROR_BLANK;
 #endif
@@ -2607,13 +2607,13 @@ read_label( drive_t *drivep )
 	 */
 	contextp->dc_iocnt = 1;
 
-	rval = validate_media_file_hdr( drivep );
+	rval = validate_media_file_hdr(drivep);
 
 	return rval;
 }
 
 static int
-validate_media_file_hdr( drive_t *drivep )
+validate_media_file_hdr(drive_t *drivep)
 {
 	global_hdr_t		*grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t		*drhdrp = drivep->d_readhdrp;
@@ -2621,7 +2621,7 @@ validate_media_file_hdr( drive_t *drivep )
 	media_hdr_t		*mrhdrp = (media_hdr_t *)drhdrp->dh_upper;
 	content_hdr_t		*ch = (content_hdr_t *)mrhdrp->mh_upper;
 	content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	char tmpbuf[GLOBAL_HDR_SZ];
 	global_hdr_t		*tmpgh = (global_hdr_t *)&tmpbuf[0];
 	drive_hdr_t		*tmpdh = (drive_hdr_t *)tmpgh->gh_upper;
@@ -2630,22 +2630,22 @@ validate_media_file_hdr( drive_t *drivep )
 	content_hdr_t		*tmpch = (content_hdr_t *)tmpmh->mh_upper;
 	content_inode_hdr_t	*tmpcih = (content_inode_hdr_t *)tmpch->ch_specific;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "validating media file header\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "validating media file header\n");
 
-	memcpy( tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ );
+	memcpy(tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ);
 
 	/* check the checksum
 	 */
-	if ( ! global_hdr_checksum_check( tmpgh )) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! global_hdr_checksum_check(tmpgh)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "bad media file header checksum\n");
 	        return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( ! tape_rec_checksum_check( contextp, contextp->dc_recp )) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("tape record checksum error\n") );
+	if (! tape_rec_checksum_check(contextp, contextp->dc_recp)) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("tape record checksum error\n"));
 		return DRIVE_ERROR_CORRUPTION;
 
 	}
@@ -2657,54 +2657,54 @@ validate_media_file_hdr( drive_t *drivep )
 	xlate_content_inode_hdr(tmpcih, cih, 1);
 	xlate_rec_hdr(tmprh, tprhdrp, 1);
 
-	memcpy( contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ );
+	memcpy(contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ);
 
 	/* check the magic number
 	 */
-	if ( strncmp( grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "missing magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the version
 	 */
-	if ( global_version_check( grhdrp->gh_version ) != BOOL_TRUE ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (global_version_check(grhdrp->gh_version) != BOOL_TRUE) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid version number (%d) in tape label\n",
-		      grhdrp->gh_version );
+		      grhdrp->gh_version);
 	        return DRIVE_ERROR_VERSION;
 	}
 
 	/* check the strategy id
 	 */
-	if ( drhdrp->dh_strategyid != drivep->d_strategyp->ds_id ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (drhdrp->dh_strategyid != drivep->d_strategyp->ds_id) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	               "unrecognized drive strategy ID (%d)\n",
-	               drivep->d_readhdrp->dh_strategyid );
+	               drivep->d_readhdrp->dh_strategyid);
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the record magic number
 	 */
-	if ( tprhdrp->magic != STAPE_MAGIC ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (tprhdrp->magic != STAPE_MAGIC) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid record magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the record version number
 	 */
-	if ( tprhdrp->version != STAPE_VERSION ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (tprhdrp->version != STAPE_VERSION) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid record version number in tape label\n");
 	        return DRIVE_ERROR_VERSION;
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "media file header valid: "
 	      "media file ix %d\n",
-	      mrhdrp->mh_mediafileix );
+	      mrhdrp->mh_mediafileix);
 
 	return 0;
 }
@@ -2720,12 +2720,12 @@ validate_media_file_hdr( drive_t *drivep )
  *	FALSE on error
  */
 static bool_t
-get_tpcaps( drive_t *drivep )
+get_tpcaps(drive_t *drivep)
 {
 #ifdef DEBUG
-	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_fd >= 0);
 #endif
 
 	/* can't ask about blksz, can't set blksz, can't ask about
@@ -2736,7 +2736,7 @@ get_tpcaps( drive_t *drivep )
 	drivep->d_capabilities |= DRIVE_CAP_OVERWRITE;
 	drivep->d_capabilities |= DRIVE_CAP_BSF;
 
-	set_recommended_sizes( drivep );
+	set_recommended_sizes(drivep);
 
 	return BOOL_TRUE;
 }
@@ -2749,32 +2749,32 @@ get_tpcaps( drive_t *drivep )
  *	void
  */
 static void
-set_recommended_sizes( drive_t *drivep )
+set_recommended_sizes(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t	fsize = drive_strategy_rmt.ds_recmfilesz;
 	off64_t	marksep = drive_strategy_rmt.ds_recmarksep;
 
 	if (contextp->dc_filesz > 0) {
 		fsize = contextp->dc_filesz;
 #ifdef DUMP
-		if ( hdr_mfilesz > fsize ) {
-			mlog( MLOG_WARNING, _(
+		if (hdr_mfilesz > fsize) {
+			mlog(MLOG_WARNING, _(
 			      "recommended media file size of %llu Mb less than "
 			      "estimated file header size %llu Mb for %s\n"),
-			      fsize / ( 1024 * 1024 ),
-			      hdr_mfilesz / ( 1024 * 1024 ),
-			      drivep->d_pathname );
+			      fsize / (1024 * 1024),
+			      hdr_mfilesz / (1024 * 1024),
+			      drivep->d_pathname);
 		}
 #endif /* DUMP */
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "recommended tape media file size set to 0x%llx bytes\n",
-	      fsize );
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	      fsize);
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "recommended tape media mark separation set to 0x%llx bytes\n",
-	      marksep );
+	      marksep);
 
 	drivep->d_recmfilesz = fsize;
 	drivep->d_recmarksep = marksep;
@@ -2792,18 +2792,18 @@ set_recommended_sizes( drive_t *drivep )
  *	-1 on failure
  */
 static int
-mt_op(int fd, int sub_op, int param )
+mt_op(int fd, int sub_op, int param)
 {
 	struct mtop 	mop;
 	char *printstr;
 	int rval;
 
-	mop.mt_op   	= (short )sub_op;
+	mop.mt_op   	= (short)sub_op;
 	mop.mt_count	= param;
 
-	assert( fd >= 0 );
+	assert(fd >= 0);
 
-	switch ( sub_op ) {
+	switch (sub_op) {
 	case MTSEEK:
 		printstr = "seek";
 		break;
@@ -2842,22 +2842,22 @@ mt_op(int fd, int sub_op, int param )
 		printstr = "???";
 		break;
 	}
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: %s %d\n",
 	      printstr,
-	      param );
+	      param);
 
-	rval = ioctl( fd, MTIOCTOP, &mop );
-	if ( rval < 0 ) {
+	rval = ioctl(fd, MTIOCTOP, &mop);
+	if (rval < 0) {
 		/* failure
 	 	 */
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "tape op %s %d returns %d: errno == %d (%s)\n",
 		      printstr,
 		      param,
 		      rval,
 		      errno,
-		      strerror( errno ));
+		      strerror(errno));
 		return -1;
 	}
 
@@ -2874,82 +2874,82 @@ mt_op(int fd, int sub_op, int param )
  *      DRIVE_ERROR_*
  */
 static int
-determine_write_error( int nwritten, int saved_errno )
+determine_write_error(int nwritten, int saved_errno)
 {
 	int        ret = 0;
 
-	if ( saved_errno == EACCES ) {
+	if (saved_errno == EACCES) {
 		mlog(MLOG_NORMAL,
-			_("tape is write protected\n") );
+			_("tape is write protected\n"));
 
 		ret = DRIVE_ERROR_DEVICE;
 	} else if (
-			( saved_errno == ENOSPC )
+			(saved_errno == ENOSPC)
 				||
-			( saved_errno == EIO )
+			(saved_errno == EIO)
 				||
-			(( saved_errno == 0 ) && ( nwritten >= 0 ))  /* short
+			((saved_errno == 0) && (nwritten >= 0))  /* short
 							write indicates EOM */
 		) {
 		mlog(MLOG_NORMAL,
-			_("tape media error on write operation\n") );
+			_("tape media error on write operation\n"));
 
 		mlog(MLOG_NORMAL,
-			_("no more data can be written to this tape\n") );
+			_("no more data can be written to this tape\n"));
 
 		ret = DRIVE_ERROR_EOM;
-	} else if ( saved_errno != 0 ) {
+	} else if (saved_errno != 0) {
 		ret = DRIVE_ERROR_CORE;
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 			"tape unknown error on write operation: "
 			"%d, %d\n",
 			nwritten, saved_errno);
 	}
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 		"tape write operation nwritten %d, errno %d\n",
 		nwritten,
 		saved_errno);
 
-	return ( ret );
+	return (ret);
 
 }
 
 static void
-tape_rec_checksum_set( drive_context_t *contextp, char *bufp )
+tape_rec_checksum_set(drive_context_t *contextp, char *bufp)
 {
-	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	uint32_t *beginp = ( uint32_t * )bufp;
-	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	rec_hdr_t *rechdrp = (rec_hdr_t *)bufp;
+	uint32_t *beginp = (uint32_t *)bufp;
+	uint32_t *endp = (uint32_t *)(bufp + tape_recsz);
 	uint32_t *p;
 	uint32_t accum;
 
-	if ( ! contextp->dc_recchksumpr ) {
+	if (! contextp->dc_recchksumpr) {
 		return;
 	}
 
 	INT_SET(rechdrp->ischecksum, ARCH_CONVERT, 1);
 	rechdrp->checksum = 0;
 	accum = 0;
-	for ( p = beginp ; p < endp ; p++ ) {
+	for (p = beginp ; p < endp ; p++) {
 	        accum += INT_GET(*p, ARCH_CONVERT);
 	}
-	INT_SET(rechdrp->checksum, ARCH_CONVERT, ( int32_t )( ~accum + 1 ));
+	INT_SET(rechdrp->checksum, ARCH_CONVERT, (int32_t)(~accum + 1));
 }
 
 static bool_t
-tape_rec_checksum_check( drive_context_t *contextp, char *bufp )
+tape_rec_checksum_check(drive_context_t *contextp, char *bufp)
 {
-	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	uint32_t *beginp = ( uint32_t * )bufp;
-	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	rec_hdr_t *rechdrp = (rec_hdr_t *)bufp;
+	uint32_t *beginp = (uint32_t *)bufp;
+	uint32_t *endp = (uint32_t *)(bufp + tape_recsz);
 	uint32_t *p;
 	uint32_t accum;
 
-	if ( contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT) ) {
+	if (contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
 		accum = 0;
-		for ( p = beginp ; p < endp ; p++ ) {
+		for (p = beginp ; p < endp ; p++) {
 	       		accum += INT_GET(*p, ARCH_CONVERT);
 		}
 		return accum == 0 ? BOOL_TRUE : BOOL_FALSE;
@@ -2962,75 +2962,75 @@ tape_rec_checksum_check( drive_context_t *contextp, char *bufp )
  */
 #ifdef RMTDBG
 static int
-dbgrmtopen( char *path, int flags )
+dbgrmtopen(char *path, int flags)
 {
 	int rval;
-	rval = rmtopen( path, flags );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtopen(path, flags);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTOPEN( %s, %d ) returns %d: errno=%d (%s)\n"),
 	      path,
 	      flags,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtclose( int fd )
+dbgrmtclose(int fd)
 {
 	int rval;
-	rval = rmtclose( fd );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtclose(fd);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTCLOSE( %d ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtioctl( int fd, int op, void *arg )
+dbgrmtioctl(int fd, int op, void *arg)
 {
 	int rval;
-	rval = rmtioctl( fd, op, arg );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtioctl(fd, op, arg);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTIOCTL( %d, %d, 0x%x ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      op,
 	      arg,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtread( int fd, void *p, uint sz )
+dbgrmtread(int fd, void *p, uint sz)
 {
 	int rval;
-	rval = rmtread( fd, p, sz );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtread(fd, p, sz);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTREAD( %d, 0x%x, %u ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      p,
 	      sz,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 static int
-dbgrmtwrite( int fd, void *p, uint sz )
+dbgrmtwrite(int fd, void *p, uint sz)
 {
 	int rval;
-	rval = rmtwrite( fd, p, sz );
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	rval = rmtwrite(fd, p, sz);
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("RMTWRITE( %d, 0x%x, %u ) returns %d: errno=%d (%s)\n"),
 	      fd,
 	      p,
 	      sz,
 	      rval,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 	return rval;
 }
 #endif /* RMTDBG */
@@ -3042,14 +3042,14 @@ dbgrmtwrite( int fd, void *p, uint sz )
  *	void
  */
 static void
-display_access_failed_message( drive_t *drivep )
+display_access_failed_message(drive_t *drivep)
 {
-	mlog( MLOG_NORMAL | MLOG_DRIVE, _(
+	mlog(MLOG_NORMAL | MLOG_DRIVE, _(
[… more lines in the raw message]

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

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

Signature · 1 line
2.19.1

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

author
#3 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 common/drive_scsitape.c | 2948 +++++++++++++++++++--------------------
 1 file changed, 1474 insertions(+), 1474 deletions(-)
common/drive_scsitape.c +1474 -1474
index c360f9c..5c9ee89 100644
@@ -257,11 +257,11 @@ typedef struct drive_context drive_context_t;
 /* macros for shortcut references to context. assumes a local variable named
  * 'contextp'.
  */
-#define	tape_recsz	( contextp->dc_recsz )
-#define	tape_blksz	( contextp->dc_blksz )
+#define	tape_recsz	(contextp->dc_recsz)
+#define	tape_blksz	(contextp->dc_blksz)
 
 /* macros to interpret tape status information returned by reference from
- * mt_get_status( ).
+ * mt_get_status().
  */
 	/* tape is positioned at end-of-tape   			*/
 #define IS_EOT(mtstat)		GMT_EOT(mtstat)
@@ -284,116 +284,116 @@ typedef long mtstat_t;
 
 /* declarations of externally defined global variables ***********************/
 
-extern void usage( void );
+extern void usage(void);
 #ifdef DUMP
 extern uint64_t hdr_mfilesz;
 #endif /* DUMP */
 
 /* remote tape protocol declarations (should be a system header file)
  */
-extern int rmtopen( char *, int, ... );
-extern int rmtclose( int );
-extern int rmtfstat( int, struct stat * );
-extern int rmtioctl( int, int, ... );
-extern int rmtread( int, void*, uint);
-extern int rmtwrite( int, const void *, uint);
+extern int rmtopen(char *, int, ...);
+extern int rmtclose(int);
+extern int rmtfstat(int, struct stat *);
+extern int rmtioctl(int, int, ...);
+extern int rmtread(int, void*, uint);
+extern int rmtwrite(int, const void *, uint);
 
 
 /* forward declarations of locally defined static functions ******************/
 
 /* strategy functions
  */
-static int ds_match( int, char *[], drive_t * );
-static int ds_instantiate( int, char *[], drive_t * );
+static int ds_match(int, char *[], drive_t *);
+static int ds_instantiate(int, char *[], drive_t *);
 
 /* manager operations
  */
-static bool_t do_init( drive_t * );
-static bool_t do_sync( drive_t * );
-static int do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, int * );
-static void do_return_read_buf( drive_t *, char *, size_t );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static int do_seek_mark( drive_t *, drive_mark_t * );
-static int do_next_mark( drive_t * );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static void do_end_read( drive_t * );
-static int do_begin_write( drive_t * );
-static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
-static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static int do_write( drive_t *, char *, size_t );
-static size_t do_get_align_cnt( drive_t * );
-static int do_end_write( drive_t *, off64_t * );
-static int do_fsf( drive_t *, int , int *);
-static int do_bsf( drive_t *, int , int *);
-static int do_rewind( drive_t * );
-static int do_erase( drive_t * );
-static int do_eject_media( drive_t * );
-static int do_get_device_class( drive_t * );
-static void do_display_metrics( drive_t *drivep );
-static void do_quit( drive_t * );
+static bool_t do_init(drive_t *);
+static bool_t do_sync(drive_t *);
+static int do_begin_read(drive_t *);
+static char *do_read(drive_t *, size_t , size_t *, int *);
+static void do_return_read_buf(drive_t *, char *, size_t);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static int do_seek_mark(drive_t *, drive_mark_t *);
+static int do_next_mark(drive_t *);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static void do_end_read(drive_t *);
+static int do_begin_write(drive_t *);
+static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
+static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static int do_write(drive_t *, char *, size_t);
+static size_t do_get_align_cnt(drive_t *);
+static int do_end_write(drive_t *, off64_t *);
+static int do_fsf(drive_t *, int , int *);
+static int do_bsf(drive_t *, int , int *);
+static int do_rewind(drive_t *);
+static int do_erase(drive_t *);
+static int do_eject_media(drive_t *);
+static int do_get_device_class(drive_t *);
+static void do_display_metrics(drive_t *drivep);
+static void do_quit(drive_t *);
 
 /* misc. local utility funcs
  */
-static int	mt_op(int , int , int );
-static int mt_blkinfo(int , struct mtblkinfo * );
-static bool_t mt_get_fileno( drive_t *, long *);
-static bool_t mt_get_status( drive_t *, mtstat_t *);
-static int determine_write_error( drive_t *, int, int );
-static int read_label( drive_t *);
-static bool_t tape_rec_checksum_check( drive_context_t *, char * );
-static void set_recommended_sizes( drive_t * );
-static void display_access_failed_message( drive_t *);
-static void status_failed_message( drive_t *);
-static bool_t get_tpcaps( drive_t * );
-static bool_t set_fixed_blksz( drive_t *, size_t );
-static int prepare_drive( drive_t *drivep );
-static bool_t Open( drive_t *drivep );
-static void Close( drive_t *drivep );
-static int Read( drive_t *drivep,
+static int	mt_op(int , int , int);
+static int mt_blkinfo(int , struct mtblkinfo *);
+static bool_t mt_get_fileno(drive_t *, long *);
+static bool_t mt_get_status(drive_t *, mtstat_t *);
+static int determine_write_error(drive_t *, int, int);
+static int read_label(drive_t *);
+static bool_t tape_rec_checksum_check(drive_context_t *, char *);
+static void set_recommended_sizes(drive_t *);
+static void display_access_failed_message(drive_t *);
+static void status_failed_message(drive_t *);
+static bool_t get_tpcaps(drive_t *);
+static bool_t set_fixed_blksz(drive_t *, size_t);
+static int prepare_drive(drive_t *drivep);
+static bool_t Open(drive_t *drivep);
+static void Close(drive_t *drivep);
+static int Read(drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
-		      int *errnop );
-static int Write( drive_t *drivep,
+		      int *errnop);
+static int Write(drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
-		       int *saved_errnop );
-static int quick_backup( drive_t *drivep,
+		       int *saved_errnop);
+static int quick_backup(drive_t *drivep,
 			      drive_context_t *contextp,
-			      ix_t skipcnt );
-static int record_hdr_validate( drive_t *drivep,
+			      ix_t skipcnt);
+static int record_hdr_validate(drive_t *drivep,
 				     char *bufp,
-				     bool_t chkoffpr );
-static int ring_read( void *clientctxp, char *bufp );
-static int ring_write( void *clientctxp, char *bufp );
-static double percent64( off64_t num, off64_t denom );
-static int getrec( drive_t *drivep );
-static int write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
-                              bool_t xlatepr );
-static ring_msg_t * Ring_get( ring_t *ringp );
-static void Ring_reset(  ring_t *ringp, ring_msg_t *msgp );
-static void Ring_put(  ring_t *ringp, ring_msg_t *msgp );
-static int validate_media_file_hdr( drive_t *drivep );
-static void calc_max_lost( drive_t *drivep );
-static void display_ring_metrics( drive_t *drivep, int mlog_flags );
-static mtstat_t rewind_and_verify( drive_t *drivep );
-static mtstat_t erase_and_verify( drive_t *drivep );
-static mtstat_t bsf_and_verify( drive_t *drivep );
-static mtstat_t fsf_and_verify( drive_t *drivep );
-static void calc_best_blk_and_rec_sz( drive_t *drivep );
-static bool_t set_best_blk_and_rec_sz( drive_t *drivep );
-static bool_t isefsdump( drive_t *drivep );
-static int get_driver_character_major( const char * );
-static void map_ts_status( struct mtget *, struct mtget_sgi );
+				     bool_t chkoffpr);
+static int ring_read(void *clientctxp, char *bufp);
+static int ring_write(void *clientctxp, char *bufp);
+static double percent64(off64_t num, off64_t denom);
+static int getrec(drive_t *drivep);
+static int write_record(drive_t *drivep, char *bufp, bool_t chksumpr,
+                              bool_t xlatepr);
+static ring_msg_t * Ring_get(ring_t *ringp);
+static void Ring_reset(ring_t *ringp, ring_msg_t *msgp);
+static void Ring_put(ring_t *ringp, ring_msg_t *msgp);
+static int validate_media_file_hdr(drive_t *drivep);
+static void calc_max_lost(drive_t *drivep);
+static void display_ring_metrics(drive_t *drivep, int mlog_flags);
+static mtstat_t rewind_and_verify(drive_t *drivep);
+static mtstat_t erase_and_verify(drive_t *drivep);
+static mtstat_t bsf_and_verify(drive_t *drivep);
+static mtstat_t fsf_and_verify(drive_t *drivep);
+static void calc_best_blk_and_rec_sz(drive_t *drivep);
+static bool_t set_best_blk_and_rec_sz(drive_t *drivep);
+static bool_t isefsdump(drive_t *drivep);
+static int get_driver_character_major(const char *);
+static void map_ts_status(struct mtget *, struct mtget_sgi);
 
 /* RMT trace stubs
  */
 #ifdef RMTDBG
-static int dbgrmtopen( char *, int );
-static int dbgrmtclose( int );
-static int dbgrmtioctl( int, int, void *);
-static int dbgrmtread( int, void*, uint);
-static int dbgrmtwrite( int, void *, uint);
+static int dbgrmtopen(char *, int);
+static int dbgrmtclose(int);
+static int dbgrmtioctl(int, int, void *);
+static int dbgrmtread(int, void*, uint);
+static int dbgrmtwrite(int, void *, uint);
 #endif /* RMTDBG */
 
 /* definition of locally defined global variables ****************************/
@@ -462,11 +462,11 @@ is_scsi_driver(char *pathname)
 		return BOOL_FALSE;
 	}
 
-	if ( stat64( pathname, &statbuf ) == -1) {
+	if (stat64(pathname, &statbuf) == -1) {
 		return BOOL_FALSE;
 	}
 
-	if ( !S_ISCHR( statbuf.st_mode )) {
+	if (!S_ISCHR(statbuf.st_mode)) {
 		return BOOL_FALSE;
 	}
 
@@ -510,7 +510,7 @@ is_scsi_driver(char *pathname)
  */
 /* ARGSUSED */
 static int
-ds_match( int argc, char *argv[], drive_t *drivep )
+ds_match(int argc, char *argv[], drive_t *drivep)
 {
 	struct mtget mt_stat;
 	int fd;
@@ -518,21 +518,21 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 	/* heuristics to determine if this is a drive.
 	 */
 
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 		return -10;
 	}
 
-	if ( strchr( drivep->d_pathname, ':')) {
+	if (strchr(drivep->d_pathname, ':')) {
 		errno = 0;
-		fd = open( drivep->d_pathname, O_RDONLY );
-		if ( fd < 0 ) {
+		fd = open(drivep->d_pathname, O_RDONLY);
+		if (fd < 0) {
 			return -10;
 		}
-		if ( ioctl( fd, MTIOCGET, &mt_stat ) < 0 ) {
-			close( fd );
+		if (ioctl(fd, MTIOCGET, &mt_stat) < 0) {
+			close(fd);
 			return -10;
 		}
-		close( fd );
+		close(fd);
 		return 10;
 	} else {
                 if (is_scsi_driver(drivep->d_pathname)) {
@@ -548,18 +548,18 @@ ds_match( int argc, char *argv[], drive_t *drivep )
  */
 /*ARGSUSED*/
 static bool_t
-ds_instantiate( int argc, char *argv[], drive_t *drivep )
+ds_instantiate(int argc, char *argv[], drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int c;
 
 	/* opportunity for sanity checking
 	 */
-	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
-	assert( sizeof( rec_hdr_t )
+	assert(sizeof(global_hdr_t) <= STAPE_HDR_SZ);
+	assert(sizeof(rec_hdr_t)
 		==
-		sizeofmember( drive_hdr_t, dh_specific ));
-	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
+		sizeofmember(drive_hdr_t, dh_specific));
+	assert(! (STAPE_MAX_RECSZ % PGSZ));
 
 	/* hook up the drive ops
 	 */
@@ -567,9 +567,9 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 
 	/* allocate context for the drive manager
 	 */
-	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
-	assert( contextp );
-	memset( ( void * )contextp, 0, sizeof( *contextp ));
+	contextp = (drive_context_t *)calloc(1, sizeof(drive_context_t));
+	assert(contextp);
+	memset((void *)contextp, 0, sizeof(*contextp));
 
 	/* do not enable a separate I/O thread,
 	 * more testing to be done first...
@@ -589,26 +589,26 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 #endif
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
-		switch ( c ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
+		switch (c) {
 		case GETOPT_RINGLEN:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
-			contextp->dc_ringlen = ( size_t )atoi( optarg );
-			if ( contextp->dc_ringlen < RINGLEN_MIN
+			contextp->dc_ringlen = (size_t)atoi(optarg);
+			if (contextp->dc_ringlen < RINGLEN_MIN
 			     ||
-			     contextp->dc_ringlen > RINGLEN_MAX ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+			     contextp->dc_ringlen > RINGLEN_MAX) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("-%c argument must be "
 				      "between %u and %u: ignoring %u\n"),
 				      c,
 				      RINGLEN_MIN,
 				      RINGLEN_MAX,
-				      contextp->dc_ringlen );
+				      contextp->dc_ringlen);
 				return BOOL_FALSE;
 			}
 			break;
@@ -625,33 +625,33 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 			contextp->dc_isQICpr = BOOL_TRUE;
 			break;
 		case GETOPT_BLOCKSIZE:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-			    mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+			    mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				    _("-%c argument missing\n"),
-				    c );
+				    c);
 			    return -10;
 			}
-			cmdlineblksize = ( uint32_t )atoi( optarg );
+			cmdlineblksize = (uint32_t)atoi(optarg);
 			break;
 #ifdef DUMP
 		case GETOPT_OVERWRITE:
 			contextp->dc_overwritepr = BOOL_TRUE;
 			break;
 		case GETOPT_FILESZ:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			if (! optarg || optarg[0] == '-') {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("-%c argument missing\n"),
-				      c );
+				      c);
 				return BOOL_FALSE;
 			}
                         /* given in Mb */
-			contextp->dc_filesz = (off64_t)atoi( optarg ) * 1024 * 1024;
+			contextp->dc_filesz = (off64_t)atoi(optarg) * 1024 * 1024;
                         if (contextp->dc_filesz <= 0) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("-%c argument must be a "
 				      "positive number (Mb): ignoring %u\n"),
 				      c,
-				      contextp->dc_filesz );
+				      contextp->dc_filesz);
 				return BOOL_FALSE;
                         }
 			break;
@@ -675,37 +675,37 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	/* if threads not allowed, allocate a record buffer. otherwise
 	 * create a ring, from which buffers will be taken.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
-		assert( contextp->dc_bufp );
+	if (contextp->dc_singlethreadedpr) {
+		contextp->dc_bufp = (char *)memalign(PGSZ, STAPE_MAX_RECSZ);
+		assert(contextp->dc_bufp);
 	} else {
 		int rval;
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
 		      "ring op: create: ringlen == %u\n",
-		      contextp->dc_ringlen );
-		contextp->dc_ringp = ring_create( contextp->dc_ringlen,
+		      contextp->dc_ringlen);
+		contextp->dc_ringp = ring_create(contextp->dc_ringlen,
 						  STAPE_MAX_RECSZ,
 						  contextp->dc_ringpinnedpr,
 						  drivep->d_index,
 						  ring_read,
 						  ring_write,
-						  ( void * )drivep,
-						  &rval );
-		if ( ! contextp->dc_ringp ) {
-			if ( rval == ENOMEM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+						  (void *)drivep,
+						  &rval);
+		if (! contextp->dc_ringp) {
+			if (rval == ENOMEM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("unable to allocate memory "
-				      "for I/O buffer ring\n") );
-			} else if ( rval == E2BIG ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "for I/O buffer ring\n"));
+			} else if (rval == E2BIG) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not enough physical memory "
-				      "to pin down I/O buffer ring\n") );
-			} else if ( rval == EPERM ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				      "to pin down I/O buffer ring\n"));
+			} else if (rval == EPERM) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("not allowed "
-				      "to pin down I/O buffer ring\n") );
+				      "to pin down I/O buffer ring\n"));
 			} else {
-				assert( 0 );
+				assert(0);
 			}
 			return BOOL_FALSE;
 		}
@@ -713,7 +713,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 
 	/* scan drive device pathname to see if remote tape
 	 */
-	if ( strchr( drivep->d_pathname, ':') ) {
+	if (strchr(drivep->d_pathname, ':')) {
 		contextp->dc_isrmtpr = BOOL_TRUE;
 	} else {
 		contextp->dc_isrmtpr = BOOL_FALSE;
@@ -723,7 +723,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	 * mark them as unknown for now. however, if this is an RMT
 	 * access, we know immediately some capabilities are missing.
 	 */
-	if ( contextp->dc_isrmtpr ) {
+	if (contextp->dc_isrmtpr) {
 		contextp->dc_cangetblkszpr = BOOL_FALSE;
 		contextp->dc_cansetblkszpr = BOOL_FALSE;
 		contextp->dc_isvarpr = BOOL_TRUE;
@@ -781,15 +781,15 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
  */
 /* ARGSUSED */
 static bool_t
-do_init( drive_t *drivep )
+do_init(drive_t *drivep)
 {
 #ifdef DUMP
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 #endif /* DUMP */
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: init\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: init\n");
 
 #ifdef DUMP
 	/* fill in media strategy id: artifact of first version of xfsdump
@@ -806,10 +806,10 @@ do_init( drive_t *drivep )
  */
 /* ARGSUSED */
 static bool_t
-do_sync( drive_t *drivep )
+do_sync(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: sync\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: sync\n");
 
 	return BOOL_TRUE;
 }
@@ -824,32 +824,32 @@ do_sync( drive_t *drivep )
  *
  */
 static int
-do_begin_read( drive_t *drivep )
+do_begin_read(drive_t *drivep)
 {
         drive_context_t *contextp;
         int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: begin read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: begin read\n");
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_READ );
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! contextp->dc_recp );
+	assert(drivep->d_capabilities & DRIVE_CAP_READ);
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! contextp->dc_recp);
 
 	/* get a record buffer to use during initialization.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -858,38 +858,38 @@ do_begin_read( drive_t *drivep )
 	 * size previously determined.
 	 */
 	contextp->dc_iocnt = 0;
-	if ( contextp->dc_fd < 0 ) {
-		assert( contextp->dc_fd == -1 );
-		rval = prepare_drive( drivep );
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_fd < 0) {
+		assert(contextp->dc_fd == -1);
+		rval = prepare_drive(drivep);
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	} else {
-		rval = read_label( drivep );
-		if ( rval ) {
-			if ( ! contextp->dc_singlethreadedpr ) {
-			    Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+		rval = read_label(drivep);
+		if (rval) {
+			if (! contextp->dc_singlethreadedpr) {
+			    Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			}
 			contextp->dc_msgp = 0;
 			contextp->dc_recp = 0;
 			return rval;
 		}
 	}
-	assert( contextp->dc_iocnt == 1 );
+	assert(contextp->dc_iocnt == 1);
 					/* set by prepare_drive or read_label */
 
 	/* all is well. adjust context. don't kick off read-aheads just yet;
 	 * the client may not want this media file.
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
+	if (! contextp->dc_singlethreadedpr) {
 		contextp->dc_msgp->rm_op = RING_OP_NOP;
 		contextp->dc_msgp->rm_user = 0; /* do diff. use in do_seek */
-		Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -920,31 +920,31 @@ do_begin_read( drive_t *drivep )
  *
  */
 static char *
-do_read( drive_t *drivep,
+do_read(drive_t *drivep,
 	 size_t wantedcnt,
 	 size_t *actualcntp,
-	 int *rvalp )
+	 int *rvalp)
 {
 	drive_context_t *contextp;
 	size_t availcnt;
 	size_t actualcnt;
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: read: wanted %u (0x%x)\n",
 	      wantedcnt,
-	      wantedcnt );
+	      wantedcnt);
 
 	/* get context ptrs
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( wantedcnt > 0 );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(wantedcnt > 0);
 
 	/* clear the return status field
 	 */
@@ -952,30 +952,30 @@ do_read( drive_t *drivep,
 
 	/* read a new record if necessary
 	 */
-	rval = getrec( drivep );
-	if ( rval ) {
-		mlog( MLOG_NITTY | MLOG_DRIVE,
+	rval = getrec(drivep);
+	if (rval) {
+		mlog(MLOG_NITTY | MLOG_DRIVE,
 		      "drive op read returning error rval=%d\n",
-		      rval );
+		      rval);
 		*rvalp = rval;
 		return 0;
 	}
 
 	/* figure how much data is available, and how much should be supplied
 	 */
-	availcnt = ( size_t )( contextp->dc_dataendp - contextp->dc_nextp );
-	actualcnt = min( wantedcnt, availcnt );
+	availcnt = (size_t)(contextp->dc_dataendp - contextp->dc_nextp);
+	actualcnt = min(wantedcnt, availcnt);
 
 	/* adjust the context
 	 */
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive op read actual == %d (0x%x)\n",
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	*actualcntp = actualcnt;
 	return contextp->dc_ownedp;
@@ -990,29 +990,29 @@ do_read( drive_t *drivep,
  */
 /* ARGSUSED */
 static void
-do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
+do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	/* REFERENCED */
 	size_t ownedcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: return read buf: sz %d (0x%x)\n",
 	      retcnt,
-	      retcnt );
+	      retcnt);
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( bufp == contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(bufp == contextp->dc_ownedp);
 
 	/* calculate how much the caller owns
 	 */
-	assert( contextp->dc_nextp >= contextp->dc_ownedp );
-	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	assert( ownedcnt == retcnt );
+	assert(contextp->dc_nextp >= contextp->dc_ownedp);
+	ownedcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
+	assert(ownedcnt == retcnt);
 
 	/* take possession of buffer portion
 	 */
@@ -1021,11 +1021,11 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
 	/* if caller is done with this record, take the buffer back
 	 * and (if ring in use) give buffer to ring for read-ahead.
 	 */
-	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
-		assert( contextp->dc_nextp == contextp->dc_dataendp );
-		if ( ! contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_nextp >= contextp->dc_dataendp) {
+		assert(contextp->dc_nextp == contextp->dc_dataendp);
+		if (! contextp->dc_singlethreadedpr) {
 			contextp->dc_msgp->rm_op = RING_OP_READ;
-			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1043,29 +1043,29 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
  *	void
  */
 static void
-do_get_mark( drive_t *drivep, drive_mark_t *markp )
+do_get_mark(drive_t *drivep, drive_mark_t *markp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t offset;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: get mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: get mark\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 	/* the mark is simply the offset into the media file of the
 	 * next byte to be read.
 	 */
-	offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
-		offset += ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
+	offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
+		offset += (off64_t)(contextp->dc_nextp - contextp->dc_recp);
 	}
 
-	*markp = ( drive_mark_t )offset;
+	*markp = (drive_mark_t)offset;
 
 	return;
 }
@@ -1082,7 +1082,7 @@ typedef enum { SEEKMODE_BUF, SEEKMODE_RAW } seekmode_t;
  *
  */
 static int
-do_seek_mark( drive_t *drivep, drive_mark_t *markp )
+do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 {
 	drive_context_t	*contextp;
 	off64_t wantedoffset;
@@ -1094,55 +1094,55 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
 
 	/* the desired mark is passed by reference, and is really just an
 	 * offset into the raw (incl rec hdrs) read stream
 	 */
-	wantedoffset = *( off64_t * )markp;
+	wantedoffset = *(off64_t *)markp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: seek mark: %lld (0x%llx)\n",
 	      wantedoffset,
-	      wantedoffset );
+	      wantedoffset);
 
 	/* determine the current offset. assert that the wanted offset is
 	 * not less than the current offset.
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset >= currentoffset );
+	assert(wantedoffset >= currentoffset);
 
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
 	 */
-	if ( contextp->dc_recp ) {
+	if (contextp->dc_recp) {
 		off64_t nextrecoffset;
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		nextrecoffset = contextp->dc_reccnt  * ( off64_t )tape_recsz
+		nextrecoffset = contextp->dc_reccnt  * (off64_t)tape_recsz
 				+
-				( off64_t )rechdrp->rec_used;
-		if ( wantedoffset >= nextrecoffset ) {
+				(off64_t)rechdrp->rec_used;
+		if (wantedoffset >= nextrecoffset) {
 			uint32_t recoff;
 			size_t wantedcnt;
 			char *dummybufp;
@@ -1152,39 +1152,39 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			/* if this is the last record, the wanted offset
 			 * must be just after it.
 			 */
-			if ( rechdrp->rec_used < tape_recsz ) {
-				assert( wantedoffset == nextrecoffset );
+			if (rechdrp->rec_used < tape_recsz) {
+				assert(wantedoffset == nextrecoffset);
 			}
 
 			/* figure how much to ask for
 			 */
-			assert( contextp->dc_nextp >= contextp->dc_recp );
-			recoff = ( uint32_t )( contextp->dc_nextp
+			assert(contextp->dc_nextp >= contextp->dc_recp);
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			wantedcnt = ( size_t )( rechdrp->rec_used
+						contextp->dc_recp);
+			wantedcnt = (size_t)(rechdrp->rec_used
 						-
-						recoff );
+						recoff);
 
 			/* eat that much tape
 			 */
 			rval = 0;
-			dummybufp = do_read( drivep,
+			dummybufp = do_read(drivep,
 					     wantedcnt,
 					     &actualcnt,
-					     &rval );
-			if ( rval ) {
+					     &rval);
+			if (rval) {
 				return rval;
 			}
-			assert( actualcnt == wantedcnt );
-			do_return_read_buf( drivep, dummybufp, actualcnt );
-			currentoffset += ( off64_t )actualcnt;
-			assert( currentoffset == nextrecoffset );
-			assert( wantedoffset >= currentoffset );
-			assert( ! contextp->dc_recp );
-			assert( currentoffset
+			assert(actualcnt == wantedcnt);
+			do_return_read_buf(drivep, dummybufp, actualcnt);
+			currentoffset += (off64_t)actualcnt;
+			assert(currentoffset == nextrecoffset);
+			assert(wantedoffset >= currentoffset);
+			assert(! contextp->dc_recp);
+			assert(currentoffset
 				==
-				contextp->dc_reccnt * ( off64_t )tape_recsz );
+				contextp->dc_reccnt * (off64_t)tape_recsz);
 		}
 	}
 
@@ -1195,208 +1195,208 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 * made it there, suspend read-ahead, eat those readahead records,
 	 * FSR the remaining, and resume readahead.
 	 */
-	if ( contextp->dc_canfsrpr
+	if (contextp->dc_canfsrpr
 	     &&
-	     wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	     wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
 
-		assert( ! contextp->dc_recp );
-		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
-		if ( contextp->dc_singlethreadedpr ) {
+		assert(! contextp->dc_recp);
+		wantedreccnt = wantedoffset / (off64_t)tape_recsz;
+		if (contextp->dc_singlethreadedpr) {
 			seekmode = SEEKMODE_RAW;
 		} else {
 			seekmode = SEEKMODE_BUF;
 		}
-		assert( wantedreccnt != 0 ); /* so NOP below can be
+		assert(wantedreccnt != 0); /* so NOP below can be
 					      * distinguished from use
 					      * in do_begin_read
 					      */
-		while ( contextp->dc_reccnt < wantedreccnt ) {
+		while (contextp->dc_reccnt < wantedreccnt) {
 			off64_t recskipcnt64;
 			off64_t recskipcnt64remaining;
 
-			if ( seekmode == SEEKMODE_BUF ) {
+			if (seekmode == SEEKMODE_BUF) {
 				ring_stat_t rs;
-				assert( ! contextp->dc_msgp );
+				assert(! contextp->dc_msgp);
 				contextp->dc_msgp =
-						Ring_get( contextp->dc_ringp );
+						Ring_get(contextp->dc_ringp);
 				rs = contextp->dc_msgp->rm_stat;
-				if ( rs == RING_STAT_ERROR ) {
+				if (rs == RING_STAT_ERROR) {
 					contextp->dc_errorpr = BOOL_TRUE;
 					return contextp->dc_msgp->rm_rval;
 				}
-				if ( rs != RING_STAT_OK
+				if (rs != RING_STAT_OK
 				     &&
 				     rs != RING_STAT_INIT
 				     &&
-				     rs != RING_STAT_NOPACK ) {
-					assert( 0 );
+				     rs != RING_STAT_NOPACK) {
+					assert(0);
 					contextp->dc_errorpr = BOOL_TRUE;
 					return DRIVE_ERROR_CORE;
 				}
-				if ( rs == RING_STAT_OK ) {
+				if (rs == RING_STAT_OK) {
 					contextp->dc_reccnt++;
 				}
-				if ( rs == RING_STAT_NOPACK
+				if (rs == RING_STAT_NOPACK
 				     &&
 				     contextp->dc_msgp->rm_user
 				     ==
-				     wantedreccnt ) {
+				     wantedreccnt) {
 					seekmode = SEEKMODE_RAW;
 				}
 				contextp->dc_msgp->rm_op = RING_OP_NOP;
 				contextp->dc_msgp->rm_user = wantedreccnt;
-				Ring_put( contextp->dc_ringp,
-					  contextp->dc_msgp );
+				Ring_put(contextp->dc_ringp,
+					  contextp->dc_msgp);
 				contextp->dc_msgp = 0;
 				continue;
 			}
 
-			assert( contextp->dc_reccnt == contextp->dc_iocnt );
-			assert( wantedreccnt > contextp->dc_reccnt );
+			assert(contextp->dc_reccnt == contextp->dc_iocnt);
+			assert(wantedreccnt > contextp->dc_reccnt);
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
-			while ( recskipcnt64remaining ) {
+			while (recskipcnt64remaining) {
 				int recskipcnt;
 				int saved_errno;
 				int rval;
 
-				assert( recskipcnt64remaining > 0 );
-				if ( recskipcnt64remaining > INTGENMAX ) {
+				assert(recskipcnt64remaining > 0);
+				if (recskipcnt64remaining > INTGENMAX) {
 					recskipcnt = INTGENMAX;
 				} else {
-					recskipcnt = ( int )
+					recskipcnt = (int)
 						     recskipcnt64remaining;
 				}
-				assert( recskipcnt > 0 );
-				rval = mt_op( contextp->dc_fd,
+				assert(recskipcnt > 0);
+				rval = mt_op(contextp->dc_fd,
 					      MTFSR,
-					      recskipcnt );
+					      recskipcnt);
 				saved_errno = errno;
-				if ( rval ) {
-					mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				if (rval) {
+					mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 					      _("could not forward space %d "
 					      "tape blocks: "
 					      "rval == %d, errno == %d (%s)\n"),
 					      rval,
 					      saved_errno,
-					      strerror( saved_errno ));
+					      strerror(saved_errno));
 					return DRIVE_ERROR_MEDIA;
 				}
-				recskipcnt64remaining -= ( off64_t )recskipcnt;
+				recskipcnt64remaining -= (off64_t)recskipcnt;
 			}
 			contextp->dc_reccnt += recskipcnt64;
 			contextp->dc_iocnt += recskipcnt64;
 			currentoffset = contextp->dc_reccnt
 					*
-					( off64_t )tape_recsz;
-			assert( wantedoffset >= currentoffset );
-			assert( wantedoffset - currentoffset
+					(off64_t)tape_recsz;
+			assert(wantedoffset >= currentoffset);
+			assert(wantedoffset - currentoffset
 				<
-				( off64_t )tape_recsz );
+				(off64_t)tape_recsz);
 		}
 	}
 
 	/* remove excess records by eating them. won't be any if
 	 * FSR supported
 	 */
-	while ( wantedoffset - currentoffset >= ( off64_t )tape_recsz ) {
+	while (wantedoffset - currentoffset >= (off64_t)tape_recsz) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 		int rval;
 
-		assert( ! contextp->dc_recp );
+		assert(! contextp->dc_recp);
 
 		/* figure how much to ask for. to eat an entire record,
 		 * ask for a record sans the header. do_read will eat
 		 * the header, we eat the rest.
 		 */
-		wantedcnt = ( size_t )( tape_recsz - STAPE_HDR_SZ );
+		wantedcnt = (size_t)(tape_recsz - STAPE_HDR_SZ);
 
 		/* eat that much tape
 		 */
 		rval = 0;
-		dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		if ( rval ) {
+		dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		if (rval) {
 			return rval;
 		}
-		assert( actualcnt == wantedcnt );
-		do_return_read_buf( drivep, dummybufp, actualcnt );
-		assert( ! contextp->dc_recp );
-		currentoffset += ( off64_t )tape_recsz;
-		assert( currentoffset
+		assert(actualcnt == wantedcnt);
+		do_return_read_buf(drivep, dummybufp, actualcnt);
+		assert(! contextp->dc_recp);
+		currentoffset += (off64_t)tape_recsz;
+		assert(currentoffset
 			==
-			contextp->dc_reccnt * ( off64_t )tape_recsz );
+			contextp->dc_reccnt * (off64_t)tape_recsz);
 	}
 
 	/* eat that portion of the next record leading up to the
 	 * desired offset.
 	 */
-	if ( wantedoffset != currentoffset ) {
+	if (wantedoffset != currentoffset) {
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
 
-		assert( wantedoffset > currentoffset );
-		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
-		wantedcnt = ( size_t )( wantedoffset - currentoffset );
-		if ( contextp->dc_recp ) {
+		assert(wantedoffset > currentoffset);
+		assert(wantedoffset - currentoffset < (off64_t)tape_recsz);
+		wantedcnt = (size_t)(wantedoffset - currentoffset);
+		if (contextp->dc_recp) {
 			uint32_t recoff;
 #ifdef DEBUG
-			rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+			rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
-			recoff = ( uint32_t )( contextp->dc_nextp
+			recoff = (uint32_t)(contextp->dc_nextp
 						-
-						contextp->dc_recp );
-			assert( recoff <= tape_recsz );
-			assert( rechdrp->rec_used <= tape_recsz );
-			assert( recoff >= STAPE_HDR_SZ );
-			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-			assert( recoff <= rechdrp->rec_used );
-			assert( recoff + wantedcnt <= rechdrp->rec_used );
+						contextp->dc_recp);
+			assert(recoff <= tape_recsz);
+			assert(rechdrp->rec_used <= tape_recsz);
+			assert(recoff >= STAPE_HDR_SZ);
+			assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+			assert(recoff <= rechdrp->rec_used);
+			assert(recoff + wantedcnt <= rechdrp->rec_used);
 		} else {
-			assert( wantedcnt >= STAPE_HDR_SZ );
+			assert(wantedcnt >= STAPE_HDR_SZ);
 			wantedcnt -= STAPE_HDR_SZ;
 		}
 
 		/* eat that much tape
 		 */
-		if ( wantedcnt > 0 ) {
+		if (wantedcnt > 0) {
 		    int rval;
 		    rval = 0;
-		    dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
-		    if ( rval ) {
+		    dummybufp = do_read(drivep, wantedcnt, &actualcnt, &rval);
+		    if (rval) {
 			    return rval;
 		    }
-		    assert( actualcnt == wantedcnt );
-		    do_return_read_buf( drivep, dummybufp, actualcnt );
+		    assert(actualcnt == wantedcnt);
+		    do_return_read_buf(drivep, dummybufp, actualcnt);
 		}
 	}
 
 	/* as a sanity check, refigure the current offset and make sure
 	 * it is equal to the wanted offset
 	 */
-	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	if ( contextp->dc_recp ) {
+	currentoffset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	if (contextp->dc_recp) {
 		uint32_t recoff;
 #ifdef DEBUG
-		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rec_hdr_t *rechdrp = (rec_hdr_t *)contextp->dc_recp;
 #endif
 
-		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( uint32_t )( contextp->dc_nextp
+		assert(contextp->dc_nextp >= contextp->dc_recp);
+		recoff = (uint32_t)(contextp->dc_nextp
 					-
-					contextp->dc_recp );
-		assert( recoff <= tape_recsz );
-		assert( rechdrp->rec_used <= tape_recsz );
-		assert( recoff >= STAPE_HDR_SZ );
-		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
-		assert( recoff <= rechdrp->rec_used );
-		currentoffset += ( off64_t )recoff;
+					contextp->dc_recp);
+		assert(recoff <= tape_recsz);
+		assert(rechdrp->rec_used <= tape_recsz);
+		assert(recoff >= STAPE_HDR_SZ);
+		assert(rechdrp->rec_used >= STAPE_HDR_SZ);
+		assert(recoff <= rechdrp->rec_used);
+		currentoffset += (off64_t)recoff;
 	}
-	assert( wantedoffset == currentoffset );
+	assert(wantedoffset == currentoffset);
 
 	return 0;
 }
@@ -1412,7 +1412,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_next_mark( drive_t *drivep )
+do_next_mark(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	rec_hdr_t *rechdrp;
@@ -1429,69 +1429,69 @@ do_next_mark( drive_t *drivep )
 
 	/* assert protocol being followed.
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: next mark\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: next mark\n");
 
 	trycnt = 0;
 
-	if ( contextp->dc_errorpr ) {
+	if (contextp->dc_errorpr) {
 		goto resetring;
 	} else {
 		goto noerrorsearch;
 	}
 
 noerrorsearch:
-	for ( ; ; ) {
-		rval = getrec( drivep );
-		if ( rval == DRIVE_ERROR_CORRUPTION ) {
+	for (; ;) {
+		rval = getrec(drivep);
+		if (rval == DRIVE_ERROR_CORRUPTION) {
 			goto resetring;
-		} else if ( rval ) {
+		} else if (rval) {
 			return rval;
 		}
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
 
-		assert( rechdrp->first_mark_offset != 0 );
-		if ( rechdrp->first_mark_offset > 0 ) {
+		assert(rechdrp->first_mark_offset != 0);
+		if (rechdrp->first_mark_offset > 0) {
 			 off64_t markoff = rechdrp->first_mark_offset
 					   -
 					   rechdrp->file_offset;
-			 off64_t curoff = ( off64_t )( contextp->dc_nextp
+			 off64_t curoff = (off64_t)(contextp->dc_nextp
 						       -
-						       contextp->dc_recp );
-			 assert( markoff > 0 );
-			 assert( curoff > 0 );
-			 if ( markoff >= curoff ) {
+						       contextp->dc_recp);
+			 assert(markoff > 0);
+			 assert(curoff > 0);
+			 if (markoff >= curoff) {
 				break;
 			}
 		}
 
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
 		contextp->dc_reccnt++;
 	}
 
-	assert( rechdrp->first_mark_offset - rechdrp->file_offset
+	assert(rechdrp->first_mark_offset - rechdrp->file_offset
 		<=
-		( off64_t )tape_recsz );
+		(off64_t)tape_recsz);
 	contextp->dc_nextp = contextp->dc_recp
 			     +
-			     ( size_t )( rechdrp->first_mark_offset
+			     (size_t)(rechdrp->first_mark_offset
 					 -
-					 rechdrp->file_offset );
-	assert( contextp->dc_nextp <= contextp->dc_dataendp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+					 rechdrp->file_offset);
+	assert(contextp->dc_nextp <= contextp->dc_dataendp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	if (contextp->dc_nextp == contextp->dc_dataendp) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1501,152 +1501,152 @@ noerrorsearch:
 	return 0;
 
 resetring:
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
 
 	/* get a record buffer and cast a record header pointer
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
+	if (contextp->dc_singlethreadedpr) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	goto readrecord;
 
 readrecord:
 	trycnt++;
-	if ( trycnt > maxtrycnt ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
-		      _("unable to locate next mark in media file\n") );
+	if (trycnt > maxtrycnt) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
+		      _("unable to locate next mark in media file\n"));
 		return DRIVE_ERROR_MEDIA;
 	}
 
-	nread = Read( drivep, contextp->dc_recp, tape_recsz, &saved_errno );
+	nread = Read(drivep, contextp->dc_recp, tape_recsz, &saved_errno);
 	goto validateread;
 
 validateread:
-	if ( nread == ( int )tape_recsz ) {
+	if (nread == (int)tape_recsz) {
 		goto validatehdr;
 	}
-	ok = mt_get_status( drivep, &mtstat );
-	if ( ! ok ) {
-		status_failed_message( drivep );
+	ok = mt_get_status(drivep, &mtstat);
+	if (! ok) {
+		status_failed_message(drivep);
 		return DRIVE_ERROR_DEVICE;
 	}
 
-	if ( IS_FMK( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EOF attempting to read record\n" );
+	if (IS_FMK(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EOF attempting to read record\n");
 		return DRIVE_ERROR_EOF;
 	}
 
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EOD attempting to read record\n" );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EOD attempting to read record\n");
 		return DRIVE_ERROR_EOD;
 	}
 
-	if ( IS_EOT( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EOM attempting to read record\n" );
+	if (IS_EOT(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EOM attempting to read record\n");
 		return DRIVE_ERROR_EOM;
 	}
 
-	if ( IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "encountered EW attempting to read record\n" );
+	if (IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "encountered EW attempting to read record\n");
 		return DRIVE_ERROR_EOM;
 	}
 
-	if ( nread >= 0 ) {
-		assert( ( size_t )nread <= tape_recsz );
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (nread >= 0) {
+		assert((size_t)nread <= tape_recsz);
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "short read (nread == %d, record size == %d)\n",
 		      nread,
-		      tape_recsz );
+		      tape_recsz);
 		goto getbeyonderror;
 	}
 
 	/* some other error
 	 */
-	mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
+	mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _(
 	      "unexpected error attempting to read record: "
 	      "read returns %d, errno %d (%s)\n"),
 	      nread,
 	      errno,
-	      strerror( errno ));
+	      strerror(errno));
 
 	goto getbeyonderror;
 
 validatehdr:
-	rval = record_hdr_validate( drivep, contextp->dc_recp, BOOL_FALSE );
+	rval = record_hdr_validate(drivep, contextp->dc_recp, BOOL_FALSE);
 
-	if ( rval
+	if (rval
 	     &&
-	     ( contextp->dc_isQICpr == BOOL_TRUE
+	     (contextp->dc_isQICpr == BOOL_TRUE
 	       ||
-	       contextp->dc_isQICpr == BOOL_UNKNOWN )) {
+	       contextp->dc_isQICpr == BOOL_UNKNOWN)) {
 		goto huntQIC;
 	}
 
-	if ( rval ) {
+	if (rval) {
 		goto readrecord;
 	}
 
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
-	if ( rechdrp->first_mark_offset < 0 ) {
-		mlog( MLOG_NORMAL | MLOG_DRIVE,
+	if (rechdrp->first_mark_offset < 0) {
+		mlog(MLOG_NORMAL | MLOG_DRIVE,
 		      _("valid record %lld but no mark\n"),
-		      contextp->dc_iocnt - 1 );
+		      contextp->dc_iocnt - 1);
 		goto readrecord;
 	}
 
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
 	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
-	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
-	assert( markoff < ( off64_t )tape_recsz );
-	assert( rechdrp->rec_used > STAPE_HDR_SZ );
-	assert( rechdrp->rec_used < tape_recsz );
+	assert(markoff >= (off64_t)STAPE_HDR_SZ);
+	assert(markoff < (off64_t)tape_recsz);
+	assert(rechdrp->rec_used > STAPE_HDR_SZ);
+	assert(rechdrp->rec_used < tape_recsz);
 
 	goto alliswell;
 
 alliswell:
-	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
-	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
-	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
+	contextp->dc_nextp = contextp->dc_recp + (size_t)markoff;
+	assert(! (rechdrp->file_offset % (off64_t)tape_recsz));
+	contextp->dc_reccnt = rechdrp->file_offset / (off64_t)tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
-	assert( contextp->dc_dataendp <= contextp->dc_recendp );
-	assert( contextp->dc_nextp < contextp->dc_dataendp );
+	assert(contextp->dc_dataendp <= contextp->dc_recendp);
+	assert(contextp->dc_nextp < contextp->dc_dataendp);
 	contextp->dc_errorpr = BOOL_FALSE;
 
-	mlog( MLOG_NORMAL | MLOG_DRIVE,
+	mlog(MLOG_NORMAL | MLOG_DRIVE,
 	      _("resynchronized at record %lld offset %u\n"),
 	      contextp->dc_iocnt - 1,
 	      contextp->dc_nextp
 	      -
-	      contextp->dc_recp );
+	      contextp->dc_recp);
 	return 0;
 
 getbeyonderror:
-	rval = mt_op( contextp->dc_fd, MTFSR, 1 );
+	rval = mt_op(contextp->dc_fd, MTFSR, 1);
 	saved_errno = errno;
 
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not forward space one tape block beyond "
 		      "read error: rval == %d, errno == %d (%s)\n"),
 		      rval,
 		      saved_errno,
-		      strerror( saved_errno ));
+		      strerror(saved_errno));
 		return DRIVE_ERROR_MEDIA;
 	}
 
@@ -1658,12 +1658,12 @@ huntQIC:
 	 * the following blocks to the head of the record buffer, and try
 	 * to read the remaining blocks in the record.
 	 */
-	for ( p = contextp->dc_recp + QIC_BLKSZ
+	for (p = contextp->dc_recp + QIC_BLKSZ
 	      ;
 	      p < contextp->dc_recendp
 	      ;
-	      p += QIC_BLKSZ ) {
-		if ( *( uint64_t * )p == STAPE_MAGIC ) {
+	      p += QIC_BLKSZ) {
+		if (*(uint64_t *)p == STAPE_MAGIC) {
 			goto adjustQIC;
 		}
 	}
@@ -1671,14 +1671,14 @@ huntQIC:
 	goto readrecord;
 
 adjustQIC:
-	tailsz = ( size_t )( contextp->dc_recendp - p );
-	memcpy( ( void * )contextp->dc_recp,
-		( void * )p,
-		tailsz );
-	nread = Read( drivep,
+	tailsz = (size_t)(contextp->dc_recendp - p);
+	memcpy((void *)contextp->dc_recp,
+		(void *)p,
+		tailsz);
+	nread = Read(drivep,
 		      contextp->dc_recp + tailsz,
 		      tape_recsz - tailsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	goto validateread;
 }
@@ -1691,20 +1691,20 @@ adjustQIC:
  *	void
  */
 static void
-do_end_read( drive_t *drivep )
+do_end_read(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: end read\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: end read\n");
 
 	/* assert protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 
@@ -1720,7 +1720,7 @@ do_end_read( drive_t *drivep )
  * 	DRIVE_ERROR_... on failure
  */
 static int
-do_begin_write( drive_t *drivep )
+do_begin_write(drive_t *drivep)
 {
 	drive_context_t		*contextp;
 	drive_hdr_t		*dwhdrp;
@@ -1742,38 +1742,38 @@ do_begin_write( drive_t *drivep )
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: begin write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: begin write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( ! drivep->d_markrecheadp );
-	assert( ! contextp->dc_recp );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(! drivep->d_markrecheadp);
+	assert(! contextp->dc_recp);
 
 	/* get pointers into global write header
 	 */
 	gwhdrp = drivep->d_gwritehdrp;
 	dwhdrp = drivep->d_writehdrp;
-	tpwhdrp = ( rec_hdr_t * )dwhdrp->dh_specific;
+	tpwhdrp = (rec_hdr_t *)dwhdrp->dh_specific;
 
 	/* must already be open. The only way to open is to do a begin_read.
 	 * so all interaction with scsi tape requires reading first.
 	 */
-	assert( contextp->dc_fd != -1 );
+	assert(contextp->dc_fd != -1);
 
 	/* get tape device status. verify tape is positioned
  	 */
-	if ( ! mt_get_status( drivep, &mtstat )) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
         	return DRIVE_ERROR_DEVICE;
 	}
-	if ( IS_EOT( mtstat )) {
+	if (IS_EOT(mtstat)) {
 		return DRIVE_ERROR_EOM;
 	}
-	if ( IS_EW( mtstat ) && !(IS_BOT(mtstat)) ) {
+	if (IS_EW(mtstat) && !(IS_BOT(mtstat))) {
 		return DRIVE_ERROR_EOM;
 	}
 
@@ -1781,8 +1781,8 @@ do_begin_write( drive_t *drivep )
 	 */
 	tpwhdrp->magic = STAPE_MAGIC;
 	tpwhdrp->version = STAPE_VERSION;
-	tpwhdrp->blksize = ( int32_t )tape_blksz;
-	tpwhdrp->recsize = ( int32_t )tape_recsz;
+	tpwhdrp->blksize = (int32_t)tape_blksz;
+	tpwhdrp->recsize = (int32_t)tape_recsz;
 	tpwhdrp->rec_used = 0;
 	tpwhdrp->file_offset = 0;
 	tpwhdrp->first_mark_offset= 0;
@@ -1791,15 +1791,15 @@ do_begin_write( drive_t *drivep )
 	/* get a record buffer. will be used for the media file header,
 	 * and is needed to "prime the pump" for first call to do_write.
 	 */
-	assert( ! contextp->dc_recp );
-	if ( contextp->dc_singlethreadedpr ) {
-		assert( contextp->dc_bufp );
+	assert(! contextp->dc_recp);
+	if (contextp->dc_singlethreadedpr) {
+		assert(contextp->dc_bufp);
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		assert( contextp->dc_ringp );
-		assert( ! contextp->dc_msgp );
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert(contextp->dc_ringp);
+		assert(! contextp->dc_msgp);
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+		assert(contextp->dc_msgp->rm_stat == RING_STAT_INIT);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -1807,7 +1807,7 @@ do_begin_write( drive_t *drivep )
 	 * being produced!
 	 */
 	contextp->dc_iocnt = 0;
-	memset( ( void * )contextp->dc_recp, 0, tape_recsz );
+	memset((void *)contextp->dc_recp, 0, tape_recsz);
 
 	tmpgh  = (global_hdr_t *)contextp->dc_recp;
 	tmpdh  = (drive_hdr_t *)tmpgh->gh_upper;
@@ -1829,12 +1829,12 @@ do_begin_write( drive_t *drivep )
 
 	/* checksum the global header
 	 */
-	global_hdr_checksum_set( tmpgh );
+	global_hdr_checksum_set(tmpgh);
 
-	rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE );
-	if ( rval ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_FALSE);
+	if (rval) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_recp = 0;
@@ -1844,7 +1844,7 @@ do_begin_write( drive_t *drivep )
 	/* prepare the drive context. must have a record buffer ready to
 	 * go, header initialized.
 	 */
-	assert( ! contextp->dc_ownedp );
+	assert(! contextp->dc_ownedp);
 	contextp->dc_reccnt = 1; /* count the header record */
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
@@ -1854,12 +1854,12 @@ do_begin_write( drive_t *drivep )
 	rechdrp = (rec_hdr_t*)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	/* set mode now so operators will work
 	 */
@@ -1874,10 +1874,10 @@ do_begin_write( drive_t *drivep )
  * in record.
  */
 static void
-do_set_mark( drive_t *drivep,
+do_set_mark(drive_t *drivep,
 	     drive_mcbfp_t cbfuncp,
 	     void *cbcontextp,
-	     drive_markrec_t *markrecp )
+	     drive_markrec_t *markrecp)
 {
 	drive_context_t *contextp;
 	off64_t nextoff;
@@ -1885,34 +1885,34 @@ do_set_mark( drive_t *drivep,
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
 
 	/* calculate and fill in the mark record offset
 	 */
-	assert( contextp->dc_recp );
-	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
+	assert(contextp->dc_recp);
+	nextoff = contextp->dc_reccnt * (off64_t)tape_recsz
 		  +
-		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
-	markrecp->dm_log = ( drive_mark_t )nextoff;
+		  (off64_t)(contextp->dc_nextp - contextp->dc_recp);
+	markrecp->dm_log = (drive_mark_t)nextoff;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: set mark: %lld (0x%llx)\n",
 	      nextoff,
-	      nextoff );
+	      nextoff);
 
 	/* note the location of the first mark in this tape record.
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-	if ( rechdrp->first_mark_offset == -1LL ) {
-		assert( nextoff != -1LL );
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
+	if (rechdrp->first_mark_offset == -1LL) {
+		assert(nextoff != -1LL);
 		rechdrp->first_mark_offset = nextoff;
 	}
 
@@ -1921,11 +1921,11 @@ do_set_mark( drive_t *drivep,
 	markrecp->dm_cbfuncp = cbfuncp;
 	markrecp->dm_cbcontextp = cbcontextp;
 	markrecp->dm_nextp = 0;
-	if ( drivep->d_markrecheadp == 0 ) {
+	if (drivep->d_markrecheadp == 0) {
 		drivep->d_markrecheadp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	} else {
-		assert( drivep->d_markrectailp );
+		assert(drivep->d_markrectailp);
 		drivep->d_markrectailp->dm_nextp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	}
@@ -1940,7 +1940,7 @@ do_set_mark( drive_t *drivep,
  *	"actual_bufszp" points to the size of the buffer
  */
 static char *
-do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
+do_get_write_buf(drive_t *drivep, size_t wantedcnt, size_t *actualcntp)
 {
 	drive_context_t *contextp;
 	size_t remainingcnt;
@@ -1948,32 +1948,32 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* figure how much is available; supply the min of what is
 	 * available and what is wanted.
 	 */
-	remainingcnt = ( size_t )( contextp->dc_recendp - contextp->dc_nextp );
-	actualcnt = min( remainingcnt, wantedcnt );
+	remainingcnt = (size_t)(contextp->dc_recendp - contextp->dc_nextp);
+	actualcnt = min(remainingcnt, wantedcnt);
 	*actualcntp = actualcnt;
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: get write buf: wanted %u (0x%x) actual %u (0x%x)\n",
 	      wantedcnt,
 	      wantedcnt,
 	      actualcnt,
-	      actualcnt );
+	      actualcnt);
 
 	return contextp->dc_ownedp;
 }
@@ -1991,7 +1991,7 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
  */
 /* ARGSUSED */
 static int
-do_write( drive_t *drivep, char *bufp, size_t retcnt )
+do_write(drive_t *drivep, char *bufp, size_t retcnt)
 {
 	drive_context_t *contextp;
 	rec_hdr_t *rechdrp;
@@ -2002,33 +2002,33 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* get drive context and pointer to global write hdr
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 	gwhdrp = drivep->d_gwritehdrp;
 
 	/* calculate how many bytes we believe caller is holding
 	 */
-	heldcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
+	heldcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: write: retcnt %u (0x%x) heldcnt %u (0x%x)\n",
 	      retcnt,
 	      retcnt,
 	      heldcnt,
-	      heldcnt );
+	      heldcnt);
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp <= contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp <= contextp->dc_recendp);
 
 	/* verify the caller is returning exactly what is held
 	 */
-	assert( bufp == contextp->dc_ownedp );
-	assert( retcnt == heldcnt );
+	assert(bufp == contextp->dc_ownedp);
+	assert(retcnt == heldcnt);
 
 	/* take it back
 	 */
@@ -2037,30 +2037,30 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	/* if some portion of the record buffer has not yet been
 	 * held by the client, just return.
 	 */
-	if ( contextp->dc_nextp < contextp->dc_recendp ) {
+	if (contextp->dc_nextp < contextp->dc_recendp) {
 		return 0;
 	}
 
 	/* record in record header that entire record is used
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->rec_used = tape_recsz;
 
 	/* write out the record buffer and get a new one.
 	 */
-	if ( contextp->dc_singlethreadedpr ) {
-		rval = write_record( drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE );
+	if (contextp->dc_singlethreadedpr) {
+		rval = write_record(drivep, contextp->dc_recp, BOOL_TRUE, BOOL_TRUE);
 		last_rec_wrtn_wo_err = contextp->dc_reccnt; /* conv cnt to ix */
 	} else {
 		contextp->dc_msgp->rm_op = RING_OP_WRITE;
 		contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-		Ring_put( contextp->dc_ringp,
-			  contextp->dc_msgp );
+		Ring_put(contextp->dc_ringp,
+			  contextp->dc_msgp);
 		contextp->dc_msgp = 0;
-		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
+		contextp->dc_msgp = Ring_get(contextp->dc_ringp);
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 		last_rec_wrtn_wo_err = contextp->dc_msgp->rm_user;
-		switch( contextp->dc_msgp->rm_stat ) {
+		switch(contextp->dc_msgp->rm_stat) {
 		case RING_STAT_OK:
 		case RING_STAT_INIT:
 			rval = 0;
@@ -2069,7 +2069,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 			rval = contextp->dc_msgp->rm_rval;
 			break;
 		default:
-			assert( 0 );
+			assert(0);
 			return DRIVE_ERROR_CORE;
 		}
 	}
@@ -2077,7 +2077,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	/* check for errors. if none, commit all marks before a safety margin
 	 * before the no error offset.
 	 */
-	if ( rval ) {
+	if (rval) {
 		contextp->dc_errorpr = BOOL_TRUE;
 	} else {
 		off64_t recs_wrtn_wo_err;
@@ -2085,8 +2085,8 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 		off64_t bytes_committed;
 		recs_wrtn_wo_err = last_rec_wrtn_wo_err + 1;
 		recs_committed = recs_wrtn_wo_err - contextp->dc_lostrecmax;
-		bytes_committed = recs_committed * ( off64_t )tape_recsz;
-		drive_mark_commit( drivep, bytes_committed );
+		bytes_committed = recs_committed * (off64_t)tape_recsz;
+		drive_mark_commit(drivep, bytes_committed);
 	}
 
 	/* adjust context
@@ -2099,15 +2099,15 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* intialize header in new record
 	 */
-	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
+	rechdrp = (rec_hdr_t *)contextp->dc_recp;
 	rechdrp->magic = STAPE_MAGIC;
 	rechdrp->version = STAPE_VERSION;
-	rechdrp->file_offset = contextp->dc_reccnt * ( off64_t )tape_recsz;
-	rechdrp->blksize = ( int32_t )tape_blksz;
-	rechdrp->recsize = ( int32_t )tape_recsz;
+	rechdrp->file_offset = contextp->dc_reccnt * (off64_t)tape_recsz;
+	rechdrp->blksize = (int32_t)tape_blksz;
+	rechdrp->recsize = (int32_t)tape_recsz;
 	rechdrp->capability = drivep->d_capabilities;
 	rechdrp->first_mark_offset = -1LL;
-	uuid_copy( rechdrp->dump_uuid, gwhdrp->gh_dumpid );
+	uuid_copy(rechdrp->dump_uuid, gwhdrp->gh_dumpid);
 
 	return rval;
 }
@@ -2120,40 +2120,40 @@ 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;
 	drive_context_t *contextp;
 
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: get align cnt\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: get align cnt\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_errorpr );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_errorpr);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because all buffers are page-aligned
 	 * and a multiple of PGSZ.
 	 */
-	next_alignment_off = ( intptr_t )contextp->dc_nextp;
+	next_alignment_off = (intptr_t)contextp->dc_nextp;
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
-	next_alignment_point = ( char * )next_alignment_off;
-	assert( next_alignment_point <= contextp->dc_recendp );
+	next_alignment_point = (char *)next_alignment_off;
+	assert(next_alignment_point <= contextp->dc_recendp);
 
 	/* return the number of bytes to the next alignment offset
 	 */
-	assert( next_alignment_point >= contextp->dc_nextp );
-	return ( size_t )( next_alignment_point - contextp->dc_nextp );
+	assert(next_alignment_point >= contextp->dc_nextp);
+	return (size_t)(next_alignment_point - contextp->dc_nextp);
 }
 
 /* do_end_write - pad and write pending record if any client data in it.
@@ -2164,9 +2164,9 @@ do_get_align_cnt( drive_t * drivep )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_end_write( drive_t *drivep, off64_t *ncommittedp )
+do_end_write(drive_t *drivep, off64_t *ncommittedp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t first_rec_w_err; /* zero-based index */
 	off64_t recs_wtn_wo_err;
 	off64_t recs_guaranteed;
@@ -2174,17 +2174,17 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	int rval;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: end write\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: end write\n");
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_recp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	assert( contextp->dc_nextp < contextp->dc_recendp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_recp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ);
+	assert(contextp->dc_nextp < contextp->dc_recendp);
 
 	/* pre-initialize return of count of bytes committed to media
 	 */
@@ -2194,46 +2194,46 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * to do anymore writes, just cleanup and return 0. don't need to
 	 * do commits, already done when error occured.
 	 */
-	if ( contextp->dc_errorpr ) {
-		if ( ! contextp->dc_singlethreadedpr ) {
-			Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (contextp->dc_errorpr) {
+		if (! contextp->dc_singlethreadedpr) {
+			Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 			contextp->dc_msgp = 0;
 		}
 		contextp->dc_mode = OM_NONE;
-		drive_mark_discard( drivep );
-		*ncommittedp = ( contextp->dc_iocnt - contextp->dc_lostrecmax )
+		drive_mark_discard(drivep);
+		*ncommittedp = (contextp->dc_iocnt - contextp->dc_lostrecmax)
 			       *
-			       ( off64_t )tape_recsz;
+			       (off64_t)tape_recsz;
 		contextp->dc_recp = 0;
 		return 0;
 	}
 
 	/* if any user data in current record buffer, send it out.
 	 */
-	if ( contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ ) {
+	if (contextp->dc_nextp > contextp->dc_recp + STAPE_HDR_SZ) {
 		rec_hdr_t *rechdrp;
 		size_t bufusedcnt;
 
-		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
-		bufusedcnt = ( size_t )( contextp->dc_nextp
+		rechdrp = (rec_hdr_t *)contextp->dc_recp;
+		bufusedcnt = (size_t)(contextp->dc_nextp
 					 -
-					 contextp->dc_recp );
+					 contextp->dc_recp);
 		rechdrp->rec_used = bufusedcnt;
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "writing padded last record\n" );
-		if ( contextp->dc_singlethreadedpr ) {
-			rval = write_record( drivep,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "writing padded last record\n");
+		if (contextp->dc_singlethreadedpr) {
+			rval = write_record(drivep,
 					     contextp->dc_recp,
-					     BOOL_TRUE, BOOL_TRUE );
+					     BOOL_TRUE, BOOL_TRUE);
 		} else {
-			assert( contextp->dc_msgp );
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_WRITE;
 			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			switch( contextp->dc_msgp->rm_stat ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
 				rval = 0;
@@ -2242,7 +2242,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 				rval = contextp->dc_msgp->rm_rval;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2259,7 +2259,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * media, and that will be used to select which marks
 	 * to commit and which to discard.
 	 */
-	if ( rval ) {
+	if (rval) {
 		first_rec_w_err = contextp->dc_iocnt;
 			/* because dc_iocnt bumped by write_record
 			 * only if no error
@@ -2267,28 +2267,28 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	} else {
 		first_rec_w_err = -1L;
 	}
-	if ( ! contextp->dc_singlethreadedpr ) {
-		while ( ! rval ) {
-			assert( contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		while (! rval) {
+			assert(contextp->dc_msgp);
 			contextp->dc_msgp->rm_op = RING_OP_TRACE;
-			Ring_put( contextp->dc_ringp,
-				  contextp->dc_msgp );
+			Ring_put(contextp->dc_ringp,
+				  contextp->dc_msgp);
 			contextp->dc_msgp = 0;
-			contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-			if ( contextp->dc_msgp->rm_op == RING_OP_TRACE ) {
+			contextp->dc_msgp = Ring_get(contextp->dc_ringp);
+			if (contextp->dc_msgp->rm_op == RING_OP_TRACE) {
 				break;
 			}
-			switch( contextp->dc_msgp->rm_stat ) {
+			switch(contextp->dc_msgp->rm_stat) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
-				assert( rval == 0 );
+				assert(rval == 0);
 				break;
 			case RING_STAT_ERROR:
 				rval = contextp->dc_msgp->rm_rval;
 				first_rec_w_err = contextp->dc_msgp->rm_user;
 				break;
 			default:
-				assert( 0 );
+				assert(0);
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2297,8 +2297,8 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	/* the ring is now flushed. reset
 	 */
-	if ( ! contextp->dc_singlethreadedpr ) {
-		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
+	if (! contextp->dc_singlethreadedpr) {
+		Ring_reset(contextp->dc_ringp, contextp->dc_msgp);
 		contextp->dc_msgp = 0;
 	}
 	contextp->dc_recp = 0;
@@ -2307,30 +2307,30 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * side-effect of flushing the driver/drive of pending writes,
 	 * exposing any write errors.
 	 */
-	if ( ! rval ) {
+	if (! rval) {
 		int weofrval;
 		mtstat_t mtstat;
 		bool_t ok;
 
-		weofrval = mt_op( contextp->dc_fd, MTWEOF, 1 );
-		if ( ! weofrval ) {
-			ok = mt_get_status( drivep, &mtstat );
-			if ( ! ok ) {
-				status_failed_message( drivep );
+		weofrval = mt_op(contextp->dc_fd, MTWEOF, 1);
+		if (! weofrval) {
+			ok = mt_get_status(drivep, &mtstat);
+			if (! ok) {
+				status_failed_message(drivep);
 				mtstat = 0;
 				rval = DRIVE_ERROR_DEVICE;
 			}
 		} else {
 			mtstat = 0;
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
 			      "MTWEOF returned %d: errno == %d (%s)\n",
 			      weofrval,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 		}
-		if ( weofrval || IS_EW( mtstat ) || IS_EOT( mtstat )) {
-			mlog( MLOG_DEBUG | MLOG_DRIVE,
-			     "hit EOM trying to write file mark\n" );
+		if (weofrval || IS_EW(mtstat) || IS_EOT(mtstat)) {
+			mlog(MLOG_DEBUG | MLOG_DRIVE,
+			     "hit EOM trying to write file mark\n");
 			rval = DRIVE_ERROR_EOM;
 		}
 	}
@@ -2349,18 +2349,18 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * and return rval. return by reference the number of bytes committed
 	 * to tape.
 	 */
-	if ( rval ) {
-		assert( first_rec_w_err >= 0 );
+	if (rval) {
+		assert(first_rec_w_err >= 0);
 		recs_wtn_wo_err = first_rec_w_err;
 		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
 	} else {
-		assert( first_rec_w_err == -1 );
+		assert(first_rec_w_err == -1);
 		recs_wtn_wo_err = contextp->dc_iocnt;
 		recs_guaranteed = recs_wtn_wo_err;
 	}
-	bytes_committed = recs_guaranteed * ( off64_t )tape_recsz;
-	drive_mark_commit( drivep, bytes_committed );
-	drive_mark_discard( drivep );
+	bytes_committed = recs_guaranteed * (off64_t)tape_recsz;
+	drive_mark_commit(drivep, bytes_committed);
+	drive_mark_discard(drivep);
 	contextp->dc_mode = OM_NONE;
 	*ncommittedp = bytes_committed;
 	return rval;
@@ -2374,7 +2374,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_fsf( drive_t *drivep, int count, int *statp )
+do_fsf(drive_t *drivep, int count, int *statp)
 {
 	int 		i, done, op_failed, opcount;
 	mtstat_t mtstat;
@@ -2382,42 +2382,42 @@ do_fsf( drive_t *drivep, int count, int *statp )
 
 	/* get drive context
 	 */
-        contextp = ( drive_context_t * )drivep->d_contextp;
+        contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* verify protocol being followed
 	 */
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: fsf: count %d\n",
-	      count );
+	      count);
 
-	assert( count );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(count);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* get tape status
   	 */
-	if ( ! mt_get_status( drivep, &mtstat) ) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
 		*statp = DRIVE_ERROR_DEVICE;
 		return 0;
 	}
 
-	for ( i = 0 ; i < count; i++ ) {
+	for (i = 0 ; i < count; i++) {
 		done = 0;
 		opcount = 2;
 
 		/* the tape may encounter errors will trying to
 		 * reach the next file.
 		 */
-		while ( !done ) {
+		while (!done) {
 			/* check for end-of-data and end-of-tape conditions
 			 */
-			if ( IS_EOT( mtstat ) ) {
+			if (IS_EOT(mtstat)) {
 				*statp = DRIVE_ERROR_EOM;
 				return i;
 
-			} else if ( IS_EOD( mtstat ) ) {
+			} else if (IS_EOD(mtstat)) {
 				*statp = DRIVE_ERROR_EOD;
 				return i;
 			}
@@ -2426,17 +2426,17 @@ do_fsf( drive_t *drivep, int count, int *statp )
 			 * NOTE:
 			 * 	ignore return code
 			 */
-			mlog( MLOG_VERBOSE | MLOG_DRIVE,
-			      _("advancing tape to next media file\n") );
+			mlog(MLOG_VERBOSE | MLOG_DRIVE,
+			      _("advancing tape to next media file\n"));
 
 			op_failed = 0;
-			assert( contextp->dc_fd >= 0 );
-			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
+			assert(contextp->dc_fd >= 0);
+			if (mt_op(contextp->dc_fd, MTFSF, 1)) {
 				op_failed = 1;
 			}
 
-			if ( ! mt_get_status( drivep, &mtstat) ) {
-				status_failed_message( drivep );
+			if (! mt_get_status(drivep, &mtstat)) {
+				status_failed_message(drivep);
 				*statp = DRIVE_ERROR_DEVICE;
 				return i;
 			}
@@ -2444,7 +2444,7 @@ do_fsf( drive_t *drivep, int count, int *statp )
 			/* Check for a file mark to
 			 * determine if the fsf command worked.
 			 */
-			if ( (!op_failed) && (IS_FMK(mtstat)) ) {
+			if ((!op_failed) && (IS_FMK(mtstat))) {
 				done = 1;
 			}
 
@@ -2452,9 +2452,9 @@ do_fsf( drive_t *drivep, int count, int *statp )
 			 * times, and a file mark has not been reached,
 			 * return an error.
 			 */
-			if ( --opcount < 0 ) {
-				mlog( MLOG_VERBOSE | MLOG_DRIVE,
-					_("FSF tape command failed\n") );
+			if (--opcount < 0) {
+				mlog(MLOG_VERBOSE | MLOG_DRIVE,
+					_("FSF tape command failed\n"));
 
 				*statp = DRIVE_ERROR_DEVICE;
 				return i;
@@ -2474,19 +2474,19 @@ do_fsf( drive_t *drivep, int count, int *statp )
  *	*statp set to zero or DRIVE_ERROR_...
  */
 static int
-do_bsf( drive_t *drivep, int count, int *statp )
+do_bsf(drive_t *drivep, int count, int *statp)
 {
 #ifdef DEBUG
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	int skipped;
 	mtstat_t mtstat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: bsf: count %d\n",
-	      count );
+	      count);
 
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_mode == OM_NONE);
 
 	*statp = 0;
 
@@ -2497,29 +2497,29 @@ do_bsf( drive_t *drivep, int count, int *statp )
 
 	/* get tape status
 	 */
-	if ( ! mt_get_status( drivep, &mtstat )) {
-		status_failed_message( drivep );
+	if (! mt_get_status(drivep, &mtstat)) {
+		status_failed_message(drivep);
 		*statp = DRIVE_ERROR_DEVICE;
 		return 0;
 	}
 
 	/* check for beginning-of-tape condition. close/reopen hack here
 	 */
-	if ( IS_BOT( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "reopening drive while at BOT\n" );
-		Close( drivep );
-		if ( ! Open( drivep )) {
-			display_access_failed_message( drivep );
+	if (IS_BOT(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "reopening drive while at BOT\n");
+		Close(drivep);
+		if (! Open(drivep)) {
+			display_access_failed_message(drivep);
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
-		if ( ! mt_get_status( drivep, &mtstat )) {
-			status_failed_message( drivep );
+		if (! mt_get_status(drivep, &mtstat)) {
+			status_failed_message(drivep);
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
-		assert( IS_BOT(mtstat ));
+		assert(IS_BOT(mtstat));
 
 
 		*statp = DRIVE_ERROR_BOM;
@@ -2529,18 +2529,18 @@ do_bsf( drive_t *drivep, int count, int *statp )
 	/* check if already at (and to right of) file mark and
 	 * count is zero.
 	 */
-	if ( IS_FMK( mtstat ) && count == 0 ) {
+	if (IS_FMK(mtstat) && count == 0) {
 		return 0;
 	}
 
 	/* back space - places us to left of previous file mark
 	 */
-	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
-	mtstat = bsf_and_verify( drivep );
+	assert(drivep->d_capabilities & DRIVE_CAP_BSF);
+	mtstat = bsf_and_verify(drivep);
 
 	/* check again for beginning-of-tape condition
 	 */
-	if ( IS_BOT( mtstat )) {
+	if (IS_BOT(mtstat)) {
 		*statp = DRIVE_ERROR_BOM;
 		return 0;
 	}
@@ -2550,8 +2550,8 @@ do_bsf( drive_t *drivep, int count, int *statp )
 	 * TS devices !!!  LINUX ST tape driver only reports
 	 * GMT_EOF to the right of the filemark !!
 	 */
-	if ( TS_ISDRIVER ) {
-		if ( ! IS_FMK( mtstat )) {
+	if (TS_ISDRIVER) {
+		if (! IS_FMK(mtstat)) {
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
@@ -2559,18 +2559,18 @@ 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.
 		 */
-		mtstat = bsf_and_verify( drivep );
-		if ( IS_BOT( mtstat )) {
+		mtstat = bsf_and_verify(drivep);
+		if (IS_BOT(mtstat)) {
 			*statp = DRIVE_ERROR_BOM;
 			return skipped + 1;
 		}
-		if ( TS_ISDRIVER ) {
-			if ( ! IS_FMK( mtstat )) {
+		if (TS_ISDRIVER) {
+			if (! IS_FMK(mtstat)) {
 				*statp = DRIVE_ERROR_DEVICE;
 				return 0;
 			}
@@ -2579,11 +2579,11 @@ 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 )) {
+	mtstat = fsf_and_verify(drivep);
+	if(IS_EOT(mtstat)) {
 		*statp = DRIVE_ERROR_EOM;
 	}
-	if ( ! IS_FMK( mtstat )) {
+	if (! IS_FMK(mtstat)) {
 		*statp = DRIVE_ERROR_DEVICE;
 	}
 
@@ -2600,23 +2600,23 @@ do_bsf( drive_t *drivep, int count, int *statp )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_rewind( drive_t *drivep )
+do_rewind(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	mtstat_t mtstat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: rewind\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: rewind\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	mtstat = rewind_and_verify( drivep );
-	if ( ! IS_BOT( mtstat )) {
+	mtstat = rewind_and_verify(drivep);
+	if (! IS_BOT(mtstat)) {
 		return DRIVE_ERROR_DEVICE;
 	} else {
 		return 0;
@@ -2631,40 +2631,40 @@ do_rewind( drive_t *drivep )
  *	DRIVE_ERROR_* on failure
  */
 static int
-do_erase( drive_t *drivep )
+do_erase(drive_t *drivep)
 {
 #ifdef DEBUG
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 #endif
 	mtstat_t mtstat;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: erase\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: erase\n");
 
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp->dc_fd >= 0);
 
 	/* use validating tape rewind util func
 	 */
-	mtstat = rewind_and_verify( drivep );
-	if ( ! IS_BOT( mtstat )) {
+	mtstat = rewind_and_verify(drivep);
+	if (! IS_BOT(mtstat)) {
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* use validating tape erase util func
 	 */
-	( void )erase_and_verify( drivep );
+	(void)erase_and_verify(drivep);
 
 	/* rewind again
 	 */
-	mtstat = rewind_and_verify( drivep );
-	if ( ! IS_BOT( mtstat )) {
+	mtstat = rewind_and_verify(drivep);
+	if (! IS_BOT(mtstat)) {
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* close the drive so we start from scratch
 	 */
-	Close( drivep );
+	Close(drivep);
 	return 0;
 }
 
@@ -2676,27 +2676,27 @@ do_erase( drive_t *drivep )
  *	DRIVE_ERROR_DEVICE on failure
  */
 static int
-do_eject_media( drive_t *drivep )
+do_eject_media(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: eject media\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: eject media\n");
 
 	/* drive must be open
 	 */
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* issue tape unload
 	 */
-	if ( contextp->dc_unloadokpr ) {
-		( void )mt_op( contextp->dc_fd, MTUNLOAD, 0 );
+	if (contextp->dc_unloadokpr) {
+		(void)mt_op(contextp->dc_fd, MTUNLOAD, 0);
 	}
 
 	/* close the device driver
 	 */
-	Close( drivep );
+	Close(drivep);
 
 	return 0;
 }
@@ -2709,10 +2709,10 @@ do_eject_media( drive_t *drivep )
  */
 /* ARGSUSED */
 static int
-do_get_device_class( drive_t *drivep)
+do_get_device_class(drive_t *drivep)
 {
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: get device class\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: get device class\n");
 
 	return DEVICE_TAPE_REMOVABLE;
 }
@@ -2720,69 +2720,69 @@ do_get_device_class( drive_t *drivep)
 /* do_display_metrics - print ring stats if using I/O ring
  */
 static void
-do_display_metrics( drive_t *drivep )
+do_display_metrics(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	if ( ringp ) {
-		if ( drivecnt > 1 ) {
-			mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
+	if (ringp) {
+		if (drivecnt > 1) {
+			mlog(MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_DRIVE,
 			      _("drive %u "),
-			      drivep->d_index );
+			      drivep->d_index);
 		}
-		display_ring_metrics( drivep,
-				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK );
+		display_ring_metrics(drivep,
+				      MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK);
 	}
 }
 
 /* do_quit
  */
 static void
-do_quit( drive_t *drivep )
+do_quit(drive_t *drivep)
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op: quit\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op: quit\n");
 
 	/* print the ring metrics and kill the ring
 	 */
-	if ( ringp ) {
-		display_ring_metrics( drivep, MLOG_VERBOSE );
+	if (ringp) {
+		display_ring_metrics(drivep, MLOG_VERBOSE);
 
 		/* tell slave to die
 		 */
-		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
-		      "ring op: destroy\n" );
-		ring_destroy( ringp );
+		mlog((MLOG_NITTY + 1) | MLOG_DRIVE,
+		      "ring op: destroy\n");
+		ring_destroy(ringp);
 	}
 
-	if ( ! contextp->dc_isvarpr
+	if (! contextp->dc_isvarpr
 	     &&
 	     ! contextp->dc_isQICpr
 	     &&
 	     contextp->dc_cansetblkszpr
 	     &&
-	     ( contextp->dc_origcurblksz != 0 ) ) {
-		( void )set_fixed_blksz( drivep, contextp->dc_origcurblksz );
+	     (contextp->dc_origcurblksz != 0)) {
+		(void)set_fixed_blksz(drivep, contextp->dc_origcurblksz);
 	}
 
 	/* issue tape unload
 	 */
-	if ( contextp->dc_unloadokpr ) {
-		( void )mt_op( contextp->dc_fd, MTUNLOAD, 0 );
+	if (contextp->dc_unloadokpr) {
+		(void)mt_op(contextp->dc_fd, MTUNLOAD, 0);
 	}
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "drive op quit complete\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "drive op quit complete\n");
 }
 
 static double
-percent64( off64_t num, off64_t denom )
+percent64(off64_t num, off64_t denom)
 {
-	return ( double )( num * 100 ) / ( double )denom;
+	return (double)(num * 100) / (double)denom;
 }
 
 
@@ -2831,7 +2831,7 @@ percent64( off64_t num, off64_t denom )
 
 
 static int
-read_label( drive_t *drivep )
+read_label(drive_t *drivep)
 {
 	drive_context_t *contextp;
 	int nread;
@@ -2843,46 +2843,46 @@ read_label( drive_t *drivep )
 
 	/* initialize context ptr
 	 */
-	contextp = ( drive_context_t * )drivep->d_contextp;
+	contextp = (drive_context_t *)drivep->d_contextp;
 
 	/* if not at BOT or a file mark, advance to right of next file mark
 	 */
-	ok = mt_get_status( drivep, &mtstat );
-	if ( ! ok ) {
-		status_failed_message( drivep );
+	ok = mt_get_status(drivep, &mtstat);
+	if (! ok) {
+		status_failed_message(drivep);
 		return DRIVE_ERROR_DEVICE;
 	}
-	if ( ! IS_BOT( mtstat ) && ! IS_FMK( mtstat )) {
-		mtstat = fsf_and_verify( drivep );
+	if (! IS_BOT(mtstat) && ! IS_FMK(mtstat)) {
+		mtstat = fsf_and_verify(drivep);
 	}
 
 	/* if we hit EOM or early warning, just return
 	 */
-	if ( IS_EOT( mtstat ) || IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "begin read hit EOM/EW\n" );
+	if (IS_EOT(mtstat) || IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "begin read hit EOM/EW\n");
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* if we hit EOD, a file mark is missing
 	 */
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-		      _("file mark missing from tape (hit EOD)\n") );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		      _("file mark missing from tape (hit EOD)\n"));
 #ifdef DUMP
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-		      _("writing file mark at EOD\n") );
-		rval = mt_op( contextp->dc_fd, MTWEOF, 1 );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING,
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		      _("writing file mark at EOD\n"));
+		rval = mt_op(contextp->dc_fd, MTWEOF, 1);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING,
 			      _("unable to write file mark at eod: %s (%d)\n"),
-			      strerror( errno ),
-			      errno );
+			      strerror(errno),
+			      errno);
 			return DRIVE_ERROR_MEDIA;
 		}
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 #endif /* DUMP */
@@ -2890,9 +2890,9 @@ read_label( drive_t *drivep )
 
 	/* verify we are either at BOT or a file mark
 	 */
-	if ( ! IS_BOT( mtstat ) && ! IS_FMK( mtstat )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
-		      _("file mark missing from tape\n") );
+	if (! IS_BOT(mtstat) && ! IS_FMK(mtstat)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+		      _("file mark missing from tape\n"));
 #ifdef DUMP
 		return DRIVE_ERROR_MEDIA;
 #endif
@@ -2901,7 +2901,7 @@ read_label( drive_t *drivep )
 	/* remember if we were at BOT, so we know how to reposition if EOD
 	 * encountered
 	 */
-	if ( IS_BOT( mtstat )) {
+	if (IS_BOT(mtstat)) {
 		wasatbotpr = BOOL_TRUE;
 	} else {
 		wasatbotpr = BOOL_FALSE;
@@ -2909,18 +2909,18 @@ read_label( drive_t *drivep )
 
 	/* read the first record of the media file directly
 	 */
-	nread = Read( drivep,
+	nread = Read(drivep,
 		      contextp->dc_recp,
 		      tape_recsz,
-		      &saved_errno );
+		      &saved_errno);
 
 	/* if a read error, get status
 	 */
-	if ( nread != ( int )tape_recsz ) {
-		assert( nread < ( int )tape_recsz );
-		ok = mt_get_status( drivep, &mtstat );
-		if ( ! ok ) {
-			status_failed_message( drivep );
+	if (nread != (int)tape_recsz) {
+		assert(nread < (int)tape_recsz);
+		ok = mt_get_status(drivep, &mtstat);
+		if (! ok) {
+			status_failed_message(drivep);
 			return DRIVE_ERROR_DEVICE;
 		}
 	} else {
@@ -2929,29 +2929,29 @@ read_label( drive_t *drivep )
 
 	/* check for an unexpected errno
 	 */
-	if ( nread < 0 && saved_errno != ENOSPC ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (nread < 0 && saved_errno != ENOSPC) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not read from drive: %s (%d)\n"),
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* check for a blank tape. NOTE: shouldn't get here!
 	 */
-	if ( nread == 0 && wasatbotpr ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (nread == 0 && wasatbotpr) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("unexpectedly encountered EOD at BOT: "
-		      "assuming corrupted media\n") );
-		( void )rewind_and_verify( drivep );
+		      "assuming corrupted media\n"));
+		(void)rewind_and_verify(drivep);
 		return DRIVE_ERROR_MEDIA;
 	}
 
 	/* if we hit end of tape or early warning, indicate EOM
 	 */
-	if ( IS_EOT( mtstat ) || IS_EW( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOM\n" );
+	if (IS_EOT(mtstat) || IS_EW(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOM\n");
 		return DRIVE_ERROR_EOM;
 	}
 
@@ -2959,29 +2959,29 @@ read_label( drive_t *drivep )
 #ifdef DUMP
 	/* if we hit EOD, re-position in anticipation of appending.
 	 */
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOD: repositioning for append\n" );
-		if ( drivep->d_capabilities & DRIVE_CAP_BSF ) {
-			( void )bsf_and_verify( drivep );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOD: repositioning for append\n");
+		if (drivep->d_capabilities & DRIVE_CAP_BSF) {
+			(void)bsf_and_verify(drivep);
 		}
-		( void )fsf_and_verify( drivep );
+		(void)fsf_and_verify(drivep);
 		return DRIVE_ERROR_EOD;
 	}
 #endif /* DUMP */
 #ifdef RESTORE
 
         /* Linux case */
-	if ( IS_EOD( mtstat ) && IS_FMK( mtstat ) ) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOM\n" );
+	if (IS_EOD(mtstat) && IS_FMK(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOM\n");
 		return DRIVE_ERROR_EOM;
 	}
 
 
-	if ( IS_EOD( mtstat )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
-		      "hit EOD\n" );
+	if (IS_EOD(mtstat)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
+		      "hit EOD\n");
 		return DRIVE_ERROR_EOD;
 	}
 #endif /* RESTORE */
@@ -2989,11 +2989,11 @@ read_label( drive_t *drivep )
 	/* if we hit a file mark, this is very bad.
 	 * indicates the media has been corrupted
 	 */
-	if ( IS_FMK( mtstat )) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (IS_FMK(mtstat)) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("unexpectedly encountered a file mark: "
-		      "assuming corrupted media\n") );
-		( void )rewind_and_verify( drivep );
+		      "assuming corrupted media\n"));
+		(void)rewind_and_verify(drivep);
 		return DRIVE_ERROR_MEDIA;
 	}
 
@@ -3001,13 +3001,13 @@ read_label( drive_t *drivep )
 	 */
 	contextp->dc_iocnt = 1;
 
-	rval = validate_media_file_hdr( drivep );
+	rval = validate_media_file_hdr(drivep);
 
 	return rval;
 }
 
 static int
-validate_media_file_hdr( drive_t *drivep )
+validate_media_file_hdr(drive_t *drivep)
 {
 	global_hdr_t		*grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t		*drhdrp = drivep->d_readhdrp;
@@ -3024,10 +3024,10 @@ validate_media_file_hdr( drive_t *drivep )
 	content_hdr_t		*tmpch = (content_hdr_t *)tmpmh->mh_upper;
 	content_inode_hdr_t	*tmpcih = (content_inode_hdr_t *)tmpch->ch_specific;
 
-	mlog( MLOG_DEBUG | MLOG_DRIVE,
-	      "validating media file header\n" );
+	mlog(MLOG_DEBUG | MLOG_DRIVE,
+	      "validating media file header\n");
 
-	memcpy( tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ );
+	memcpy(tmpbuf, contextp->dc_recp, GLOBAL_HDR_SZ);
 
 	mlog(MLOG_NITTY, "validate_media_file_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -3047,14 +3047,14 @@ validate_media_file_hdr( drive_t *drivep )
 
 	/* check the checksum
 	 */
-	if ( ! global_hdr_checksum_check( tmpgh )) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! global_hdr_checksum_check(tmpgh)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "bad media file header checksum\n");
 	        return DRIVE_ERROR_CORRUPTION;
 	}
 
-	if ( ! tape_rec_checksum_check( contextp, contextp->dc_recp )) {
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (! tape_rec_checksum_check(contextp, contextp->dc_recp)) {
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "tape record checksum error\n");
 		return DRIVE_ERROR_CORRUPTION;
 
@@ -3067,54 +3067,54 @@ validate_media_file_hdr( drive_t *drivep )
 	xlate_content_inode_hdr(tmpcih, cih, 1);
 	xlate_rec_hdr(tmprh, tprhdrp, 1);
 
-	memcpy( contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ );
+	memcpy(contextp->dc_recp, grhdrp, GLOBAL_HDR_SZ);
 
 	/* check the magic number
 	 */
-	if ( strncmp( grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC,GLOBAL_HDR_MAGIC_SZ)) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "missing magic number in tape label\n");
 	        return DRIVE_ERROR_FORMAT;
 	}
 
 	/* check the version
 	 */
-	if ( global_version_check( grhdrp->gh_version ) != BOOL_TRUE ) {
-	        mlog( MLOG_DEBUG | MLOG_DRIVE,
+	if (global_version_check(grhdrp->gh_version) != BOOL_TRUE) {
+	        mlog(MLOG_DEBUG | MLOG_DRIVE,
 	              "invalid version number (%d) in tape label\n",
-		      grhdrp->gh_version );
+		      grhdrp->gh_version);
 	        return DRIVE_ERROR_VERSION;
 	}
 
 	/* check the strategy id
 	 */
-	if ( drhdrp->dh_strategyid != drivep->d_strategyp->ds_id ) {
[… more lines in the raw message]

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

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

Signature · 1 line
2.19.1

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

author
#4 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 common/drive_simple.c  |  732 +++++++++----------
 common/exit.h          |    4 +-
 common/fs.c            |  188 ++---
 common/fs.h            |   12 +-
 common/global.c        |  206 +++---
 common/global.h        |   28 +-
 common/hsmapi.c        |   22 +-
 common/inventory.c     |  302 ++++----
 common/inventory.h     |   36 +-
 common/lock.c          |   14 +-
 common/lock.h          |    6 +-
 common/main.c          | 1578 ++++++++++++++++++++--------------------
 common/media.c         |  126 ++--
 common/media.h         |   20 +-
 common/media_rmvtape.h |    6 +-
 15 files changed, 1640 insertions(+), 1640 deletions(-)
common/drive_simple.c +366 -366
index 54a3058..2d802d3 100644
@@ -55,12 +55,12 @@
 #define read    rmtread
 #define write   rmtwrite
 
-extern int rmtclose( int );
+extern int rmtclose(int);
 extern int rmtcreat (char *path, int mode);
-extern int rmtioctl( int, int, ... );
-extern int rmtopen( char *, int, ... );
-extern int rmtread( int, void*, uint);
-extern int rmtwrite( int, const void *, uint);
+extern int rmtioctl(int, int, ...);
+extern int rmtopen(char *, int, ...);
+extern int rmtread(int, void*, uint);
+extern int rmtwrite(int, const void *, uint);
 
 
 /* drive_simple.c - drive strategy for standard in or a file
@@ -73,14 +73,14 @@ extern int rmtwrite( int, const void *, uint);
  * buf must be page-aligned and at least 1 page in size
  */
 #define PGPERBUF	64	/* private read buffer */
-#define BUFSZ		( PGPERBUF * PGSZ )
+#define BUFSZ		(PGPERBUF * PGSZ)
 
 /* operational mode
  */
 typedef enum { OM_NONE, OM_READ, OM_WRITE } om_t;
 
 struct drive_context {
-	char dc_buf[ BUFSZ ];	/* input/output buffer */
+	char dc_buf[BUFSZ];	/* input/output buffer */
 	om_t dc_mode;		/* current mode of operation */
 	ix_t dc_fmarkcnt;	/* how many file marks to the left */
 	char *dc_ownedp;	/* first byte owned by caller */
@@ -108,31 +108,31 @@ extern size_t pgsz;
 
 /* strategy functions
  */
-static int ds_match( int, char *[], drive_t * );
-static int ds_instantiate( int, char *[], drive_t * );
+static int ds_match(int, char *[], drive_t *);
+static int ds_instantiate(int, char *[], drive_t *);
 
 /* declare manager operators
  */
-static bool_t do_init( drive_t * );
-static bool_t do_sync( drive_t * );
-static int do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, int * );
-static void do_return_read_buf( drive_t *, char *, size_t );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static int do_seek_mark( drive_t *, drive_mark_t * );
-static int do_next_mark( drive_t * );
-static void do_get_mark( drive_t *, drive_mark_t * );
-static void do_end_read( drive_t * );
-static int do_begin_write( drive_t * );
-static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
-static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static int do_write( drive_t *, char *, size_t );
-static size_t do_get_align_cnt( drive_t * );
-static int do_end_write( drive_t *, off64_t * );
-static int do_rewind( drive_t * );
-static int do_erase( drive_t * );
-static int do_get_device_class( drive_t * );
-static void do_quit( drive_t * );
+static bool_t do_init(drive_t *);
+static bool_t do_sync(drive_t *);
+static int do_begin_read(drive_t *);
+static char *do_read(drive_t *, size_t , size_t *, int *);
+static void do_return_read_buf(drive_t *, char *, size_t);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static int do_seek_mark(drive_t *, drive_mark_t *);
+static int do_next_mark(drive_t *);
+static void do_get_mark(drive_t *, drive_mark_t *);
+static void do_end_read(drive_t *);
+static int do_begin_write(drive_t *);
+static void do_set_mark(drive_t *, drive_mcbfp_t, void *, drive_markrec_t *);
+static char * do_get_write_buf(drive_t *, size_t , size_t *);
+static int do_write(drive_t *, char *, size_t);
+static size_t do_get_align_cnt(drive_t *);
+static int do_end_write(drive_t *, off64_t *);
+static int do_rewind(drive_t *);
+static int do_erase(drive_t *);
+static int do_get_device_class(drive_t *);
+static void do_quit(drive_t *);
 
 
 /* definition of locally defined global variables ****************************/
@@ -188,39 +188,39 @@ static drive_ops_t drive_ops = {
  */
 /* ARGSUSED */
 static int
-ds_match( int argc, char *argv[], drive_t *drivep )
+ds_match(int argc, char *argv[], drive_t *drivep)
 {
 	bool_t isrmtpr;
 	struct stat64 statbuf;
 
 	/* sanity checks
 	 */
-	assert( ! ( sizeofmember( drive_context_t, dc_buf ) % PGSZ ));
+	assert(! (sizeofmember(drive_context_t, dc_buf) % PGSZ));
 
 	/* determine if this is an rmt file. if so, give a weak match:
 	 * might be an ordinary file accessed via the rmt protocol.
 	 */
-	if ( strchr( drivep->d_pathname, ':') ) {
+	if (strchr(drivep->d_pathname, ':')) {
 		isrmtpr = BOOL_TRUE;
 	} else {
 		isrmtpr = BOOL_FALSE;
 	}
-	if ( isrmtpr ) {
+	if (isrmtpr) {
 		return 1;
 	}
 
 	/* willing to pick up anything not picked up by other strategies,
 	 * as long as it exists and is not a directory
 	 */
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 		return 1;
 	}
 
-	if ( stat64( drivep->d_pathname, &statbuf )) {
+	if (stat64(drivep->d_pathname, &statbuf)) {
 		return -1;
 	}
 
-	if ( S_ISDIR( statbuf.st_mode )) {
+	if (S_ISDIR(statbuf.st_mode)) {
 		return -1;
 	}
 
@@ -231,7 +231,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
  */
 /*ARGSUSED*/
 static bool_t
-ds_instantiate( int argc, char *argv[], drive_t *drivep )
+ds_instantiate(int argc, char *argv[], drive_t *drivep)
 {
 	drive_context_t *contextp;
 
@@ -242,15 +242,15 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	/* initialize the drive context - allocate a page-aligned
 	 * structure, so the buffer is page-aligned.
 	 */
-	contextp = ( drive_context_t * )memalign( PGSZ,
-						  sizeof( drive_context_t ));
-	assert( contextp );
-	assert( ( void * )contextp->dc_buf == ( void * )contextp );
-	memset( ( void * )contextp, 0, sizeof( *contextp ));
+	contextp = (drive_context_t *)memalign(PGSZ,
+						  sizeof(drive_context_t));
+	assert(contextp);
+	assert((void *)contextp->dc_buf == (void *)contextp);
+	memset((void *)contextp, 0, sizeof(*contextp));
 
 	/* scan drive device pathname to see if remote tape
 	 */
-	if ( strchr( drivep->d_pathname, ':') ) {
+	if (strchr(drivep->d_pathname, ':')) {
 		contextp->dc_isrmtpr = BOOL_TRUE;
 	} else {
 		contextp->dc_isrmtpr = BOOL_FALSE;
@@ -260,7 +260,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	 */
 	drivep->d_capabilities = 0;
 	drivep->d_capabilities |= DRIVE_CAP_AUTOREWIND;
-	if ( ! strcmp( drivep->d_pathname, "stdio" )) {
+	if (! strcmp(drivep->d_pathname, "stdio")) {
 #ifdef DUMP
 		contextp->dc_fd = 1;
 #endif /* DUMP */
@@ -268,7 +268,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 		drivep->d_capabilities |= DRIVE_CAP_READ;
 		contextp->dc_fd = 0;
 #endif /* RESTORE */
-	} else if ( contextp->dc_isrmtpr ) {
+	} else if (contextp->dc_isrmtpr) {
 		int oflags;
 #ifdef DUMP
 		oflags = O_WRONLY | O_CREAT | O_TRUNC;
@@ -278,28 +278,28 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 		drivep->d_capabilities |= DRIVE_CAP_READ;
 #endif /* RESTORE */
 		contextp->dc_rampr = BOOL_FALSE;
-		contextp->dc_fd = open( drivep->d_pathname,
+		contextp->dc_fd = open(drivep->d_pathname,
 					oflags,
-				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
-		if ( contextp->dc_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		if (contextp->dc_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("unable to open %s: %s\n"),
 			      drivep->d_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 	} else {
 		int oflags = 0;
 		struct stat statbuf;
 		int rval;
-		rval = stat( drivep->d_pathname, &statbuf );
+		rval = stat(drivep->d_pathname, &statbuf);
 #ifdef DUMP
-		if ( rval ) {
-			if ( errno != ENOENT ) {
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		if (rval) {
+			if (errno != ENOENT) {
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("stat of %s failed: %s\n"),
 				      drivep->d_pathname,
-				      strerror( errno ));
+				      strerror(errno));
 				return BOOL_FALSE;
 			}
 			drivep->d_capabilities |= DRIVE_CAP_REWIND;
@@ -309,7 +309,7 @@ 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;
@@ -326,26 +326,26 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 				oflags = O_WRONLY;
 				break;
 			default:
-				mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 				      _("cannot dump to %s "
 				      "file type %x\n"),
 				      drivep->d_pathname,
-				      statbuf.st_mode & S_IFMT );
+				      statbuf.st_mode & S_IFMT);
 				return BOOL_FALSE;
 			}
 		}
 #endif /* DUMP */
 #ifdef RESTORE
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("stat of %s failed: %s\n"),
 			      drivep->d_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 
 		}
 		oflags = O_RDONLY;
-		switch( statbuf.st_mode & S_IFMT ) {
+		switch(statbuf.st_mode & S_IFMT) {
 		case S_IFREG:
 		case S_IFCHR:
 		case S_IFBLK:
@@ -356,21 +356,21 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 			drivep->d_capabilities |= DRIVE_CAP_READ;
 			break;
 		default:
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("cannot restore from %s file type %x\n"),
 			      drivep->d_pathname,
-			      statbuf.st_mode & S_IFMT );
+			      statbuf.st_mode & S_IFMT);
 			return BOOL_FALSE;
 		}
 #endif /* RESTORE */
-		contextp->dc_fd = open( drivep->d_pathname,
+		contextp->dc_fd = open(drivep->d_pathname,
 					oflags,
-				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
-		if ( contextp->dc_fd < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+				        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		if (contextp->dc_fd < 0) {
+			mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 			      _("unable to open %s: %s\n"),
 			      drivep->d_pathname,
-			      strerror( errno ));
+			      strerror(errno));
 			return BOOL_FALSE;
 		}
 	}
@@ -381,7 +381,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	contextp->dc_mode = OM_NONE;
 	contextp->dc_fmarkcnt = 0;
 
-	drivep->d_contextp = ( void * )contextp;
+	drivep->d_contextp = (void *)contextp;
 
 	drivep->d_cap_est = -1;
 	drivep->d_rate_est = -1;
@@ -394,11 +394,11 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
  */
 /* ARGSUSED */
 static bool_t
-do_init( drive_t *drivep )
+do_init(drive_t *drivep)
 {
 #ifdef DUMP
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
+	media_hdr_t *mwhdrp = (media_hdr_t *)dwhdrp->dh_upper;
 #endif /* DUMP */
 
 #ifdef DUMP
@@ -415,7 +415,7 @@ do_init( drive_t *drivep )
  */
 /* ARGSUSED */
 static bool_t
-do_sync( drive_t *drivep )
+do_sync(drive_t *drivep)
 {
 	return BOOL_TRUE;
 }
@@ -424,14 +424,14 @@ do_sync( drive_t *drivep )
  * read the media hdr
  */
 static int
-do_begin_read( drive_t *drivep )
+do_begin_read(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t *drhdrp = drivep->d_readhdrp;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int nread;
 	int rval;
 	global_hdr_t		*tmphdr = (global_hdr_t	*)malloc(GLOBAL_HDR_SZ);
@@ -444,25 +444,25 @@ do_begin_read( drive_t *drivep )
 	content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 	content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple begin_read( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple begin_read( )\n");
 
 	/* verify protocol being followed
 	 */
-	assert( dcaps & DRIVE_CAP_READ );
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(dcaps & DRIVE_CAP_READ);
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* can only read one media file
 	 */
-	if ( contextp->dc_fmarkcnt > 0 ) {
+	if (contextp->dc_fmarkcnt > 0) {
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* prepare the drive context
 	 */
 	contextp->dc_ownedp = 0;
-	contextp->dc_emptyp = &contextp->dc_buf[ 0 ];
+	contextp->dc_emptyp = &contextp->dc_buf[0];
 	contextp->dc_nextp = contextp->dc_emptyp;
 	contextp->dc_bufstroff = 0;
 
@@ -471,18 +471,18 @@ do_begin_read( drive_t *drivep )
 	 */
 	contextp->dc_mode = OM_READ;
 
-	nread = read_buf( ( char * )tmphdr,
+	nread = read_buf((char *)tmphdr,
 			  GLOBAL_HDR_SZ,
-			  ( void * )drivep,
-			  ( rfp_t )drivep->d_opsp->do_read,
-			  ( rrbfp_t )drivep->d_opsp->do_return_read_buf,
-			  &rval );
+			  (void *)drivep,
+			  (rfp_t)drivep->d_opsp->do_read,
+			  (rrbfp_t)drivep->d_opsp->do_return_read_buf,
+			  &rval);
 	contextp->dc_mode = OM_NONE;
 
 	/* if EOD and nread is zero, there is no data after the file mark
 	 */
-	if ( rval == DRIVE_ERROR_EOD ) {
-		if ( nread == 0 ) {
+	if (rval == DRIVE_ERROR_EOD) {
+		if (nread == 0) {
 			free(tmphdr);
 			return DRIVE_ERROR_BLANK;
 		} else {
@@ -490,11 +490,11 @@ do_begin_read( drive_t *drivep )
 			return DRIVE_ERROR_FORMAT;
 		}
 	}
-	if  ( rval ) {
+	if  (rval) {
 		free(tmphdr);
 		return rval;
 	}
-	assert( ( size_t )nread == GLOBAL_HDR_SZ );
+	assert((size_t)nread == GLOBAL_HDR_SZ);
 
 	mlog(MLOG_NITTY, "do_begin_read: global_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -514,17 +514,17 @@ do_begin_read( drive_t *drivep )
 
 	/* check the checksum
 	 */
-	if ( ! global_hdr_checksum_check( tmphdr )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
-		      _("media file header checksum error\n") );
+	if (! global_hdr_checksum_check(tmphdr)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		      _("media file header checksum error\n"));
 		free(tmphdr);
 		return DRIVE_ERROR_CORRUPTION;
 	}
 
 	xlate_global_hdr(tmphdr, grhdrp, 1);
 	xlate_drive_hdr(tmpdh, dh, 1);
-	*(( drive_mark_t * )dh->dh_specific) =
-		INT_GET(*(( drive_mark_t * )tmpdh->dh_specific), ARCH_CONVERT);
+	*((drive_mark_t *)dh->dh_specific) =
+		INT_GET(*((drive_mark_t *)tmpdh->dh_specific), ARCH_CONVERT);
 	xlate_media_hdr(tmpmh, mh, 1);
 	xlate_content_hdr(tmpch, ch, 1);
 	xlate_content_inode_hdr(tmpcih, cih, 1);
@@ -532,8 +532,8 @@ do_begin_read( drive_t *drivep )
 
 	/* check the magic number
 	 */
-	if ( strncmp( grhdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ)) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	if (strncmp(grhdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		      _("media file header magic number mismatch: %s, %s\n"),
 		      grhdrp->gh_magic,
 		      GLOBAL_HDR_MAGIC);
@@ -542,32 +542,32 @@ do_begin_read( drive_t *drivep )
 
 	/* check the version
 	 */
-	if ( global_version_check( grhdrp->gh_version ) != BOOL_TRUE ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	if (global_version_check(grhdrp->gh_version) != BOOL_TRUE) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		      _("unrecognized media file header version (%d)\n"),
-		      grhdrp->gh_version );
+		      grhdrp->gh_version);
 		return DRIVE_ERROR_VERSION;
 	}
 
 	/* check the strategy id
 	 */
-	if ( drhdrp->dh_strategyid != drive_strategy_simple.ds_id ) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+	if (drhdrp->dh_strategyid != drive_strategy_simple.ds_id) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
 		      _("unrecognized drive strategy ID "
 		      "(media says %d, expected %d)\n"),
-		      drhdrp->dh_strategyid, drive_strategy_simple.ds_id );
+		      drhdrp->dh_strategyid, drive_strategy_simple.ds_id);
 		return DRIVE_ERROR_FORMAT;
 	}
 
 	/* record the offset of the first mark
 	 */
-	contextp->dc_firstmark = *( drive_mark_t * )drhdrp->dh_specific;
+	contextp->dc_firstmark = *(drive_mark_t *)drhdrp->dh_specific;
 
 	/* adjust the drive capabilities based on presence of first mark.
 	 * this is a hack workaround for a bug in xfsdump which causes the
 	 * first mark offset to not always be placed in the hdr.
 	 */
-	if ( contextp->dc_firstmark ) {
+	if (contextp->dc_firstmark) {
 		drivep->d_capabilities |= DRIVE_CAP_NEXTMARK;
 	}
 
@@ -580,24 +580,24 @@ do_begin_read( drive_t *drivep )
 /* read - supply the caller with some filled buffer
  */
 static char *
-do_read( drive_t *drivep,
+do_read(drive_t *drivep,
          size_t wantedcnt,
          size_t *actualcntp,
-         int *rvalp )
+         int *rvalp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	size_t remainingcnt;
 	size_t actualcnt;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple read( want %u )\n",
-	      wantedcnt );
+	      wantedcnt);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
-	assert( wantedcnt > 0 );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
+	assert(wantedcnt > 0);
 
 	/* pre-initialize reference return
 	 */
@@ -605,12 +605,12 @@ do_read( drive_t *drivep,
 
 	/* count number of unread bytes in buffer
 	 */
-	assert( contextp->dc_emptyp >= contextp->dc_nextp );
-	remainingcnt = ( size_t )( contextp->dc_emptyp - contextp->dc_nextp );
+	assert(contextp->dc_emptyp >= contextp->dc_nextp);
+	remainingcnt = (size_t)(contextp->dc_emptyp - contextp->dc_nextp);
 
 	/* if no unread bytes in buffer, refill
 	 */
-	if ( remainingcnt == 0 ) {
+	if (remainingcnt == 0) {
 		size_t bufhowfullcnt;
 		int nread;
 
@@ -619,13 +619,13 @@ do_read( drive_t *drivep,
 		 * beginning of the media file) of the top of the buffer
 		 * after we refill the buffer.
 		 */
-		bufhowfullcnt = ( size_t )
-				( contextp->dc_emptyp - contextp->dc_buf );
+		bufhowfullcnt = (size_t)
+				(contextp->dc_emptyp - contextp->dc_buf);
 
 		/* attempt to fill the buffer. nread may be less if at EOF
 		 */
-		nread = read( contextp->dc_fd, contextp->dc_buf, BUFSZ );
-		if ( nread < 0 ) {
+		nread = read(contextp->dc_fd, contextp->dc_buf, BUFSZ);
+		if (nread < 0) {
 			*rvalp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
@@ -633,31 +633,31 @@ do_read( drive_t *drivep,
 		/* adjust the recorded offset of the top of the buffer
 		 * relative to the beginning of the media file
 		 */
-		contextp->dc_bufstroff += ( off64_t )bufhowfullcnt;
+		contextp->dc_bufstroff += (off64_t)bufhowfullcnt;
 
 		/* record the ptrs to the first empty byte and the next
 		 * byte to be read
 		 */
-		assert( nread <= BUFSZ );
+		assert(nread <= BUFSZ);
 		contextp->dc_emptyp = contextp->dc_buf + nread;
 		contextp->dc_nextp = contextp->dc_buf;
 
 		/* if no bytes were read, the caller has seen all bytes.
 		 */
-		if ( nread == 0 ) {
+		if (nread == 0) {
 			*rvalp = DRIVE_ERROR_EOD;
 			return 0;
 		}
 
 		/* adjust the remaining count
 		 */
-		remainingcnt = ( size_t )nread;
+		remainingcnt = (size_t)nread;
 	}
 
 	/* the caller specified at most how many bytes he wants. if less
 	 * than that remain unread in buffer, just return that many.
 	 */
-	actualcnt = min( wantedcnt, remainingcnt );
+	actualcnt = min(wantedcnt, remainingcnt);
 
 	/* set the owned ptr to the first byte to be supplied
 	 */
@@ -666,7 +666,7 @@ do_read( drive_t *drivep,
 	/* advance the next ptr to the next byte to be supplied
 	 */
 	contextp->dc_nextp += actualcnt;
-	assert( contextp->dc_nextp <= contextp->dc_emptyp );
+	assert(contextp->dc_nextp <= contextp->dc_emptyp);
 
 	/* return the actual number of bytes supplied, and a ptr to the first
 	 */
@@ -679,29 +679,29 @@ do_read( drive_t *drivep,
  */
 /* ARGSUSED */
 static void
-do_return_read_buf( drive_t *drivep, char *retp, size_t retcnt )
+do_return_read_buf(drive_t *drivep, char *retp, size_t retcnt)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	/* REFERENCED */
 	size_t ownedcnt;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple return_read_buf( returning %u )\n",
-	      retcnt );
+	      retcnt);
 
 	/* verify protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(contextp->dc_ownedp);
 
 	/* verify returning right buffer
 	 */
-	assert( retp == contextp->dc_ownedp );
+	assert(retp == contextp->dc_ownedp);
 
 	/* verify all of buffer provided is being returned
 	 */
-	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	assert( retcnt == ownedcnt );
+	ownedcnt = (size_t)(contextp->dc_nextp - contextp->dc_ownedp);
+	assert(retcnt == ownedcnt);
 
 	/* indicate nothing now owned by caller
 	 */
@@ -712,37 +712,37 @@ do_return_read_buf( drive_t *drivep, char *retp, size_t retcnt )
  * next byte to be read
  */
 static void
-do_get_mark( drive_t *drivep, drive_mark_t *markp )
+do_get_mark(drive_t *drivep, drive_mark_t *markp)
 {
-        drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+        drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t nextoff;
 	off64_t strmoff;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple get_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple get_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
 	/* calculate the offset of the next byte to be supplied relative to
 	 * the beginning of the buffer and relative to the beginning of
 	 * ther media file.
 	 */
-	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
+	nextoff = (off64_t)(contextp->dc_nextp - contextp->dc_buf);
 	strmoff = contextp->dc_bufstroff + nextoff;
-	*markp = ( drive_mark_t )strmoff;
+	*markp = (drive_mark_t)strmoff;
 }
 
 /* seek forward to the specified mark. the caller must not have already read
  * past that point.
  */
 static int
-do_seek_mark( drive_t *drivep, drive_mark_t *markp )
+do_seek_mark(drive_t *drivep, drive_mark_t *markp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	off64_t mark = *( off64_t * )markp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
+	off64_t mark = *(off64_t *)markp;
 	off64_t nextoff;
 	off64_t strmoff;
 	/* REFERENCED */
@@ -751,40 +751,40 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	int nreadneeded;
 	int rval;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple seek_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple seek_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
 	/* calculate the current offset within the media file
 	 * of the next byte to be read
 	 */
-	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
+	nextoff = (off64_t)(contextp->dc_nextp - contextp->dc_buf);
 	strmoff = contextp->dc_bufstroff + nextoff;
 
 	/* if the caller attempts to seek past the current offset,
 	 * this is really bad
 	 */
-	if ( strmoff > mark ) {
+	if (strmoff > mark) {
 		return DRIVE_ERROR_CORE;
 	}
 
 	/* use read_buf util func to eat up difference
 	 */
 	nreadneeded64 = mark - strmoff;
-	while ( nreadneeded64 > 0 ) {
-		if ( nreadneeded64 > INTGENMAX )
+	while (nreadneeded64 > 0) {
+		if (nreadneeded64 > INTGENMAX)
 			nreadneeded = INTGENMAX;
 		else
-			nreadneeded = ( int )nreadneeded64;
-		nread = read_buf( 0, nreadneeded, drivep,
-				  ( rfp_t )drivep->d_opsp->do_read,
-				( rrbfp_t )drivep->d_opsp->do_return_read_buf,
-				  &rval );
-		if  ( rval ) {
+			nreadneeded = (int)nreadneeded64;
+		nread = read_buf(0, nreadneeded, drivep,
+				  (rfp_t)drivep->d_opsp->do_read,
+				(rrbfp_t)drivep->d_opsp->do_return_read_buf,
+				  &rval);
+		if  (rval) {
 			return rval;
 		}
 		nreadneeded64 -= nread;
@@ -792,9 +792,9 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* verify we are on the mark
 	 */
-	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
+	nextoff = (off64_t)(contextp->dc_nextp - contextp->dc_buf);
 	strmoff = contextp->dc_bufstroff + nextoff;
-	assert( strmoff == mark );
+	assert(strmoff == mark);
 
 	return 0;
 }
@@ -804,30 +804,30 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
  * has already read past that mark, blow up.
  */
 static int
-do_next_mark( drive_t *drivep )
+do_next_mark(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	drive_mark_t mark = contextp->dc_firstmark;
 	int rval;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple next_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple next_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( dcaps & DRIVE_CAP_NEXTMARK );
-	assert( contextp->dc_mode == OM_READ );
-	assert( ! contextp->dc_ownedp );
+	assert(dcaps & DRIVE_CAP_NEXTMARK);
+	assert(contextp->dc_mode == OM_READ);
+	assert(! contextp->dc_ownedp);
 
-	if ( ! mark ) {
+	if (! mark) {
 		return DRIVE_ERROR_EOF;
 	}
 
-	rval = do_seek_mark( drivep, ( drive_mark_t * )&mark );
-	if ( rval ) {
+	rval = do_seek_mark(drivep, (drive_mark_t *)&mark);
+	if (rval) {
 		return rval;
 	}
 
@@ -838,33 +838,33 @@ do_next_mark( drive_t *drivep )
  * just discards any buffered data
  */
 void
-do_end_read( drive_t *drivep )
+do_end_read(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple end_read( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple end_read( )\n");
 
 	/* be sure we are following protocol
 	 */
-	assert( contextp->dc_mode == OM_READ );
+	assert(contextp->dc_mode == OM_READ);
 	contextp->dc_mode = OM_NONE;
 
 	/* bump the file mark cnt
 	 */
 	contextp->dc_fmarkcnt++;
-	assert( contextp->dc_fmarkcnt == 1 );
+	assert(contextp->dc_fmarkcnt == 1);
 }
 
 /* begin_write - prepare file for writing
  */
 static int
-do_begin_write( drive_t *drivep )
+do_begin_write(drive_t *drivep)
 {
 	int dcaps = drivep->d_capabilities;
 	global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	int rval;
 	global_hdr_t		*tmphdr;
 	drive_hdr_t		*tmpdh;
@@ -876,27 +876,27 @@ do_begin_write( drive_t *drivep )
 	content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 	content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple begin_write( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple begin_write( )\n");
 
 	/* sanity checks
 	 */
-	assert( dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE );
+	assert(dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_fd >= 0 );
-	assert( contextp->dc_mode == OM_NONE );
+	assert(contextp->dc_fd >= 0);
+	assert(contextp->dc_mode == OM_NONE);
 
 	/* only one media file may be written
 	 */
-	if ( contextp->dc_fmarkcnt > 0 ) {
+	if (contextp->dc_fmarkcnt > 0) {
 		return DRIVE_ERROR_EOM;
 	}
 
 	/* indicate in the header that there is no recorded mark.
 	 */
-	*( ( off64_t * )dwhdrp->dh_specific ) = 0;
+	*((off64_t *)dwhdrp->dh_specific) = 0;
 
 	/* prepare the drive context. initially the caller does not own
 	 * any of the write buffer, so the next portion of the buffer to
@@ -906,20 +906,20 @@ do_begin_write( drive_t *drivep )
 	 */
 	contextp->dc_ownedp = 0;
 	contextp->dc_nextp = contextp->dc_buf;
-	contextp->dc_emptyp = contextp->dc_buf + sizeof( contextp->dc_buf );
+	contextp->dc_emptyp = contextp->dc_buf + sizeof(contextp->dc_buf);
 	contextp->dc_bufstroff = 0;
 	contextp->dc_markcnt = 0;
 
 	/* truncate the destination if it supports read.
 	 */
-	if ( dcaps & DRIVE_CAP_READ ) {
-		rval = ftruncate( contextp->dc_fd, 0 );
-		if ( rval ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	if (dcaps & DRIVE_CAP_READ) {
+		rval = ftruncate(contextp->dc_fd, 0);
+		if (rval) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("attempt to truncate %s failed: %d (%s)\n"),
 			      drivep->d_pathname,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 		}
 	}
 
@@ -937,16 +937,16 @@ do_begin_write( drive_t *drivep )
 
 	xlate_global_hdr(gwhdrp, tmphdr, 1);
 	xlate_drive_hdr(dh, tmpdh, 1);
-	INT_SET(*(( drive_mark_t * )tmpdh->dh_specific),
+	INT_SET(*((drive_mark_t *)tmpdh->dh_specific),
 		ARCH_CONVERT,
-		*(( drive_mark_t * )dh->dh_specific));
+		*((drive_mark_t *)dh->dh_specific));
 	xlate_media_hdr(mh, tmpmh, 1);
 	xlate_content_hdr(ch, tmpch, 1);
 	xlate_content_inode_hdr(cih, tmpcih, 1);
 
 	/* checksum the header
 	 */
-	global_hdr_checksum_set( tmphdr );
+	global_hdr_checksum_set(tmphdr);
 
 	mlog(MLOG_NITTY, "do_begin_write: global_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -964,28 +964,28 @@ do_begin_write( drive_t *drivep )
 	     tmphdr->gh_hostname,
 	     tmphdr->gh_dumplabel);
 
-	if ( ! global_hdr_checksum_check( tmphdr )) {
-		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
-		      _("media file header checksum error\n") );
+	if (! global_hdr_checksum_check(tmphdr)) {
+		mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE,
+		      _("media file header checksum error\n"));
 	}
 	else {
-		mlog( MLOG_NITTY, "media file header checksum OK!\n" );
+		mlog(MLOG_NITTY, "media file header checksum OK!\n");
 	}
 
 	/* write the header using the write_buf() utility function and
 	 * my own get_write_buf and write operators.
 	 */
-	rval = write_buf( ( char * )tmphdr,
+	rval = write_buf((char *)tmphdr,
 			  GLOBAL_HDR_SZ,
-			  ( void * )drivep,
-			  ( gwbfp_t )drivep->d_opsp->do_get_write_buf,
-			  ( wfp_t )drivep->d_opsp->do_write );
+			  (void *)drivep,
+			  (gwbfp_t)drivep->d_opsp->do_get_write_buf,
+			  (wfp_t)drivep->d_opsp->do_write);
 
 	free(tmphdr);
 
 	/* if error while writing hdr, undo mode
 	 */
-	if ( rval ) {
+	if (rval) {
 		contextp->dc_mode = OM_NONE;
 	}
 
@@ -995,28 +995,28 @@ do_begin_write( drive_t *drivep )
 /* do_set_mark - record a markrecord and callback
  */
 static void
-do_set_mark( drive_t *drivep,
+do_set_mark(drive_t *drivep,
 	     drive_mcbfp_t cbfuncp,
 	     void *cbcontextp,
-	     drive_markrec_t *markrecp )
+	     drive_markrec_t *markrecp)
 {
-	drive_context_t		*contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t		*contextp = (drive_context_t *)drivep->d_contextp;
 	drive_mark_t		mark;
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple set_mark( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple set_mark( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
 
 	/* calculate the mark offset
 	 */
-	mark = ( drive_mark_t )( contextp->dc_bufstroff
+	mark = (drive_mark_t)(contextp->dc_bufstroff
 				 +
-				 ( off64_t )
-				 ( contextp->dc_nextp - contextp->dc_buf ));
+				 (off64_t)
+				 (contextp->dc_nextp - contextp->dc_buf));
 
 	/* fill in the mark field of the mark record
 	 */
@@ -1034,27 +1034,27 @@ do_set_mark( drive_t *drivep,
 	 * buffer has not yet been flushed, we can just edit the buffer.
 	 */
 	contextp->dc_markcnt++;
-	if ( contextp->dc_markcnt == 1 ) {
-		if ( contextp->dc_bufstroff == 0 ) {
+	if (contextp->dc_markcnt == 1) {
+		if (contextp->dc_bufstroff == 0) {
 			/* cast the write buffer into a media file hdr
 			 */
 			global_hdr_t		*gwhdrp  =
-				( global_hdr_t * )contextp->dc_buf;
-			drive_hdr_t		*dwhdrp = ( drive_hdr_t * )gwhdrp->gh_upper;
+				(global_hdr_t *)contextp->dc_buf;
+			drive_hdr_t		*dwhdrp = (drive_hdr_t *)gwhdrp->gh_upper;
 
-			mlog( MLOG_NITTY | MLOG_DRIVE,
+			mlog(MLOG_NITTY | MLOG_DRIVE,
 			     "re-writing media file header with first mark "
-			     "(in buffer)\n" );
+			     "(in buffer)\n");
 
 			/* record mark in hdr
 			 */
-			INT_SET(*( ( drive_mark_t * )dwhdrp->dh_specific ), ARCH_CONVERT, mark);
+			INT_SET(*((drive_mark_t *)dwhdrp->dh_specific), ARCH_CONVERT, mark);
 
 			/* adjust header checksum
 			 */
-			global_hdr_checksum_set( gwhdrp );
+			global_hdr_checksum_set(gwhdrp);
 
-		} else if ( contextp->dc_rampr ) {
+		} else if (contextp->dc_rampr) {
 			global_hdr_t		*gwhdrp = drivep->d_gwritehdrp;
 			drive_hdr_t		*dwhdrp = drivep->d_writehdrp;
 			off64_t			newoff;
@@ -1063,24 +1063,24 @@ do_set_mark( drive_t *drivep,
 
 			/* assert the header has been flushed
 			 */
-			assert( contextp->dc_bufstroff >= sizeof( *gwhdrp ));
+			assert(contextp->dc_bufstroff >= sizeof(*gwhdrp));
 
 			/* record mark in hdr
 			 */
-			INT_SET(*( ( drive_mark_t * )dwhdrp->dh_specific ), ARCH_CONVERT, mark);
+			INT_SET(*((drive_mark_t *)dwhdrp->dh_specific), ARCH_CONVERT, mark);
 
 			/* adjust header checksum
 			 */
-			global_hdr_checksum_set( gwhdrp );
+			global_hdr_checksum_set(gwhdrp);
 
 			/* seek to beginning
 			 */
-			newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
-			if ( newoff < 0 ) {
-				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+			newoff = lseek64(contextp->dc_fd, (off64_t)0, SEEK_SET);
+			if (newoff < 0) {
+				mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 				      _("could not save first mark: %d (%s)\n"),
 				      errno,
-				      strerror( errno ));
+				      strerror(errno));
 			} else {
 				global_hdr_t		*tmphdr;
 				drive_hdr_t		*tmpdh;
@@ -1092,14 +1092,14 @@ do_set_mark( drive_t *drivep,
 				content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 				content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-				assert( newoff == 0 );
+				assert(newoff == 0);
 
 				/* write and seek back to current offset
 				 */
-				mlog( MLOG_NITTY | MLOG_DRIVE,
+				mlog(MLOG_NITTY | MLOG_DRIVE,
 				     "re-writing media file header "
 				     "with first mark "
-				     "(on media)\n" );
+				     "(on media)\n");
 
 				tmphdr = (global_hdr_t *)malloc(GLOBAL_HDR_SZ);
 				assert(tmphdr);
@@ -1109,16 +1109,16 @@ do_set_mark( drive_t *drivep,
 				tmpcih = (content_inode_hdr_t *)tmpch->ch_specific;
 				xlate_global_hdr(gwhdrp, tmphdr, 1);
 				xlate_drive_hdr(dh, tmpdh, 1);
-				INT_SET(*(( drive_mark_t * )tmpdh->dh_specific),
+				INT_SET(*((drive_mark_t *)tmpdh->dh_specific),
 					ARCH_CONVERT,
-					*(( drive_mark_t * )dh->dh_specific));
+					*((drive_mark_t *)dh->dh_specific));
 				xlate_media_hdr(mh, tmpmh, 1);
 				xlate_content_hdr(ch, tmpch, 1);
 				xlate_content_inode_hdr(cih, tmpcih, 1);
 
 				/* adjust header checksum
 				 */
-				global_hdr_checksum_set( tmphdr );
+				global_hdr_checksum_set(tmphdr);
 
 				mlog(MLOG_NITTY, "do_set_mark: global_hdr\n"
 				     "\tgh_magic %.100s\n"
@@ -1136,16 +1136,16 @@ do_set_mark( drive_t *drivep,
 				     tmphdr->gh_hostname,
 				     tmphdr->gh_dumplabel);
 
-				nwritten = write( contextp->dc_fd,
+				nwritten = write(contextp->dc_fd,
 						  tmphdr,
-						  sizeof( *tmphdr ));
-				assert( ( size_t )nwritten == sizeof( *tmphdr ));
+						  sizeof(*tmphdr));
+				assert((size_t)nwritten == sizeof(*tmphdr));
 				free(tmphdr);
 
-				newoff = lseek64( contextp->dc_fd,
+				newoff = lseek64(contextp->dc_fd,
 						  contextp->dc_bufstroff,
-						  SEEK_SET );
-				assert( newoff == contextp->dc_bufstroff );
+						  SEEK_SET);
+				assert(newoff == contextp->dc_bufstroff);
 			}
 		}
 	}
@@ -1153,19 +1153,19 @@ do_set_mark( drive_t *drivep,
 	/* if all written are committed, send the mark back immediately.
 	 * otherwise put the mark record on the tail of the queue.
 	 */
-	if ( contextp->dc_nextp == contextp->dc_buf ) {
-		assert( drivep->d_markrecheadp == 0 );
-		( * cbfuncp )( cbcontextp, markrecp, BOOL_TRUE );
+	if (contextp->dc_nextp == contextp->dc_buf) {
+		assert(drivep->d_markrecheadp == 0);
+		(* cbfuncp)(cbcontextp, markrecp, BOOL_TRUE);
 		return;
 	} else {
 		markrecp->dm_cbfuncp = cbfuncp;
 		markrecp->dm_cbcontextp = cbcontextp;
 		markrecp->dm_nextp = 0;
-		if ( drivep->d_markrecheadp == 0 ) {
+		if (drivep->d_markrecheadp == 0) {
 			drivep->d_markrecheadp = markrecp;
 			drivep->d_markrectailp = markrecp;
 		} else {
-			assert( drivep->d_markrectailp );
+			assert(drivep->d_markrectailp);
 			drivep->d_markrectailp->dm_nextp = markrecp;
 			drivep->d_markrectailp = markrecp;
 		}
@@ -1178,31 +1178,31 @@ do_set_mark( drive_t *drivep,
  */
 /*ARGSUSED*/
 static char *
-do_get_write_buf( drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp )
+do_get_write_buf(drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	size_t remaining_bufsz;
 	size_t actual_bufsz;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple get_write_buf( want %u )\n",
-	      wanted_bufsz );
+	      wanted_bufsz);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_emptyp );
-	assert( contextp->dc_ownedsz == 0 );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_emptyp);
+	assert(contextp->dc_ownedsz == 0);
 
 	/* calculate how much buffer remains
 	 */
-	remaining_bufsz =( size_t )( contextp->dc_emptyp - contextp->dc_nextp );
+	remaining_bufsz =(size_t)(contextp->dc_emptyp - contextp->dc_nextp);
 
 	/*  give the caller the lesser of what he wants and what is available
 	 */
-	actual_bufsz = min( wanted_bufsz, remaining_bufsz );
+	actual_bufsz = min(wanted_bufsz, remaining_bufsz);
 
 	/* caller will own that portion of buffer
 	 */
@@ -1224,15 +1224,15 @@ do_get_write_buf( drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp )
  */
 /*ARGSUSED*/
 static int
-do_write( drive_t *drivep, char *bufp, size_t writesz )
+do_write(drive_t *drivep, char *bufp, size_t writesz)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t ownedstroff = contextp->dc_bufstroff
 			      +
-			      ( off64_t )
-			      ( contextp->dc_ownedp - contextp->dc_buf );
+			      (off64_t)
+			      (contextp->dc_ownedp - contextp->dc_buf);
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
+	mlog(MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple write( "
 	      "offset %lld (0x%llx 0%llo) "
 	      "size %u (0x%x 0%o) "
@@ -1243,55 +1243,55 @@ do_write( drive_t *drivep, char *bufp, size_t writesz )
 	      writesz,
 	      writesz,
 	      writesz,
-	      0 );
+	      0);
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( contextp->dc_ownedp );
-	assert( bufp == contextp->dc_ownedp );
-	assert( ! contextp->dc_nextp );
-	assert( contextp->dc_ownedp < contextp->dc_emptyp );
-	assert( writesz == contextp->dc_ownedsz );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(contextp->dc_ownedp);
+	assert(bufp == contextp->dc_ownedp);
+	assert(! contextp->dc_nextp);
+	assert(contextp->dc_ownedp < contextp->dc_emptyp);
+	assert(writesz == contextp->dc_ownedsz);
 
 	/* calculate next portion of buffer available for get_write_buf,
 	 * and indicate no portion is owned.
 	 */
 	contextp->dc_nextp = contextp->dc_ownedp + writesz;
-	assert( contextp->dc_nextp <= contextp->dc_emptyp );
+	assert(contextp->dc_nextp <= contextp->dc_emptyp);
 	contextp->dc_ownedp = 0;
 	contextp->dc_ownedsz = 0;
 
-	if ( writesz == 0 ) {
+	if (writesz == 0) {
 		return 0; /* returning unused buffer */
 	}
 
 	/* if buffer is full, flush it
 	 */
-	if ( contextp->dc_nextp == contextp->dc_emptyp ) {
+	if (contextp->dc_nextp == contextp->dc_emptyp) {
 		int nwritten;
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "flushing write buf addr 0x%x size 0x%x\n",
 		      contextp->dc_buf,
-		      sizeof( contextp->dc_buf ));
+		      sizeof(contextp->dc_buf));
 
 		contextp->dc_nextp = 0;
-		nwritten = write( contextp->dc_fd,
+		nwritten = write(contextp->dc_fd,
 				  contextp->dc_buf,
-				  sizeof( contextp->dc_buf ));
-		if ( nwritten < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				  sizeof(contextp->dc_buf));
+		if (nwritten < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("write to %s failed: %d (%s)\n"),
 			      drivep->d_pathname,
 			      errno,
-			      strerror( errno ));
+			      strerror(errno));
 			nwritten = 0;
 		}
-		contextp->dc_bufstroff += ( off64_t )nwritten;
-		drive_mark_commit( drivep, contextp->dc_bufstroff );
+		contextp->dc_bufstroff += (off64_t)nwritten;
+		drive_mark_commit(drivep, contextp->dc_bufstroff);
 		contextp->dc_nextp = contextp->dc_buf;
-		if ( ( size_t )nwritten < sizeof( contextp->dc_buf )) {
+		if ((size_t)nwritten < sizeof(contextp->dc_buf)) {
 			return DRIVE_ERROR_EOM;
 		}
 	}
@@ -1303,91 +1303,91 @@ do_write( drive_t *drivep, char *bufp, size_t writesz )
  * cause the next call to get_write_buf() to be page-aligned.
  */
 static size_t
-do_get_align_cnt( drive_t *drivep )
+do_get_align_cnt(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	intptr_t next_alignment_off;
 	char *next_alignment_point;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple get_align_cnt( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple get_align_cnt( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_emptyp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_emptyp);
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because dc_buf is page-aligned and
 	 * a multiple of PGSZ.
 	 */
-	next_alignment_off = ( intptr_t )contextp->dc_nextp;
+	next_alignment_off = (intptr_t)contextp->dc_nextp;
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
-	next_alignment_point = ( char * )next_alignment_off;
-	assert( next_alignment_point <= contextp->dc_emptyp );
+	next_alignment_point = (char *)next_alignment_off;
+	assert(next_alignment_point <= contextp->dc_emptyp);
 
 	/* return the number of bytes to the next alignment point
 	 */
-	return ( size_t )( next_alignment_point - contextp->dc_nextp );
+	return (size_t)(next_alignment_point - contextp->dc_nextp);
 }
 
 /* end_write - flush any buffered data, and return by reference how many
  * bytes were committed.
  */
 static int
-do_end_write( drive_t *drivep, off64_t *ncommittedp )
+do_end_write(drive_t *drivep, off64_t *ncommittedp)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	size_t remaining_bufsz;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple end_write( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple end_write( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_WRITE );
-	assert( ! contextp->dc_ownedp );
-	assert( contextp->dc_nextp );
-	assert( contextp->dc_nextp < contextp->dc_emptyp );
+	assert(contextp->dc_mode == OM_WRITE);
+	assert(! contextp->dc_ownedp);
+	assert(contextp->dc_nextp);
+	assert(contextp->dc_nextp < contextp->dc_emptyp);
 
 	/* calculate length of un-written portion of buffer
 	 */
-	assert( contextp->dc_nextp >= contextp->dc_buf );
-	remaining_bufsz = ( size_t )( contextp->dc_nextp - contextp->dc_buf );
+	assert(contextp->dc_nextp >= contextp->dc_buf);
+	remaining_bufsz = (size_t)(contextp->dc_nextp - contextp->dc_buf);
 
-	if ( remaining_bufsz ) {
+	if (remaining_bufsz) {
 		int nwritten;
-		if ( contextp->dc_israwdevpr ) {
-			remaining_bufsz = ( remaining_bufsz + ( BBSIZE - 1 ))
+		if (contextp->dc_israwdevpr) {
+			remaining_bufsz = (remaining_bufsz + (BBSIZE - 1))
 					  &
-					  ~( BBSIZE - 1 );
+					  ~(BBSIZE - 1);
 		}
 
-		mlog( MLOG_DEBUG | MLOG_DRIVE,
+		mlog(MLOG_DEBUG | MLOG_DRIVE,
 		      "flushing write buf addr 0x%x size 0x%x\n",
 		      contextp->dc_buf,
-		      remaining_bufsz );
+		      remaining_bufsz);
 
-		nwritten = write( contextp->dc_fd,
+		nwritten = write(contextp->dc_fd,
 				  contextp->dc_buf,
-				  remaining_bufsz );
-		if ( nwritten < 0 ) {
-			mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+				  remaining_bufsz);
+		if (nwritten < 0) {
+			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 			      _("write to %s failed: %d (%s)\n"),
 			      drivep->d_pathname,
 			      errno,
-			      strerror( errno ));
-			drive_mark_discard( drivep );
+			      strerror(errno));
+			drive_mark_discard(drivep);
 			*ncommittedp = contextp->dc_bufstroff;
 			contextp->dc_mode = OM_NONE;
 			return DRIVE_ERROR_DEVICE;
 		}
-		contextp->dc_bufstroff += ( off64_t )nwritten;
-		drive_mark_commit( drivep, contextp->dc_bufstroff );
-		if ( ( size_t )nwritten < remaining_bufsz ) {
+		contextp->dc_bufstroff += (off64_t)nwritten;
+		drive_mark_commit(drivep, contextp->dc_bufstroff);
+		if ((size_t)nwritten < remaining_bufsz) {
 			*ncommittedp = contextp->dc_bufstroff;
 			contextp->dc_mode = OM_NONE;
 			return DRIVE_ERROR_EOM;
@@ -1397,7 +1397,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	/* bump the file mark cnt
 	 */
 	contextp->dc_fmarkcnt++;
-	assert( contextp->dc_fmarkcnt == 1 );
+	assert(contextp->dc_fmarkcnt == 1);
 
 	*ncommittedp = contextp->dc_bufstroff;
 	contextp->dc_mode = OM_NONE;
@@ -1407,32 +1407,32 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 /* rewind - return the current file offset to the beginning
  */
 int
-do_rewind( drive_t *drivep )
+do_rewind(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t newoff;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple rewind( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple rewind( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( dcaps & DRIVE_CAP_REWIND );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(dcaps & DRIVE_CAP_REWIND);
+	assert(contextp->dc_fd >= 0);
 
 	/* seek to beginning of file
 	 */
-	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
-	if ( newoff ) {
-		assert( newoff < 0 );
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	newoff = lseek64(contextp->dc_fd, (off64_t)0, SEEK_SET);
+	if (newoff) {
+		assert(newoff < 0);
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not rewind %s: %s\n"),
 		      drivep->d_pathname,
-		      strerror( errno ));
+		      strerror(errno));
 		return DRIVE_ERROR_DEVICE;
 	}
 
@@ -1442,45 +1442,45 @@ do_rewind( drive_t *drivep )
 /* erase - truncate to zero length
  */
 int
-do_erase( drive_t *drivep )
+do_erase(drive_t *drivep)
 {
 #ifdef DEBUG
 	int dcaps = drivep->d_capabilities;
 #endif
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 	off64_t newoff;
 	int rval;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple erase( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple erase( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( dcaps & DRIVE_CAP_ERASE );
-	assert( contextp->dc_fd >= 0 );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(dcaps & DRIVE_CAP_ERASE);
+	assert(contextp->dc_fd >= 0);
 
 	/* seek to beginning of file
 	 */
-	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
-	if ( newoff ) {
-		assert( newoff < 0 );
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	newoff = lseek64(contextp->dc_fd, (off64_t)0, SEEK_SET);
+	if (newoff) {
+		assert(newoff < 0);
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not rewind %s in prep for erase: %s\n"),
 		      drivep->d_pathname,
-		      strerror( errno ));
+		      strerror(errno));
 		return DRIVE_ERROR_DEVICE;
 	}
 
 	/* erase to beginning of file
 	 */
-	rval = ftruncate64( contextp->dc_fd, ( off64_t )0 );
-	if ( rval ) {
-		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
+	rval = ftruncate64(contextp->dc_fd, (off64_t)0);
+	if (rval) {
+		mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not erase %s: %s (%d)\n"),
 		      drivep->d_pathname,
-		      strerror( errno ),
-		      errno );
+		      strerror(errno),
+		      errno);
 		return DRIVE_ERROR_DEVICE;
 	}
 	contextp->dc_fmarkcnt = 0;
@@ -1492,36 +1492,36 @@ do_erase( drive_t *drivep )
  */
 /* ARGSUSED */
 static int
-do_get_device_class( drive_t *drivep )
+do_get_device_class(drive_t *drivep)
 {
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple get_device_class( )\n" );
-	assert( drivep );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple get_device_class( )\n");
+	assert(drivep);
 	return DEVICE_NONREMOVABLE;
 }
 
 static void
-do_quit( drive_t *drivep )
+do_quit(drive_t *drivep)
 {
-	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
+	drive_context_t *contextp = (drive_context_t *)drivep->d_contextp;
 
-	mlog( MLOG_NITTY | MLOG_DRIVE,
-	      "drive_simple quit( )\n" );
+	mlog(MLOG_NITTY | MLOG_DRIVE,
+	      "drive_simple quit( )\n");
 
 	/* assert protocol
 	 */
-	assert( contextp->dc_mode == OM_NONE );
-	assert( contextp );
+	assert(contextp->dc_mode == OM_NONE);
+	assert(contextp);
 
 	/* close file
 	 */
-	if ( contextp->dc_fd > 1 ) {
-		close( contextp->dc_fd );
+	if (contextp->dc_fd > 1) {
+		close(contextp->dc_fd);
 	}
 	contextp->dc_fd = -1;
 
 	/* free context
 	 */
-	free( ( void * )contextp );
+	free((void *)contextp);
 	drivep->d_contextp = 0;
 }
common/exit.h +2 -2
index 403946d..de76cd8 100644
@@ -26,9 +26,9 @@
 #define EXIT_FAULT	4	/* code fault */
 
 static inline const char *
-exit_codestring( int code )
+exit_codestring(int code)
 {
-	switch ( code ) {
+	switch (code) {
 	case EXIT_NORMAL:    return "SUCCESS";
 	case EXIT_ERROR:     return "ERROR";
 	case EXIT_INTERRUPT: return "INTERRUPT";
common/fs.c +94 -94

350 lines not on this page · raw message

common/fs.h +6 -6
index 4a9d9d1..7b02d72 100644
@@ -31,7 +31,7 @@
  *
  * returns BOOL_FALSE if srcname does not describe a file system.
  */
-extern bool_t fs_info( char *fstype,		/* out: fs type (fsid.h) */
+extern bool_t fs_info(char *fstype,		/* out: fs type (fsid.h) */
 		       int fstypesz,	/* in: buffer size */
 		       char *fstypedef,		/* in: default fs type */
 		       char *fsdevice,		/* out: blk spec. dev. file */
@@ -39,22 +39,22 @@ extern bool_t fs_info( char *fstype,		/* out: fs type (fsid.h) */
 		       char *mntpt,		/* out: where fs mounted */
 		       int mntptsz,	/* in: buffer size */
 		       uuid_t *fsid,		/* out: fs uuid */
-		       char *srcname );		/* in: how user named the fs */
+		       char *srcname);		/* in: how user named the fs */
 
 /* fs_mounted - checks if a file system is mounted at its mount point
  */
-extern bool_t fs_mounted( char *fstype,
+extern bool_t fs_mounted(char *fstype,
 		          char *fsdevice,
 		          char *mntpt,
-		          uuid_t *fsid );
+		          uuid_t *fsid);
 
 /* fs_getid - retrieves the uuid of the file system containing the named
  * file. returns -1 with errno set on error.
  */
-extern int fs_getid( char *fullpathname, uuid_t *fsidp );
+extern int fs_getid(char *fullpathname, uuid_t *fsidp);
 
 /* tells how many inos in use
  */
-extern size_t fs_getinocnt( char *mnts );
+extern size_t fs_getinocnt(char *mnts);
 
 #endif /* FS_H */
common/global.c +103 -103

386 lines not on this page · raw message

common/global.h +14 -14
index 53351a1..141c6db 100644
@@ -41,7 +41,7 @@
 #define GLOBAL_HDR_UUID_SZ	0x10
 
 struct global_hdr {
-	char gh_magic[ GLOBAL_HDR_MAGIC_SZ ];		/*   8    8 */
+	char gh_magic[GLOBAL_HDR_MAGIC_SZ];		/*   8    8 */
 		/* unique signature of xfsdump */
 	uint32_t gh_version;				/*   4    c */
 		/* header version */
@@ -49,55 +49,55 @@ struct global_hdr {
 		/* 32-bit unsigned additive inverse of entire header */
 	time32_t gh_timestamp;				/*   4   14 */
 		/* time32_t of dump */
-	char gh_pad1[ 4 ];				/*   4   18 */
+	char gh_pad1[4];				/*   4   18 */
 		/* alignment */
 	uint64_t gh_ipaddr;				/*   8   20 */
 		/* from gethostid(2), room for expansion */
 	uuid_t gh_dumpid;				/*  10   30 */
 		/* ID of dump session	 */
-	char gh_pad2[ 0xd0 ];				/*  d0  100 */
+	char gh_pad2[0xd0];				/*  d0  100 */
 		/* alignment */
-	char gh_hostname[ GLOBAL_HDR_STRING_SZ ];	/* 100  200 */
+	char gh_hostname[GLOBAL_HDR_STRING_SZ];	/* 100  200 */
 		/* from gethostname(2) */
-	char gh_dumplabel[ GLOBAL_HDR_STRING_SZ ];	/* 100  300 */
+	char gh_dumplabel[GLOBAL_HDR_STRING_SZ];	/* 100  300 */
 		/* label of dump session */
-	char gh_pad3[ 0x100 ];				/* 100  400 */
+	char gh_pad3[0x100];				/* 100  400 */
 		/* padding */
-	char gh_upper[ GLOBAL_HDR_SZ - 0x400 ];		/* c00 1000 */
+	char gh_upper[GLOBAL_HDR_SZ - 0x400];		/* c00 1000 */
 		/* header info private to upper software layers */
 };
 
 typedef struct global_hdr global_hdr_t;
 
 
-/* used by main( ) to allocate and populate a global header template.
+/* used by main() to allocate and populate a global header template.
  * drive managers will copy this into the write header.
  */
-extern global_hdr_t * global_hdr_alloc( int argc, char *argv[ ] );
+extern global_hdr_t * global_hdr_alloc(int argc, char *argv[]);
 
 
-/* used by main( ) to free the global header template after drive ini.
+/* used by main() to free the global header template after drive ini.
  */
-extern void global_hdr_free( global_hdr_t *ghdrp );
+extern void global_hdr_free(global_hdr_t *ghdrp);
 
 
 /* global_hdr_checksum_set - fill in the global media file header checksum.
  * utility function for use by drive-specific strategies.
  */
-extern void global_hdr_checksum_set( global_hdr_t *hdrp );
+extern void global_hdr_checksum_set(global_hdr_t *hdrp);
 
 
 /* global_hdr_checksum_check - check the global media file header checksum.
  * utility function for use by drive-specific strategies.
  * returns BOOL_TRUE if ok, BOOL_FALSE if bad
  */
-extern bool_t global_hdr_checksum_check( global_hdr_t *hdrp );
+extern bool_t global_hdr_checksum_check(global_hdr_t *hdrp);
 
 /* global_version_check - if we know this version number, return BOOL_TRUE
  * else return BOOL_FALSE
  */
 
-extern bool_t global_version_check( uint32_t version );
+extern bool_t global_version_check(uint32_t version);
 
 
 #endif /* GLOBAL_H */
common/hsmapi.c +11 -11
index 7a3584d..24bb924 100644
@@ -74,12 +74,12 @@ typedef	struct {
 	u_char	regcnt[2];	/* number of regions in MSB form */
 } XFSattrvalue1_t;
 
-#define	MIN_FORMAT1_ATTR_LEN	( sizeof(XFSattrvalue1_t) + \
-				  sizeof(XFSattrregion_t) )
+#define	MIN_FORMAT1_ATTR_LEN	(sizeof(XFSattrvalue1_t) + \
+				  sizeof(XFSattrregion_t))
 
 /* supported fsys values */
 
-/* XFS DMAPI (w/o MMR ) */
+/* XFS DMAPI (w/o MMR) */
 #define	FSYS_TYPE_XFS		1
 
 /* supported version values */
@@ -111,13 +111,13 @@ 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) | \
+#define DMF_EV_BITS	((1<<DM_EVENT_DESTROY) | \
 			  (1<<DM_EVENT_READ)    | \
 			  (1<<DM_EVENT_WRITE)   | \
-			  (1<<DM_EVENT_TRUNCATE) )
+			  (1<<DM_EVENT_TRUNCATE))
 
 /* OFL file's managed region event flags */
-#define DMF_MR_FLAGS	( 0x1 | 0x2 | 0x4 )
+#define DMF_MR_FLAGS	(0x1 | 0x2 | 0x4)
 
 /* The following definitions provide the internal format of the hsm_fs_ctxt_t
    and hsm_f_ctxt_t structures, respectively.
@@ -476,7 +476,7 @@ const	xfs_bstat_t	*statp)
 	if ((statp->bs_xflags & XFS_XFLAG_HASATTR) == 0) {
 		return 0;	/* no DMF attribute exists */
 	}
-	if ((statp->bs_dmevmask & DMF_EV_BITS) == 0 ) {
+	if ((statp->bs_dmevmask & DMF_EV_BITS) == 0) {
 		return 0;	/* no interesting DMAPI bits set */
 	}
 
@@ -735,8 +735,8 @@ HsmAddNewAttribute(
 	if (dmfattr1p->version == DMF_ATTR_FORMAT_1 &&
 	    msb_load(dmfattr1p->sitetag, sizeof(dmfattr1p->sitetag)) != 0) {
 		XFSattrregion_t *reg;
-		reg = (XFSattrregion_t *)( dmf_f_ctxtp->attrval +
-				           sizeof(XFSattrvalue1_t) );
+		reg = (XFSattrregion_t *)(dmf_f_ctxtp->attrval +
+				           sizeof(XFSattrvalue1_t));
 		dmf_f_ctxtp->attrlen = MIN_FORMAT1_ATTR_LEN;
 
 		/* make one offline region the size of the whole file */
@@ -794,7 +794,7 @@ HsmBeginRestoreFile(
 	 * remove the attribute when the file is completed.
 	 */
 	*hsm_flagp = 0;
-	if ( bstatp->bs_dmevmask && bstatp->bs_xflags & XFS_XFLAG_HASATTR ) {
+	if (bstatp->bs_dmevmask && bstatp->bs_xflags & XFS_XFLAG_HASATTR) {
 		memset(&dmattr, 0, sizeof(XFSattrvalue0_t));
 		dmattr.fsys = FSYS_TYPE_XFS;
 		msb_store(dmattr.state, DMF_ST_NOMIGR, sizeof(dmattr.state));
@@ -871,7 +871,7 @@ 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"),
common/inventory.c +151 -151

535 lines not on this page · raw message

common/inventory.h +18 -18
index d5c182a..599fc25 100644

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

common/lock.c +7 -7
index 9826581..216d202 100644

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

common/lock.h +3 -3
index 1dab2ae..97460bb 100644

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

common/main.c +789 -789

1,578 lines not on this page · raw message

common/media.c +63 -63

126 lines not on this page · raw message

common/media.h +10 -10
index 0b727e5..64e39ca 100644

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

common/media_rmvtape.h +3 -3
index 61e80e1..4116a14 100644

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

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

Signature · 1 line
2.19.1

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

author
#5 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 common/mlog.c     | 328 +++++++++++++++++++++++-----------------------
 common/mlog.h     |  58 ++++----
 common/openutil.c |  72 +++++-----
 common/openutil.h |  22 ++--
 common/path.c     | 190 +++++++++++++--------------
 common/path.h     |   8 +-
 common/qlock.c    | 116 ++++++++--------
 common/qlock.h    |  18 +--
 common/rec_hdr.h  |   4 +-
 common/ring.c     | 228 ++++++++++++++++----------------
 common/ring.h     |  20 +--
 common/stream.c   |  96 +++++++-------
 common/stream.h   |  26 ++--
 common/timeutil.c |   8 +-
 common/timeutil.h |   6 +-
 common/ts_mtio.h  |   2 +-
 common/types.h    |  58 ++++----
 common/util.c     | 260 ++++++++++++++++++------------------
 common/util.h     |  56 ++++----
 19 files changed, 788 insertions(+), 788 deletions(-)
common/mlog.c +164 -164
index 0924bf2..e3cf69d 100644
@@ -42,7 +42,7 @@
 #include "drive.h"
 
 extern char *progname;
-extern void usage( void );
+extern void usage(void);
 extern pthread_t parenttid;
 
 #ifdef DUMP
@@ -52,7 +52,7 @@ static FILE *mlog_fp = NULL; /* stderr */;
 static FILE *mlog_fp = NULL; /* stdout */;
 #endif /* RESTORE */
 
-int mlog_level_ss[ MLOG_SS_CNT ];
+int mlog_level_ss[MLOG_SS_CNT];
 
 int mlog_showlevel = BOOL_FALSE;
 
@@ -60,11 +60,11 @@ int mlog_showss = BOOL_FALSE;
 
 int mlog_timestamp = BOOL_FALSE;
 
-static int mlog_sym_lookup( char * );
+static int mlog_sym_lookup(char *);
 
 static size_t mlog_streamcnt;
 
-static char mlog_levelstr[ 3 ];
+static char mlog_levelstr[3];
 
 #define MLOG_SS_NAME_MAX	15
 #ifdef DUMP
@@ -76,9 +76,9 @@ static char mlog_levelstr[ 3 ];
 #endif /* DUMP */
 #define N(a) (sizeof((a)) / sizeof((a)[0]))
 
-static char mlog_ssstr[ MLOG_SS_NAME_MAX + 2 ];
+static char mlog_ssstr[MLOG_SS_NAME_MAX + 2];
 
-static char mlog_tsstr[ 10 ];
+static char mlog_tsstr[10];
 
 struct mlog_sym {
 	char *sym;
@@ -87,7 +87,7 @@ struct mlog_sym {
 
 typedef struct mlog_sym mlog_sym_t;
 
-char *mlog_ss_names[ MLOG_SS_CNT ] = {
+char *mlog_ss_names[MLOG_SS_CNT] = {
 	"general",	/* MLOG_SS_GEN */
 	"proc",		/* MLOG_SS_PROC */
 	"drive",	/* MLOG_SS_DRIVE */
@@ -102,7 +102,7 @@ char *mlog_ss_names[ MLOG_SS_CNT ] = {
 	"excluded_files" /* MLOG_SS_EXCLFILES */
 };
 
-static mlog_sym_t mlog_sym[ ] = {
+static mlog_sym_t mlog_sym[] = {
 	{"0",		MLOG_SILENT},
 	{"1",		MLOG_VERBOSE},
 	{"2",		MLOG_TRACE},
@@ -122,7 +122,7 @@ static rv_t mlog_main_exit_return = RV_NONE;
 static rv_t mlog_main_exit_hint = RV_NONE;
 
 void
-mlog_init0( void )
+mlog_init0(void)
 {
 	int i;
 
@@ -134,17 +134,17 @@ mlog_init0( void )
 #endif /* RESTORE */
 
 	/* initialize stream count. will be updated later by call to
-	 * mlog_tell_streamcnt( ), after drive layer has counted drives
+	 * mlog_tell_streamcnt(), after drive layer has counted drives
 	 */
 	mlog_streamcnt = 1;
 
-	for( i = 0 ; i < MLOG_SS_CNT ; i++ ) {
-		mlog_level_ss[ i ] = MLOG_VERBOSE;
+	for(i = 0 ; i < MLOG_SS_CNT ; i++) {
+		mlog_level_ss[i] = MLOG_VERBOSE;
 	}
 }
 
 bool_t
-mlog_init1( int argc, char *argv[ ] )
+mlog_init1(int argc, char *argv[])
 {
 	char **suboptstrs;
 	ix_t ssix;
@@ -154,105 +154,105 @@ mlog_init1( int argc, char *argv[ ] )
 
 	/* prepare an array of suboption token strings. this will be the
 	 * concatenation of the subsystem names with the verbosity symbols.
-	 * this array of char pts must be null terminated for getsubopt( 3 ).
+	 * this array of char pts must be null terminated for getsubopt(3).
 	 */
-	vsymcnt = sizeof( mlog_sym ) / sizeof( mlog_sym[ 0 ] );
-	suboptstrs = ( char ** )calloc( MLOG_SS_CNT + vsymcnt + 1,
-					sizeof( char * ));
-	assert( suboptstrs );
-	for ( soix = 0 ; soix < MLOG_SS_CNT ; soix++ ) {
-		assert( strlen( mlog_ss_names[ soix ] ) <= MLOG_SS_NAME_MAX );
+	vsymcnt = sizeof(mlog_sym) / sizeof(mlog_sym[0]);
+	suboptstrs = (char **)calloc(MLOG_SS_CNT + vsymcnt + 1,
+					sizeof(char *));
+	assert(suboptstrs);
+	for (soix = 0 ; soix < MLOG_SS_CNT ; soix++) {
+		assert(strlen(mlog_ss_names[soix]) <= MLOG_SS_NAME_MAX);
 			/* unrelated, but opportunity to chk */
-		suboptstrs[ soix ] = mlog_ss_names[ soix ];
+		suboptstrs[soix] = mlog_ss_names[soix];
 	}
-	for ( ; soix < MLOG_SS_CNT + vsymcnt ; soix++ ) {
-		suboptstrs[ soix ] = mlog_sym[ soix - MLOG_SS_CNT ].sym;
+	for (; soix < MLOG_SS_CNT + vsymcnt ; soix++) {
+		suboptstrs[soix] = mlog_sym[soix - MLOG_SS_CNT].sym;
 	}
-	suboptstrs[ soix ] = 0;
+	suboptstrs[soix] = 0;
 
 	/* set all of the subsystem log levels to -1, so we can see which
 	 * subsystems where explicitly called out. those which weren't will
 	 * be given the "general" level.
 	 */
-	for ( ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++ ) {
-		mlog_level_ss[ ssix ] = -1;
+	for (ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++) {
+		mlog_level_ss[ssix] = -1;
 	}
-	mlog_level_ss[ MLOG_SS_GEN ] = MLOG_VERBOSE;
+	mlog_level_ss[MLOG_SS_GEN] = MLOG_VERBOSE;
 
 	/* get command line options
 	 */
 	optind = 1;
 	opterr = 0;
-	while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
+	while ((c = getopt(argc, argv, GETOPT_CMDSTRING)) != EOF) {
 		char *options;
 
-		switch ( c ) {
+		switch (c) {
 		case GETOPT_VERBOSITY:
-			if ( ! optarg || optarg[ 0 ] == '-' ) {
-				fprintf( stderr,
+			if (! optarg || optarg[0] == '-') {
+				fprintf(stderr,
 					 _("%s: -%c argument missing\n"),
 					 progname,
-					 c );
-				usage( );
+					 c);
+				usage();
 				return BOOL_FALSE;
 			}
 			options = optarg;
-			while ( *options ) {
+			while (*options) {
 				int suboptix;
 				char *valstr;
 
-				suboptix = getsubopt( &options,
+				suboptix = getsubopt(&options,
 						      (constpp)suboptstrs,
-						      &valstr );
-				if ( suboptix < 0 ) {
-					fprintf( stderr,
+						      &valstr);
+				if (suboptix < 0) {
+					fprintf(stderr,
 						 _("%s: -%c argument invalid\n"),
 						 progname,
-						 c );
-					usage( );
+						 c);
+					usage();
 					return BOOL_FALSE;
 				}
-				assert( ( ix_t )suboptix
+				assert((ix_t)suboptix
 					<
-					MLOG_SS_CNT + vsymcnt );
-				if ( suboptix < MLOG_SS_CNT ) {
-					if ( ! valstr ) {
-						fprintf( stderr,
+					MLOG_SS_CNT + vsymcnt);
+				if (suboptix < MLOG_SS_CNT) {
+					if (! valstr) {
+						fprintf(stderr,
 							 _("%s: -%c subsystem "
 							 "subargument "
 							 "%s requires a "
 							 "verbosity value\n"),
 							 progname,
 							 c,
-						mlog_ss_names[ suboptix ] );
-						usage( );
+						mlog_ss_names[suboptix]);
+						usage();
 						return BOOL_FALSE;
 					}
-					ssix = ( ix_t )suboptix;
-					mlog_level_ss[ ssix ] =
-						    mlog_sym_lookup( valstr );
+					ssix = (ix_t)suboptix;
+					mlog_level_ss[ssix] =
+						    mlog_sym_lookup(valstr);
 				} else {
-					if ( valstr ) {
-						fprintf( stderr,
+					if (valstr) {
+						fprintf(stderr,
 							 _("%s: -%c argument "
 							 "does not require "
 							 "a value\n"),
 							 progname,
-							 c );
-						usage( );
+							 c);
+						usage();
 						return BOOL_FALSE;
 					}
 					ssix = MLOG_SS_GEN;
-					mlog_level_ss[ ssix ] =
-				    mlog_sym_lookup( suboptstrs[ suboptix ] );
+					mlog_level_ss[ssix] =
+				    mlog_sym_lookup(suboptstrs[suboptix]);
 				}
-				if ( mlog_level_ss[ ssix ] < 0 ) {
-					fprintf( stderr,
+				if (mlog_level_ss[ssix] < 0) {
+					fprintf(stderr,
 						 _("%s: -%c argument "
 						 "invalid\n"),
 						 progname,
-						 c );
-					usage( );
+						 c);
+					usage();
 					return BOOL_FALSE;
 				}
 			}
@@ -269,25 +269,25 @@ mlog_init1( int argc, char *argv[ ] )
 		}
 	}
 
-	free( ( void * )suboptstrs );
+	free((void *)suboptstrs);
 
 	/* give subsystems not explicitly called out the "general" verbosity
 	 */
-	for ( ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++ ) {
-		if ( mlog_level_ss[ ssix ] < 0 ) {
-			assert( mlog_level_ss[ ssix ] == -1 );
-			assert( mlog_level_ss[ MLOG_SS_GEN ] >= 0 );
-			mlog_level_ss[ ssix ] = mlog_level_ss[ MLOG_SS_GEN ];
+	for (ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++) {
+		if (mlog_level_ss[ssix] < 0) {
+			assert(mlog_level_ss[ssix] == -1);
+			assert(mlog_level_ss[MLOG_SS_GEN] >= 0);
+			mlog_level_ss[ssix] = mlog_level_ss[MLOG_SS_GEN];
 		}
 	}
 
 	/* prepare a string for optionally displaying the log level
 	 */
-	mlog_levelstr[ 0 ] = 0;
-	mlog_levelstr[ 1 ] = 0;
-	mlog_levelstr[ 2 ] = 0;
-	if ( mlog_showlevel ) {
-		mlog_levelstr[ 0 ] = ':';
+	mlog_levelstr[0] = 0;
+	mlog_levelstr[1] = 0;
+	mlog_levelstr[2] = 0;
+	if (mlog_showlevel) {
+		mlog_levelstr[0] = ':';
 	}
 
 #ifdef DUMP
@@ -296,7 +296,7 @@ mlog_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 */
@@ -307,31 +307,31 @@ mlog_init1( int argc, char *argv[ ] )
 }
 
 bool_t
-mlog_init2( void )
+mlog_init2(void)
 {
 	/* allocate a qlock
 	 */
-	mlog_qlockh = qlock_alloc( QLOCK_ORD_MLOG );
+	mlog_qlockh = qlock_alloc(QLOCK_ORD_MLOG);
 
 	return BOOL_TRUE;
 }
 
 void
-mlog_tell_streamcnt( size_t streamcnt )
+mlog_tell_streamcnt(size_t streamcnt)
 {
 	mlog_streamcnt = streamcnt;
 }
 
 void
-mlog_lock( void )
+mlog_lock(void)
 {
-	qlock_lock( mlog_qlockh );
+	qlock_lock(mlog_qlockh);
 }
 
 void
-mlog_unlock( void )
+mlog_unlock(void)
 {
-	qlock_unlock( mlog_qlockh );
+	qlock_unlock(mlog_qlockh);
 }
 
 /*
@@ -341,122 +341,122 @@ mlog_unlock( void )
  * too much output.
  */
 void
-mlog_override_level( int levelarg )
+mlog_override_level(int levelarg)
 {
 	int level;
 	ix_t ss; /* SubSystem */
 
 	level = levelarg & MLOG_LEVELMASK;
-	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
+	ss = (ix_t)((levelarg & MLOG_SS_MASK) >> MLOG_SS_SHIFT);
 
 	if (ss == MLOG_SS_GEN) { /* do level for all subsys */
-	    for (ss = 0 ; ss < MLOG_SS_CNT ; ss++ ) {
-		mlog_level_ss[ ss ] = level;
+	    for (ss = 0 ; ss < MLOG_SS_CNT ; ss++) {
+		mlog_level_ss[ss] = level;
 	    }
 	}
 	else { /* do a particular subsys */
-	    mlog_level_ss[ ss ] = level;
+	    mlog_level_ss[ss] = level;
 	}
 }
 
 void
-mlog( int levelarg, char *fmt, ... )
+mlog(int levelarg, char *fmt, ...)
 {
 	va_list args;
-	va_start( args, fmt );
-	mlog_va( levelarg, fmt, args );
-	va_end( args );
+	va_start(args, fmt);
+	mlog_va(levelarg, fmt, args);
+	va_end(args);
 }
 
 void
-mlog_va( int levelarg, char *fmt, va_list args )
+mlog_va(int levelarg, char *fmt, va_list args)
 {
 	int level;
 	ix_t ss;
 
 	level = levelarg & MLOG_LEVELMASK;
-	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
+	ss = (ix_t)((levelarg & MLOG_SS_MASK) >> MLOG_SS_SHIFT);
 
-	assert( ss < MLOG_SS_CNT );
-	if ( level > mlog_level_ss[ ss ] ) {
+	assert(ss < MLOG_SS_CNT);
+	if (level > mlog_level_ss[ss]) {
 		return;
 	}
 
-	if ( ! ( levelarg & MLOG_NOLOCK )) {
-		mlog_lock( );
+	if (! (levelarg & MLOG_NOLOCK)) {
+		mlog_lock();
 	}
 
-	if ( ! ( levelarg & MLOG_BARE )) {
+	if (! (levelarg & MLOG_BARE)) {
 		int streamix;
-		streamix = stream_getix( pthread_self( ) );
+		streamix = stream_getix(pthread_self());
 
-		if ( mlog_showss ) {
-			sprintf( mlog_ssstr, ":%s", mlog_ss_names[ ss ] );
+		if (mlog_showss) {
+			sprintf(mlog_ssstr, ":%s", mlog_ss_names[ ss]);
 		} else {
-			mlog_ssstr[ 0 ] = 0;
+			mlog_ssstr[0] = 0;
 		}
 
-		if ( mlog_timestamp ) {
-			time_t now = time( 0 );
-			struct tm *tmp = localtime( &now );
-			sprintf( mlog_tsstr,
+		if (mlog_timestamp) {
+			time_t now = time(0);
+			struct tm *tmp = localtime(&now);
+			sprintf(mlog_tsstr,
 				 ":%02d.%02d.%02d",
 				 tmp->tm_hour,
 				 tmp->tm_min,
-				 tmp->tm_sec );
-			assert( strlen( mlog_tsstr ) < sizeof( mlog_tsstr ));
+				 tmp->tm_sec);
+			assert(strlen(mlog_tsstr) < sizeof(mlog_tsstr));
 		} else {
-			mlog_tsstr[ 0 ] = 0;
+			mlog_tsstr[0] = 0;
 		}
 
-		if ( mlog_showlevel ) {
-			mlog_levelstr[ 0 ] = ':';
-			if ( level > 9 ) {
-				mlog_levelstr[ 1 ] = '?';
+		if (mlog_showlevel) {
+			mlog_levelstr[0] = ':';
+			if (level > 9) {
+				mlog_levelstr[1] = '?';
 			} else {
-				mlog_levelstr[ 1 ] = ( char )
-						     ( level
+				mlog_levelstr[1] = (char)
+						     (level
 						       +
-						       ( int )'0' );
+						       (int)'0');
 			}
 		} else {
-			mlog_levelstr[ 0 ] = 0;
+			mlog_levelstr[0] = 0;
 		}
-		if ( streamix != -1 && mlog_streamcnt > 1 ) {
-			fprintf( mlog_fp,
+		if (streamix != -1 && mlog_streamcnt > 1) {
+			fprintf(mlog_fp,
 				 _("%s%s%s%s: drive %d: "),
 				 progname,
 				 mlog_tsstr,
 				 mlog_ssstr,
 				 mlog_levelstr,
-				 streamix );
+				 streamix);
 		} else {
-			fprintf( mlog_fp,
+			fprintf(mlog_fp,
 				 "%s%s%s%s: ",
 				 progname,
 				 mlog_tsstr,
 				 mlog_ssstr,
-				 mlog_levelstr );
+				 mlog_levelstr);
 		}
-		if ( levelarg & MLOG_NOTE ) {
-			fprintf( mlog_fp,
-				 "NOTE: " );
+		if (levelarg & MLOG_NOTE) {
+			fprintf(mlog_fp,
+				 "NOTE: ");
 		}
-		if ( levelarg & MLOG_WARNING ) {
-			fprintf( mlog_fp,
-				 "WARNING: " );
+		if (levelarg & MLOG_WARNING) {
+			fprintf(mlog_fp,
+				 "WARNING: ");
 		}
-		if ( levelarg & MLOG_ERROR ) {
-			fprintf( mlog_fp,
-				 "ERROR: " );
+		if (levelarg & MLOG_ERROR) {
+			fprintf(mlog_fp,
+				 "ERROR: ");
 		}
 	}
 
-	vfprintf( mlog_fp, fmt, args );
-	fflush( mlog_fp );
+	vfprintf(mlog_fp, fmt, args);
+	fflush(mlog_fp);
 
-	if ( ! ( levelarg & MLOG_NOLOCK )) {
-		mlog_unlock( );
+	if (! (levelarg & MLOG_NOLOCK)) {
+		mlog_unlock();
 	}
 }
 
@@ -569,7 +569,7 @@ rv_getdesc(rv_t rv)
  */
 
 int
-_mlog_exit( const char *file, int line, int exit_code, rv_t rv )
+_mlog_exit(const char *file, int line, int exit_code, rv_t rv)
 {
 	pthread_t tid;
 	const struct rv_map *rvp;
@@ -578,7 +578,7 @@ _mlog_exit( const char *file, int line, int exit_code, rv_t rv )
 	rvp = rv_getdesc(rv);
 
 
-	mlog( MLOG_DEBUG | MLOG_NOLOCK,
+	mlog(MLOG_DEBUG | MLOG_NOLOCK,
 	      "%s: %d: mlog_exit called: "
 	      "exit_code: %s return: %s (%s)\n",
 	      file, line,
@@ -586,7 +586,7 @@ _mlog_exit( const char *file, int line, int exit_code, rv_t rv )
 	      rvp->rv_string, rvp->rv_desc);
 
 	if (rv < 0 || rv >= _RV_NUM) {
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
 		      "mlog_exit(): bad return code");
 		return exit_code;
 	}
@@ -598,7 +598,7 @@ _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;
@@ -631,7 +631,7 @@ _mlog_exit( const char *file, int line, int exit_code, rv_t rv )
 }
 
 void
-_mlog_exit_hint( const char *file, int line, rv_t rv )
+_mlog_exit_hint(const char *file, int line, rv_t rv)
 {
 	pthread_t tid;
 	const struct rv_map *rvp;
@@ -639,14 +639,14 @@ _mlog_exit_hint( const char *file, int line, rv_t rv )
 	tid = pthread_self();
 	rvp = rv_getdesc(rv);
 
-	mlog( MLOG_DEBUG | MLOG_NOLOCK,
+	mlog(MLOG_DEBUG | MLOG_NOLOCK,
 	      "%s: %d: mlog_exit_hint called: "
 	      "hint: %s (%s)\n",
 	      file, line,
 	      rvp->rv_string, rvp->rv_desc);
 
 	if (rv < 0 || rv >= _RV_NUM) {
-		mlog( MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
+		mlog(MLOG_DEBUG | MLOG_ERROR | MLOG_NOLOCK,
 		      "mlog_exit_hint(): bad return code");
 		return;
 	}
@@ -658,22 +658,22 @@ _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 );
+		stream_set_hint(tid, rv);
 
 }
 
 rv_t
-mlog_get_hint( void )
+mlog_get_hint(void)
 {
 	stream_state_t states[] = { S_RUNNING };
 	/* REFERENCED */
 	bool_t ok;
 	rv_t hint;
 
-	if ( pthread_equal( pthread_self(), parenttid ) )
+	if (pthread_equal(pthread_self(), parenttid))
 		return mlog_main_exit_hint;
 
 	ok = stream_get_exit_status(pthread_self(), states, N(states),
@@ -720,7 +720,7 @@ mlog_exit_flush(void)
 	if (ntids > 0) {
 
 		/* print the state of all the streams */
-		fprintf(mlog_fp, _("%s: %s Summary:\n"), progname, PROGSTR_CAPS );
+		fprintf(mlog_fp, _("%s: %s Summary:\n"), progname, PROGSTR_CAPS);
 
 		for (i = 0; i < ntids; i++) {
 			stream_state_t state;
@@ -785,15 +785,15 @@ mlog_exit_flush(void)
 }
 
 static int
-mlog_sym_lookup( char *sym )
+mlog_sym_lookup(char *sym)
 {
 	mlog_sym_t *p = mlog_sym;
 	mlog_sym_t *ep = mlog_sym
 			 +
-			 sizeof( mlog_sym ) / sizeof( mlog_sym[ 0 ] );
+			 sizeof(mlog_sym) / sizeof(mlog_sym[0]);
 
-	for ( ; p < ep ; p++ ) {
-		if ( ! strcmp( sym, p->sym )) {
+	for (; p < ep ; p++) {
+		if (! strcmp(sym, p->sym)) {
 			return p->level;
 		}
 	}
@@ -802,7 +802,7 @@ mlog_sym_lookup( char *sym )
 }
 
 void
-fold_init( fold_t fold, char *infostr, char c )
+fold_init(fold_t fold, char *infostr, char c)
 {
 	size_t infolen;
 	size_t dashlen;
@@ -812,36 +812,36 @@ fold_init( fold_t fold, char *infostr, char c )
 	char *endp;
 	ix_t cnt;
 
-	assert( sizeof( fold_t ) == FOLD_LEN + 1 );
+	assert(sizeof(fold_t) == FOLD_LEN + 1);
 
-	infolen = strlen( infostr );
-	if ( infolen > FOLD_LEN - 4 ) {
+	infolen = strlen(infostr);
+	if (infolen > FOLD_LEN - 4) {
 		infolen = FOLD_LEN - 4;
 	}
 	dashlen = FOLD_LEN - infolen - 3;
 	predashlen = dashlen / 2;
 	postdashlen = dashlen - predashlen;
 
-	p = &fold[ 0 ];
-	endp = &fold[ sizeof( fold_t ) - 1 ];
+	p = &fold[0];
+	endp = &fold[sizeof(fold_t) - 1];
 
-	assert( p < endp );
+	assert(p < endp);
 	*p++ = ' ';
-	for ( cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++ ) {
+	for (cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++) {
 		*p = c;
 	}
-	assert( p < endp );
+	assert(p < endp);
 	*p++ = ' ';
-	assert( p < endp );
-	assert( p + infolen < endp );
-	strcpy( p, infostr );
+	assert(p < endp);
+	assert(p + infolen < endp);
+	strcpy(p, infostr);
 	p += infolen;
-	assert( p < endp );
+	assert(p < endp);
 	*p++ = ' ';
-	assert( p < endp );
-	for ( cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++ ) {
+	assert(p < endp);
+	for (cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++) {
 		*p = c;
 	}
-	assert( p <= endp );
+	assert(p <= endp);
 	*p = 0;
 }
common/mlog.h +29 -29

99 lines not on this page · raw message

common/openutil.c +36 -36

162 lines not on this page · raw message

common/openutil.h +11 -11
index 587462c..0e418d4 100644
@@ -28,35 +28,35 @@
  * representation of the pid will be appended to the pathname, beginning
  * with a '.'.
  */
-extern char *open_pathalloc( char *dirname, char *basename, pid_t pid );
+extern char *open_pathalloc(char *dirname, char *basename, pid_t pid);
 
 /* create the specified file, creating or truncating as necessary,
  * with read and write permissions, given a directory and base.
- * return the file descriptor, or -1 with errno set. uses mlog( MLOG_NORMAL...
+ * return the file descriptor, or -1 with errno set. uses mlog(MLOG_NORMAL...
  * if the creation fails.
  */
-extern int open_trwdb( char *dirname, char *basename, pid_t pid );
-extern int open_trwp( char *pathname );
+extern int open_trwdb(char *dirname, char *basename, pid_t pid);
+extern int open_trwp(char *pathname);
 
 
 /* open the specified file, with read and write permissions, given a
  * directory and base.* return the file descriptor, or -1 with errno set.
- * uses mlog( MLOG_NORMAL... if the open fails.
+ * uses mlog(MLOG_NORMAL... if the open fails.
  */
-extern int open_rwdb( char *dirname, char *basename, pid_t pid );
-extern int open_rwp( char *pathname );
+extern int open_rwdb(char *dirname, char *basename, pid_t pid);
+extern int open_rwp(char *pathname);
 
 
 /* create and open the specified file, failing if already exists
  */
-extern int open_erwp( char *pathname );
-extern int open_erwdb( char *dirname, char *basename, pid_t pid );
+extern int open_erwp(char *pathname);
+extern int open_erwdb(char *dirname, char *basename, pid_t pid);
 
 
 /* create the specified directory, guaranteed to be initially empty. returns
- * 0 on success, -1 if trouble. uses mlog( MLOG_NORMAL... if the creation fails.
+ * 0 on success, -1 if trouble. uses mlog(MLOG_NORMAL... if the creation fails.
  */
-extern int mkdir_tp( char *pathname );
+extern int mkdir_tp(char *pathname);
 
 
 #endif /* UTIL_H */
common/path.c +95 -95

365 lines not on this page · raw message

common/path.h +4 -4
index 9092233..f05f5c7 100644
@@ -20,9 +20,9 @@
 
 /* various pathname helpers
  */
-extern char * path_reltoabs( char *dir, char *basedir );
-extern char *path_normalize( char *path );
-extern char * path_diff( char *path, char *base );
-extern int path_beginswith( char *path, char *base );
+extern char * path_reltoabs(char *dir, char *basedir);
+extern char *path_normalize(char *path);
+extern char * path_diff(char *path, char *base);
+extern int path_beginswith(char *path, char *base);
 
 #endif /* PATH_H */
common/qlock.c +58 -58

256 lines not on this page · raw message

common/qlock.h +9 -9
index 6c2dd18..52a8467 100644
@@ -48,14 +48,14 @@ typedef void *qlockh_t;
 	/* opaque handle
 	 */
 
-extern qlockh_t qlock_alloc( ix_t ord );
+extern qlockh_t qlock_alloc(ix_t ord);
 	/* allocates a qlock with the specified ordinal. returns
 	 * NULL if lock can't be allocated.
 	 */
-extern void qlock_lock( qlockh_t qlockh );
+extern void qlock_lock(qlockh_t qlockh);
 	/* acquires the specified lock.
 	 */
-extern void qlock_unlock( qlockh_t qlockh );
+extern void qlock_unlock(qlockh_t qlockh);
 	/* releases the specified lock.
 	 */
 
@@ -64,23 +64,23 @@ typedef void *qsemh_t;
 	/* opaque handle
 	 */
 
-extern qsemh_t qsem_alloc( size_t cnt );
+extern qsemh_t qsem_alloc(size_t cnt);
 	/* allocates a counting semaphore initialized to the specified
 	 * count. returns a qsem handle
 	 */
-extern void qsem_free( qsemh_t qsemh );
+extern void qsem_free(qsemh_t qsemh);
 	/* frees the counting semaphore
 	 */
-extern void qsemP( qsemh_t qsemh );
+extern void qsemP(qsemh_t qsemh);
 	/* "P" (decrement) op
 	 */
-extern void qsemV( qsemh_t qsemh );
+extern void qsemV(qsemh_t qsemh);
 	/* "V" (increment) op
 	 */
-extern bool_t qsemPwouldblock( qsemh_t qsemh );
+extern bool_t qsemPwouldblock(qsemh_t qsemh);
 	/* returns true if a qsemP op would block
 	 */
-extern size_t qsemPavail( qsemh_t qsemh );
+extern size_t qsemPavail(qsemh_t qsemh);
 	/* number of resources available
 	 */
 
common/rec_hdr.h +2 -2
index 1ab783c..a33c54e 100644
@@ -51,7 +51,7 @@ struct rec_hdr {
 	int32_t capability;			/*   4  18 */
 		/* tape drive capabilities (from drive.h)
 		 */
-	char pad1[ 8 ];				/*   8  20 */
+	char pad1[8];				/*   8  20 */
 		/* padding
 		 */
 	off64_t file_offset;			/*   8  28 */
@@ -73,7 +73,7 @@ struct rec_hdr {
 
 	uuid_t dump_uuid;			/*  10  4c */
 
-	char pad2[ 0x1b4 ];			/* 1b4 200 */
+	char pad2[0x1b4];			/* 1b4 200 */
 };		/* pad to sizeof drive_hdr_t dh_specific */
 
 typedef struct rec_hdr rec_hdr_t;
common/ring.c +114 -114

504 lines not on this page · raw message

common/ring.h +10 -10
index 6126b77..be4ae69 100644
@@ -144,8 +144,8 @@ struct ring {
 	qsemh_t r_active_qsemh;
 	size_t r_client_cnt;
 	size_t r_slave_cnt;
-	int ( *r_readfunc )( void *contextp, char *bufp );
-	int ( *r_writefunc )( void *contextp, char *bufp );
+	int (*r_readfunc)(void *contextp, char *bufp);
+	int (*r_writefunc)(void *contextp, char *bufp);
 	void *r_clientctxp;
 };
 
@@ -164,34 +164,34 @@ typedef struct ring ring_t;
  * E2BIG - insufficient physical memory available for pinning;
  * EPERM - exceeds allowed amount of pinned down memory.
  */
-extern ring_t *ring_create( size_t ringlen,
+extern ring_t *ring_create(size_t ringlen,
 			    size_t bufsz,
 			    bool_t pinpr,
 			    ix_t drive_index,
-			    int ( * readfunc )( void *clientctxp, char *bufp ),
-			    int ( * writefunc )( void *clientctxp, char *bufp ),
+			    int (* readfunc)(void *clientctxp, char *bufp),
+			    int (* writefunc)(void *clientctxp, char *bufp),
 			    void *clientctxp,
-			    int *rvalp );
+			    int *rvalp);
 
 
 /* ring_get - get a message off the ready queue
  */
-extern ring_msg_t *ring_get( ring_t *ringp );
+extern ring_msg_t *ring_get(ring_t *ringp);
 
 
 /* ring_put - put a message on the active queue
  */
-extern void ring_put( ring_t *ringp, ring_msg_t *msgp );
+extern void ring_put(ring_t *ringp, ring_msg_t *msgp);
 
 
 /* ring_reset - re-initialize the ring, after the current I/O completes.
  * msgp must be NULL if the client is not currently holding a ring message.
  * otherwise it must point to that message.
  */
-extern void ring_reset( ring_t *ringp, ring_msg_t *msgp );
+extern void ring_reset(ring_t *ringp, ring_msg_t *msgp);
 
 /* ring_destroy - de-allocates ring
  */
-extern void ring_destroy( ring_t *ringp );
+extern void ring_destroy(ring_t *ringp);
 
 #endif /* RING_H */
common/stream.c +48 -48

241 lines not on this page · raw message

common/stream.h +13 -13
index a83a5a5..b3417fa 100644
@@ -41,21 +41,21 @@
 
 typedef enum { S_FREE, S_RUNNING, S_ZOMBIE } stream_state_t;
 
-extern void stream_init( void );
-extern void stream_register( pthread_t tid, int streamix );
+extern void stream_init(void);
+extern void stream_register(pthread_t tid, int streamix);
 /* NOTE: lock() must be held when calling stream_dead */
-extern void stream_dead( pthread_t tid );
-extern void stream_free( pthread_t tid );
-extern int stream_find_all( stream_state_t states[],
+extern void stream_dead(pthread_t tid);
+extern void stream_free(pthread_t tid);
+extern int stream_find_all(stream_state_t states[],
 			    int nstates,
 			    pthread_t tids[],
-			    int ntids );
-extern int stream_getix( pthread_t tid );
-extern void stream_set_code( pthread_t tid, int code );
-extern void stream_set_return( pthread_t tid, rv_t rv );
-extern void stream_set_hint( pthread_t tid, rv_t rv );
-extern bool_t stream_exists( pthread_t tid );
-extern bool_t stream_get_exit_status( pthread_t tid,
+			    int ntids);
+extern int stream_getix(pthread_t tid);
+extern void stream_set_code(pthread_t tid, int code);
+extern void stream_set_return(pthread_t tid, rv_t rv);
+extern void stream_set_hint(pthread_t tid, rv_t rv);
+extern bool_t stream_exists(pthread_t tid);
+extern bool_t stream_get_exit_status(pthread_t tid,
 				      stream_state_t states[],
 				      int nstates,
 				      stream_state_t *state,
@@ -63,7 +63,7 @@ extern bool_t stream_get_exit_status( pthread_t tid,
 				      int *exit_code,
 				      rv_t *exit_return,
 				      rv_t *exit_hint);
-extern size_t stream_cnt( void );
+extern size_t stream_cnt(void);
 
 
 #endif /* STREAM_H */
common/timeutil.c +4 -4
index 0e52968..a25b0c4 100644
@@ -38,12 +38,12 @@ ctime32_r(const time32_t *timep, char *buf)
 }
 
 char *
-ctimennl( const time32_t *clockp )
+ctimennl(const time32_t *clockp)
 {
-	char *p = ctime32( clockp );
+	char *p = ctime32(clockp);
 
-	if ( p && strlen( p ) > 0 ) {
-		p[ strlen( p ) - 1 ] = 0;
+	if (p && strlen(p) > 0) {
+		p[strlen(p) - 1] = 0;
 	}
 
 	return p;
common/timeutil.h +3 -3
index b200855..5b9567d 100644
@@ -24,14 +24,14 @@
 
 /* ctime32 - takes a time32_t instead of a time_t
  */
-extern char *ctime32( const time32_t *timep );
+extern char *ctime32(const time32_t *timep);
 
 /* ctime32_r - takes a time32_t instead of a time_t
  */
-extern char *ctime32_r( const time32_t *timep, char *buf );
+extern char *ctime32_r(const time32_t *timep, char *buf);
 
 /* ctimennl - ctime(3C) with newline removed
  */
-extern char *ctimennl( const time32_t *clockp );
+extern char *ctimennl(const time32_t *clockp);
 
 #endif /* TIMEUTIL_H */
common/ts_mtio.h +1 -1
index 92fd889..9e4ae4c 100644
@@ -42,7 +42,7 @@ typedef unsigned int    minor_t;
  * #define MTSEEK	22	 Seek to the given block number.  Not all
  *				 drives support this option.  For drives
  *				 that support audio, the block number
- *				 actually becomes the program number ( 0
+ *				 actually becomes the program number (0
  *				 meaning leadin area, 0xfffffffe meaning
  *				 leadout, and other values (currently 1-
  *				 799 decimal) the program #).  For seeking
common/types.h +29 -29

89 lines not on this page · raw message

common/util.c +130 -130

367 lines not on this page · raw message

common/util.h +28 -28

56 lines not on this page · raw message

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

Signature · 1 line
2.19.1

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

author
#6 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 dump/content.c | 2032 ++++++++++++++++++++++++------------------------
 1 file changed, 1016 insertions(+), 1016 deletions(-)
dump/content.c +1016 -1016
index ecc867d..4e4566a 100644
@@ -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,
[… more lines in the raw message]

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

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

Signature · 1 line
2.19.1

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

author
#7 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 dump/content.c | 1612 ++++++++++++++++++++++++------------------------
 1 file changed, 806 insertions(+), 806 deletions(-)
dump/content.c +806 -806
index 4e4566a..43f51db 100644
@@ -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";
[… more lines in the raw message]

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

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

Signature · 1 line
2.19.1

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

author
#8 lore raw

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

In reply to Jan Tulak

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

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

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

for i in {1..8}; do

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

done

# Revert changes in defines that would cause redefinition error

sed -i \
    -e 's/^#define sizeofmember.*$/#define sizeofmember( t, m )\tsizeof( ( ( t * )0 )->m )/' \
    -e 's/^#define offsetofmember.*$/#define offsetofmember( t, m )\t( ( size_t )( char * )\&( ( ( t * )0 )->m ) )/' \
    common/types.h

*****

---
 dump/getopt.h         |   2 +-
 dump/inomap.c         | 768 +++++++++++++++++++++---------------------
 dump/inomap.h         |  32 +-
 dump/var.c            |  96 +++---
 dump/var.h            |   4 +-
 include/swab.h        |  24 +-
 include/swap.h        |  10 +-
 inventory/getopt.h    |   2 +-
 inventory/inv_api.c   | 414 +++++++++++------------
 inventory/inv_core.c  | 106 +++---
 inventory/inv_files.c |  10 +-
 inventory/inv_fstab.c | 152 ++++-----
 inventory/inv_idx.c   | 274 +++++++--------
 inventory/inv_mgr.c   | 332 +++++++++---------
 inventory/inv_oref.c  |  46 +--
 inventory/inv_oref.h  |   2 +-
 inventory/inv_priv.h  | 244 +++++++-------
 17 files changed, 1259 insertions(+), 1259 deletions(-)
dump/getopt.h +1 -1
index 3bab87a..dd798d8 100644
@@ -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' */
dump/inomap.c +384 -384

1,672 lines not on this page · raw message

dump/inomap.h +16 -16
index fb9bbf7..64b769a 100644
@@ -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.
dump/var.c +48 -48

185 lines not on this page · raw message

dump/var.h +2 -2
index 889a389..0a8f13d 100644
@@ -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 */
include/swab.h +12 -12
index 2684aa7..abfeeb6 100644
@@ -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
include/swap.h +5 -5
index fa6aec6..d74453f 100644
@@ -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)))
inventory/getopt.h +1 -1
index 7bebc6d..4ae23e4 100644
@@ -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) */
inventory/inv_api.c +207 -207

873 lines not on this page · raw message

inventory/inv_core.c +53 -53

87 lines not on this page · raw message

inventory/inv_files.c +5 -5
index 46f6b8f..ae4642d 100644

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

inventory/inv_fstab.c +76 -76

152 lines not on this page · raw message

inventory/inv_idx.c +137 -137

274 lines not on this page · raw message

inventory/inv_mgr.c +166 -166

332 lines not on this page · raw message

inventory/inv_oref.c +23 -23

46 lines not on this page · raw message

inventory/inv_oref.h +1 -1
index 0061722..836ce82 100644

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

inventory/inv_priv.h +122 -122

244 lines not on this page · raw message

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

Signature · 1 line
2.19.1

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