Commit 069178d7 authored by unknown's avatar unknown

Fixed thread specific ID.

Added support for delete by link.
Aded level ("hits") management functions.


storage/maria/ma_pagecache.h:
  Added support for delete by link.
  Aded level ("hits") management functions.
storage/maria/unittest/ma_pagecache_single.c:
  Test of delete by link.
parent e89cc606
This diff is collapsed.
......@@ -283,6 +283,10 @@ extern my_bool pagecache_delete(PAGECACHE *pagecache,
pgcache_page_no_t pageno,
enum pagecache_page_lock lock,
my_bool flush);
extern my_bool pagecache_delete_by_link(PAGECACHE *pagecache,
PAGECACHE_BLOCK_LINK *link,
enum pagecache_page_lock lock,
my_bool flush);
extern my_bool pagecache_delete_pages(PAGECACHE *pagecache,
PAGECACHE_FILE *file,
pgcache_page_no_t pageno,
......@@ -296,6 +300,9 @@ extern my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
extern int reset_pagecache_counters(const char *name, PAGECACHE *pagecache);
extern uchar *pagecache_block_link_to_buffer(PAGECACHE_BLOCK_LINK *block);
extern uint pagacache_pagelevel(PAGECACHE_BLOCK_LINK *block);
extern void pagecache_add_level_by_link(PAGECACHE_BLOCK_LINK *block,
uint level);
/* Functions to handle multiple key caches */
extern my_bool multi_pagecache_init(void);
......
......@@ -453,6 +453,7 @@ int simple_delete_flush_test()
{
unsigned char *buffw= malloc(PAGE_SIZE);
unsigned char *buffr= malloc(PAGE_SIZE);
PAGECACHE_BLOCK_LINK *link;
int res;
DBUG_ENTER("simple_delete_flush_test");
/* prepare the file */
......@@ -462,7 +463,7 @@ int simple_delete_flush_test()
PAGECACHE_LOCK_WRITE,
PAGECACHE_PIN,
PAGECACHE_WRITE_DELAY,
0, LSN_IMPOSSIBLE);
&link, LSN_IMPOSSIBLE);
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
/* test */
bfill(buffw, PAGE_SIZE, '\2');
......@@ -472,12 +473,16 @@ int simple_delete_flush_test()
PAGECACHE_PIN_LEFT_PINNED,
PAGECACHE_WRITE_DELAY,
0, LSN_IMPOSSIBLE);
pagecache_delete(&pagecache, &file1, 0,
PAGECACHE_LOCK_LEFT_WRITELOCKED, 1);
if (pagecache_delete_by_link(&pagecache, link,
PAGECACHE_LOCK_LEFT_WRITELOCKED, 1))
{
diag("simple_delete_flush_test: error during delete");
exit(1);
}
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
ok((res= test(test_file(file1, file1_name, PAGE_SIZE, PAGE_SIZE,
simple_delete_flush_test_file))),
"Simple delete-forget page file");
"Simple delete flush (link) page file");
if (res)
reset_file(&file1, file1_name);
free(buffw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment