Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
926bd676
Commit
926bd676
authored
May 20, 2001
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge heikki@work.mysql.com:/home/my/mysql
into donna.mysql.fi:/home/heikki/mysqle
parents
112ad672
23e19c90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
12 deletions
+60
-12
innobase/include/os0file.h
innobase/include/os0file.h
+11
-1
innobase/os/os0file.c
innobase/os/os0file.c
+37
-7
innobase/srv/srv0start.c
innobase/srv/srv0start.c
+12
-4
No files found.
innobase/include/os0file.h
View file @
926bd676
...
...
@@ -100,7 +100,17 @@ log. */
requests in a batch, and only after that
wake the i/o-handler thread; this has
effect only in simulated aio */
#define OS_WIN31 1
#define OS_WIN95 2
#define OS_WINNT 3
/***************************************************************************
Gets the operating system version. Currently works only on Windows. */
ulint
os_get_os_version
(
void
);
/*===================*/
/* out: OS_WIN95, OS_WIN31, OS_WINNT (2000 == NT) */
/********************************************************************
Opens an existing file or creates a new. */
...
...
innobase/os/os0file.c
View file @
926bd676
...
...
@@ -103,6 +103,38 @@ os_aio_array_t* os_aio_sync_array = NULL;
ulint
os_aio_n_segments
=
ULINT_UNDEFINED
;
/***************************************************************************
Gets the operating system version. Currently works only on Windows. */
ulint
os_get_os_version
(
void
)
/*===================*/
/* out: OS_WIN95, OS_WIN31, OS_WINNT (2000 == NT) */
{
#ifdef __WIN__
OSVERSIONINFO
os_info
;
os_info
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFO
);
ut_a
(
GetVersionEx
(
&
os_info
));
if
(
os_info
.
dwPlatformId
==
VER_PLATFORM_WIN32s
)
{
return
(
OS_WIN31
);
}
else
if
(
os_info
.
dwPlatformId
==
VER_PLATFORM_WIN32_WINDOWS
)
{
return
(
OS_WIN95
);
}
else
if
(
os_info
.
dwPlatformId
==
VER_PLATFORM_WIN32_NT
)
{
return
(
OS_WINNT
);
}
else
{
ut_error
;
return
(
0
);
}
#else
ut_error
;
return
(
0
);
#endif
}
/***************************************************************************
Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
...
...
@@ -438,13 +470,13 @@ os_file_set_size(
byte
*
buf
;
try_again:
/* We use a very big
16 MB buffer in writing because Linux is
/* We use a very big
8 MB buffer in writing because Linux may be
extremely slow in fdatasync on 1 MB writes */
buf
=
ut_malloc
(
UNIV_PAGE_SIZE
*
1024
);
buf
=
ut_malloc
(
UNIV_PAGE_SIZE
*
512
);
/* Write buffer full of zeros */
for
(
i
=
0
;
i
<
UNIV_PAGE_SIZE
*
1024
;
i
++
)
{
for
(
i
=
0
;
i
<
UNIV_PAGE_SIZE
*
512
;
i
++
)
{
buf
[
i
]
=
'\0'
;
}
...
...
@@ -456,10 +488,10 @@ try_again:
UT_NOT_USED
(
size_high
);
#endif
while
(
offset
<
low
)
{
if
(
low
-
offset
<
UNIV_PAGE_SIZE
*
1024
)
{
if
(
low
-
offset
<
UNIV_PAGE_SIZE
*
512
)
{
n_bytes
=
low
-
offset
;
}
else
{
n_bytes
=
UNIV_PAGE_SIZE
*
1024
;
n_bytes
=
UNIV_PAGE_SIZE
*
512
;
}
ret
=
os_file_write
(
name
,
file
,
buf
,
offset
,
0
,
n_bytes
);
...
...
@@ -475,8 +507,6 @@ try_again:
ret
=
os_file_flush
(
file
);
fsync
(
file
);
if
(
ret
)
{
return
(
TRUE
);
}
...
...
innobase/srv/srv0start.c
View file @
926bd676
...
...
@@ -549,11 +549,19 @@ innobase_start_or_create_for_mysql(void)
srv_n_file_io_threads
=
4
;
#endif
#ifdef WIN_ASYNC_IO
/* On NT always use aio */
os_aio_use_native_aio
=
TRUE
;
#endif
#ifdef __WIN__
if
(
os_get_os_version
()
==
OS_WIN95
||
os_get_os_version
()
==
OS_WIN31
)
{
/* On Win 95, 98, ME, and Win32 subsystem for Windows 3.1 use
simulated aio */
os_aio_use_native_aio
=
FALSE
;
srv_n_file_io_threads
=
4
;
}
else
{
/* On NT and Win 2000 always use aio */
os_aio_use_native_aio
=
TRUE
;
}
#endif
if
(
!
os_aio_use_native_aio
)
{
os_aio_init
(
4
*
SRV_N_PENDING_IOS_PER_THREAD
*
srv_n_file_io_threads
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment