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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
31e20792
Commit
31e20792
authored
Sep 26, 2013
by
Zardosht Kasheff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This checkin was meant for a branch. Undoing
Revert "stuff" This reverts commit
2423c9d0
.
parent
2423c9d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
20 deletions
+7
-20
ft/cachetable-internal.h
ft/cachetable-internal.h
+1
-3
ft/cachetable.cc
ft/cachetable.cc
+6
-17
No files found.
ft/cachetable-internal.h
View file @
31e20792
...
@@ -380,9 +380,7 @@ class pair_list {
...
@@ -380,9 +380,7 @@ class pair_list {
toku_pthread_rwlock_t
m_pending_lock_cheap
;
toku_pthread_rwlock_t
m_pending_lock_cheap
;
void
init
();
void
init
();
void
destroy
();
void
destroy
();
void
evict_completely
(
PAIR
pair
);
void
evict
(
PAIR
pair
);
void
evict_from_cachetable
(
PAIR
pair
);
void
evict_from_cachefile
(
PAIR
pair
);
void
put
(
PAIR
pair
);
void
put
(
PAIR
pair
);
PAIR
find_pair
(
CACHEFILE
file
,
CACHEKEY
key
,
uint32_t
hash
);
PAIR
find_pair
(
CACHEFILE
file
,
CACHEKEY
key
,
uint32_t
hash
);
void
pending_pairs_remove
(
PAIR
p
);
void
pending_pairs_remove
(
PAIR
p
);
...
...
ft/cachetable.cc
View file @
31e20792
...
@@ -534,12 +534,12 @@ static void pair_touch (PAIR p) {
...
@@ -534,12 +534,12 @@ static void pair_touch (PAIR p) {
p
->
count
=
(
p
->
count
<
CLOCK_SATURATION
)
?
p
->
count
+
1
:
CLOCK_SATURATION
;
p
->
count
=
(
p
->
count
<
CLOCK_SATURATION
)
?
p
->
count
+
1
:
CLOCK_SATURATION
;
}
}
// Remove a pair from the cachetable
, requires write list lock to be held and p->mutex to be held
// Remove a pair from the cachetable
// Effects: the pair is removed from the LRU list and from the cachetable's hash table.
// Effects: the pair is removed from the LRU list and from the cachetable's hash table.
// The size of the objects in the cachetable is adjusted by the size of the pair being
// The size of the objects in the cachetable is adjusted by the size of the pair being
// removed.
// removed.
static
void
cachetable_remove_pair
(
pair_list
*
list
,
evictor
*
ev
,
PAIR
p
)
{
static
void
cachetable_remove_pair
(
pair_list
*
list
,
evictor
*
ev
,
PAIR
p
)
{
list
->
evict
_completely
(
p
);
list
->
evict
(
p
);
ev
->
remove_pair_attr
(
p
->
attr
);
ev
->
remove_pair_attr
(
p
->
attr
);
}
}
...
@@ -3250,31 +3250,20 @@ void pair_list::put(PAIR p) {
...
@@ -3250,31 +3250,20 @@ void pair_list::put(PAIR p) {
m_n_in_table
++
;
m_n_in_table
++
;
}
}
// This removes the given pair from
completely from
the pair list.
// This removes the given pair from the pair list.
//
//
// requires caller to have grabbed write lock on list
, and p->mutex held
// requires caller to have grabbed write lock on list
.
//
//
void
pair_list
::
evict_completely
(
PAIR
p
)
{
void
pair_list
::
evict
(
PAIR
p
)
{
this
->
evict_from_cachetable
(
p
);
this
->
evict_from_cachefile
(
p
);
}
// Removes the PAIR from the cachetable's lists,
// but does NOT impact the list maintained by the cachefile
void
pair_list
::
evict_from_cachetable
(
PAIR
p
)
{
this
->
pair_remove
(
p
);
this
->
pair_remove
(
p
);
this
->
pending_pairs_remove
(
p
);
this
->
pending_pairs_remove
(
p
);
this
->
cf_pairs_remove
(
p
);
this
->
remove_from_hash_chain
(
p
);
this
->
remove_from_hash_chain
(
p
);
assert
(
m_n_in_table
>
0
);
assert
(
m_n_in_table
>
0
);
m_n_in_table
--
;
m_n_in_table
--
;
}
}
// Removes the PAIR from the cachefile's list of PAIRs
void
pair_list
::
evict_from_cachefile
(
PAIR
p
)
{
this
->
cf_pairs_remove
(
p
);
}
//
//
// Remove pair from linked list for cleaner/clock
// Remove pair from linked list for cleaner/clock
//
//
...
...
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