xfsdump: (style) remove spaces for pointers and negations
PATCH 1/1 xfsdump: (style) remove spaces for pointers and negations
Another case of different xfsdump style, spaces around * and ! operators. This style was used a lot through xfsdump:
(* foo_t)xxx
^ space
While the rest of XFS omits the space. Same for negations:
if (! foo)
This patch changes all occurrences to comply with the rest of xfs/kernel coding style by removing the space. Unlike the previous patches, this one is not fully replicable by a script - I had to manually correct many cases of overzealous replacements in comments or strings. (Regular expressions are a too weak tool for these context-sensitive changes.)
Still, the script that did most of the job is here:
find . -name '*.[ch]' ! -type d -exec gawk -i inplace '{
$0 = gensub(/^([^"]*)\(\* /, "\\1(*", "g") # foo(* bar
$0 = gensub(/\(\* ([^"]*)$/, "(*\\1", "g") #
$0 = gensub(/^([^ *#]{2}[^"]*)! /, "\\1!", "g") # space after exclamation mark
}; {print }' {} \;--- common/cldmgr.c | 8 +- common/cldmgr.h | 2 +- common/cleanup.c | 12 +- common/dlog.c | 8 +- common/dlog.h | 4 +- common/drive.c | 30 +-- common/drive.h | 50 ++--- common/drive_minrmt.c | 136 ++++++------- common/drive_scsitape.c | 283 +++++++++++++------------- common/drive_simple.c | 32 +-- common/fs.c | 10 +- common/global.c | 12 +- common/inventory.c | 2 +- common/main.c | 116 +++++------ common/media.c | 18 +- common/mlog.c | 12 +- common/path.c | 16 +- common/qlock.c | 8 +- common/ring.c | 8 +- common/ring.h | 4 +- common/stream.c | 2 +- common/util.c | 22 +- common/util.h | 8 +- dump/content.c | 170 ++++++++-------- dump/inomap.c | 12 +- dump/var.c | 6 +- inventory/inv_api.c | 16 +- inventory/inv_fstab.c | 4 +- inventory/inv_idx.c | 1 - inventory/inv_mgr.c | 4 +- inventory/inv_oref.c | 10 +- inventory/inv_stobj.c | 16 +- inventory/testmain.c | 8 +- invutil/cmenu.h | 24 +-- invutil/invutil.c | 2 +- restore/bag.c | 10 +- restore/content.c | 436 ++++++++++++++++++++-------------------- restore/dirattr.c | 24 +-- restore/dirattr.h | 2 +- restore/inomap.c | 12 +- restore/inomap.h | 2 +- restore/namreg.c | 14 +- restore/node.c | 8 +- restore/tree.c | 262 ++++++++++++------------ restore/tree.h | 4 +- restore/win.c | 20 +- 46 files changed, 934 insertions(+), 936 deletions(-)
common/cldmgr.c +4 -4
@@ -47,7 +47,7 @@ struct cld {int c_exit_code;pthread_t c_tid;ix_t c_streamix; -int (* c_entry)(void *arg1); +int (*c_entry)(void *arg1);void * c_arg1; };
@@ -73,7 +73,7 @@ cldmgr_init(void) }bool_t -cldmgr_create (int (* entry)(void *arg1), +cldmgr_create (int (*entry)(void *arg1),ix_t streamix,char *descstr,void *arg1)
@@ -84,7 +84,7 @@ cldmgr_create(int (* entry)(void *arg1),assert (pthread_equal (pthread_self (), cldmgr_parenttid)); cldp =cldmgr_getcld (); -if (! cldp) { +if (!cldp) { mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_PROC, _( "cannot create %s thread for stream %u: " "too many child threads (max allowed is %d)\n"),
@@ -234,7 +234,7 @@ cldmgr_entry(void *arg1)"thread %lu created for stream %d\n" , tid, cldp->c_streamix); - cldp->c_exit_code = (* cldp->c_entry)(cldp->c_arg1); + cldp->c_exit_code = (*cldp->c_entry)(cldp->c_arg1);pthread_cleanup_pop (1 );
common/cldmgr.h +1 -1
@@ -29,7 +29,7 @@ extern bool_t cldmgr_init(void);/* cldmgr_create - creates a child thread. returns FALSE if trouble * encountered */ -extern bool_t cldmgr_create (int (* entry)(void *arg1), +extern bool_t cldmgr_create (int (*entry)(void *arg1),ix_t streamix,char *descstr,void *arg1);
common/cleanup.c +6 -6
@@ -22,7 +22,7 @@#include "cleanup.h" struct cu { -void (* cu_funcp)(void *arg1,void *arg2); +void (*cu_funcp)(void *arg1,void *arg2);void *cu_arg1;void *cu_arg2;int cu_flags;
@@ -45,7 +45,7 @@ cleanup_init(void) }static cleanup_t * -cleanup_register_base (void (* funcp)(void *arg1,void *arg2), +cleanup_register_base (void (*funcp)(void *arg1,void *arg2),void *arg1,void *arg2) {
@@ -64,7 +64,7 @@ cleanup_register_base(void (* funcp)(void *arg1, void *arg2), }cleanup_t * -cleanup_register (void (* funcp)(void *arg1,void *arg2), +cleanup_register (void (*funcp)(void *arg1,void *arg2),void *arg1,void *arg2) {
@@ -76,7 +76,7 @@ cleanup_register(void (* funcp)(void *arg1, void *arg2), }cleanup_t * -cleanup_register_early (void (* funcp)(void *arg1,void *arg2), +cleanup_register_early (void (*funcp)(void *arg1,void *arg2),void *arg1,void *arg2) {
@@ -118,7 +118,7 @@ cleanup(void) {while (cu_rootp) {cu_t *p = cu_rootp; - (* p->cu_funcp)(p->cu_arg1, p->cu_arg2); + (*p->cu_funcp)(p->cu_arg1, p->cu_arg2); cu_rootp = p->cu_nextp;free ((void *)p); }
@@ -136,7 +136,7 @@ cleanup_early(void)cu_t *cunextp = cuptr->cu_nextp;if (cuptr->cu_flags &CU_EARLY ) { - (* cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2); + (*cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2);free ((void *)cuptr);if (cuprevp) { cuprevp->cu_nextp = cunextp;
common/dlog.c +4 -4
@@ -90,7 +90,7 @@ dlog_init(int argc, char *argv[])/* look to see if restore source coming in on * stdin. If so, try to open /dev/tty for dialogs. */ -if (optind < argc && !strcmp (argv[optind ],"-" )) { +if (optind < argc && !strcmp (argv[optind ],"-" )) { dlog_ttyfd =open ("/dev/tty" ,O_RDWR );if (dlog_ttyfd <0 ) {perror ("/dev/tty" );
@@ -251,7 +251,7 @@ dlog_multi_query(char *querystr[],long int val;char *end = buf; -if (!strlen (buf)) { +if (!strlen (buf)) {return defaultix; }
@@ -303,7 +303,7 @@ dlog_string_query(dlog_ucbp_t ucb, /* user's print func *//* call the caller's callback with his context, print context, and * print operator */ - (* ucb)(uctxp, dlog_string_query_print,0 ); + (*ucb)(uctxp, dlog_string_query_print,0 );/* if called for, print the timeout and a newline. * if not, print just a newline
@@ -362,7 +362,7 @@ dlog_string_query_print(void *ctxp, char *fmt, ...) {va_list args; -assert (! ctxp); +assert (!ctxp);va_start (args, fmt);mlog_va (MLOG_NORMAL |MLOG_NOLOCK |MLOG_BARE , fmt, args);
common/dlog.h +2 -2
@@ -78,8 +78,8 @@ extern void dlog_multi_ack(char *ackstr[], size_t ackcnt);* received, sigquitix if SIGQUIT received. if any of the exception indices * are set to IXMAX by the caller, those events will be ignored. */ -typedef void (*dlog_pcbp_t )(void *pctxp,char *s, ...); -typedef void (*dlog_ucbp_t )(void *uctxp,dlog_pcbp_t pcb,void *pctxp); +typedef void (*dlog_pcbp_t )(void *pctxp,char *s, ...); +typedef void (*dlog_ucbp_t )(void *uctxp,dlog_pcbp_t pcb,void *pctxp); extern ix_t dlog_string_query(dlog_ucbp_t ucb, /* user's print func */ void *uctxp, /* user's context for above */ char *bufp, /* typed string returned in */
common/drive.c +15 -15
@@ -131,7 +131,7 @@ drive_init1(int argc, char *argv[])while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_DUMPDEST : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL ,_ ("-%c argument missing\n" ), c);
@@ -152,7 +152,7 @@ drive_init1(int argc, char *argv[])* a single dash ('-') with no option letter. This must appear * between all lettered arguments and the file system pathname. */ -if (optind < argc && !strcmp (argv[optind ],"-" )) { +if (optind < argc && !strcmp (argv[optind ],"-" )) {if (driveix >0 ) { mlog(MLOG_NORMAL,#ifdef DUMP
@@ -211,10 +211,10 @@ drive_init1(int argc, char *argv[])for (six =0 ; six < scnt; six++) {drive_strategy_t *sp = strategypp[six];int score; - score = (* sp->ds_match)(argc, + score = (*sp->ds_match)(argc, argv, drivep); -if (! bestsp || score > bestscore) { +if (!bestsp || score > bestscore) { bestsp = sp; bestscore = score; }
@@ -226,10 +226,10 @@ drive_init1(int argc, char *argv[])mlog (MLOG_VERBOSE ,_ ("using %s strategy\n" ), bestsp->ds_description); - ok = (* bestsp->ds_instantiate)(argc, + ok = (*bestsp->ds_instantiate)(argc, argv, drivep); -if (! ok) { +if (!ok) {return BOOL_FALSE ; } }
@@ -256,8 +256,8 @@ drive_init2(int argc,bool_t ok;drive_allochdrs (drivep, gwhdrtemplatep, driveix); - ok = (* drivep->d_opsp->do_init)(drivep); -if (! ok) { + ok = (*drivep->d_opsp->do_init)(drivep); +if (!ok) {return BOOL_FALSE ; } }
@@ -278,8 +278,8 @@ drive_init3(void)drive_t *drivep = drivepp[driveix];bool_t ok; - ok = (* drivep->d_opsp->do_sync)(drivep); -if (! ok) { + ok = (*drivep->d_opsp->do_sync)(drivep); +if (!ok) {return BOOL_FALSE ; } }
@@ -304,7 +304,7 @@ drive_mark_commit(drive_t *drivep, off64_t ncommitted) ; ) { drivep->d_markrecheadp = dmp->dm_nextp; - (* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_TRUE ); + (*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_TRUE ); dmp = drivep->d_markrecheadp; } }
@@ -324,7 +324,7 @@ drive_mark_discard(drive_t *drivep) ; drivep->d_markrecheadp = dmp->dm_nextp, dmp = dmp->dm_nextp) { - (* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_FALSE ); + (*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_FALSE ); } }
@@ -340,7 +340,7 @@ drive_display_metrics(void)drive_t *drivep = drivepp[driveix];drive_ops_t *dop = drivep->d_opsp;if (dop->do_display_metrics) { - (* dop->do_display_metrics)(drivep); + (*dop->do_display_metrics)(drivep); } } }
@@ -371,9 +371,9 @@ drive_alloc(char *pathname, ix_t driveix)/* set pipe flags */ -if (!strcmp (pathname,"stdio" )) { +if (!strcmp (pathname,"stdio" )) { drivep->d_isunnamedpipepr =BOOL_TRUE ; - }else if (!stat64 (pathname, &statbuf) + }else if (!stat64 (pathname, &statbuf) && (statbuf.st_mode &S_IFMT ) ==S_IFIFO ) { drivep->d_isnamedpipepr =BOOL_TRUE ;
common/drive.h +25 -25
188 lines not on this page · raw message
common/drive_minrmt.c +68 -68
486 lines not on this page · raw message
common/drive_scsitape.c +141 -142
1,017 lines not on this page · raw message
common/drive_simple.c +16 -16
@@ -195,7 +195,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)/* 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.
@@ -212,7 +212,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)/* 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 ; }
@@ -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 */
@@ -514,7 +514,7 @@ do_begin_read(drive_t *drivep)/* check the checksum */ -if (!global_hdr_checksum_check (tmphdr)) { +if (!global_hdr_checksum_check (tmphdr)) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_DRIVE ,_ ("media file header checksum error\n" ));free (tmphdr);
@@ -596,7 +596,7 @@ do_read(drive_t *drivep,/* assert protocol */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (wantedcnt >0 );/* pre-initialize reference return
@@ -724,7 +724,7 @@ do_get_mark(drive_t *drivep, drive_mark_t *markp)/* assert protocol */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +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
@@ -757,7 +757,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)/* assert protocol */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);/* calculate the current offset within the media file * of the next byte to be read
@@ -820,9 +820,9 @@ do_next_mark(drive_t *drivep)*/ assert (dcaps &DRIVE_CAP_NEXTMARK );assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp); -if (! mark) { +if (!mark) {return DRIVE_ERROR_EOF ; }
@@ -964,7 +964,7 @@ do_begin_write(drive_t *drivep) tmphdr->gh_hostname, tmphdr->gh_dumplabel); -if (!global_hdr_checksum_check (tmphdr)) { +if (!global_hdr_checksum_check (tmphdr)) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_DRIVE ,_ ("media file header checksum error\n" )); }
@@ -1008,7 +1008,7 @@ do_set_mark(drive_t *drivep,/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);/* calculate the mark offset
@@ -1155,7 +1155,7 @@ do_set_mark(drive_t *drivep,*/ if (contextp->dc_nextp == contextp->dc_buf) {assert (drivep->d_markrecheadp ==0 ); - (* cbfuncp)(cbcontextp, markrecp,BOOL_TRUE ); + (*cbfuncp)(cbcontextp, markrecp,BOOL_TRUE );return ; }else { markrecp->dm_cbfuncp = cbfuncp;
@@ -1191,7 +1191,7 @@ do_get_write_buf(drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp)/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_emptyp);assert (contextp->dc_ownedsz ==0 );
@@ -1250,7 +1250,7 @@ do_write(drive_t *drivep, char *bufp, size_t writesz)assert (contextp->dc_mode ==OM_WRITE );assert (contextp->dc_ownedp);assert (bufp == contextp->dc_ownedp); -assert (! contextp->dc_nextp); +assert (!contextp->dc_nextp);assert (contextp->dc_ownedp < contextp->dc_emptyp);assert (writesz == contextp->dc_ownedsz);
@@ -1315,7 +1315,7 @@ do_get_align_cnt(drive_t *drivep)/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_emptyp);
@@ -1349,7 +1349,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_emptyp);
common/fs.c +5 -5
@@ -339,16 +339,16 @@ fs_tab_lookup_blk(char *blks)struct stat64 statb;bool_t bok; -if (! tep->fte_blks) { +if (!tep->fte_blks) {continue ; } -if (!strcmp (tep->fte_blks, blks)) { +if (!strcmp (tep->fte_blks, blks)) {return tep; } - aok = !stat64 (blks, &stata); - bok = !stat64 (tep->fte_blks, &statb); + aok = !stat64 (blks, &stata); + bok = !stat64 (tep->fte_blks, &statb);if (aok && bok && stata.st_rdev == statb.st_rdev) {return tep; }
@@ -362,7 +362,7 @@ fs_tab_lookup_mnt(char *mnts)fs_tab_ent_t *tep;for (tep = fs_tabp; tep; tep = tep->fte_nextp) { -if (tep->fte_mnts && !strcmp (tep->fte_mnts, mnts)) { +if (tep->fte_mnts && !strcmp (tep->fte_mnts, mnts)) {return tep; } }
common/global.c +6 -6
@@ -114,7 +114,7 @@ global_hdr_alloc(int argc, char *argv[]) strerror(errno));return 0 ; } -if (!strlen (ghdrp->gh_hostname)) { +if (!strlen (ghdrp->gh_hostname)) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("hostname length is zero\n" ));return 0 ;
@@ -164,7 +164,7 @@ global_hdr_alloc(int argc, char *argv[])return 0 ; } -if (!uuid_parse (optarg, ghdrp->gh_dumpid)) { +if (!uuid_parse (optarg, ghdrp->gh_dumpid)) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument not a valid uuid\n" ), c);
@@ -208,14 +208,14 @@ global_hdr_alloc(int argc, char *argv[])/* if no dump label specified, no pipes in use, and dialogs * are allowed, prompt for one */ -if (! dumplabel &&dlog_allowed ()) { +if (!dumplabel &&dlog_allowed ()) { dumplabel =prompt_label (labelbuf,sizeof (labelbuf)); }#endif /* DUMP */ -if (! dumplabel || !strlen (dumplabel)) { +if (!dumplabel || !strlen (dumplabel)) {#ifdef DUMP -if (! pipeline) { +if (!pipeline) {mlog (MLOG_VERBOSE |MLOG_WARNING ,_ ("no session label specified\n" )); }
@@ -308,7 +308,7 @@ prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp) {/* query: ask for a dump label */ - (* pcb)(pctxp, + (*pcb)(pctxp,_ ("please enter label for this dump session" )); }
common/inventory.c +1 -1
@@ -241,7 +241,7 @@ inv_writesession_open(assert (tok !=INV_TOKEN_NULL );assert (sesid && fsid && mntpt && devpath); -if (! (tok->d_update_flag &FSTAB_UPDATED )) { +if (!(tok->d_update_flag &FSTAB_UPDATED )) {if (put_fstab_entry (fsid, mntpt, devpath) <0 ) {printf ("put_fstab_entry :(\n" );return INV_TOKEN_NULL ;
common/main.c +58 -58
453 lines not on this page · raw message
common/media.c +9 -9
@@ -113,7 +113,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)usage ();return 0 ; } -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL ,_ ("-%c argument missing\n" ), c);
@@ -128,7 +128,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)/* if no media label specified, synthesize one */ -if (! medialabel) { +if (!medialabel) {/* not useful mlog(MLOG_VERBOSE, _("WARNING: no media label specified\n"));
@@ -158,7 +158,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp) chosen_sp =0 ;for (id =0 ; spp < epp; spp++, id++) { (*spp)->ms_id = id; -if (! chosen_sp) { +if (!chosen_sp) {/* lend the media_t array to the strategy */ (*spp)->ms_mediap = mediapp;
@@ -169,12 +169,12 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp) mediap->m_strategyp = *spp; mediap->m_writehdrp->mh_strategyid = id; } -if ((* (*spp)->ms_match)(argc, argv, dsp)) { +if ((*(*spp)->ms_match)(argc, argv, dsp)) { chosen_sp = *spp; } } } -if (! chosen_sp) { +if (!chosen_sp) { mlog(MLOG_NORMAL,#ifdef DUMP _("no media strategy available for selected "
@@ -200,8 +200,8 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)/* initialize the strategy. this will cause each of the managers * to be initialized as well. if error, return 0. */ - ok = (* chosen_sp->ms_create)(chosen_sp, argc, argv); -if (! ok) { + ok = (*chosen_sp->ms_create)(chosen_sp, argc, argv); +if (!ok) {return 0 ; }
@@ -215,7 +215,7 @@ media_init(media_strategy_t *msp, int argc, char *argv[]) {bool_t ok; - ok = (* msp->ms_init)(msp, argc, argv); + ok = (*msp->ms_init)(msp, argc, argv);return ok; }
@@ -223,7 +223,7 @@ media_init(media_strategy_t *msp, int argc, char *argv[])void media_complete (media_strategy_t *msp) { - (* msp->ms_complete)(msp); + (*msp->ms_complete)(msp); }/* media_get_upper_hdrs - supply pointers to portion of media file headers
common/mlog.c +6 -6
@@ -188,7 +188,7 @@ mlog_init1(int argc, char *argv[])switch (c) {case GETOPT_VERBOSITY : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) { fprintf(stderr, _("%s: -%c argument missing\n"), progname,
@@ -216,7 +216,7 @@ mlog_init1(int argc, char *argv[]) < MLOG_SS_CNT + vsymcnt);if (suboptix <MLOG_SS_CNT ) { -if (! valstr) { +if (!valstr) { fprintf(stderr, _("%s: -%c subsystem " "subargument "
@@ -382,11 +382,11 @@ mlog_va(int levelarg, char *fmt, va_list args)return ; } -if (! (levelarg &MLOG_NOLOCK )) { +if (!(levelarg &MLOG_NOLOCK )) {mlog_lock (); } -if (! (levelarg &MLOG_BARE )) { +if (!(levelarg &MLOG_BARE )) {int streamix; streamix =stream_getix (pthread_self ());
@@ -455,7 +455,7 @@ mlog_va(int levelarg, char *fmt, va_list args)vfprintf (mlog_fp, fmt, args);fflush (mlog_fp); -if (! (levelarg &MLOG_NOLOCK )) { +if (!(levelarg &MLOG_NOLOCK )) {mlog_unlock (); } }
@@ -793,7 +793,7 @@ mlog_sym_lookup(char *sym)sizeof (mlog_sym) /sizeof (mlog_sym[0 ]);for (; p < ep; p++) { -if (!strcmp (sym, p->sym)) { +if (!strcmp (sym, p->sym)) {return p->level; } }
common/path.c +8 -8
@@ -60,7 +60,7 @@ path_diff(char *path, char *base)assert (*base =='/' );assert (*path =='/' ); -if (!path_beginswith (path, base)) { +if (!path_beginswith (path, base)) {return 0 ; }
@@ -85,10 +85,10 @@ path_diff(char *path, char *base)int path_beginswith (char *path,char *base) { -if (! base) { +if (!base) {return 0 ; } -return !strncmp (base, path,strlen (base)); +return !strncmp (base, path,strlen (base)); } char *
@@ -136,19 +136,19 @@ path_normalize(char *path)assert (path[0 ] =='/' );while ((pep =pem_next (pemp)) !=0 ) { -if (!strcmp (pep,"" )) { +if (!strcmp (pep,"" )) {free ((void *)pep);continue ; } -if (!strcmp (pep,"." )) { +if (!strcmp (pep,"." )) {free ((void *)pep);continue ; } -if (!strcmp (pep,".." )) { +if (!strcmp (pep,".." )) {int ok;free ((void *)pep); ok =pa_peel (pap); -if (! ok) { +if (!ok) {pa_free (pap);pem_free (pemp);return 0 ;
@@ -201,7 +201,7 @@ pem_next(pem_t *pemp)/* if end of string encountered, place next next at end of string */ -if (! nextnext) { +if (!nextnext) {for (nextnext = pemp->pem_next; *nextnext; nextnext++) ; }
common/qlock.c +4 -4
@@ -79,7 +79,7 @@ qlock_alloc(ix_t ord)/* verify the ordinal is not already taken, and mark as taken */ -assert (!QLOCK_ORDMAP_GET (qlock_ordalloced, ord)); +assert (!QLOCK_ORDMAP_GET (qlock_ordalloced, ord));QLOCK_ORDMAP_SET (qlock_ordalloced, ord);/* allocate lock memory
@@ -119,7 +119,7 @@ qlock_lock(qlockh_t qlockh) qlockp->ql_ord, thread_ordmap); } -assert (!QLOCK_ORDMAP_GET (thread_ordmap, qlockp->ql_ord)); +assert (!QLOCK_ORDMAP_GET (thread_ordmap, qlockp->ql_ord));/* assert that no locks with a lesser ordinal are held by this thread */
@@ -130,7 +130,7 @@ qlock_lock(qlockh_t qlockh) qlockp->ql_ord, thread_ordmap); } -assert (!QLOCK_ORDMAP_CHK (thread_ordmap, qlockp->ql_ord)); +assert (!QLOCK_ORDMAP_CHK (thread_ordmap, qlockp->ql_ord));/* acquire the lock */
@@ -160,7 +160,7 @@ qlock_unlock(qlockh_t qlockh)/* release the lock */ rval =pthread_mutex_unlock (&qlockp->ql_mutex); -assert (! rval); +assert (!rval); } qsemh_t
common/ring.c +4 -4
@@ -99,7 +99,7 @@ ring_create(size_t ringlen, msgp->rm_loc =RING_LOC_READY ; msgp->rm_bufp = (char *)memalign (PGSZ , bufsz); -if (! msgp->rm_bufp) { +if (!msgp->rm_bufp) { *rvalp =ENOMEM ;return 0 ; }
@@ -224,7 +224,7 @@ ring_reset(ring_t *ringp, ring_msg_t *msgp)/* if the client is not holding a message, get the next message */ if (ringp->r_client_cnt ==0 ) { -assert (! msgp); +assert (!msgp); msgp =ring_get (ringp);assert (msgp);assert (ringp->r_client_cnt ==1 );
@@ -433,7 +433,7 @@ ring_slave_entry(void *ringctxp) msgp->rm_stat =RING_STAT_IGNORE ;break ; } -if (! ringp->r_first_io_time) { +if (!ringp->r_first_io_time) { ringp->r_first_io_time =time (0 );assert (ringp->r_first_io_time); }
@@ -453,7 +453,7 @@ ring_slave_entry(void *ringctxp) msgp->rm_stat =RING_STAT_IGNORE ;break ; } -if (! ringp->r_first_io_time) { +if (!ringp->r_first_io_time) { ringp->r_first_io_time =time (0 );assert (ringp->r_first_io_time); }
common/ring.h +2 -2
@@ -168,8 +168,8 @@ extern ring_t *ring_create(size_t ringlen,size_t bufsz, bool_t pinpr, ix_t drive_index, - int (* readfunc)(void *clientctxp, char *bufp), - int (* writefunc)(void *clientctxp, char *bufp), + int (*readfunc)(void *clientctxp, char *bufp), + int (*writefunc)(void *clientctxp, char *bufp), void *clientctxp, int *rvalp);
common/stream.c +1 -1
@@ -253,7 +253,7 @@ stream_get_exit_status(pthread_t tid,lock (); p =stream_find (tid, states, nstates); -if (! p) goto unlock; +if (!p) goto unlock;if (state) *state = p->s_state;if (ix) *ix = p->s_ix;
common/util.c +11 -11
@@ -58,7 +58,7 @@ write_buf(char *bufp, }else { (void )memset ((void *)mbufp,0 , mbufsz); } - rval = (* write_funcp)(contextp, mbufp, mbufsz); + rval = (*write_funcp)(contextp, mbufp, mbufsz);if (rval) {return rval; }
@@ -86,7 +86,7 @@ read_buf(char *bufp, nread =0 ; *statp =0 ;while (bufsz) { - mbufp = (* read_funcp)(contextp, bufsz, &mbufsz, statp); + mbufp = (*read_funcp)(contextp, bufsz, &mbufsz, statp);if (*statp) {break ; }
@@ -97,7 +97,7 @@ read_buf(char *bufp, } bufsz -= mbufsz; nread += (int )mbufsz; - (* return_read_buf_funcp)(contextp, mbufp, mbufsz); + (*return_read_buf_funcp)(contextp, mbufp, mbufsz); }return nread;
@@ -202,15 +202,15 @@ bigstat_iter(jdm_fshandle_t *fshandlep, }if ((p->bs_mode &S_IFMT ) ==S_IFDIR ) { -if (! (selector &BIGSTAT_ITER_DIR )){ +if (!(selector &BIGSTAT_ITER_DIR )){continue ; } }else { -if (! (selector &BIGSTAT_ITER_NONDIR )){ +if (!(selector &BIGSTAT_ITER_NONDIR )){continue ; } } - rval = (* fp)(cb_arg1, fshandlep, fsfd, p); + rval = (*fp)(cb_arg1, fshandlep, fsfd, p);if (rval) { *statp = rval;return 0 ;
@@ -272,7 +272,7 @@ bigstat_one(int fsfd,#define INOGRPLEN 256 int inogrp_iter(int fsfd, - int (* fp)(void *arg1, + int (*fp)(void *arg1, int fsfd, xfs_inogrp_t *inogrp), void * arg1,
@@ -311,7 +311,7 @@ inogrp_iter(int fsfd,for (p = igrp, endp = igrp + inogrpcnt; p < endp; p++) {int rval; - rval = (* fp)(arg1, fsfd, p); + rval = (*fp)(arg1, fsfd, p);if (rval) { *statp = rval;free (igrp);
@@ -376,7 +376,7 @@ diriter(jdm_fshandle_t *fshandlep, statp->bs_ino, strerror(errno)); *cbrvalp =0 ; -if (! usrgdp) { +if (!usrgdp) {free ((void *)gdp); }return -1 ;
@@ -476,7 +476,7 @@ diriter(jdm_fshandle_t *fshandlep,/* invoke the callback */ - cbrval = (* cbfp)(arg1, + cbrval = (*cbfp)(arg1, fshandlep, fsfd, &statbuf,
@@ -495,7 +495,7 @@ diriter(jdm_fshandle_t *fshandlep, } (void )close (fd); -if (! usrgdp) { +if (!usrgdp) {free ((void *)gdp); }
common/util.h +4 -4
@@ -32,8 +32,8 @@* * if bufp is null, writes bufsz zeros. */ -typedef char * (*gwbfp_t )(void *contextp,size_t wantedsz,size_t *szp); -typedef int (*wfp_t )(void *contextp,char *bufp,size_t bufsz); +typedef char *(*gwbfp_t )(void *contextp,size_t wantedsz,size_t *szp); +typedef int (*wfp_t )(void *contextp,char *bufp,size_t bufsz); extern int write_buf(char *bufp, size_t bufsz,
@@ -57,7 +57,7 @@ extern int write_buf(char *bufp,* *statp will be zero. */ typedef char * (*rfp_t )(void *contextp,size_t wantedsz,size_t *szp,int *statp); -typedef void (*rrbfp_t )(void *contextp,char *bufp,size_t bufsz); +typedef void (*rrbfp_t )(void *contextp,char *bufp,size_t bufsz); extern int read_buf(char *bufp, size_t bufsz,
@@ -110,7 +110,7 @@ extern int bigstat_one(int fsfd, xfs_bstat_t *statp); extern int inogrp_iter(int fsfd, - int (* fp)(void *arg1, + int (*fp)(void *arg1, int fsfd, xfs_inogrp_t *inogrp), void * arg1,
dump/content.c +85 -85
81 lines not on this page · raw message
restore/content.c +218 -218
436 lines not on this page · raw message
restore/tree.c +131 -131
262 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.0
Part of the diff is not shown here. View the raw message.
Quoted 16 lines · Jan Tulak
Another case of different xfsdump style, spaces around * and ! operators. This style was used a lot through xfsdump:
(* foo_t)xxx
^ space
While the rest of XFS omits the space. Same for negations:
if (! foo)This patch changes all occurrences to comply with the rest of xfs/kernel coding style by removing the space. Unlike the previous patches, this one is not fully replicable by a script - I had to manually correct many cases of overzealous replacements in comments or strings. (Regular expressions are a too weak tool for these context-sensitive changes.)
Still, the script that did most of the job is here:
Quoted 7 lines
find . -name '*.[ch]' ! -type d -exec gawk -i inplace '{ $0 = gensub(/^([^"]*)\(\* /, "\\1(*", "g") # foo(* bar $0 = gensub(/\(\* ([^"]*)$/, "(*\\1", "g") # $0 = gensub(/^([^ *#]{2}[^"]*)! /, "\\1!", "g") # space after exclamation mark }; {print }' {} \;Signed-off-by Jan Tulak <[email protected]>
(starts reading it all, eventually resorts to skimming & spot-checking ...)
Looks good, thanks!
Quoted 16 lines · Jan Tulak
Another case of different xfsdump style, spaces around * and ! operators. This style was used a lot through xfsdump:
(* foo_t)xxx
^ space
While the rest of XFS omits the space. Same for negations:
if (! foo)This patch changes all occurrences to comply with the rest of xfs/kernel coding style by removing the space. Unlike the previous patches, this one is not fully replicable by a script - I had to manually correct many cases of overzealous replacements in comments or strings. (Regular expressions are a too weak tool for these context-sensitive changes.)
Still, the script that did most of the job is here:
Quoted 8 lines
find . -name '*.[ch]' ! -type d -exec gawk -i inplace '{ $0 = gensub(/^([^"]*)\(\* /, "\\1(*", "g") # foo(* bar $0 = gensub(/\(\* ([^"]*)$/, "(*\\1", "g") # $0 = gensub(/^([^ *#]{2}[^"]*)! /, "\\1!", "g") # space after exclamation mark }; {print }' {} \;Signed-off-by Jan Tulak <[email protected]>---
looks good.
Quoted 7,578 lines
common/cldmgr.c | 8 +- common/cldmgr.h | 2 +- common/cleanup.c | 12 +- common/dlog.c | 8 +- common/dlog.h | 4 +- common/drive.c | 30 +-- common/drive.h | 50 ++--- common/drive_minrmt.c | 136 ++++++------- common/drive_scsitape.c | 283 +++++++++++++------------- common/drive_simple.c | 32 +-- common/fs.c | 10 +- common/global.c | 12 +- common/inventory.c | 2 +- common/main.c | 116 +++++------ common/media.c | 18 +- common/mlog.c | 12 +- common/path.c | 16 +- common/qlock.c | 8 +- common/ring.c | 8 +- common/ring.h | 4 +- common/stream.c | 2 +- common/util.c | 22 +- common/util.h | 8 +- dump/content.c | 170 ++++++++-------- dump/inomap.c | 12 +- dump/var.c | 6 +- inventory/inv_api.c | 16 +- inventory/inv_fstab.c | 4 +- inventory/inv_idx.c | 1 - inventory/inv_mgr.c | 4 +- inventory/inv_oref.c | 10 +- inventory/inv_stobj.c | 16 +- inventory/testmain.c | 8 +- invutil/cmenu.h | 24 +-- invutil/invutil.c | 2 +- restore/bag.c | 10 +- restore/content.c | 436 ++++++++++++++++++++-------------------- restore/dirattr.c | 24 +-- restore/dirattr.h | 2 +- restore/inomap.c | 12 +- restore/inomap.h | 2 +- restore/namreg.c | 14 +- restore/node.c | 8 +- restore/tree.c | 262 ++++++++++++------------ restore/tree.h | 4 +- restore/win.c | 20 +- 46 files changed, 934 insertions(+), 936 deletions(-)common/cldmgr.c +4
-4@@ -47,7 +47,7 @@ struct cld {int c_exit_code;pthread_t c_tid;ix_t c_streamix; -int (* c_entry)(void *arg1); +int (*c_entry)(void *arg1);void * c_arg1; };@@ -73,7 +73,7 @@ cldmgr_init(void) }bool_t -cldmgr_create (int (* entry)(void *arg1), +cldmgr_create (int (*entry)(void *arg1),ix_t streamix,char *descstr,void *arg1)@@ -84,7 +84,7 @@ cldmgr_create(int (* entry)(void *arg1),assert (pthread_equal (pthread_self (), cldmgr_parenttid)); cldp =cldmgr_getcld (); -if (! cldp) { +if (!cldp) { mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_PROC, _( "cannot create %s thread for stream %u: " "too many child threads (max allowed is %d)\n"),@@ -234,7 +234,7 @@ cldmgr_entry(void *arg1)"thread %lu created for stream %d\n" , tid, cldp->c_streamix); - cldp->c_exit_code = (* cldp->c_entry)(cldp->c_arg1); + cldp->c_exit_code = (*cldp->c_entry)(cldp->c_arg1);pthread_cleanup_pop (1 );common/cldmgr.h +1
-1@@ -29,7 +29,7 @@ extern bool_t cldmgr_init(void);/* cldmgr_create - creates a child thread. returns FALSE if trouble * encountered */ -extern bool_t cldmgr_create (int (* entry)(void *arg1), +extern bool_t cldmgr_create (int (*entry)(void *arg1),ix_t streamix,char *descstr,void *arg1);common/cleanup.c +6
-6@@ -22,7 +22,7 @@#include "cleanup.h" struct cu { -void (* cu_funcp)(void *arg1,void *arg2); +void (*cu_funcp)(void *arg1,void *arg2);void *cu_arg1;void *cu_arg2;int cu_flags;@@ -45,7 +45,7 @@ cleanup_init(void) }static cleanup_t * -cleanup_register_base (void (* funcp)(void *arg1,void *arg2), +cleanup_register_base (void (*funcp)(void *arg1,void *arg2),void *arg1,void *arg2) {@@ -64,7 +64,7 @@ cleanup_register_base(void (* funcp)(void *arg1, void *arg2), }cleanup_t * -cleanup_register (void (* funcp)(void *arg1,void *arg2), +cleanup_register (void (*funcp)(void *arg1,void *arg2),void *arg1,void *arg2) {@@ -76,7 +76,7 @@ cleanup_register(void (* funcp)(void *arg1, void *arg2), }cleanup_t * -cleanup_register_early (void (* funcp)(void *arg1,void *arg2), +cleanup_register_early (void (*funcp)(void *arg1,void *arg2),void *arg1,void *arg2) {@@ -118,7 +118,7 @@ cleanup(void) {while (cu_rootp) {cu_t *p = cu_rootp; - (* p->cu_funcp)(p->cu_arg1, p->cu_arg2); + (*p->cu_funcp)(p->cu_arg1, p->cu_arg2); cu_rootp = p->cu_nextp;free ((void *)p); }@@ -136,7 +136,7 @@ cleanup_early(void)cu_t *cunextp = cuptr->cu_nextp;if (cuptr->cu_flags &CU_EARLY ) { - (* cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2); + (*cuptr->cu_funcp)(cuptr->cu_arg1, cuptr->cu_arg2);free ((void *)cuptr);if (cuprevp) { cuprevp->cu_nextp = cunextp;common/dlog.c +4
-4@@ -90,7 +90,7 @@ dlog_init(int argc, char *argv[])/* look to see if restore source coming in on * stdin. If so, try to open /dev/tty for dialogs. */ -if (optind < argc && !strcmp (argv[optind ],"-" )) { +if (optind < argc && !strcmp (argv[optind ],"-" )) { dlog_ttyfd =open ("/dev/tty" ,O_RDWR );if (dlog_ttyfd <0 ) {perror ("/dev/tty" );@@ -251,7 +251,7 @@ dlog_multi_query(char *querystr[],long int val;char *end = buf; -if (!strlen (buf)) { +if (!strlen (buf)) {return defaultix; }@@ -303,7 +303,7 @@ dlog_string_query(dlog_ucbp_t ucb, /* user's print func *//* call the caller's callback with his context, print context, and * print operator */ - (* ucb)(uctxp, dlog_string_query_print,0 ); + (*ucb)(uctxp, dlog_string_query_print,0 );/* if called for, print the timeout and a newline. * if not, print just a newline @@ -362,7 +362,7 @@ dlog_string_query_print(void *ctxp, char *fmt, ...) {va_list args; -assert (! ctxp); +assert (!ctxp);va_start (args, fmt);mlog_va (MLOG_NORMAL |MLOG_NOLOCK |MLOG_BARE , fmt, args);common/dlog.h +2
-2@@ -78,8 +78,8 @@ extern void dlog_multi_ack(char *ackstr[], size_t ackcnt);* received, sigquitix if SIGQUIT received. if any of the exception indices * are set to IXMAX by the caller, those events will be ignored. */ -typedef void (*dlog_pcbp_t )(void *pctxp,char *s, ...); -typedef void (*dlog_ucbp_t )(void *uctxp,dlog_pcbp_t pcb,void *pctxp); +typedef void (*dlog_pcbp_t )(void *pctxp,char *s, ...); +typedef void (*dlog_ucbp_t )(void *uctxp,dlog_pcbp_t pcb,void *pctxp); extern ix_t dlog_string_query(dlog_ucbp_t ucb, /* user's print func */ void *uctxp, /* user's context for above */ char *bufp, /* typed string returned in */common/drive.c +15
-15@@ -131,7 +131,7 @@ drive_init1(int argc, char *argv[])while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_DUMPDEST : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL ,_ ("-%c argument missing\n" ), c);@@ -152,7 +152,7 @@ drive_init1(int argc, char *argv[])* a single dash ('-') with no option letter. This must appear * between all lettered arguments and the file system pathname. */ -if (optind < argc && !strcmp (argv[optind ],"-" )) { +if (optind < argc && !strcmp (argv[optind ],"-" )) {if (driveix >0 ) { mlog(MLOG_NORMAL,#ifdef DUMP @@ -211,10 +211,10 @@ drive_init1(int argc, char *argv[])for (six =0 ; six < scnt; six++) {drive_strategy_t *sp = strategypp[six];int score; - score = (* sp->ds_match)(argc, + score = (*sp->ds_match)(argc, argv, drivep); -if (! bestsp || score > bestscore) { +if (!bestsp || score > bestscore) { bestsp = sp; bestscore = score; }@@ -226,10 +226,10 @@ drive_init1(int argc, char *argv[])mlog (MLOG_VERBOSE ,_ ("using %s strategy\n" ), bestsp->ds_description); - ok = (* bestsp->ds_instantiate)(argc, + ok = (*bestsp->ds_instantiate)(argc, argv, drivep); -if (! ok) { +if (!ok) {return BOOL_FALSE ; } }@@ -256,8 +256,8 @@ drive_init2(int argc,bool_t ok;drive_allochdrs (drivep, gwhdrtemplatep, driveix); - ok = (* drivep->d_opsp->do_init)(drivep); -if (! ok) { + ok = (*drivep->d_opsp->do_init)(drivep); +if (!ok) {return BOOL_FALSE ; } }@@ -278,8 +278,8 @@ drive_init3(void)drive_t *drivep = drivepp[driveix];bool_t ok; - ok = (* drivep->d_opsp->do_sync)(drivep); -if (! ok) { + ok = (*drivep->d_opsp->do_sync)(drivep); +if (!ok) {return BOOL_FALSE ; } }@@ -304,7 +304,7 @@ drive_mark_commit(drive_t *drivep, off64_t ncommitted) ; ) { drivep->d_markrecheadp = dmp->dm_nextp; - (* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_TRUE ); + (*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_TRUE ); dmp = drivep->d_markrecheadp; } }@@ -324,7 +324,7 @@ drive_mark_discard(drive_t *drivep) ; drivep->d_markrecheadp = dmp->dm_nextp, dmp = dmp->dm_nextp) { - (* dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_FALSE ); + (*dmp->dm_cbfuncp)(dmp->dm_cbcontextp, dmp,BOOL_FALSE ); } }@@ -340,7 +340,7 @@ drive_display_metrics(void)drive_t *drivep = drivepp[driveix];drive_ops_t *dop = drivep->d_opsp;if (dop->do_display_metrics) { - (* dop->do_display_metrics)(drivep); + (*dop->do_display_metrics)(drivep); } } }@@ -371,9 +371,9 @@ drive_alloc(char *pathname, ix_t driveix)/* set pipe flags */ -if (!strcmp (pathname,"stdio" )) { +if (!strcmp (pathname,"stdio" )) { drivep->d_isunnamedpipepr =BOOL_TRUE ; - }else if (!stat64 (pathname, &statbuf) + }else if (!stat64 (pathname, &statbuf) && (statbuf.st_mode &S_IFMT ) ==S_IFIFO ) { drivep->d_isnamedpipepr =BOOL_TRUE ;common/drive.h +25
-25@@ -138,13 +138,13 @@ struct drive_strategy {char *ds_description;/* a short char string describing strategy */ -int (* ds_match)(int argc, +int (*ds_match)(int argc,char *argv[],struct drive *drivep);/* returns degree of match. drivep has been pre-allocated * and initialized with generic info. */ -bool_t (* ds_instantiate)(int argc, +bool_t (*ds_instantiate)(int argc,char *argv[],struct drive *drivep);/* creates a drive manager instance, by filling in the @@ -186,7 +186,7 @@ typedef off64_t drive_mark_t;* was NOT committed. */ struct drive_markrec ;/* forward decl */ -typedef void (*drive_mcbfp_t )(void *context_t, +typedef void (*drive_mcbfp_t )(void *context_t,struct drive_markrec *markrecp,bool_t committed);@@ -257,17 +257,17 @@ struct drive {typedef struct drive drive_t ;struct drive_ops { -bool_t (* do_init)(drive_t *drivep); +bool_t (*do_init)(drive_t *drivep);/* initializes drive, and begins async * determination of media object presence * returns FALSE if session should be aborted. */ -bool_t (* do_sync)(drive_t *drivep); +bool_t (*do_sync)(drive_t *drivep);/* synchronizes with the activity kicked off * by do_init. returns FALSE if session should * be aborted. */ -int (* do_begin_read)(drive_t *drivep); +int (*do_begin_read)(drive_t *drivep);/* prepares the drive manager for reading. * if the media is positioned at BOM or just * after a file mark, current media file is @@ -306,7 +306,7 @@ struct drive_ops {* begin_read. if successful, caller MUST call * end_read prior to next begin_read. */ -char * (* do_read)(drive_t *drivep, +char *(*do_read)(drive_t *drivep,size_t wanted_bufsz,size_t *actual_bufszp,int *statp);@@ -341,7 +341,7 @@ struct drive_ops {* valid data (although the buffer size may * be zero!). */ -void (* do_return_read_buf)(drive_t *drivep, +void (*do_return_read_buf)(drive_t *drivep,char *bufp,size_t bufsz);/* returns the buffer obtained @@ -349,14 +349,14 @@ struct drive_ops {* the entire buffer must be returned * in one shot. */ -void (* do_get_mark)(drive_t *drivep, +void (*do_get_mark)(drive_t *drivep,drive_mark_t *drivemarkp);/* returns (by reference) a mark corresponding * to the next byte which will be read by a * call to do_read(). will be used in a later * session to seek to that position. */ -int (* do_seek_mark)(drive_t *drivep, +int (*do_seek_mark)(drive_t *drivep,drive_mark_t *drivemarkp);/* searches for the specified mark within the * current file. returns zero if the mark @@ -367,7 +367,7 @@ struct drive_ops {* CORRUPTION - encountered corrupt data; * DEVICE - device error; */ -int (* do_next_mark)(drive_t *drivep); +int (*do_next_mark)(drive_t *drivep);/* if d_capabilities has DRIVE_CAP_NEXTMARK set, * drive has the capability to * seek forward to the next mark. returns @@ -385,7 +385,7 @@ struct drive_ops {* will position the media at the next media * file. */ -int (* do_begin_write)(drive_t *drivep); +int (*do_begin_write)(drive_t *drivep);/* begins a write media file for writing. * asserts the media is positioned at BOM or * just after a file mark. write header will @@ -396,7 +396,7 @@ struct drive_ops {* DEVICE - device error; * CORE - driver error */ -void (* do_set_mark)(drive_t *drivep, +void (*do_set_mark)(drive_t *drivep,drive_mcbfp_t cbfuncp,void *cbcontextp,drive_markrec_t *markrecp);@@ -426,7 +426,7 @@ struct drive_ops {* last committed marked point in the write * stream. */ -char * (* do_get_write_buf)(drive_t *drivep, +char *(*do_get_write_buf)(drive_t *drivep,size_t wanted_bufsz,size_t *actual_bufszp);/* asks the drive manager for a buffer. @@ -443,7 +443,7 @@ struct drive_ops {* be larger or smaller than the wanted bufsz, * but will be at least 1 byte in length. */ -int (* do_write)(drive_t *drivep, +int (*do_write)(drive_t *drivep,char *bufp,size_t bufsz);/* asks the drive manager to write bufsz @@ -473,7 +473,7 @@ struct drive_ops {* instead, the caller must get another buffer * using do_get_write_buf(). */ -size_t (* do_get_align_cnt)(drive_t *drivep); +size_t (*do_get_align_cnt)(drive_t *drivep);/* used during writing. returns the number * of bytes which should be written to * page-align the next do_get_write_buf() @@ -481,7 +481,7 @@ struct drive_ops {* alignment will be maintained after the * initial alignment done using this info. */ -int (* do_end_write)(drive_t *drivep,off64_t *ncommittedp); +int (*do_end_write)(drive_t *drivep,off64_t *ncommittedp);/* terminates a media file write sequence. * flushes any buffered data not yet committed * to media, and calls callbacks for all marks @@ -502,7 +502,7 @@ struct drive_ops {* an error, do_end_write will not do any * I/O, and will return 0. */ -int (* do_fsf)(drive_t *drivep, +int (*do_fsf)(drive_t *drivep,int count,int *statp);/* if d_capabilities has DRIVE_CAP_FSF set, @@ -528,7 +528,7 @@ struct drive_ops {* behaves as if position is at most recent * file mark or BOT. */ -int (* do_bsf)(drive_t *drivep, +int (*do_bsf)(drive_t *drivep,int count,int *statp);/* if d_capabilities has DRIVE_CAP_BSF set, @@ -554,35 +554,35 @@ struct drive_ops {* BOM - hit beginning of recorded data; * DEVICE - device error; */ -int (* do_rewind)(drive_t *drivep); +int (*do_rewind)(drive_t *drivep);/* if d_capabilities has DRIVE_CAP_REWIND set, * drive has the capability to * position at beginning of recorded data * DEVICE - device error; */ -int (* do_erase)(drive_t *drivep); +int (*do_erase)(drive_t *drivep);/* if d_capabilities has DRIVE_CAP_ERASE set, * drive has the capability to * erase: all content of media object is * eradicated. * DEVICE - device error; */ -int (* do_eject_media)(drive_t *drivep); +int (*do_eject_media)(drive_t *drivep);/* if d_capabilities has DRIVE_CAP_EJECT set, * drive has capability * to eject media, and will do so when called. * DEVICE - device error; */ -int (* do_get_device_class)(drive_t *drivep); +int (*do_get_device_class)(drive_t *drivep);/* returns the media class of the device * (see below). */ -void (* do_display_metrics)(drive_t *drivep); +void (*do_display_metrics)(drive_t *drivep);/* use BARE mlog to print useful throughput * and performance info. set to NULL if * nothing to say. */ -void (* do_quit)(drive_t * drivep); +void (*do_quit)(drive_t *drivep);/* tells the drive manager to de-allocate * resources, INCLUDING the slave process. */ common/drive_minrmt.c +68
-68@@ -278,7 +278,7 @@ static void do_get_mark(drive_t *, drive_mark_t *);static void do_end_read (drive_t *);static int do_begin_write (drive_t *);static void do_set_mark (drive_t *,drive_mcbfp_t ,void *,drive_markrec_t *); -static char *do_get_write_buf (drive_t *,size_t ,size_t *); +static char *do_get_write_buf (drive_t *,size_t ,size_t *);static int do_write (drive_t *,char *,size_t );static size_t do_get_align_cnt (drive_t *);static int do_end_write (drive_t *,off64_t *);@@ -320,7 +320,7 @@ 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 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);@@ -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 ; }@@ -432,7 +432,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_BLOCKSIZE : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("-%c argument missing\n" ), c);@@ -479,7 +479,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)assert (sizeof (rec_hdr_t) ==sizeofmember (drive_hdr_t, dh_specific)); -assert (! (STAPE_MAX_RECSZ %PGSZ )); +assert (!(STAPE_MAX_RECSZ %PGSZ ));/* hook up the drive ops */ @@ -510,7 +510,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_RINGLEN : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("-%c argument missing\n" ), c);@@ -549,7 +549,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep) _("Overwrite command line option\n"));break ;case GETOPT_FILESZ : -if (! optarg || optarg [0 ] =='-' ) { +if (!optarg || optarg [0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("-%c argument missing\n" ), c);@@ -601,7 +601,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep) ring_write, (void *)drivep, &rval); -if (! contextp->dc_ringp) { +if (!contextp->dc_ringp) {if (rval ==ENOMEM ) { mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _("unable to allocate memory "@@ -727,7 +727,7 @@ do_begin_read(drive_t *drivep)*/ assert (drivep->d_capabilities &DRIVE_CAP_READ );assert (contextp->dc_mode ==OM_NONE ); -assert (! contextp->dc_recp); +assert (!contextp->dc_recp);/* get a record buffer to use during initialization. */ @@ -749,7 +749,7 @@ do_begin_read(drive_t *drivep)assert (contextp->dc_fd ==-1 ); rval =prepare_drive (drivep);if (rval) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); } contextp->dc_msgp =0 ;@@ -759,7 +759,7 @@ do_begin_read(drive_t *drivep) }else { rval =read_label (drivep);if (rval) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); } contextp->dc_msgp =0 ;@@ -773,7 +773,7 @@ do_begin_read(drive_t *drivep)/* 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);@@ -829,8 +829,8 @@ do_read(drive_t *drivep,/* assert protocol being followed */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (wantedcnt >0 );/* clear the return status field @@ -891,7 +891,7 @@ do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)/* assert protocol being followed */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_errorpr); +assert (!contextp->dc_errorpr);assert (contextp->dc_ownedp);assert (bufp == contextp->dc_ownedp);@@ -910,7 +910,7 @@ do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)*/ if (contextp->dc_nextp >= contextp->dc_dataendp) {assert (contextp->dc_nextp == contextp->dc_dataendp); -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) { contextp->dc_msgp->rm_op =RING_OP_READ ;Ring_put (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ;@@ -941,8 +941,8 @@ do_get_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_errorpr); +assert (!contextp->dc_ownedp);/* the mark is simply the offset into the media file of the * next byte to be read. @@ -982,8 +982,8 @@ 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_errorpr); +assert (!contextp->dc_ownedp);/* the desired mark is passed by reference, and is really just an @@ -1068,7 +1068,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp) currentoffset += (off64_t )actualcnt;assert (currentoffset == nextrecoffset);assert (wantedoffset >= currentoffset); -assert (! contextp->dc_recp); +assert (!contextp->dc_recp);assert (currentoffset == contextp->dc_reccnt * (off64_t )tape_recsz);@@ -1088,7 +1088,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)off64_t wantedreccnt;seekmode_t seekmode; -assert (! contextp->dc_recp); +assert (!contextp->dc_recp); wantedreccnt = wantedoffset / (off64_t )tape_recsz;if (contextp->dc_singlethreadedpr) { seekmode =SEEKMODE_RAW ;@@ -1105,7 +1105,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)if (seekmode ==SEEKMODE_BUF ) {ring_stat_t rs; -assert (! contextp->dc_msgp); +assert (!contextp->dc_msgp); contextp->dc_msgp =Ring_get (contextp->dc_ringp); rs = contextp->dc_msgp->rm_stat;@@ -1194,7 +1194,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)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 @@ -1211,7 +1211,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp) }assert (actualcnt == wantedcnt);do_return_read_buf (drivep, dummybufp, actualcnt); -assert (! contextp->dc_recp); +assert (!contextp->dc_recp); currentoffset += (off64_t )tape_recsz; assert(currentoffset ==@@ -1315,8 +1315,8 @@ 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_errorpr); +assert (!contextp->dc_ownedp);mlog (MLOG_DEBUG |MLOG_DRIVE ,"rmt drive op: next mark\n" );@@ -1354,7 +1354,7 @@ noerrorsearch: } } -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_put (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ;@@ -1374,7 +1374,7 @@ noerrorsearch: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) { +if (!contextp->dc_singlethreadedpr) {Ring_put (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ;@@ -1386,7 +1386,7 @@ noerrorsearch:return 0 ; resetring: -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -1464,7 +1464,7 @@ validatehdr: 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);@@ -1475,7 +1475,7 @@ validatehdr: alliswell: contextp->dc_nextp = contextp->dc_recp + (size_t )markoff; -assert (! (rechdrp->file_offset % (off64_t )tape_recsz)); +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;@@ -1558,7 +1558,7 @@ do_end_read(drive_t *drivep)/* assert protocol being followed */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +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, @@ -1567,7 +1567,7 @@ do_end_read(drive_t *drivep)*/ (void )fsf_and_verify (drivep); -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -1613,8 +1613,8 @@ do_begin_write(drive_t *drivep)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_NONE ); -assert (! drivep->d_markrecheadp); -assert (! contextp->dc_recp); +assert (!drivep->d_markrecheadp); +assert (!contextp->dc_recp);/* get pointers into global write header */ @@ -1641,13 +1641,13 @@ 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); +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); +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;@@ -1683,7 +1683,7 @@ do_begin_write(drive_t *drivep) rval =write_record (drivep, contextp->dc_recp,BOOL_TRUE ,BOOL_FALSE );if (rval) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =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 ;@@ -1740,8 +1740,8 @@ do_set_mark(drive_t *drivep,/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);@@ -1803,8 +1803,8 @@ do_get_write_buf(drive_t *drivep, size_t wantedcnt, size_t *actualcntp)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_recendp);@@ -1869,7 +1869,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); +assert (!contextp->dc_errorpr);assert (contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);@@ -1970,7 +1970,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)* the number of bytes to next alignment */ static size_t -do_get_align_cnt (drive_t * drivep) +do_get_align_cnt (drive_t *drivep) {char *next_alignment_point;intptr_t next_alignment_off;@@ -1984,8 +1984,8 @@ do_get_align_cnt(drive_t * drivep)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_recendp);@@ -2030,7 +2030,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);assert (contextp->dc_nextp >= contextp->dc_recp +STAPE_HDR_SZ );@@ -2045,7 +2045,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)* do commits, already done when error occured. */ if (contextp->dc_errorpr) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -2117,8 +2117,8 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp) }else { first_rec_w_err =-1L ; } -if (! contextp->dc_singlethreadedpr) { -while (! rval) { +if (!contextp->dc_singlethreadedpr) { +while (!rval) {assert (contextp->dc_msgp); contextp->dc_msgp->rm_op =RING_OP_TRACE ; Ring_put(contextp->dc_ringp,@@ -2147,7 +2147,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)/* the ring is now flushed. reset */ -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -2157,7 +2157,7 @@ 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 );@@ -2637,13 +2637,13 @@ validate_media_file_hdr(drive_t *drivep)/* check the checksum */ -if (!global_hdr_checksum_check (tmpgh)) { +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)) { +if (!tape_rec_checksum_check (contextp, contextp->dc_recp)) {mlog (MLOG_NORMAL |MLOG_DRIVE ,_ ("tape record checksum error\n" ));return DRIVE_ERROR_CORRUPTION ;@@ -2925,7 +2925,7 @@ tape_rec_checksum_set(drive_context_t *contextp, char *bufp)uint32_t *p;uint32_t accum; -if (! contextp->dc_recchksumpr) { +if (!contextp->dc_recchksumpr) {return ; }@@ -3096,7 +3096,7 @@ prepare_drive(drive_t *drivep)/* open the drive */ ok =Open (drivep); -if (! ok) { +if (!ok) {if (errno !=EBUSY ) {display_access_failed_message (drivep);return DRIVE_ERROR_DEVICE ;@@ -3121,7 +3121,7 @@ prepare_drive(drive_t *drivep)* mark separation and media file size. */ ok =get_tpcaps (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }@@ -3223,7 +3223,7 @@ prepare_drive(drive_t *drivep) "and try again\n");Close (drivep); ok =Open (drivep); -if (! ok) { +if (!ok) {display_access_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -3246,7 +3246,7 @@ prepare_drive(drive_t *drivep) "and try again\n");Close (drivep); ok =Open (drivep); -if (! ok) { +if (!ok) {display_access_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -3335,7 +3335,7 @@ checkhdr: } (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_FOREIGN ;@@ -3362,7 +3362,7 @@ largersize:_ ("assuming media is corrupt " "or contains non-xfsdump data\n")); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_FOREIGN ;@@ -3371,7 +3371,7 @@ largersize:*/ if (tape_recsz !=STAPE_MAX_RECSZ ) { tape_recsz =STAPE_MAX_RECSZ ; -if (! contextp->dc_isQICpr) { +if (!contextp->dc_isQICpr) { tape_blksz = tape_recsz;; } changedblkszpr =BOOL_TRUE ;@@ -3526,7 +3526,7 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)rec_hdr_t *rechdrp = &rechdr;rec_hdr_t *tmprh = (rec_hdr_t *)bufp; -if (!tape_rec_checksum_check (contextp, bufp)) { +if (!tape_rec_checksum_check (contextp, bufp)) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("record %lld corrupt: bad record checksum\n" ), contextp->dc_iocnt -1 );@@ -3703,7 +3703,7 @@ getrec(drive_t *drivep)drive_context_t *contextp; contextp = (drive_context_t *)drivep->d_contextp; -while (! contextp->dc_recp) { +while (!contextp->dc_recp) {rec_hdr_t *rechdrp;if (contextp->dc_singlethreadedpr) {int rval;@@ -3850,12 +3850,12 @@ display_ring_metrics(drive_t *drivep, int mlog_flags)char *bufszsfxp;if (tape_recsz ==STAPE_MIN_MAX_BLKSZ ) { -assert (! (STAPE_MIN_MAX_BLKSZ %0x400 )); +assert (!(STAPE_MIN_MAX_BLKSZ %0x400 ));sprintf (bufszbuf,"%u" ,STAPE_MIN_MAX_BLKSZ /0x400 );assert (strlen (bufszbuf) <sizeof (bufszbuf)); bufszsfxp =_ ("KB" ); }else if (tape_recsz ==STAPE_MAX_RECSZ ) { -assert (! (STAPE_MAX_RECSZ %0x100000 )); +assert (!(STAPE_MAX_RECSZ %0x100000 ));sprintf (bufszbuf,"%u" ,STAPE_MAX_RECSZ /0x100000 );assert (strlen (bufszbuf) <sizeof (bufszbuf)); bufszsfxp =_ ("MB" );common/drive_scsitape.c +141
-142@@ -370,7 +370,7 @@ 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 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);@@ -518,7 +518,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 ; }@@ -559,7 +559,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)assert (sizeof (rec_hdr_t) ==sizeofmember (drive_hdr_t, dh_specific)); -assert (! (STAPE_MAX_RECSZ %PGSZ )); +assert (!(STAPE_MAX_RECSZ %PGSZ ));/* hook up the drive ops */ @@ -592,7 +592,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep)while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_RINGLEN : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("-%c argument missing\n" ), c);@@ -625,7 +625,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep) contextp->dc_isQICpr =BOOL_TRUE ;break ;case GETOPT_BLOCKSIZE : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("-%c argument missing\n" ), c);@@ -638,7 +638,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep) contextp->dc_overwritepr =BOOL_TRUE ;break ;case GETOPT_FILESZ : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("-%c argument missing\n" ), c);@@ -691,7 +691,7 @@ ds_instantiate(int argc, char *argv[], drive_t *drivep) ring_write, (void *)drivep, &rval); -if (! contextp->dc_ringp) { +if (!contextp->dc_ringp) {if (rval ==ENOMEM ) { mlog(MLOG_NORMAL | MLOG_ERROR | MLOG_DRIVE, _("unable to allocate memory "@@ -840,7 +840,7 @@ do_begin_read(drive_t *drivep)*/ assert (drivep->d_capabilities &DRIVE_CAP_READ );assert (contextp->dc_mode ==OM_NONE ); -assert (! contextp->dc_recp); +assert (!contextp->dc_recp);/* get a record buffer to use during initialization. */ @@ -862,7 +862,7 @@ do_begin_read(drive_t *drivep)assert (contextp->dc_fd ==-1 ); rval =prepare_drive (drivep);if (rval) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); } contextp->dc_msgp =0 ;@@ -872,7 +872,7 @@ do_begin_read(drive_t *drivep) }else { rval =read_label (drivep);if (rval) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); } contextp->dc_msgp =0 ;@@ -886,7 +886,7 @@ do_begin_read(drive_t *drivep)/* 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);@@ -942,8 +942,8 @@ do_read(drive_t *drivep,/* assert protocol being followed */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (wantedcnt >0 );/* clear the return status field @@ -1004,7 +1004,7 @@ do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)/* assert protocol being followed */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_errorpr); +assert (!contextp->dc_errorpr);assert (contextp->dc_ownedp);assert (bufp == contextp->dc_ownedp);@@ -1023,7 +1023,7 @@ do_return_read_buf(drive_t *drivep, char *bufp, size_t retcnt)*/ if (contextp->dc_nextp >= contextp->dc_dataendp) {assert (contextp->dc_nextp == contextp->dc_dataendp); -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) { contextp->dc_msgp->rm_op =RING_OP_READ ;Ring_put (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ;@@ -1054,8 +1054,8 @@ do_get_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_errorpr); +assert (!contextp->dc_ownedp);/* the mark is simply the offset into the media file of the * next byte to be read. @@ -1095,8 +1095,8 @@ 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_errorpr); +assert (!contextp->dc_ownedp);/* the desired mark is passed by reference, and is really just an @@ -1181,7 +1181,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp) currentoffset += (off64_t )actualcnt;assert (currentoffset == nextrecoffset);assert (wantedoffset >= currentoffset); -assert (! contextp->dc_recp); +assert (!contextp->dc_recp);assert (currentoffset == contextp->dc_reccnt * (off64_t )tape_recsz);@@ -1201,7 +1201,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)off64_t wantedreccnt;seekmode_t seekmode; -assert (! contextp->dc_recp); +assert (!contextp->dc_recp); wantedreccnt = wantedoffset / (off64_t )tape_recsz;if (contextp->dc_singlethreadedpr) { seekmode =SEEKMODE_RAW ;@@ -1218,7 +1218,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)if (seekmode ==SEEKMODE_BUF ) {ring_stat_t rs; -assert (! contextp->dc_msgp); +assert (!contextp->dc_msgp); contextp->dc_msgp =Ring_get (contextp->dc_ringp); rs = contextp->dc_msgp->rm_stat;@@ -1307,7 +1307,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)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 @@ -1324,7 +1324,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp) }assert (actualcnt == wantedcnt);do_return_read_buf (drivep, dummybufp, actualcnt); -assert (! contextp->dc_recp); +assert (!contextp->dc_recp); currentoffset += (off64_t )tape_recsz; assert(currentoffset ==@@ -1430,8 +1430,8 @@ 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_errorpr); +assert (!contextp->dc_ownedp);mlog (MLOG_DEBUG |MLOG_DRIVE ,"drive op: next mark\n" );@@ -1469,7 +1469,7 @@ noerrorsearch: } } -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_put (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ;@@ -1489,7 +1489,7 @@ noerrorsearch: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) { +if (!contextp->dc_singlethreadedpr) {Ring_put (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ;@@ -1501,7 +1501,7 @@ noerrorsearch:return 0 ; resetring: -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -1535,7 +1535,7 @@ validateread: goto validatehdr; } ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -1608,7 +1608,7 @@ validatehdr: 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);@@ -1619,7 +1619,7 @@ validatehdr: alliswell: contextp->dc_nextp = contextp->dc_recp + (size_t )markoff; -assert (! (rechdrp->file_offset % (off64_t )tape_recsz)); +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;@@ -1701,9 +1701,9 @@ do_end_read(drive_t *drivep)/* assert protocol being followed */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp); -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -1750,8 +1750,8 @@ do_begin_write(drive_t *drivep)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_NONE ); -assert (! drivep->d_markrecheadp); -assert (! contextp->dc_recp); +assert (!drivep->d_markrecheadp); +assert (!contextp->dc_recp);/* get pointers into global write header */ @@ -1766,7 +1766,7 @@ do_begin_write(drive_t *drivep)/* get tape device status. verify tape is positioned */ -if (!mt_get_status (drivep, &mtstat)) { +if (!mt_get_status (drivep, &mtstat)) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -1791,13 +1791,13 @@ 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); +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); +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;@@ -1833,7 +1833,7 @@ do_begin_write(drive_t *drivep) rval =write_record (drivep, contextp->dc_recp,BOOL_TRUE ,BOOL_FALSE );if (rval) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =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 ;@@ -1890,8 +1890,8 @@ do_set_mark(drive_t *drivep,/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);@@ -1953,8 +1953,8 @@ do_get_write_buf(drive_t *drivep, size_t wantedcnt, size_t *actualcntp)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_recendp);@@ -2019,7 +2019,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); +assert (!contextp->dc_errorpr);assert (contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);@@ -2120,7 +2120,7 @@ do_write(drive_t *drivep, char *bufp, size_t retcnt)* the number of bytes to next alignment */ static size_t -do_get_align_cnt (drive_t * drivep) +do_get_align_cnt (drive_t *drivep) {char *next_alignment_point;intptr_t next_alignment_off;@@ -2134,8 +2134,8 @@ do_get_align_cnt(drive_t * drivep)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_errorpr); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_errorpr); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_recendp);@@ -2180,7 +2180,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)/* verify protocol being followed */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_recp);assert (contextp->dc_nextp);assert (contextp->dc_nextp >= contextp->dc_recp +STAPE_HDR_SZ );@@ -2195,7 +2195,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)* do commits, already done when error occured. */ if (contextp->dc_errorpr) { -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -2267,8 +2267,8 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp) }else { first_rec_w_err =-1L ; } -if (! contextp->dc_singlethreadedpr) { -while (! rval) { +if (!contextp->dc_singlethreadedpr) { +while (!rval) {assert (contextp->dc_msgp); contextp->dc_msgp->rm_op =RING_OP_TRACE ; Ring_put(contextp->dc_ringp,@@ -2297,7 +2297,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)/* the ring is now flushed. reset */ -if (! contextp->dc_singlethreadedpr) { +if (!contextp->dc_singlethreadedpr) {Ring_reset (contextp->dc_ringp, contextp->dc_msgp); contextp->dc_msgp =0 ; }@@ -2307,15 +2307,15 @@ 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) { +if (!weofrval) { ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep); mtstat =0 ; rval =DRIVE_ERROR_DEVICE ;@@ -2397,7 +2397,7 @@ do_fsf(drive_t *drivep, int count, int *statp)/* get tape status */ -if (!mt_get_status (drivep, &mtstat)) { +if (!mt_get_status (drivep, &mtstat)) {status_failed_message (drivep); *statp =DRIVE_ERROR_DEVICE ;return 0 ;@@ -2435,7 +2435,7 @@ do_fsf(drive_t *drivep, int count, int *statp) op_failed =1 ; } -if (!mt_get_status (drivep, &mtstat)) { +if (!mt_get_status (drivep, &mtstat)) {status_failed_message (drivep); *statp =DRIVE_ERROR_DEVICE ;return i;@@ -2497,7 +2497,7 @@ do_bsf(drive_t *drivep, int count, int *statp)/* get tape status */ -if (!mt_get_status (drivep, &mtstat)) { +if (!mt_get_status (drivep, &mtstat)) {status_failed_message (drivep); *statp =DRIVE_ERROR_DEVICE ;return 0 ;@@ -2509,12 +2509,12 @@ do_bsf(drive_t *drivep, int count, int *statp)mlog (MLOG_DEBUG |MLOG_DRIVE ,"reopening drive while at BOT\n" );Close (drivep); -if (!Open (drivep)) { +if (!Open (drivep)) {display_access_failed_message (drivep); *statp =DRIVE_ERROR_DEVICE ;return 0 ; } -if (!mt_get_status (drivep, &mtstat)) { +if (!mt_get_status (drivep, &mtstat)) {status_failed_message (drivep); *statp =DRIVE_ERROR_DEVICE ;return 0 ;@@ -2551,7 +2551,7 @@ do_bsf(drive_t *drivep, int count, int *statp)* GMT_EOF to the right of the filemark !! */ if (TS_ISDRIVER ) { -if (!IS_FMK (mtstat)) { +if (!IS_FMK (mtstat)) { *statp =DRIVE_ERROR_DEVICE ;return 0 ; }@@ -2570,7 +2570,7 @@ do_bsf(drive_t *drivep, int count, int *statp)return skipped +1 ; }if (TS_ISDRIVER ) { -if (!IS_FMK (mtstat)) { +if (!IS_FMK (mtstat)) { *statp =DRIVE_ERROR_DEVICE ;return 0 ; }@@ -2583,7 +2583,7 @@ do_bsf(drive_t *drivep, int count, int *statp)if (IS_EOT (mtstat)) { *statp =DRIVE_ERROR_EOM ; } -if (!IS_FMK (mtstat)) { +if (!IS_FMK (mtstat)) { *statp =DRIVE_ERROR_DEVICE ; }@@ -2616,7 +2616,7 @@ do_rewind(drive_t *drivep)/* use validating tape rewind util func */ mtstat =rewind_and_verify (drivep); -if (!IS_BOT (mtstat)) { +if (!IS_BOT (mtstat)) {return DRIVE_ERROR_DEVICE ; }else {return 0 ;@@ -2647,7 +2647,7 @@ do_erase(drive_t *drivep)/* use validating tape rewind util func */ mtstat =rewind_and_verify (drivep); -if (!IS_BOT (mtstat)) { +if (!IS_BOT (mtstat)) {return DRIVE_ERROR_DEVICE ; }@@ -2658,7 +2658,7 @@ do_erase(drive_t *drivep)/* rewind again */ mtstat =rewind_and_verify (drivep); -if (!IS_BOT (mtstat)) { +if (!IS_BOT (mtstat)) {return DRIVE_ERROR_DEVICE ; }@@ -2759,7 +2759,7 @@ do_quit(drive_t *drivep)ring_destroy (ringp); } - if (! contextp->dc_isvarpr + if (!contextp->dc_isvarpr && ! contextp->dc_isQICpr &&@@ -2848,11 +2848,11 @@ read_label(drive_t *drivep)/* if not at BOT or a file mark, advance to right of next file mark */ ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; } -if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) { +if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) { mtstat =fsf_and_verify (drivep); }@@ -2881,7 +2881,7 @@ read_label(drive_t *drivep)return DRIVE_ERROR_MEDIA ; } ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -2890,7 +2890,7 @@ read_label(drive_t *drivep)/* verify we are either at BOT or a file mark */ -if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) { +if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("file mark missing from tape\n" ));#ifdef DUMP @@ -2919,7 +2919,7 @@ read_label(drive_t *drivep)if (nread != (int )tape_recsz) {assert (nread < (int )tape_recsz); ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -3047,13 +3047,13 @@ validate_media_file_hdr(drive_t *drivep)/* check the checksum */ -if (!global_hdr_checksum_check (tmpgh)) { +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)) { +if (!tape_rec_checksum_check (contextp, contextp->dc_recp)) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"tape record checksum error\n" );return DRIVE_ERROR_CORRUPTION ;@@ -3158,7 +3158,7 @@ set_fixed_blksz(drive_t *drivep, size_t blksz)/* close and re-open */ Close (drivep); -if (!Open (drivep)) { +if (!Open (drivep)) {display_access_failed_message (drivep);return BOOL_FALSE ; }@@ -3178,7 +3178,7 @@ set_fixed_blksz(drive_t *drivep, size_t blksz)/* see if we were successful (can't look if RMT, so assume * it worked) */ -if (! contextp->dc_isrmtpr) { +if (!contextp->dc_isrmtpr) {bool_t ok; ok =mt_blkinfo (contextp->dc_fd, &mtinfo);if (! ok) {@@ -3237,7 +3237,7 @@ get_tpcaps(drive_t *drivep)struct mtblkinfo mtinfo;bool_t ok; ok =mt_blkinfo (contextp->dc_fd, &mtinfo); -if (! ok) { +if (!ok) {return BOOL_FALSE ; }@@ -3561,7 +3561,7 @@ determine_write_error(drive_t *drivep, int nwritten, int saved_errno)/* get tape device status */ -if (!mt_get_status (drivep, &mtstat)) { +if (!mt_get_status (drivep, &mtstat)) {status_failed_message (drivep); ret =DRIVE_ERROR_DEVICE ; }else if (IS_WPROT (mtstat) && (saved_errno ==EROFS )) {@@ -3617,7 +3617,7 @@ tape_rec_checksum_set(drive_context_t *contextp, char *bufp)uint32_t *p;uint32_t accum; -if (! contextp->dc_recchksumpr) { +if (!contextp->dc_recchksumpr) {return ; }@@ -3886,7 +3886,7 @@ retry:/* open the drive */ ok =Open (drivep); -if (! ok) { +if (!ok) {if (errno !=EBUSY ) {display_access_failed_message (drivep);return DRIVE_ERROR_DEVICE ;@@ -3907,7 +3907,7 @@ retry:*/ mtstat =0 ; ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -3977,7 +3977,7 @@ retry:* mark separation and media file size. */ ok =get_tpcaps (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }@@ -3998,7 +3998,7 @@ retry:"Overwrite option specified. " "Trying best blocksize\n"); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_OVERWRITE ;@@ -4017,7 +4017,7 @@ retry:* we will use tape motion. back up two file marks, because * typically we will be positioned after last file mark at EOD. */ -if (!IS_BOT (mtstat) &&IS_FMK (mtstat)) { +if (!IS_BOT (mtstat) &&IS_FMK (mtstat)) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"tape positioned at file mark, " "but do not know if before or after: "@@ -4077,13 +4077,13 @@ retry:/* if a fixed device, but not QIC, and possible to set the block * size, do so. */ -if (! contextp->dc_isvarpr +if (!contextp->dc_isvarpr && - ! contextp->dc_isQICpr + !contextp->dc_isQICpr && contextp->dc_cansetblkszpr) { ok =set_fixed_blksz (drivep, tape_blksz); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; } }@@ -4092,7 +4092,7 @@ retry:*/ mtstat =0 ; ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -4103,7 +4103,7 @@ retry:* so we must either bsf or rewind to eliminate the uncertainty. * if BSF is not supported, must rewind. */ -if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) { +if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"tape position unknown: searching backward " "for file mark or BOT\n" );@@ -4113,7 +4113,7 @@ retry: } mtstat =0 ; ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -4121,7 +4121,7 @@ retry:/* if we can't position the tape, call it a media error */ -if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) { +if (!IS_BOT (mtstat) && !IS_FMK (mtstat)) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("unable to backspace/rewind media\n" ));return DRIVE_ERROR_MEDIA ;@@ -4131,7 +4131,7 @@ retry:"tape positioned at BOT: " "doing redundant rewind\n"); mtstat =rewind_and_verify (drivep); -if (!IS_BOT (mtstat)) { +if (!IS_BOT (mtstat)) {return DRIVE_ERROR_DEVICE ; } }@@ -4198,7 +4198,7 @@ retry: "indicates blank tape: returning\n"); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_BLANK ;@@ -4216,7 +4216,7 @@ retry: "indicates blank tape: returning\n"); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_BLANK ;@@ -4226,7 +4226,7 @@ retry:*/ if (saved_errno ==ENOSPC && - ! wasatbotpr) { + !wasatbotpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"errno ENOSPC while not at BOT " "indicates EOD: retrying\n" );@@ -4245,7 +4245,7 @@ retry: "and try again\n");Close (drivep); ok =Open (drivep); -if (! ok) { +if (!ok) {display_access_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -4258,14 +4258,14 @@ retry:*/ mtstat =0 ; ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; } if (nread == 0 && - ! contextp->dc_isvarpr + !contextp->dc_isvarpr && IS_EOD(mtstat) &&@@ -4276,7 +4276,7 @@ retry: "indicates blank tape: returning\n"); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_BLANK ;@@ -4284,11 +4284,11 @@ retry:if (nread ==0 && - ! contextp->dc_isvarpr + !contextp->dc_isvarpr &&IS_EOD (mtstat) && - ! wasatbotpr) { + !wasatbotpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread == 0 and EOD while not at BOT on " "fixed blocksize drive "@@ -4302,11 +4302,11 @@ retry:if (nread ==0 && - ! contextp->dc_isvarpr + !contextp->dc_isvarpr &&IS_EOT (mtstat) && - ! wasatbotpr) { + !wasatbotpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread == 0 and EOT while not at BOT on " "fixed blocksize drive "@@ -4320,13 +4320,13 @@ retry:if (nread ==0 && - ! contextp->dc_isvarpr + !contextp->dc_isvarpr && - !IS_EOD (mtstat) + !IS_EOD (mtstat) && - !IS_FMK (mtstat) + !IS_FMK (mtstat) && - !IS_EOT (mtstat)) { + !IS_EOT (mtstat)) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread == 0 and not EOD, not EOT, " "and not at a file mark on fixed blocksize drive "@@ -4347,7 +4347,7 @@ retry: "indicates blank tape: returning\n"); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_BLANK ;@@ -4359,7 +4359,7 @@ retry: && IS_EOD(mtstat) && - ! wasatbotpr) { + !wasatbotpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread == 0 and EOD while not at BOT on " "variable blocksize drive "@@ -4377,7 +4377,7 @@ retry: && IS_EOT(mtstat) && - ! wasatbotpr) { + !wasatbotpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread == 0 and EOT while not at BOT on " "variable blocksize drive "@@ -4402,7 +4402,7 @@ retry: "indicates foreign tape: returning\n"); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_FOREIGN ;@@ -4412,11 +4412,11 @@ retry: && contextp->dc_isvarpr && - ! IS_EOD(mtstat) + !IS_EOD(mtstat) && - ! IS_FMK(mtstat) + !IS_FMK(mtstat) && - ! IS_EOT(mtstat)) { + !IS_EOT(mtstat)) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread > 0 and not EOD, not EOT, " "and not at a file mark on variable blocksize drive "@@ -4426,7 +4426,7 @@ retry:if (nread < (int )tape_recsz && - ! contextp->dc_isvarpr) { + !contextp->dc_isvarpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread less than selected record size on " "fixed blocksize drive "@@ -4436,7 +4436,7 @@ retry:if (nread == (int )tape_recsz && - ! contextp->dc_isvarpr) { + !contextp->dc_isvarpr) {mlog (MLOG_DEBUG |MLOG_DRIVE ,"nread == selected blocksize " "on fixed blocksize drive "@@ -4518,7 +4518,7 @@ checkhdr: } (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_FOREIGN ;@@ -4556,7 +4556,7 @@ newsize:mlog (MLOG_NORMAL |MLOG_DRIVE ,_ ("cannot determine tape block size " "after two tries\n" )); -if (! wasatbotpr) { +if (!wasatbotpr) {mlog (MLOG_NORMAL |MLOG_DRIVE ,_ ("will rewind and try again\n" )); (void )rewind_and_verify (drivep);@@ -4568,7 +4568,7 @@ newsize: "or contains non-xfsdump data\n")); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_FOREIGN ;@@ -4576,7 +4576,7 @@ newsize: }if (tape_recsz >STAPE_MIN_MAX_BLKSZ ) { tape_recsz =STAPE_MIN_MAX_BLKSZ ; -if (! contextp->dc_isQICpr) { +if (!contextp->dc_isQICpr) { tape_blksz = tape_recsz;; } changedblkszpr =BOOL_TRUE ;@@ -4595,7 +4595,7 @@ largersize:mlog (MLOG_NORMAL |MLOG_DRIVE ,_ ("cannot determine tape block size " "after two tries\n" )); -if (! wasatbotpr) { +if (!wasatbotpr) {mlog (MLOG_NORMAL |MLOG_DRIVE ,_ ("will rewind and try again\n" )); (void )rewind_and_verify (drivep);@@ -4607,7 +4607,7 @@ largersize: "or contains non-xfsdump data\n")); (void )rewind_and_verify (drivep); ok =set_best_blk_and_rec_sz (drivep); -if (! ok) { +if (!ok) {return DRIVE_ERROR_DEVICE ; }return DRIVE_ERROR_FOREIGN ;@@ -4617,7 +4617,7 @@ largersize:*/ if (tape_recsz !=STAPE_MAX_RECSZ ) { tape_recsz =STAPE_MAX_RECSZ ; -if (! contextp->dc_isQICpr) { +if (!contextp->dc_isQICpr) { tape_blksz = tape_recsz;; } changedblkszpr =BOOL_TRUE ;@@ -4777,7 +4777,7 @@ quick_backup(drive_t *drivep, drive_context_t *contextp, ix_t skipcnt)return 0 ; }if (TS_ISDRIVER ) { -if (!IS_FMK (mtstat)) { +if (!IS_FMK (mtstat)) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("unable to backspace tape: " "assuming media error\n" ));@@ -4805,7 +4805,7 @@ record_hdr_validate(drive_t *drivep, char *bufp, bool_t chkoffpr)rec_hdr_t *rechdrp = &rechdr;rec_hdr_t *tmprh = (rec_hdr_t *)bufp; -if (!tape_rec_checksum_check (contextp, bufp)) { +if (!tape_rec_checksum_check (contextp, bufp)) {mlog (MLOG_NORMAL |MLOG_WARNING |MLOG_DRIVE ,_ ("record %lld corrupt: bad record checksum\n" ), contextp->dc_iocnt -1 );@@ -4904,7 +4904,7 @@ read_record(drive_t *drivep, char *bufp)/* get drive status */ ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) {status_failed_message (drivep);return DRIVE_ERROR_DEVICE ; }@@ -4982,7 +4982,7 @@ getrec(drive_t *drivep)drive_context_t *contextp; contextp = (drive_context_t *)drivep->d_contextp; -while (! contextp->dc_recp) { +while (!contextp->dc_recp) {rec_hdr_t *rechdrp;if (contextp->dc_singlethreadedpr) {int rval;@@ -5129,17 +5129,17 @@ display_ring_metrics(drive_t *drivep, int mlog_flags)char *bufszsfxp;if (tape_recsz ==STAPE_MIN_MAX_BLKSZ ) { -assert (! (STAPE_MIN_MAX_BLKSZ %0x400 )); +assert (!(STAPE_MIN_MAX_BLKSZ %0x400 ));sprintf (bufszbuf,"%u" ,STAPE_MIN_MAX_BLKSZ /0x400 );assert (strlen (bufszbuf) <sizeof (bufszbuf)); bufszsfxp ="KB" ; }else if (tape_recsz ==STAPE_MAX_RECSZ ) { -assert (! (STAPE_MAX_RECSZ %0x100000 )); +assert (!(STAPE_MAX_RECSZ %0x100000 ));sprintf (bufszbuf,"%u" ,STAPE_MAX_RECSZ /0x100000 );assert (strlen (bufszbuf) <sizeof (bufszbuf)); bufszsfxp ="MB" ; }else if (tape_recsz ==STAPE_MAX_LINUX_RECSZ ) { -assert (! (STAPE_MAX_LINUX_RECSZ %0x100000 )); +assert (!(STAPE_MAX_LINUX_RECSZ %0x100000 ));sprintf (bufszbuf,"%u" ,STAPE_MAX_LINUX_RECSZ /0x100000 );assert (strlen (bufszbuf) <sizeof (bufszbuf)); bufszsfxp ="MB" ;@@ -5184,7 +5184,7 @@ rewind_and_verify(drive_t *drivep) rval =mt_op (contextp->dc_fd,MTREW ,0 ); } ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) { mtstat =0 ;status_failed_message (drivep);if (try >1 ) {@@ -5214,7 +5214,7 @@ erase_and_verify(drive_t *drivep) (void )mt_op (contextp->dc_fd,MTERASE ,0 ); ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) { mtstat =0 ;status_failed_message (drivep); }@@ -5235,7 +5235,7 @@ bsf_and_verify(drive_t *drivep)mtstat_t mtstat; ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) { mtstat =0 ;status_failed_message (drivep);if (try >1 ) {@@ -5265,7 +5265,7 @@ bsf_and_verify(drive_t *drivep)* set correctly otherwise. [TS:Oct/2000] */ ok =mt_get_fileno (drivep, &fileno); -if (! ok) { +if (!ok) {status_failed_message (drivep);return 0 ; }@@ -5279,7 +5279,7 @@ bsf_and_verify(drive_t *drivep) try =1 ; status: ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) { mtstat =0 ;status_failed_message (drivep);if (try >1 ) {@@ -5306,7 +5306,7 @@ fsf_and_verify(drive_t *drivep)bool_t ok; ok =mt_get_status (drivep, &mtstat); -if (! ok) { +if (!ok) { mtstat =0 ;status_failed_message (drivep);if (try >1 ) {@@ -5335,7 +5335,7 @@ calc_best_blk_and_rec_sz(drive_t *drivep) {drive_context_t *contextp = (drive_context_t *)drivep->d_contextp; -if (! contextp->dc_isrmtpr) { +if (!contextp->dc_isrmtpr) {if (cmdlineblksize >0 ) { tape_blksz = cmdlineblksize; }else {@@ -5361,14 +5361,14 @@ set_best_blk_and_rec_sz(drive_t *drivep)calc_best_blk_and_rec_sz (drivep); -if (! contextp->dc_isvarpr +if (!contextp->dc_isvarpr && ! contextp->dc_isQICpr && contextp->dc_cansetblkszpr) {bool_t ok; ok =set_fixed_blksz (drivep, tape_blksz); -if (! ok) { +if (!ok) {return BOOL_FALSE ; } }@@ -5460,4 +5460,3 @@ map_ts_status(struct mtget *mtstat, struct mtget_sgi mtstat_sgi) }return ; } -common/drive_simple.c +16
-16@@ -195,7 +195,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)/* 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. @@ -212,7 +212,7 @@ ds_match(int argc, char *argv[], drive_t *drivep)/* 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 ; }@@ -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 */ @@ -514,7 +514,7 @@ do_begin_read(drive_t *drivep)/* check the checksum */ -if (!global_hdr_checksum_check (tmphdr)) { +if (!global_hdr_checksum_check (tmphdr)) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_DRIVE ,_ ("media file header checksum error\n" ));free (tmphdr);@@ -596,7 +596,7 @@ do_read(drive_t *drivep,/* assert protocol */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (wantedcnt >0 );/* pre-initialize reference return @@ -724,7 +724,7 @@ do_get_mark(drive_t *drivep, drive_mark_t *markp)/* assert protocol */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +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 @@ -757,7 +757,7 @@ do_seek_mark(drive_t *drivep, drive_mark_t *markp)/* assert protocol */ assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);/* calculate the current offset within the media file * of the next byte to be read @@ -820,9 +820,9 @@ do_next_mark(drive_t *drivep)*/ assert (dcaps &DRIVE_CAP_NEXTMARK );assert (contextp->dc_mode ==OM_READ ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp); -if (! mark) { +if (!mark) {return DRIVE_ERROR_EOF ; }@@ -964,7 +964,7 @@ do_begin_write(drive_t *drivep) tmphdr->gh_hostname, tmphdr->gh_dumplabel); -if (!global_hdr_checksum_check (tmphdr)) { +if (!global_hdr_checksum_check (tmphdr)) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_DRIVE ,_ ("media file header checksum error\n" )); }@@ -1008,7 +1008,7 @@ do_set_mark(drive_t *drivep,/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);/* calculate the mark offset @@ -1155,7 +1155,7 @@ do_set_mark(drive_t *drivep,*/ if (contextp->dc_nextp == contextp->dc_buf) {assert (drivep->d_markrecheadp ==0 ); - (* cbfuncp)(cbcontextp, markrecp,BOOL_TRUE ); + (*cbfuncp)(cbcontextp, markrecp,BOOL_TRUE );return ; }else { markrecp->dm_cbfuncp = cbfuncp;@@ -1191,7 +1191,7 @@ do_get_write_buf(drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp)/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_emptyp);assert (contextp->dc_ownedsz ==0 );@@ -1250,7 +1250,7 @@ do_write(drive_t *drivep, char *bufp, size_t writesz)assert (contextp->dc_mode ==OM_WRITE );assert (contextp->dc_ownedp);assert (bufp == contextp->dc_ownedp); -assert (! contextp->dc_nextp); +assert (!contextp->dc_nextp);assert (contextp->dc_ownedp < contextp->dc_emptyp);assert (writesz == contextp->dc_ownedsz);@@ -1315,7 +1315,7 @@ do_get_align_cnt(drive_t *drivep)/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_emptyp);@@ -1349,7 +1349,7 @@ do_end_write(drive_t *drivep, off64_t *ncommittedp)/* assert protocol */ assert (contextp->dc_mode ==OM_WRITE ); -assert (! contextp->dc_ownedp); +assert (!contextp->dc_ownedp);assert (contextp->dc_nextp);assert (contextp->dc_nextp < contextp->dc_emptyp);common/fs.c +5
-5@@ -339,16 +339,16 @@ fs_tab_lookup_blk(char *blks)struct stat64 statb;bool_t bok; -if (! tep->fte_blks) { +if (!tep->fte_blks) {continue ; } -if (!strcmp (tep->fte_blks, blks)) { +if (!strcmp (tep->fte_blks, blks)) {return tep; } - aok = !stat64 (blks, &stata); - bok = !stat64 (tep->fte_blks, &statb); + aok = !stat64 (blks, &stata); + bok = !stat64 (tep->fte_blks, &statb);if (aok && bok && stata.st_rdev == statb.st_rdev) {return tep; }@@ -362,7 +362,7 @@ fs_tab_lookup_mnt(char *mnts)fs_tab_ent_t *tep;for (tep = fs_tabp; tep; tep = tep->fte_nextp) { -if (tep->fte_mnts && !strcmp (tep->fte_mnts, mnts)) { +if (tep->fte_mnts && !strcmp (tep->fte_mnts, mnts)) {return tep; } }common/global.c +6
-6@@ -114,7 +114,7 @@ global_hdr_alloc(int argc, char *argv[]) strerror(errno));return 0 ; } -if (!strlen (ghdrp->gh_hostname)) { +if (!strlen (ghdrp->gh_hostname)) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("hostname length is zero\n" ));return 0 ;@@ -164,7 +164,7 @@ global_hdr_alloc(int argc, char *argv[])return 0 ; } -if (!uuid_parse (optarg, ghdrp->gh_dumpid)) { +if (!uuid_parse (optarg, ghdrp->gh_dumpid)) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument not a valid uuid\n" ), c);@@ -208,14 +208,14 @@ global_hdr_alloc(int argc, char *argv[])/* if no dump label specified, no pipes in use, and dialogs * are allowed, prompt for one */ -if (! dumplabel &&dlog_allowed ()) { +if (!dumplabel &&dlog_allowed ()) { dumplabel =prompt_label (labelbuf,sizeof (labelbuf)); }#endif /* DUMP */ -if (! dumplabel || !strlen (dumplabel)) { +if (!dumplabel || !strlen (dumplabel)) {#ifdef DUMP -if (! pipeline) { +if (!pipeline) {mlog (MLOG_VERBOSE |MLOG_WARNING ,_ ("no session label specified\n" )); }@@ -308,7 +308,7 @@ prompt_label_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp) {/* query: ask for a dump label */ - (* pcb)(pctxp, + (*pcb)(pctxp,_ ("please enter label for this dump session" )); }common/inventory.c +1
-1@@ -241,7 +241,7 @@ inv_writesession_open(assert (tok !=INV_TOKEN_NULL );assert (sesid && fsid && mntpt && devpath); -if (! (tok->d_update_flag &FSTAB_UPDATED )) { +if (!(tok->d_update_flag &FSTAB_UPDATED )) {if (put_fstab_entry (fsid, mntpt, devpath) <0 ) {printf ("put_fstab_entry :(\n" );return INV_TOKEN_NULL ;common/main.c +58
-58@@ -201,14 +201,14 @@ main(int argc, char *argv[])* if found, create a new argv. */ ok =loadoptfile (&argc, &argv); -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_OPT ); }/* initialize message logging (stage 1) */ ok =mlog_init1 (argc, argv); -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }/* scan the command line for the info, progress @@ -223,7 +223,7 @@ main(int argc, char *argv[])while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_MINSTACKSZ : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_NOLOCK ,_ ("-%c argument missing\n" ), c);@@ -245,7 +245,7 @@ main(int argc, char *argv[]) minstacksz = tmpstacksz;break ;case GETOPT_MAXSTACKSZ : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_NOLOCK ,_ ("-%c argument missing\n" ), c);@@ -271,7 +271,7 @@ main(int argc, char *argv[])mlog_exit_hint (RV_USAGE );break ;case GETOPT_PROGRESS : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_NOLOCK ,_ ("-%c argument missing\n" ), c);@@ -333,14 +333,14 @@ main(int argc, char *argv[])*/ ok =set_rlimits (&vmsz);#endif /* RESTORE */ -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }/* initialize message logging (stage 2) - allocate the message lock */ ok =mlog_init2 (); -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }@@ -385,7 +385,7 @@ main(int argc, char *argv[])* core, if necessary. some tmp files may be placed here as well. */ homedir =getcwd (0 ,MAXPATHLEN ); -if (! homedir) { +if (!homedir) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("unable to determine current directory: %s\n" ),strerror (errno));@@ -395,7 +395,7 @@ main(int argc, char *argv[])/* sanity check the inventory database directory, setup global paths */ ok =inv_setup_base (); -if (! ok) { +if (!ok) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_NOLOCK ,_ ("both /var/lib/xfsdump and /var/xfsdump exist - fatal\n" ));return mlog_exit (EXIT_ERROR ,RV_INIT );@@ -413,7 +413,7 @@ main(int argc, char *argv[])/* if an inventory display is requested, do it and exit */ -if (!inv_DEBUG_print (argc, argv)) { +if (!inv_DEBUG_print (argc, argv)) {return mlog_exit (EXIT_NORMAL ,RV_OK );/* normal termination */ }@@ -436,14 +436,14 @@ main(int argc, char *argv[])/* initialize operator dialog capability */ ok =dlog_init (argc, argv); -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }/* initialize the child process manager */ ok =cldmgr_init (); -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }@@ -453,7 +453,7 @@ main(int argc, char *argv[])* will be done shortly. */ ok =drive_init1 (argc, argv); -if (! ok) { +if (!ok) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }@@ -480,7 +480,7 @@ main(int argc, char *argv[])mlog (MLOG_VERBOSE ,_ ("version %s (dump format %d.0)" ),VERSION ,GLOBAL_HDR_VERSION ); -if (! pipeline && ! stdoutpiped && sistr &&dlog_allowed ()) { +if (!pipeline && !stdoutpiped && sistr &&dlog_allowed ()) { mlog(MLOG_VERBOSE | MLOG_BARE, _( " - " "type %s for status and control\n"),@@ -494,7 +494,7 @@ main(int argc, char *argv[])/* build a global write header template */ gwhdrtemplatep =global_hdr_alloc (argc, argv); -if (! gwhdrtemplatep) { +if (!gwhdrtemplatep) {return mlog_exit (EXIT_ERROR ,RV_INIT ); }#endif /* DUMP */ @@ -526,7 +526,7 @@ main(int argc, char *argv[]) sa.sa_handler =SIG_IGN ;sigaction (SIGPIPE , &sa,NULL ); -if (! pipeline) { +if (!pipeline) {sigset_t blocked_set; stop_in_progress =BOOL_FALSE ;@@ -565,7 +565,7 @@ main(int argc, char *argv[])#ifdef RESTORE ok =content_init (argc, argv, vmsz /VMSZ_PER );#endif /* RESTORE */ -if (! ok) { +if (!ok) { err =mlog_exit (EXIT_ERROR ,RV_INIT ); goto err_free; }@@ -591,12 +591,12 @@ main(int argc, char *argv[]) argv, (global_hdr_t *)0);#endif /* RESTORE */ -if (! ok) { +if (!ok) { err =mlog_exit (EXIT_ERROR ,RV_INIT ); goto err_free; } ok =drive_init3 (); -if (! ok) { +if (!ok) { err =mlog_exit (EXIT_ERROR ,RV_INIT ); goto err_free; }@@ -630,7 +630,7 @@ main(int argc, char *argv[])* asynchronously read the media file header, typically a very * time-consuming chore. drive_init3 will synchronize with each slave. */ -if (! init_error) { +if (!init_error) {#ifdef DUMP ok = drive_init2(argc, argv,@@ -641,13 +641,13 @@ main(int argc, char *argv[]) argv, (global_hdr_t *)0);#endif /* RESTORE */ -if (! ok) { +if (!ok) { init_error =BOOL_TRUE ; } } -if (! init_error) { +if (!init_error) { ok =drive_init3 (); -if (! ok) { +if (!ok) { init_error =BOOL_TRUE ; } }@@ -655,13 +655,13 @@ main(int argc, char *argv[])/* create a child thread for each stream. drivecnt global from * drive.h, initialized by drive_init[12] */ -if (! init_error) { +if (!init_error) {for (stix =0 ; stix < drivecnt; stix++) { ok =cldmgr_create (childmain, stix,"child" , (void *)stix); -if (! ok) { +if (!ok) { init_error =BOOL_TRUE ; } }@@ -800,7 +800,7 @@ main(int argc, char *argv[])/* see if need to initiate a stop */ -if (stop_requested && ! stop_in_progress) { +if (stop_requested && !stop_in_progress) {mlog (MLOG_NORMAL ,_ ("initiating session interrupt (timeout in %d sec)\n" ), stop_timeout);@@ -828,7 +828,7 @@ main(int argc, char *argv[]) } } -if (progrpt_enabledpr && ! stop_in_progress) { +if (progrpt_enabledpr && !stop_in_progress) {bool_t need_progrptpr =BOOL_FALSE ;while (now >= progrpt_deadline) { need_progrptpr =BOOL_TRUE ;@@ -1153,7 +1153,7 @@ loadoptfile(int *argcp, char ***argvp)while ((c =getopt (*argcp, *argvp,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_OPTFILE : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR |MLOG_NOLOCK ,_ ("-%c argument missing\n" ), c);@@ -1173,7 +1173,7 @@ loadoptfile(int *argcp, char ***argvp)break ; } } -if (! optfilename) { +if (!optfilename) {return BOOL_TRUE ; }@@ -1222,7 +1222,7 @@ loadoptfile(int *argcp, char ***argvp) i++;/* to skip option argument */ continue ; } - sz +=strlen ((* argvp)[i]) +1 ; + sz +=strlen ((*argvp)[i]) +1 ; }/* add in the size of the option file (plus one byte in case @@ -1240,7 +1240,7 @@ loadoptfile(int *argcp, char ***argvp) p = argbuf; i =0 ;sprintf (p,"%s " , ( * argvp)[ i]); - p +=strlen ((* argvp)[i]) +1 ; + p +=strlen ((*argvp)[i]) +1 ; i++;/* copy the options file into the buffer after the given args @@ -1267,7 +1267,7 @@ loadoptfile(int *argcp, char ***argvp)continue ; }sprintf (p,"%s " , ( * argvp)[ i]); - p +=strlen ((* argvp)[i]) +1 ; + p +=strlen ((*argvp)[i]) +1 ; }/* null-terminate the entire buffer @@ -1296,7 +1296,7 @@ loadoptfile(int *argcp, char ***argvp)/* done when NULL encountered */ -if (! *p) { +if (!*p) {break ; }@@ -1310,14 +1310,14 @@ loadoptfile(int *argcp, char ***argvp)/* if no more separators, all tokens seen */ -if (! p) { +if (!p) {break ; } }/* if no arguments, can return now */ -if (! tokencnt) { +if (!tokencnt) {close (fd);return BOOL_TRUE ; }@@ -1342,7 +1342,7 @@ loadoptfile(int *argcp, char ***argvp)/* done when NULL encountered */ -if (! *p) { +if (!*p) {break ; }@@ -1370,7 +1370,7 @@ loadoptfile(int *argcp, char ***argvp)/* if no more separators, all tokens seen */ -if (! endp) { +if (!endp) {break ; }@@ -1468,7 +1468,7 @@ childmain(void *arg1)/* let the drive manager shut down its slave thread */ drivep = drivepp[stix]; - (* drivep->d_opsp->do_quit)(drivep); + (*drivep->d_opsp->do_quit)(drivep);return exitcode; }@@ -1480,7 +1480,7 @@ prompt_prog_cb(void *uctxp, dlog_pcbp_t pcb, void *pctxp) {/* query: ask for a dump label */ - (* pcb)(pctxp, + (*pcb)(pctxp, progrpt_enabledpr ? _("please enter seconds between progress reports, "@@ -1565,7 +1565,7 @@ sigint_dialog(void) "the following operations\n");assert (querycnt <=QUERYMAX ); choicecnt =0 ; -if (! stop_in_progress) { +if (!stop_in_progress) { interruptix = choicecnt; choicestr[choicecnt++ ] =_ ("interrupt this session" ); }else {@@ -1906,7 +1906,7 @@ sigint_dialog(void)if (responseix == okix) {int newinterval; newinterval =atoi (buf); -if (!strlen (buf)) { +if (!strlen (buf)) { ackstr[ackcnt++ ] =_ ("no change\n" ); }else if (newinterval >0 ) {time32_t newdeadline;@@ -1953,21 +1953,21 @@ sigint_dialog(void) ackstr[ackcnt++ ] =_ ("no change\n" ); } }else if (responseix == mllevix) { - mlog_showlevel = ! mlog_showlevel; + mlog_showlevel = !mlog_showlevel;if (mlog_showlevel) { ackstr[ackcnt++ ] =_ ("showing log message levels\n" ); }else { ackstr[ackcnt++ ] =_ ("hiding log message levels\n" ); } }else if (responseix == mlssix) { - mlog_showss = ! mlog_showss; + mlog_showss = !mlog_showss;if (mlog_showss) { ackstr[ackcnt++ ] =_ ("showing log message subsystems\n" ); }else { ackstr[ackcnt++ ] =_ ("hiding log message subsystems\n" ); } }else if (responseix == mltsix) { - mlog_timestamp = ! mlog_timestamp; + mlog_timestamp = !mlog_timestamp;if (mlog_timestamp) { ackstr[ackcnt++ ] =_ ("showing log message timestamps\n" ); }else {@@ -2056,7 +2056,7 @@ set_rlimits(size64_t *vmszp) rval =getrlimit64 (RLIMIT_AS , &rlimit64); -assert (! rval); +assert (!rval); mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC, "RLIMIT_AS org cur 0x%llx max 0x%llx\n", rlimit64.rlim_cur,@@ -2066,7 +2066,7 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_cur = rlimit64.rlim_max; (void )setrlimit64 (RLIMIT_AS , &rlimit64); rval =getrlimit64 (RLIMIT_AS , &rlimit64); -assert (! rval); +assert (!rval); mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC, "RLIMIT_VMEM now cur 0x%llx max 0x%llx\n", rlimit64.rlim_cur,@@ -2078,7 +2078,7 @@ set_rlimits(size64_t *vmszp)assert (minstacksz <= maxstacksz); rval =getrlimit64 (RLIMIT_STACK , &rlimit64); -assert (! rval); +assert (!rval); mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC, "RLIMIT_STACK org cur 0x%llx max 0x%llx\n", rlimit64.rlim_cur,@@ -2098,7 +2098,7 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_max = minstacksz; (void )setrlimit64 (RLIMIT_STACK , &rlimit64); rval =getrlimit64 (RLIMIT_STACK , &rlimit64); -assert (! rval); +assert (!rval);if (rlimit64.rlim_cur < minstacksz) { mlog(MLOG_NORMAL |@@ -2125,7 +2125,7 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_cur = minstacksz; (void )setrlimit64 (RLIMIT_STACK , &rlimit64); rval =getrlimit64 (RLIMIT_STACK , &rlimit64); -assert (! rval); +assert (!rval);if (rlimit64.rlim_cur < minstacksz) { mlog(MLOG_NORMAL |@@ -2153,7 +2153,7 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_cur = maxstacksz; (void )setrlimit64 (RLIMIT_STACK , &rlimit64); rval =getrlimit64 (RLIMIT_STACK , &rlimit64); -assert (! rval); +assert (!rval);if (rlimit64.rlim_cur > maxstacksz) { mlog(MLOG_NORMAL |@@ -2174,14 +2174,14 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_max); rval =getrlimit64 (RLIMIT_DATA , &rlimit64); -assert (! rval); +assert (!rval);mlog (MLOG_NITTY |MLOG_NOLOCK |MLOG_PROC ,"RLIMIT_DATA org cur 0x%llx max 0x%llx\n" , rlimit64.rlim_cur, rlimit64.rlim_max); rval =getrlimit64 (RLIMIT_FSIZE , &rlimit64); -assert (! rval); +assert (!rval); mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC, "RLIMIT_FSIZE org cur 0x%llx max 0x%llx\n", rlimit64.rlim_cur,@@ -2191,14 +2191,14 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_cur =RLIM64_INFINITY ; (void )setrlimit64 (RLIMIT_FSIZE , &rlimit64); rval =getrlimit64 (RLIMIT_FSIZE , &rlimit64); -assert (! rval); +assert (!rval);mlog (MLOG_NITTY |MLOG_NOLOCK |MLOG_PROC ,"RLIMIT_FSIZE now cur 0x%llx max 0x%llx\n" , rlimit64.rlim_cur, rlimit64.rlim_max); rval =getrlimit64 (RLIMIT_CPU , &rlimit64); -assert (! rval); +assert (!rval); mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC, "RLIMIT_CPU cur 0x%llx max 0x%llx\n", rlimit64.rlim_cur,@@ -2206,7 +2206,7 @@ set_rlimits(size64_t *vmszp) rlimit64.rlim_cur = rlimit64.rlim_max; (void )setrlimit64 (RLIMIT_CPU , &rlimit64); rval =getrlimit64 (RLIMIT_CPU , &rlimit64); -assert (! rval); +assert (!rval); mlog(MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC, "RLIMIT_CPU now cur 0x%llx max 0x%llx\n", rlimit64.rlim_cur,@@ -2285,7 +2285,7 @@ strpbrkquotes(char *p, const char *sep) }if (*p =='\\' ) { -if (! prevcharwasbackslash) { +if (!prevcharwasbackslash) { prevcharwasbackslash =BOOL_TRUE ; }else { prevcharwasbackslash =BOOL_FALSE ;@@ -2306,7 +2306,7 @@ strpbrkquotes(char *p, const char *sep)continue ; } -if (! inquotes) { +if (!inquotes) {if (strchr (sep, (int )(*p))) {return p; }@@ -2338,7 +2338,7 @@ stripquotes(char *p) justremovedbackslash =BOOL_FALSE ;for (nextp = p; nextp < endp;) { -if (*nextp =='\\' && ! justremovedbackslash) { +if (*nextp =='\\' && !justremovedbackslash) {shiftleftby1 (nextp, endp); endp--; justremovedbackslash =BOOL_TRUE ;common/media.c +9
-9@@ -113,7 +113,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)usage ();return 0 ; } -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL ,_ ("-%c argument missing\n" ), c);@@ -128,7 +128,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)/* if no media label specified, synthesize one */ -if (! medialabel) { +if (!medialabel) {/* not useful mlog(MLOG_VERBOSE, _("WARNING: no media label specified\n")); @@ -158,7 +158,7 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp) chosen_sp =0 ;for (id =0 ; spp < epp; spp++, id++) { (*spp)->ms_id = id; -if (! chosen_sp) { +if (!chosen_sp) {/* lend the media_t array to the strategy */ (*spp)->ms_mediap = mediapp;@@ -169,12 +169,12 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp) mediap->m_strategyp = *spp; mediap->m_writehdrp->mh_strategyid = id; } -if ((* (*spp)->ms_match)(argc, argv, dsp)) { +if ((*(*spp)->ms_match)(argc, argv, dsp)) { chosen_sp = *spp; } } } -if (! chosen_sp) { +if (!chosen_sp) { mlog(MLOG_NORMAL,#ifdef DUMP _("no media strategy available for selected "@@ -200,8 +200,8 @@ media_create(int argc, char *argv[], drive_strategy_t *dsp)/* initialize the strategy. this will cause each of the managers * to be initialized as well. if error, return 0. */ - ok = (* chosen_sp->ms_create)(chosen_sp, argc, argv); -if (! ok) { + ok = (*chosen_sp->ms_create)(chosen_sp, argc, argv); +if (!ok) {return 0 ; }@@ -215,7 +215,7 @@ media_init(media_strategy_t *msp, int argc, char *argv[]) {bool_t ok; - ok = (* msp->ms_init)(msp, argc, argv); + ok = (*msp->ms_init)(msp, argc, argv);return ok; }@@ -223,7 +223,7 @@ media_init(media_strategy_t *msp, int argc, char *argv[])void media_complete (media_strategy_t *msp) { - (* msp->ms_complete)(msp); + (*msp->ms_complete)(msp); }/* media_get_upper_hdrs - supply pointers to portion of media file headers common/mlog.c +6
-6@@ -188,7 +188,7 @@ mlog_init1(int argc, char *argv[])switch (c) {case GETOPT_VERBOSITY : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) { fprintf(stderr, _("%s: -%c argument missing\n"), progname,@@ -216,7 +216,7 @@ mlog_init1(int argc, char *argv[]) < MLOG_SS_CNT + vsymcnt);if (suboptix <MLOG_SS_CNT ) { -if (! valstr) { +if (!valstr) { fprintf(stderr, _("%s: -%c subsystem " "subargument "@@ -382,11 +382,11 @@ mlog_va(int levelarg, char *fmt, va_list args)return ; } -if (! (levelarg &MLOG_NOLOCK )) { +if (!(levelarg &MLOG_NOLOCK )) {mlog_lock (); } -if (! (levelarg &MLOG_BARE )) { +if (!(levelarg &MLOG_BARE )) {int streamix; streamix =stream_getix (pthread_self ());@@ -455,7 +455,7 @@ mlog_va(int levelarg, char *fmt, va_list args)vfprintf (mlog_fp, fmt, args);fflush (mlog_fp); -if (! (levelarg &MLOG_NOLOCK )) { +if (!(levelarg &MLOG_NOLOCK )) {mlog_unlock (); } }@@ -793,7 +793,7 @@ mlog_sym_lookup(char *sym)sizeof (mlog_sym) /sizeof (mlog_sym[0 ]);for (; p < ep; p++) { -if (!strcmp (sym, p->sym)) { +if (!strcmp (sym, p->sym)) {return p->level; } }common/path.c +8
-8@@ -60,7 +60,7 @@ path_diff(char *path, char *base)assert (*base =='/' );assert (*path =='/' ); -if (!path_beginswith (path, base)) { +if (!path_beginswith (path, base)) {return 0 ; }@@ -85,10 +85,10 @@ path_diff(char *path, char *base)int path_beginswith (char *path,char *base) { -if (! base) { +if (!base) {return 0 ; } -return !strncmp (base, path,strlen (base)); +return !strncmp (base, path,strlen (base)); } char *@@ -136,19 +136,19 @@ path_normalize(char *path)assert (path[0 ] =='/' );while ((pep =pem_next (pemp)) !=0 ) { -if (!strcmp (pep,"" )) { +if (!strcmp (pep,"" )) {free ((void *)pep);continue ; } -if (!strcmp (pep,"." )) { +if (!strcmp (pep,"." )) {free ((void *)pep);continue ; } -if (!strcmp (pep,".." )) { +if (!strcmp (pep,".." )) {int ok;free ((void *)pep); ok =pa_peel (pap); -if (! ok) { +if (!ok) {pa_free (pap);pem_free (pemp);return 0 ;@@ -201,7 +201,7 @@ pem_next(pem_t *pemp)/* if end of string encountered, place next next at end of string */ -if (! nextnext) { +if (!nextnext) {for (nextnext = pemp->pem_next; *nextnext; nextnext++) ; }common/qlock.c +4
-4@@ -79,7 +79,7 @@ qlock_alloc(ix_t ord)/* verify the ordinal is not already taken, and mark as taken */ -assert (!QLOCK_ORDMAP_GET (qlock_ordalloced, ord)); +assert (!QLOCK_ORDMAP_GET (qlock_ordalloced, ord));QLOCK_ORDMAP_SET (qlock_ordalloced, ord);/* allocate lock memory @@ -119,7 +119,7 @@ qlock_lock(qlockh_t qlockh) qlockp->ql_ord, thread_ordmap); } -assert (!QLOCK_ORDMAP_GET (thread_ordmap, qlockp->ql_ord)); +assert (!QLOCK_ORDMAP_GET (thread_ordmap, qlockp->ql_ord));/* assert that no locks with a lesser ordinal are held by this thread */ @@ -130,7 +130,7 @@ qlock_lock(qlockh_t qlockh) qlockp->ql_ord, thread_ordmap); } -assert (!QLOCK_ORDMAP_CHK (thread_ordmap, qlockp->ql_ord)); +assert (!QLOCK_ORDMAP_CHK (thread_ordmap, qlockp->ql_ord));/* acquire the lock */ @@ -160,7 +160,7 @@ qlock_unlock(qlockh_t qlockh)/* release the lock */ rval =pthread_mutex_unlock (&qlockp->ql_mutex); -assert (! rval); +assert (!rval); } qsemh_tcommon/ring.c +4
-4@@ -99,7 +99,7 @@ ring_create(size_t ringlen, msgp->rm_loc =RING_LOC_READY ; msgp->rm_bufp = (char *)memalign (PGSZ , bufsz); -if (! msgp->rm_bufp) { +if (!msgp->rm_bufp) { *rvalp =ENOMEM ;return 0 ; }@@ -224,7 +224,7 @@ ring_reset(ring_t *ringp, ring_msg_t *msgp)/* if the client is not holding a message, get the next message */ if (ringp->r_client_cnt ==0 ) { -assert (! msgp); +assert (!msgp); msgp =ring_get (ringp);assert (msgp);assert (ringp->r_client_cnt ==1 );@@ -433,7 +433,7 @@ ring_slave_entry(void *ringctxp) msgp->rm_stat =RING_STAT_IGNORE ;break ; } -if (! ringp->r_first_io_time) { +if (!ringp->r_first_io_time) { ringp->r_first_io_time =time (0 );assert (ringp->r_first_io_time); }@@ -453,7 +453,7 @@ ring_slave_entry(void *ringctxp) msgp->rm_stat =RING_STAT_IGNORE ;break ; } -if (! ringp->r_first_io_time) { +if (!ringp->r_first_io_time) { ringp->r_first_io_time =time (0 );assert (ringp->r_first_io_time); }common/ring.h +2
-2@@ -168,8 +168,8 @@ extern ring_t *ring_create(size_t ringlen,size_t bufsz, bool_t pinpr, ix_t drive_index, - int (* readfunc)(void *clientctxp, char *bufp), - int (* writefunc)(void *clientctxp, char *bufp), + int (*readfunc)(void *clientctxp, char *bufp), + int (*writefunc)(void *clientctxp, char *bufp), void *clientctxp, int *rvalp);common/stream.c +1
-1@@ -253,7 +253,7 @@ stream_get_exit_status(pthread_t tid,lock (); p =stream_find (tid, states, nstates); -if (! p) goto unlock; +if (!p) goto unlock;if (state) *state = p->s_state;if (ix) *ix = p->s_ix;common/util.c +11
-11@@ -58,7 +58,7 @@ write_buf(char *bufp, }else { (void )memset ((void *)mbufp,0 , mbufsz); } - rval = (* write_funcp)(contextp, mbufp, mbufsz); + rval = (*write_funcp)(contextp, mbufp, mbufsz);if (rval) {return rval; }@@ -86,7 +86,7 @@ read_buf(char *bufp, nread =0 ; *statp =0 ;while (bufsz) { - mbufp = (* read_funcp)(contextp, bufsz, &mbufsz, statp); + mbufp = (*read_funcp)(contextp, bufsz, &mbufsz, statp);if (*statp) {break ; }@@ -97,7 +97,7 @@ read_buf(char *bufp, } bufsz -= mbufsz; nread += (int )mbufsz; - (* return_read_buf_funcp)(contextp, mbufp, mbufsz); + (*return_read_buf_funcp)(contextp, mbufp, mbufsz); }return nread;@@ -202,15 +202,15 @@ bigstat_iter(jdm_fshandle_t *fshandlep, }if ((p->bs_mode &S_IFMT ) ==S_IFDIR ) { -if (! (selector &BIGSTAT_ITER_DIR )){ +if (!(selector &BIGSTAT_ITER_DIR )){continue ; } }else { -if (! (selector &BIGSTAT_ITER_NONDIR )){ +if (!(selector &BIGSTAT_ITER_NONDIR )){continue ; } } - rval = (* fp)(cb_arg1, fshandlep, fsfd, p); + rval = (*fp)(cb_arg1, fshandlep, fsfd, p);if (rval) { *statp = rval;return 0 ;@@ -272,7 +272,7 @@ bigstat_one(int fsfd,#define INOGRPLEN 256 int inogrp_iter(int fsfd, - int (* fp)(void *arg1, + int (*fp)(void *arg1, int fsfd, xfs_inogrp_t *inogrp), void * arg1,@@ -311,7 +311,7 @@ inogrp_iter(int fsfd,for (p = igrp, endp = igrp + inogrpcnt; p < endp; p++) {int rval; - rval = (* fp)(arg1, fsfd, p); + rval = (*fp)(arg1, fsfd, p);if (rval) { *statp = rval;free (igrp);@@ -376,7 +376,7 @@ diriter(jdm_fshandle_t *fshandlep, statp->bs_ino, strerror(errno)); *cbrvalp =0 ; -if (! usrgdp) { +if (!usrgdp) {free ((void *)gdp); }return -1 ;@@ -476,7 +476,7 @@ diriter(jdm_fshandle_t *fshandlep,/* invoke the callback */ - cbrval = (* cbfp)(arg1, + cbrval = (*cbfp)(arg1, fshandlep, fsfd, &statbuf,@@ -495,7 +495,7 @@ diriter(jdm_fshandle_t *fshandlep, } (void )close (fd); -if (! usrgdp) { +if (!usrgdp) {free ((void *)gdp); }common/util.h +4
-4@@ -32,8 +32,8 @@* * if bufp is null, writes bufsz zeros. */ -typedef char * (*gwbfp_t )(void *contextp,size_t wantedsz,size_t *szp); -typedef int (*wfp_t )(void *contextp,char *bufp,size_t bufsz); +typedef char *(*gwbfp_t )(void *contextp,size_t wantedsz,size_t *szp); +typedef int (*wfp_t )(void *contextp,char *bufp,size_t bufsz); extern int write_buf(char *bufp, size_t bufsz,@@ -57,7 +57,7 @@ extern int write_buf(char *bufp,* *statp will be zero. */ typedef char * (*rfp_t )(void *contextp,size_t wantedsz,size_t *szp,int *statp); -typedef void (*rrbfp_t )(void *contextp,char *bufp,size_t bufsz); +typedef void (*rrbfp_t )(void *contextp,char *bufp,size_t bufsz); extern int read_buf(char *bufp, size_t bufsz,@@ -110,7 +110,7 @@ extern int bigstat_one(int fsfd, xfs_bstat_t *statp); extern int inogrp_iter(int fsfd, - int (* fp)(void *arg1, + int (*fp)(void *arg1, int fsfd, xfs_inogrp_t *inogrp), void * arg1,dump/content.c +85
-85@@ -599,7 +599,7 @@ content_init(int argc,while ((c =getopt (argc, argv,GETOPT_CMDSTRING )) !=EOF ) {switch (c) {case GETOPT_LEVEL : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument missing\n" ), c);@@ -618,7 +618,7 @@ content_init(int argc, }break ;case GETOPT_SUBTREE : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument missing\n" ), c);@@ -636,7 +636,7 @@ content_init(int argc, subtreecnt++;break ;case GETOPT_MAXDUMPFILESIZE : -if (! optarg || optarg [0 ] =='-' ) { +if (!optarg || optarg [0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument missing\n" ), c);@@ -671,7 +671,7 @@ content_init(int argc, sc_preerasepr =BOOL_TRUE ;break ;case GETOPT_ALERTPROG : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument missing\n" ), c);@@ -687,7 +687,7 @@ content_init(int argc, sc_dumpasoffline =BOOL_TRUE ;break ;case GETOPT_BASED : -if (! optarg || optarg[0 ] =='-' ) { +if (!optarg || optarg[0 ] =='-' ) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("-%c argument missing\n" ), c);@@ -720,7 +720,7 @@ 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++; }@@ -769,7 +769,7 @@ 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, + if (!fs_info(fstype, sizeof(fstype), FS_DEFAULT, fsdevice,@@ -790,7 +790,7 @@ 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)) { +if (!fs_mounted (fstype, fsdevice, mntpnt, &fsid)) {mlog (MLOG_NORMAL |MLOG_ERROR ,_ ("%s must be mounted to be dumped\n" ), srcname);@@ -880,7 +880,7 @@ content_init(int argc, interruptedpr =BOOL_FALSE ; ok =inv_get_session_byuuid (&fsid, &baseuuid, &sessp); -if (! ok) { +if (!ok) { mlog(MLOG_NORMAL | MLOG_ERROR, _( "could not find specified base dump (%s) " "in inventory\n"),@@ -994,7 +994,7 @@ content_init(int argc, inv_idbt, (u_char_t )sc_level, &sessp); -if (! ok) { +if (!ok) { sessp =0 ; }@@ -1036,7 +1036,7 @@ content_init(int argc, &sessp);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.21.0
Part of the diff is not shown here. View the raw message.