mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
cleanup: my_off_t mmaped_length -> size_t
all mmap-related functions take size_t lengh. mmaped_length was casted to size_t *every single time*
This commit is contained in:
@@ -4791,8 +4791,7 @@ static int replace_data_file(HA_CHECK *param, MI_INFO *info, File new_file)
|
||||
*/
|
||||
if (info->s->file_map)
|
||||
{
|
||||
(void) my_munmap((char*) info->s->file_map,
|
||||
(size_t) info->s->mmaped_length);
|
||||
(void) my_munmap((char*) info->s->file_map, info->s->mmaped_length);
|
||||
info->s->file_map= NULL;
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
|
||||
#if defined(HAVE_MADVISE)
|
||||
madvise((char*) info->s->file_map, size, MADV_RANDOM);
|
||||
#endif
|
||||
info->s->mmaped_length= size;
|
||||
info->s->mmaped_length= (size_t) size;
|
||||
info->s->file_read= mi_mmap_pread;
|
||||
info->s->file_write= mi_mmap_pwrite;
|
||||
DBUG_RETURN(0);
|
||||
@@ -118,8 +118,7 @@ int mi_munmap_file(MI_INFO *info)
|
||||
{
|
||||
int ret;
|
||||
DBUG_ENTER("mi_unmap_file");
|
||||
if ((ret= my_munmap((void*) info->s->file_map,
|
||||
(size_t) info->s->mmaped_length)))
|
||||
if ((ret= my_munmap((void*) info->s->file_map, info->s->mmaped_length)))
|
||||
DBUG_RETURN(ret);
|
||||
info->s->file_read= mi_nommap_pread;
|
||||
info->s->file_write= mi_nommap_pwrite;
|
||||
|
@@ -114,7 +114,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
|
||||
if (myisam_flush)
|
||||
{
|
||||
if (share->file_map)
|
||||
my_msync(info->dfile, share->file_map, (size_t)share->mmaped_length, MS_SYNC);
|
||||
my_msync(info->dfile, share->file_map, share->mmaped_length, MS_SYNC);
|
||||
if (mysql_file_sync(share->kfile, MYF(0)))
|
||||
mark_crashed= error= my_errno;
|
||||
if (mysql_file_sync(info->dfile, MYF(0)))
|
||||
@@ -529,7 +529,7 @@ int _mi_writeinfo(register MI_INFO *info, uint operation)
|
||||
if (myisam_flush)
|
||||
{
|
||||
if (share->file_map)
|
||||
my_msync(info->dfile, share->file_map, (size_t)share->mmaped_length, MS_SYNC);
|
||||
my_msync(info->dfile, share->file_map, share->mmaped_length, MS_SYNC);
|
||||
mysql_file_sync(share->kfile, 0);
|
||||
mysql_file_sync(info->dfile, 0);
|
||||
}
|
||||
|
@@ -1551,7 +1551,7 @@ void _mi_unmap_file(MI_INFO *info)
|
||||
{
|
||||
DBUG_ASSERT(info->s->options & HA_OPTION_COMPRESS_RECORD);
|
||||
|
||||
(void) my_munmap((char*) info->s->file_map, (size_t) info->s->mmaped_length);
|
||||
(void) my_munmap((char*) info->s->file_map, info->s->mmaped_length);
|
||||
|
||||
if (myisam_mmap_size != SIZE_T_MAX)
|
||||
{
|
||||
|
@@ -224,7 +224,7 @@ typedef struct st_mi_isam_share
|
||||
THR_LOCK lock;
|
||||
mysql_mutex_t intern_lock; /* Locking for use with _locking */
|
||||
mysql_rwlock_t *key_root_lock;
|
||||
my_off_t mmaped_length;
|
||||
size_t mmaped_length;
|
||||
uint nonmmaped_inserts; /* counter of writing in non-mmaped
|
||||
area */
|
||||
mysql_rwlock_t mmap_lock;
|
||||
|
Reference in New Issue
Block a user