Skip to content

Commit

Permalink
WT-2599: split out the checksum code from the support directory (#2707)
Browse files Browse the repository at this point in the history
* WT-2599: split out the checksum code from the support directory

Also fix a lint complaint about missing enum options in a case statement and remove unnecessary WT_FILE_SYSTEM/WT_FILE_HANDLE method initialization.
  • Loading branch information
keithbostic authored and michaelcahill committed May 2, 2016
1 parent 445df70 commit 701e83d
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build_win/filelist.win
Expand Up @@ -47,6 +47,7 @@ src/btree/row_key.c
src/btree/row_modify.c
src/btree/row_srch.c
src/cache/cache_las.c
src/checksum/checksum.c
src/config/config.c
src/config/config_api.c
src/config/config_check.c
Expand Down Expand Up @@ -148,7 +149,6 @@ src/session/session_api.c
src/session/session_compact.c
src/session/session_dhandle.c
src/session/session_salvage.c
src/support/cksum.c
src/support/cond_auto.c
src/support/crypto.c
src/support/err.c
Expand Down
6 changes: 3 additions & 3 deletions dist/filelist
Expand Up @@ -47,6 +47,9 @@ src/btree/row_key.c
src/btree/row_modify.c
src/btree/row_srch.c
src/cache/cache_las.c
src/checksum/checksum.c
src/checksum/power8/crc32.S
src/checksum/power8/crc32_wrapper.c
src/config/config.c
src/config/config_api.c
src/config/config_check.c
Expand Down Expand Up @@ -147,7 +150,6 @@ src/session/session_api.c
src/session/session_compact.c
src/session/session_dhandle.c
src/session/session_salvage.c
src/support/cksum.c
src/support/cond_auto.c
src/support/crypto.c
src/support/err.c
Expand All @@ -159,8 +161,6 @@ src/support/hex.c
src/support/huffman.c
src/support/mtx_rw.c
src/support/pow.c
src/support/power8/crc32.S
src/support/power8/crc32_wrapper.c
src/support/rand.c
src/support/scratch.c
src/support/stat.c
Expand Down
4 changes: 2 additions & 2 deletions dist/s_longlines
Expand Up @@ -8,9 +8,9 @@ l=`(cd .. &&
find bench/wtperf examples ext src test -name '*.[chisy]' &&
find dist -name '*.py' &&
find src -name '*.in') |
sed -e '/dist\/stat_data\.py/d' \
sed -e '/checksum\/power8/d' \
-e '/dist\/stat_data\.py/d' \
-e '/include\/extern\.h/d' \
-e '/support\/power8/d' \
-e '/support\/stat\.c/d'`

for f in $l ; do
Expand Down
2 changes: 1 addition & 1 deletion dist/s_style
Expand Up @@ -20,7 +20,7 @@ if [ $# -ne 1 ]; then
-name '*.[chisy]' -o -name '*.in' -o -name '*.dox' |
sed -e '/Makefile.in/d' \
-e '/build_win\/wiredtiger_config.h/d' \
-e '/support\/power8/d' |
-e '/checksum\/power8/d' |
xargs $xp -n 1 -I{} sh ./dist/s_style {}
else
# General style correction and cleanup for a single file
Expand Down
2 changes: 1 addition & 1 deletion dist/s_whitespace
Expand Up @@ -38,7 +38,7 @@ for f in `find bench examples ext src test \
-name '*.in' -o \
-name 'Makefile.am' |
sed -e '/Makefile.in/d' \
-e '/support\/power8/d'`; do
-e '/checksum\/power8/d'`; do
whitespace_and_empty_line $f
done

Expand Down
4 changes: 2 additions & 2 deletions dist/s_win
Expand Up @@ -47,8 +47,8 @@ win_filelist()
(
sed \
-e '/\/os_posix\//d' \
-e '/src\/support\/power8\/crc32.S/d' \
-e '/src\/support\/power8\/crc32_wrapper.c/d'
-e '/src\/checksum\/power8\/crc32.S/d' \
-e '/src\/checksum\/power8\/crc32_wrapper.c/d'

echo 'src/os_win/os_dir.c'
echo 'src/os_win/os_dlopen.c'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/evict/evict_file.c
Expand Up @@ -86,6 +86,8 @@ __wt_evict_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
__wt_page_can_evict(session, ref, NULL));
__wt_ref_out(session, ref);
break;
case WT_SYNC_CHECKPOINT:
case WT_SYNC_WRITE_LEAVES:
WT_ILLEGAL_VALUE_ERR(session);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/include/extern.h
Expand Up @@ -203,6 +203,8 @@ extern int __wt_las_cursor_open(WT_SESSION_IMPL *session, WT_CURSOR **cursorp);
extern int __wt_las_cursor( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t *session_flags);
extern int __wt_las_cursor_close( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t session_flags);
extern int __wt_las_sweep(WT_SESSION_IMPL *session);
extern uint32_t __wt_cksum(const void *chunk, size_t len);
extern void __wt_cksum_init(void);
extern int __wt_config_initn( WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str, size_t len);
extern int __wt_config_init(WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str);
extern int __wt_config_subinit( WT_SESSION_IMPL *session, WT_CONFIG *conf, WT_CONFIG_ITEM *item);
Expand Down Expand Up @@ -579,8 +581,6 @@ extern void __wt_session_close_cache(WT_SESSION_IMPL *session);
extern int __wt_session_get_btree(WT_SESSION_IMPL *session, const char *uri, const char *checkpoint, const char *cfg[], uint32_t flags);
extern int __wt_session_lock_checkpoint(WT_SESSION_IMPL *session, const char *checkpoint);
extern int __wt_salvage(WT_SESSION_IMPL *session, const char *cfg[]);
extern uint32_t __wt_cksum(const void *chunk, size_t len);
extern void __wt_cksum_init(void);
extern int __wt_cond_auto_alloc( WT_SESSION_IMPL *session, const char *name, bool is_signalled, uint64_t min, uint64_t max, WT_CONDVAR **condp);
extern int __wt_cond_auto_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond);
extern int __wt_cond_auto_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress, bool *signalled);
Expand Down
2 changes: 0 additions & 2 deletions src/os_posix/os_fs.c
Expand Up @@ -673,8 +673,6 @@ __wt_os_posix(WT_SESSION_IMPL *session)
file_system->directory_list_free = __wt_posix_directory_list_free;
#ifdef __linux__
file_system->directory_sync = __posix_directory_sync;
#else
file_system->directory_sync = NULL;
#endif
file_system->exist = __posix_fs_exist;
file_system->open_file = __posix_open_file;
Expand Down
3 changes: 0 additions & 3 deletions src/os_win/os_fs.c
Expand Up @@ -506,8 +506,6 @@ __win_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session,
*/
#else
file_handle->map = __wt_win_map;
file_handle->map_discard = NULL;
file_handle->map_preload = NULL;
file_handle->unmap = __wt_win_unmap;
#endif
file_handle->read = __win_file_read;
Expand Down Expand Up @@ -556,7 +554,6 @@ __wt_os_win(WT_SESSION_IMPL *session)
/* Initialize the Windows jump table. */
file_system->directory_list = __wt_win_directory_list;
file_system->directory_list_free = __wt_win_directory_list_free;
file_system->directory_sync = NULL;
file_system->exist = __win_fs_exist;
file_system->open_file = __win_open_file;
file_system->remove = __win_fs_remove;
Expand Down
6 changes: 6 additions & 0 deletions src/schema/schema_open.c
Expand Up @@ -427,6 +427,8 @@ __schema_open_table(WT_SESSION_IMPL *session,
const char *tconfig;
char *tablename;

*tablep = NULL;

cursor = NULL;
table = NULL;
tablename = NULL;
Expand Down Expand Up @@ -527,6 +529,8 @@ __wt_schema_get_colgroup(WT_SESSION_IMPL *session,
const char *tablename, *tend;
u_int i;

if (tablep != NULL)
*tablep = NULL;
*colgroupp = NULL;

tablename = uri;
Expand Down Expand Up @@ -571,6 +575,8 @@ __wt_schema_get_index(WT_SESSION_IMPL *session,
const char *tablename, *tend;
u_int i;

if (tablep != NULL)
*tablep = NULL;
*indexp = NULL;

tablename = uri;
Expand Down

0 comments on commit 701e83d

Please sign in to comment.