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
e2a384eb
Commit
e2a384eb
authored
Dec 11, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: buf_buddy_relocate(): Relocate buf_page_t objects that represent
clean compressed pages (BUF_BLOCK_ZIP_PAGE).
parent
ba1fb955
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
4 deletions
+46
-4
buf/buf0buddy.c
buf/buf0buddy.c
+46
-4
No files found.
buf/buf0buddy.c
View file @
e2a384eb
...
...
@@ -68,6 +68,9 @@ buf_buddy_relocate(
buf_page_t
*
bpage
;
const
ulint
size
=
BUF_BUDDY_LOW
<<
i
;
#ifdef UNIV_SYNC_DEBUG
ut_a
(
mutex_own
(
&
buf_pool
->
mutex
));
#endif
/* UNIV_SYNC_DEBUG */
ut_ad
(
src
==
ut_align_down
(
src
,
size
));
ut_ad
(
dst
==
ut_align_down
(
dst
,
size
));
ut_ad
((((
ulint
)
src
)
^
((
ulint
)
dst
))
==
size
);
...
...
@@ -132,13 +135,52 @@ buf_buddy_relocate(
mutex_enter
(
&
buf_pool
->
zip_mutex
);
if
(
buf_flush_ready_for_replace
(
bpage
))
{
memcpy
(
dst
,
src
,
size
);
/* TODO: relocate bpage->list, bpage->LRU */
buf_page_t
*
dpage
=
(
buf_page_t
*
)
dst
;
buf_page_t
*
b
;
ulint
fold
=
buf_page_address_fold
(
bpage
->
space
,
bpage
->
offset
);
memcpy
(
dpage
,
bpage
,
size
);
/* relocate buf_pool->LRU */
b
=
UT_LIST_GET_PREV
(
LRU
,
bpage
);
UT_LIST_REMOVE
(
LRU
,
buf_pool
->
LRU
,
bpage
);
if
(
b
)
{
UT_LIST_INSERT_AFTER
(
LRU
,
buf_pool
->
LRU
,
b
,
dpage
);
}
else
{
UT_LIST_ADD_FIRST
(
LRU
,
buf_pool
->
LRU
,
dpage
);
}
/* relocate buf_pool->zip_clean */
b
=
UT_LIST_GET_PREV
(
list
,
bpage
);
UT_LIST_REMOVE
(
list
,
buf_pool
->
zip_clean
,
bpage
);
if
(
b
)
{
UT_LIST_INSERT_AFTER
(
list
,
buf_pool
->
zip_clean
,
b
,
dpage
);
}
else
{
UT_LIST_ADD_FIRST
(
list
,
buf_pool
->
zip_clean
,
dpage
);
}
/* relocate buf_pool->page_hash */
HASH_DELETE
(
buf_page_t
,
hash
,
buf_pool
->
page_hash
,
fold
,
bpage
);
HASH_INSERT
(
buf_page_t
,
hash
,
buf_pool
->
page_hash
,
fold
,
dpage
);
}
mutex_exit
(
&
buf_pool
->
zip_mutex
);
/* TODO: return(TRUE); */
break
;
return
(
TRUE
);
}
}
...
...
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