diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-05-27 12:24:13 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-05-27 12:24:13 -0400 |
commit | f5419223022aee228d03fd48b66bec6ba78a3896 (patch) | |
tree | 70e7a84f28a2fa90eeafad0740fe9b2d9f56ef47 | |
parent | b0ee2818f0bf712ffb43b214b8344f5ddb28c2ff (diff) | |
download | mongo-f5419223022aee228d03fd48b66bec6ba78a3896.tar.gz |
Minor code shuffling/simplification, unused variable cleanups, comment fixing.
-rw-r--r-- | src/cursor/cur_backup.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c index 992d3d7d4e3..c45b869cfeb 100644 --- a/src/cursor/cur_backup.c +++ b/src/cursor/cur_backup.c @@ -210,6 +210,10 @@ __backup_start( if (!target_list) WT_ERR(__backup_all(session, cb)); + /* Add the hot backup and single-threading file to the list. */ + WT_ERR(__backup_list_append(session, cb, WT_METADATA_BACKUP)); + WT_ERR(__backup_list_append(session, cb, WT_SINGLETHREAD)); + /* Close the hot backup file. */ ret = fclose(cb->bfp); cb->bfp = NULL; @@ -258,10 +262,9 @@ __backup_all(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb) WT_CURSOR *cursor; WT_DECL_RET; int cmp; - const char *key, *path, *uri, *value; + const char *key, *uri, *value; cursor = NULL; - path = NULL; /* * Open a cursor on the metadata file and copy all of the entries to @@ -315,15 +318,8 @@ __backup_all(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb) } WT_ERR_NOTFOUND_OK(ret); - /* Add the hot backup and single-threading file to the list. */ - WT_ERR(__backup_list_append(session, cb, WT_METADATA_BACKUP)); - WT_ERR(__backup_list_append(session, cb, WT_SINGLETHREAD)); - -err: - if (cursor != NULL) +err: if (cursor != NULL) WT_TRET(cursor->close(cursor)); - if (path != NULL) - __wt_free(session, path); return (ret); } @@ -368,12 +364,6 @@ __backup_uri(WT_SESSION_IMPL *session, WT_ERR(__wt_schema_worker(session, uri, NULL, cfg, 0)); } WT_ERR_NOTFOUND_OK(ret); - if (!target_list) - return (0); - - /* Add the hot backup and single-threading file to the list. */ - WT_ERR(__backup_list_append(session, cb, WT_METADATA_BACKUP)); - WT_ERR(__backup_list_append(session, cb, WT_SINGLETHREAD)); err: __wt_scr_free(&tmp); return (ret); @@ -420,12 +410,12 @@ __wt_backup_list_append(WT_SESSION_IMPL *session, const char *name) cb = session->bkp_cursor; - /* Add the entry to the backup file. */ + /* Add the metadata entry to the backup file. */ WT_RET(__wt_metadata_read(session, name, &value)); WT_RET_TEST( (fprintf(cb->bfp, "%s\n%s\n", name, value) < 0), __wt_errno()); - /* Add to the list of files returned by the cursor. */ + /* Add to the list of files needing to be copied. */ if (WT_PREFIX_MATCH(name, "file:")) WT_RET( __backup_list_append(session, cb, name + strlen("file:"))); |