diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 3cde6123345..6254a567a39 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -3775,6 +3775,7 @@ xb_filters_free()
 	}
 }
 
+#if 0 // FIXME: replace this
 /*********************************************************************//**
 Create log file metadata. */
 static
@@ -3806,6 +3807,7 @@ open_or_create_log_file(
 		   ulint(srv_log_file_size >> srv_page_size_shift),
 		   false, false);
 }
+#endif
 
 /***********************************************************************
 Set the open files limit. Based on set_max_open_files().
@@ -4072,6 +4074,7 @@ xtrabackup_backup_func()
 
 	log_sys.create();
 	log_sys.log.create(srv_n_log_files);
+#if 0 // FIXME: replace this
 	fil_space_t*	space = fil_space_create(
 		"innodb_redo_log", SRV_LOG_SPACE_FIRST_ID, 0,
 		FIL_TYPE_LOG, NULL);
@@ -4079,6 +4082,7 @@ xtrabackup_backup_func()
 	for (ulint i = 0; i < srv_n_log_files; i++) {
 		open_or_create_log_file(space, i);
 	}
+#endif
 
 	/* create extra LSN dir if it does not exist. */
 	if (xtrabackup_extra_lsndir
@@ -5580,7 +5584,11 @@ xtrabackup_prepare_func(char** argv)
 	}
 
 	/* Check whether the log is applied enough or not. */
