diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-09-01 19:34:11 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-02 09:34:11 +1000 |
commit | a2b453ca4088fcecf2fbaf49d66cad40a88067e6 (patch) | |
tree | 222228305034bfe9e7fce45deba54c665bd5719b | |
parent | afb53e28cde37c6a52c591619c1649bf57a573ee (diff) | |
download | mongo-a2b453ca4088fcecf2fbaf49d66cad40a88067e6.tar.gz |
WT-2885 __wt_checkpoint_signal lint (#3015)
__wt_checkpoint_signal doesn't return anything, switch from the function
type int to void
WT_CONNECTION_IMPL.ckpt_signalled is a boolean, retype it.
-rw-r--r-- | src/conn/conn_ckpt.c | 8 | ||||
-rw-r--r-- | src/include/connection.h | 2 | ||||
-rw-r--r-- | src/include/extern.h | 2 | ||||
-rw-r--r-- | src/log/log.c | 5 |
4 files changed, 7 insertions, 10 deletions
diff --git a/src/conn/conn_ckpt.c b/src/conn/conn_ckpt.c index 5e9d8f70193..b4913043d63 100644 --- a/src/conn/conn_ckpt.c +++ b/src/conn/conn_ckpt.c @@ -93,7 +93,7 @@ __ckpt_server(void *arg) /* Reset. */ if (conn->ckpt_logsize) { __wt_log_written_reset(session); - conn->ckpt_signalled = 0; + conn->ckpt_signalled = false; /* * In case we crossed the log limit during the @@ -226,9 +226,8 @@ __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session) /* * __wt_checkpoint_signal -- * Signal the checkpoint thread if sufficient log has been written. - * Return 1 if this signals the checkpoint thread, 0 otherwise. */ -int +void __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize) { WT_CONNECTION_IMPL *conn; @@ -237,7 +236,6 @@ __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize) WT_ASSERT(session, WT_CKPT_LOGSIZE(conn)); if (logsize >= conn->ckpt_logsize && !conn->ckpt_signalled) { __wt_cond_signal(session, conn->ckpt_cond); - conn->ckpt_signalled = 1; + conn->ckpt_signalled = true; } - return (0); } diff --git a/src/include/connection.h b/src/include/connection.h index bd5726a06c3..e4ba6ffc046 100644 --- a/src/include/connection.h +++ b/src/include/connection.h @@ -273,7 +273,7 @@ struct __wt_connection_impl { WT_CONDVAR *ckpt_cond; /* Checkpoint wait mutex */ #define WT_CKPT_LOGSIZE(conn) ((conn)->ckpt_logsize != 0) wt_off_t ckpt_logsize; /* Checkpoint log size period */ - uint32_t ckpt_signalled;/* Checkpoint signalled */ + bool ckpt_signalled;/* Checkpoint signalled */ uint64_t ckpt_usecs; /* Checkpoint timer */ uint64_t ckpt_time_max; /* Checkpoint time min/max */ diff --git a/src/include/extern.h b/src/include/extern.h index e3fbeb7aa28..7e6777d1bd3 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -249,7 +249,7 @@ extern int __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DE extern WT_THREAD_RET __wt_cache_pool_server(void *arg); extern int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); +extern void __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize); extern int __wt_conn_dhandle_find( WT_SESSION_IMPL *session, const char *uri, const char *checkpoint) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_conn_btree_open( WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); diff --git a/src/log/log.c b/src/log/log.c index 14cb2b8c064..9514b2a2939 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -1349,8 +1349,7 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) yield_count = 0; if (freep != NULL) *freep = 1; - release_buffered = - WT_LOG_SLOT_RELEASED_BUFFERED(slot->slot_state); + release_buffered = WT_LOG_SLOT_RELEASED_BUFFERED(slot->slot_state); release_bytes = release_buffered + slot->slot_unbuffered; /* @@ -1363,7 +1362,7 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) */ if (WT_CKPT_LOGSIZE(conn)) { log->log_written += (wt_off_t)release_bytes; - WT_RET(__wt_checkpoint_signal(session, log->log_written)); + __wt_checkpoint_signal(session, log->log_written); } /* Write the buffered records */ |