diff options
author | sueloverso <sue@mongodb.com> | 2016-07-20 11:32:15 -0400 |
---|---|---|
committer | Keith Bostic <keith.bostic@mongodb.com> | 2016-07-20 11:32:15 -0400 |
commit | 91c035d7715f116284ff5cc1daaa11de98880a33 (patch) | |
tree | 32b7013f77b955b93063fbffb09523a5fa19bde7 | |
parent | 91040aad51516e6f36074dc8120a2a5115bf76a2 (diff) | |
download | mongo-91c035d7715f116284ff5cc1daaa11de98880a33.tar.gz |
WT-2782 Minor text changes for file system functions (#2890)
* WT-2782 Add comment that caller must free the list.
* Typo.
-rw-r--r-- | src/include/wiredtiger.in | 2 | ||||
-rw-r--r-- | src/log/log.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index fa56eb43f46..8f1249481eb 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -3739,7 +3739,7 @@ struct __wt_file_system { * @param[out] dirlist the method returns an allocated array of * individually allocated strings, one for each entry in the * directory. - * @param[out] countp the method the number of entries returned + * @param[out] countp the number of entries returned */ int (*fs_directory_list)(WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *directory, const char *prefix, diff --git a/src/log/log.c b/src/log/log.c index b9d757bbde8..8ec910115ac 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -281,7 +281,8 @@ __log_get_files(WT_SESSION_IMPL *session, /* * __wt_log_get_all_files -- * Retrieve the list of log files, either all of them or only the active - * ones (those that are not candidates for archiving). + * ones (those that are not candidates for archiving). The caller is + * responsible for freeing the directory list returned. */ int __wt_log_get_all_files(WT_SESSION_IMPL *session, @@ -311,6 +312,10 @@ __wt_log_get_all_files(WT_SESSION_IMPL *session, for (max = 0, i = 0; i < count; ) { WT_ERR(__wt_log_extract_lognum(session, files[i], &id)); if (active_only && id < log->ckpt_lsn.l.file) { + /* + * Any files not being returned are individually freed + * and the array adjusted. + */ __wt_free(session, files[i]); files[i] = files[count - 1]; files[--count] = NULL; @@ -325,6 +330,10 @@ __wt_log_get_all_files(WT_SESSION_IMPL *session, *filesp = files; *countp = count; + /* + * Only free on error. The caller is responsible for calling free + * once it is done using the returned list. + */ if (0) { err: WT_TRET(__wt_fs_directory_list_free(session, &files, count)); } |