-	if ((srv_start_lsn || fil_space_get(SRV_LOG_SPACE_FIRST_ID))
+	if ((srv_start_lsn
+#if 0 // FIXME: replace this (or remove if srv_start_lsn is reliable)
+	     || fil_space_get(SRV_LOG_SPACE_FIRST_ID)
+#endif
+	     )
 	    && srv_start_lsn < target_lsn) {
 		msg("mariabackup: error: "
 		    "The log was only applied up to LSN " LSN_PF
diff --git a/storage/innobase/buf/buf0buddy.cc b/storage/innobase/buf/buf0buddy.cc
index f932195897c..46813425c3f 100644
--- a/storage/innobase/buf/buf0buddy.cc
+++ b/storage/innobase/buf/buf0buddy.cc
@@ -39,7 +39,7 @@ safe to look at BUF_BUDDY_STAMP_OFFSET.
 The answer lies in following invariants:
 * All blocks allocated by buddy allocator are used for compressed
 page frame.
-* A compressed table always have space_id < SRV_LOG_SPACE_FIRST_ID
+* A compressed table always have space_id < SRV_TMP_SPACE_ID
 * BUF_BUDDY_STAMP_OFFSET always points to the space_id field in
 a frame.
   -- The above is true because we look at these fields when the
@@ -67,7 +67,7 @@ are written.*/
 
 /** Value that we stamp on all buffers that are currently on the zip_free
 list. This value is stamped at BUF_BUDDY_STAMP_OFFSET offset */
-#define BUF_BUDDY_STAMP_FREE	 SRV_LOG_SPACE_FIRST_ID
+#define BUF_BUDDY_STAMP_FREE	 SRV_TMP_SPACE_ID
 
 /** Stamp value for non-free buffers. Will be overwritten by a non-zero
 value by the consumer of the block */
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 0eaa746deb8..e8928c7c2c9 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -595,7 +595,7 @@ buf_dblwr_process()
 		dberr_t	err = fil_io(
 			request, true,
 			page_id, page_size,
-				0, page_size.physical(), read_buf, NULL);
+			0, page_size.physical(), read_buf, NULL);
 
 		if (err != DB_SUCCESS) {
 			ib::warn()
@@ -696,7 +696,7 @@ buf_dblwr_process()
 
 	recv_dblwr.pages.clear();
 
-	fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
+	fil_flush_file_spaces();
 	ut_free(unaligned_read_buf);
 }
 
@@ -754,7 +754,7 @@ buf_dblwr_update(
 			mutex_exit(&buf_dblwr->mutex);
 			/* This will finish the batch. Sync data files
 			to the disk. */
-			fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
+			fil_flush_file_spaces();
 			mutex_enter(&buf_dblwr->mutex);
 
 			/* We can now reuse the doublewrite memory buffer: */
@@ -965,7 +965,7 @@ buf_dblwr_flush_buffered_writes()
 		/* Sync the writes to the disk. */
 		buf_dblwr_sync_datafiles();
 		/* Now we flush the data to disk (for example, with fsync) */
-		fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
+		fil_flush_file_spaces();
 		return;
 	}
 
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index c8e7236dc93..3e95062ac5a 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -362,7 +362,7 @@ buf_dump(
 		     bpage = UT_LIST_GET_NEXT(LRU, bpage)) {
 
 			ut_a(buf_page_in_file(bpage));
-			if (bpage->id.space() >= SRV_LOG_SPACE_FIRST_ID) {
+			if (bpage->id.space() >= SRV_TMP_SPACE_ID) {
 				/* Ignore the innodb_temporary tablespace. */
 				continue;
 			}
@@ -689,7 +689,7 @@ buf_load()
 		/* space_id for this iteration of the loop */
 		const ulint	this_space_id = BUF_DUMP_SPACE(dump[i]);
 
-		if (this_space_id >= SRV_LOG_SPACE_FIRST_ID) {
+		if (this_space_id >= SRV_TMP_SPACE_ID) {
 			/* Ignore the innodb_temporary tablespace. */
 			continue;
 		}
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 1540f7e53bc..9f589df6bdf 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -2794,7 +2794,7 @@ dict_load_tablespace(
 {
 	ut_ad(!table->is_temporary());
 	ut_ad(!table->space);
-	ut_ad(table->space_id < SRV_LOG_SPACE_FIRST_ID);
+	ut_ad(table->space_id < SRV_TMP_SPACE_ID);
 	ut_ad(fil_system.sys_space);
 
 	if (table->space_id == TRX_SYS_SPACE) {
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index ffd82ca9415..c4f2faea7d4 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -223,7 +223,6 @@ fil_space_belongs_in_lru(
 {
 	switch (space->purpose) {
 	case FIL_TYPE_TEMPORARY:
-	case FIL_TYPE_LOG:
 		return(false);
 	case FIL_TYPE_TABLESPACE:
 		return(fil_is_user_tablespace_id(space->id));
@@ -348,7 +347,6 @@ fil_space_get(
 	mutex_enter(&fil_system.mutex);
 	fil_space_t*	space = fil_space_get_by_id(id);
 	mutex_exit(&fil_system.mutex);
-	ut_ad(space == NULL || space->purpose != FIL_TYPE_LOG);
 	return(space);
 }
 
@@ -478,7 +476,6 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
 bool fil_node_t::read_page0(bool first)
 {
 	ut_ad(mutex_own(&fil_system.mutex));
-	ut_a(space->purpose != FIL_TYPE_LOG);
 	const page_size_t page_size(space->flags);
 	const ulint psize = page_size.physical();
 
@@ -617,10 +614,6 @@ static bool fil_node_open_file(fil_node_t* node)
 			node->handle = OS_FILE_CLOSED;
 			return false;
 		}
-	} else if (space->purpose == FIL_TYPE_LOG) {
-		node->handle = os_file_create(
-			innodb_log_file_key, node->name, OS_FILE_OPEN,
-			OS_FILE_AIO, OS_LOG_FILE, read_only_mode, &success);
 	} else {
 		node->handle = os_file_create(
 			innodb_data_file_key, node->name,
@@ -630,29 +623,27 @@ static bool fil_node_open_file(fil_node_t* node)
 			OS_FILE_AIO, OS_DATA_FILE, read_only_mode, &success);
 	}
 
-	if (space->purpose != FIL_TYPE_LOG) {
-		/*
-		For the temporary tablespace and during the
-		non-redo-logged adjustments in
-		IMPORT TABLESPACE, we do not care about
-		the atomicity of writes.
-
-		Atomic writes is supported if the file can be used
-		with atomic_writes (not log file), O_DIRECT is
-		used (tested in ha_innodb.cc) and the file is
-		device and file system that supports atomic writes
-		for the given block size
-		*/
-		space->atomic_write_supported
-			= space->purpose == FIL_TYPE_TEMPORARY
-			|| space->purpose == FIL_TYPE_IMPORT
-			|| (node->atomic_write
-			    && srv_use_atomic_writes
-			    && my_test_if_atomic_write(
-				    node->handle,
-				    int(page_size_t(space->flags)
-					.physical())));
-	}
+	/*
+	For the temporary tablespace and during the
+	non-redo-logged adjustments in
+	IMPORT TABLESPACE, we do not care about
+	the atomicity of writes.
+
+	Atomic writes is supported if the file can be used
+	with atomic_writes (not log file), O_DIRECT is
+	used (tested in ha_innodb.cc) and the file is
+	device and file system that supports atomic writes
+	for the given block size
+	*/
+	space->atomic_write_supported
+		= space->purpose == FIL_TYPE_TEMPORARY
+		|| space->purpose == FIL_TYPE_IMPORT
+		|| (node->atomic_write
+		    && srv_use_atomic_writes
+		    && my_test_if_atomic_write(
+			    node->handle,
+			    int(page_size_t(space->flags)
+				.physical())));
 
 	ut_a(success);
 	ut_a(node->is_open());
@@ -816,10 +807,6 @@ fil_flush_low(fil_space_t* space)
 		case FIL_TYPE_IMPORT:
 			fil_n_pending_tablespace_flushes++;
 			break;
-		case FIL_TYPE_LOG:
-			fil_n_pending_log_flushes++;
-			fil_n_log_flushes++;
-			break;
 		}
 #ifdef _WIN32
 		if (node->is_raw_disk) {
@@ -884,9 +871,6 @@ fil_flush_low(fil_space_t* space)
 		case FIL_TYPE_IMPORT:
 			fil_n_pending_tablespace_flushes--;
 			continue;
-		case FIL_TYPE_LOG:
-			fil_n_pending_log_flushes--;
-			continue;
 		}
 
 		ut_ad(0);
@@ -1030,11 +1014,6 @@ fil_mutex_enter_and_prepare_for_io(
 	for (ulint count = 0;;) {
 		mutex_enter(&fil_system.mutex);
 
-		if (space_id >= SRV_LOG_SPACE_FIRST_ID) {
-			/* We keep log files always open. */
-			break;
-		}
-
 		fil_space_t*	space = fil_space_get_by_id(space_id);
 
 		if (space == NULL) {
@@ -1076,7 +1055,7 @@ fil_mutex_enter_and_prepare_for_io(
 					os_thread_sleep(20000);
 					/* Flush tablespaces so that we can
 					close modified files in the LRU list */
-					fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
+					fil_flush_file_spaces();
 
 					count++;
 					mutex_enter(&fil_system.mutex);
@@ -1341,8 +1320,7 @@ fil_space_create(
 
 	ut_ad(fil_system.is_initialised());
 	ut_ad(fsp_flags_is_valid(flags & ~FSP_FLAGS_MEM_MASK, id));
-	ut_ad(purpose == FIL_TYPE_LOG
-	      || srv_page_size == UNIV_PAGE_SIZE_ORIG || flags != 0);
+	ut_ad(srv_page_size == UNIV_PAGE_SIZE_ORIG || flags != 0);
 
 	DBUG_EXECUTE_IF("fil_space_create_failure", return(NULL););
 
@@ -1408,17 +1386,15 @@ fil_space_create(
 		the durability or atomicity of writes to the
 		temporary tablespace files. */
 		space->atomic_write_supported = true;
+		ut_ad(id == SRV_TMP_SPACE_ID);
+	} else if (id > fil_system.max_assigned_id) {
+		fil_system.max_assigned_id = id;
 	}
 
 	HASH_INSERT(fil_space_t, hash, fil_system.spaces, id, space);
 
 	UT_LIST_ADD_LAST(fil_system.space_list, space);
 
-	if (id < SRV_LOG_SPACE_FIRST_ID && id > fil_system.max_assigned_id) {
-
-		fil_system.max_assigned_id = id;
-	}
-
 	/* Inform key rotation that there could be something
 	to do */
 	if (purpose == FIL_TYPE_TABLESPACE
@@ -1463,16 +1439,16 @@ fil_assign_new_space_id(
 
 	id++;
 
-	if (id > (SRV_LOG_SPACE_FIRST_ID / 2) && (id % 1000000UL == 0)) {
+	if (id > (SRV_TMP_SPACE_ID / 2) && (id % 1000000UL == 0)) {
 		ib::warn() << "You are running out of new single-table"
 			" tablespace id's. Current counter is " << id
-			<< " and it must not exceed" << SRV_LOG_SPACE_FIRST_ID
+			<< " and it must not exceed" << SRV_TMP_SPACE_ID
 			<< "! To reset the counter to zero you have to dump"
 			" all your tables and recreate the whole InnoDB"
 			" installation.";
 	}
 
-	success = (id < SRV_LOG_SPACE_FIRST_ID);
+	success = (id < SRV_TMP_SPACE_ID);
 
 	if (success) {
 		*space_id = fil_system.max_assigned_id = id;
@@ -1510,49 +1486,42 @@ fil_space_get_space(
 		return(space);
 	}
 
-	switch (space->purpose) {
-	case FIL_TYPE_LOG:
-		break;
-	case FIL_TYPE_TEMPORARY:
-	case FIL_TYPE_TABLESPACE:
-	case FIL_TYPE_IMPORT:
-		ut_a(id != 0);
-
-		mutex_exit(&fil_system.mutex);
+	ut_a(id != 0);
 
-		/* It is possible that the space gets evicted at this point
-		before the fil_mutex_enter_and_prepare_for_io() acquires
-		the fil_system.mutex. Check for this after completing the
-		call to fil_mutex_enter_and_prepare_for_io(). */
-		fil_mutex_enter_and_prepare_for_io(id);
+	mutex_exit(&fil_system.mutex);
 
-		/* We are still holding the fil_system.mutex. Check if
-		the space is still in memory cache. */
-		space = fil_space_get_by_id(id);
+	/* It is possible that the space gets evicted at this point
+	before the fil_mutex_enter_and_prepare_for_io() acquires
+	the fil_system.mutex. Check for this after completing the
+	call to fil_mutex_enter_and_prepare_for_io(). */
+	fil_mutex_enter_and_prepare_for_io(id);
 
-		if (space == NULL || UT_LIST_GET_LEN(space->chain) == 0) {
-			return(NULL);
-		}
+	/* We are still holding the fil_system.mutex. Check if
+	the space is still in memory cache. */
+	space = fil_space_get_by_id(id);
 
-		/* The following code must change when InnoDB supports
-		multiple datafiles per tablespace. */
-		ut_a(1 == UT_LIST_GET_LEN(space->chain));
+	if (space == NULL || UT_LIST_GET_LEN(space->chain) == 0) {
+		return(NULL);
+	}
 
-		node = UT_LIST_GET_FIRST(space->chain);
+	/* The following code must change when InnoDB supports
+	multiple datafiles per tablespace. */
+	ut_a(1 == UT_LIST_GET_LEN(space->chain));
 
-		/* It must be a single-table tablespace and we have not opened
-		the file yet; the following calls will open it and update the
-		size fields */
+	node = UT_LIST_GET_FIRST(space->chain);
 
-		if (!fil_node_prepare_for_io(node, space)) {
-			/* The single-table tablespace can't be opened,
-			because the ibd file is missing. */
-			return(NULL);
-		}
+	/* It must be a single-table tablespace and we have not opened
+	the file yet; the following calls will open it and update the
+	size fields */
 
-		fil_node_complete_io(node, IORequestRead);
+	if (!fil_node_prepare_for_io(node, space)) {
+		/* The single-table tablespace can't be opened,
+		because the ibd file is missing. */
+		return(NULL);
 	}
 
+	fil_node_complete_io(node, IORequestRead);
+
 	return(space);
 }
 
@@ -1565,7 +1534,7 @@ fil_space_set_recv_size(ulint id, ulint size)
 {
 	mutex_enter(&fil_system.mutex);
 	ut_ad(size);
-	ut_ad(id < SRV_LOG_SPACE_FIRST_ID);
+	ut_ad(id < SRV_TMP_SPACE_ID);
 
 	if (fil_space_t* space = fil_space_get_space(id)) {
 		space->recv_size = size;
@@ -1848,56 +1817,6 @@ fil_close_all_files(void)
 	      || UT_LIST_GET_LEN(fil_system.named_spaces) == 0);
 }
 
-/*******************************************************************//**
-Closes the redo log files. There must not be any pending i/o's or not
-flushed modifications in the files. */
-void
-fil_close_log_files(
-/*================*/
-	bool	free)	/*!< in: whether to free the memory object */
-{
-	fil_space_t*	space;
-
-	mutex_enter(&fil_system.mutex);
-
-	space = UT_LIST_GET_FIRST(fil_system.space_list);
-
-	while (space != NULL) {
-		fil_node_t*	node;
-		fil_space_t*	prev_space = space;
-
-		if (space->purpose != FIL_TYPE_LOG) {
-			space = UT_LIST_GET_NEXT(space_list, space);
-			continue;
-		}
-
-		/* Log files are not in the fil_system.named_spaces list. */
-		ut_ad(space->max_lsn == 0);
-
-		for (node = UT_LIST_GET_FIRST(space->chain);
-		     node != NULL;
-		     node = UT_LIST_GET_NEXT(chain, node)) {
-
-			if (node->is_open()) {
-				node->close();
-			}
-		}
-
-		space = UT_LIST_GET_NEXT(space_list, space);
-
-		if (free) {
-			fil_space_detach(prev_space);
-			fil_space_free_low(prev_space);
-		}
-	}
-
-	mutex_exit(&fil_system.mutex);
-
-	if (free) {
-		log_sys.log.close();
-	}
-}
-
 /*******************************************************************//**
 Sets the max tablespace id counter if the given number is bigger than the
 previous value. */
@@ -1906,7 +1825,7 @@ fil_set_max_space_id_if_bigger(
 /*===========================*/
 	ulint	max_id)	/*!< in: maximum known id */
 {
-	if (max_id >= SRV_LOG_SPACE_FIRST_ID) {
+	if (max_id >= SRV_TMP_SPACE_ID) {
 		ib::fatal() << "Max tablespace id is too high, " << max_id;
 	}
 
@@ -1944,7 +1863,7 @@ fil_write_flushed_lsn(
 		mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, lsn);
 		err = fil_write(page_id, univ_page_size, 0,
 				srv_page_size, buf);
-		fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
+		fil_flush_file_spaces();
 	}
 
 	ut_free(buf1);
@@ -2840,7 +2759,7 @@ fil_rename_tablespace_check(
 	for (fil_space_t* space = UT_LIST_GET_FIRST(fil_system.space_list);
 	     space; space = UT_LIST_GET_NEXT(space_list, space)) {
 		ulint id = space->id;
-		if (id && id < SRV_LOG_SPACE_FIRST_ID
+		if (id && id < SRV_TMP_SPACE_ID
 		    && space->purpose == FIL_TYPE_TABLESPACE
 		    && !strcmp(new_path,
 			       UT_LIST_GET_FIRST(space->chain)->name)) {
@@ -3009,7 +2928,7 @@ fil_ibd_create(
 
 	ut_ad(!is_system_tablespace(space_id));
 	ut_ad(!srv_read_only_mode);
-	ut_a(space_id < SRV_LOG_SPACE_FIRST_ID);
+	ut_a(space_id < SRV_TMP_SPACE_ID);
 	ut_a(size >= FIL_IBD_FILE_INITIAL_SIZE);
 	ut_a(fsp_flags_is_valid(flags & ~FSP_FLAGS_MEM_MASK, space_id));
 
@@ -4199,8 +4118,7 @@ fil_io(
 	ut_ad(recv_no_ibuf_operations
 	      || req_type.is_write()
 	      || !ibuf_bitmap_page(page_id, page_size)
-	      || sync
-	      || req_type.is_log());
+	      || sync);
 
 	ulint	mode;
 
@@ -4208,10 +4126,6 @@ fil_io(
 
 		mode = OS_AIO_SYNC;
 
-	} else if (req_type.is_log()) {
-
-		mode = OS_AIO_LOG;
-
 	} else if (req_type.is_read()
 		   && !recv_no_ibuf_operations
 		   && ibuf_page(page_id, page_size, NULL)) {
@@ -4471,67 +4385,36 @@ fil_aio_wait(
 	deadlocks in the i/o system. We keep tablespace 0 data files always
 	open, and use a special i/o thread to serve insert buffer requests. */
 
-	switch (purpose) {
-	case FIL_TYPE_LOG:
-		srv_set_io_thread_op_info(segment, "complete io for log");
-		/* We use synchronous writing of the logs
-		and can only end up here when writing a log checkpoint! */
-		ut_a(ptrdiff_t(message) == 1);
-		/* It was a checkpoint write */
-		switch (srv_flush_t(srv_file_flush_method)) {
-		case SRV_O_DSYNC:
-		case SRV_NOSYNC:
-			break;
-		case SRV_FSYNC:
-		case SRV_LITTLESYNC:
-		case SRV_O_DIRECT:
-		case SRV_O_DIRECT_NO_FSYNC:
-#ifdef _WIN32
-		case SRV_ALL_O_DIRECT_FSYNC:
-#endif
-			fil_flush(SRV_LOG_SPACE_FIRST_ID);
-		}
+	srv_set_io_thread_op_info(segment, "complete io for buf page");
 
-		DBUG_PRINT("ib_log", ("checkpoint info written"));
-		log_sys.complete_checkpoint();
+	/* async single page writes from the dblwr buffer don't have
+	access to the page */
+	buf_page_t* bpage = static_cast<buf_page_t*>(message);
+	if (!bpage) {
 		return;
-	case FIL_TYPE_TABLESPACE:
-	case FIL_TYPE_TEMPORARY:
-	case FIL_TYPE_IMPORT:
-		srv_set_io_thread_op_info(segment, "complete io for buf page");
+	}
 
-		/* async single page writes from the dblwr buffer don't have
-		access to the page */
-		buf_page_t* bpage = static_cast<buf_page_t*>(message);
-		if (!bpage) {
-			return;
-		}
+	ulint offset = bpage->id.page_no();
+	dberr_t err = buf_page_io_complete(bpage, dblwr);
+	if (err == DB_SUCCESS) {
+		return;
+	}
 
-		ulint offset = bpage->id.page_no();
-		dberr_t err = buf_page_io_complete(bpage, dblwr);
-		if (err == DB_SUCCESS) {
-			return;
-		}
+	ut_ad(type.is_read());
+	if (recv_recovery_is_on() && !srv_force_recovery) {
+		recv_sys->found_corrupt_fs = true;
+	}
 
-		ut_ad(type.is_read());
-		if (recv_recovery_is_on() && !srv_force_recovery) {
-			recv_sys->found_corrupt_fs = true;
+	if (fil_space_t* space = fil_space_acquire_for_io(space_id)) {
+		if (space == node->space) {
+			ib::error() << "Failed to read file '"
+				    << node->name
+				    << "' at offset " << offset
+				    << ": " << ut_strerr(err);
 		}
 
-		if (fil_space_t* space = fil_space_acquire_for_io(space_id)) {
-			if (space == node->space) {
-				ib::error() << "Failed to read file '"
-					    << node->name
-					    << "' at offset " << offset
-					    << ": " << ut_strerr(err);
-			}
-
-			space->release_for_io();
-		}
-		return;
+		space->release_for_io();
 	}
-
-	ut_ad(0);
 }
 
 /**********************************************************************//**
@@ -4573,19 +4456,13 @@ fil_flush(fil_space_t* space)
 	}
 }
 
-/** Flush to disk the writes in file spaces of the given type
-possibly cached by the OS.
-@param[in]	purpose	FIL_TYPE_TABLESPACE or FIL_TYPE_LOG */
-void
-fil_flush_file_spaces(
-	fil_type_t	purpose)
+/** fsync() recent writes to data files */
+void fil_flush_file_spaces()
 {
 	fil_space_t*	space;
 	ulint*		space_ids;
 	ulint		n_space_ids;
 
-	ut_ad(purpose == FIL_TYPE_TABLESPACE || purpose == FIL_TYPE_LOG);
-
 	mutex_enter(&fil_system.mutex);
 
 	n_space_ids = UT_LIST_GET_LEN(fil_system.unflushed_spaces);
@@ -4608,7 +4485,7 @@ fil_flush_file_spaces(
 	     space;
 	     space = UT_LIST_GET_NEXT(unflushed_spaces, space)) {
 
-		if (space->purpose == purpose
+		if (space->purpose == FIL_TYPE_TABLESPACE
 		    && !space->is_stopping()) {
 
 			space_ids[n_space_ids++] = space->id;
@@ -4931,13 +4808,8 @@ fil_names_dirty_and_write(
 	fil_names_write(space, mtr);
 
 	DBUG_EXECUTE_IF("fil_names_write_bogus",
-			{
-				char bogus_name[] = "./test/bogus file.ibd";
-				os_normalize_path(bogus_name);
-				fil_name_write(
-					SRV_LOG_SPACE_FIRST_ID, 0,
-					bogus_name, mtr);
-			});
+			fil_name_write(SRV_TMP_SPACE_ID, 0,
+				       "./test/bogus file.ibd", mtr););
 }
 
 /** On a log checkpoint, reset fil_names_dirty_and_write() flags
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index 9e92646556c..0fb35cff3b7 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -160,7 +160,6 @@ fsp_get_space_header(
 	buf_block_t*	block;
 	fsp_header_t*	header;
 
-	ut_ad(space->purpose != FIL_TYPE_LOG);
 	ut_ad(!FSP_FLAGS_GET_ZIP_SSIZE(space->flags)
 	      == !page_size.is_compressed());
 
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b3ac1d43ade..7e76bb580dc 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -18243,7 +18243,6 @@ checkpoint_now_set(THD*, st_mysql_sys_var*, void*, const void* save)
 			  ? log_sys.append_on_checkpoint->size() : 0)
 		       < log_sys.lsn) {
 			log_make_checkpoint_at(LSN_MAX, TRUE);
-			fil_flush_file_spaces(FIL_TYPE_LOG);
 		}
 
 		dberr_t err = fil_write_flushed_lsn(log_sys.lsn);
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 1c90e8dd5c8..83c6e68f9a9 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -906,15 +906,7 @@ ibuf_set_free_bits_func(
 	bitmap_page = ibuf_bitmap_get_map_page(block->page.id,
 					       block->page.size, &mtr);
 
-	switch (space->purpose) {
-	case FIL_TYPE_LOG:
-		ut_ad(0);
-		break;
-	case FIL_TYPE_TABLESPACE:
-		break;
-		/* fall through */
-	case FIL_TYPE_TEMPORARY:
-	case FIL_TYPE_IMPORT:
+	if (space->purpose != FIL_TYPE_TABLESPACE) {
 		mtr_set_log_mode(&mtr, MTR_LOG_NO_REDO);
 	}
 
@@ -2559,7 +2551,7 @@ ibuf_merge_space(
 	dtuple_t*	tuple = ibuf_search_tuple_build(space, 0, heap);
 	ulint		n_pages = 0;
 
-	ut_ad(space < SRV_LOG_SPACE_FIRST_ID);
+	ut_ad(space < SRV_TMP_SPACE_ID);
 
 	ibuf_mtr_start(&mtr);
 
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index bce9516b11d..31e82f7f013 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -49,9 +49,7 @@ enum fil_type_t {
 	/** a tablespace that is being imported (no logging until finished) */
 	FIL_TYPE_IMPORT,
 	/** persistent tablespace (for system, undo log or tables) */
-	FIL_TYPE_TABLESPACE,
-	/** redo log covering changes to files of FIL_TYPE_TABLESPACE */
-	FIL_TYPE_LOG
+	FIL_TYPE_TABLESPACE
 };
 
 /** Check if fil_type is any of FIL_TYPE_TEMPORARY, FIL_TYPE_IMPORT
@@ -722,13 +720,6 @@ void
 fil_close_all_files(void);
 /*=====================*/
 /*******************************************************************//**
-Closes the redo log files. There must not be any pending i/o's or not
-flushed modifications in the files. */
-void
-fil_close_log_files(
-/*================*/
-	bool	free);	/*!< in: whether to free the memory object */
-/*******************************************************************//**
 Sets the max tablespace id counter if the given number is bigger than the
 previous value. */
 void
@@ -1090,12 +1081,8 @@ fil_flush(
 void
 fil_flush(fil_space_t* space);
 
-/** Flush to disk the writes in file spaces of the given type
-possibly cached by the OS.
-@param[in]	purpose	FIL_TYPE_TABLESPACE or FIL_TYPE_LOG */
-void
-fil_flush_file_spaces(
-	fil_type_t	purpose);
+/** fsync() recent writes to data files */
+void fil_flush_file_spaces();
 /******************************************************************//**
 Checks the consistency of the tablespace cache.
 @return true if ok */
diff --git a/storage/innobase/include/fsp0types.h b/storage/innobase/include/fsp0types.h
index d99ca14fe9a..7e67fa739c7 100644
--- a/storage/innobase/include/fsp0types.h
+++ b/storage/innobase/include/fsp0types.h
@@ -27,11 +27,8 @@ Created May 26, 2009 Vasil Dimov
 #ifndef fsp0types_h
 #define fsp0types_h
 
-/** The fil_space_t::id of the redo log. All persistent tablespaces
-have a smaller fil_space_t::id. */
-#define SRV_LOG_SPACE_FIRST_ID		0xFFFFFFF0U
 /** The fil_space_t::id of the innodb_temporary tablespace. */
-#define SRV_TMP_SPACE_ID		0xFFFFFFFEU
+#define SRV_TMP_SPACE_ID		0xFFFFFFF0U
 
 #include "ut0byte.h"
 
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
index 3d28cacbfe0..ee0ced79379 100644
--- a/storage/innobase/include/log0log.h
+++ b/storage/innobase/include/log0log.h
@@ -600,6 +600,11 @@ struct log_t{
     @param[in]	n_files		number of files */
     void create(ulint n_files);
 
+    /** Close the redo log files */
+    void close_files();
+    /** Invoke fsync() on the redo log files */
+    void fsync();
+
     /** Close the redo log buffer. */
     void close()
     {
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index 71da751ad25..ce1ec17fbff 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -178,9 +178,6 @@ static const ulint OS_FILE_ERROR_MAX = 200;
 /** No transformations during read/write, write as is. */
 #define IORequestRead		IORequest(IORequest::READ)
 #define IORequestWrite		IORequest(IORequest::WRITE)
-#define IORequestLogRead	IORequest(IORequest::LOG | IORequest::READ)
-#define IORequestLogWrite	IORequest(IORequest::LOG | IORequest::WRITE)
-
 
 
 /**
@@ -200,11 +197,8 @@ class IORequest {
 		/** Data file */
 		DATA_FILE = 8,
 
-		/** Log file request*/
-		LOG = 16,
-
 		/** Disable partial read warnings */
-		DISABLE_PARTIAL_IO_WARNINGS = 32,
+		DISABLE_PARTIAL_IO_WARNINGS = 16,
 
 		/** Do not to wake i/o-handler threads, but the caller will do
 		the waking explicitly later, in this way the caller can post
@@ -213,13 +207,13 @@ class IORequest {
 		a simulated batch may introduce hidden chances of deadlocks,
 		because I/Os are not actually handled until all
 		have been posted: use with great caution! */
-		DO_NOT_WAKE = 64,
+		DO_NOT_WAKE = 32,
 
 		/** Ignore failed reads of non-existent pages */
-		IGNORE_MISSING = 128,
+		IGNORE_MISSING = 64,
 
 		/** Use punch hole if available*/
-		PUNCH_HOLE = 256,
+		PUNCH_HOLE = 128,
 	};
 
 	/** Default constructor */
@@ -289,13 +283,6 @@ class IORequest {
 		return((m_type & WRITE) == WRITE);
 	}
 
-	/** @return true if it is a redo log write */
-	bool is_log() const
-		MY_ATTRIBUTE((warn_unused_result))
-	{
-		return((m_type & LOG) == LOG);
-	}
-
 	/** @return true if the simulated AIO thread should be woken up */
 	bool is_wake() const
 		MY_ATTRIBUTE((warn_unused_result))
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 9e05383bfc6..b787fcd36f1 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -724,7 +724,7 @@ log_file_header_flush(
 	MONITOR_INC(MONITOR_LOG_IO);
 
 	srv_stats.os_log_pending_writes.inc();
-
+#if 0//FIXME: replace this
 	const ulint	page_no = ulint(dest_offset >> srv_page_size_shift);
 
 	fil_io(IORequestLogWrite, true,
@@ -732,7 +732,7 @@ log_file_header_flush(
 	       univ_page_size,
 	       ulint(dest_offset & (srv_page_size - 1)),
 	       OS_FILE_LOG_BLOCK_SIZE, buf, NULL);
-
+#endif
 	srv_stats.os_log_pending_writes.dec();
 }
 
@@ -840,8 +840,8 @@ log_write_buf(
 
 	MONITOR_INC(MONITOR_LOG_IO);
 
+#if 0 // FIXME: replace this
 	srv_stats.os_log_pending_writes.inc();
-
 	ut_a((next_offset >> srv_page_size_shift) <= ULINT_MAX);
 
 	const ulint	page_no = ulint(next_offset >> srv_page_size_shift);
@@ -850,8 +850,8 @@ log_write_buf(
 	       page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
 	       univ_page_size,
 	       ulint(next_offset & (srv_page_size - 1)), write_len, buf, NULL);
-
 	srv_stats.os_log_pending_writes.dec();
+#endif
 
 	srv_stats.os_log_written.add(write_len);
 	srv_stats.log_writes.inc();
@@ -867,20 +867,28 @@ log_write_buf(
 	}
 }
 
+/** Close the redo log files */
+void log_t::files::close_files()
+{
+	ut_ad(!"FIXME: implement this! (replaces fil_close_log_files())");
+}
+
+/** Invoke fsync() on the redo log files */
+void log_t::files::fsync()
+{
+	ut_ad(!"FIXME: implement this!");
+}
+
 /** Flush the recently written changes to the log file.
 and invoke log_mutex_enter(). */
-static
-void
-log_write_flush_to_disk_low()
+static void log_write_flush_to_disk_low()
 {
-	/* FIXME: This is not holding log_sys.mutex while
-	calling os_event_set()! */
 	ut_a(log_sys.n_pending_flushes == 1); /* No other threads here */
 
 	bool	do_flush = srv_file_flush_method != SRV_O_DSYNC;
 
 	if (do_flush) {
-		fil_flush(SRV_LOG_SPACE_FIRST_ID);
+		log_sys.log.fsync();
 	}
 
 	MONITOR_DEC(MONITOR_PENDING_LOG_FLUSH);
@@ -1345,7 +1353,7 @@ log_group_checkpoint(lsn_t end_lsn)
 		rw_lock_x_lock_gen(&log_sys.checkpoint_lock,
 				   LOG_CHECKPOINT);
 	}
-
+#if 0 // FIXME: replace this
 	/* Note: We alternate the physical place of the checkpoint info.
 	See the (next_checkpoint_no & 1) below. */
 
@@ -1356,6 +1364,7 @@ log_group_checkpoint(lsn_t end_lsn)
 	       ? LOG_CHECKPOINT_2 : LOG_CHECKPOINT_1,
 	       OS_FILE_LOG_BLOCK_SIZE,
 	       buf, reinterpret_cast<void*>(1) /* checkpoint write */);
+#endif
 }
 
 /** Read a log group header page to log_sys.checkpoint_buf.
@@ -1367,12 +1376,13 @@ void log_header_read(ulint header)
 	log_sys.n_log_ios++;
 
 	MONITOR_INC(MONITOR_LOG_IO);
-
+#if 0 // FIXME: replace this
 	fil_io(IORequestLogRead, true,
 	       page_id_t(SRV_LOG_SPACE_FIRST_ID,
 			 header >> srv_page_size_shift),
 	       univ_page_size, header & (srv_page_size - 1),
 	       OS_FILE_LOG_BLOCK_SIZE, log_sys.checkpoint_buf, NULL);
+#endif
 }
 
 /** Write checkpoint info to the log header and invoke log_mutex_exit().
@@ -1452,7 +1462,7 @@ log_checkpoint(
 #ifdef _WIN32
 	case SRV_ALL_O_DIRECT_FSYNC:
 #endif
-		fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
+		fil_flush_file_spaces();
 	}
 
 	log_mutex_enter();
@@ -1909,7 +1919,7 @@ logs_empty_and_mark_files_at_shutdown(void)
 
 		/* Ensure that all buffered changes are written to the
 		redo log before fil_close_all_files(). */
-		fil_flush_file_spaces(FIL_TYPE_LOG);
+		//FIXME: fsync()
 	} else {
 		lsn = srv_start_lsn;
 	}
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 23dfc4afa0f..692d16d71e7 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -764,7 +764,7 @@ bool log_t::files::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
 	log_sys.n_log_ios++;
 
 	MONITOR_INC(MONITOR_LOG_IO);
-
+#if 0 // FIXME: replace this
 	ut_a((source_offset >> srv_page_size_shift) <= ULINT_MAX);
 
 	const ulint	page_no = ulint(source_offset >> srv_page_size_shift);
@@ -774,6 +774,7 @@ bool log_t::files::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
 	       univ_page_size,
 	       ulint(source_offset & (srv_page_size - 1)),
 	       len, buf, NULL);
+#endif
 
 	for (ulint l = 0; l < len; l += OS_FILE_LOG_BLOCK_SIZE,
 		     buf += OS_FILE_LOG_BLOCK_SIZE,
@@ -846,8 +847,6 @@ bool log_t::files::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
 	return(success);
 }
 
-
-
 /********************************************************//**
 Copies a log segment from the most up-to-date log group to the other log
 groups, so that they all contain the latest log data. Also writes the info
@@ -985,13 +984,14 @@ static dberr_t recv_log_format_0_recover(lsn_t lsn, bool crypt)
 	static const char* NO_UPGRADE_RECOVERY_MSG =
 		"Upgrade after a crash is not supported."
 		" This redo log was created before MariaDB 10.2.2";
-
+#if 0 // FIXME: replace this
 	fil_io(IORequestLogRead, true,
 	       page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
 	       univ_page_size,
 	       ulint((source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1))
 		     & (srv_page_size - 1)),
 	       OS_FILE_LOG_BLOCK_SIZE, buf, NULL);
+#endif
 
 	if (log_block_calc_checksum_format_0(buf)
 	    != log_block_get_checksum(buf)
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 3c8a3a3e578..efae720bdcc 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -1934,7 +1934,6 @@ LinuxAIOHandler::collect()
 			/* Deallocate unused blocks from file system.
 			This is newer done to page 0 or to log files.*/
 			if (slot->offset > 0
-			    && !slot->type.is_log()
 			    && slot->type.is_write()
 			    && slot->type.punch_hole()) {
 
@@ -4883,7 +4882,6 @@ os_file_io(
 			bytes_returned += n_bytes;
 
 			if (offset > 0
-			    && !type.is_log()
 			    && type.is_write()
 			    && type.punch_hole()) {
 				*err = type.punch_hole(file, offset, n);
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 4e9f16a502f..3a3cf0e55fb 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3728,7 +3728,7 @@ row_import_for_mysql(
 	ut_ad(!table->is_temporary());
 
 	ut_ad(table->space_id);
-	ut_ad(table->space_id < SRV_LOG_SPACE_FIRST_ID);
+	ut_ad(table->space_id < SRV_TMP_SPACE_ID);
 	ut_ad(prebuilt->trx);
 	ut_ad(!table->is_readable());
 
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 54b0e75fd80..8296bc140e4 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -452,7 +452,7 @@ create_log_files(
 	ib_logfile0, so that crash recovery cannot find it until it
 	has been completed and renamed. */
 	sprintf(logfilename + dirnamelen, "ib_logfile%u", INIT_LOG_FILE0);
-
+#if 0 // FIXME: replace this
 	fil_space_t*	log_space = fil_space_create(
 		"innodb_redo_log", SRV_LOG_SPACE_FIRST_ID, 0, FIL_TYPE_LOG,
 		NULL/* innodb_encrypt_log works at a different level */);
@@ -473,6 +473,7 @@ create_log_files(
 		log_space->add(logfilename, OS_FILE_CLOSED, size,
 			       false, false);
 	}
+#endif
 
 	log_sys.log.create(srv_n_log_files);
 	if (!log_set_capacity(srv_log_file_size_requested)) {
@@ -512,7 +513,7 @@ create_log_files_rename(
 {
 	/* If innodb_flush_method=O_DSYNC,
 	we need to explicitly flush the log buffers. */
-	fil_flush(SRV_LOG_SPACE_FIRST_ID);
+	log_sys.log.fsync();
 
 	ut_ad(!srv_log_files_created);
 	ut_d(srv_log_files_created = true);
@@ -522,7 +523,7 @@ create_log_files_rename(
 
 	/* Close the log files, so that we can rename
 	the first one. */
-	fil_close_log_files(false);
+	log_sys.log.close_files();
 
 	/* Rename the first log file, now that a log
 	checkpoint has been created. */
@@ -1232,7 +1233,7 @@ srv_prepare_to_delete_redo_log_files(
 
 		/* If innodb_flush_method=O_DSYNC,
 		we need to explicitly flush the log buffers. */
-		fil_flush(SRV_LOG_SPACE_FIRST_ID);
+		log_sys.log.fsync();
 
 		ut_ad(flushed_lsn == log_get_lsn());
 
@@ -1716,7 +1717,7 @@ dberr_t srv_start(bool create_new_db)
 		/* Create the in-memory file space objects. */
 
 		sprintf(logfilename + dirnamelen, "ib_logfile%u", 0);
-
+#if 0 // FIXME: replace this
 		/* Disable the doublewrite buffer for log files. */
 		fil_space_t*	log_space = fil_space_create(
 			"innodb_redo_log",
@@ -1738,7 +1739,7 @@ dberr_t srv_start(bool create_new_db)
 			log_space->add(logfilename, OS_FILE_CLOSED, size,
 				       false, false);
 		}
-
+#endif
 		log_sys.log.create(srv_n_log_files_found);
 
 		if (!log_set_capacity(srv_log_file_size_requested)) {
@@ -1972,7 +1973,8 @@ dberr_t srv_start(bool create_new_db)
 			buf_flush_sync_all_buf_pools();
 			err = fil_write_flushed_lsn(log_get_lsn());
 			ut_ad(!buf_pool_check_no_pending_io());
-			fil_close_log_files(true);
+			log_sys.log.close_files();
+			log_sys.log.close();
 			if (err == DB_SUCCESS) {
 				bool trunc = srv_operation
 					== SRV_OPERATION_RESTORE;
@@ -2035,7 +2037,7 @@ dberr_t srv_start(bool create_new_db)
 
 			/* Close and free the redo log files, so that
 			we can replace them. */
-			fil_close_log_files(true);
+			log_sys.log.close_files();
 
 			DBUG_EXECUTE_IF("innodb_log_abort_5",
 					return(srv_init_abort(DB_ERROR)););
