From eb6364619ff807645230479bf7d2eb87d1a4edb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 27 Nov 2018 14:28:07 +0200 Subject: [PATCH] Remove the redundant variable fil_n_file_opened --- extra/mariabackup/fil_cur.cc | 2 -- storage/innobase/fil/fil0fil.cc | 5 ----- storage/innobase/include/fil0fil.h | 3 --- storage/innobase/include/srv0srv.h | 2 +- storage/innobase/srv/srv0mon.cc | 2 +- storage/innobase/srv/srv0srv.cc | 2 +- 6 files changed, 3 insertions(+), 13 deletions(-) diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc index f5b3db1e184..7b7cfb3c948 100644 --- a/extra/mariabackup/fil_cur.cc +++ b/extra/mariabackup/fil_cur.cc @@ -110,7 +110,6 @@ xb_fil_node_close_file( ut_a(fil_system->n_open > 0); fil_system->n_open--; - fil_n_file_opened--; if (node->space->purpose == FIL_TYPE_TABLESPACE && fil_is_user_tablespace_id(node->space->id)) { @@ -179,7 +178,6 @@ xb_fil_cur_open( mutex_enter(&fil_system->mutex); fil_system->n_open++; - fil_n_file_opened++; if (node->space->purpose == FIL_TYPE_TABLESPACE && fil_is_user_tablespace_id(node->space->id)) { diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 6c5ae70a2cc..6368d4b4751 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -138,9 +138,6 @@ ulint fil_n_pending_log_flushes = 0; /** Number of pending tablespace flushes */ ulint fil_n_pending_tablespace_flushes = 0; -/** Number of files currently open */ -ulint fil_n_file_opened = 0; - /** The null file address */ fil_addr_t fil_addr_null = {FIL_NULL, 0}; @@ -758,7 +755,6 @@ retry: ut_a(node->is_open()); fil_system->n_open++; - fil_n_file_opened++; if (fil_space_belongs_in_lru(space)) { @@ -797,7 +793,6 @@ fil_node_close_file( ut_ad(!node->is_open()); ut_a(fil_system->n_open > 0); fil_system->n_open--; - fil_n_file_opened--; if (fil_space_belongs_in_lru(node->space)) { diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 34bf216fd97..d1bd2dc14d4 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -443,9 +443,6 @@ extern ulint fil_n_pending_log_flushes; /** Number of pending tablespace flushes */ extern ulint fil_n_pending_tablespace_flushes; -/** Number of files currently open */ -extern ulint fil_n_file_opened; - #ifndef UNIV_INNOCHECKSUM /** Look up a tablespace. diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 4117a3f0dd3..7ad5d2f2183 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -1020,7 +1020,7 @@ struct export_var_t{ ulint innodb_system_rows_inserted; /*!< srv_n_system_rows_inserted */ ulint innodb_system_rows_updated; /*!< srv_n_system_rows_updated */ ulint innodb_system_rows_deleted; /*!< srv_n_system_rows_deleted*/ - ulint innodb_num_open_files; /*!< fil_n_file_opened */ + ulint innodb_num_open_files; /*!< fil_system_t::n_open */ ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */ ulint innodb_available_undo_logs; /*!< srv_available_undo_logs */ diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index f6c388f2dcf..de1c0d27efe 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -1960,7 +1960,7 @@ srv_mon_process_existing_counter( break; case MONITOR_OVLD_N_FILE_OPENED: - value = fil_n_file_opened; + value = fil_system->n_open; break; case MONITOR_OVLD_IBUF_MERGE_INSERT: diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 08d201511da..5572521662b 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1626,7 +1626,7 @@ srv_export_innodb_status(void) export_vars.innodb_system_rows_deleted = srv_stats.n_system_rows_deleted; - export_vars.innodb_num_open_files = fil_n_file_opened; + export_vars.innodb_num_open_files = fil_system->n_open; export_vars.innodb_truncated_status_writes = srv_truncated_status_writes;