summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache2.c
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-06-11 11:20:31 +0300
committermonty@mashka.mysql.fi <>2002-06-11 11:20:31 +0300
commit2aecdd1a91bf8386829146609ce0219c51793841 (patch)
tree8fcaabe013fff43cf466235067f2c47f0cd66531 /mysys/mf_iocache2.c
parentdb41437a100e204e60f45d5c9a6b26f63e512659 (diff)
downloadmariadb-git-2aecdd1a91bf8386829146609ce0219c51793841.tar.gz
Big code cleanup/review before 4.0.2 release.
(All commit emails since 4.0.1 checked) This had to be done now, before the 4.1 tree changes to much, to make it easy to propagate bug fixes to the 4.1 tree.
Diffstat (limited to 'mysys/mf_iocache2.c')
-rw-r--r--mysys/mf_iocache2.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index c56022e93e8..b19ca391672 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -27,32 +27,36 @@
my_off_t my_b_append_tell(IO_CACHE* info)
{
- /* prevent optimizer from putting res in a register when debugging
- we need this to be able to see the value of res when the assert fails
+ /*
+ Prevent optimizer from putting res in a register when debugging
+ we need this to be able to see the value of res when the assert fails
*/
dbug_volatile my_off_t res;
-/* we need to lock the append buffer mutex to keep flush_io_cache()
- from messing with the variables that we need in order to provide the
- answer to the question.
-*/
+
+ /*
+ We need to lock the append buffer mutex to keep flush_io_cache()
+ from messing with the variables that we need in order to provide the
+ answer to the question.
+ */
#ifdef THREAD
pthread_mutex_lock(&info->append_buffer_lock);
#endif
- /* save the value of my_tell in res so we can see it when studying
- coredump
- */
#ifndef DBUG_OFF
- /* make sure EOF is where we think it is. Note that we cannot just use
- my_tell() because we have a reader thread that could have left the
- file offset in a non-EOF location
- */
+ /*
+ Make sure EOF is where we think it is. Note that we cannot just use
+ my_tell() because we have a reader thread that could have left the
+ file offset in a non-EOF location
+ */
{
- volatile my_off_t save_pos;
- save_pos = my_tell(info->file,MYF(0));
- my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0));
- DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer)
- == (res=my_tell(info->file,MYF(0))));
- my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0));
+ volatile my_off_t save_pos;
+ save_pos = my_tell(info->file,MYF(0));
+ my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0));
+ /*
+ Save the value of my_tell in res so we can see it when studying coredump
+ */
+ DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer)
+ == (res=my_tell(info->file,MYF(0))));
+ my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0));
}
#endif
res = info->end_of_file + (info->write_pos-info->append_read_pos);
@@ -74,10 +78,9 @@ void my_b_seek(IO_CACHE *info,my_off_t pos)
DBUG_PRINT("enter",("pos: %lu", (ulong) pos));
/*
- TODO: verify that it is OK to do seek in the non-append
- area in SEQ_READ_APPEND cache
- */
- /* TODO:
+ TODO:
+ Verify that it is OK to do seek in the non-append
+ area in SEQ_READ_APPEND cache
a) see if this always works
b) see if there is a better way to make it work
*/