From 5000693dcdddb35878f06e08fcd35ec8ae0a48d5 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 9 Feb 2008 11:17:40 +0000 Subject: [PATCH] kes Remove a redundant jcr argument to find_files, match_files, and find_one_file. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6382 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/backup.c | 2 +- bacula/src/filed/estimate.c | 4 ++-- bacula/src/filed/restore.c | 2 +- bacula/src/filed/verify.c | 4 ++-- bacula/src/findlib/find.c | 5 ++--- bacula/src/findlib/find_one.c | 30 +++++++++++++++--------------- bacula/src/findlib/match.c | 4 ++-- bacula/src/findlib/protos.h | 8 ++++---- bacula/src/tools/testfind.c | 2 +- bacula/src/tools/testls.c | 2 +- bacula/src/version.h | 4 ++-- bacula/technotes-2.3 | 2 ++ 12 files changed, 35 insertions(+), 34 deletions(-) diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 4e91bfdbe8..fcdb7e052b 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -130,7 +130,7 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr) jcr->acl_text = get_pool_memory(PM_MESSAGE); /* Subroutine save_file() is called for each file */ - if (!find_files(jcr, (FF_PKT *)jcr->ff, save_file, (void *)jcr)) { + if (!find_files(jcr, (FF_PKT *)jcr->ff, save_file)) { ok = false; /* error */ set_jcr_job_status(jcr, JS_ErrorTerminated); } diff --git a/bacula/src/filed/estimate.c b/bacula/src/filed/estimate.c index 70d0154fb4..bc552b2fe4 100644 --- a/bacula/src/filed/estimate.c +++ b/bacula/src/filed/estimate.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2001-2007 Free Software Foundation Europe e.V. + Copyright (C) 2001-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -50,7 +50,7 @@ int make_estimate(JCR *jcr) set_jcr_job_status(jcr, JS_Running); set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); - stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file, (void *)jcr); + stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file); return stat; } diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 8abe454371..7869df4b4e 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -848,7 +848,7 @@ static bool verify_signature(JCR *jcr, r_ctx &rctx) /* Checksum the entire file */ /* Make sure we don't modify JobBytes by saving and restoring it */ saved_bytes = jcr->JobBytes; - if (find_one_file(jcr, jcr->ff, do_file_digest, jcr, jcr->last_fname, (dev_t)-1, 1) != 0) { + if (find_one_file(jcr, jcr->ff, do_file_digest, jcr->last_fname, (dev_t)-1, 1) != 0) { Jmsg(jcr, M_ERROR, 0, _("Digest one file failed for file: %s\n"), jcr->last_fname); jcr->JobBytes = saved_bytes; diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c index e42dcf5f6b..b3dcca92c2 100644 --- a/bacula/src/filed/verify.c +++ b/bacula/src/filed/verify.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -56,7 +56,7 @@ void do_verify(JCR *jcr) set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); Dmsg0(10, "Start find files\n"); /* Subroutine verify_file() is called for each file */ - find_files(jcr, (FF_PKT *)jcr->ff, verify_file, (void *)jcr); + find_files(jcr, (FF_PKT *)jcr->ff, verify_file); Dmsg0(10, "End find files\n"); if (jcr->big_buf) { diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index 3f0ad75377..fc1ed509c6 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -159,8 +159,7 @@ get_win32_driveletters(FF_PKT *ff, char* szDrives) * */ int -find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool top_level), - void *his_pkt) +find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool top_level)) { ff->callback = callback; @@ -192,7 +191,7 @@ find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool t char *fname = node->c_str(); Dmsg1(100, "F %s\n", fname); ff->top_fname = fname; - if (find_one_file(jcr, ff, our_callback, his_pkt, ff->top_fname, (dev_t)-1, true) == 0) { + if (find_one_file(jcr, ff, our_callback, ff->top_fname, (dev_t)-1, true) == 0) { return 0; /* error return */ } } diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 704ee9c444..aa5936eda5 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -268,7 +268,7 @@ bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt) int find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt, bool top_level), - void *pkt, char *fname, dev_t parent_device, bool top_level) + char *fname, dev_t parent_device, bool top_level) { struct utimbuf restore_times; int rtn_stat; @@ -280,7 +280,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, /* Cannot stat file */ ff_pkt->type = FT_NOSTAT; ff_pkt->ff_errno = errno; - return handle_file(ff_pkt, pkt, top_level); + return handle_file(ff_pkt, jcr, top_level); } Dmsg1(300, "File ----: %s\n", fname); @@ -341,7 +341,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, ff_pkt->statp.st_ctime < ff_pkt->save_time)) { /* Incremental option, file not changed */ ff_pkt->type = FT_NOCHG; - return handle_file(ff_pkt, pkt, top_level); + return handle_file(ff_pkt, jcr, top_level); } } @@ -358,7 +358,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, sizeof(ff_pkt->hfsinfo), FSOPT_NOFOLLOW) != 0) { ff_pkt->type = FT_NOSTAT; ff_pkt->ff_errno = errno; - return handle_file(ff_pkt, pkt, top_level); + return handle_file(ff_pkt, jcr, top_level); } } #endif @@ -397,7 +397,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, ff_pkt->link = lp->name; ff_pkt->type = FT_LNKSAVED; /* Handle link, file already saved */ ff_pkt->LinkFI = lp->FileIndex; - return handle_file(ff_pkt, pkt, top_level); + return handle_file(ff_pkt, jcr, top_level); } /* File not previously dumped. Chain it into our list. */ @@ -427,7 +427,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, } else { ff_pkt->type = FT_REG; } - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -446,7 +446,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, /* Could not follow link */ ff_pkt->type = FT_NOFOLLOW; ff_pkt->ff_errno = errno; - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -455,7 +455,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, buffer[size] = 0; ff_pkt->link = buffer; /* point to link */ ff_pkt->type = FT_LNK; /* got a real link */ - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -482,7 +482,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, /* Could not access() directory */ ff_pkt->type = FT_NOACCESS; ff_pkt->ff_errno = errno; - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -523,7 +523,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, * do not immediately save it, but do so only after everything * in the directory is seen (i.e. the FT_DIREND). */ - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (rtn_stat < 1 || ff_pkt->type == FT_REPARSE) { /* ignore or error status */ free(link); return rtn_stat; @@ -568,7 +568,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, } /* If not recursing, just backup dir and return */ if (!recurse) { - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -591,7 +591,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, if ((directory = opendir(fname)) == NULL) { ff_pkt->type = FT_NOOPEN; ff_pkt->ff_errno = errno; - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -635,7 +635,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, } *q = 0; if (!file_is_excluded(ff_pkt, link)) { - rtn_stat = find_one_file(jcr, ff_pkt, handle_file, pkt, link, our_device, false); + rtn_stat = find_one_file(jcr, ff_pkt, handle_file, link, our_device, false); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } @@ -652,7 +652,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, * the directory modes and dates. Temp directory values * were used without this record. */ - handle_file(dir_ff_pkt, pkt, top_level); /* handle directory entry */ + handle_file(dir_ff_pkt, jcr, top_level); /* handle directory entry */ if (ff_pkt->linked) { ff_pkt->linked->FileIndex = dir_ff_pkt->FileIndex; } @@ -690,7 +690,7 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, /* The only remaining types are special (character, ...) files */ ff_pkt->type = FT_SPEC; } - rtn_stat = handle_file(ff_pkt, pkt, top_level); + rtn_stat = handle_file(ff_pkt, jcr, top_level); if (ff_pkt->linked) { ff_pkt->linked->FileIndex = ff_pkt->FileIndex; } diff --git a/bacula/src/findlib/match.c b/bacula/src/findlib/match.c index 62ed2e8f8b..9d124b3f54 100644 --- a/bacula/src/findlib/match.c +++ b/bacula/src/findlib/match.c @@ -64,7 +64,7 @@ static const int fnmode = 0; int -match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool), void *his_pkt) +match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool)) { ff->callback = callback; @@ -76,7 +76,7 @@ match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool) bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts)); Dmsg1(100, "find_files: file=%s\n", inc->fname); if (!file_is_excluded(ff, inc->fname)) { - if (find_one_file(jcr, ff, callback, his_pkt, inc->fname, (dev_t)-1, 1) ==0) { + if (find_one_file(jcr, ff, callback, inc->fname, (dev_t)-1, 1) ==0) { return 0; /* error return */ } } diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h index dc50119998..1bd177d962 100644 --- a/bacula/src/findlib/protos.h +++ b/bacula/src/findlib/protos.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -45,8 +45,8 @@ int create_file (JCR *jcr, ATTR *attr, BFILE *ofd, int replace); /* From find.c */ FF_PKT *init_find_files(); void set_find_options(FF_PKT *ff, int incremental, time_t mtime); -int find_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool), void *pkt); -int match_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool), void *pkt); +int find_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool)); +int match_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool)); int term_find_files(FF_PKT *ff); int get_win32_driveletters(FF_PKT *ff, char* szDrives); @@ -63,7 +63,7 @@ struct s_included_file *get_next_included_file(FF_PKT *ff, /* From find_one.c */ int find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt, bool top_level), - void *pkt, char *p, dev_t parent_device, bool top_level); + char *p, dev_t parent_device, bool top_level); int term_find_one(FF_PKT *ff); bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt); diff --git a/bacula/src/tools/testfind.c b/bacula/src/tools/testfind.c index 57528e309d..2604d394fe 100644 --- a/bacula/src/tools/testfind.c +++ b/bacula/src/tools/testfind.c @@ -163,7 +163,7 @@ main (int argc, char *const *argv) copy_fileset(ff, jcr); - find_files(jcr, ff, print_file, NULL); + find_files(jcr, ff, print_file); free_jcr(jcr); free_config_resources(); diff --git a/bacula/src/tools/testls.c b/bacula/src/tools/testls.c index 22d9a78a66..bf31fa7aa8 100644 --- a/bacula/src/tools/testls.c +++ b/bacula/src/tools/testls.c @@ -165,7 +165,7 @@ main (int argc, char *const *argv) } fclose(fd); } - match_files(jcr, ff, print_file, NULL); + match_files(jcr, ff, print_file); term_include_exclude_files(ff); hard_links = term_find_files(ff); diff --git a/bacula/src/version.h b/bacula/src/version.h index 8ccd5d54b4..ed6856e6a3 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.9" -#define BDATE "08 February 2008" -#define LSMDATE "08Feb08" +#define BDATE "09 February 2008" +#define LSMDATE "09Feb08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index bc8612dc84..7f7973d72b 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,8 @@ General: 09Feb08 +kes Remove a redundant jcr argument to find_files, match_files, and + find_one_file. kes Implement '.status dir header|scheduled|running|terminated' that prints the requested status section. With the exception of the header, the other reports have fields separated by tabs (\t). -- 2.39.5