diff options
author | Marc Alff <marc.alff@sun.com> | 2009-12-04 18:26:15 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2009-12-04 18:26:15 -0700 |
commit | 04fe40393d9d0ef81cc6a770bda67ab67fe4154e (patch) | |
tree | 9ca152d7f2ac50cfd8b7fca83f87cb06148d97a0 /storage/myisam/mi_dynrec.c | |
parent | 560e76c567c3551f5a4320acfc954200e8330ad8 (diff) | |
download | mariadb-git-04fe40393d9d0ef81cc6a770bda67ab67fe4154e.tar.gz |
WL#2360 Performance schema
Part II, engines instrumentation
Diffstat (limited to 'storage/myisam/mi_dynrec.c')
-rw-r--r-- | storage/myisam/mi_dynrec.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 1de0fef876d..4c681eeff5f 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -143,7 +143,7 @@ size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer, { DBUG_PRINT("info", ("mi_read with mmap %d\n", info->dfile)); if (info->s->concurrent_insert) - rw_rdlock(&info->s->mmap_lock); + mysql_rwlock_rdlock(&info->s->mmap_lock); /* The following test may fail in the following cases: @@ -156,24 +156,24 @@ size_t mi_mmap_pread(MI_INFO *info, uchar *Buffer, { memcpy(Buffer, info->s->file_map + offset, Count); if (info->s->concurrent_insert) - rw_unlock(&info->s->mmap_lock); + mysql_rwlock_unlock(&info->s->mmap_lock); return 0; } else { if (info->s->concurrent_insert) - rw_unlock(&info->s->mmap_lock); - return my_pread(info->dfile, Buffer, Count, offset, MyFlags); + mysql_rwlock_unlock(&info->s->mmap_lock); + return mysql_file_pread(info->dfile, Buffer, Count, offset, MyFlags); } } - /* wrapper for my_pread in case if mmap isn't used */ + /* wrapper for mysql_file_pread in case if mmap isn't used */ size_t mi_nommap_pread(MI_INFO *info, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) { - return my_pread(info->dfile, Buffer, Count, offset, MyFlags); + return mysql_file_pread(info->dfile, Buffer, Count, offset, MyFlags); } @@ -198,7 +198,7 @@ size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer, { DBUG_PRINT("info", ("mi_write with mmap %d\n", info->dfile)); if (info->s->concurrent_insert) - rw_rdlock(&info->s->mmap_lock); + mysql_rwlock_rdlock(&info->s->mmap_lock); /* The following test may fail in the following cases: @@ -211,26 +211,26 @@ size_t mi_mmap_pwrite(MI_INFO *info, const uchar *Buffer, { memcpy(info->s->file_map + offset, Buffer, Count); if (info->s->concurrent_insert) - rw_unlock(&info->s->mmap_lock); + mysql_rwlock_unlock(&info->s->mmap_lock); return 0; } else { info->s->nonmmaped_inserts++; if (info->s->concurrent_insert) - rw_unlock(&info->s->mmap_lock); - return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags); + mysql_rwlock_unlock(&info->s->mmap_lock); + return mysql_file_pwrite(info->dfile, Buffer, Count, offset, MyFlags); } } - /* wrapper for my_pwrite in case if mmap isn't used */ + /* wrapper for mysql_file_pwrite in case if mmap isn't used */ size_t mi_nommap_pwrite(MI_INFO *info, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) { - return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags); + return mysql_file_pwrite(info->dfile, Buffer, Count, offset, MyFlags); } @@ -1642,7 +1642,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, while (length > IO_SIZE*2) { - if (my_pread(file,temp_buff,next_length,filepos, MYF(MY_NABP)) || + if (mysql_file_pread(file, temp_buff, next_length, filepos, MYF(MY_NABP)) || memcmp(buff, temp_buff, next_length)) goto err; filepos+=next_length; @@ -1650,7 +1650,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, length-= next_length; next_length=IO_SIZE*2; } - if (my_pread(file,temp_buff,length,filepos,MYF(MY_NABP))) + if (mysql_file_pread(file, temp_buff, length, filepos, MYF(MY_NABP))) goto err; DBUG_RETURN(memcmp(buff,temp_buff,length)); err: @@ -1831,8 +1831,9 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, uchar *buf, block_info.filepos + block_info.data_len && flush_io_cache(&info->rec_cache)) goto err; - /* my_seek(info->dfile,filepos,MY_SEEK_SET,MYF(0)); */ - if (my_read(info->dfile,(uchar*) to,block_info.data_len,MYF(MY_NABP))) + /* mysql_file_seek(info->dfile, filepos, MY_SEEK_SET, MYF(0)); */ + if (mysql_file_read(info->dfile, (uchar*) to, block_info.data_len, + MYF(MY_NABP))) { if (my_errno == -1) my_errno= HA_ERR_WRONG_IN_RECORD; /* Unexpected end of file */ @@ -1880,12 +1881,12 @@ uint _mi_get_block_info(MI_BLOCK_INFO *info, File file, my_off_t filepos) if (file >= 0) { /* - We do not use my_pread() here because we want to have the file + We do not use mysql_file_pread() here because we want to have the file pointer set to the end of the header after this function. - my_pread() may leave the file pointer untouched. + mysql_file_pread() may leave the file pointer untouched. */ - my_seek(file,filepos,MY_SEEK_SET,MYF(0)); - if (my_read(file, header, sizeof(info->header),MYF(0)) != + mysql_file_seek(file, filepos, MY_SEEK_SET, MYF(0)); + if (mysql_file_read(file, header, sizeof(info->header), MYF(0)) != sizeof(info->header)) goto err; } |