Skip to content

Commit d434270

Browse files
committed
Remove dead references to NO_FALLOCATE.
1 parent cbf80b0 commit d434270

File tree

5 files changed

+38
-66
lines changed

5 files changed

+38
-66
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ fil_space_is_flushed(
484484
return(true);
485485
}
486486

487-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
487+
#ifdef UNIV_LINUX
488488

489489
#include <sys/ioctl.h>
490490
/** FusionIO atomic write control info */
@@ -511,7 +511,7 @@ fil_fusionio_enable_atomic_write(os_file_t file)
511511

512512
return(false);
513513
}
514-
#endif /* !NO_FALLOCATE && UNIV_LINUX */
514+
#endif /* UNIV_LINUX */
515515

516516
/** Append a file to the chain of files of a space.
517517
@param[in] name file name of a file that is not open
@@ -3520,11 +3520,10 @@ fil_ibd_create(
35203520
return(DB_ERROR);
35213521
}
35223522

3523-
bool atomic_write;
3524-
3525-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
3526-
if (fil_fusionio_enable_atomic_write(file)) {
3523+
#ifdef UNIV_LINUX
3524+
const bool atomic_write = fil_fusionio_enable_atomic_write(file);
35273525

3526+
if (atomic_write) {
35283527
/* This is required by FusionIO HW/Firmware */
35293528
int ret = posix_fallocate(file, 0, size * UNIV_PAGE_SIZE);
35303529

@@ -3547,21 +3546,14 @@ fil_ibd_create(
35473546
} else {
35483547
success = true;
35493548
}
3550-
3551-
atomic_write = true;
3552-
} else {
3553-
atomic_write = false;
3554-
3549+
} else
3550+
#else
3551+
const bool atomic_write = false;
3552+
#endif /* UNIV_LINUX */
3553+
{
35553554
success = os_file_set_size(
35563555
path, file, size * UNIV_PAGE_SIZE, srv_read_only_mode);
35573556
}
3558-
#else
3559-
atomic_write = false;
3560-
3561-
success = os_file_set_size(
3562-
path, file, size * UNIV_PAGE_SIZE, srv_read_only_mode);
3563-
3564-
#endif /* !NO_FALLOCATE && UNIV_LINUX */
35653557

35663558
if (!success) {
35673559
os_file_close(file);
@@ -3913,18 +3905,13 @@ fil_ibd_open(
39133905
df_dict.close();
39143906
}
39153907

3916-
bool atomic_write;
3917-
3918-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
3919-
if (!srv_use_doublewrite_buf && df_default.is_open()) {
3920-
atomic_write = fil_fusionio_enable_atomic_write(
3921-
df_default.handle());
3922-
} else {
3923-
atomic_write = false;
3924-
}
3908+
#ifdef UNIV_LINUX
3909+
const bool atomic_write = !srv_use_doublewrite_buf
3910+
&& df_default.is_open()
3911+
&& fil_fusionio_enable_atomic_write(df_default.handle());
39253912
#else
3926-
atomic_write = false;
3927-
#endif /* !NO_FALLOCATE && UNIV_LINUX */
3913+
const bool atomic_write = false;
3914+
#endif /* UNIV_LINUX */
39283915

39293916
/* We have now checked all possible tablespace locations and
39303917
have a count of how many unique files we found. If things are
@@ -5052,7 +5039,7 @@ fil_space_extend(
50525039
ut_ad(len > 0);
50535040
const char* name = node->name == NULL ? space->name : node->name;
50545041

5055-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
5042+
#ifdef UNIV_LINUX
50565043
/* This is required by FusionIO HW/Firmware */
50575044
int ret = posix_fallocate(node->handle, node_start, len);
50585045

@@ -5077,7 +5064,7 @@ fil_space_extend(
50775064

50785065
err = DB_IO_ERROR;
50795066
}
5080-
#endif /* NO_FALLOCATE || !UNIV_LINUX */
5067+
#endif
50815068

50825069
if (!node->atomic_write || err == DB_IO_ERROR) {
50835070

storage/innobase/fsp/fsp0space.cc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,12 @@ Tablespace::open_or_create(bool is_temp)
122122
break;
123123
}
124124

125-
bool atomic_write;
126-
127-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
128-
if (!srv_use_doublewrite_buf) {
129-
atomic_write = fil_fusionio_enable_atomic_write(
130-
it->m_handle);
131-
} else {
132-
atomic_write = false;
133-
}
125+
#ifdef UNIV_LINUX
126+
const bool atomic_write = fil_fusionio_enable_atomic_write(
127+
it->m_handle);
134128
#else
135-
atomic_write = false;
136-
#endif /* !NO_FALLOCATE && UNIV_LINUX */
129+
const bool atomic_write = false;
130+
#endif
137131

138132
/* We can close the handle now and open the tablespace
139133
the proper way. */

storage/innobase/fsp/fsp0sysspace.cc

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -909,28 +909,24 @@ SysTablespace::open_or_create(
909909
return(err);
910910
}
911911

912-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
912+
#ifdef UNIV_LINUX
913913
/* Note: This should really be per node and not per
914914
tablespace because a tablespace can contain multiple
915915
files (nodes). The implication is that all files of
916916
the tablespace should be on the same medium. */
917917

918-
if (fil_fusionio_enable_atomic_write(it->m_handle)) {
918+
it->m_atomic_write
919+
= fil_fusionio_enable_atomic_write(it->m_handle);
919920

920-
if (srv_use_doublewrite_buf) {
921-
ib::info() << "FusionIO atomic IO enabled,"
922-
" disabling the double write buffer";
921+
if (it->m_atomic_write && srv_use_doublewrite_buf) {
922+
ib::info() << "FusionIO atomic IO enabled,"
923+
" disabling the double write buffer";
923924

924-
srv_use_doublewrite_buf = false;
925-
}
926-
927-
it->m_atomic_write = true;
928-
} else {
929-
it->m_atomic_write = false;
925+
srv_use_doublewrite_buf = false;
930926
}
931927
#else
932928
it->m_atomic_write = false;
933-
#endif /* !NO_FALLOCATE && UNIV_LINUX*/
929+
#endif
934930
}
935931

936932
if (!create_new_db && flush_lsn) {

storage/innobase/include/fil0fil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,14 +1799,14 @@ fil_names_clear(
17991799
lsn_t lsn,
18001800
bool do_write);
18011801

1802-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
1802+
#ifdef UNIV_LINUX
18031803
/**
18041804
Try and enable FusionIO atomic writes.
18051805
@param[in] file OS file handle
18061806
@return true if successful */
18071807
bool
18081808
fil_fusionio_enable_atomic_write(os_file_t file);
1809-
#endif /* !NO_FALLOCATE && UNIV_LINUX */
1809+
#endif /* UNIV_LINUX */
18101810

18111811
/** Note that the file system where the file resides doesn't support PUNCH HOLE
18121812
@param[in,out] node Node to set */

storage/innobase/srv/srv0start.cc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -681,17 +681,12 @@ srv_undo_tablespace_open(
681681
os_offset_t size;
682682
fil_space_t* space;
683683

684-
bool atomic_write;
685-
686-
#if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
687-
if (!srv_use_doublewrite_buf) {
688-
atomic_write = fil_fusionio_enable_atomic_write(fh);
689-
} else {
690-
atomic_write = false;
691-
}
684+
#ifdef UNIV_LINUX
685+
const bool atomic_write = !srv_use_doublewrite_buf
686+
&& fil_fusionio_enable_atomic_write(fh);
692687
#else
693-
atomic_write = false;
694-
#endif /* !NO_FALLOCATE && UNIV_LINUX */
688+
const bool atomic_write = false;
689+
#endif
695690

696691
size = os_file_get_size(fh);
697692
ut_a(size != (os_offset_t) -1);

0 commit comments

Comments
 (0)